X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Partition.cpp;h=9c348199b3b9f2aa3bb571002395635f1b796991;hb=a13f87935d2a6f52f942790b6abc874f1016c9fc;hp=58b3784e933ceca8d75408aa84dbfe381128a56d;hpb=524d88b5c908ef4995ddd2b3975a4333a6db558d;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index 58b3784e9..9c348199b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -64,23 +64,23 @@ void FeaturesPlugin_Partition::initAttributes() //================================================================================================= void FeaturesPlugin_Partition::execute() { - ObjectHierarchy anObjects; + GeomAPI_ShapeHierarchy anObjects; ListOfShape aPlanes; // Getting objects. processAttribute(BASE_OBJECTS_ID(), anObjects, aPlanes); - if(anObjects.IsEmpty()) { + if(anObjects.empty()) { static const std::string aFeatureError = "Error: No objects for partition."; setError(aFeatureError); return; } - ListOfShape aBaseObjects = anObjects.Objects(); + ListOfShape aBaseObjects = anObjects.objects(); aBaseObjects.insert(aBaseObjects.end(), aPlanes.begin(), aPlanes.end()); // resize planes to the bounding box of operated shapes std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); - resizePlanes(anObjects.Objects(), aPlanes, aMakeShapeList); + resizePlanes(anObjects.objects(), aPlanes, aMakeShapeList); // cut unused solids of composolids from the objects of partition ListOfShape aTargetObjects, anUnusedSubs; @@ -147,7 +147,7 @@ void FeaturesPlugin_Partition::execute() } GeomShapePtr aResultCompound = - keepUnusedSubsOfCompound(aFirstShape, anObjects, ObjectHierarchy(), aMakeShapeList); + keepUnusedSubsOfCompound(aFirstShape, anObjects, GeomAPI_ShapeHierarchy(), aMakeShapeList); if (anIt.more()) { if (aResultCompound->shapeType() != GeomAPI_Shape::COMPOUND) { @@ -234,7 +234,7 @@ static bool cutSubs(ListOfShape& theSubsToCut, } bool FeaturesPlugin_Partition::cutSubs( - FeaturesPlugin_Partition::ObjectHierarchy& theHierarchy, + GeomAPI_ShapeHierarchy& theHierarchy, ListOfShape& theUsed, ListOfShape& theNotUsed, std::shared_ptr& theMakeShapeList, @@ -243,14 +243,14 @@ bool FeaturesPlugin_Partition::cutSubs( theUsed.clear(); theNotUsed.clear(); - ObjectHierarchy::Iterator anIt = theHierarchy.Begin(); + GeomAPI_ShapeHierarchy::iterator anIt = theHierarchy.begin(); // compose a set of tools for the CUT operation: // find the list of unused subs of the first argument or use itself ListOfShape aToolsForUsed, aToolsForUnused; - GeomShapePtr aFirstArgument = theHierarchy.Parent(*anIt, false); + GeomShapePtr aFirstArgument = theHierarchy.parent(*anIt, false); if (aFirstArgument && aFirstArgument->shapeType() == GeomAPI_Shape::COMPSOLID) { - theHierarchy.SplitCompound(aFirstArgument, theUsed, aToolsForUsed); + theHierarchy.splitCompound(aFirstArgument, theUsed, aToolsForUsed); theNotUsed = aToolsForUsed; } else { @@ -261,13 +261,13 @@ bool FeaturesPlugin_Partition::cutSubs( // cut subs bool isOk = true; - for (++anIt; anIt != theHierarchy.End() && isOk; ++anIt) { + for (++anIt; anIt != theHierarchy.end() && isOk; ++anIt) { ListOfShape aUsed, aNotUsed; - GeomShapePtr aParent = theHierarchy.Parent(*anIt, false); + GeomShapePtr aParent = theHierarchy.parent(*anIt, false); if (aParent && aParent->shapeType() == GeomAPI_Shape::COMPSOLID) { - aParent = theHierarchy.Parent(*anIt); // get parent once again to mark its subs as processed - theHierarchy.SplitCompound(aParent, aUsed, aNotUsed); + aParent = theHierarchy.parent(*anIt); // get parent once again to mark its subs as processed + theHierarchy.splitCompound(aParent, aUsed, aNotUsed); } else aUsed.push_back(*anIt);