From: Jérôme Date: Mon, 7 Dec 2020 13:28:54 +0000 (+0100) Subject: #20441 : Fix issue in algo X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce19450b99bcb98c23fcd5a26cd40c1f746dab9b;p=modules%2Fshaper.git #20441 : Fix issue in algo --- 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 @@