Salome HOME
Porting Salome to OCCT 7.7.0
authorjfa <jfa@opencascade.com>
Fri, 17 Feb 2023 16:55:49 +0000 (16:55 +0000)
committerjfa <jfa@opencascade.com>
Fri, 17 Feb 2023 16:55:49 +0000 (16:55 +0000)
24 files changed:
src/ARCHIMEDE/Archimede_VolumeSection.cxx
src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx
src/BlockFix/BlockFix_UnionFaces.cxx
src/EntityGUI/EntityGUI_3DSketcherDlg.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.hxx
src/GEOMImpl/GEOMImpl_ICanonicalRecognition.hxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx
src/GEOMUtils/GEOMUtils.cxx
src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx
src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx
src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx
src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx
src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx
src/OBJECT/GEOM_AISShape.cxx
src/OBJECT/GEOM_Annotation.cxx
src/OBJECT/GEOM_OCCReader.cxx
src/OCC2VTK/GEOM_EdgeSource.cxx
src/OCC2VTK/GEOM_ShadingFace.cxx
src/OCC2VTK/GEOM_WireframeFace.cxx
src/ShHealOper/ShHealOper_FillHoles.cxx

index c4a9479a3806b965aab8b01a52667d387e098588..ccf381aa8788f01191f6ee9a706fa8bd70dd8eee 100644 (file)
@@ -90,13 +90,12 @@ void VolumeSection::CenterOfGravity()
       if(Tr.IsNull())
         MESSAGE("Error, null layer" );
       nbNodes = Tr->NbNodes();
-      const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
       
       // Calcul des dimensions de la boite englobante du solide
       
       for(i=1;i<=nbNodes;i++)
         {
-          InitPoint = Nodes(i).Transformed(L.Transformation());
+          InitPoint = Tr->Node(i).Transformed(L.Transformation());
           if(InitPoint.X() < Xmin)
             Xmin = InitPoint.X();
           if(InitPoint.X() > Xmax)
@@ -131,9 +130,9 @@ Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
   Standard_Real Volume=0;
   Standard_Real Determinant=0;
   gp_Pnt P[3];
-  
+
   // Projection du point d'initialisation sur le plan de section
-  
+
   InitPoint.SetZ(Elevation);
 
   for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next()) 
@@ -142,28 +141,25 @@ Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
       Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
       if(Tr.IsNull())
         MESSAGE("Error, null layer" );
-      const Poly_Array1OfTriangle& triangles = Tr->Triangles();
       Standard_Integer nbTriangles = Tr->NbTriangles();
-      //nbNodes = Tr->NbNodes();
-      const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
-      
+
       // Calcul des volumes de chaque triangle, de chaque face 
       // en tenant compte des triangles coupes par le plan de section
-      
-      for (i=1;i<=nbTriangles;i++) 
+
+      for (i=1;i<=nbTriangles;i++)
         {
           Determinant=0;
           //Gardons la meme orientation des noeuds
           if (F.Orientation()  == TopAbs_REVERSED)
-            triangles(i).Get(noeud[0], noeud[2], noeud[1]);
+            Tr->Triangle(i).Get(noeud[0], noeud[2], noeud[1]);
           else 
-            triangles(i).Get(noeud[0], noeud[1], noeud[2]);
+            Tr->Triangle(i).Get(noeud[0], noeud[1], noeud[2]);
           
-          P[0] = Nodes(noeud[0]).Transformed(L.Transformation());
+          P[0] = Tr->Node(noeud[0]).Transformed(L.Transformation());
           z[0] = P[0].Z();
-          P[1] = Nodes(noeud[1]).Transformed(L.Transformation());
+          P[1] = Tr->Node(noeud[1]).Transformed(L.Transformation());
           z[1] = P[1].Z();
-          P[2] = Nodes(noeud[2]).Transformed(L.Transformation());
+          P[2] = Tr->Node(noeud[2]).Transformed(L.Transformation());
           z[2] = P[2].Z();
 
           // Determination des cas aux limites pour les triangles
index 42134d10bc576e67852027e20f778306c0879985..19c90b578c9af72291afcf1c02073e6ae5525c66 100644 (file)
 #include <TColgp_SequenceOfXYZ.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
 #include <BRepAdaptor_HSurface.hxx>
+#else
+#include <BRepAdaptor_Surface.hxx>
+#endif
 
 #include <BRep_Builder.hxx>
 #include <BRepGProp.hxx>
@@ -117,9 +123,15 @@ TopoDS_Shape AdvancedEngine_SmoothingSurfaceDriver::MakeSmoothingSurfaceUnClosed
 
   GeomPlate_BuildPlateSurface aBuilder(3,10);
   // ** Initialization of surface
+#if OCC_VERSION_LARGE < 0x07070000
   Handle(BRepAdaptor_HSurface) HSI = new BRepAdaptor_HSurface();
   HSI->ChangeSurface().Initialize(aInitShape);
   aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->ChangeSurface().Face()));
+#else
+  Handle(BRepAdaptor_Surface) HSI = new BRepAdaptor_Surface();
+  HSI->Initialize(aInitShape);
+  aBuilder.LoadInitSurface( BRep_Tool::Surface(HSI->Face()) );
+#endif
 
   Standard_Integer j, j1, j2;
   // cout << "Init surface" << endl;
index 294deb2245796d062e52873a92d1bdbba6125cc8..8a30a7e23e14e94b2dab57b08d62915b7904c8aa 100644 (file)
 
 #include <TColGeom_HArray2OfSurface.hxx>
 
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GeomAdaptor_HSurface.hxx>
-#include <GeomLib_IsPlanarSurface.hxx>
+#else
+#include <GeomAdaptor_Surface.hxx>
+#endif
 
+#include <GeomLib_IsPlanarSurface.hxx>
 #include <Geom_Surface.hxx>
 #include <Geom_Plane.hxx>
 #include <Geom_OffsetSurface.hxx>
@@ -85,7 +89,9 @@
 #include <Geom_SurfaceOfLinearExtrusion.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
 #include <BRepAdaptor_Surface.hxx>
+#if OCC_VERSION_LARGE < 0x07070000
 #include <BRepAdaptor_HSurface.hxx>
+#endif
 #include <LocalAnalysis_SurfaceContinuity.hxx>
 #include <GeomConvert_ApproxSurface.hxx>
 #include <Bnd_Box.hxx>
@@ -300,7 +306,11 @@ static Standard_Boolean IsTangentFaces(const TopoDS_Edge& theEdge,
 
 // Computation of the number of samples on the edge.
   BRepAdaptor_Surface              aBAS(theFace);
+#if OCC_VERSION_LARGE < 0x07070000
   Handle(BRepAdaptor_HSurface)     aBAHS      = new BRepAdaptor_HSurface(aBAS);
+#else
+  Handle(BRepAdaptor_Surface)      aBAHS      = new BRepAdaptor_Surface(aBAS);
+#endif
   Handle(BRepTopAdaptor_TopolTool) aTool      = new BRepTopAdaptor_TopolTool(aBAHS);
   Standard_Integer                 aNbSamples =     aTool->NbSamples();
   const Standard_Integer           aNbSamplesMax =   23;
@@ -903,8 +913,13 @@ Standard_Boolean BlockFix_UnionFaces::IsSameDomain(const TopoDS_Face& aFace,
   if (S1->IsKind(STANDARD_TYPE(Geom_ElementarySurface)) &&
       S2->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
   {
+#if OCC_VERSION_LARGE < 0x07070000
     Handle(GeomAdaptor_HSurface) aGA1 = new GeomAdaptor_HSurface(S1);
     Handle(GeomAdaptor_HSurface) aGA2 = new GeomAdaptor_HSurface(S2);
+#else
+    Handle(GeomAdaptor_Surface) aGA1 = new GeomAdaptor_Surface(S1);
+    Handle(GeomAdaptor_Surface) aGA2 = new GeomAdaptor_Surface(S2);
+#endif
 
     Handle(BRepTopAdaptor_TopolTool) aTT1 = new BRepTopAdaptor_TopolTool();
     Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
index 780550c8880655d109803ac8d8a735135964c112..84c25577c3f4e7dd6dfc8b61ec03b94419199452 100644 (file)
@@ -191,7 +191,7 @@ void AIS_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentati
   asp->Aspect()->SetTextZoomable(aZoomable);
   asp->Aspect()->SetTextAngle(aAngle);
   asp->Aspect()->SetTextFontAspect(aFontAspect);
-  Prs3d_Text::Draw(aPresentation, asp, aText, aPosition); // todo: deprecated OCCT API
+  Prs3d_Text::Draw(aPresentation->CurrentGroup(), asp, aText, aPosition);
 }
 
 bool isSame (double d1, double d2)
index e7041f483f006741df1876f39ccfdeb128d0da36..792aff616e0dd4624b5e90cf3d850b0bb35104b5 100644 (file)
@@ -616,14 +616,12 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
   }
   //
   const gp_Trsf& aTrsf=aLoc.Transformation();
-  const Poly_Array1OfTriangle& aTrs=aTRF->Triangles();
-  const TColgp_Array1OfPnt& aNodes=aTRF->Nodes();
   //
   // map link/nbtriangles
-  j1=aTrs.Lower();
-  j2=aTrs.Upper();
+  j1 = 1;
+  j2 = aTRF->NbTriangles();
   for (j=j1; j<=j2; ++j) {
-    const Poly_Triangle& aTr=aTrs(j);
+    const Poly_Triangle& aTr = aTRF->Triangle(j);
     aTr.Get(n[0], n[1], n[2]);
     n[3]=n[0];
     for (k=0; k<3; ++k) {
@@ -655,11 +653,11 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
   }
   //
   // inner nodes=all_nodes - boundary_nodes
-  j1=aNodes.Lower();
-  j2=aNodes.Upper();
+  j1=1;
+  j2=aTRF->NbNodes();
   for (j=j1; j<=j2; ++j) {
     if (!aMBN.Contains(j)) {
-      aP=aNodes(j).Transformed(aTrsf);
+      aP=aTRF->Node(j).Transformed(aTrsf);
       aLP.Append(aP);
     }
   }
@@ -769,13 +767,12 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
   }
   else {
     const gp_Trsf& aTrsf=aLoc.Transformation();
-    const TColgp_Array1OfPnt& aNodes=aTRE->Nodes();
     //
     aNbNodes=aPTE->NbNodes();
     const TColStd_Array1OfInteger& aInds=aPTE->Nodes();
     for (j=2; j<aNbNodes; ++j) {
       aIndex=aInds(j);
-      aP=aNodes(aIndex).Transformed(aTrsf);
+      aP=aTRE->Node(aIndex).Transformed(aTrsf);
       aLP.Append(aP);
     }
   }
index a75b8c784f03639df9ae6562ba076d962bf78867..357bf28f8fdc3fbd6b202ab46eae3c3aa05eb0fc 100644 (file)
@@ -55,6 +55,9 @@
 #include <BOPAlgo_Builder.hxx>
 
 #include <GEOMAlgo_AlgoTools.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
 /////////////////////////////////////////////////////////////////////////
 //=======================================================================
 //class : GEOMAlgo_ShellSolidBuilder
@@ -70,7 +73,12 @@ class GEOMAlgo_ShellSolidBuilder : public BOPAlgo_Builder {
 
  protected:
   Standard_EXPORT
+#if OCC_VERSION_LARGE < 0x07070000
     virtual void PerformInternal(const BOPAlgo_PaveFiller& theFiller);
+#else
+    virtual void PerformInternal(const BOPAlgo_PaveFiller& theFiller,
+                                 const Message_ProgressRange& theRange);
+#endif
 };
 
 //=======================================================================
@@ -93,9 +101,13 @@ GEOMAlgo_ShellSolidBuilder::~GEOMAlgo_ShellSolidBuilder()
 //function : PerformInternal
 //purpose  : 
 //=======================================================================
+#if OCC_VERSION_LARGE < 0x07070000
 void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
+#else
+void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFiller,
+                                                 const Message_ProgressRange& theRange)
+#endif
 {
-   //
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
   myContext=myPaveFiller->Context();
@@ -111,10 +123,21 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
   if (HasErrors()) {
     return;
   }
+
+#if OCC_VERSION_LARGE >= 0x07070000
+  Message_ProgressScope aPS(theRange, "Building the result of Boolean operation", 100);
   //
+  BOPAlgo_PISteps aSteps (PIOperation_Last);
+  analyzeProgress (100, aSteps);
+#endif
+
   // 3. Fill Images
   // 3.1 Vertice
+#if OCC_VERSION_LARGE < 0x07070000
   FillImagesVertices();
+#else
+  FillImagesVertices(aPS.Next(aSteps.GetStep(PIOperation_TreatVertices)));
+#endif
   if (HasErrors()) {
     return;
   }
@@ -124,7 +147,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
     return;
   }
   // 3.2 Edges
+#if OCC_VERSION_LARGE < 0x07070000
   FillImagesEdges();
+#else
+  FillImagesEdges(aPS.Next(aSteps.GetStep(PIOperation_TreatEdges)));
+#endif
   if (HasErrors()) {
     return;
   }
@@ -135,7 +162,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
   } 
   //
   // 3.3 Wires
+#if OCC_VERSION_LARGE < 0x07070000
   FillImagesContainers(TopAbs_WIRE);
+#else
+  FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps.GetStep(PIOperation_TreatWires)));
+#endif
   if (HasErrors()) {
     return;
   }
@@ -146,7 +177,11 @@ void GEOMAlgo_ShellSolidBuilder::PerformInternal(const BOPAlgo_PaveFiller& theFi
   }
   
   // 3.4 Faces
+#if OCC_VERSION_LARGE < 0x07070000
   FillImagesFaces();
+#else
+  FillImagesFaces(aPS.Next(aSteps.GetStep(PIOperation_TreatFaces)));
+#endif
   if (HasErrors()) {
     return;
   }
index fbd3fbfcee49797297c898c57f9e8d68274398e0..8cfe5461886d7da99ea1365c834c715d27ab941b 100644 (file)
@@ -180,7 +180,11 @@ void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
 //function : PostTreat
 //purpose  : 
 //=======================================================================
+#if OCC_VERSION_LARGE < 0x07070000
 void GEOMAlgo_Splitter::PostTreat()
+#else
+void GEOMAlgo_Splitter::PostTreat(const Message_ProgressRange& theRange)
+#endif
 {
   if (myLimit!=TopAbs_SHAPE) {
     Standard_Integer i, aNbS;
@@ -282,7 +286,11 @@ void GEOMAlgo_Splitter::PostTreat()
     myShape=aLS.First();
   }
   //
+#if OCC_VERSION_LARGE < 0x07070000
   BOPAlgo_Builder::PostTreat();
+#else
+  BOPAlgo_Builder::PostTreat(theRange);
+#endif
 }
 //=======================================================================
 //function : TreatCompound
index 0719a4d9b9964658a6d9cd2254dbea7427e1a468..d79539e9b3a4e0aadb925b116e119384deab75cb 100644 (file)
@@ -42,6 +42,8 @@
 
 #include <BOPAlgo_Builder.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 //=======================================================================
 //class    : GEOMAlgo_Splitter
 //purpose  :
@@ -85,7 +87,11 @@ class GEOMAlgo_Splitter : public BOPAlgo_Builder
     virtual void BuildResult(const TopAbs_ShapeEnum theType);
 
   Standard_EXPORT
+#if OCC_VERSION_LARGE < 0x07070000
     virtual void PostTreat();
+#else
+    virtual void PostTreat(const Message_ProgressRange& theRange);
+#endif
   
  protected:
   TopTools_ListOfShape myTools; 
index b4d482dcfefc46430df0043e9067d72b97fb7b6c..b75b0a7b7974073f9400e54b807a64a4d552e506 100644 (file)
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
 
+#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Sphere.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Elips.hxx>
+#include <gp_Lin.hxx>
+
 #include <vector>
 
 class GEOM_Object;
index 48d7d732e608370f9180bbc84cac890a23488c1e..278a8396434538bb641288f32f588316ec79874f 100644 (file)
@@ -34,6 +34,8 @@
 
 #include <GEOMUtils.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <ShapeAnalysis_FreeBounds.hxx>
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeFix_Face.hxx>
 #include <Geom_Conic.hxx>
 #include <Geom_BSplineCurve.hxx>
 #include <Geom_BSplineSurface.hxx>
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GeomAdaptor_HCurve.hxx>
+#else
+#include <GeomAdaptor_Curve.hxx>
+#endif
 #include <GeomFill_BSplineCurves.hxx>
 #include <GeomConvert_ApproxCurve.hxx>
 #include <GeomConvert.hxx>
@@ -160,7 +166,11 @@ static GeomFill_Trihedron EvaluateBestSweepMode(const TopoDS_Shape& Spine)
     Standard_Real fpar, lpar;
     Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, fpar, lpar);
     GeomAdaptor_Curve GAcurve(aCurve, fpar, lpar);
+#if OCC_VERSION_LARGE < 0x07070000
     Handle(GeomAdaptor_HCurve) GAHcurve = new GeomAdaptor_HCurve(GAcurve);
+#else
+    Handle(GeomAdaptor_Curve) GAHcurve = new GeomAdaptor_Curve(GAcurve);
+#endif
 
     Handle(GeomFill_CorrectedFrenet) aCorrFrenet = new GeomFill_CorrectedFrenet(Standard_True); //for evaluation
     aCorrFrenet->SetCurve(GAHcurve);
index 0929093d9142ecbb34980d1ac61cc9e5e465eacf..9bd97d9f57c88aed9b7d8045b4c78526be6d5b19 100644 (file)
 
 #include <GEOMImpl_ProjectionDriver.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMImpl_IMirror.hxx>
 #include <GEOMImpl_IProjection.hxx>
 #include <GEOMImpl_IProjOnCyl.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 #include <GEOMUtils.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GEOMUtils_HTrsfCurve2d.hxx>
+#else
+#include <GEOMUtils_TrsfCurve2d.hxx>
+#endif
 
 #include <Approx_Curve2d.hxx>
 #include <Bnd_Box2d.hxx>
@@ -661,11 +668,17 @@ TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
       }
 
       // Transform the curve to cylinder's parametric space.
+#if OCC_VERSION_LARGE < 0x07070000
       Handle(GEOMUtils::HTrsfCurve2d) aTrsfCurve =
         new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
-      Approx_Curve2d                  aConv (aTrsfCurve, aPar[0], aPar[1],
-                                                         aUResol, aVResol, GeomAbs_C1,
-                                             9, 1000);
+#else
+      Handle(GEOMUtils::TrsfCurve2d) aTrsfCurve =
+        new GEOMUtils::TrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
+#endif
+
+      Approx_Curve2d aConv (aTrsfCurve, aPar[0], aPar[1],
+                            aUResol, aVResol, GeomAbs_C1,
+                            9, 1000);
 
       if (!aConv.IsDone() && !aConv.HasResult()) {
         return aResult;
index 24d7318c0ef8ce06a30f3df0287aa693ca0570b3..6528b650cd8de36fa3e7b9857143a08996205b39 100644 (file)
@@ -96,8 +96,6 @@
 #include <sstream>
 #include <algorithm>
 
-#include <V3d_Coordinate.hxx>
-
 #include <Standard_Failure.hxx>
 #include <Standard_NullObject.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@@ -1095,7 +1093,7 @@ gp_Pnt GEOMUtils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
   // inside V3d_View::FitMinMax() method. It's by occt design.
   // So, we should use camera direction instead.
 
-  V3d_Coordinate XAt, YAt, ZAt;
+  Standard_Real XAt, YAt, ZAt;
   aView->At(XAt, YAt, ZAt);
   gp_Pnt AtPoint(XAt, YAt, ZAt);
 
index 0ca44c88b1336680ae0ba6058b3f166a885a9068..000aedc76511ceb9a5b7ce7e4ae1c216b5e08404 100644 (file)
 //
 
 
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
+
 #include <GEOMUtils_HTrsfCurve2d.hxx>
 
 namespace GEOMUtils {
@@ -45,3 +49,5 @@ GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
 : myCurve (theCurve, theUFirst, theULast, theTrsf)
 {
 }
+
+#endif
index c7d0f01ac62b3d54096f0d61b7f4e42b7b760a7b..e6d7ba6897735961cfc116a105c24746d41e2bab 100644 (file)
 #define _GEOMUtils_HTrsfCurve2d_HXX_
 
 
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
+
 #include <GEOMUtils_TrsfCurve2d.hxx>
 
 #include <Adaptor2d_HCurve2d.hxx>
@@ -78,3 +82,5 @@ namespace GEOMUtils
 }
 
 #endif
+
+#endif
index 86d47a333d2541888e9e10e5abbd24afaf5b82db..dc8bfdbe929c5e3d3e9ff8f34ca2967ddb197a39 100644 (file)
 
 
 #include <GEOMUtils_TrsfCurve2d.hxx>
+
+#include <Geom2d_BezierCurve.hxx>
+#include <Geom2d_BSplineCurve.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GEOMUtils_HTrsfCurve2d.hxx>
+#else
+IMPLEMENT_STANDARD_RTTIEXT(GEOMUtils::TrsfCurve2d, Adaptor2d_Curve2d)
+#endif
 
 //=======================================================================
 //function : TrsfCurve2d
@@ -134,6 +142,7 @@ void GEOMUtils::TrsfCurve2d::Intervals(TColStd_Array1OfReal &T,
 //function : Trim
 //purpose  :
 //=======================================================================
+#if OCC_VERSION_LARGE < 0x07070000
 Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim
               (const Standard_Real First, const Standard_Real Last,
                const Standard_Real /*Tol*/) const
@@ -144,6 +153,18 @@ Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim
 
   return aAHCurve;
 }
+#else
+Handle(Adaptor2d_Curve2d) GEOMUtils::TrsfCurve2d::Trim
+              (const Standard_Real First, const Standard_Real Last,
+               const Standard_Real /*Tol*/) const
+{
+  Handle(Geom2d_Curve)            aCurve = myCurve.Curve();
+  Handle(GEOMUtils::TrsfCurve2d) aAHCurve =
+    new GEOMUtils::TrsfCurve2d(aCurve, First, Last, myTrsf);
+
+  return aAHCurve;
+}
+#endif
 
 //=======================================================================
 //function : IsClosed
index 9363f5529305ee60db4096e9cd69a9478583d1b2..da9fa20b1986e8122bfe235b597cdddf688fd2bf 100644 (file)
@@ -28,6 +28,8 @@
 #include <TColStd_HArray1OfReal.hxx>
 #include <TopoDS_Face.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 
 namespace GEOMUtils
 {
@@ -37,6 +39,9 @@ namespace GEOMUtils
    */
   class TrsfCurve2d : public Adaptor2d_Curve2d
   {
+#if OCC_VERSION_LARGE >= 0x07070000
+  DEFINE_STANDARD_RTTIEXT(TrsfCurve2d, Adaptor2d_Curve2d)
+#endif
 
   public:
     
@@ -109,7 +114,11 @@ namespace GEOMUtils
     /**
      * Redefined method from the base class.
      */
+#if OCC_VERSION_LARGE < 0x07070000
     Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim
+#else
+    Standard_EXPORT Handle(Adaptor2d_Curve2d) Trim
+#endif
               (const Standard_Real First, const Standard_Real Last,
                const Standard_Real ) const;
 
@@ -233,6 +242,11 @@ namespace GEOMUtils
     Trsf2d              myTrsf;
 
   };
+
+#if OCC_VERSION_LARGE >= 0x07070000
+  DEFINE_STANDARD_HANDLE(TrsfCurve2d, Adaptor2d_Curve2d)
+#endif
+
 }
 
 #endif
index 29a12a13166e9c2eadfe35d49c97f58fb58bc29d..79591763a909b80d29c3add4d0562943d3fecec8 100644 (file)
@@ -57,7 +57,6 @@
 #include <Geom_Line.hxx>
 #include <Geom_Plane.hxx>
 #include <NCollection_Sequence.hxx>
-#include <Quantity_Length.hxx>
 
 //=================================================================================
 // function : Constructor
index 1daff82fc0282ff6c480d572fb96423e7e9d17d4..c7f70433a4c43fa89919ceaf1f2a87648ed0ff28 100644 (file)
@@ -712,15 +712,13 @@ Standard_Boolean GEOM_AISShape::computeMassCenter( const TopoDS_Shape& theShape,
     {
       gp_XY C( 0, 0 );
       double A = 0;
-      const TColgp_Array1OfPnt2d& uvArray = triangulation->UVNodes();
-      const Poly_Array1OfTriangle&  trias = triangulation->Triangles();
       Standard_Integer n1,n2,n3;
-      for ( int iT = trias.Lower(); iT <= trias.Upper(); ++iT )
+      for ( int iT = 1; iT <= triangulation->NbTriangles(); ++iT )
       {
-        trias( iT ).Get( n1,n2,n3 );
-        const gp_Pnt2d& uv1 = uvArray( n1 );
-        const gp_Pnt2d& uv2 = uvArray( n2 );
-        const gp_Pnt2d& uv3 = uvArray( n3 );
+        triangulation->Triangle( iT ).Get( n1,n2,n3 );
+        const gp_Pnt2d& uv1 = triangulation->UVNode( n1 );
+        const gp_Pnt2d& uv2 = triangulation->UVNode( n2 );
+        const gp_Pnt2d& uv3 = triangulation->UVNode( n3 );
         double a = 0.5 * sqrt(( uv1.X() - uv3.X() ) * ( uv2.Y() - uv1.Y() ) -
                               ( uv1.X() - uv2.X() ) * ( uv3.Y() - uv1.Y() ));
         C += ( uv1.XY() + uv2.XY() + uv3.XY() ) / 3. * a;
index 67948a5943f43590845ee8b7f534ff4d1030831f..42fe984179a40cf7d5c5f49b254c8b9742c127b2 100644 (file)
@@ -711,24 +711,21 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
     const OpenGl_Aspects* anAspect = theWorkspace->Aspects();
 
     // getting string size will also initialize font library
-#if OCC_VERSION_LARGE >= 0x07040000
+#if OCC_VERSION_LARGE >= 0x07070000
+    Font_Hinting aFH = theWorkspace->View()->RenderingParams().FontHinting;
     myTextDraw->StringSize( aContext,
-      myText, *anAspect, myTextParams->Height(), aDPI,
+      myText, *anAspect, myTextParams->Height(), aDPI, aFH,
       myTextSize.x, myTextSize.a, myTextSize.d );
 #else
     myTextDraw->StringSize( aContext,
-      myText, *anAspect, myTextParams, aDPI,
+      myText, *anAspect, myTextParams->Height(), aDPI,
       myTextSize.x, myTextSize.a, myTextSize.d );
 #endif
 
     myTextDPI = aDPI;
     myTextSize.y = myTextSize.a - myTextSize.d;
 
-# if OCC_VERSION_LARGE >= 0x07040000
     switch ( myTextParams->HorizontalAlignment() )
-#else
-    switch (myTextParams.HAlign)
-#endif
     {
       case Graphic3d_HTA_LEFT:   myTextUnderline.x() = 0.f; break;
       case Graphic3d_HTA_CENTER: myTextUnderline.x() = -myTextSize.x / 2.f; break;
@@ -737,11 +734,7 @@ void GEOM_Annotation::OpenGl_Annotation::Render( const Handle(OpenGl_Workspace)&
         break;
     }
 
-# if OCC_VERSION_LARGE >= 0x07040000
     switch ( myTextParams->VerticalAlignment() )
-#else
-    switch (myTextParams.VAlign)
-#endif
     {
       case Graphic3d_VTA_TOPFIRSTLINE:
       case Graphic3d_VTA_TOP:    myTextUnderline.y() = -myTextSize.y; break;
index 0dad2a6d85ddf5e7a66ed85443f3c07a5fdf7bc2..3606618fa9e288c77ab4bff55ad8fb26bc5f723c 100644 (file)
@@ -29,6 +29,8 @@
 
 #include <GEOMUtils_Hatcher.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 // VTK Includes
 #include <vtkPoints.h>
 #include <vtkCellArray.h>
 #include <vtkInformationVector.h>
 
 // OpenCASCADE Includes
+#if OCC_VERSION_LARGE < 0x07070000
 #include <Adaptor3d_HCurve.hxx>
+#else
+#include <Adaptor3d_Curve.hxx>
+#endif
 #include <Poly_Triangulation.hxx>
 #include <Poly_Polygon3D.hxx>
 #include <Poly_PolygonOnTriangulation.hxx>
@@ -622,10 +628,9 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
   } else {
     nbnodes = aEdgePoly->NbNodes();
     const TColStd_Array1OfInteger& Nodesidx = aEdgePoly->Nodes();
-    const TColgp_Array1OfPnt& theNodesPoly = T->Nodes();
 
-    aP1 = theNodesPoly(1);
-    aP2 = theNodesPoly(nbnodes);
+    aP1 = T->Node(1);
+    aP2 = T->Node(nbnodes);
 
     float coord[3];
     vtkIdType pts[2];
@@ -634,8 +639,8 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge,
       Standard_Integer id1 = Nodesidx(j);
       Standard_Integer id2 = Nodesidx(j+1);
       
-      gp_Pnt pt1 = theNodesPoly(id1);
-      gp_Pnt pt2 = theNodesPoly(id2);
+      gp_Pnt pt1 = T->Node(id1);
+      gp_Pnt pt2 = T->Node(id2);
           
       if(!isidtrsf) {
         // apply edge transformation
@@ -853,13 +858,10 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
 
     Standard_Integer nbNodesInFace = aPoly->NbNodes();
     Standard_Integer nbTriInFace = aPoly->NbTriangles();
-                
-    const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
-    const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
       
     Standard_Integer i;
     for(i=1;i<=nbNodesInFace;i++) {
-      gp_Pnt P = Nodes(i);
+      gp_Pnt P = aPoly->Node(i);
       float coord[3];
       if(!identity) P.Transform(myTransf);
       coord[0] = P.X(); coord[1] = P.Y(); coord[2] = P.Z();
@@ -870,7 +872,7 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace,
       // Get the triangle
         
       Standard_Integer N1,N2,N3;
-      Triangles(i).Get(N1,N2,N3);
+      aPoly->Triangle(i).Get(N1,N2,N3);
         
       vtkIdType pts[3];
       pts[0] = N1-1; pts[1] = N2-1; pts[2] = N3-1;
index 83928b396919e4615571da662cb5e0cfff18c43a..06a1f68f9e5f8ab715597be58fea1eb9e11672aa 100644 (file)
@@ -138,17 +138,16 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
   } else {
     Standard_Integer aNbNodes = aEdgePoly->NbNodes();
     const TColStd_Array1OfInteger& aNodeIds = aEdgePoly->Nodes();
-    const TColgp_Array1OfPnt& anId2Pnts = T->Nodes();
 
-    aP1 = anId2Pnts(aNodeIds(1));
-    aP2 = anId2Pnts(aNodeIds(aNbNodes));
+    aP1 = T->Node(aNodeIds(1));
+    aP2 = T->Node(aNodeIds(aNbNodes));
 
     for(int j = 1; j < aNbNodes; j++) {
       Standard_Integer id1 = aNodeIds(j);
       Standard_Integer id2 = aNodeIds(j+1);
       
-      gp_Pnt pt1 = anId2Pnts(id1);
-      gp_Pnt pt2 = anId2Pnts(id2);
+      gp_Pnt pt1 = T->Node(id1);
+      gp_Pnt pt2 = T->Node(id2);
           
       if(!isidtrsf) {
         // apply edge transformation
index 7eee99c1e459cbd26ebebb915df4db14680b8fa0..c5f6dbf2fce1bba4f24ed5259abf3b1286f86af6 100644 (file)
@@ -85,21 +85,19 @@ OCC2VTK(const TopoDS_Face& theFace,
       
     Standard_Integer i; 
     int aNbOfNodes = thePts->GetNumberOfPoints();
-    const TColgp_Array1OfPnt& Nodes = aPoly->Nodes();
     Standard_Integer nbNodesInFace = aPoly->NbNodes(); 
     for(i = 1; i <= nbNodesInFace; i++) {
-      gp_Pnt P = Nodes(i);
+      gp_Pnt P = aPoly->Node(i);
       if(!identity) 
         P.Transform(myTransf);
       thePts->InsertNextPoint(P.X(),P.Y(),P.Z());
     }
 
-    const Poly_Array1OfTriangle& Triangles = aPoly->Triangles();
     Standard_Integer nbTriInFace = aPoly->NbTriangles();
     for(i = 1; i <= nbTriInFace; i++){
       // Get the triangle
       Standard_Integer N1,N2,N3;
-      Triangles(i).Get(N1,N2,N3);
+      aPoly->Triangle(i).Get(N1,N2,N3);
       N1 += aNbOfNodes - 1;
       N2 += aNbOfNodes - 1;
       N3 += aNbOfNodes - 1;
index 07575178cfa1adc00937a5895adae28cafe67674..a771d8670c77b513c99ac464f568f21245632d02 100644 (file)
 #include <vtkInformation.h>
 #include <vtkInformationVector.h>
  
-#include <Adaptor3d_HCurve.hxx>
 #include <BRep_Tool.hxx>
 #include <TColStd_Array1OfReal.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
+#include <Adaptor3d_HCurve.hxx>
+#else
+#include <Adaptor3d_Curve.hxx>
+#endif
+
 vtkStandardNewMacro(GEOM_WireframeFace)
  
 GEOM_WireframeFace::GEOM_WireframeFace(): 
index d62d95285ec755d3d0f443a7cc189c2da4d6e331..c8e7a5cb264a5e3c2cc98ef70773b4cf70026bd5 100644 (file)
 #include <ShHealOper_FillHoles.hxx>
 #include <ShapeAnalysis_FreeBounds.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
+#if OCC_VERSION_LARGE < 0x07070000
 #include <BRepAdaptor_HCurve.hxx>
+#endif
 #include <BRep_Builder.hxx>
 #include <BRepFill_CurveConstraint.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
@@ -284,7 +288,11 @@ Handle(Geom_Surface) ShHealOper_FillHoles::buildSurface(const TopoDS_Wire& theWi
 
       TopoDS_Edge ae = TopoDS::Edge(aIter.Value());
       BRepAdaptor_Curve adC(ae);
-      Handle(BRepAdaptor_HCurve) aHAD= new BRepAdaptor_HCurve(adC);
+#if OCC_VERSION_LARGE < 0x07070000
+      Handle(BRepAdaptor_HCurve) aHAD = new BRepAdaptor_HCurve(adC);
+#else
+      Handle(BRepAdaptor_Curve) aHAD = new BRepAdaptor_Curve(adC);
+#endif
       // Handle(BRepFill_CurveConstraint) aConst =
       //     new BRepFill_CurveConstraint (Handle(Adaptor3d_HCurve)::DownCast(aHAD), (Standard_Integer) GeomAbs_C0, myNbPtsOnCur, myTol3d);
       Handle(GeomPlate_CurveConstraint) aConst =