X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_BooleanFuse.cpp;h=77d5bcefd8a04c5d50aa76ab55bcaf930a492a1f;hb=77c4c0ec3be9f797e9f29212864bf3b6ac2e76a1;hp=04194d5b10c1acd26516246a8254efd8b3ca2857;hpb=8607b62ba4fd0681fe1f406efed0ad0a48a382e0;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp index 04194d5b1..77d5bcefd 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp @@ -41,8 +41,6 @@ #include #include -static const int THE_FUSE_VERSION_1 = 20190506; - //================================================================================================== FeaturesPlugin_BooleanFuse::FeaturesPlugin_BooleanFuse() : FeaturesPlugin_Boolean(FeaturesPlugin_Boolean::BOOL_FUSE) @@ -62,14 +60,14 @@ void FeaturesPlugin_BooleanFuse::initAttributes() ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), OBJECT_LIST_ID()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TOOL_LIST_ID()); - initVersion(THE_FUSE_VERSION_1, selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID())); + initVersion(BOP_VERSION_9_4(), selectionList(OBJECT_LIST_ID()), selectionList(TOOL_LIST_ID())); } //================================================================================================== void FeaturesPlugin_BooleanFuse::execute() { std::string anError; - ObjectHierarchy anObjectsHierarchy, aToolsHierarchy; + GeomAPI_ShapeHierarchy anObjectsHierarchy, aToolsHierarchy; ListOfShape aPlanes; bool isSimpleCreation = false; @@ -92,9 +90,9 @@ void FeaturesPlugin_BooleanFuse::execute() ListOfShape anObjects, aTools, anEdgesAndFaces; // all objects except edges and faces - anObjectsHierarchy.ObjectsByType(anEdgesAndFaces, anObjects, + anObjectsHierarchy.objectsByType(anEdgesAndFaces, anObjects, GeomAPI_Shape::FACE, GeomAPI_Shape::EDGE); - aToolsHierarchy.ObjectsByType(anEdgesAndFaces, aTools, + aToolsHierarchy.objectsByType(anEdgesAndFaces, aTools, GeomAPI_Shape::FACE, GeomAPI_Shape::EDGE); if ((anObjects.size() + aTools.size() + anEdgesAndFaces.size()) < 2) { @@ -104,7 +102,7 @@ void FeaturesPlugin_BooleanFuse::execute() } // version of FUSE feature - int aFuseVersion = version(); + const std::string aFuseVersion = data()->version(); // Collecting all solids which will be fused. ListOfShape aSolidsToFuse; @@ -113,20 +111,20 @@ void FeaturesPlugin_BooleanFuse::execute() // Collecting solids from compsolids which will not be modified // in boolean operation and will be added to result. - bool isProcessCompsolid = !isSimpleCreation || aFuseVersion >= THE_FUSE_VERSION_1; + bool isProcessCompsolid = !isSimpleCreation || !aFuseVersion.empty(); ListOfShape aShapesToAdd; - for (ObjectHierarchy::Iterator anObjectsIt = anObjectsHierarchy.Begin(); - isProcessCompsolid && anObjectsIt != anObjectsHierarchy.End(); + for (GeomAPI_ShapeHierarchy::iterator anObjectsIt = anObjectsHierarchy.begin(); + isProcessCompsolid && anObjectsIt != anObjectsHierarchy.end(); ++anObjectsIt) { GeomShapePtr anObject = *anObjectsIt; - GeomShapePtr aParent = anObjectsHierarchy.Parent(anObject, false); + GeomShapePtr aParent = anObjectsHierarchy.parent(anObject, false); if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID) { // mark all subs of this parent as precessed to avoid handling twice - aParent = anObjectsHierarchy.Parent(anObject); + aParent = anObjectsHierarchy.parent(anObject); ListOfShape aUsed, aNotUsed; - anObjectsHierarchy.SplitCompound(aParent, aUsed, aNotUsed); + anObjectsHierarchy.splitCompound(aParent, aUsed, aNotUsed); aShapesToAdd.insert(aShapesToAdd.end(), aNotUsed.begin(), aNotUsed.end()); } } @@ -236,7 +234,7 @@ void FeaturesPlugin_BooleanFuse::execute() aMakeShapeList->appendAlgo(aUnifyAlgo); } - if (aFuseVersion == THE_FUSE_VERSION_1) { + if (aFuseVersion == BOP_VERSION_9_4()) { // merge hierarchies of compounds containing objects and tools // and append the result of the FUSE operation aShape = keepUnusedSubsOfCompound(aShape, anObjectsHierarchy, aToolsHierarchy, aMakeShapeList);