Salome HOME
0019941: EDF 766 SMESH : Max length hypothesis
[modules/smesh.git] / src / StdMeshers / StdMeshers_CompositeSegment_1D.cxx
index 7c949c52718a159cec0f88e6592438936f2ac60e..f5cf86cd995241069a87ca3aab7f50d36d4010e9 100644 (file)
@@ -1,32 +1,31 @@
-//  SMESH SMESH : implementaion of SMESH idl descriptions
+//  Copyright (C) 2007-2008  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 SMESH : implementaion of SMESH idl descriptions
 //  File   : StdMeshers_Regular_1D.cxx
 //           Moved here from SMESH_Regular_1D.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
 //  $Header$
-
+//
 #include "StdMeshers_CompositeSegment_1D.hxx"
 #include "StdMeshers_FaceSide.hxx"
 #include "StdMeshers_AutomaticLength.hxx"
@@ -91,8 +90,7 @@ namespace {
         eNext = TopoDS::Edge( ancestor );
     }
     if ( edgeCounter.Extent() < 3 && !eNext.IsNull() ) {
-      GeomAbs_Shape cont = SMESH_Algo::Continuity( edge, eNext );
-      if (cont >= GeomAbs_G1) {
+      if ( SMESH_Algo::IsContinuous( edge, eNext )) {
         // care of orientation
         bool reverse;
         if ( forward )
@@ -120,14 +118,14 @@ namespace {
       return;
     for ( int iE = 0; iE < side.NbEdges(); ++iE )
     {
-      // set listener and its data 
+      // set listener and its data
       EventListenerData * listenerData = new EventListenerData(true);
       const TopoDS_Edge& edge = side.Edge( iE );
       SMESH_subMesh * sm = side.GetMesh()->GetSubMesh( edge );
       sm->SetEventListener( eListener, listenerData, sm );
       // add edge submesh to the data
       sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
-      if ( !sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK ) {
+      if ( sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK ) {
         sm->SetIsAlwaysComputed( true );
         listenerData->mySubMeshes.push_back( sm );
       }
@@ -137,7 +135,7 @@ namespace {
         TopoDS_Vertex V = side.FirstVertex( iE );
         sm = side.GetMesh()->GetSubMesh( V );
         sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
-        if ( !sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK )
+        if ( sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK )
           sm->SetIsAlwaysComputed( true );
         listenerData->mySubMeshes.push_back( sm );
       }
@@ -334,7 +332,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
   auto_ptr< BRepAdaptor_CompCurve > C3d ( side->GetCurve3d() );
   double f = C3d->FirstParameter(), l = C3d->LastParameter();
   list< double > params;
-  if ( !computeInternalParameters ( *C3d, side->Length(), f, l, params, false ))
+  if ( !computeInternalParameters ( aMesh, *C3d, side->Length(), f, l, params, false ))
     return false;
 
   // Redistribute parameters near ends
@@ -350,7 +348,7 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
 
   const SMDS_MeshNode * nFirst = SMESH_Algo::VertexNode( VFirst, meshDS );
   const SMDS_MeshNode * nLast  = SMESH_Algo::VertexNode( VLast, meshDS );
-  if (!nFirst) 
+  if (!nFirst)
     return error(COMPERR_BAD_INPUT_MESH, TComm("No node on vertex ")
                  <<meshDS->ShapeToIndex(VFirst));
   if (!nLast)
@@ -415,4 +413,3 @@ bool StdMeshers_CompositeSegment_1D::Compute(SMESH_Mesh &         aMesh,
 
   return true;
 }
-