From ce19450b99bcb98c23fcd5a26cd40c1f746dab9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Mon, 7 Dec 2020 14:28:54 +0100 Subject: [PATCH] #20441 : Fix issue in algo --- .../FeaturesPlugin_SharedFaces.cpp | 28 ++++++------------- src/FeaturesPlugin/sharedFaces_widget.xml | 2 +- src/GeomAlgoAPI/GeomAlgoAPI_SharedFaces.cpp | 16 +++++------ src/GeomAlgoAPI/GeomAlgoAPI_SharedFaces.h | 8 +++--- src/ModelAPI/CMakeLists.txt | 2 ++ 5 files changed, 24 insertions(+), 32 deletions(-) diff --git a/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp index c5d3afd93..718b16356 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp @@ -61,17 +61,6 @@ void FeaturesPlugin_SharedFaces::initAttributes() data()->addAttribute(GROUP_NAME_ID(), ModelAPI_AttributeString::typeId()); ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), GROUP_NAME_ID()); - boolean(CREATE_GROUP_ID())->setValue(false); -} - -void explodeCompound(const GeomShapePtr& theCompound, ListOfShape& theSubs) -{ - if (theCompound->isCompound() || theCompound->isCompSolid()) { - GeomAPI_ShapeIterator anIt(theCompound); - for (; anIt.more(); anIt.next()) - explodeCompound(anIt.current(), theSubs); - } else - theSubs.push_back(theCompound); } //================================================================================================= @@ -126,13 +115,14 @@ void FeaturesPlugin_SharedFaces::attributeChanged(const std::string& theID) if (aShape) { std::string anError; ListOfShape aFaces; - ListOfShape theSubs; - explodeCompound(aShape, theSubs); - if( !GetSharedredFaces( theSubs, - aFaces, - true, - anError)) - setError("Error in GetSharedredFaces calculation :" + anError); + ListOfShape theShapes; + + theShapes.push_back(aShape); + if (!GetSharedFaces(theShapes, + aFaces, + false, + anError)) + setError("Error in GetSharedFaces calculation :" + anError); AttributeSelectionListPtr aFacesListAttr = std::dynamic_pointer_cast @@ -149,7 +139,7 @@ void FeaturesPlugin_SharedFaces::attributeChanged(const std::string& theID) GeomShapePtr aFacePtr = *anIt; if (!aFacePtr.get()) { - setError("GetSharedredFaces : An invalid face found " + anError); + setError("GetSharedFaces : An invalid face found " + anError); } aFacesListAttr->append( ancompSolidAttr->context(), aFacePtr); } diff --git a/src/FeaturesPlugin/sharedFaces_widget.xml b/src/FeaturesPlugin/sharedFaces_widget.xml index 960c960c6..3e08994fd 100644 --- a/src/FeaturesPlugin/sharedFaces_widget.xml +++ b/src/FeaturesPlugin/sharedFaces_widget.xml @@ -11,7 +11,7 @@