-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
#include <GEOMAlgo_ShellSolid.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <Standard_Failure.hxx>
#include <gp_Pnt2d.hxx>
#include <BOPTools_AlgoTools.hxx>
-#include <BOPCol_DataMapOfShapeListOfShape.hxx>
-#include <BOPCol_ListOfShape.hxx>
-#if OCC_VERSION_LARGE > 0x06070100
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
#include <IntTools_Context.hxx>
-#else
-#include <BOPInt_Context.hxx>
-#endif
#include <BOPDS_DS.hxx>
#include <BOPAlgo_Builder.hxx>
#include <GEOMAlgo_AlgoTools.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
/////////////////////////////////////////////////////////////////////////
//=======================================================================
//class : GEOMAlgo_ShellSolidBuilder
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
};
//=======================================================================
//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
{
-#if OCC_VERSION_LARGE <= 0x07010000
- myErrorStatus=0;
-#endif
- //
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
myContext=myPaveFiller->Context();
//
// 1. CheckData
CheckData();
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
return;
}
//
// 2. Prepare
Prepare();
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
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();
-#if OCC_VERSION_LARGE > 0x07010000
- if (HasErrors()) {
#else
- if (myErrorStatus) {
+ FillImagesVertices(aPS.Next(aSteps.GetStep(PIOperation_TreatVertices)));
#endif
+ if (HasErrors()) {
return;
}
//
BuildResult(TopAbs_VERTEX);
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
return;
}
// 3.2 Edges
+#if OCC_VERSION_LARGE < 0x07070000
FillImagesEdges();
-#if OCC_VERSION_LARGE > 0x07010000
- if (HasErrors()) {
#else
- if (myErrorStatus) {
+ FillImagesEdges(aPS.Next(aSteps.GetStep(PIOperation_TreatEdges)));
#endif
+ if (HasErrors()) {
return;
}
//
BuildResult(TopAbs_EDGE);
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
return;
}
//
// 3.3 Wires
+#if OCC_VERSION_LARGE < 0x07070000
FillImagesContainers(TopAbs_WIRE);
-#if OCC_VERSION_LARGE > 0x07010000
- if (HasErrors()) {
#else
- if (myErrorStatus) {
+ FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps.GetStep(PIOperation_TreatWires)));
#endif
+ if (HasErrors()) {
return;
}
//
BuildResult(TopAbs_WIRE);
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
return;
}
// 3.4 Faces
+#if OCC_VERSION_LARGE < 0x07070000
FillImagesFaces();
-#if OCC_VERSION_LARGE > 0x07010000
- if (HasErrors()) {
#else
- if (myErrorStatus) {
+ FillImagesFaces(aPS.Next(aSteps.GetStep(PIOperation_TreatFaces)));
#endif
+ if (HasErrors()) {
return;
}
//
BuildResult(TopAbs_FACE);
-#if OCC_VERSION_LARGE > 0x07010000
if (HasErrors()) {
-#else
- if (myErrorStatus) {
-#endif
return;
}
}
//=======================================================================
void GEOMAlgo_ShellSolid::Perform()
{
-#if OCC_VERSION_LARGE <= 0x07010000
- myErrorStatus=0;
-#endif
//
try {
Standard_Integer aNbArgs, iRank, iErr, iBeg, iEnd, i, aNbSp;
myErrorStatus=10;
return;
}
-#if OCC_VERSION_LARGE > 0x07010000
if(myDSFiller->HasErrors()) {
-#else
- if(myDSFiller->ErrorStatus()) {
-#endif
myErrorStatus=11;
return;
}
//
const BOPDS_DS& aDS=myDSFiller->DS();
BOPDS_DS* pDS=(BOPDS_DS*)&aDS;
- const BOPCol_ListOfShape& aLS=pDS->Arguments();
+ const TopTools_ListOfShape& aLS=pDS->Arguments();
//
aNbArgs=aLS.Extent();
if (aNbArgs!=2) {
return;
}
//
-#if OCC_VERSION_LARGE > 0x06070100
Handle(IntTools_Context) aCtx=myDSFiller->Context();
-#else
- Handle(BOPInt_Context) aCtx=myDSFiller->Context();
-#endif
const BOPDS_IndexRange& aRange=pDS->Range(iRank);
aRange.Indices(iBeg, iEnd);
const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
GEOMAlgo_ShellSolidBuilder aSSB;
//
aSSB.PerformWithFiller(*myDSFiller);
-#if OCC_VERSION_LARGE > 0x07010000
iErr=aSSB.HasErrors();
-#else
- iErr=aSSB.ErrorStatus();
-#endif
if (iErr) {
myErrorStatus=15;
return;
}
//
- const BOPCol_DataMapOfShapeListOfShape& aImages=aSSB.Images();
+ const TopTools_DataMapOfShapeListOfShape& aImages=aSSB.Images();
//
//-------------------------------
for (i=iBeg; i<=iEnd; ++i) {
aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
}
else {
- const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
+ const TopTools_ListOfShape& aLSp=aImages.Find(aS);
aNbSp=aLSp.Extent();
if (aNbSp>0) {
continue;
}//for (i=iBeg; i<=iEnd; ++i) {
}// try
- catch (Standard_Failure) {
+ catch (Standard_Failure&) {
myErrorStatus=12;
}
}