Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/smesh.git] / src / SMDS / SMDS_VolumeTool.hxx
index 5eb5a0755a5012460bffbb485b7ef60e380b5495..9cc0ae829eec00b44abbc09abd1966b72f3e5691 100644 (file)
@@ -1,32 +1,31 @@
-//  SMESH SMDS : implementaion of Salome mesh data structure
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  SMESH SMDS : implementaion of Salome mesh data structure
 // File      : SMDS_VolumeTool.hxx
 // Module    : SMESH
 // Created   : Tue Jul 13 11:27:17 2004
 // Author    : Edward AGAPOV (eap)
-
-
+//
 #ifndef SMDS_VolumeTool_HeaderFile
 #define SMDS_VolumeTool_HeaderFile
 
@@ -34,7 +33,7 @@
 
 class SMDS_MeshElement;
 class SMDS_MeshNode;
-class SMDS_PolyhedralVolumeOfNodes;
+class SMDS_VtkVolume;
 class SMDS_MeshVolume;
 
 #include <vector>
@@ -63,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;
@@ -95,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
@@ -134,12 +139,16 @@ class SMDS_EXPORT SMDS_VolumeTool
   // To comfort link iteration, the array
   // length == NbFaceNodes( faceIndex ) + 1 and
   // the last node index == the first one.
+  // NOTE: for the quadratic volume, node indoces are in the order the nodes encounter
+  // in face boundary and not the order they are in the mesh face
 
   const SMDS_MeshNode** GetFaceNodes( int faceIndex );
   // Return the array of face nodes.
   // To comfort link iteration, the array
   // length == NbFaceNodes( faceIndex ) + 1 and
   // the last node == the first one.
+  // NOTE: for the quadratic volume, nodes are in the order they encounter in face boundary
+  // and not the order they are in the mesh face
   // WARNING: do not modify the array, some methods
   //          work basing on its contents
 
@@ -157,6 +166,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
 
@@ -204,12 +216,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;