Go to the documentation of this file.
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>
82 virtual std::ostream &
SaveTo(std::ostream & save);
89 virtual std::istream &
LoadFrom(std::istream & load);
104 const TopoDS_Shape& aShape,
151 virtual const std::list <const SMESHDS_Hypothesis *> &
153 const TopoDS_Shape & aShape,
154 const bool ignoreAuxiliary=
true);
166 const std::list <const SMESHDS_Hypothesis *> &
168 const TopoDS_Shape & aShape,
169 const bool ignoreAuxiliary=
true);
177 const bool ignoreAuxiliary)
const;
254 const TopoDS_Edge& theEdge,
255 std::vector< double > & theParams);
265 const TopoDS_Edge& theEdge,
266 const bool ignoreMediumNodes,
267 std::map< double, const SMDS_MeshNode* > & theNodes);
290 static GeomAbs_Shape
Continuity(
const TopoDS_Edge & E1,
const TopoDS_Edge & E2);
295 static bool IsContinuous(
const TopoDS_Edge & E1,
const TopoDS_Edge & E2) {
296 return ( Continuity( E1, E2 ) >= GeomAbs_G1 );
std::list< const SMESHDS_Hypothesis * > _appliedHypList
const std::list< const SMESHDS_Hypothesis * > & GetAppliedHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
Returns a list of compatible hypotheses assigned to a shape in a mesh.
static bool GetNodeParamOnEdge(const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, std::vector< double > &theParams)
Fill vector of node parameters on geometrical edge, including vertex nodes.
std::list< const SMDS_MeshElement * > _badInputElements
to explain COMPERR_BAD_INPUT_MESH
virtual std::istream & LoadFrom(std::istream &load)
Loads nothing from a stream.
virtual const std::list< const SMESHDS_Hypothesis * > & GetUsedHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const bool ignoreAuxiliary=true)
Returns a list of compatible hypotheses used to mesh a shape.
void addBadInputElement(const SMDS_MeshElement *elem)
store a bad input element preventing computation, which may be a temporary one i.e....
virtual void SetEventListener(SMESH_subMesh *subMesh)
Sets event listener to submeshes if necessary.
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0
Check hypothesis definition to mesh a shape.
bool error(SMESH_ComputeErrorPtr error)
store error and return error->IsOK()
virtual ~ SMESH_Algo()
Destructor.
virtual bool Compute(SMESH_Mesh &aMesh, SMESH_MesherHelper *aHelper)
Computes mesh without geometry.
@ COMPERR_ALGO_FAILED
algo failed for some reason
int _error
SMESH_ComputeErrorName or anything algo specific.
bool SupportSubmeshes() const
virtual bool Evaluate(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)=0
evaluates size of prospective mesh on a shape
bool NeedDescretBoundary() const
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0
Computes mesh on a shape.
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
bool OnlyUnaryInput() const
static double EdgeLength(const TopoDS_Edge &E)
Compute length of an edge.
SMESH_ComputeErrorPtr GetComputeError() const
return compute error
SMESH_Algo(int hypId, int studyId, SMESH_Gen *gen)
Creates algorithm.
static const SMDS_MeshNode * VertexNode(const TopoDS_Vertex &V, const SMESHDS_Mesh *meshDS)
Return the node built on a vertex.
bool InitCompatibleHypoFilter(SMESH_HypoFilter &theFilter, const bool ignoreAuxiliary) const
Make the filter recognize only compatible hypotheses.
static bool IsContinuous(const TopoDS_Edge &E1, const TopoDS_Edge &E2)
Return true if an edge can be considered as a continuation of another.
virtual std::ostream & SaveTo(std::ostream &save)
Saves nothing in a stream.
virtual bool SetParametersByDefaults(const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
Initialize my parameter values by default parameters.
std::map< SMESH_subMesh *, std::vector< int > > MapShapeNbElems
std::string _comment
any text explaining what is wrong in Compute()
static GeomAbs_Shape Continuity(const TopoDS_Edge &E1, const TopoDS_Edge &E2)
Return continuity of two edges.
static bool IsReversedSubMesh(const TopoDS_Face &theFace, SMESHDS_Mesh *theMeshDS)
Find out elements orientation on a geometrical face.
bool _requireDescretBoundary
bool error(int error, const SMESH_Comment &comment="")
store error and comment and then return ( error == COMPERR_OK )
static bool GetSortedNodesOnEdge(const SMESHDS_Mesh *theMesh, const TopoDS_Edge &theEdge, const bool ignoreMediumNodes, std::map< double, const SMDS_MeshNode * > &theNodes)
Fill map of node parameter on geometrical edge to node it-self.
virtual bool SetParametersByMesh(const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
Just return false as the algorithm does not hold parameters values.
std::vector< std::string > _compatibleHypothesis
std::map< SMESH_subMesh *, std::vector< int > >::iterator MapShapeNbElemsItr
const std::vector< std::string > & GetCompatibleHypothesis()
Returns all types of compatible hypotheses.
void InitComputeError()
initialize compute error
virtual void SubmeshRestored(SMESH_subMesh *subMesh)
Allow algo to do something after persistent restoration.
bool error(const SMESH_Comment &comment="")
store COMPERR_ALGO_FAILED error and comment and then return false
std::list< const SMESHDS_Hypothesis * > _usedHypList