Salome HOME
0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm
authoreap <eap@opencascade.com>
Mon, 28 Jan 2013 08:12:41 +0000 (08:12 +0000)
committereap <eap@opencascade.com>
Mon, 28 Jan 2013 08:12:41 +0000 (08:12 +0000)
+  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

src/SMESH/SMESH_Algo.cxx
src/SMESH/SMESH_Algo.hxx

index f7bd7f9bf3b2bf85824bab37264a6da3a0453e12..ac294864b2a4bf35362f1a99e99488ea3ff33d17 100644 (file)
@@ -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;
+// }
 
 //=============================================================================
 /*!
index 1a3be0876eb8dc012a137455948ae486836bff51..76f6de97957d6168ffd8a7d2ada8f59598e06321 100644 (file)
 #include <list>
 #include <map>
 
+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<int> >           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 <dim> 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<std::string>              _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)