From c856f50b73f4a8ac6c13cc657f0b68cbcd5ae76f Mon Sep 17 00:00:00 2001 From: cg246364 Date: Wed, 13 Apr 2022 15:54:06 +0200 Subject: [PATCH] Implementation of shared faces inspection, bos #29568 Fix problems with updating the number of faces and the list of faces --- .../ConnectorPlugin_PublishToStudyFeature.py | 81 ++++---- src/FeaturesAPI/CMakeLists.txt | 2 + src/FeaturesAPI/FeaturesAPI.i | 2 + src/FeaturesAPI/FeaturesAPI_SharedFaces.cpp | 83 ++++++++ src/FeaturesAPI/FeaturesAPI_SharedFaces.h | 77 ++++++++ src/FeaturesAPI/FeaturesAPI_swig.h | 1 + src/FeaturesPlugin/CMakeLists.txt | 9 + .../FeaturesPlugin_CommonSharedFaces.cpp | 98 ++++++++++ .../FeaturesPlugin_CommonSharedFaces.h | 66 +++++++ .../FeaturesPlugin_GroupSharedFaces.cpp | 131 +++++++++++++ .../FeaturesPlugin_GroupSharedFaces.h | 114 +++++++++++ src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp | 6 + .../FeaturesPlugin_SharedFaces.cpp | 185 ++++++++++++++++++ .../FeaturesPlugin_SharedFaces.h | 133 +++++++++++++ src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts | 122 ++++++++++++ .../Test/TestCheckSharedFaces.py | 122 ++++++++++++ src/FeaturesPlugin/doc/FeaturesPlugin.rst | 1 + .../doc/TUI_sharedFacesFeature.rst | 11 ++ .../doc/checkSharedFaceFeature.rst | 52 +++++ .../doc/examples/check_shared_faces.py | 21 ++ .../images/checkSharedFacesPropertyPanel.png | Bin 0 -> 26398 bytes .../doc/images/sharedFacesResult.png | Bin 0 -> 7992 bytes .../doc/images/shared_shapes.png | Bin 0 -> 583 bytes src/FeaturesPlugin/icons/shared_shapes.png | Bin 0 -> 583 bytes src/FeaturesPlugin/plugin-Features.xml | 8 + .../shared_faces_macro_widget.xml | 35 ++++ src/FeaturesPlugin/shared_faces_widget.xml | 31 +++ src/FeaturesPlugin/tests.set | 1 + src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp | 17 ++ src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h | 5 + src/PythonAPI/model/features/__init__.py | 1 + 31 files changed, 1376 insertions(+), 39 deletions(-) create mode 100644 src/FeaturesAPI/FeaturesAPI_SharedFaces.cpp create mode 100644 src/FeaturesAPI/FeaturesAPI_SharedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_SharedFaces.h create mode 100644 src/FeaturesPlugin/Test/TestCheckSharedFaces.py create mode 100644 src/FeaturesPlugin/doc/TUI_sharedFacesFeature.rst create mode 100644 src/FeaturesPlugin/doc/checkSharedFaceFeature.rst create mode 100644 src/FeaturesPlugin/doc/examples/check_shared_faces.py create mode 100644 src/FeaturesPlugin/doc/images/checkSharedFacesPropertyPanel.png create mode 100644 src/FeaturesPlugin/doc/images/sharedFacesResult.png create mode 100644 src/FeaturesPlugin/doc/images/shared_shapes.png create mode 100644 src/FeaturesPlugin/icons/shared_shapes.png create mode 100644 src/FeaturesPlugin/shared_faces_macro_widget.xml create mode 100644 src/FeaturesPlugin/shared_faces_widget.xml diff --git a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py index f36be7a06..a27578e18 100644 --- a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py +++ b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py @@ -163,51 +163,54 @@ class PublishToStudyFeature(ModelAPI.ModelAPI_Feature): # If theFields is true, the same is performed for Fields. def processGroups(self, theRes, theEngine, thePartFeatureId, theStudyShape, theFields): allGroupsProcessed = [] + allRefGroups = [] if theFields: - aRefGroups = ModelAPI.referencedFeatures(theRes, "Field", True) + allRefGroups.append(ModelAPI.referencedFeatures(theRes, "Field", True)) else: - aRefGroups = ModelAPI.referencedFeatures(theRes, "Group", True) - for aRef in aRefGroups: - aGroupIndices = [] - aGroupHasIndex = {} - aResShape = theRes.shape() - if theFields: - aSelList = aRef.selectionList("selected") - else: - aSelList = aRef.selectionList("group_list") - aSelType = GeomAPI_Shape.shapeTypeByStr(aSelList.selectionType()) - for aGroupRes in aRef.results(): - aShape = aGroupRes.shape() - anExplorer = GeomAPI_ShapeExplorer(aShape, aSelType) - while anExplorer.more(): - anId = GeomAlgoAPI.GeomAlgoAPI_CompoundBuilder.id(aResShape, anExplorer.current()) - if anId > 0 and not anId in aGroupHasIndex: - aGroupIndices.append(anId) - aGroupHasIndex[anId] = 0 - anExplorer.next() - if len(aGroupIndices): # create group - aGroupFeatureId = aRef.data().featureId() + allRefGroups.append(ModelAPI.referencedFeatures(theRes, "Group", True)) + allRefGroups.append(ModelAPI.referencedFeatures(theRes, "Shared_faces", True)) + for aRefGroups in allRefGroups: + for aRef in aRefGroups: + aGroupIndices = [] + aGroupHasIndex = {} + aResShape = theRes.shape() if theFields: - aFieldOp = theEngine.GetIFieldOperations() - aGroupEntry = "field" + str(thePartFeatureId) + ":" + str(aGroupFeatureId) - aGroup = aFieldOp.FindField(theStudyShape, aGroupEntry) + aSelList = aRef.selectionList("selected") else: - aGroupOp = theEngine.GetIGroupOperations() - aGroupEntry = "group" + str(thePartFeatureId) + ":" + str(aGroupFeatureId) - aGroup = aGroupOp.FindGroup(theStudyShape, aGroupEntry) - if not aGroup: # create a new + aSelList = aRef.selectionList("group_list") + aSelType = GeomAPI_Shape.shapeTypeByStr(aSelList.selectionType()) + for aGroupRes in aRef.results(): + aShape = aGroupRes.shape() + anExplorer = GeomAPI_ShapeExplorer(aShape, aSelType) + while anExplorer.more(): + anId = GeomAlgoAPI.GeomAlgoAPI_CompoundBuilder.id(aResShape, anExplorer.current()) + if anId > 0 and not anId in aGroupHasIndex: + aGroupIndices.append(anId) + aGroupHasIndex[anId] = 0 + anExplorer.next() + if len(aGroupIndices): # create group + aGroupFeatureId = aRef.data().featureId() if theFields: - aGroup = aFieldOp.CreateFieldByType(theStudyShape, aSelType) + aFieldOp = theEngine.GetIFieldOperations() + aGroupEntry = "field" + str(thePartFeatureId) + ":" + str(aGroupFeatureId) + aGroup = aFieldOp.FindField(theStudyShape, aGroupEntry) else: - aGroup = aGroupOp.CreateGroup(theStudyShape, aSelType) - aGroup.SetEntry(aGroupEntry) - theEngine.AddInStudy(aGroup, aRef.firstResult().data().name(), theStudyShape) - aGroup.SetSelection(aGroupIndices) - if theFields: - self.fillField(aGroup, aRef, theEngine, aGroupIndices) - # a group takes shape from the main result - #aGroup.SetShapeByStream(aRef.firstResult().shape().getShapeStream(False)) # group shape - allGroupsProcessed.append(aGroupEntry) + aGroupOp = theEngine.GetIGroupOperations() + aGroupEntry = "group" + str(thePartFeatureId) + ":" + str(aGroupFeatureId) + aGroup = aGroupOp.FindGroup(theStudyShape, aGroupEntry) + if not aGroup: # create a new + if theFields: + aGroup = aFieldOp.CreateFieldByType(theStudyShape, aSelType) + else: + aGroup = aGroupOp.CreateGroup(theStudyShape, aSelType) + aGroup.SetEntry(aGroupEntry) + theEngine.AddInStudy(aGroup, aRef.firstResult().data().name(), theStudyShape) + aGroup.SetSelection(aGroupIndices) + if theFields: + self.fillField(aGroup, aRef, theEngine, aGroupIndices) + # a group takes shape from the main result + #aGroup.SetShapeByStream(aRef.firstResult().shape().getShapeStream(False)) # group shape + allGroupsProcessed.append(aGroupEntry) # check all existing groups: if some does not processed, remove it from the tree aSOIter = SHAPERSTUDY_utils.getStudy().NewChildIterator(theStudyShape.GetSO()) while aSOIter.More(): diff --git a/src/FeaturesAPI/CMakeLists.txt b/src/FeaturesAPI/CMakeLists.txt index 15254f37d..13c520322 100644 --- a/src/FeaturesAPI/CMakeLists.txt +++ b/src/FeaturesAPI/CMakeLists.txt @@ -60,6 +60,7 @@ SET(PROJECT_HEADERS FeaturesAPI_GeometryCalculation.h FeaturesAPI_BoundingBox.h FeaturesAPI_LimitTolerance.h + FeaturesAPI_SharedFaces.h ) SET(PROJECT_SOURCES @@ -102,6 +103,7 @@ SET(PROJECT_SOURCES FeaturesAPI_GeometryCalculation.cpp FeaturesAPI_BoundingBox.cpp FeaturesAPI_LimitTolerance.cpp + FeaturesAPI_SharedFaces.cpp ) SET(PROJECT_LIBRARIES diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index 0e444f027..bab98e950 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -99,6 +99,7 @@ %shared_ptr(FeaturesAPI_Rotation) %shared_ptr(FeaturesAPI_Scale) %shared_ptr(FeaturesAPI_Sewing) +%shared_ptr(FeaturesAPI_SharedFaces) %shared_ptr(FeaturesAPI_Symmetry) %shared_ptr(FeaturesAPI_Translation) %shared_ptr(FeaturesAPI_Union) @@ -245,6 +246,7 @@ %include "FeaturesAPI_Rotation.h" %include "FeaturesAPI_Scale.h" %include "FeaturesAPI_Sewing.h" +%include "FeaturesAPI_SharedFaces.h" %include "FeaturesAPI_Symmetry.h" %include "FeaturesAPI_Translation.h" %include "FeaturesAPI_Union.h" diff --git a/src/FeaturesAPI/FeaturesAPI_SharedFaces.cpp b/src/FeaturesAPI/FeaturesAPI_SharedFaces.cpp new file mode 100644 index 000000000..402eb873e --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_SharedFaces.cpp @@ -0,0 +1,83 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "FeaturesAPI_SharedFaces.h" + +#include + +#include +#include +#include +#include + +//================================================================================================= +FeaturesAPI_SharedFaces::FeaturesAPI_SharedFaces( + const std::shared_ptr& theFeature) +: ModelHighAPI_Interface(theFeature) +{ + initialize(); +} + +//================================================================================================= +FeaturesAPI_SharedFaces::FeaturesAPI_SharedFaces( + const std::shared_ptr& theFeature, + const ModelHighAPI_Selection& theObject, + const std::string & theNameGroup) +:ModelHighAPI_Interface(theFeature) +{ + if (initialize()) { + fillAttribute(theObject, myobjectselected); + fillAttribute(theNameGroup, mygroupname); + execute(); + } +} + +//================================================================================================= +FeaturesAPI_SharedFaces::~FeaturesAPI_SharedFaces() +{ +} + +//================================================================================================= +void FeaturesAPI_SharedFaces::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + AttributeSelectionPtr anAttrObject; + anAttrObject = aBase->selection(FeaturesPlugin_GroupSharedFaces::OBJECT_ID()); + + theDumper << aBase << " = model.getSharedFaces(" << aDocName << ", " << anAttrObject; + theDumper << ", " << aBase->string(FeaturesPlugin_GroupSharedFaces::GROUP_NAME_ID()); + theDumper << ")" << std::endl; +} + +//================================================================================================= +SharedFacesPtr getSharedFaces(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject, + const std::string & theNameGroup) +{ + FeaturePtr aFeature = thePart->addFeature(FeaturesPlugin_GroupSharedFaces::ID()); + SharedFacesPtr aSharedFaces; + + aSharedFaces.reset(new FeaturesAPI_SharedFaces(aFeature, + theObject, + theNameGroup)); + return aSharedFaces; +} + diff --git a/src/FeaturesAPI/FeaturesAPI_SharedFaces.h b/src/FeaturesAPI/FeaturesAPI_SharedFaces.h new file mode 100644 index 000000000..ac62ee747 --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_SharedFaces.h @@ -0,0 +1,77 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef FeaturesAPI_SharedFaces_H_ +#define FeaturesAPI_SharedFaces_H_ + +#include "FeaturesAPI.h" + +#include "FeaturesPlugin_GroupSharedFaces.h" + +#include +#include +#include + +class ModelAPI_Document; +class ModelHighAPI_Selection; + +/// \class FeaturesAPI_SharedFaces +/// \ingroup CPPHighAPI +/// \brief Interface to find shared faces +class FeaturesAPI_SharedFaces: public ModelHighAPI_Interface +{ +public: + /// Constructor without values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_SharedFaces(const std::shared_ptr& theFeature); + + FEATURESAPI_EXPORT + explicit FeaturesAPI_SharedFaces(const std::shared_ptr& theFeature, + const ModelHighAPI_Selection& theObject, + const std::string & theNameGroup); + + /// Destructor. + FEATURESAPI_EXPORT + virtual ~FeaturesAPI_SharedFaces(); + + INTERFACE_2(FeaturesPlugin_GroupSharedFaces::ID(), + objectselected, FeaturesPlugin_GroupSharedFaces::OBJECT_ID(), + ModelAPI_AttributeSelection, /** object selected*/, + groupname, FeaturesPlugin_GroupSharedFaces::GROUP_NAME_ID(), + ModelAPI_AttributeString, /** group name*/) + + /// Dump wrapped feature + FEATURESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; +}; + +/// Pointer on the SharedFaces object. +typedef std::shared_ptr SharedFacesPtr; + +/// \ingroup CPPHighAPI +/// \brief Create a group of shared faces in a compsolid or a compound +/// \param thePart the part +/// \param theObject the selected object +/// \param theNameGroup the group name +FEATURESAPI_EXPORT +SharedFacesPtr getSharedFaces(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject, + const std::string & theNameGroup); + +#endif // FeaturesAPI_SharedFaces_H_ diff --git a/src/FeaturesAPI/FeaturesAPI_swig.h b/src/FeaturesAPI/FeaturesAPI_swig.h index a440abd0b..53bdbb86f 100644 --- a/src/FeaturesAPI/FeaturesAPI_swig.h +++ b/src/FeaturesAPI/FeaturesAPI_swig.h @@ -62,5 +62,6 @@ #include "FeaturesAPI_GeometryCalculation.h" #include "FeaturesAPI_BoundingBox.h" #include "FeaturesAPI_LimitTolerance.h" + #include "FeaturesAPI_SharedFaces.h" #endif // FeaturesAPI_swig_H_ diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index d4db12a9d..198f7d82f 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -79,6 +79,9 @@ SET(PROJECT_HEADERS FeaturesPlugin_InspectNormalToFace.h FeaturesPlugin_GlueFaces.h FeaturesPlugin_LimitTolerance.h + FeaturesPlugin_CommonSharedFaces.h + FeaturesPlugin_GroupSharedFaces.h + FeaturesPlugin_SharedFaces.h ) SET(PROJECT_SOURCES @@ -138,6 +141,9 @@ SET(PROJECT_SOURCES FeaturesPlugin_InspectNormalToFace.cpp FeaturesPlugin_GlueFaces.cpp FeaturesPlugin_LimitTolerance.cpp + FeaturesPlugin_CommonSharedFaces.cpp + FeaturesPlugin_GroupSharedFaces.cpp + FeaturesPlugin_SharedFaces.cpp ) SET(XML_RESOURCES @@ -184,6 +190,8 @@ SET(XML_RESOURCES normal_to_face_widget.xml create_normal_to_face_widget.xml limit_tolerance_widget.xml + shared_faces_macro_widget.xml + shared_faces_widget.xml ) SET(TEXT_RESOURCES @@ -204,6 +212,7 @@ INCLUDE_DIRECTORIES( ../ModuleBase ../Events ../Config + ../Locale ${OpenCASCADE_INCLUDE_DIR} ) diff --git a/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.cpp new file mode 100644 index 000000000..8c154ed14 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.cpp @@ -0,0 +1,98 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "FeaturesPlugin_CommonSharedFaces.h" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +//================================================================================================= +void FeaturesPlugin_CommonSharedFaces::updateFaces() +{ + AttributeSelectionPtr aCompSolidAttr = + std::dynamic_pointer_cast(attributObject()); + AttributeSelectionListPtr aFacesListAttr = + std::dynamic_pointer_cast (attributListFaces()); + + GeomShapePtr aShape = aCompSolidAttr->value(); + + AttributeBooleanPtr anIsCompute = + std::dynamic_pointer_cast(attributIsCompute()); + if (!anIsCompute->value()) { + myShape = aShape; + anIsCompute->setValue(true); + } + if (aShape.get() && aCompSolidAttr->context().get() && !aShape->isEqual(myShape)) { + if (aFacesListAttr->isInitialized()) + aFacesListAttr->clear(); + aShape = aCompSolidAttr->context()->shape(); + if (aShape) { + ListOfShape aFaces = GeomAlgoAPI_ShapeTools::getSharedFaces(aShape); + myShape = aShape; + aFacesListAttr->setSelectionType("face"); + ListOfShape::const_iterator anIt = aFaces.cbegin(); + for(; anIt != aFaces.cend(); ++anIt) { + GeomShapePtr aFacePtr = *anIt; + if (!(aFacesListAttr->isInList(aCompSolidAttr->context(), aFacePtr))) { + aFacesListAttr->append(aCompSolidAttr->context(), aFacePtr); + } + } + std::stringstream aLabel; + aLabel << aFacesListAttr->size(); + AttributeStringPtr aNumberFacesAttr = + std::dynamic_pointer_cast(attributNumberFaces()); + aNumberFacesAttr->setValue(aLabel.str()); + } + } +} + +//================================================================================================= +void FeaturesPlugin_CommonSharedFaces::setFacesGroup(const std::wstring& theName) +{ + std::vector aColor; + ResultGroupPtr aGroup = document()->createGroup(data()); + // Clean the result of the operation + aGroup->data()->setName(theName); + aGroup->store(GeomShapePtr()); + + // shapes containing in group + ListOfShape aFaces; + AttributeSelectionListPtr aFacesListAttr = + std::dynamic_pointer_cast (attributListFaces()); + + for (int anI =0; anI< aFacesListAttr->size(); anI++) { + AttributeSelectionPtr aAtt = aFacesListAttr->value(anI); + aFaces.push_back(aAtt->value()); + } + + GeomShapePtr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces); + aGroup->store(aCompound); + aColor = {255,0,0}; + setResult(aGroup); + ModelAPI_Tools::setColor(lastResult(),aColor); +} + diff --git a/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.h new file mode 100644 index 000000000..3a31c3b4e --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_CommonSharedFaces.h @@ -0,0 +1,66 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef FeaturesPlugin_CommonSharedFaces_H_ +#define FeaturesPlugin_CommonSharedFaces_H_ + +#include "FeaturesPlugin.h" + +#include +#include +#include + + +/// \class FeaturesPlugin_CommonSharedFaces +/// \ingroup Plugins +/// \brief Feature to check the shared faces of solid + +class FeaturesPlugin_CommonSharedFaces : public ModelAPI_Feature +{ +public: + /// Performs the algorithm and stores results it in the data structure. + FEATURESPLUGIN_EXPORT virtual void execute(){}; + + /// Return Attribut values of result. + virtual AttributePtr attributObject() = 0; + + /// Return Attribut values of result. + virtual AttributePtr attributListFaces() = 0; + + /// Return Attribut values of result. + virtual AttributePtr attributNumberFaces() = 0; + + /// Return Attribut values of IsCompute. + virtual AttributePtr attributIsCompute() = 0; + + protected: + FeaturesPlugin_CommonSharedFaces() {} + + //Set group of faces + void setFacesGroup(const std::wstring& theName ); + + // Update the list of faces + void updateFaces(); + + // the shape studied + GeomShapePtr myShape; + +}; + +#endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.cpp new file mode 100644 index 000000000..994a78852 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.cpp @@ -0,0 +1,131 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "FeaturesPlugin_GroupSharedFaces.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +//================================================================================================= +FeaturesPlugin_GroupSharedFaces::FeaturesPlugin_GroupSharedFaces() +{ +} + +//================================================================================================= +void FeaturesPlugin_GroupSharedFaces::initAttributes() +{ + data()->addAttribute(OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(LIST_FACES_ID(), ModelAPI_AttributeSelectionList::typeId()); + data()->addAttribute(NUMBER_FACES_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeInteger::typeId()); + data()->addAttribute(GROUP_NAME_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(COMPUTE_ID(), ModelAPI_AttributeBoolean::typeId()); + + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TRANSPARENCY_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), COMPUTE_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), NUMBER_FACES_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LIST_FACES_ID()); + + data()->boolean(COMPUTE_ID())->setValue(true); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupSharedFaces::attributObject() +{ + return attribute(OBJECT_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupSharedFaces::attributIsCompute() +{ + return attribute(COMPUTE_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupSharedFaces::attributListFaces() +{ + return attribute(LIST_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupSharedFaces::attributNumberFaces() +{ + return attribute(NUMBER_FACES_ID()); +} + +//================================================================================================= +void FeaturesPlugin_GroupSharedFaces::execute() +{ + if (selectionList(LIST_FACES_ID())->isInitialized() + && string(GROUP_NAME_ID())->value() != "") { + AttributeStringPtr aNameAtt = string(GROUP_NAME_ID()) ; + std::wstring aNameFace = aNameAtt->isUValue() ? + Locale::Convert::toWString(aNameAtt->valueU()) : + Locale::Convert::toWString(aNameAtt->value()); + + if (lastResult().get()) + eraseResultFromList(lastResult()); + setFacesGroup(aNameFace); + } else { + if (lastResult().get()) { + eraseResultFromList(lastResult()); + } + } + if (selection(OBJECT_ID())->isInitialized() && integer(TRANSPARENCY_ID())->isInitialized()) { + AttributeSelectionPtr aCompSolidAttr = selection(OBJECT_ID()); + ResultPtr aResult = aCompSolidAttr->context(); + + double aTranparency = integer(TRANSPARENCY_ID())->value() / 100.0; + ModelAPI_Tools::setTransparency(aResult, aTranparency); + + ResultBodyPtr aResultBody = std::dynamic_pointer_cast(aResult); + std::list allRes; + ModelAPI_Tools::allSubs(aResultBody, allRes); + std::list::iterator aRes; + for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) { + ModelAPI_Tools::setTransparency(*aRes, aTranparency); + } + } + + // Update the number of shared faces + AttributeSelectionListPtr aFacesListAttr = + std::dynamic_pointer_cast (attributListFaces()); + AttributeStringPtr aNumberFacesAttr = + std::dynamic_pointer_cast (attributNumberFaces()); + std::stringstream aLabel; + aLabel << aFacesListAttr->size(); + aNumberFacesAttr->setValue(aLabel.str()); +} + +//================================================================================================= +void FeaturesPlugin_GroupSharedFaces::attributeChanged(const std::string& theID) +{ + if (theID == OBJECT_ID() || theID == LIST_FACES_ID()) + updateFaces(); +} diff --git a/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.h new file mode 100644 index 000000000..d81781b1c --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_GroupSharedFaces.h @@ -0,0 +1,114 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef FeaturesPlugin_GroupSharedFaces_H_ +#define FeaturesPlugin_GroupSharedFaces_H_ + +#include + +/// \class FeaturesPlugin_GroupSharedFaces +/// \ingroup Plugins +/// \brief Feature to check the shared faces of solid + +class FeaturesPlugin_GroupSharedFaces : public FeaturesPlugin_CommonSharedFaces +{ +public: + /// Group shared faces kind. + inline static const std::string& ID() + { + static const std::string MY_ID("Shared_faces"); + return MY_ID; + } + + /// Attribute name for object selected. + inline static const std::string& OBJECT_ID() + { + static const std::string MY_OBJECT_ID("main_object"); + return MY_OBJECT_ID; + } + + /// Attribute name for number of faces. + inline static const std::string& NUMBER_FACES_ID() + { + static const std::string MY_NUMBER_FACES_ID("number_shared_faces"); + return MY_NUMBER_FACES_ID; + } + + /// Attribute name for z coodinate. + inline static const std::string& LIST_FACES_ID() + { + static const std::string MY_LIST_FACES_ID("group_list"); + return MY_LIST_FACES_ID; + } + + /// Attribute name for transparency. + inline static const std::string& TRANSPARENCY_ID() + { + static const std::string MY_TRANSPARENCY_ID("transparency"); + return MY_TRANSPARENCY_ID; + } + + /// Attribute name for group name. + inline static const std::string& GROUP_NAME_ID() + { + static const std::string MY_GROUP_NAME_ID("group_name"); + return MY_GROUP_NAME_ID; + } + + /// Attribute name for indicate to launch the algo. + inline static const std::string& COMPUTE_ID() + { + static const std::string MY_COMPUTE_ID("compute"); + return MY_COMPUTE_ID; + } + + /// \return the kind of a feature. + virtual const std::string& getKind() + { + return ID(); + } + + /// Performs the algorithm and stores results it in the data structure. + FEATURESPLUGIN_EXPORT virtual void execute(); + + /// Request for initialization of data model of the feature: adding all attributes + FEATURESPLUGIN_EXPORT virtual void initAttributes(); + + /// Called on change of any argument-attribute of this object + /// \param theID identifier of changed attribute + FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); + + /// Use plugin manager for features creation + FeaturesPlugin_GroupSharedFaces(); + +private: + /// Return Attribut values of object. + virtual AttributePtr attributObject(); + + /// Return Attribut values of list of faces. + virtual AttributePtr attributListFaces(); + + /// Return Attribut values of number of faces. + virtual AttributePtr attributNumberFaces(); + + /// Return Attribut values of IsCompute. + virtual AttributePtr attributIsCompute(); +}; + +#endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index 5c312469b..9659812ad 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -236,6 +238,10 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID) return FeaturePtr(new FeaturesPlugin_PointCloudOnFace); } else if (theFeatureID == FeaturesPlugin_LimitTolerance::ID()) { return FeaturePtr(new FeaturesPlugin_LimitTolerance); + } else if (theFeatureID == FeaturesPlugin_SharedFaces::ID()) { + return FeaturePtr(new FeaturesPlugin_SharedFaces); + } else if (theFeatureID == FeaturesPlugin_GroupSharedFaces::ID()) { + return FeaturePtr(new FeaturesPlugin_GroupSharedFaces); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp new file mode 100644 index 000000000..15eebf6d5 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.cpp @@ -0,0 +1,185 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "FeaturesPlugin_SharedFaces.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +//================================================================================================= +FeaturesPlugin_SharedFaces::FeaturesPlugin_SharedFaces() +{ +} + +//================================================================================================= +void FeaturesPlugin_SharedFaces::initAttributes() +{ + data()->addAttribute(OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(LIST_FACES_ID(), ModelAPI_AttributeSelectionList::typeId()); + + data()->addAttribute(NUMBER_FACES_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeInteger::typeId()); + data()->addAttribute(CREATE_GROUP_ID(), ModelAPI_AttributeBoolean::typeId()); + data()->addAttribute(GROUP_NAME_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(COMPUTE_ID(), ModelAPI_AttributeBoolean::typeId()); + + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), GROUP_NAME_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), COMPUTE_ID()); + data()->boolean(COMPUTE_ID())->setValue(true); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_SharedFaces::attributIsCompute() +{ + return attribute(COMPUTE_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_SharedFaces::attributObject() +{ + return attribute(OBJECT_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_SharedFaces::attributListFaces() +{ + return attribute(LIST_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_SharedFaces::attributNumberFaces() +{ + return attribute(NUMBER_FACES_ID()); +} + +//================================================================================================= +void FeaturesPlugin_SharedFaces::execute() +{ + if (boolean(CREATE_GROUP_ID())->value()) { + + if (string(GROUP_NAME_ID())->value() != "" + && selectionList(LIST_FACES_ID())->isInitialized()) { + + if (lastResult().get()) { + eraseResultFromList(lastResult()); + } + + if (!myCreateGroupFeature.get()) + createGroup(); + updateGroup(); + } + + } else { + if (selectionList(LIST_FACES_ID())->isInitialized()) { + + if (myCreateGroupFeature.get()) { + myCreateGroupFeature->eraseResults(); + SessionPtr aSession = ModelAPI_Session::get(); + DocumentPtr aDoc = aSession->activeDocument(); + aDoc->removeFeature(myCreateGroupFeature); + myCreateGroupFeature.reset(); + } + + if (lastResult().get()) + eraseResultFromList(lastResult()); + setFacesGroup(L"Group_SharedFaces"); + } + } + + if (selection(OBJECT_ID())->isInitialized()) { + AttributeSelectionPtr aCompSolidAttr = selection(OBJECT_ID()); + ResultPtr aResult = aCompSolidAttr->context(); + + double aTranparency = integer(TRANSPARENCY_ID())->value()/100.0; + ModelAPI_Tools::setTransparency(aResult, aTranparency); + + ResultBodyPtr aResultBody = std::dynamic_pointer_cast(aResult); + std::list allRes; + ModelAPI_Tools::allSubs(aResultBody, allRes); + std::list::iterator aRes; + for(aRes = allRes.begin(); aRes != allRes.end(); aRes++) { + ModelAPI_Tools::setTransparency(*aRes, aTranparency); + } + } + + // Update the number of shared faces + AttributeSelectionListPtr aFacesListAttr = + std::dynamic_pointer_cast (attributListFaces()); + AttributeStringPtr aNumberFacesAttr = + std::dynamic_pointer_cast (attributNumberFaces()); + std::stringstream aLabel; + aLabel << aFacesListAttr->size(); + aNumberFacesAttr->setValue(aLabel.str()); +} + +//================================================================================================= +void FeaturesPlugin_SharedFaces::attributeChanged(const std::string& theID) +{ + if (theID == OBJECT_ID()) { + updateFaces(); + if (myCreateGroupFeature.get()) + updateGroup(); + } +} + + +//================================================================================================= +void FeaturesPlugin_SharedFaces::createGroup() +{ + SessionPtr aSession = ModelAPI_Session::get(); + + DocumentPtr aDoc = aSession->activeDocument(); + + if (aDoc.get()) { + myCreateGroupFeature = aDoc->addFeature(FeaturesPlugin_GroupSharedFaces::ID()); + } +} + +//================================================================================================= +void FeaturesPlugin_SharedFaces::updateGroup() +{ + myCreateGroupFeature->boolean(FeaturesPlugin_GroupSharedFaces::COMPUTE_ID())->setValue(false); + myCreateGroupFeature->string(FeaturesPlugin_GroupSharedFaces::GROUP_NAME_ID()) + ->setValue(string(GROUP_NAME_ID())->value()); + + myCreateGroupFeature->selection(FeaturesPlugin_GroupSharedFaces::OBJECT_ID()) + ->setValue(selection(OBJECT_ID())->context(), selection(OBJECT_ID())->value()); + AttributeSelectionListPtr aFacesFeatures = + std::dynamic_pointer_cast + (myCreateGroupFeature->attribute(LIST_FACES_ID())); + + AttributeSelectionListPtr aFaces = + std::dynamic_pointer_cast(attribute(LIST_FACES_ID())); + aFaces->copyTo(aFacesFeatures); + + myCreateGroupFeature->integer(FeaturesPlugin_GroupSharedFaces::TRANSPARENCY_ID()) + ->setValue( integer(TRANSPARENCY_ID())->value()); + myCreateGroupFeature->execute(); + myCreateGroupFeature->boolean(FeaturesPlugin_GroupSharedFaces::COMPUTE_ID())->setValue(true); +} diff --git a/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.h new file mode 100644 index 000000000..25112533e --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_SharedFaces.h @@ -0,0 +1,133 @@ +// Copyright (C) 2018-2021 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef FeaturesPlugin_SharedFaces_H_ +#define FeaturesPlugin_SharedFaces_H_ + +#include + +/// \class FeaturesPlugin_SharedFaces +/// \ingroup Plugins +/// \brief Feature to check the shared faces of compsolid or compound + +class FeaturesPlugin_SharedFaces : public FeaturesPlugin_CommonSharedFaces +{ +public: + /// Shared faces kind. + inline static const std::string& ID() + { + static const std::string MY_ID("Shared_faces_macro"); + return MY_ID; + } + + /// Attribute name for object selected. + inline static const std::string& OBJECT_ID() + { + static const std::string MY_OBJECT_ID("main_object"); + return MY_OBJECT_ID; + } + + /// Attribute name for number of faces. + inline static const std::string& NUMBER_FACES_ID() + { + static const std::string MY_NUMBER_FACES_ID("number_shared_faces"); + return MY_NUMBER_FACES_ID; + } + + /// Attribute name for z coodinate. + inline static const std::string& LIST_FACES_ID() + { + static const std::string MY_LIST_FACES_ID("group_list"); + return MY_LIST_FACES_ID; + } + + /// Attribute name for transparency. + inline static const std::string& TRANSPARENCY_ID() + { + static const std::string MY_TRANSPARENCY_ID("transparency"); + return MY_TRANSPARENCY_ID; + } + + /// Attribute name for checkbox create group. + inline static const std::string& CREATE_GROUP_ID() + { + static const std::string MY_CREATE_GROUP_ID("create_group"); + return MY_CREATE_GROUP_ID; + } + + /// Attribute name for indicate to launch the algo. + inline static const std::string& COMPUTE_ID() + { + static const std::string MY_COMPUTE_ID("compute"); + return MY_COMPUTE_ID; + } + + /// Attribute name for group name. + inline static const std::string& GROUP_NAME_ID() + { + static const std::string MY_GROUP_NAME_ID("group_name"); + return MY_GROUP_NAME_ID; + } + + /// \return the kind of a feature. + virtual const std::string& getKind() + { + return ID(); + } + + /// Performs the algorithm and stores results it in the data structure. + FEATURESPLUGIN_EXPORT virtual void execute(); + + /// Request for initialization of data model of the feature: adding all attributes + FEATURESPLUGIN_EXPORT virtual void initAttributes(); + + /// Called on change of any argument-attribute of this object + /// \param theID identifier of changed attribute + FEATURESPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); + + /// Reimplemented from ModelAPI_Feature::isMacro(). Returns true. + FEATURESPLUGIN_EXPORT virtual bool isMacro() const { return true; } + + /// Use plugin manager for features creation + FeaturesPlugin_SharedFaces(); + +private: + /// Return attribut values of object. + virtual AttributePtr attributObject(); + + /// Return attribut values of list of faces. + virtual AttributePtr attributListFaces(); + + /// Return attribut values of number of faces. + virtual AttributePtr attributNumberFaces(); + + /// Return attribut values of IsCompute. + virtual AttributePtr attributIsCompute(); + + /// Create group + void createGroup(); + + /// Update group + void updateGroup(); + + /// Feature to create group + FeaturePtr myCreateGroupFeature; +}; + +#endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts index 41fa7dca7..a01ffc9bc 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts @@ -155,6 +155,10 @@ Bounding box Boîte englobante + + Check shared faces + Vérifier les faces partagées + Placement Placement @@ -5503,6 +5507,124 @@ + + + Shared_faces_macro + + Check shared faces + Vérifier les faces partagées + + + Shared faces + Faces partagées + + + Number of shared faces : + Nombre de faces partagées : + + + + Shared_faces_macro:create_group + + Create group + Créer un groupe + + + + Shared_faces_macro:group_name + + Group name + Nom du groupe + + + + Shared_faces_macro:main_object + + Object + Objet + + + Shared faces + Faces partagées + + + + Shared_faces_macro:group_list + + Shared faces + Faces partagées + + + List of faces : + Liste des faces : + + + + Shared_faces_macro:transparency + + Transparency + Transparence + + + + Shared_faces + + Check shared faces + Vérifier les faces partagées + + + Shared faces + Faces partagées + + + Number of shared faces : + Nombre de faces partagées : + + + + Shared_faces:create_group + + Create group + Créer un groupe + + + + Shared_faces:group_name + + Group name + Nom du groupe + + + + Shared_faces:main_object + + Object + Objet + + + Shared faces + Faces partagées + + + + Shared_faces:group_list + + Shared faces + Faces partagées + + + List of faces : + Liste des faces : + + + + Shared_faces:transparency + + Transparency + Transparence + + + Symmetry diff --git a/src/FeaturesPlugin/Test/TestCheckSharedFaces.py b/src/FeaturesPlugin/Test/TestCheckSharedFaces.py new file mode 100644 index 000000000..41f9e5ce7 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestCheckSharedFaces.py @@ -0,0 +1,122 @@ +# Copyright (C) 2014-2021 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +""" + Unit test of Check shared faces +""" +#========================================================================= +# Initialization of the test +#========================================================================= + + +import os +import math + +from ModelAPI import * +from GeomAPI import * +from salome.shaper import model + + +__updated__ = "2020-11-12" + + +if __name__ == '__main__': + + model.begin() + partSet = model.moduleDocument() + Part_1 = model.addPart(partSet) + Part_1_doc = Part_1.document() + ### Create Box + Box_1 = model.addBox(Part_1_doc, 10, 10, 10) + ### Create Point + Point_2 = model.addPoint(Part_1_doc, 20, 10, 10) + ### Create Box + Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "Point_1")) + ### Create CompSolid + CompSolid_1 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")]) + ### Create Box + Box_3 = model.addBox(Part_1_doc, 10, 10, 10) + ### Create Box + Box_4 = model.addBox(Part_1_doc, 10, 10, 10) + ### Create Translation + Translation_1 = model.addTranslation(Part_1_doc, [model.selection("COMPOUND", "all-in-Box_4")], axis = model.selection("EDGE", "PartSet/OX"), + distance = 10, keepSubResults = True) + ### Create CompSolid + CompSolid_2 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_3_1"), model.selection("COMPOUND", "Translation_1_1")]) + ### Create Box + Box_5 = model.addBox(Part_1_doc, 10, 10, 10) + ### Create Translation + Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_5_1")], vector = [10, 0, 10], keepSubResults = True) + ### Create Compound + Compound_1 = model.addCompound(Part_1_doc, [model.selection("COMPSOLID", "CompSolid_1_1"), model.selection("SOLID", "Translation_2_1")]) + Compound_1.result().setTransparency(0.5) + Compound_1.result().subResult(0).setTransparency(0.5) + Compound_1.result().subResult(0).subResult(0).setTransparency(0.5) + Compound_1.result().subResult(0).subResult(1).setTransparency(0.5) + Compound_1.result().subResult(1).setTransparency(0.5) + + ### Create Shared_faces for compsolid + Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), "faces_compsolid") + + ### Create Shared_faces for compound + Shared_faces_2 = model.getSharedFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1"), 'faces_compound') + + model.do() + + # Check results + assert(Part_1_doc.size("Groups") == 2) + Shared_faces_1_Feature = Shared_faces_1.feature() + assert Shared_faces_1_Feature.error() == '' + assert Shared_faces_1_Feature.name() == "Shared_faces_1" + + aSelectionList = Shared_faces_1_Feature.selectionList("group_list") + assert aSelectionList.size() == 1 + + Shared_faces_2_Feature = Shared_faces_2.feature() + assert Shared_faces_2_Feature.error() == '' + assert Shared_faces_2_Feature.name() == "Shared_faces_2" + + aSelectionList = Shared_faces_2_Feature.selectionList("group_list") + assert aSelectionList.size() == 1 + + resShape_1 = modelAPI_Result(Part_1_doc.object("Groups", 0)).shape() + assert(not resShape_1.isNull()) + + # the group result is a face, check that this is one face + aShapeExplorer = GeomAPI_ShapeExplorer(resShape_1, GeomAPI_Shape.FACE) + assert(aShapeExplorer.more()) + assert(aShapeExplorer.current().isFace()) + aShapeExplorer.next() + assert(not aShapeExplorer.more()) + + resShape_2 = modelAPI_Result(Part_1_doc.object("Groups", 1)).shape() + assert(not resShape_2.isNull()) + + # the group result is a face, check that this is one face + aShapeExplorer = GeomAPI_ShapeExplorer(resShape_2, GeomAPI_Shape.FACE) + assert(aShapeExplorer.more()) + assert(aShapeExplorer.current().isFace()) + aShapeExplorer.next() + assert(not aShapeExplorer.more()) + + model.end() + + #========================================================================= + # End of test + #========================================================================= diff --git a/src/FeaturesPlugin/doc/FeaturesPlugin.rst b/src/FeaturesPlugin/doc/FeaturesPlugin.rst index a47b713d0..43d13da81 100644 --- a/src/FeaturesPlugin/doc/FeaturesPlugin.rst +++ b/src/FeaturesPlugin/doc/FeaturesPlugin.rst @@ -14,6 +14,7 @@ Features plug-in provides a set of common topological operations. It implements angularCopyFeature.rst boundingBoxFeature.rst chamferFeature.rst + checkSharedFaceFeature.rst copyFeature.rst defeaturingFeature.rst extrusionCutFeature.rst diff --git a/src/FeaturesPlugin/doc/TUI_sharedFacesFeature.rst b/src/FeaturesPlugin/doc/TUI_sharedFacesFeature.rst new file mode 100644 index 000000000..48e2f331c --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_sharedFacesFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_shared_faces: + +Check shared faces +================== + +.. literalinclude:: examples/check_shared_faces.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/FeaturesPlugin/doc/checkSharedFaceFeature.rst b/src/FeaturesPlugin/doc/checkSharedFaceFeature.rst new file mode 100644 index 000000000..48b7ec39e --- /dev/null +++ b/src/FeaturesPlugin/doc/checkSharedFaceFeature.rst @@ -0,0 +1,52 @@ +.. |shared_shapes.icon| image:: images/shared_shapes.png + +Check shared faces +================== + +The **Check shared faces** feature find the shared faces within a composolid or compound. + +The result is a list of faces and a group that can be created with a specified name. + +To check shared faces in the active part: + +#. Select in the Main Menu *Inspection - > Check shared faces* item or +#. Click |shared_shapes.icon| **Check shared faces** button in the toolbar + +The property panel is shown below. + +.. figure:: images/checkSharedFacesPropertyPanel.png + :align: center + + Check shared faces + + +Input fields: + +- **Object** contains composolid or compound selected in 3D OCC viewer or object browser. +- **Number of shared faces** indicate the number of found faces. +- **List of faces** the list of found faces. +- **Transparency** set the transparency of selected object. +- **Create group** check-box that allows the creation of the found faces group. +- **Group name** specifies the name of the group created. + + +**TUI Command**: + +.. py:function:: model.getSharedFaces(Part_doc, shape, nameGroup) + + :param part: The current part object. + :param object: A composolid or compound in format *model.selection(TYPE, shape)*. + :param string: The name of group to create + :return: Created group. + +Result +"""""" + +Result of **Check shared faces** where **Create group** is checked. + +.. figure:: images/sharedFacesResult.png + :align: center + + Shared faces + +**See Also** a sample TUI Script of :ref:`tui_shared_faces` operation. diff --git a/src/FeaturesPlugin/doc/examples/check_shared_faces.py b/src/FeaturesPlugin/doc/examples/check_shared_faces.py new file mode 100644 index 000000000..198027331 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/check_shared_faces.py @@ -0,0 +1,21 @@ +from salome.shaper import model +import os + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +### Create Box +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +### Create Point +Point_2 = model.addPoint(Part_1_doc, 20, 10, 10) +### Create Box +Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "Point_1")) +### Create CompSolid +CompSolid_1 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")]) + +### Create Shared_faces +Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), "mygroup") + +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/images/checkSharedFacesPropertyPanel.png b/src/FeaturesPlugin/doc/images/checkSharedFacesPropertyPanel.png new file mode 100644 index 0000000000000000000000000000000000000000..c5f0ee92ae482dd0a8d249ee5224ea66378007ee GIT binary patch literal 26398 zcmbrm2RzpO|1W+u6^TNjgeFQ#B$1hfWRFnFp4odPtCXZr_9%O0RkAWlwg@3aMppI~ z=lS`5&-eVkzjJ=)od5rE?)%aGxVyNn>oeZ(*Xy}npNI0-B`L`n$w?#@06lcg!bUwn+k#pR{M#aS$^Eewp!^hqSPAh#fas}=IJz8i_H{&^R^i&nCV z+vTv7SbpQ6jT1|z)37^JFhUW|bCmt`ll!J+WmP(@WuI=Sk*SGNyWYESk)Qp;)rZ5! zefDJ^djBJEBYI=F$7WO9ErW16`Yk-&=anA5e_5UBU#7N|`U;=x%V%NwbyA9Zna0MV zSCaqe2&UQe#?YzS?Azjcc>2`2YY~oKj?OLTFHF)%sw=2IY7Z7sZKtkzA^wB4&;n$bNKI?|e?la8L(yw=!+3#z;Qp4SDOv&mg zaZ2?5j%_Nz^1cD|6BpU{DcT;I{K;(lcW(i$b;!pr+4snKzGO15QMos^)yO?|k&3&} zG~a)LxkAKpztOjY!>iw|7*E{WV0hoGxh~E0a`|X+TXVdmNbh+|tM2CDOFym2=pDKB zl(-B(FP%umec7%fBYBy$LHrwAob(*8?6kak!-hoKT}k}e6moL+0lY|ND*OYbN7A{iG?I}Syb7v zbG+M0>-xw>)wG&)&@;9|_U%3l0t#U@d!N-P9{pU>$d-~$ms5FW;n*sDZLnKowB7jF zgKO(k6YB*k%58nKu7ZEax`%~^OB(EAW`)`d8r))JjUVnuxf-;H;7nG72u`zA{_5~V{pcuc-MP|eT? z3J$*PLr(X-z~)50X}kNRk9qe8-X~9<*p9Vvw%0y*_;5K^zwY6iH)j&Bg_Xy6tcQ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&%PdTN7=wmP_X|vk2FJAnAH{htVe;X0L?j;lW|EXQb;0`OKz$ z>QW7}=-***#gCw1kB$%#MF3cJsNcmE&rN93JE>XR1a8skB|d$TKT9_2 zgTZ#qVj7wm9b@B+FJEFi_1KzXyLp_AQ%05%g7p}TtN)&g|A&bG4U&t!ziF&m5&MT@ Tqvv^iOA5u&&egVz<1hFZOWeaI literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/images/sharedFacesResult.png b/src/FeaturesPlugin/doc/images/sharedFacesResult.png new file mode 100644 index 0000000000000000000000000000000000000000..114ac342149b334af9c2478682effc4d250ff046 GIT binary patch literal 7992 zcmZu$cRbbK|G$~pNvPz8Lawg8x<+Oyv$)x$T$_Z;wUUsKkqFmL*?WeoL`GaA>)IoG zlyN1pe&_1*`F_8D{5&4smwV3poYy|j=j(*(YO6EQo~MOCAPl!|s@{b_PSk;4hm%y` zo0|swqTqwVP5GAoN$}%)(&`2H|D3y;p}XEAYj;meR}{p?`H>R}?)K0Xg>rVYedNAI z{z(A>fwtdLRno^K{}^9#V)HkYcrmI3lN1rlg9(rm- zFBAF}6KeCUvF#0E=%izLV6b6O5nGVrkm%VLEUg-E+VLrgu+Gboe5qJieW!)XLa;NP z(U{=)T(W|O|8-*Q7(IrD&9X$n=X1|N}8-@pIV3p^2EsM59B`6GsdUI z?H?+YRNpOg1mN~UDqQ3t>&$VSkOrS1PU}1bWS!NL-Hn3tsSMZZgO};#r`S<)m{X6E z{UMJPQS5q5e&W#<`>F59Pca3V(KEY4zCSM^hhU;g!q0(sAAjM{e_+)tP42bu8^=qj zxF7p?Av}b2l6E#_@^RUTFDy=)kf*;-)}2kyBR}OCl(KLV0l6O-M!5GxFuK~m_4ye{ zdfD-6M18}76A;W+gNEQI&bHA{b6?05U$iqqrsSn^Fj;>_15E$GlkP(9OTlELf|RHs zJ93R(EEJrO*&9PAAh=d%O(uPR{%DOf7oHPb>{2;0Mf0)&FZ~k`tnsBGyO!l;b2~Hh;USVT(Kc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O!iVAroUKfn!}Z)EekZ$@mS$@5_7pKCa97YCr=ze7R)!P9cykpIZ>|7~T2<%B^X z-FHY3TAg$O`QJzD|47fSL=J{X!1%A2|1)%aoj6XSw#SRKQn3PA{<%0jzCHZ+A*fNV zLJ66=_Fsul{=Gs3^D%+60Q~>e=$IxmlUfJIk5VP@(*LN5*@FE0|NpD;Y6}Ip)MWr# gt$ic?xps6yjICw+<2WxMSrEuAHEq=*<@?Y64`L2SSO5S3 literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/images/shared_shapes.png b/src/FeaturesPlugin/doc/images/shared_shapes.png new file mode 100644 index 0000000000000000000000000000000000000000..23f804802251319855cadf3afb9bdabb5182e900 GIT binary patch literal 583 zcmV-N0=WH&P)bgGWIS@MM7DVsg zT;{Y$DPd*+G)+U(G}Lv?dcEE@O|yle1kO1`q-skICn*>%Fqoz*B@Fc)W9X*W+AKNZWNCW(f&_Xpg5lBUL3vMMO}M17Qe(?qQFJ zKuXk2^K8;nXaPRFT`wFbH-CcQJrV+{Qf4+2UIQP;JLBg2&%e}7LseCzlt^Y+8tSX6 z?C<~Ky(4%}kT4_M1HX<0+-Ovi3dwBv&QxcF!FxmkDuSxa2zS6&=8L|S5QwUXN=YrR zV2p8SV$?E1Q^E(}_o7C5EXK4%LV0LrsK}r=C93N1S)8l=bgGWIS@MM7DVsg zT;{Y$DPd*+G)+U(G}Lv?dcEE@O|yle1kO1`q-skICn*>%Fqoz*B@Fc)W9X*W+AKNZWNCW(f&_Xpg5lBUL3vMMO}M17Qe(?qQFJ zKuXk2^K8;nXaPRFT`wFbH-CcQJrV+{Qf4+2UIQP;JLBg2&%e}7LseCzlt^Y+8tSX6 z?C<~Ky(4%}kT4_M1HX<0+-Ovi3dwBv&QxcF!FxmkDuSxa2zS6&=8L|S5QwUXN=YrR zV2p8SV$?E1Q^E(}_o7C5EXK4%LV0LrsK}r=C93N1S)8l= + + + + + + diff --git a/src/FeaturesPlugin/shared_faces_macro_widget.xml b/src/FeaturesPlugin/shared_faces_macro_widget.xml new file mode 100644 index 000000000..d9e1e4c5d --- /dev/null +++ b/src/FeaturesPlugin/shared_faces_macro_widget.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + diff --git a/src/FeaturesPlugin/shared_faces_widget.xml b/src/FeaturesPlugin/shared_faces_widget.xml new file mode 100644 index 000000000..0c637211e --- /dev/null +++ b/src/FeaturesPlugin/shared_faces_widget.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/src/FeaturesPlugin/tests.set b/src/FeaturesPlugin/tests.set index 98f8623c6..eca27f516 100644 --- a/src/FeaturesPlugin/tests.set +++ b/src/FeaturesPlugin/tests.set @@ -543,6 +543,7 @@ SET(TEST_NAMES_PARA TestBooleanCut_Fuzzy_2.py TestBooleanFuse_Fuzzy.py TestBooleanCommon_Fuzzy.py + TestCheckSharedFaces.py ) SET(TEST_NAMES_SEQ diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp index 1a10fc353..31087ffc0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp @@ -1781,3 +1781,20 @@ void GeomAlgoAPI_ShapeTools::computeThroughAll(const ListOfShape& theObjects, } } } + +ListOfShape GeomAlgoAPI_ShapeTools::getSharedFaces(const GeomShapePtr& theShape) +{ + ListOfShape aSharedFaces; + TopTools_IndexedDataMapOfShapeListOfShape aMapFS; + TopExp::MapShapesAndUniqueAncestors(theShape->impl(), + TopAbs_FACE, TopAbs_SOLID, aMapFS); + for (Standard_Integer i = 1; i <= aMapFS.Extent(); i++) { + const TopTools_ListOfShape& ancestors = aMapFS.FindFromIndex(i); + if (ancestors.Size() > 1) { + GeomShapePtr aFace(new GeomAPI_Shape); + aFace->setImpl(new TopoDS_Shape(aMapFS.FindKey(i))); + aSharedFaces.push_back(aFace); + } + } + return aSharedFaces; +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index 0c058e147..b1697bd0c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -235,6 +235,11 @@ public: const ListOfShape& theBaseShapes, const std::shared_ptr theDir, double& theToSize, double& theFromSize); + + /// \brief Get shared faces of a shape + /// \param[in] theShape shape that should be exploded + /// \return list of shared faces + GEOMALGOAPI_EXPORT static ListOfShape getSharedFaces(const GeomShapePtr& theShape); }; #endif diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 14351b736..6226b5a6a 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -33,6 +33,7 @@ from FeaturesAPI import measureLength, measureDistance, measureRadius, measureAn from FeaturesAPI import shapeProximity from FeaturesAPI import getPointCoordinates, getGeometryCalculation, getBoundingBox from FeaturesAPI import getNormal +from FeaturesAPI import getSharedFaces from FeaturesAPI import makeVertexInsideFace from FeaturesAPI import addRemoveResults from FeaturesAPI import addCopy, addImportResult -- 2.39.2