28 #ifndef _SMESH_ALGO_HXX_
29 #define _SMESH_ALGO_HXX_
38 #include <GeomAbs_Shape.hxx>
39 #include <TopoDS_Shape.hxx>
94 bool IsCompatible(
const Features& algo2 )
const;
99 static const Features& GetFeatures(
const std::string& algoType );
121 virtual std::ostream &
SaveTo(std::ostream & save);
128 virtual std::istream &
LoadFrom(std::istream & load);
133 const std::vector < std::string > & GetCompatibleHypothesis();
145 const TopoDS_Shape& aShape,
176 virtual bool IsApplicableToShape(
const TopoDS_Shape & shape,
bool toCheckAll)
const;
182 virtual void CancelCompute();
187 virtual double GetProgress()
const;
212 virtual const std::list <const SMESHDS_Hypothesis *> &
214 const TopoDS_Shape & aShape,
215 const bool ignoreAuxiliary=
true)
const;
219 virtual const std::list < TopoDS_Shape > & GetAssignedShapes()
const;
225 const SMESH_HypoFilter* GetCompatibleHypoFilter(
const bool ignoreAuxiliary)
const;
240 void InitComputeError();
244 double GetProgressByTic()
const;
319 static bool GetNodeParamOnEdge(
const SMESHDS_Mesh* theMesh,
320 const TopoDS_Edge& theEdge,
321 std::vector< double > & theParams);
332 static bool GetSortedNodesOnEdge(
const SMESHDS_Mesh* theMesh,
333 const TopoDS_Edge& theEdge,
334 const bool ignoreMediumNodes,
335 std::map< double, const SMDS_MeshNode* > & theNodes,
343 static double EdgeLength(
const TopoDS_Edge & E);
345 smIdType NumberOfPoints(
SMESH_Mesh& aMesh,
const TopoDS_Wire& W);
353 static GeomAbs_Shape Continuity(
const TopoDS_Edge& E1,
const TopoDS_Edge& E2);
358 static bool IsContinuous(
const TopoDS_Edge & E1,
const TopoDS_Edge & E2) {
359 return ( Continuity( E1, E2 ) >= GeomAbs_G1 );
364 static bool IsStraight(
const TopoDS_Edge & E,
const bool degenResult=
false );
368 static bool isDegenerated(
const TopoDS_Edge & E,
const bool checkLength=
false );
396 static const SMDS_MeshNode* VertexNode(
const TopoDS_Vertex& V,
399 const bool checkV=
true);
401 enum EMeshError { MEr_OK = 0, MEr_HOLES, MEr_BAD_ORI, MEr_EMPTY };
431 const bool addNodes=
false);
449 bool _neededLowerHyps[4];
486 virtual bool IsApplicableToShape(
const TopoDS_Shape & shape,
bool toCheckAll)
const;
500 virtual bool IsApplicableToShape(
const TopoDS_Shape & shape,
bool toCheckAll)
const;
507 const TopoDS_Face& face);
521 virtual bool IsApplicableToShape(
const TopoDS_Shape & shape,
bool toCheckAll)
const;
SMDSAbs_ElementType
Type (node, edge, face or volume) of elements.
Definition: SMDSAbs_ElementType.hxx:34
@ SMDSAbs_All
Definition: SMDSAbs_ElementType.hxx:35
std::map< SMESH_subMesh *, std::vector< smIdType > > MapShapeNbElems
Definition: SMESH_Algo.hxx:61
std::map< SMESH_subMesh *, std::vector< smIdType > >::iterator MapShapeNbElemsItr
Definition: SMESH_Algo.hxx:64
@ COMPERR_ALGO_FAILED
algo failed for some reason
Definition: SMESH_ComputeError.hxx:53
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Definition: SMESH_ComputeError.hxx:36
#define SMESH_EXPORT
Definition: SMESH_SMESH.hxx:37
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Definition: SMDS_MeshNode.hxx:36
Definition: SMDS_Mesh.hxx:53
virtual std::ostream & SaveTo(std::ostream &save)=0
virtual std::istream & LoadFrom(std::istream &load)=0
Definition: SMESHDS_Mesh.hxx:68
Definition: SMESHDS_SubMesh.hxx:48
Definition: SMESH_Algo.hxx:470
Definition: SMESH_Algo.hxx:476
Definition: SMESH_Algo.hxx:490
Definition: SMESH_Algo.hxx:511
Root of all algorithms.
Definition: SMESH_Algo.hxx:79
bool _supportSubmeshes
Definition: SMESH_Algo.hxx:448
std::list< TopoDS_Shape > _assigedShapeList
Definition: SMESH_Algo.hxx:439
bool NeedDiscreteBoundary() const
Definition: SMESH_Algo.hxx:267
double _progress
Definition: SMESH_Algo.hxx:462
bool _requireShape
Definition: SMESH_Algo.hxx:447
virtual bool Evaluate(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)=0
evaluates size of prospective mesh on a shape
const SMDS_Mesh * _mesh
mesh being computed, needed to create SMESH_BadInputElements
Definition: SMESH_Algo.hxx:458
std::list< const SMESHDS_Hypothesis * > _usedHypList
Definition: SMESH_Algo.hxx:438
EMeshError
Definition: SMESH_Algo.hxx:401
int _progressTic
Definition: SMESH_Algo.hxx:464
bool SupportSubmeshes() const
Definition: SMESH_Algo.hxx:273
bool _quadraticMesh
Definition: SMESH_Algo.hxx:453
volatile bool _computeCanceled
is set to True while computing to stop it
Definition: SMESH_Algo.hxx:460
bool NeedShape() const
Definition: SMESH_Algo.hxx:270
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)=0
Check hypothesis definition to mesh a shape.
int _error
SMESH_ComputeErrorName or anything algo specific.
Definition: SMESH_Algo.hxx:455
std::list< const SMDS_MeshElement * > _badInputElements
to explain COMPERR_BAD_INPUT_MESH
Definition: SMESH_Algo.hxx:457
const SMESH_HypoFilter * _compatibleAllHypFilter
Definition: SMESH_Algo.hxx:435
std::vector< SMESH_subMesh * > _smToCompute
Definition: SMESH_Algo.hxx:465
static bool IsContinuous(const TopoDS_Edge &E1, const TopoDS_Edge &E2)
Return true if an edge can be considered as a continuation of another.
Definition: SMESH_Algo.hxx:358
bool NeedLowerHyps(int dim) const
Definition: SMESH_Algo.hxx:276
std::vector< SMESH_subMesh * > & SubMeshesToCompute()
Return a vector of sub-meshes to Compute()
Definition: SMESH_Algo.hxx:248
bool error(const SMESH_Comment &comment="")
store COMPERR_ALGO_FAILED error and comment and then return false
Definition: SMESH_Algo.hxx:417
virtual void setSubMeshesToCompute(SMESH_subMesh *aSubMesh)
Definition: SMESH_Algo.hxx:282
bool OnlyUnaryInput() const
Definition: SMESH_Algo.hxx:259
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)=0
Computes mesh on a shape.
bool _onlyUnaryInput
Definition: SMESH_Algo.hxx:445
std::string _comment
any text explaining what is wrong in Compute()
Definition: SMESH_Algo.hxx:456
const SMESH_HypoFilter * _compatibleNoAuxHypFilter
Definition: SMESH_Algo.hxx:436
virtual ~ SMESH_Algo()
Destructor.
std::vector< std::string > _compatibleHypothesis
Definition: SMESH_Algo.hxx:437
const Features & GetFeatures() const
Definition: SMESH_Algo.hxx:100
bool _requireDiscreteBoundary
Definition: SMESH_Algo.hxx:446
Definition: SMESH_Gen.hxx:68
Definition: SMESH_HypoFilter.hxx:57
Definition: SMESH_Hypothesis.hxx:48
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
virtual bool SetParametersByDefaults(const TDefaults &dflts, const SMESH_Mesh *theMesh=0)=0
Initialize my parameter values by default parameters.
virtual bool SetParametersByMesh(const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)=0
Initialize my parameter values by the mesh built on the geometry.
Definition: SMESH_Mesh.hxx:80
It helps meshers to add elements and provides other utilities.
Definition: SMESH_MesherHelper.hxx:84
Container of xD mesh elements substituting other ones in the input mesh of an (x+1)D algorithm.
Definition: SMESH_ProxyMesh.hxx:51
Definition: SMESH_subMesh.hxx:61
void SetEventListener(SMESH_subMesh *subMesh, TopoDS_Shape srcShape, SMESH_Mesh *srcMesh)
Set event listeners to submesh with projection algo.
Definition: StdMeshers_ProjectionUtils.cxx:2546
Structure describing algorithm features.
Definition: SMESH_Algo.hxx:87
std::set< SMDSAbs_GeometryType > _inElemTypes
Definition: SMESH_Algo.hxx:89
std::set< SMDSAbs_GeometryType > _outElemTypes
Definition: SMESH_Algo.hxx:90
std::string _label
Definition: SMESH_Algo.hxx:91
int _dim
Definition: SMESH_Algo.hxx:88
Features()
Definition: SMESH_Algo.hxx:93
Definition: SMESH_Hypothesis.hxx:100