Salome HOME
Update mail address
[modules/smesh.git] / src / SMESH / SMESH_Block.cxx
index 4c55ca8e40886ab0538d3580e75a988405a94438..3a086833078bde24a5d663f8842d59ce382554dc 100644 (file)
@@ -15,7 +15,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
 
 // File      : SMESH_Pattern.hxx
 // Created   : Mon Aug  2 10:30:00 2004
@@ -239,6 +239,42 @@ bool SMESH_Block::ShellPoint( const gp_XYZ& theParams, gp_XYZ& thePoint ) const
   return true;
 }
 
+//=======================================================================
+//function : ShellPoint
+//purpose  : computes coordinates of a point in shell by points on sub-shapes;
+//           thePointOnShape[ subShapeID ] must be a point on a subShape
+//=======================================================================
+
+bool SMESH_Block::ShellPoint(const gp_XYZ&         theParams,
+                             const vector<gp_XYZ>& thePointOnShape,
+                             gp_XYZ&               thePoint )
+{
+  if ( thePointOnShape.size() < ID_F1yz )
+    return false;
+
+  double x = theParams.X(), y = theParams.Y(), z = theParams.Z();
+  double x1 = 1. - x,       y1 = 1. - y,       z1 = 1. - z;
+  const vector<gp_XYZ>& p = thePointOnShape;
+
+  thePoint = 
+    x1 * p[ID_F0yz] + x * p[ID_F1yz]
+      + y1 * p[ID_Fx0z] + y * p[ID_Fx1z]
+        + z1 * p[ID_Fxy0] + z * p[ID_Fxy1]
+          + x1 * (y1 * (z1 * p[ID_V000] + z * p[ID_V001])
+                  + y * (z1 * p[ID_V010] + z * p[ID_V011]))
+            + x * (y1 * (z1 * p[ID_V100] + z * p[ID_V101])
+                   + y * (z1 * p[ID_V110] + z * p[ID_V111]));
+  thePoint -=
+    x1 * (y1 * p[ID_E00z] + y * p[ID_E01z])
+      + x * (y1 * p[ID_E10z] + y * p[ID_E11z])
+        + y1 * (z1 * p[ID_Ex00] + z * p[ID_Ex01])
+          + y * (z1 * p[ID_Ex10] + z * p[ID_Ex11])
+            + z1 * (x1 * p[ID_E0y0] + x * p[ID_E1y0])
+              + z * (x1 * p[ID_E0y1] + x * p[ID_E1y1]);
+
+  return true;
+}
+
 //=======================================================================
 //function : NbVariables
 //purpose  :