28 #ifndef _SMESH_ALGO_HXX_
29 #define _SMESH_ALGO_HXX_
37 #include <TopoDS_Shape.hxx>
38 #include <TopoDS_Edge.hxx>
39 #include <GeomAbs_Shape.hxx>
79 virtual std::ostream &
SaveTo(std::ostream & save);
86 virtual std::istream &
LoadFrom(std::istream & load);
91 const std::vector < std::string > & GetCompatibleHypothesis();
100 virtual bool CheckHypothesis(
SMESH_Mesh& aMesh,
138 virtual const std::list <const SMESHDS_Hypothesis *> &
141 const bool ignoreAuxiliary=
true);
153 const std::list <const SMESHDS_Hypothesis *> &
156 const bool ignoreAuxiliary=
true);
164 const bool ignoreAuxiliary)
const;
180 void InitComputeError();
243 static bool GetNodeParamOnEdge(
const SMESHDS_Mesh* theMesh,
244 const TopoDS_Edge& theEdge,
245 std::vector< double > & theParams);
255 static bool GetSortedNodesOnEdge(
const SMESHDS_Mesh* theMesh,
256 const TopoDS_Edge& theEdge,
257 const bool ignoreMediumNodes,
258 std::map< double, const SMDS_MeshNode* > & theNodes);
267 static bool IsReversedSubMesh (
const TopoDS_Face& theFace,
274 static double EdgeLength(
const TopoDS_Edge & E);
282 static GeomAbs_Shape Continuity(
const TopoDS_Edge & E1,
const TopoDS_Edge & E2);
287 static bool IsContinuous(
const TopoDS_Edge & E1,
const TopoDS_Edge & E2) {
288 return ( Continuity( E1, E2 ) >= GeomAbs_G1 );
297 static const SMDS_MeshNode* VertexNode(
const TopoDS_Vertex& V,
std::list< const SMDS_MeshElement * > _badInputElements
to explain COMPERR_BAD_INPUT_MESH
std::list< const SMESHDS_Hypothesis * > _usedHypList
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
int _error
SMESH_ComputeErrorName or anything algo specific.
std::string _comment
any text explaining what is wrong in Compute()
bool NeedDescretBoundary() const
bool SupportSubmeshes() const
static bool IsContinuous(const TopoDS_Edge &E1, const TopoDS_Edge &E2)
Return true if an edge can be considered as a continuation of another.
bool OnlyUnaryInput() const
virtual std::istream & LoadFrom(std::istream &load)=0
virtual bool SetParametersByDefaults(const TDefaults &dflts, const SMESH_Mesh *theMesh=0)=0
Initialize my parameter values by default parameters.
virtual std::ostream & SaveTo(std::ostream &save)=0
virtual bool SetParametersByMesh(const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)=0
Initialize my parameter values by the mesh built on the geometry.
std::vector< std::string > _compatibleHypothesis
bool error(const SMESH_Comment &comment="")
store COMPERR_ALGO_FAILED error and comment and then return false
bool _requireDescretBoundary
std::list< const SMESHDS_Hypothesis * > _appliedHypList
algo failed for some reason