Salome HOME
Typo-fix by Kunda
[modules/geom.git] / src / AdvancedEngine / AdvancedEngine_PipeTShapeDriver.cxx
index 25d0edadece5aa78db53fabb1affc7e49a97b9f2..dffa0b5f50598d335dc06cfed452b9df405b520f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -26,9 +26,9 @@
 #include "GEOM_Function.hxx"
 #include "GEOM_IOperations.hxx"
 #include "GEOMUtils.hxx"
-#include "GEOMAlgo_FinderShapeOn1.hxx"
 #include "GEOMAlgo_FinderShapeOn2.hxx"
 #include "GEOMAlgo_ClsfBox.hxx"
+#include "GEOMAlgo_ClsfSurf.hxx"
 #include "GEOMAlgo_Splitter.hxx"
 
 #include "Geom_CylindricalSurface.hxx"
@@ -38,7 +38,6 @@
 #include <gp_Pln.hxx>
 #include <gp_Dir.hxx>
 #include <gp_Trsf.hxx>
-#include <TFunction_Logbook.hxx>
 #include <StdFail_NotDone.hxx>
 #include <BRepPrimAPI_MakeCone.hxx>
 #include <BRepPrimAPI_MakeCylinder.hxx>
@@ -127,7 +126,7 @@ AdvancedEngine_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     TCollection_AsciiString aMsg (" iErr : ");
     aMsg += TCollection_AsciiString(iErr);
@@ -185,12 +184,14 @@ Handle(TColStd_HSequenceOfInteger)
   }
 
   // Call algo
-  GEOMAlgo_FinderShapeOn1 aFinder;
-  Standard_Real aTol = 1e-6;
+  GEOMAlgo_FinderShapeOn2   aFinder;
+  Handle(GEOMAlgo_ClsfSurf) aClsfSurf = new GEOMAlgo_ClsfSurf;
+  Standard_Real             aTol      = 1e-6;
 
+  aClsfSurf->SetSurface(theSurface);
   aFinder.SetShape(theShape);
   aFinder.SetTolerance(aTol);
-  aFinder.SetSurface(theSurface);
+  aFinder.SetClsf(aClsfSurf);
   aFinder.SetShapeType(theShapeType);
   aFinder.SetState(theState);
 
@@ -199,7 +200,7 @@ Handle(TColStd_HSequenceOfInteger)
   // Default value=3
   aFinder.SetNbPntsMin(3);
   // Sets the maximal number of inner points for edges or faces.
-  // It is usefull for the cases when this number is very big (e.g =2000) to improve
+  // It is useful for the cases when this number is very big (e.g =2000) to improve
   // the performance. If this value =0, all inner points will be taken into account.
   // Default value=0
   aFinder.SetNbPntsMax(0);
@@ -208,7 +209,7 @@ Handle(TColStd_HSequenceOfInteger)
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
 //    MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
@@ -217,7 +218,7 @@ Handle(TColStd_HSequenceOfInteger)
     return aSeqOfIDs;
   }
 //  Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
 //  if (iWrn) {
 //    MESSAGE(" *** iWrn : " << iWrn);
 //  }
@@ -311,7 +312,7 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
 
   gp_Pnt aP0 (0, 0, 0);
   gp_Pnt aP1 (-l1, 0, 0);
-  gp_Vec aVX = gp::DX(), aVY = gp::DY(), aVZ = gp::DZ();
+  gp_Vec aVX = gp::DX(), aVZ = gp::DZ();
   gp_Ax2 anAxes1 (aP1, aVX, aVZ);
   gp_Ax2 anAxes2 (aP0, aVZ, aVX);
 
@@ -337,13 +338,13 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
   // Remove small radius main pipe
   BRepAlgoAPI_Cut cut1 (fuse1.Shape(), C1Int.Shape());
   if (!cut1.IsDone()) {
-    StdFail_NotDone::Raise("Coudn't cut cylinders");
+    StdFail_NotDone::Raise("Couldn't cut cylinders");
   }
 
   // Remove small radius incident pipe => Te
   BRepAlgoAPI_Cut Te (cut1.Shape(), C2Int.Shape());
   if (!Te.IsDone()) {
-    StdFail_NotDone::Raise("Coudn't cut cylinders");
+    StdFail_NotDone::Raise("Couldn't cut cylinders");
   }
 
   TopoDS_Shape aShape = Te.Shape();
@@ -399,7 +400,7 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const doubl
 //function : Execute
 //purpose  :
 //=======================================================================
-Standard_Integer AdvancedEngine_PipeTShapeDriver::Execute (TFunction_Logbook& log) const
+Standard_Integer AdvancedEngine_PipeTShapeDriver::Execute(Handle(TFunction_Logbook)& log) const
 {
   if (Label().IsNull()) return 0;
   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
@@ -622,7 +623,7 @@ Standard_Integer AdvancedEngine_PipeTShapeDriver::Execute (TFunction_Logbook& lo
 
   aFunction->SetValue(aShape);
 
-  log.SetTouched(Label());
+  log->SetTouched(Label());
 
   return 1;
 }
@@ -683,5 +684,4 @@ GetCreationInformation(std::string&             theOperationName,
   return true;
 }
 
-IMPLEMENT_STANDARD_HANDLE (AdvancedEngine_PipeTShapeDriver,GEOM_BaseDriver);
 IMPLEMENT_STANDARD_RTTIEXT (AdvancedEngine_PipeTShapeDriver,GEOM_BaseDriver);