]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021893: EDF 2133 SMESH : Improvement of 3D extrusion algorithm
authoreap <eap@opencascade.com>
Mon, 28 Jan 2013 08:19:29 +0000 (08:19 +0000)
committereap <eap@opencascade.com>
Mon, 28 Jan 2013 08:19:29 +0000 (08:19 +0000)
Make SubMeshesComputed() public

Make getDependsOnIterator() const

src/SMESH/SMESH_subMesh.cxx
src/SMESH/SMESH_subMesh.hxx

index 270a4f87027045808d07f1b7ca6fd87c7727eb3a..1c03f3fc3e2c3f0381b36b24fae218ff37d9c5c5 100644 (file)
@@ -264,11 +264,11 @@ bool SMESH_subMesh::IsMeshComputed() const
 
 //=============================================================================
 /*!
- *
+ * Return true if all sub-meshes have been meshed
  */
 //=============================================================================
 
-bool SMESH_subMesh::subMeshesComputed()
+bool SMESH_subMesh::SubMeshesComputed() const
 {
   int myDim = SMESH_Gen::GetShapeDim( _subShape );
   int dimToCheck = myDim - 1;
@@ -1398,7 +1398,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event)
           if (!algo->OnlyUnaryInput())
             shape = getCollection( gen, algo, subComputed );
           else
-            subComputed = subMeshesComputed();
+            subComputed = SubMeshesComputed();
           ret = ( algo->NeedDiscreteBoundary() ? subComputed :
                   algo->SupportSubmeshes() ? true :
                   ( !subComputed || _father->IsNotConformAllowed() ));
@@ -1953,7 +1953,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
                                           SMESH_Algo* theAlgo,
                                           bool &      theSubComputed)
 {
-  theSubComputed = subMeshesComputed();
+  theSubComputed = SubMeshesComputed();
 
   TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh();
 
@@ -1986,7 +1986,7 @@ TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
       if (strcmp( anAlgo->GetName(), theAlgo->GetName()) == 0 && // same algo
           anAlgo->GetUsedHypothesis( *_father, S, ignoreAuxiliaryHyps ) == aUsedHyp) // same hyps
         aBuilder.Add( aCompound, S );
-      if ( !subMesh->subMeshesComputed() )
+      if ( !subMesh->SubMeshesComputed() )
         theSubComputed = false;
     }
   }
@@ -2362,22 +2362,23 @@ namespace {
 //================================================================================
 
 SMESH_subMeshIteratorPtr SMESH_subMesh::getDependsOnIterator(const bool includeSelf,
-                                                             const bool reverse)
+                                                             const bool reverse) const
 {
+  SMESH_subMesh *me = (SMESH_subMesh*) this;
   SMESH_subMesh *prepend=0, *append=0;
   if ( includeSelf ) {
-    if ( reverse ) prepend = this;
-    else            append = this;
+    if ( reverse ) prepend = me;
+    else            append = me;
   }
   typedef map < int, SMESH_subMesh * > TMap;
   if ( reverse )
   {
     return SMESH_subMeshIteratorPtr
-      ( new _Iterator( new SMDS_mapReverseIterator<TMap>( DependsOn() ), prepend, append ));
+      ( new _Iterator( new SMDS_mapReverseIterator<TMap>( me->DependsOn() ), prepend, append ));
   }
   {
     return SMESH_subMeshIteratorPtr
-      ( new _Iterator( new SMDS_mapIterator<TMap>( DependsOn() ), prepend, append ));
+      ( new _Iterator( new SMDS_mapIterator<TMap>( me->DependsOn() ), prepend, append ));
   }
 }
 
index 43b8349f1b032c0dae5bf02b7e49d1b9ebb7d4c8..0c956cea623af7fa8627fde9e16b659e71c95be7 100644 (file)
@@ -84,7 +84,7 @@ class SMESH_EXPORT SMESH_subMesh
    * \brief Return iterator on the submeshes this one depends on
    */
   SMESH_subMeshIteratorPtr getDependsOnIterator(const bool includeSelf,
-                                                const bool complexShapeFirst);
+                                                const bool complexShapeFirst) const;
 
   const TopoDS_Shape & GetSubShape() const;
 
@@ -253,6 +253,8 @@ public:
   void SetIsAlwaysComputed(bool isAlCo);
   bool IsAlwaysComputed() { return _alwaysComputed; }
 
+  bool SubMeshesComputed() const;
+
   
   /*!
    * \brief  Find common submeshes (based on shared subshapes with other
@@ -267,9 +269,6 @@ protected:
   // ==================================================================
   void insertDependence(const TopoDS_Shape aSubShape);
 
-  bool subMeshesComputed();
-  //bool SubMeshesReady();
-
   void removeSubMeshElementsAndNodes();
   void updateDependantsState(const compute_event theEvent);
   void updateSubMeshState(const compute_state theState);