Salome HOME
Bug NPAL12872 - EDF189 GEOM, SMESH : Visualization of groups with many colors
[modules/smesh.git] / src / SMESH / SMESH_Mesh.hxx
index 35bd13d506d37437e38541e17558adc3e0d86581..d7b86da5d0daefec1a7495d8a2c75c5b9b7114e5 100644 (file)
@@ -72,25 +72,40 @@ class SMESH_Group;
 class TopTools_ListOfShape;
 class SMESH_subMesh;
 class SMESH_HypoFilter;
+class TopoDS_Solid;
 
-//typedef NMTTools_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain;
 typedef SMESH_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain;
 
 class SMESH_EXPORT SMESH_Mesh
 {
-  SMESH_Mesh();
-  SMESH_Mesh(const SMESH_Mesh&);
 public:
-  SMESH_Mesh(int theLocalId, 
-            int theStudyId, 
-            SMESH_Gen* theGen,
-            bool theIsEmbeddedMode,
+  SMESH_Mesh(int               theLocalId, 
+            int               theStudyId, 
+            SMESH_Gen*        theGen,
+            bool              theIsEmbeddedMode,
             SMESHDS_Document* theDocument);
   
   virtual ~SMESH_Mesh();
   
+  /*!
+   * \brief Set geometry to be meshed
+   */
   void ShapeToMesh(const TopoDS_Shape & aShape);
-  
+  /*!
+   * \brief Return geometry to be meshed. (It may be a PseudoShape()!)
+   */
+  TopoDS_Shape GetShapeToMesh() const;
+  /*!
+   * \brief Return true if there is a geometry to be meshed, not PseudoShape()
+   */
+  bool HasShapeToMesh() const { return _isShapeToMesh; }
+  /*!
+   * \brief Return a solid which is returned by GetShapeToMesh() if
+   *        a real geometry to be meshed was not set
+   */
+  static const TopoDS_Solid& PseudoShape();
+
+
   int UNVToMesh(const char* theFileName);
   /*!
    * consult DriverMED_R_SMESHDS_Mesh::ReadStatus for returned value
@@ -124,11 +139,11 @@ public:
   
   void ClearLog() throw(SALOME_Exception);
   
-  int GetId();
+  int GetId()                { return _id; }
   
-  SMESHDS_Mesh * GetMeshDS();
+  SMESHDS_Mesh * GetMeshDS() { return _myMeshDS; }
   
-  SMESH_Gen *GetGen();
+  SMESH_Gen *GetGen()        { return _gen; }
   
   SMESH_subMesh *GetSubMesh(const TopoDS_Shape & aSubShape)
     throw(SALOME_Exception);
@@ -159,6 +174,10 @@ public:
   // return list of ancestors of theSubShape in the order
   // that lower dimention shapes come first.
 
+  void SetAutoColor(bool theAutoColor) throw(SALOME_Exception);
+
+  bool GetAutoColor() throw(SALOME_Exception);
+
   /*! Check group names for duplications.
    *  Consider maximum group name length stored in MED file.
    */
@@ -176,34 +195,25 @@ public:
   
   int NbNodes() throw(SALOME_Exception);
   
-  /*!
-   * ElementOrder points out entities of what order are requested
-   */
-  enum ElementOrder {
-    ORDER_ANY,          /*! entities of any order */
-    ORDER_LINEAR,       /*! entities of 1st order */
-    ORDER_QUADRATIC     /*! entities of 2nd order */
-  };
-
-  int NbEdges(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbFaces(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbTriangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbQuadrangles(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
 
   int NbPolygons() throw(SALOME_Exception);
   
-  int NbVolumes(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbTetras(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbHexas(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
-  int NbPyramids(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
 
-  int NbPrisms(ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
+  int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) throw(SALOME_Exception);
   
   int NbPolyhedrons() throw(SALOME_Exception);
   
@@ -222,30 +232,7 @@ public:
   
   void RemoveGroup (const int theGroupID);
 
-  // Propagation hypothesis management
-
-  const SMESH_Hypothesis* IsLocal1DHypothesis (const TopoDS_Shape& theEdge);
-  // Returns a local 1D hypothesis used for theEdge.
-
-  bool IsPropagationHypothesis (const TopoDS_Shape& theEdge);
-  // Returns true, if a local Propagation hypothesis is set directly on <theEdge>
-
-  bool IsPropagatedHypothesis (const TopoDS_Shape& theEdge,
-                               TopoDS_Shape&       theMainEdge);
-  // Returns true, if a local 1D hypothesis is
-  // propagated on <theEdge> from some other edge.
-  // Returns through <theMainEdge> the edge, from
-  // which the 1D hypothesis is propagated on <theEdge>
-
-  bool IsReversedInChain (const TopoDS_Shape& theEdge,
-                          const TopoDS_Shape& theMainEdge);
-  // Returns true if theEdge should be reversed to be
-  // co-directed with theMainEdge
-
-  bool RebuildPropagationChains();
-  bool RemovePropagationChain (const TopoDS_Shape& theMainEdge);
-  bool BuildPropagationChain (const TopoDS_Shape& theMainEdge);
-  
   SMDSAbs_ElementType GetElementType( const int id, const bool iselem );
 
   //
@@ -253,11 +240,8 @@ public:
   ostream& Dump(ostream & save);
   
 private:
-  // Propagation hypothesis management
-  void CleanMeshOnPropagationChain(const TopoDS_Shape& theMainEdge);
-  //
   
-private:
+protected:
   int                        _id;           // id given by creator (unique within the creator instance)
   int                        _studyId;
   int                        _idDoc;        // id given by SMESHDS_Document
@@ -269,10 +253,14 @@ private:
   map <int, SMESH_subMesh *> _mapSubMesh;
   map <int, SMESH_Group *>   _mapGroup;
   SMESH_Gen *                _gen;
+
+  bool                       _isAutoColor;
   
   TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors;
 
-  IndexedMapOfChain _mapPropagationChains; // Propagation hypothesis management
+protected:
+  SMESH_Mesh() {};
+  SMESH_Mesh(const SMESH_Mesh&) {};
 };
 
 #endif