- public:
- // algo features
-
- // SMESH_Hypothesis::GetDim();
- // 1 - dimention of target mesh
-
- bool OnlyUnaryInput() const { return _onlyUnaryInput; }
- // 2 - is collection of tesselatable shapes inacceptable as input;
- // "collection" means a shape containing shapes of dim equal
- // to GetDim().
- // Algo which can process a collection shape should expect
- // an input temporary shape that is neither MainShape nor
- // its child.
-
- bool NeedDescretBoundary() const { return _requireDescretBoundary; }
- // 3 - is a Dim-1 mesh prerequisite
-
- protected:
- bool _onlyUnaryInput;
- bool _requireDescretBoundary;
- std::vector<std::string> _compatibleHypothesis;
- std::list<const SMESHDS_Hypothesis *> _appliedHypList;
- std::list<const SMESHDS_Hypothesis *> _usedHypList;
-
- // quadratic mesh creation required
+ /*!
+ * \brief Return true if an edge can be considered as a continuation of another
+ */
+ static bool IsContinuous(const TopoDS_Edge & E1, const TopoDS_Edge & E2) {
+ return ( Continuity( E1, E2 ) >= GeomAbs_G1 );
+ }
+
+ /*!
+ * \brief Return the node built on a vertex
+ * \param V - the vertex
+ * \param meshDS - mesh
+ * \retval const SMDS_MeshNode* - found node or NULL
+ */
+ static const SMDS_MeshNode* VertexNode(const TopoDS_Vertex& V,
+ const SMESHDS_Mesh* meshDS);
+
+protected:
+
+ /*!
+ * \brief store error and comment and then return ( error == COMPERR_OK )
+ */
+ bool error(int error, const SMESH_Comment& comment = "");
+ /*!
+ * \brief store COMPERR_ALGO_FAILED error and comment and then return false
+ */
+ bool error(const SMESH_Comment& comment = "")
+ { return error(COMPERR_ALGO_FAILED, comment); }
+ /*!
+ * \brief store error and return error->IsOK()
+ */
+ bool error(SMESH_ComputeErrorPtr error);
+ /*!
+ * \brief store a bad input element preventing computation,
+ * which may be a temporary one i.e. not residing the mesh,
+ * then it will be deleted by InitComputeError()
+ */
+ void addBadInputElement(const SMDS_MeshElement* elem);
+
+protected:
+
+ std::vector<std::string> _compatibleHypothesis;
+ std::list<const SMESHDS_Hypothesis *> _appliedHypList;
+ std::list<const SMESHDS_Hypothesis *> _usedHypList;
+
+ // Algo features influencing which Compute() and how is called:
+ // in what turn and with what input shape.
+ // This fields must be redefined if necessary by each descendant at constructor.
+ bool _onlyUnaryInput; // mesh one shape of GetDim() at once. Default TRUE
+ bool _requireDescretBoundary; // GetDim()-1 mesh must be present. Default TRUE
+ bool _requireShape; // work with GetDim()-1 mesh bound to geom only. Default TRUE
+ bool _supportSubmeshes; // if !_requireDescretBoundary. Default FALSE
+
+ // quadratic mesh creation required,
+ // is usually set trough SMESH_MesherHelper::IsQuadraticSubMesh()