X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_VolumeTool.hxx;h=4c0e1a911b90d1bed377ba1d36afe4b9f2f13232;hp=0c840a512c09371fcc83173b5d18dacee704559f;hb=c63ee099ad2b149bd70136839c973e8910137bc5;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f diff --git a/src/SMDS/SMDS_VolumeTool.hxx b/src/SMDS/SMDS_VolumeTool.hxx index 0c840a512..4c0e1a911 100644 --- a/src/SMDS/SMDS_VolumeTool.hxx +++ b/src/SMDS/SMDS_VolumeTool.hxx @@ -17,7 +17,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // // @@ -32,10 +32,23 @@ class SMDS_MeshElement; class SMDS_MeshNode; +class SMDS_PolyhedralVolumeOfNodes; #include #include +//#ifdef WNT +//#include +//#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,9 +76,11 @@ 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 file bottom + // See node order of forward volumes at the file bottom void Inverse(); // Change nodes order as if the volume changes its orientation: @@ -101,12 +119,8 @@ class SMDS_VolumeTool // info on faces // ------------- - void SetForwardOrientation (); - // Node order in faces will be as for forward orientation - void SetExternalNormal (); // Node order in faces will be so that faces normals are external. - // It overrides SetForwardOrientation() int NbFaces() const { return myNbFaces; } // Return number of faces of the volume. In the following @@ -135,8 +149,7 @@ class SMDS_VolumeTool bool IsFaceExternal( int faceIndex ); // Check normal orientation of a face. - // SetForwardOrientation() and SetForwardOrientation() are taken - // into account. + // SetExternalNormal() is taken into account. bool IsFreeFace( int faceIndex ); // Check that all volumes built on the face nodes lays on one side @@ -154,27 +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& theFaceNodesIndices ); + //int GetFaceIndex( const std::set& 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 myForwardFaces; bool myExternalFaces; - int* myFaceNodeIndices; - int* myFaceNbNodes; - const SMDS_MeshNode* myFaceNodes[ 5 ]; + int myCurFace; + int myFaceNbNodes; + int* myFaceNodeIndices; + const SMDS_MeshNode** myFaceNodes; }; #endif @@ -191,13 +227,13 @@ class SMDS_VolumeTool // /|\ // / | \ // / | \ -// N0 +---|---+ N2 TETRAHEDRON +// N0 +---|---+ N1 TETRAHEDRON // \ | / // \ | / // \ | / // \|/ // + -// N1 +// N2 // + N4 // /|\ @@ -213,18 +249,18 @@ class SMDS_VolumeTool // |/ \| // N0 +---------+ N2 -// N7+----------+N6 +// N5+----------+N6 // /| /| // / | / | // / | / | -// N4+----------+N5 | +// N4+----------+N7 | // | | | | HEXAHEDRON // | | | | // | | | | -// | N3+------|---+N2 +// | N1+------|---+N2 // | / | / // | / | / // |/ |/ -// N0+----------+N1 +// N0+----------+N3 // */