Salome HOME
0021074: EDF 1682 MESH: Bug with start and end length hypothesis
[modules/smesh.git] / src / SMDS / SMDS_VolumeTool.hxx
index b95bc8a620f48c5bf41568db9d440820de98f967..2e17f145b4120607129581b88762c61f7ed1115b 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  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
@@ -19,6 +19,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH SMDS : implementaion of Salome mesh data structure
 // File      : SMDS_VolumeTool.hxx
 // Module    : SMESH
@@ -32,7 +33,7 @@
 
 class SMDS_MeshElement;
 class SMDS_MeshNode;
-class SMDS_PolyhedralVolumeOfNodes;
+class SMDS_VtkVolume;
 class SMDS_MeshVolume;
 
 #include <vector>
@@ -61,7 +62,7 @@ class SMDS_EXPORT SMDS_VolumeTool
   // Set volume.
   // Return false if theVolume is not of type SMDSAbs_Volume
 
-  const SMDS_MeshVolume* Get() const;
+  const SMDS_MeshVolume* Element() const;
   // return element
 
   int ID() const;
@@ -93,19 +94,25 @@ class SMDS_EXPORT SMDS_VolumeTool
 
   bool GetBaryCenter (double & X, double & Y, double & Z) const;
 
+  bool IsOut(double X, double Y, double Z, double tol);
+  // Classify a point
 
   // -----------------------
   // info on node connection
   // -----------------------
 
   bool IsLinked (const SMDS_MeshNode* theNode1,
-                 const SMDS_MeshNode* theNode2) const;
+                 const SMDS_MeshNode* theNode2,
+                 const bool           theIgnoreMediumNodes=false) const;
   // Return true if theNode1 is linked with theNode2.
+  // If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
 
   bool IsLinked (const int theNode1Index,
-                 const int theNode2Index) const;
+                 const int theNode2Index,
+                 bool      theIgnoreMediumNodes=false) const;
   // Return true if the node with theNode1Index is linked
   // with the node with theNode2Index
+  // If theIgnoreMediumNodes then corner nodes of quadratic cell are considered linked as well
 
   int GetNodeIndex(const SMDS_MeshNode* theNode) const;
   // Return an index of theNode
@@ -155,6 +162,9 @@ class SMDS_EXPORT SMDS_VolumeTool
   bool GetFaceNormal (int faceIndex, double & X, double & Y, double & Z);
   // Return a normal to a face
 
+  bool GetFaceBaryCenter (int faceIndex, double & X, double & Y, double & Z);
+  // Return barycenter of a face
+
   double GetFaceArea( int faceIndex );
   // Return face area
 
@@ -202,12 +212,13 @@ private:
   bool setFace( int faceIndex );
 
   const SMDS_MeshElement* myVolume;
-  const SMDS_PolyhedralVolumeOfNodes* myPolyedre;
+  const SMDS_VtkVolume*   myPolyedre;
 
   bool                    myVolForward;
   int                     myNbFaces;
   int                     myVolumeNbNodes;
   const SMDS_MeshNode**   myVolumeNodes;
+  std::vector< int >      myPolyIndices;
 
   bool                    myExternalFaces;