From: eap Date: Mon, 28 Jan 2013 08:12:41 +0000 (+0000) Subject: 0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm X-Git-Tag: pluginMGCleaner~169 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3a627861584e456ed8beab8e9b145c8cafd0e4bd;p=modules%2Fsmesh.git 0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm + bool NeedLowerHyps(int dim) const { return _neededLowerHyps[ dim ]; } + void addBadInputElements(const SMESHDS_SubMesh* sm, + const bool addNodes=false); + bool _neededLowerHyps[4]; // hyp dims needed by algo that !NeedDiscreteBoundary(). Df. FALSE --- diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index f7bd7f9bf..ac294864b 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -87,6 +87,8 @@ SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen) _onlyUnaryInput = _requireDiscreteBoundary = _requireShape = true; _quadraticMesh = _supportSubmeshes = false; _error = COMPERR_OK; + for ( int i = 0; i < 4; ++i ) + _neededLowerHyps[ i ] = false; } //============================================================================= @@ -823,19 +825,42 @@ void SMESH_Algo::addBadInputElement(const SMDS_MeshElement* elem) _badInputElements.push_back( elem ); } +//======================================================================= +//function : addBadInputElements +//purpose : store a bad input elements or nodes preventing computation +//======================================================================= + +void SMESH_Algo::addBadInputElements(const SMESHDS_SubMesh* sm, + const bool addNodes) +{ + if ( sm ) + { + if ( addNodes ) + { + SMDS_NodeIteratorPtr nIt = sm->GetNodes(); + while ( nIt->more() ) addBadInputElement( nIt->next() ); + } + else + { + SMDS_ElemIteratorPtr eIt = sm->GetElements(); + while ( eIt->more() ) addBadInputElement( eIt->next() ); + } + } +} + //============================================================================= /*! * */ //============================================================================= -int SMESH_Algo::NumberOfWires(const TopoDS_Shape& S) -{ - int i = 0; - for (TopExp_Explorer exp(S,TopAbs_WIRE); exp.More(); exp.Next()) - i++; - return i; -} +// int SMESH_Algo::NumberOfWires(const TopoDS_Shape& S) +// { +// int i = 0; +// for (TopExp_Explorer exp(S,TopAbs_WIRE); exp.More(); exp.Next()) +// i++; +// return i; +// } //============================================================================= /*! diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 1a3be0876..76f6de979 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -43,17 +43,18 @@ #include #include +class SMDS_MeshNode; +class SMESHDS_Mesh; +class SMESHDS_SubMesh; class SMESH_Gen; -class SMESH_Mesh; class SMESH_HypoFilter; -class TopoDS_Vertex; -class TopoDS_Wire; +class SMESH_Mesh; +class SMESH_MesherHelper; +class SMESH_subMesh; class TopoDS_Face; class TopoDS_Shape; -class SMESHDS_Mesh; -class SMDS_MeshNode; -class SMESH_subMesh; -class SMESH_MesherHelper; +class TopoDS_Vertex; +class TopoDS_Wire; class gp_XYZ; typedef std::map< SMESH_subMesh*, std::vector > MapShapeNbElems; @@ -231,6 +232,10 @@ public: bool SupportSubmeshes() const { return _supportSubmeshes; } // 5 - whether supports submeshes if !NeedDiscreteBoundary() + bool NeedLowerHyps(int dim) const { return _neededLowerHyps[ dim ]; } + // 6 - if algo !NeedDiscreteBoundary() but requires presence of + // hypotheses of dimension to generate all-dimensional mesh. + // This info is used not to issue warnings on hiding of lower global algos. public: // ================================================================== @@ -302,7 +307,7 @@ public: */ static bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true); - static int NumberOfWires(const TopoDS_Shape& S); + //static int NumberOfWires(const TopoDS_Shape& S); int NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W); /*! @@ -363,6 +368,9 @@ public: */ void addBadInputElement(const SMDS_MeshElement* elem); + void addBadInputElements(const SMESHDS_SubMesh* sm, + const bool addNodes=false); + protected: std::vector _compatibleHypothesis; @@ -373,9 +381,10 @@ protected: // in what turn and with what input shape. // These fields must be redefined if necessary by each descendant at constructor. bool _onlyUnaryInput; // mesh one shape of GetDim() at once. Default TRUE - bool _requireDiscreteBoundary; // GetDim()-1 mesh must be present. Default TRUE + bool _requireDiscreteBoundary;// GetDim()-1 mesh must be present. Default TRUE bool _requireShape; // work with GetDim()-1 mesh bound to geom only. Default TRUE bool _supportSubmeshes; // if !_requireDiscreteBoundary. Default FALSE + bool _neededLowerHyps[4]; // hyp dims needed by algo that !NeedDiscreteBoundary(). Df. FALSE // indicates if quadratic mesh creation is required, // is usually set like this: _quadraticMesh = SMESH_MesherHelper::IsQuadraticSubMesh(shape)