Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESH / SMESH_Algo.cxx
index bbe59e92804deace295eb1f96f6e14b5b4d8b0dd..98e8af4691b3b2f2b5afc5a69591cdffc01c91cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
@@ -24,7 +24,7 @@
 //  File   : SMESH_Algo.cxx
 //  Author : Paul RASCLE, EDF
 //  Module : SMESH
-//
+
 #include "SMESH_Algo.hxx"
 
 #include "SMDS_EdgePosition.hxx"
@@ -40,6 +40,8 @@
 #include "SMESH_Mesh.hxx"
 #include "SMESH_TypeDefs.hxx"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepLProp.hxx>
 #include <BRep_Tool.hxx>
@@ -79,7 +81,7 @@ SMESH_Algo::SMESH_Algo (int hypId, int studyId, SMESH_Gen * gen)
 {
   gen->_mapAlgo[hypId] = this;
 
-  _onlyUnaryInput = _requireDescretBoundary = _requireShape = true;
+  _onlyUnaryInput = _requireDiscreteBoundary = _requireShape = true;
   _quadraticMesh = _supportSubmeshes = false;
   _error = COMPERR_OK;
 }
@@ -174,7 +176,7 @@ double SMESH_Algo::EdgeLength(const TopoDS_Edge & E)
     return 0;
   TopLoc_Location L;
   Handle(Geom_Curve) C = BRep_Tool::Curve(E, L, UMin, UMax);
-  GeomAdaptor_Curve AdaptCurve(C);
+  GeomAdaptor_Curve AdaptCurve(C, UMin, UMax); //range is important for periodic curves
   double length = GCPnts_AbscissaPoint::Length(AdaptCurve, UMin, UMax);
   return length;
 }
@@ -437,7 +439,7 @@ bool SMESH_Algo::GetSortedNodesOnEdge(const SMESHDS_Mesh*                   theM
         return false;
       const SMDS_EdgePosition* epos =
         static_cast<const SMDS_EdgePosition*>(node->GetPosition());
-      theNodes.insert( make_pair( epos->GetUParameter(), node ));
+      theNodes.insert( theNodes.end(), make_pair( epos->GetUParameter(), node ));
       //MESSAGE("U " << epos->GetUParameter() << " ID " << node->GetID());
       ++nbNodes;
     }
@@ -512,7 +514,7 @@ GeomAbs_Shape SMESH_Algo::Continuity(TopoDS_Edge E1,
   Standard_Real tol = BRep_Tool::Tolerance( V );
   Standard_Real angTol = 2e-3;
   try {
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
 #endif
     return BRepLProp::Continuity(C1, C2, u1, u2, tol, angTol);