From 0dfd9c7063c2722819beba70b9287749c3db108d Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 17 Oct 2018 17:40:54 +0300 Subject: [PATCH] Removed some redundant names. --- src/BuildPlugin/BuildPlugin_Compound.cpp | 6 ++--- src/BuildPlugin/BuildPlugin_Edge.cpp | 2 +- src/BuildPlugin/BuildPlugin_Shell.cpp | 6 ++--- src/BuildPlugin/BuildPlugin_Solid.cpp | 2 +- src/BuildPlugin/BuildPlugin_SubShapes.cpp | 6 ++--- src/BuildPlugin/BuildPlugin_Wire.cpp | 2 +- src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp | 24 +++++-------------- .../FeaturesPlugin_CompositeBoolean.cpp | 2 -- .../FeaturesPlugin_FusionFaces.cpp | 6 ++--- .../FeaturesPlugin_Intersection.cpp | 7 +----- .../FeaturesPlugin_Partition.cpp | 4 ++-- .../FeaturesPlugin_RemoveSubShapes.cpp | 9 +++---- src/FeaturesPlugin/FeaturesPlugin_Union.cpp | 6 ++--- 13 files changed, 26 insertions(+), 56 deletions(-) diff --git a/src/BuildPlugin/BuildPlugin_Compound.cpp b/src/BuildPlugin/BuildPlugin_Compound.cpp index 39c136ade..6d6c0c79f 100644 --- a/src/BuildPlugin/BuildPlugin_Compound.cpp +++ b/src/BuildPlugin/BuildPlugin_Compound.cpp @@ -77,9 +77,9 @@ void BuildPlugin_Compound::execute() if (aCopyCompound) { ResultBodyPtr aResultBody = document()->createBody(data(), anIndexToRemove++); aResultBody->store(aCopyCompound); - aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::VERTEX, "Modified_Vertex"); - aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::EDGE, "Modified_Edge"); - aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::FACE, "Modified_Face"); + aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::VERTEX); + aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::EDGE); + aResultBody->loadModifiedShapes(aCopyAlgo, aCompound, GeomAPI_Shape::FACE); setResult(aResultBody); } removeResults(anIndexToRemove); diff --git a/src/BuildPlugin/BuildPlugin_Edge.cpp b/src/BuildPlugin/BuildPlugin_Edge.cpp index 2004281d7..a3a247e30 100644 --- a/src/BuildPlugin/BuildPlugin_Edge.cpp +++ b/src/BuildPlugin/BuildPlugin_Edge.cpp @@ -99,7 +99,7 @@ void BuildPlugin_Edge::execute() // Store result. ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); aResultBody->storeModified(aShape, aCopyAlgo->shape()); - aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::VERTEX, "Modified_Vertex"); + aResultBody->loadModifiedShapes(aCopyAlgo, aShape, GeomAPI_Shape::VERTEX); setResult(aResultBody, aResultIndex); ++aResultIndex; diff --git a/src/BuildPlugin/BuildPlugin_Shell.cpp b/src/BuildPlugin/BuildPlugin_Shell.cpp index 9e55284ce..cc361be59 100644 --- a/src/BuildPlugin/BuildPlugin_Shell.cpp +++ b/src/BuildPlugin/BuildPlugin_Shell.cpp @@ -100,12 +100,10 @@ void BuildPlugin_Shell::execute() if (aShell->isSubShape(aHistoryShape, false)) { aResultBody->loadModifiedShapes(aSewingAlgo, aFace, - GeomAPI_Shape::EDGE, - "Modified_Edge"); + GeomAPI_Shape::EDGE); aResultBody->loadModifiedShapes(aSewingAlgo, aFace, - GeomAPI_Shape::FACE, - "Modified_Face"); + GeomAPI_Shape::FACE); break; } } diff --git a/src/BuildPlugin/BuildPlugin_Solid.cpp b/src/BuildPlugin/BuildPlugin_Solid.cpp index 6e79e3b89..dc0c57ed5 100644 --- a/src/BuildPlugin/BuildPlugin_Solid.cpp +++ b/src/BuildPlugin/BuildPlugin_Solid.cpp @@ -71,7 +71,7 @@ void BuildPlugin_Solid::storeResult(const ListOfShape& theOriginalShapes, ++anIt) { GeomShapePtr aShape = *anIt; - aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::FACE, "Modified_Face"); + aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::FACE); } setResult(aResultBody); } diff --git a/src/BuildPlugin/BuildPlugin_SubShapes.cpp b/src/BuildPlugin/BuildPlugin_SubShapes.cpp index bb2fa74c9..c919828c7 100644 --- a/src/BuildPlugin/BuildPlugin_SubShapes.cpp +++ b/src/BuildPlugin/BuildPlugin_SubShapes.cpp @@ -127,7 +127,7 @@ void BuildPlugin_SubShapes::execute() const int aModEdgeTag = 2; ResultBodyPtr aResultBody = document()->createBody(data()); aResultBody->storeModified(aBaseShape, aResultShape); - aResultBody->loadModifiedShapes(aBuilder, aBaseShape, GeomAPI_Shape::EDGE, "Modified_Edge"); + aResultBody->loadModifiedShapes(aBuilder, aBaseShape, GeomAPI_Shape::EDGE); for (ListOfShape::const_iterator anIt = aShapesToAdd.cbegin(); anIt != aShapesToAdd.cend(); ++anIt) @@ -135,9 +135,7 @@ void BuildPlugin_SubShapes::execute() GeomAPI_Shape::ShapeType aShType = (*anIt)->shapeType(); aResultBody->loadModifiedShapes(aBuilder, *anIt, - aShType, - aShType == GeomAPI_Shape::VERTEX ? "Modified_Vertex" - : "Modified_Edge"); + aShType); } setResult(aResultBody); } diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 54ae7a95b..a941765b7 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -88,7 +88,7 @@ void BuildPlugin_Wire::execute() for(ListOfShape::const_iterator anIt = anEdges.cbegin(); anIt != anEdges.cend(); ++anIt) { std::shared_ptr anEdgeInList(new GeomAPI_Edge(*anIt)); if(anEdgeInList->isEqual(anEdgeInResult)) { - aResultBody->modified(anEdgeInList, anEdgeInResult, "Edge"); + aResultBody->modified(anEdgeInList, anEdgeInResult); break; } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index e12238eaa..63a7834b0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -581,7 +581,6 @@ void FeaturesPlugin_Boolean::execute() } std::shared_ptr aMakeShapeList; - GeomAPI_DataMapOfShapeShape aMapOfShapes; if(!aShapesToAdd.empty()) { // Cut objects with not used solids. std::shared_ptr anObjectsCutAlgo(new GeomAlgoAPI_Boolean( @@ -593,7 +592,6 @@ void FeaturesPlugin_Boolean::execute() aShapesToSmash.clear(); aShapesToSmash.push_back(anObjectsCutAlgo->shape()); aMakeShapeList->appendAlgo(anObjectsCutAlgo); - aMapOfShapes.merge(anObjectsCutAlgo->mapOfSubShapes()); } // Cut tools with not used solids. @@ -605,7 +603,6 @@ void FeaturesPlugin_Boolean::execute() aTools.clear(); aTools.push_back(aToolsCutAlgo->shape()); aMakeShapeList->appendAlgo(aToolsCutAlgo); - aMapOfShapes.merge(aToolsCutAlgo->mapOfSubShapes()); } } @@ -631,7 +628,6 @@ void FeaturesPlugin_Boolean::execute() return; } aMakeShapeList->appendAlgo(aBoolAlgo); - aMapOfShapes.merge(aBoolAlgo->mapOfSubShapes()); // Put all (cut result, tools and not used solids) to PaveFiller. aShapesToAdd.push_back(aBoolAlgo->shape()); @@ -657,7 +653,6 @@ void FeaturesPlugin_Boolean::execute() std::shared_ptr aShape = aFillerAlgo->shape(); aMakeShapeList->appendAlgo(aFillerAlgo); - aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); std::shared_ptr aFrontShape = anOriginalShapes.front(); anOriginalShapes.pop_front(); @@ -694,26 +689,19 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t theResultBody->storeModified(theBaseShape, theResultShape); - const std::string aModEName = "Modified_Edge"; - const std::string aModFName = "Modified_Face"; - - theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE, aModEName); - theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aModFName); + theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::EDGE); + theResultBody->loadModifiedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE); theResultBody->loadDeletedShapes(theMakeShape, theBaseShape, GeomAPI_Shape::FACE); - std::string aName; for (ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); ++anIter) { - aName = (*anIter)->shapeType() <= GeomAPI_Shape::FACE ? aModFName - : aModEName; - theResultBody->loadModifiedShapes(theMakeShape, - *anIter, - aName == aModEName ? GeomAPI_Shape::EDGE - : GeomAPI_Shape::FACE, - aName); + GeomAPI_Shape::ShapeType aShapeType = + (*anIter)->shapeType() <= GeomAPI_Shape::FACE ? GeomAPI_Shape::FACE + : GeomAPI_Shape::EDGE; + theResultBody->loadModifiedShapes(theMakeShape, *anIter, aShapeType); theResultBody->loadDeletedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 1c486f59e..f1b693c5b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -380,8 +380,6 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the const ListOfShape& theTools, const std::shared_ptr theMakeShape) { - const std::string aModName = "Modfied"; - ListOfShape aTools = theTools; aTools.push_back(theObject); diff --git a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp index 12e0325e0..d9973525d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp @@ -81,10 +81,8 @@ void FeaturesPlugin_FusionFaces::execute() } else { aResultBody->storeModified(aBaseShape, aResultShape); - const std::string aModEName = "Modified_Edge"; - const std::string aModFName = "Modified_Face"; - aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::EDGE, aModEName); - aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::FACE, aModFName); + aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::EDGE); + aResultBody->loadModifiedShapes(anAlgo, aBaseShape, GeomAPI_Shape::FACE); } setResult(aResultBody); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp index 73dec6b8a..b5fd9982b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp @@ -142,12 +142,7 @@ void FeaturesPlugin_Intersection::loadNamingDS(std::shared_ptrmodified(aShapesMap.find(aSubShape), - aSubShape, - std::string("Modified_") - + (anIndex == 0 ? "Vertex_" : "Edge_") - + std::to_string((long long)(anIndex == 0 ? aModifiedVertexIndex++ - : aModifiedEdgeIndex++))); + theResultBody->modified(aShapesMap.find(aSubShape), aSubShape); } else { theResultBody->generated( aSubShape, diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index f8b1bfdb2..ca91f21b6 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -213,8 +213,8 @@ void FeaturesPlugin_Partition::storeResult( ++anIt) { GeomShapePtr aShape = *anIt; - aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::EDGE, "Modified_Edge"); - aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::FACE, "Modified_Face"); + aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::EDGE); + aResultBody->loadModifiedShapes(theMakeShape, aShape, GeomAPI_Shape::FACE); aResultBody->loadDeletedShapes(theMakeShape, aShape, GeomAPI_Shape::FACE); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp index b53eca256..d2bd7e5de 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp @@ -293,15 +293,12 @@ void FeaturesPlugin_RemoveSubShapes::execute() aResultBody->loadModifiedShapes(aMakeShapeList, aBaseShape, - GeomAPI_Shape::FACE, - "Modified_Face"); + GeomAPI_Shape::FACE); aResultBody->loadModifiedShapes(aMakeShapeList, aBaseShape, - GeomAPI_Shape::EDGE, - "Modified_Edge"); + GeomAPI_Shape::EDGE); aResultBody->loadModifiedShapes(aMakeShapeList, aBaseShape, - GeomAPI_Shape::VERTEX, - "Modified_Vertex"); + GeomAPI_Shape::VERTEX); setResult(aResultBody); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index 9c9cfdc5a..e9cbaee7d 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -169,15 +169,13 @@ void FeaturesPlugin_Union::execute() // workaround: make copy to name edges correctly // Store result and naming. - const std::string aModEName = "Modified_Edge"; - const std::string aModFName = "Modified_Face"; std::shared_ptr aResultBody = document()->createBody(data()); aResultBody->storeModified(anObjects.front(), aShape); for(ListOfShape::const_iterator anIter = anObjects.begin(); anIter != anObjects.end(); ++anIter) { - aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::EDGE, aModEName); - aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aModFName); + aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::EDGE); + aResultBody->loadModifiedShapes(aMakeShapeList, *anIter, GeomAPI_Shape::FACE); //aResultBody->loadDeletedShapes(&aMakeShapeList, *anIter, GeomAPI_Shape::FACE, aDeletedTag); } -- 2.39.2