Salome HOME
fix bug 11943 TC: Wrong nodal connectivity of hexahedrons imported from UNV format...
[modules/smesh.git] / src / SMDS / SMDS_VolumeTool.hxx
index 99e7dc1763800377f1cd6a851f6fcac4da59635b..b5528c10eae7ea082cbc59beb8b1e24578b983b3 100644 (file)
 
 class SMDS_MeshElement;
 class SMDS_MeshNode;
+class SMDS_PolyhedralVolumeOfNodes;
 
 #include <vector>
 #include <set>
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
 // =========================================================================
 //
 // Class providing topological and other information about SMDS_MeshVolume:
@@ -44,10 +57,13 @@ class SMDS_MeshNode;
 //
 // =========================================================================
 
-class SMDS_VolumeTool
+class SMDS_WNT_EXPORT SMDS_VolumeTool
 {
  public:
 
+  enum VolumeType { UNKNOWN = -1, TETRA = 0, PYRAM, PENTA, HEXA, QUAD_TETRA,
+                    QUAD_PYRAM, QUAD_PENTA, QUAD_HEXA, POLYHEDA };
+
   SMDS_VolumeTool ();
   ~SMDS_VolumeTool ();
   SMDS_VolumeTool (const SMDS_MeshElement* theVolume);
@@ -60,6 +76,8 @@ class SMDS_VolumeTool
   // general info
   // -----------------------
 
+  VolumeType GetVolumeType() const;
+
   bool IsForward() const { return myVolForward; }
   // Check volume orientation. can be changed by Inverse().
   // See node order of forward volumes at the file bottom
@@ -149,26 +167,50 @@ class SMDS_VolumeTool
   // Return index of a face formed by theFaceNodes.
   // Return -1 if a face not found
 
-  int GetFaceIndex( const std::set<int>& theFaceNodesIndices );
+  //int GetFaceIndex( const std::set<int>& theFaceNodesIndices );
   // Return index of a face formed by theFaceNodesIndices
   // Return -1 if a face not found
 
+  // ------------------------
+  // static methods for faces
+  // ------------------------
+
+  static VolumeType GetType(int nbNodes);
+  // return VolumeType by nb of nodes in a volume
+
+  static int NbFaces( VolumeType type );
+  // return nb of faces by volume type
+
+  static const int* GetFaceNodesIndices(VolumeType type,
+                                        int        faceIndex,
+                                        bool       external);
+  // Return the array of face nodes indices
+  // To comfort link iteration, the array
+  // length == NbFaceNodes( faceIndex ) + 1 and
+  // the last node index == the first one.
+
+  static int NbFaceNodes(VolumeType type,
+                         int        faceIndex );
+  // Return number of nodes in the array of face nodes
 
  private:
 
   bool setFace( int faceIndex );
 
   const SMDS_MeshElement* myVolume;
+  const SMDS_PolyhedralVolumeOfNodes* myPolyedre;
+
   bool                    myVolForward;
   int                     myNbFaces;
   int                     myVolumeNbNodes;
-  const SMDS_MeshNode*    myVolumeNodes[ 8 ];
+  const SMDS_MeshNode**   myVolumeNodes;
 
   bool                    myExternalFaces;
-  int*                    myFaceNodeIndices;
-  int*                    myFaceNbNodes;
-  const SMDS_MeshNode*    myFaceNodes[ 5 ];
+
   int                     myCurFace;
+  int                     myFaceNbNodes;
+  int*                    myFaceNodeIndices;
+  const SMDS_MeshNode**   myFaceNodes;
 
 };
 #endif