Salome HOME
An attempt of porting to current OCCT.
authornds <nds@opencascade.com>
Fri, 3 Nov 2017 12:27:15 +0000 (15:27 +0300)
committernds <nds@opencascade.com>
Fri, 3 Nov 2017 12:27:15 +0000 (15:27 +0300)
12 files changed:
src/GeomAPI/GeomAPI_AISObject.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Partition.cpp
src/GeomAlgoAPI/GeomAlgoAPI_PaveFiller.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp
src/GeomAlgoImpl/GEOMAlgo_Splitter.cxx
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_ViewerFilters.cpp
src/PartSet/PartSet_Tools.cpp
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/XGUI/XGUI_Displayer.cpp

index a94c7b4255f3c6a289a233030f82d7d8ce1326d9..c323a7835704631979c04f3dd8fefb1755444a3a 100644 (file)
@@ -388,7 +388,8 @@ void GeomAPI_AISObject::getColor(int& theR, int& theG, int& theB)
   if (anAIS.IsNull())
     return;
 
-  Quantity_Color aColor = anAIS->Color();
+  Quantity_Color aColor;
+  anAIS->Color(aColor);
   theR = (int)(aColor.Red()*255.);
   theG = (int)(aColor.Green()*255.);
   theB = (int)(aColor.Blue()*255.);
index 64dcb89497206d838606d3d604baafe6d84f9c79..7ef54d5d6be0032e4e8401503ef55ca36c8f6acc 100644 (file)
@@ -86,9 +86,14 @@ void GeomAlgoAPI_Boolean::build(const ListOfShape& theObjects,
 
   // Building and getting result.
   aBuilder->Perform();
+#ifdef USE_OCCT_720
+  if (aBuilder->HasErrors())
+    return;
+#else
   if(aBuilder->ErrorStatus() != 0) {
     return;
   }
+#endif
   TopoDS_Shape aResult = aBuilder->Shape();
 
   if(aResult.ShapeType() == TopAbs_COMPOUND) {
index cd880734a65e4c56d03250784d6417e39b525aa8..4222649a85985b9020fecba800ecdfe539c93779 100644 (file)
@@ -102,9 +102,14 @@ void GeomAlgoAPI_Partition::build(const ListOfShape& theObjects,
 
   // Building and getting result.
   anOperation->Perform();
+#ifdef USE_OCCT_720
+  if (anOperation->HasErrors())
+    return;
+#else
   if(anOperation->ErrorStatus() != 0) {
     return;
   }
+#endif
   TopoDS_Shape aResult = anOperation->Shape();
 
   if(aResult.ShapeType() == TopAbs_COMPOUND) {
index aada7a927aa49d8eb01fbf36bdf45befbe6d62cf..9b61619a30c2624525a9fee8cf5489fd9e9379b2 100644 (file)
@@ -55,20 +55,30 @@ void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
   }
   aPaveFiller.SetArguments(aListOfShape);
   aPaveFiller.Perform();
+#ifdef USE_OCCT_720
+  if (aPaveFiller.HasErrors())
+    return;
+#else
   Standard_Integer iErr = aPaveFiller.ErrorStatus();
   if(iErr) {
     return;
   }
+#endif
 
   BOPAlgo_Builder* aBuilder = new BOPAlgo_Builder();
   this->setImpl(aBuilder);
   this->setBuilderType(OCCT_BOPAlgo_Builder);
   aBuilder->SetArguments(aListOfShape);
   aBuilder->PerformWithFiller(aPaveFiller);
+#ifdef USE_OCCT_720
+  if (aBuilder->HasErrors())
+    return;
+#else
   iErr = aBuilder->ErrorStatus();
   if(iErr) {
     return;
   }
+#endif
 
   TopoDS_Shape aResult = aBuilder->Shape();
   if(aResult.ShapeType() == TopAbs_COMPOUND) {
index d798b50ad00687b5f6cbe53edd6701623740dca3..eeebf25b04ad6c48d2e47821e8ba646dfff87b69 100644 (file)
@@ -821,8 +821,13 @@ void GeomAlgoAPI_ShapeTools::splitShape(const std::shared_ptr<GeomAPI_Shape>& th
   }
 
   aBOP.Perform();
+#ifdef USE_OCCT_720
+  if (aBOP.HasErrors())
+    return;
+#else
   if (aBOP.ErrorStatus())
     return;
+#endif
 
   // Collect splits
   const TopTools_ListOfShape& aSplits = aBOP.Modified(aBaseEdge);
@@ -866,8 +871,13 @@ void GeomAlgoAPI_ShapeTools::splitShape_p(const std::shared_ptr<GeomAPI_Shape>&
   }
 
   aBOP.Perform();
+#ifdef USE_OCCT_720
+  if (aBOP.HasErrors())
+    return;
+#else
   if (aBOP.ErrorStatus())
     return;
+#endif
 
   // Collect splits
   const TopTools_ListOfShape& aSplits = aBOP.Modified(aBaseEdge);
index c4bf9d6f38d37039a245433249aeb4b5a9997624..eadaee6c6cce7317ae3b0bcb3205afd579fbbdbf 100644 (file)
@@ -218,9 +218,13 @@ void GeomAlgoAPI_SketchBuilder::createFaces(
       aBB.AddArgument(anEdge);
   }
   aBB.Perform();
+#ifdef USE_OCCT_720
+  if (aBB.HasErrors())
+    return;
+#else
   if (aBB.ErrorStatus())
     return;
-
+#endif
   // Collect faces
   TopTools_ListOfShape anAreas = aBB.Modified(aPlnFace);
   sortFaces(anAreas, theFeatures); // sort faces by the edges in them
index f03f0594cefc786256d6081bd62331b6f8be875e..364834d40408dee94994d04ad16b54d7ba64d637 100755 (executable)
@@ -143,7 +143,9 @@ void GEOMAlgo_Splitter::Clear()
 //=======================================================================
 void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType)
 {
+#ifndef USE_OCCT_720
   myErrorStatus=0;
+#endif
   //
   TopAbs_ShapeEnum aType;
   BRep_Builder aBB;
index 108ad1681f51bbbddf5d8a659bcbe9718c1ef3d7..dbf0f252b4d8461e7697f871ab242ea101f22b11 100755 (executable)
@@ -1103,6 +1103,9 @@ void setPointBallHighlighting(AIS_Shape* theAIS)
 
   Handle(Graphic3d_AspectMarker3d) anAspect;
   Handle(Prs3d_Drawer) aDrawer = theAIS->HilightAttributes();
+#ifdef USE_OCCT_720
+  // to do: implement ball highlighting, in 7.2.0 this drawer is NULL
+#else
   if(aDrawer->HasOwnPointAspect()) {
     Handle(Prs3d_PointAspect) aPntAspect = aDrawer->PointAspect();
     if(aPixMap->IsEmpty()) {
@@ -1120,6 +1123,7 @@ void setPointBallHighlighting(AIS_Shape* theAIS)
     aDrawer->SetPointAspect(aPntAspect);
     theAIS->SetHilightAttributes(aDrawer);
   }
+#endif
 }
 
 } // namespace ModuleBase_Tools
index 0686c1d7bffa6950acd0d5deba83faefd3b7d764..3f7b3a3ad5fc853519475e166c67e8d0d0580151 100644 (file)
@@ -156,6 +156,12 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
             const Prs3d_DatumParts& aPart = aTrOwner->DatumPart();
             if (aPart >= Prs3d_DP_XAxis && aPart <= Prs3d_DP_ZAxis)
             {
+#ifdef USE_OCCT_720
+              gp_Ax2 anAxis = aTrihedron->Component()->Ax2();
+              gp_Dir aDir = anAxis.XDirection();
+              gp_Lin aLine(aTrihedron->Component()->Location(), aDir);
+              return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());
+#else
               Handle(Prs3d_Drawer) aDrawer = aTrihedron->Attributes();
               Handle(Prs3d_DatumAspect) aDatumAspect = aDrawer->DatumAspect();
               Handle(Graphic3d_ArrayOfPrimitives) aPrimitives =
@@ -167,6 +173,7 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(
               gp_Pnt aPnt2(aX2, anY2, aZ2);
               gp_Lin aLine(aPnt1, gp_Dir(gp_Vec(aPnt1, aPnt2)));
               return aPlane.Contains(aLine, Precision::Confusion(), Precision::Angular());
+#endif
             }
           }
         }
index d7c4812d02a6325b3b57d505225b89c74c6647bb..dac76b8e98286ecada62e6c7adf612516a757e53 100755 (executable)
@@ -90,6 +90,7 @@
 #include <AIS_InteractiveObject.hxx>
 #include <StdSelect_BRepOwner.hxx>
 #include <SelectMgr_IndexedMapOfOwner.hxx>
+#include <V3d_Coordinate.hxx>
 
 #include <QMouseEvent>
 
index 69ece0e8709d00810999da8df422b108f0a4d21d..8d7ea1581f67f9e353e856bedbe4a529db9f3f26 100644 (file)
@@ -139,7 +139,9 @@ void SketcherPrs_Coincident::SetColor(const Quantity_NameOfColor aCol)
 void SketcherPrs_Coincident::SetColor(const Quantity_Color &aCol)
 {
   hasOwnColor=Standard_True;
+#ifndef USE_OCCT_720
   myOwnColor=aCol;
+#endif
 }
 
 void SketcherPrs_Coincident::SetCustomColor(const std::vector<int>& theColor)
index 4a9582d29d38ed7ba2c964a79f6ae7f605a3e54d..eb2b6bbc7dd0c82ed90391fe41cce9ffff6d72da 100644 (file)
@@ -1518,7 +1518,7 @@ void XGUI_Displayer::displayTrihedron(bool theToDisplay) const
   } else {
     deactivateTrihedron(false);
 
-    aContext->Erase(aTrihedron);
+    aContext->Erase(aTrihedron, Standard_True);
     #ifdef TINSPECTOR
     if (getCallBack()) getCallBack()->Remove(aTrihedron);
     #endif