Salome HOME
[bos #20282] EDF 22320 - general compute fails
[modules/smesh.git] / src / SMESH / SMESH_subMesh.hxx
index 3d26972411c1d608281f2d65ebcbad36789f47e5..a2eef50b11898393fc29623c061129fdfbe58f6d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -36,6 +36,7 @@
 #include "Utils_SALOME_Exception.hxx"
 
 #include <TopoDS_Shape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 
 #include <list>
 #include <map>
@@ -48,7 +49,7 @@ class SMESH_Hypothesis;
 class SMESH_Mesh;
 class SMESH_subMesh;
 class SMESH_subMeshEventListener;
-class SMESH_subMeshEventListenerData;
+struct SMESH_subMeshEventListenerData;
 
 typedef SMESH_subMeshEventListener     EventListener;
 typedef SMESH_subMeshEventListenerData EventListenerData;
@@ -126,7 +127,7 @@ class SMESH_EXPORT SMESH_subMesh
   // ==================================================================
 
   /*!
-   * \brief Sets an event listener and its data to a submesh
+   * \brief Set an event listener and its data to a submesh
     * \param listener - the listener to store
     * \param data - the listener data to store
     * \param where - the submesh to store the listener and it's data
@@ -256,12 +257,21 @@ public:
   bool IsMeshComputed() const;
   // check if _subMeshDS contains mesh elements unless _alwaysComputed==true
 
+  bool IsComputedPartially() const;
+  // check if any upper level sub-shape is not computed
+
+  /*!
+   * \brief Set sub-shapes that are allowed to compute at once by a multidimensional algo
+   */
+  void SetAllowedSubShapes( const TopTools_IndexedMapOfShape* subShapes )
+  { _allowedSubShapes = subShapes; }
+
   /*!
    * \brief Allow algo->Compute() if a subshape of lower dim is meshed but
    *        none mesh entity is bound to it
    */
   void SetIsAlwaysComputed(bool isAlCo);
-  bool IsAlwaysComputed() { return _alwaysComputed; }
+  bool IsAlwaysComputed() const { return _alwaysComputed; }
 
   bool SubMeshesComputed(bool * isFailedToCompute=0) const;
 
@@ -332,6 +342,7 @@ protected:
   std::vector< SMESH_subMesh * >   _ancestors;
 
   SMESH_Algo *          _algo; // the algorithm found by last *StateEngine() call
+  TopoDS_Shape          _algoShape; // shape the algorithm is assigned to
   algo_state            _algoState;
   compute_state         _computeState;
   SMESH_ComputeErrorPtr _computeError;
@@ -343,6 +354,8 @@ protected:
   // mesh several edges as a whole and leave some of them  without mesh entities
   bool                  _alwaysComputed;
 
+  const TopTools_IndexedMapOfShape* _allowedSubShapes; // allowed to be returned by getCollection()
+
 };
 
 #endif