From 922cc08eea7fdde898b17104ced238c4978c2ec2 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 17 Feb 2023 16:55:49 +0000 Subject: [PATCH] Porting Salome to OCCT 7.7.0 --- src/ARCHIMEDE/Archimede_VolumeSection.cxx | 26 ++++++------- .../AdvancedEngine_SmoothingSurfaceDriver.cxx | 12 ++++++ src/BlockFix/BlockFix_UnionFaces.cxx | 17 ++++++++- src/EntityGUI/EntityGUI_3DSketcherDlg.cxx | 2 +- src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx | 17 ++++----- src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx | 37 ++++++++++++++++++- src/GEOMAlgo/GEOMAlgo_Splitter.cxx | 8 ++++ src/GEOMAlgo/GEOMAlgo_Splitter.hxx | 6 +++ .../GEOMImpl_ICanonicalRecognition.hxx | 8 ++++ src/GEOMImpl/GEOMImpl_PipeDriver.cxx | 10 +++++ src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx | 19 ++++++++-- src/GEOMUtils/GEOMUtils.cxx | 4 +- src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx | 6 +++ src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx | 6 +++ src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx | 21 +++++++++++ src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx | 14 +++++++ .../MeasureGUI_DimensionInteractor.cxx | 1 - src/OBJECT/GEOM_AISShape.cxx | 12 +++--- src/OBJECT/GEOM_Annotation.cxx | 15 ++------ src/OBJECT/GEOM_OCCReader.cxx | 22 ++++++----- src/OCC2VTK/GEOM_EdgeSource.cxx | 9 ++--- src/OCC2VTK/GEOM_ShadingFace.cxx | 6 +-- src/OCC2VTK/GEOM_WireframeFace.cxx | 9 ++++- src/ShHealOper/ShHealOper_FillHoles.cxx | 10 ++++- 24 files changed, 223 insertions(+), 74 deletions(-) diff --git a/src/ARCHIMEDE/Archimede_VolumeSection.cxx b/src/ARCHIMEDE/Archimede_VolumeSection.cxx index c4a9479a3..ccf381aa8 100644 --- a/src/ARCHIMEDE/Archimede_VolumeSection.cxx +++ b/src/ARCHIMEDE/Archimede_VolumeSection.cxx @@ -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 diff --git a/src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx b/src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx index 42134d10b..19c90b578 100644 --- a/src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx +++ b/src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx @@ -41,7 +41,13 @@ #include #include +#include + +#if OCC_VERSION_LARGE < 0x07070000 #include +#else +#include +#endif #include #include @@ -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; diff --git a/src/BlockFix/BlockFix_UnionFaces.cxx b/src/BlockFix/BlockFix_UnionFaces.cxx index 294deb224..8a30a7e23 100644 --- a/src/BlockFix/BlockFix_UnionFaces.cxx +++ b/src/BlockFix/BlockFix_UnionFaces.cxx @@ -73,9 +73,13 @@ #include +#if OCC_VERSION_LARGE < 0x07070000 #include -#include +#else +#include +#endif +#include #include #include #include @@ -85,7 +89,9 @@ #include #include #include +#if OCC_VERSION_LARGE < 0x07070000 #include +#endif #include #include #include @@ -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(); diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx index 780550c88..84c25577c 100644 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx @@ -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) diff --git a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx index e7041f483..792aff616 100644 --- a/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx @@ -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; jNode(aIndex).Transformed(aTrsf); aLP.Append(aP); } } diff --git a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx index a75b8c784..357bf28f8 100644 --- a/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx +++ b/src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx @@ -55,6 +55,9 @@ #include #include + +#include + ///////////////////////////////////////////////////////////////////////// //======================================================================= //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; } diff --git a/src/GEOMAlgo/GEOMAlgo_Splitter.cxx b/src/GEOMAlgo/GEOMAlgo_Splitter.cxx index fbd3fbfce..8cfe54618 100644 --- a/src/GEOMAlgo/GEOMAlgo_Splitter.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Splitter.cxx @@ -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 diff --git a/src/GEOMAlgo/GEOMAlgo_Splitter.hxx b/src/GEOMAlgo/GEOMAlgo_Splitter.hxx index 0719a4d9b..d79539e9b 100644 --- a/src/GEOMAlgo/GEOMAlgo_Splitter.hxx +++ b/src/GEOMAlgo/GEOMAlgo_Splitter.hxx @@ -42,6 +42,8 @@ #include +#include + //======================================================================= //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; diff --git a/src/GEOMImpl/GEOMImpl_ICanonicalRecognition.hxx b/src/GEOMImpl/GEOMImpl_ICanonicalRecognition.hxx index b4d482dcf..b75b0a7b7 100644 --- a/src/GEOMImpl/GEOMImpl_ICanonicalRecognition.hxx +++ b/src/GEOMImpl/GEOMImpl_ICanonicalRecognition.hxx @@ -30,6 +30,14 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + #include class GEOM_Object; diff --git a/src/GEOMImpl/GEOMImpl_PipeDriver.cxx b/src/GEOMImpl/GEOMImpl_PipeDriver.cxx index 48d7d732e..278a83964 100644 --- a/src/GEOMImpl/GEOMImpl_PipeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PipeDriver.cxx @@ -34,6 +34,8 @@ #include +#include + #include #include #include @@ -85,7 +87,11 @@ #include #include #include +#if OCC_VERSION_LARGE < 0x07070000 #include +#else +#include +#endif #include #include #include @@ -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); diff --git a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx index 0929093d9..9bd97d9f5 100644 --- a/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx @@ -24,13 +24,20 @@ #include +#include + #include #include #include #include #include #include + +#if OCC_VERSION_LARGE < 0x07070000 #include +#else +#include +#endif #include #include @@ -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; diff --git a/src/GEOMUtils/GEOMUtils.cxx b/src/GEOMUtils/GEOMUtils.cxx index 24d7318c0..6528b650c 100644 --- a/src/GEOMUtils/GEOMUtils.cxx +++ b/src/GEOMUtils/GEOMUtils.cxx @@ -96,8 +96,6 @@ #include #include -#include - #include #include #include // 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); diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx index 0ca44c88b..000aedc76 100644 --- a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx +++ b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx @@ -18,6 +18,10 @@ // +#include + +#if OCC_VERSION_LARGE < 0x07070000 + #include namespace GEOMUtils { @@ -45,3 +49,5 @@ GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve, : myCurve (theCurve, theUFirst, theULast, theTrsf) { } + +#endif diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx index c7d0f01ac..e6d7ba689 100644 --- a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx +++ b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx @@ -21,6 +21,10 @@ #define _GEOMUtils_HTrsfCurve2d_HXX_ +#include + +#if OCC_VERSION_LARGE < 0x07070000 + #include #include @@ -78,3 +82,5 @@ namespace GEOMUtils } #endif + +#endif diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx index 86d47a333..dc8bfdbe9 100644 --- a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx +++ b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx @@ -19,7 +19,15 @@ #include + +#include +#include + +#if OCC_VERSION_LARGE < 0x07070000 #include +#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 diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx index 9363f5529..da9fa20b1 100644 --- a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx +++ b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx @@ -28,6 +28,8 @@ #include #include +#include + 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 diff --git a/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx b/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx index 29a12a131..79591763a 100644 --- a/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx +++ b/src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx @@ -57,7 +57,6 @@ #include #include #include -#include //================================================================================= // function : Constructor diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index 1daff82fc..c7f70433a 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -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; diff --git a/src/OBJECT/GEOM_Annotation.cxx b/src/OBJECT/GEOM_Annotation.cxx index 67948a594..42fe98417 100644 --- a/src/OBJECT/GEOM_Annotation.cxx +++ b/src/OBJECT/GEOM_Annotation.cxx @@ -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; diff --git a/src/OBJECT/GEOM_OCCReader.cxx b/src/OBJECT/GEOM_OCCReader.cxx index 0dad2a6d8..3606618fa 100644 --- a/src/OBJECT/GEOM_OCCReader.cxx +++ b/src/OBJECT/GEOM_OCCReader.cxx @@ -29,6 +29,8 @@ #include +#include + // VTK Includes #include #include @@ -39,7 +41,11 @@ #include // OpenCASCADE Includes +#if OCC_VERSION_LARGE < 0x07070000 #include +#else +#include +#endif #include #include #include @@ -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; diff --git a/src/OCC2VTK/GEOM_EdgeSource.cxx b/src/OCC2VTK/GEOM_EdgeSource.cxx index 83928b396..06a1f68f9 100644 --- a/src/OCC2VTK/GEOM_EdgeSource.cxx +++ b/src/OCC2VTK/GEOM_EdgeSource.cxx @@ -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 diff --git a/src/OCC2VTK/GEOM_ShadingFace.cxx b/src/OCC2VTK/GEOM_ShadingFace.cxx index 7eee99c1e..c5f6dbf2f 100644 --- a/src/OCC2VTK/GEOM_ShadingFace.cxx +++ b/src/OCC2VTK/GEOM_ShadingFace.cxx @@ -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; diff --git a/src/OCC2VTK/GEOM_WireframeFace.cxx b/src/OCC2VTK/GEOM_WireframeFace.cxx index 07575178c..a771d8670 100644 --- a/src/OCC2VTK/GEOM_WireframeFace.cxx +++ b/src/OCC2VTK/GEOM_WireframeFace.cxx @@ -31,10 +31,17 @@ #include #include -#include #include #include +#include + +#if OCC_VERSION_LARGE < 0x07070000 +#include +#else +#include +#endif + vtkStandardNewMacro(GEOM_WireframeFace) GEOM_WireframeFace::GEOM_WireframeFace(): diff --git a/src/ShHealOper/ShHealOper_FillHoles.cxx b/src/ShHealOper/ShHealOper_FillHoles.cxx index d62d95285..c8e7a5cb2 100644 --- a/src/ShHealOper/ShHealOper_FillHoles.cxx +++ b/src/ShHealOper/ShHealOper_FillHoles.cxx @@ -29,9 +29,13 @@ #include #include +#include + #include #include +#if OCC_VERSION_LARGE < 0x07070000 #include +#endif #include #include #include @@ -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 = -- 2.39.2