Salome HOME
Update copyright
[modules/smesh.git] / src / StdMeshers / StdMeshers_Projection_1D.cxx
index df55fc26702ece5cf7f92d76447cd680e5e25340..8e8cc402c66a7d375573d20c2047d642811a2d4a 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SMESH SMESH : implementaion of SMESH idl descriptions
 // File      : StdMeshers_Projection_1D.cxx
 // Module    : SMESH
@@ -67,7 +68,7 @@ StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, int studyId, SMESH
   :SMESH_1D_Algo(hypId, studyId, gen)
 {
   _name = "Projection_1D";
-  _shapeType = (1 << TopAbs_EDGE);     // 1 bit per shape type
+  _shapeType = (1 << TopAbs_EDGE);      // 1 bit per shape type
 
   _compatibleHypothesis.push_back("ProjectionSource1D");
   _sourceHypo = 0;
@@ -128,25 +129,25 @@ bool StdMeshers_Projection_1D::CheckHypothesis(SMESH_Mesh&
     if ( _sourceHypo->HasVertexAssociation() )
     {
       // source and target vertices
-      if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
-           !TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
-           !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
-                                    _sourceHypo->GetSourceEdge() ))
+      if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) ||
+           !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) ||
+           !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+                                            _sourceHypo->GetSourceEdge() ))
       {
         aStatus = HYP_BAD_PARAMETER;
-        SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
-        SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
-        SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(),
-                                        _sourceHypo->GetSourceEdge() )));
+        SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh )));
+        SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh )));
+        SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceVertex(),
+                                                _sourceHypo->GetSourceEdge() )));
       }
       // PAL16202
-      else 
+      else
       {
-        bool isSub = TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
+        bool isSub = SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape );
         if ( !_sourceHypo->IsCompoundSource() ) {
           if ( !isSub ) {
             aStatus = HYP_BAD_PARAMETER;
-            SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
+            SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetTargetVertex(), aShape)));
           }
         }
         else if ( isSub ) {
@@ -159,7 +160,7 @@ bool StdMeshers_Projection_1D::CheckHypothesis(SMESH_Mesh&
           {
             const TopoDS_Shape& ancestor = ancestIt.Value();
             if ( ancestor.ShapeType() == TopAbs_EDGE &&
-                 TAssocTool::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
+                 SMESH_MesherHelper::IsSubShape( ancestor, _sourceHypo->GetSourceEdge() ))
             {
               if ( sharingEdge.IsNull() || ancestor.IsSame( sharingEdge ))
                 sharingEdge = ancestor;
@@ -175,11 +176,11 @@ bool StdMeshers_Projection_1D::CheckHypothesis(SMESH_Mesh&
       }
     }
     // check source edge
-    if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
+    if ( !SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) ||
          ( srcMesh == tgtMesh && aShape == _sourceHypo->GetSourceEdge() ))
     {
       aStatus = HYP_BAD_PARAMETER;
-      SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
+      SCRUTE((SMESH_MesherHelper::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh )));
       SCRUTE((srcMesh == tgtMesh));
       SCRUTE(( aShape == _sourceHypo->GetSourceEdge() ));
     }
@@ -379,8 +380,8 @@ bool StdMeshers_Projection_1D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
 //=======================================================================
 
 bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh,
-                                       const TopoDS_Shape& theShape,
-                                       MapShapeNbElems& aResMap)
+                                        const TopoDS_Shape& theShape,
+                                        MapShapeNbElems& aResMap)
 {
   if ( !_sourceHypo )
     return false;
@@ -390,7 +391,7 @@ bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh,
   if ( !srcMesh )
     srcMesh = tgtMesh;
 
-  SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
+  //SMESHDS_Mesh * meshDS = theMesh.GetMeshDS();
 
   // ---------------------------
   // Make subshapes association
@@ -433,8 +434,8 @@ bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh,
   // Find out nodes distribution on the source edge
   // -----------------------------------------------
 
-  double srcLength = EdgeLength( srcEdge );
-  double tgtLength = EdgeLength( tgtEdge );
+  //double srcLength = EdgeLength( srcEdge );
+  //double tgtLength = EdgeLength( tgtEdge );
   
   vector< double > params; // sorted parameters of nodes on the source edge
   if ( !SMESH_Algo::GetNodeParamOnEdge( srcMesh->GetMeshDS(), srcEdge, params ))