Salome HOME
Porting Salome to OCCT 7.7.0
authorjfa <jfa@opencascade.com>
Mon, 20 Feb 2023 17:21:19 +0000 (17:21 +0000)
committerGérald NICOLAS <gerald.nicolas@edf.fr>
Tue, 11 Apr 2023 13:28:12 +0000 (15:28 +0200)
src/GeomAPI/GeomAPI_Face.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx
src/GeomAlgoImpl/GEOMAlgo_Splitter.hxx
src/ModuleBase/ModuleBase_Tools.cpp
src/PartSet/PartSet_FieldStepPrs.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Tools.cpp

index 21d99ecc10d1c28345abbf7773c1c73f4f3938fc..1ba00d29bb558817d63b8d380e591e4117bb57a6 100644 (file)
@@ -28,6 +28,8 @@
 #include "GeomAPI_Cone.h"
 #include "GeomAPI_Torus.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Bnd_Box2d.hxx>
 #include <BndLib_Add2dCurve.hxx>
 #include <BOPTools_AlgoTools.hxx>
@@ -47,7 +49,6 @@
 #include <Geom_SurfaceOfRevolution.hxx>
 #include <Geom_SweptSurface.hxx>
 #include <Geom_ToroidalSurface.hxx>
-#include <GeomAdaptor_HSurface.hxx>
 #include <GeomAPI_ExtremaCurveCurve.hxx>
 #include <GeomLib_IsPlanarSurface.hxx>
 #include <IntPatch_ImpImpIntersection.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Face.hxx>
 
+#if OCC_VERSION_LARGE < 0x07070000
+#include <GeomAdaptor_HSurface.hxx>
+#else
+#include <GeomAdaptor_Surface.hxx>
+#endif
+
 #include <gp_Sphere.hxx>
 #include <gp_Cylinder.hxx>
 #include <gp_Cone.hxx>
@@ -156,8 +163,13 @@ bool GeomAPI_Face::isSameGeometry(const std::shared_ptr<GeomAPI_Shape> theShape)
   if (anOwnSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)) &&
       anOtherSurf->IsKind(STANDARD_TYPE(Geom_ElementarySurface)))
   {
+#if OCC_VERSION_LARGE < 0x07070000
     Handle(GeomAdaptor_HSurface) aGA1 = new GeomAdaptor_HSurface(anOwnSurf);
     Handle(GeomAdaptor_HSurface) aGA2 = new GeomAdaptor_HSurface(anOtherSurf);
+#else
+    Handle(GeomAdaptor_Surface) aGA1 = new GeomAdaptor_Surface(anOwnSurf);
+    Handle(GeomAdaptor_Surface) aGA2 = new GeomAdaptor_Surface(anOtherSurf);
+#endif
 
     Handle(BRepTopAdaptor_TopolTool) aTT1 = new BRepTopAdaptor_TopolTool();
     Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
index d6baade6e733544a5ae4135770cd4e1669930085..d4996e38ba9eedc6bd07dcaf75dfc9c62bd3257b 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "GeomAlgoAPI_SketchBuilder.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GeomAPI_Ax1.h>
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Dir.h>
 #include <Geom_Plane.hxx>
 #include <Geom_RectangularTrimmedSurface.hxx>
 
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GeomAdaptor_HCurve.hxx>
+#else
+#include <GeomAdaptor_Curve.hxx>
+#endif
 
 #include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <GeomAPI_ShapeIterator.h>
@@ -1303,7 +1309,11 @@ std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_ShapeTools::wireToEdge(
       static const int THE_MAX_INTERVALS = 32;
       double aFirst, aLast;
       Handle(Geom_Curve) aCurve = BRep_Tool::Curve(aNewEdge, aFirst, aLast);
+#if OCC_VERSION_LARGE < 0x07070000
       Handle(GeomAdaptor_HCurve) aHCurve = new GeomAdaptor_HCurve(aCurve);
+#else
+      Handle(GeomAdaptor_Curve) aHCurve = new GeomAdaptor_Curve(aCurve);
+#endif
       Approx_CurvilinearParameter anApprox(aHCurve, Precision::Confusion(), aCurve->Continuity(),
                                            THE_MAX_DEGREE, THE_MAX_INTERVALS);
       if (anApprox.HasResult()) {
index a666a3768927e656fc489eda2e7c8a83e5094582..e7b8adb3808b98a9a4adbdd8357235eefdcefac1 100644 (file)
@@ -166,7 +166,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;
@@ -268,7 +272,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 6b9b396e45970612f4454aef9c9b392e9ccfa862..7237d65f6449d6d508284d38e9ab7c55a8da1164 100644 (file)
@@ -35,6 +35,8 @@
 
 #include <BOPAlgo_Builder.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 //=======================================================================
 //class    : GEOMAlgo_Splitter
 //purpose  :
   GEOMALGOIMPL_EXPORT virtual void BuildResult(const TopAbs_ShapeEnum theType);
 
   /// Post processing of the calculation
+#if OCC_VERSION_LARGE < 0x07070000
   GEOMALGOIMPL_EXPORT virtual void PostTreat();
+#else
+  GEOMALGOIMPL_EXPORT virtual void PostTreat(const Message_ProgressRange& theRange);
+#endif
   
  protected:
    /// List of tools
index 60c1bb579c72a8f7f22a1fedcfb1201e7baea640..5ac621e1bbd7dca85287971a3017f678318950b7 100644 (file)
@@ -56,6 +56,8 @@
 #include <ModelGeomAlgo_Point2D.h>
 #include <SUIT_ResourceMgr.h>
 
+#include <Basics_OCCTVersion.hxx>
+
 #ifdef HAVE_SALOME
 #include <SUIT_Application.h>
 #include <SUIT_Session.h>
@@ -1235,11 +1237,19 @@ void setPointBallHighlighting(AIS_InteractiveObject* theAIS)
       anAspect = aPntAspect->Aspect();
       anAspect->SetType(Aspect_TOM_BALL);
     } else {
+#if OCC_VERSION_LARGE < 0x07070000
       if(aPixMap->Format() == Image_PixMap::ImgGray) {
         aPixMap->SetFormat (Image_PixMap::ImgAlpha);
       } else if(aPixMap->Format() == Image_PixMap::ImgGrayF) {
         aPixMap->SetFormat (Image_PixMap::ImgAlphaF);
       }
+#else
+      if(aPixMap->Format() == Image_Format_Gray) {
+        aPixMap->SetFormat (Image_Format_Alpha);
+      } else if(aPixMap->Format() == Image_Format_GrayF) {
+        aPixMap->SetFormat (Image_Format_AlphaF);
+      }
+#endif
       anAspect = new Graphic3d_AspectMarker3d(aPixMap);
       aPntAspect->SetAspect(anAspect);
     }
index a73f4779840e9cc9c809512a845be71924ff69e9..b435b1f871509d4c76faef4687bc8f3ddcaa319d 100644 (file)
@@ -38,7 +38,7 @@
 #include <TopoDS_Vertex.hxx>
 #include <TopExp_Explorer.hxx>
 #include <Graphic3d_Text.hxx>
-
+#include <Graphic3d_AspectText3d.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape);
 
@@ -318,14 +318,12 @@ bool PartSet_FieldStepPrs::computeMassCenter(const TopoDS_Shape& theShape, gp_Pn
     if (!triangulation.IsNull() && triangulation->HasUVNodes()) {
       gp_XY C(0, 0);
       double A = 0;
-      const TColgp_Array1OfPnt2d& uvArray = triangulation->UVNodes();
-      const Poly_Array1OfTriangle&  trias = triangulation->Triangles();
       int n1, n2, n3;
-      for (int iT = trias.Lower(); iT <= trias.Upper(); ++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);
+      for (int iT = 1; iT <= triangulation->NbTriangles(); ++iT) {
+        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 76bafe5f6b1cc2c22eadd5b143e0120c2a7e6684..8292e70d6f6a86c708f5301bba1c18867dd2fe1f 100644 (file)
 
 #include <SUIT_ResourceMgr.h>
 
+#include <Basics_OCCTVersion.hxx>
+
 #define FEATURE_ITEM_COLOR "0,0,225"
 
 
@@ -1474,7 +1476,11 @@ void PartSet_Module::setTexture(const AISObjectPtr& thePrs,
 
       //aPixmap = OCCViewer_Utilities::imageToPixmap( px.toImage());
       Handle(Image_PixMap) aPixmap = new Image_PixMap();
+#if OCC_VERSION_LARGE < 0x07070000
       aPixmap->InitTrash(Image_PixMap::ImgBGRA, aWidth, aHeight);
+#else
+      aPixmap->InitTrash(Image_Format_BGRA, aWidth, aHeight);
+#endif
       std::list<unsigned char>::iterator aByteIter = aByteList.begin();
       for (int aLine = 0; aLine < aHeight; ++aLine) {
         // convert pixels from ARGB to renderer-compatible RGBA
index 6db3bb34ac4b4ce1ea3ff6d4ddfe11da6be9e263..7e77f8c992d564b4a3a2ea1157e116b8fe4c722f 100644 (file)
@@ -93,7 +93,6 @@
 #include <AIS_InteractiveObject.hxx>
 #include <StdSelect_BRepOwner.hxx>
 #include <SelectMgr_IndexedMapOfOwner.hxx>
-#include <V3d_Coordinate.hxx>
 
 #include <QMouseEvent>
 
@@ -115,7 +114,7 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV
   if (theView.IsNull())
     return gp_Pnt();
 
-  V3d_Coordinate XAt, YAt, ZAt;
+  Standard_Real XAt, YAt, ZAt;
   theView->At(XAt, YAt, ZAt);
   gp_Pnt AtPoint(XAt, YAt, ZAt);
 
@@ -157,7 +156,7 @@ Handle(V3d_View) theView,
   gp_Vec aVec(anOriginPnt, thePoint);
 
   if (!theView.IsNull()) {
-    V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt;
+    Standard_Real XEye, YEye, ZEye, XAt, YAt, ZAt;
     theView->Eye(XEye, YEye, ZEye);
 
     theView->At(XAt, YAt, ZAt);