From d69009d3f18c162b25a274137e666ae7abc4fb6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Wed, 4 Nov 2020 15:31:17 +0100 Subject: [PATCH] Implementation of inspection of duplicated faces --- .../ConnectorPlugin_PublishToStudyFeature.py | 82 +- src/FeaturesAPI/CMakeLists.txt | 2 + src/FeaturesAPI/FeaturesAPI.i | 2 + .../FeaturesAPI_DuplicatedFaces.cpp | 94 ++ src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h | 86 ++ src/FeaturesAPI/FeaturesAPI_swig.h | 1 + src/FeaturesPlugin/CMakeLists.txt | 37 +- .../FeaturesPlugin_CommonDuplicatedFaces.cpp | 144 +++ .../FeaturesPlugin_CommonDuplicatedFaces.h | 72 ++ .../FeaturesPlugin_DuplicatedFaces.cpp | 202 ++++ .../FeaturesPlugin_DuplicatedFaces.h | 143 +++ .../FeaturesPlugin_GroupDuplicatedFaces.cpp | 146 +++ .../FeaturesPlugin_GroupDuplicatedFaces.h | 124 ++ src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp | 30 +- src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts | 136 +++ .../Test/TestCheckDuplicatedFaces.py | 92 ++ src/FeaturesPlugin/doc/FeaturesPlugin.rst | 1 + .../doc/TUI_DuplicatedFacesFeature.rst | 11 + .../doc/checkDuplicatedFaceFeature.rst | 54 + .../doc/examples/checkDuplicatedFaces.py | 29 + .../checkduplicatedFacesPropertyPanel.png | Bin 0 -> 27797 bytes .../doc/images/duplicatedFacesResult.png | Bin 0 -> 8086 bytes .../doc/images/duplicated_shapes.png | Bin 0 -> 947 bytes .../duplicated_faces_macro_widget.xml | 40 + .../duplicated_faces_widget.xml | 37 + src/FeaturesPlugin/icons/duplicatedFaces.png | Bin 0 -> 947 bytes src/FeaturesPlugin/plugin-Features.xml | 10 +- src/FeaturesPlugin/tests.set | 3 +- src/GeomAlgoAPI/CMakeLists.txt | 26 + src/GeomAlgoAPI/GEOMAlgo_AlgoTools.cxx | 1006 +++++++++++++++++ src/GeomAlgoAPI/GEOMAlgo_AlgoTools.hxx | 198 ++++ src/GeomAlgoAPI/GEOMAlgo_BndSphere.cxx | 57 + src/GeomAlgoAPI/GEOMAlgo_BndSphere.hxx | 73 ++ src/GeomAlgoAPI/GEOMAlgo_BndSphere.lxx | 108 ++ src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.cxx | 89 ++ src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.hxx | 53 + src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.cxx | 85 ++ src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.hxx | 64 ++ .../GEOMAlgo_IndexedDataMapOfIntegerShape.hxx | 45 + ...ndexedDataMapOfPassKeyShapeListOfShape.hxx | 46 + ...EOMAlgo_IndexedDataMapOfShapeBndSphere.hxx | 46 + ...IndexedDataMapOfShapeIndexedMapOfShape.hxx | 50 + .../GEOMAlgo_ListOfCoupleOfShapes.hxx | 34 + src/GeomAlgoAPI/GEOMAlgo_PassKey.cxx | 240 ++++ src/GeomAlgoAPI/GEOMAlgo_PassKey.hxx | 105 ++ src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.cxx | 47 + src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.hxx | 51 + src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.cxx | 229 ++++ src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.hxx | 105 ++ .../GEOMAlgo_PassKeyShapeMapHasher.cxx | 47 + .../GEOMAlgo_PassKeyShapeMapHasher.hxx | 52 + src/GeomAlgoAPI/GeomAlgoAPI_Algo.cpp | 82 ++ src/GeomAlgoAPI/GeomAlgoAPI_Algo.h | 68 ++ .../GeomAlgoAPI_DuplicatedFaces.cpp | 142 +++ src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h | 38 + src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.cpp | 594 ++++++++++ src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.h | 91 ++ src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.cpp | 138 +++ src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.h | 91 ++ src/ModelHighAPI/CMakeLists.txt | 6 +- src/PythonAPI/model/features/__init__.py | 1 + 61 files changed, 5624 insertions(+), 61 deletions(-) create mode 100644 src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.cpp create mode 100644 src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.h create mode 100644 src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.cpp create mode 100644 src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.h create mode 100644 src/FeaturesPlugin/Test/TestCheckDuplicatedFaces.py create mode 100644 src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst create mode 100644 src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst create mode 100644 src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py create mode 100644 src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png create mode 100644 src/FeaturesPlugin/doc/images/duplicatedFacesResult.png create mode 100644 src/FeaturesPlugin/doc/images/duplicated_shapes.png create mode 100644 src/FeaturesPlugin/duplicated_faces_macro_widget.xml create mode 100644 src/FeaturesPlugin/duplicated_faces_widget.xml create mode 100644 src/FeaturesPlugin/icons/duplicatedFaces.png create mode 100644 src/GeomAlgoAPI/GEOMAlgo_AlgoTools.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_AlgoTools.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_BndSphere.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_BndSphere.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_BndSphere.lxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_ListOfCoupleOfShapes.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKey.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKey.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.hxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.cxx create mode 100644 src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.hxx create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_Algo.cpp create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_Algo.h create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.cpp create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.cpp create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.h create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.cpp create mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.h diff --git a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py index 8da67a31e..5e2444e23 100644 --- a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py +++ b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py @@ -163,51 +163,55 @@ 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)) + allRefGroups.append(ModelAPI.referencedFeatures(theRes, "Duplicated_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 6cd9ba368..88e1dfb3a 100644 --- a/src/FeaturesAPI/CMakeLists.txt +++ b/src/FeaturesAPI/CMakeLists.txt @@ -33,6 +33,7 @@ SET(PROJECT_HEADERS FeaturesAPI_Intersection.h FeaturesAPI_Measurement.h FeaturesAPI_NormalToFace.h + FeaturesAPI_DuplicatedFaces.h FeaturesAPI_MultiRotation.h FeaturesAPI_MultiTranslation.h FeaturesAPI_Partition.h @@ -70,6 +71,7 @@ SET(PROJECT_SOURCES FeaturesAPI_Intersection.cpp FeaturesAPI_Measurement.cpp FeaturesAPI_NormalToFace.cpp + FeaturesAPI_DuplicatedFaces.cpp FeaturesAPI_MultiRotation.cpp FeaturesAPI_MultiTranslation.cpp FeaturesAPI_Partition.cpp diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index d9fa7c0b5..5c566c243 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -64,6 +64,7 @@ %shared_ptr(FeaturesAPI_BooleanFill) %shared_ptr(FeaturesAPI_Chamfer) %shared_ptr(FeaturesAPI_NormalToFace) +%shared_ptr(FeaturesAPI_DuplicatedFaces) %shared_ptr(FeaturesAPI_Extrusion) %shared_ptr(FeaturesAPI_ExtrusionBoolean) %shared_ptr(FeaturesAPI_ExtrusionCut) @@ -214,6 +215,7 @@ %include "FeaturesAPI_Intersection.h" %include "FeaturesAPI_Measurement.h" %include "FeaturesAPI_NormalToFace.h" +%include "FeaturesAPI_DuplicatedFaces.h" %include "FeaturesAPI_MultiRotation.h" %include "FeaturesAPI_MultiTranslation.h" %include "FeaturesAPI_Partition.h" diff --git a/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.cpp b/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.cpp new file mode 100644 index 000000000..0aa69855a --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.cpp @@ -0,0 +1,94 @@ +// 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_DuplicatedFaces.h" + +#include + +#include +#include + +#include +#include +#include + +//================================================================================================= +FeaturesAPI_DuplicatedFaces:: + FeaturesAPI_DuplicatedFaces(const std::shared_ptr& theFeature) + : ModelHighAPI_Interface(theFeature) +{ + initialize(); +} + +//================================================================================================= +FeaturesAPI_DuplicatedFaces::~FeaturesAPI_DuplicatedFaces() +{ +} + +//================================================================================================= +FeaturesAPI_DuplicatedFaces::FeaturesAPI_DuplicatedFaces( + const std::shared_ptr& theFeature, + const ModelHighAPI_Selection& theObject, + const ModelHighAPI_Double& theTolerance, + const std::string & theNameGroup) +:ModelHighAPI_Interface(theFeature) +{ + if (initialize()) { + fillAttribute(theObject, myobjectselected); + fillAttribute(theTolerance, mytolerance); + fillAttribute(theNameGroup, mygroupname); + + execute(); + } +} + +//================================================================================================= +void FeaturesAPI_DuplicatedFaces::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + AttributeSelectionPtr anAttrObject; + anAttrObject = aBase->selection(FeaturesPlugin_GroupDuplicatedFaces::OBJECT_ID()); + + theDumper << aBase << " = model.getDuplicatedFaces(" << aDocName << ", " << anAttrObject; + theDumper << ", " << aBase->real(FeaturesPlugin_GroupDuplicatedFaces::TOLERANCE_ID()); + theDumper << ", " << aBase->string(FeaturesPlugin_GroupDuplicatedFaces::GROUP_NAME_ID()); + theDumper << ")" << std::endl; +} + +//================================================================================================= +DuplicatedFacesPtr getDuplicatedFaces(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject, + const ModelHighAPI_Double& theTolerance, + const std::string & theNameGroup) +{ + + FeaturePtr aFeature = thePart->addFeature(FeaturesPlugin_GroupDuplicatedFaces::ID()); + + DuplicatedFacesPtr aDuplicatedFaces; + + aDuplicatedFaces.reset(new FeaturesAPI_DuplicatedFaces(aFeature, + theObject, + theTolerance, + theNameGroup)); + + return aDuplicatedFaces; +} + diff --git a/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h b/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h new file mode 100644 index 000000000..f3c426d93 --- /dev/null +++ b/src/FeaturesAPI/FeaturesAPI_DuplicatedFaces.h @@ -0,0 +1,86 @@ +// 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_DuplicatedFaces_H_ +#define FeaturesAPI_DuplicatedFaces_H_ + +#include "FeaturesAPI.h" +#include "FeaturesPlugin_GroupDuplicatedFaces.h" + +#include +#include +#include +#include + +#include + +class ModelAPI_Document; +class ModelHighAPI_Selection; + +/// \class FeaturesAPI_DuplicatedFaces +/// \ingroup CPPHighAPI +/// \brief Interface to find duplicated faces +class FeaturesAPI_DuplicatedFaces: public ModelHighAPI_Interface +{ +public: + /// Constructor without values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_DuplicatedFaces(const std::shared_ptr& theFeature); + + FEATURESAPI_EXPORT + explicit FeaturesAPI_DuplicatedFaces(const std::shared_ptr& theFeature, + const ModelHighAPI_Selection& theobject, + const ModelHighAPI_Double& theTolerance, + const std::string & theNameGroup); + + /// Destructor. + FEATURESAPI_EXPORT + virtual ~FeaturesAPI_DuplicatedFaces(); + + INTERFACE_3(FeaturesPlugin_GroupDuplicatedFaces::ID(), + objectselected, FeaturesPlugin_GroupDuplicatedFaces::OBJECT_ID(), + ModelAPI_AttributeSelection, + /** object selected*/, + tolerance, FeaturesPlugin_GroupDuplicatedFaces::TOLERANCE_ID(), + ModelAPI_AttributeDouble, + /** tolerance*/, + groupname, FeaturesPlugin_GroupDuplicatedFaces::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 DuplicatedFacesPtr; + +/// \ingroup CPPHighAPI +/// \brief get the duplicated Faces +/// \param thePart the part +/// \param theobject the object selected +FEATURESAPI_EXPORT +DuplicatedFacesPtr getDuplicatedFaces(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject, + const ModelHighAPI_Double& theTolerance, + const std::string & theNameGroup); + +#endif // FeaturesAPI_DuplicatedFaces_H_ diff --git a/src/FeaturesAPI/FeaturesAPI_swig.h b/src/FeaturesAPI/FeaturesAPI_swig.h index ede8f2c11..8e63c34ca 100644 --- a/src/FeaturesAPI/FeaturesAPI_swig.h +++ b/src/FeaturesAPI/FeaturesAPI_swig.h @@ -36,6 +36,7 @@ #include "FeaturesAPI_Intersection.h" #include "FeaturesAPI_Measurement.h" #include "FeaturesAPI_NormalToFace.h" + #include "FeaturesAPI_DuplicatedFaces.h" #include "FeaturesAPI_MultiRotation.h" #include "FeaturesAPI_MultiTranslation.h" #include "FeaturesAPI_Partition.h" diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index e3f25e81d..f758c2d4e 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -19,6 +19,16 @@ INCLUDE(Common) INCLUDE(UnitTest) +INCLUDE(UseQtExt) + +# additional include directories +INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/GeomDataAPI + ${PROJECT_SOURCE_DIR}/src/Locale + ${QT_INCLUDES}) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS(${QT_DEFINITIONS}) + SET(PROJECT_HEADERS @@ -60,6 +70,9 @@ SET(PROJECT_HEADERS FeaturesPlugin_Fillet.h FeaturesPlugin_Fillet1D.h FeaturesPlugin_Measurement.h + FeaturesPlugin_DuplicatedFaces.h + FeaturesPlugin_CommonDuplicatedFaces.h + FeaturesPlugin_GroupDuplicatedFaces.h FeaturesPlugin_FusionFaces.h FeaturesPlugin_RemoveResults.h FeaturesPlugin_Chamfer.h @@ -114,6 +127,9 @@ SET(PROJECT_SOURCES FeaturesPlugin_Fillet.cpp FeaturesPlugin_Fillet1D.cpp FeaturesPlugin_Measurement.cpp + FeaturesPlugin_DuplicatedFaces.cpp + FeaturesPlugin_CommonDuplicatedFaces.cpp + FeaturesPlugin_GroupDuplicatedFaces.cpp FeaturesPlugin_FusionFaces.cpp FeaturesPlugin_RemoveResults.cpp FeaturesPlugin_Chamfer.cpp @@ -159,6 +175,8 @@ SET(XML_RESOURCES fillet_widget.xml fillet1d_widget.xml measurement_widget.xml + duplicated_faces_widget.xml + duplicated_faces_macro_widget.xml fusion_faces_widget.xml chamfer_widget.xml copy_widget.xml @@ -178,6 +196,12 @@ SET(TEXT_RESOURCES FeaturesPlugin_msg_ru.ts ) +# sources / moc wrappings +QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_MOC_HEADERS}) + +#QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES}) + +SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES}) SOURCE_GROUP ("XML Files" FILES ${XML_RESOURCES}) SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES}) @@ -204,7 +228,12 @@ SET(PROJECT_LIBRARIES ) ADD_DEFINITIONS(-DFEATURESPLUGIN_EXPORTS) -ADD_LIBRARY(FeaturesPlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES}) +ADD_LIBRARY(FeaturesPlugin MODULE + ${PROJECT_SOURCES} + ${PROJECT_HEADERS} + ${XML_RESOURCES} + ${TEXT_RESOURCES} + ${PROJECT_AUTOMOC}) TARGET_LINK_LIBRARIES(FeaturesPlugin ${PROJECT_LIBRARIES}) INSTALL(TARGETS FeaturesPlugin DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES}) @@ -221,16 +250,16 @@ ADD_UNIT_TESTS( IF(${HAVE_SALOME}) enable_testing() set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/FeaturesPlugin") - + install(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) - + set(TMP_TESTS_NAMES) foreach(tfile ${TEST_NAMES}) list(APPEND TMP_TESTS_NAMES "Test/${tfile}") endforeach(tfile ${TEST_NAMES}) - + install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY}) ENDIF(${HAVE_SALOME}) diff --git a/src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.cpp new file mode 100644 index 000000000..bc66326c7 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.cpp @@ -0,0 +1,144 @@ +// 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_CommonDuplicatedFaces.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +//================================================================================================= +void explode(const GeomShapePtr& theCompound, ListOfShape& theSubs) +{ + if (theCompound->isCompound() || theCompound->isCompSolid()) { + GeomAPI_ShapeIterator anIt(theCompound); + for (; anIt.more(); anIt.next()) + explode(anIt.current(), theSubs); + } else + theSubs.push_back(theCompound); +} + +//================================================================================================= +void FeaturesPlugin_CommonDuplicatedFaces::updateFaces() +{ + AttributeSelectionPtr ancompSolidAttr = + std::dynamic_pointer_cast(attributObject()); + + AttributeSelectionListPtr aFacesListAttr = + std::dynamic_pointer_cast + (attributListFaces()); + + GeomShapePtr aShape = ancompSolidAttr->value(); + + AttributeDoublePtr aToleranceAttr = + std::dynamic_pointer_cast + (attributTolerance()); + + AttributeBooleanPtr anIsCompute = + std::dynamic_pointer_cast(attributIsCompute()); + if (!anIsCompute->value()) { + myShape = aShape; + anIsCompute->setValue(true); + } + if (aShape.get() && ancompSolidAttr->context().get() + && aToleranceAttr.get() && !aShape->isEqual(myShape)) { + + if (aFacesListAttr->isInitialized()) + aFacesListAttr->clear(); + + aShape = ancompSolidAttr->context()->shape(); + if (aShape) { + std::string anError; + ListOfShape aFaces; + ListOfShape theSubs; + explode(aShape, theSubs); + + if (!GetDuplicatedFaces(theSubs, + aToleranceAttr->value(), + aFaces, + anError)) + setError("Error in duplicated faces calculation :" + anError); + + myShape = aShape; + aFacesListAttr->setSelectionType("face"); + + ListOfShape::const_iterator anIt = aFaces.cbegin(); + for (; anIt != aFaces.cend(); ++anIt) { + + GeomShapePtr aFacePtr = *anIt; + + if (!aFacePtr.get()) { + setError("GetDuplicatedFaces : An invalid face found " + anError); + } + aFacesListAttr->append(ancompSolidAttr->context(), aFacePtr); + } + std::stringstream alabel; + alabel << aFacesListAttr->size(); + AttributeStringPtr aNumberFacesAttr = + std::dynamic_pointer_cast + (attributNumberFaces()); + aNumberFacesAttr->setValue(alabel.str()); + } + } +} + +//================================================================================================= +void FeaturesPlugin_CommonDuplicatedFaces::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_CommonDuplicatedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.h new file mode 100644 index 000000000..c01b6a8b2 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_CommonDuplicatedFaces.h @@ -0,0 +1,72 @@ +// 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_CommonDuplicatedFaces_H_ +#define FeaturesPlugin_CommonDuplicatedFaces_H_ + +#include "FeaturesPlugin.h" + +#include +#include +#include + +#include +#include + + +/// \class FeaturesPlugin_CommonDuplicatedFaces +/// \ingroup Plugins +/// \brief Feature to check the duplicated faces of solid + +class FeaturesPlugin_CommonDuplicatedFaces : 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 tolerance. + virtual AttributePtr attributTolerance() = 0; + + /// Return Attribut values of IsCompute. + virtual AttributePtr attributIsCompute() = 0; + + protected: + FeaturesPlugin_CommonDuplicatedFaces() {} + + //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_DuplicatedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.cpp new file mode 100644 index 000000000..badca1158 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.cpp @@ -0,0 +1,202 @@ +// 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_DuplicatedFaces.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +//================================================================================================= +FeaturesPlugin_DuplicatedFaces::FeaturesPlugin_DuplicatedFaces() +{ +} + +void FeaturesPlugin_DuplicatedFaces::initAttributes() +{ + // attribute for object selected + data()->addAttribute(OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + AttributeSelectionListPtr aList = std::dynamic_pointer_cast( + 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(TOLERANCE_ID(), ModelAPI_AttributeDouble::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_DuplicatedFaces::attributIsCompute() +{ + return attribute(COMPUTE_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_DuplicatedFaces::attributObject() +{ + return attribute(OBJECT_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_DuplicatedFaces::attributListFaces() +{ + return attribute(LIST_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_DuplicatedFaces::attributNumberFaces() +{ + return attribute(NUMBER_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_DuplicatedFaces::attributTolerance() +{ + return attribute(TOLERANCE_ID()); +} + + +//================================================================================================= +void FeaturesPlugin_DuplicatedFaces::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_DuplicatedFaces"); + } + } + + if (selection(OBJECT_ID())->isInitialized()) { + AttributeSelectionPtr ancompSolidAttr = selection(OBJECT_ID()); + ResultPtr aResult = ancompSolidAttr->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); + } + } +} + +//================================================================================================= +void FeaturesPlugin_DuplicatedFaces::attributeChanged(const std::string& theID) +{ + if (theID == OBJECT_ID() + || theID == TOLERANCE_ID()) { + updateFaces(); + if (myCreateGroupFeature.get()) + updateGroup(); + } +} + +//================================================================================================= +void FeaturesPlugin_DuplicatedFaces::createGroup() +{ + SessionPtr aSession = ModelAPI_Session::get(); + + DocumentPtr aDoc = aSession->activeDocument(); + + if (aDoc.get()) { + myCreateGroupFeature = aDoc->addFeature(FeaturesPlugin_GroupDuplicatedFaces::ID()); + } +} + +//================================================================================================= +void FeaturesPlugin_DuplicatedFaces::updateGroup() +{ + myCreateGroupFeature-> + boolean(FeaturesPlugin_GroupDuplicatedFaces::COMPUTE_ID())->setValue(false); + myCreateGroupFeature->string(FeaturesPlugin_GroupDuplicatedFaces::GROUP_NAME_ID()) + ->setValue(string(GROUP_NAME_ID())->value()); + + myCreateGroupFeature->selection(FeaturesPlugin_GroupDuplicatedFaces::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_GroupDuplicatedFaces::TRANSPARENCY_ID()) + ->setValue(integer(TRANSPARENCY_ID())->value()); + + myCreateGroupFeature->real(FeaturesPlugin_GroupDuplicatedFaces::TOLERANCE_ID()) + ->setValue(real(TOLERANCE_ID())->value()); + + myCreateGroupFeature->execute(); + myCreateGroupFeature + ->boolean(FeaturesPlugin_GroupDuplicatedFaces::COMPUTE_ID())->setValue(true); +} diff --git a/src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.h new file mode 100644 index 000000000..666a66f06 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_DuplicatedFaces.h @@ -0,0 +1,143 @@ +// 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_DuplicatedFaces_H_ +#define FeaturesPlugin_DuplicatedFaces_H_ + +#include + +/// \class FeaturesPlugin_DuplicatedFaces +/// \ingroup Plugins +/// \brief Feature to check the duplicated faces of solid + +class FeaturesPlugin_DuplicatedFaces : public FeaturesPlugin_CommonDuplicatedFaces +{ +public: + inline static const std::string& ID() + { + static const std::string MY_ID("Duplicated_faces_macro"); + return MY_ID; + } + + /// \return the kind of a feature. + virtual const std::string& getKind() + { + return 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_duplicated_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 tolerance. + inline static const std::string& TOLERANCE_ID() + { + static const std::string MY_TOLERANCE_ID("tolerance"); + return MY_TOLERANCE_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 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; + } + + /// 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_DuplicatedFaces(); + + 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 tolerance. + virtual AttributePtr attributTolerance(); + + /// 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_GroupDuplicatedFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.cpp new file mode 100644 index 000000000..4b0e1e351 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.cpp @@ -0,0 +1,146 @@ +// 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_GroupDuplicatedFaces.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +//================================================================================================= +FeaturesPlugin_GroupDuplicatedFaces::FeaturesPlugin_GroupDuplicatedFaces() +{ +} + +//================================================================================================= +void FeaturesPlugin_GroupDuplicatedFaces::initAttributes() +{ + // attribute for object selected + data()->addAttribute(OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + AttributeSelectionListPtr aList = std::dynamic_pointer_cast( + 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(TOLERANCE_ID(), ModelAPI_AttributeDouble::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()); + data()->boolean(COMPUTE_ID())->setValue(true); +} + + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupDuplicatedFaces::attributObject() +{ + return attribute(OBJECT_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupDuplicatedFaces::attributIsCompute() +{ + return attribute(COMPUTE_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupDuplicatedFaces::attributListFaces() +{ + return attribute(LIST_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupDuplicatedFaces::attributNumberFaces() +{ + return attribute(NUMBER_FACES_ID()); +} + +//================================================================================================= +AttributePtr FeaturesPlugin_GroupDuplicatedFaces::attributTolerance() +{ + return attribute(TOLERANCE_ID()); +} + +//================================================================================================= +void FeaturesPlugin_GroupDuplicatedFaces::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()) { + AttributeSelectionPtr ancompSolidAttr = selection(OBJECT_ID()); + ResultPtr aResult = ancompSolidAttr->context(); + + if(integer(TRANSPARENCY_ID())->isInitialized()){ + 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); + } + } + } +} + +//================================================================================================= +void FeaturesPlugin_GroupDuplicatedFaces::attributeChanged(const std::string& theID) +{ + if (theID == OBJECT_ID() + || theID == TOLERANCE_ID()) { + updateFaces(); + } +} diff --git a/src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.h b/src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.h new file mode 100644 index 000000000..0a45bd243 --- /dev/null +++ b/src/FeaturesPlugin/FeaturesPlugin_GroupDuplicatedFaces.h @@ -0,0 +1,124 @@ +// 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_GroupDuplicatedFaces_H_ +#define FeaturesPlugin_GroupDuplicatedFaces_H_ + +#include + +/// \class FeaturesPlugin_GroupDuplicatedFaces +/// \ingroup Plugins +/// \brief Feature to check the duplicated faces of solid + +class FeaturesPlugin_GroupDuplicatedFaces : public FeaturesPlugin_CommonDuplicatedFaces +{ +public: + inline static const std::string& ID() + { + static const std::string MY_ID("Duplicated_faces"); + return MY_ID; + } + + /// \return the kind of a feature. + virtual const std::string& getKind() + { + return 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_duplicated_faces"); + return MY_NUMBER_FACES_ID; + } + + /// Attribute name for list of faces + 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 tolerance. + inline static const std::string& TOLERANCE_ID() + { + static const std::string MY_TOLERANCE_ID("tolerance"); + return MY_TOLERANCE_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; + } + + /// 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_GroupDuplicatedFaces(); + + 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 tolerance. + virtual AttributePtr attributTolerance(); + + /// Return Attribut values of IsCompute. + virtual AttributePtr attributIsCompute(); +}; + +#endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index 3d00700d6..82a7b2b83 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -19,52 +19,53 @@ #include +#include #include +#include #include -#include #include -#include #include #include +#include #include -#include +#include #include #include -#include +#include #include +#include +#include #include +#include +#include #include #include #include #include -#include #include #include #include #include #include #include +#include #include +#include #include -#include #include #include +#include #include #include #include #include #include -#include -#include -#include -#include -#include #include +#include #include #include - #include // the only created instance of this plugin @@ -193,6 +194,10 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID) return FeaturePtr(new FeaturesPlugin_Fillet1D); } else if (theFeatureID == FeaturesPlugin_Measurement::ID()) { return FeaturePtr(new FeaturesPlugin_Measurement); + } else if (theFeatureID == FeaturesPlugin_DuplicatedFaces::ID()) { + return FeaturePtr(new FeaturesPlugin_DuplicatedFaces); + } else if (theFeatureID == FeaturesPlugin_GroupDuplicatedFaces::ID()) { + return FeaturePtr(new FeaturesPlugin_GroupDuplicatedFaces); } else if (theFeatureID == FeaturesPlugin_RemoveResults::ID()) { return FeaturePtr(new FeaturesPlugin_RemoveResults); } else if (theFeatureID == FeaturesPlugin_Chamfer::ID()) { @@ -217,7 +222,6 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID) return FeaturePtr(new FeaturesPlugin_NormalToFace); } - // feature of such kind is not found return FeaturePtr(); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts index 878c1f4d5..796e5cb83 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts @@ -143,6 +143,10 @@ Rotation Rotation + + Check duplicated faces + Vérifier les faces dupliquées + Symmetry Symétrie @@ -4966,6 +4970,138 @@ + + + Duplicated_faces_macro + + Check duplicated faces + Vérifier les faces dupliquées + + + Duplicated faces + Faces dupliquées + + + Number of duplicated faces : + Nombre de faces dupliquées : + + + + Duplicated_faces_macro:create_group + + Create group + Créer un groupe + + + + Duplicated_faces_macro:group_name + + Group name + Nom du groupe + + + + Duplicated_faces_macro:main_object + + Object + Objet + + + Duplicated faces + Faces dupliquées + + + + Duplicated_faces_macro:group_list + + Duplicated faces + Faces dupliquées + + + List of faces : + Liste des faces : + + + + Duplicated_faces_macro:transparency + + Transparency + Transparence + + + + Duplicated_faces_macro:tolerance + + Tolerance + Tolérance + + + + Duplicated_faces + + Check duplicated faces + Vérifier les faces dupliquées + + + Duplicated faces + Faces dupliquées + + + Number of duplicated faces : + Nombre de faces dupliquées : + + + + Duplicated_faces:create_group + + Create group + Créer un groupe + + + + Duplicated_faces:group_name + + Group name + Nom du groupe + + + + Duplicated_faces:main_object + + Object + Objet + + + Duplicated faces + Faces dupliquées + + + + Duplicated_faces:group_list + + Duplicatedfaces + Faces dupliquées + + + List of faces : + Liste des faces : + + + + Duplicated_faces:transparency + + Transparency + Transparence + + + + Duplicated_faces:tolerance + + Tolerance + Tolérance + + + Symmetry diff --git a/src/FeaturesPlugin/Test/TestCheckDuplicatedFaces.py b/src/FeaturesPlugin/Test/TestCheckDuplicatedFaces.py new file mode 100644 index 000000000..6029eed19 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestCheckDuplicatedFaces.py @@ -0,0 +1,92 @@ +# 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 Duplicated 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, 100, 50, 100) + ### Create Point + Point_1 = model.addPoint(Part_1_doc, 100, 0, 0) + ### Create Point + Point_2 = model.addPoint(Part_1_doc, 250, 50, 100) + ### Create Box + Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "all-in-Point_1"), model.selection("VERTEX", "all-in-Point_2")) + ### Create Point + Point_3 = model.addPoint(Part_1_doc, 100, 50, 250) + ### Create Box + Box_3 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "Point_3")) + ### Create Compound + Compound_1_objects = [model.selection("SOLID", "Box_1_1"), + model.selection("SOLID", "Box_2_1"), + model.selection("SOLID", "Box_3_1")] + Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects) + ### Create Duplicated_faces + Duplicated_faces_1 = model.getDuplicatedFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1"), 0.001, "mygroup") + + model.do() + # Check results + Duplicated_faces_1_Feature = Duplicated_faces_1.feature() + assert Duplicated_faces_1_Feature.error() == '' + assert Duplicated_faces_1_Feature.name() == "Duplicated_faces_1" + + aSelectionList = Duplicated_faces_1_Feature.selectionList("group_list") + assert aSelectionList.size() == 2 + + assert(Part_1_doc.size("Groups") == 1) + + #assert Part_1_doc.object("Groups", 0).name() == "mygroup" + resShape = modelAPI_Result(Part_1_doc.object("Groups", 0)).shape() + assert(not resShape.isNull()) + + # the group result is a face, check that this is one face + aShapeExplorer = GeomAPI_ShapeExplorer(resShape, GeomAPI_Shape.FACE) + assert(aShapeExplorer.more()) + assert(aShapeExplorer.current().isFace()) + aShapeExplorer.next() + 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 6fc8177bd..41f6a03d8 100644 --- a/src/FeaturesPlugin/doc/FeaturesPlugin.rst +++ b/src/FeaturesPlugin/doc/FeaturesPlugin.rst @@ -27,6 +27,7 @@ Features plug-in provides a set of common topological operations. It implements linearCopyFeature.rst measurementFeature.rst normalToFaceFeature.rst + checkDuplicatedFaceFeature.rst pipeFeature.rst placementFeature.rst pointCoordinatesFeature.rst diff --git a/src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst b/src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst new file mode 100644 index 000000000..369057369 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_DuplicatedFacesFeature.rst @@ -0,0 +1,11 @@ + + .. _tui_duplicated_faces: + +Check duplicated faces +====================== + +.. literalinclude:: examples/checkDuplicatedFaces.py + :linenos: + :language: python + +:download:`Download this script ` diff --git a/src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst b/src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst new file mode 100644 index 000000000..2ed808af3 --- /dev/null +++ b/src/FeaturesPlugin/doc/checkDuplicatedFaceFeature.rst @@ -0,0 +1,54 @@ +.. |duplicated_shapes.icon| image:: images/duplicated_shapes.png + +Check duplicated faces +====================== + +The **Check duplicated faces** feature find the duplicated faces within a composolid or compound. + +The result is a list of faces. A group can be created with a name specified. + +To check duplicated faces in the active part: + +#. select in the Main Menu *Inspection - > Check duplicated faces* item or +#. click |duplicated_shapes.icon| **Check duplicated faces** button in the toolbar + +The property panel is shown below. + +.. figure:: images/checkduplicatedFacesPropertyPanel.png + :align: center + + Check duplicated faces + + +Input fields: + +- **Object** contains composolid or compound selected in 3D OCC viewer or object browser. +- **Number of duplicated faces** indicate the number of found faces. +- **List of faces** the list of found faces. +- **Transparency** set the transparency of selected object. +- **Tolerance** set the tolerance for the algorithme. +- **Create group** check-box allow the creation with the group of found faces. +- **Group name** specified the name of the group created. + + +**TUI Command**: + +.. py:function:: model.getDuplicatedFaces(Part_doc, shape, tolerance, nameGroup) + + :param part: The current part object. + :param object: A composolid or compound in format *model.selection("Type", shape)*. + :param number: value of the tolerance. + :param string: name of group created. + :return: Created group. + +Result +"""""" + +Result of **Check duplicated faces** where **Create group** is checked. + +.. figure:: images/duplicatedFacesResult.png + :align: center + + Duplicated faces + +**See Also** a sample TUI Script of :ref:`tui_duplicated_faces` operation. diff --git a/src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py b/src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py new file mode 100644 index 000000000..b12dc2d09 --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/checkDuplicatedFaces.py @@ -0,0 +1,29 @@ +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, 100, 50, 100) +### Create Point +Point_1 = model.addPoint(Part_1_doc, 100, 0, 0) +### Create Point +Point_2 = model.addPoint(Part_1_doc, 250, 50, 100) +### Create Box +Box_2 = model.addBox(Part_1_doc, model.selection("VERTEX", "all-in-Point_1"), model.selection("VERTEX", "all-in-Point_2")) +### Create Point +Point_3 = model.addPoint(Part_1_doc, 100, 50, 250) +### Create Box +Box_3 = model.addBox(Part_1_doc, model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "Point_3")) +### Create Compound +Compound_1_objects = [model.selection("SOLID", "Box_1_1"), + model.selection("SOLID", "Box_2_1"), + model.selection("SOLID", "Box_3_1")] +Compound_1 = model.addCompound(Part_1_doc, Compound_1_objects) +### Create Duplicated_faces +Duplicated_faces_1 = model.getDuplicatedFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1"), 0.001, "mygroup") + +model.do() +model.end() diff --git a/src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png b/src/FeaturesPlugin/doc/images/checkduplicatedFacesPropertyPanel.png new file mode 100644 index 0000000000000000000000000000000000000000..439d7508943ca8905214eb31b90592f4d93ae295 GIT binary patch literal 27797 zcmbq)bC4%Z*Jby#ZQHipJ=3;r+qP}n=Cs|vY1{U+ZF~E9zkN5pjc*YfTM-qRmAF}d zWYxX*oRbmqvSM)1*w8>gKyVV`!iqpZz#!juEhPANOR|#D+jjx#^ix6^^850JG!FlM z#&Q->cUH19b#^mwGyyWRwX-pyb24%?F|l5dujF3n{y2pKrQ(PcDD` zxmm`;;_!m`NtzJ6G7#M@snGaXDN~_Q#9o8WW~mfeSTdw`f!%DTe1S*|Ni6E>_|y#$ zAZ1F_=716?I(l*6pOw5ky5q`ox;pZi=E|GqvXhWB%tjJI{Jh)8Za&pX6G9Ar^1s)? z5d1EKAi)C(frv371LH+=pL9qaDu3ySa;%N@*n-uMyuky{2-6pC9i^pvnKPlCJGRs? zxeDYheMB%keMu;_b`9{5)I(^>JE;xzafUrmbZJ$o){ql3Gp_^QUY=*Vy;?b1bhz&V z0~AE|r@*{B&0)l9H%JtAqvb+gov~RHdzx(~)&_?K54AITi=cOnQo?d5`=3j7?VJU! zj6@@((;Rb82)-tRA0&rxJNk}Zwgsy(KJ{ueo3ZNx!DMus-kvVZ7AqGSy2)GDyGNqy zWatzC52dr$AZ;!m5g$i&PH*q@=za?6*AHgli`~8m1TYmkOqwlKabX9Y^b(KG5=f*P zuSkC>fAoe?5;G^h!kwDEdwunMMCWl*?U{X77VP8&lwb&bI#Gt>SbTSj(>~dKcS&V& z1#%Bu89Z$m8OgIvZlmu&Wwb`!E@*Zyss(qH;~ixnSo|bVc<1?@Iw&AsYIPt*x}y}U zcOcof=1VVx|W~3Gxb`RV=21b7sxwp6a>=hi>r7kx~8A>?Fo~9^u~dPW7mQ z6LG9w5w&d)aW2bQFcjay0i{hv*?vHu2U$$+A2!M-a&nmXjTi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Zc1ss~h@0jvjnW%C2 zvLxscKjh>b=e*d6<;jwlMmiYiOZ9+Od2X49&wEzhV4CDQko78x0@5-%Q9qM zlASFR;q?YAs1jKd(-HZn>`3Lz9@@yojil_vJZvoKD`@m*d5(de!`Fr}Jal&%7iJm% zgWF~YEjWQk0ZE)cQzv%2v7~-W@%^`|rAypnkAJGU$CbM#iuhyJN{nBl0357C N#uRgMfq`TAe*vifBAWmJ literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/images/duplicated_shapes.png b/src/FeaturesPlugin/doc/images/duplicated_shapes.png new file mode 100644 index 0000000000000000000000000000000000000000..0d66a119b07a8dab28ea41d5bf263d8b4bd272e8 GIT binary patch literal 947 zcmV;k15EshP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ^@RCwBA{Qv(y12q9a05LI882|(j)eQs)AQl*d zk&zKaA|)jS92S57{)OXz|Nb%j`SXY2`}gk*-@big`1I)$!-o$a7~Z^j1ERqO00a;V zHd{c3$(e^Ru<=VU{QmnNXxKl7zyJQj@sD4B8NUDe!|?UTABL@MfnY;{KpBW%00a<* zmlG2c|Es#^GW`1e2cq#OP$Lk30c!pRV*mIJWdCOP{Ovc`Fr$nmFs&XyECCQeC@zeO ziu$kOp2zU(&p(E5Kuyf-e;9rO4gC#rA<(7&fGOe+kOsMKTU!8wY4&o4-`~H$w5tFy z4?qAh!jeruK)`=yW@d0W{rdF_97dl%e`fgl^(&YU3OktGmoHx!)@f)kd&a07n;4GB3mi{TGY!%V|uhOZBAFm#*bG5q}V7wk=# zPyYS=&A@OvfT7PakD=rAG_b+Q03d*vkX`r>h-Vq5F#P=e4~YMO!w%Un5Dj)I$bV;N zF#H0tYt(~L3B22E-um|NakgA;@DO7kzX#||DXo`1%}<7 z{qtakfl~Ji5DgGOa05Zkes}*I1E+u#!>_L(!@dLYPZSq|*dT9$0GeSJfcOZ=P=Ek} z=M-RRLuyHjY}gJc{S_d9kn^$u5GO!sVgQC=AVGitVnI`IhXfbCfO->d7zh9a7y!=r V1ZfMRt}p-q002ovPDHLkV1iQBlSu#o literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/duplicated_faces_macro_widget.xml b/src/FeaturesPlugin/duplicated_faces_macro_widget.xml new file mode 100644 index 000000000..532fcc37a --- /dev/null +++ b/src/FeaturesPlugin/duplicated_faces_macro_widget.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/src/FeaturesPlugin/duplicated_faces_widget.xml b/src/FeaturesPlugin/duplicated_faces_widget.xml new file mode 100644 index 000000000..c742ea4a7 --- /dev/null +++ b/src/FeaturesPlugin/duplicated_faces_widget.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + diff --git a/src/FeaturesPlugin/icons/duplicatedFaces.png b/src/FeaturesPlugin/icons/duplicatedFaces.png new file mode 100644 index 0000000000000000000000000000000000000000..0d66a119b07a8dab28ea41d5bf263d8b4bd272e8 GIT binary patch literal 947 zcmV;k15EshP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ^@RCwBA{Qv(y12q9a05LI882|(j)eQs)AQl*d zk&zKaA|)jS92S57{)OXz|Nb%j`SXY2`}gk*-@big`1I)$!-o$a7~Z^j1ERqO00a;V zHd{c3$(e^Ru<=VU{QmnNXxKl7zyJQj@sD4B8NUDe!|?UTABL@MfnY;{KpBW%00a<* zmlG2c|Es#^GW`1e2cq#OP$Lk30c!pRV*mIJWdCOP{Ovc`Fr$nmFs&XyECCQeC@zeO ziu$kOp2zU(&p(E5Kuyf-e;9rO4gC#rA<(7&fGOe+kOsMKTU!8wY4&o4-`~H$w5tFy z4?qAh!jeruK)`=yW@d0W{rdF_97dl%e`fgl^(&YU3OktGmoHx!)@f)kd&a07n;4GB3mi{TGY!%V|uhOZBAFm#*bG5q}V7wk=# zPyYS=&A@OvfT7PakD=rAG_b+Q03d*vkX`r>h-Vq5F#P=e4~YMO!w%Un5Dj)I$bV;N zF#H0tYt(~L3B22E-um|NakgA;@DO7kzX#||DXo`1%}<7 z{qtakfl~Ji5DgGOa05Zkes}*I1E+u#!>_L(!@dLYPZSq|*dT9$0GeSJfcOZ=P=Ek} z=M-RRLuyHjY}gJc{S_d9kn^$u5GO!sVgQC=AVGitVnI`IhXfbCfO->d7zh9a7y!=r V1ZfMRt}p-q002ovPDHLkV1iQBlSu#o literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index 87e47c378..400b36a65 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -134,7 +134,7 @@ + icon="icons/Features/fusion_faces.png" auto_preview="true" helpfile="FeaturesPlugin/fusionFacesFeature.html"> + + + + + + diff --git a/src/FeaturesPlugin/tests.set b/src/FeaturesPlugin/tests.set index 7e5e58612..e2cb9d065 100644 --- a/src/FeaturesPlugin/tests.set +++ b/src/FeaturesPlugin/tests.set @@ -177,7 +177,7 @@ SET(TEST_NAMES TestMeasurementAngle3Points.py TestMeasurementPresentation.py TestFusionFaces.py - TestFusionFaces2697.py + TestFusionFaces2697.py Test1379.py Test1922.py Test1942.py @@ -522,4 +522,5 @@ SET(TEST_NAMES TestBoundingBox.py Test23885.py TestNormalToFace.py + TestCheckDuplicatedFaces.py ) diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index 2fa736470..d751ac094 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -33,6 +33,7 @@ SET(PROJECT_HEADERS GeomAlgoAPI_Prism.h GeomAlgoAPI_Revolution.h GeomAlgoAPI_Boolean.h + GeomAlgoAPI_DuplicatedFaces.h GeomAlgoAPI_ThroughAll.h GeomAlgoAPI_Rotation.h GeomAlgoAPI_Translation.h @@ -82,6 +83,21 @@ SET(PROJECT_HEADERS GeomAlgoAPI_Fillet1D.h GeomAlgoAPI_SortListOfShapes.h GeomAlgoAPI_Filling.h + GeomAlgoAPI_GlueDetector.h + GeomAlgoAPI_GluerAlgo.h + GeomAlgoAPI_Algo.h + GEOMAlgo_BndSphereTree.hxx + GEOMAlgo_BndSphere.hxx + GEOMAlgo_BndSphere.lxx + GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx + GEOMAlgo_IndexedDataMapOfIntegerShape.hxx + GEOMAlgo_PassKeyShape.hxx + GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx + GEOMAlgo_PassKeyShapeMapHasher.hxx + GEOMAlgo_CoupleOfShapes.hxx + GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx + GEOMAlgo_ListOfCoupleOfShapes.hxx + GEOMAlgo_AlgoTools.hxx GeomAlgoAPI_CurveBuilder.h GeomAlgoAPI_NExplode.h GeomAlgoAPI_Offset.h @@ -104,6 +120,7 @@ SET(PROJECT_SOURCES GeomAlgoAPI_Prism.cpp GeomAlgoAPI_Revolution.cpp GeomAlgoAPI_Boolean.cpp + GeomAlgoAPI_DuplicatedFaces.cpp GeomAlgoAPI_ThroughAll.cpp GeomAlgoAPI_Rotation.cpp GeomAlgoAPI_Translation.cpp @@ -153,6 +170,15 @@ SET(PROJECT_SOURCES GeomAlgoAPI_Fillet1D.cpp GeomAlgoAPI_SortListOfShapes.cpp GeomAlgoAPI_Filling.cpp + GeomAlgoAPI_GlueDetector.cpp + GeomAlgoAPI_GluerAlgo.cpp + GeomAlgoAPI_Algo.cpp + GEOMAlgo_BndSphereTree.cxx + GEOMAlgo_BndSphere.cxx + GEOMAlgo_PassKeyShapeMapHasher.cxx + GEOMAlgo_CoupleOfShapes.cxx + GEOMAlgo_PassKeyShape.cxx + GEOMAlgo_AlgoTools.cxx GeomAlgoAPI_CurveBuilder.cpp GeomAlgoAPI_NExplode.cpp GeomAlgoAPI_Offset.cpp diff --git a/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.cxx b/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.cxx new file mode 100644 index 000000000..788e8d6e4 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.cxx @@ -0,0 +1,1006 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// File : GEOMAlgo_AlgoTools.cxx +// Created : +// Author : Peter KURNEV + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include + + +static + void GetCount(const TopoDS_Shape& aS, + Standard_Integer& iCnt); +static + void CopySource(const TopoDS_Shape& aS, + TopTools_IndexedDataMapOfShapeShape& aMapSS, + TopoDS_Shape& aSC); + +//======================================================================= +//function : CopyShape +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS, + TopoDS_Shape& aSC) +{ + TopTools_IndexedDataMapOfShapeShape aMapSS; + // + CopySource(aS, aMapSS, aSC); +} +//======================================================================= +//function : CopyShape +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS, + TopoDS_Shape& aSC, + TopTools_IndexedDataMapOfShapeShape& aMapSS) +{ + CopySource(aS, aMapSS, aSC); +} +//======================================================================= +//function : CopySource +//purpose : +//======================================================================= +void CopySource(const TopoDS_Shape& aS, + TopTools_IndexedDataMapOfShapeShape& aMapSS, + TopoDS_Shape& aSC) +{ + Standard_Boolean bFree; + TopAbs_ShapeEnum aT; + TopoDS_Iterator aIt; + TopoDS_Shape aSF; + BRep_Builder BB; + // + aT=aS.ShapeType(); + // + if (aMapSS.Contains(aS)) { + aSC=aMapSS.ChangeFromKey(aS); + aSC.Orientation(aS.Orientation()); + return; + } + else { + aSC=aS.EmptyCopied(); + aMapSS.Add(aS, aSC); + } + // + bFree=aSC.Free(); + aSC.Free(Standard_True); + aSF=aS; + if (aT==TopAbs_EDGE){ + TopAbs_Orientation aOr; + // + aOr=aS.Orientation(); + if(aOr==TopAbs_INTERNAL) { + aSF.Orientation(TopAbs_FORWARD); + } + } + aIt.Initialize(aSF); + for (; aIt.More(); aIt.Next()) { + TopoDS_Shape aSCx; + // + const TopoDS_Shape& aSx=aIt.Value(); + // + CopySource (aSx, aMapSS, aSCx); + // + aSCx.Orientation(aSx.Orientation()); + BB.Add(aSC, aSCx); + } + aSC.Free(bFree); +} +//======================================================================= +//function : FaceNormal +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF, + const Standard_Real U, + const Standard_Real V, + gp_Vec& aN) +{ + gp_Pnt aPnt ; + gp_Vec aD1U, aD1V; + Handle(Geom_Surface) aSurface; + + aSurface=BRep_Tool::Surface(aF); + aSurface->D1 (U, V, aPnt, aD1U, aD1V); + aN=aD1U.Crossed(aD1V); + aN.Normalize(); + if (aF.Orientation() == TopAbs_REVERSED){ + aN.Reverse(); + } + return; +} +//======================================================================= +//function : BuildPCurveForEdgeOnFace +//purpose : +//======================================================================= +Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace + (const TopoDS_Edge& aEold, + const TopoDS_Edge& aEnew, + const TopoDS_Face& aF, + const Handle(IntTools_Context)& aCtx) +{ + Standard_Boolean bIsClosed, bUClosed, bHasOld; + Standard_Integer iRet, aNbPoints; + Standard_Real aTS, aTS1, aTS2, aT, aT1, aT2, aScPr, aTol; + Standard_Real aU, aV, aUS1, aVS1, aUS2, aVS2; + gp_Pnt aP; + gp_Pnt2d aP2DS1, aP2DS2, aP2D; + gp_Vec2d aV2DS1, aV2DS2; + Handle(Geom2d_Curve) aC2D, aC2DS1, aC2DS2; + Handle(Geom_Surface) aS; + TopoDS_Edge aES; + // + iRet=0; + // + bHasOld=BOPTools_AlgoTools2D::HasCurveOnSurface(aEnew, aF, aC2D, aT1, aT2, aTol); + if (bHasOld) { + return iRet; + } + // + // Try to copy PCurve from old edge to the new one. + iRet = BOPTools_AlgoTools2D::AttachExistingPCurve(aEold, aEnew, aF, aCtx); + + if (iRet) { + // Do PCurve using projection algorithm. + iRet = 0; + } else { + // The PCurve is attached successfully. + return iRet; + } + // + BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aEnew, aF); + aC2D=BRep_Tool::CurveOnSurface(aEnew, aF, aT1, aT2); + if (aC2D.IsNull()){ + iRet=1; + return iRet; + } + // + bIsClosed=BRep_Tool::IsClosed(aEold, aF); + if (!bIsClosed) { + return iRet; + } + // + aTol=1.e-7; + // + // 1. bUClosed - direction of closeness + // + aES=aEold; + aES.Orientation(TopAbs_FORWARD); + aC2DS1=BRep_Tool::CurveOnSurface(aES, aF, aTS1, aTS2); + // + aES.Orientation(TopAbs_REVERSED); + aC2DS2=BRep_Tool::CurveOnSurface(aES, aF, aTS1, aTS2); + // + aTS=IntTools_Tools::IntermediatePoint(aTS1, aTS2); + // + aC2DS1->D1(aTS, aP2DS1, aV2DS1); + aC2DS2->D1(aTS, aP2DS2, aV2DS2); + // + gp_Vec2d aV2DS12(aP2DS1, aP2DS2); + gp_Dir2d aD2DS12(aV2DS12); + const gp_Dir2d& aD2DX=gp::DX2d(); + // + aScPr=aD2DS12*aD2DX; + bUClosed=Standard_True; + if (fabs(aScPr) < aTol) { + bUClosed=!bUClosed; + } + // + // 2. aP2D - point on curve aC2D, that corresponds to aP2DS1 + aP2DS1.Coord(aUS1, aVS1); + aP2DS2.Coord(aUS2, aVS2); + // + aS=BRep_Tool::Surface(aF); + aS->D0(aUS1, aVS1, aP); + // + GeomAPI_ProjectPointOnCurve& aProjPC=aCtx->ProjPC(aEnew); + // + aProjPC.Perform(aP); + aNbPoints=aProjPC.NbPoints(); + if (!aNbPoints) { + iRet=2; + return iRet; + } + // + aT=aProjPC.LowerDistanceParameter(); + + // + // 3. Build the second 2D curve + Standard_Boolean bRevOrder; + gp_Vec2d aV2DT, aV2D; + Handle(Geom2d_Curve) aC2Dnew; + Handle(Geom2d_TrimmedCurve) aC2DTnew; + BRep_Builder aBB; + // + aC2D->D1(aT, aP2D, aV2D); + aP2D.Coord(aU, aV); + // + aC2Dnew=Handle(Geom2d_Curve)::DownCast(aC2D->Copy()); + aC2DTnew = new Geom2d_TrimmedCurve(aC2Dnew, aT1, aT2); + // + aV2DT=aV2DS12; + if (!bUClosed) { // V Closed + if (fabs(aV-aVS2)Translate(aV2DT); + // + // 4 Order the 2D curves + bRevOrder=Standard_False; + aScPr=aV2D*aV2DS1; + if(aScPr<0.) { + bRevOrder=!bRevOrder; + } + // + // 5. Update the edge + aTol=BRep_Tool::Tolerance(aEnew); + if (!bRevOrder) { + aBB.UpdateEdge(aEnew, aC2D, aC2DTnew, aF, aTol); + } + else { + aBB.UpdateEdge(aEnew, aC2DTnew, aC2D , aF, aTol); + } + // + return iRet; +} +////////////////////////////////////////////////////////////////////////// +//======================================================================= +// function: MakeContainer +// purpose: +//======================================================================= +void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType, + TopoDS_Shape& theC) +{ + BRep_Builder aBB; + // + switch(theType) { + case TopAbs_COMPOUND:{ + TopoDS_Compound aC; + aBB.MakeCompound(aC); + theC=aC; + } + break; + // + case TopAbs_COMPSOLID:{ + TopoDS_CompSolid aCS; + aBB.MakeCompSolid(aCS); + theC=aCS; + } + break; + // + case TopAbs_SOLID:{ + TopoDS_Solid aSolid; + aBB.MakeSolid(aSolid); + theC=aSolid; + } + break; + // + // + case TopAbs_SHELL:{ + TopoDS_Shell aShell; + aBB.MakeShell(aShell); + theC=aShell; + } + break; + // + case TopAbs_WIRE: { + TopoDS_Wire aWire; + aBB.MakeWire(aWire); + theC=aWire; + } + break; + // + default: + break; + } +} +//======================================================================= +//function : IsUPeriodic +//purpose : +//======================================================================= +Standard_Boolean GEOMAlgo_AlgoTools::IsUPeriodic(const Handle(Geom_Surface) &aS) +{ + Standard_Boolean bRet; + GeomAbs_SurfaceType aType; + GeomAdaptor_Surface aGAS; + // + aGAS.Load(aS); + aType=aGAS.GetType(); + bRet=(aType==GeomAbs_Cylinder|| + aType==GeomAbs_Cone || + aType==GeomAbs_Sphere); + // + return bRet; +} + +//======================================================================= +//function : RefinePCurveForEdgeOnFace +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE, + const TopoDS_Face& aF, + const Standard_Real aUMin, + const Standard_Real aUMax) +{ + Standard_Real aT1, aT2, aTx, aUx, aTol; + gp_Pnt2d aP2D; + Handle(Geom_Surface) aS; + Handle(Geom2d_Curve) aC2D; + BRep_Builder aBB; + // + aC2D=BRep_Tool::CurveOnSurface(aE, aF, aT1, aT2); + if (!aC2D.IsNull()) { + if (BRep_Tool::IsClosed(aE, aF)) { + return; + } + aTx=IntTools_Tools::IntermediatePoint(aT1, aT2); + aC2D->D0(aTx, aP2D); + aUx=aP2D.X(); + if (aUx < aUMin || aUx > aUMax) { + // need to rebuild + Handle(Geom2d_Curve) aC2Dx; + // + aTol=BRep_Tool::Tolerance(aE); + aBB.UpdateEdge(aE, aC2Dx, aF, aTol); + } + } +} +//======================================================================= +//function :IsSplitToReverse +//purpose : +//======================================================================= +Standard_Boolean GEOMAlgo_AlgoTools::IsSplitToReverse + (const TopoDS_Edge& aEF1, + const TopoDS_Edge& aEF2, + const Handle(IntTools_Context)& aContext) +{ + Standard_Boolean aFlag; + Standard_Real aT1, aT2, aScPr, a, b; + gp_Vec aV1, aV2; + gp_Pnt aP; + + + Handle(Geom_Curve)aC1=BRep_Tool::Curve(aEF1, a, b); + aT1=IntTools_Tools::IntermediatePoint(a, b); + aC1->D0(aT1, aP); + aFlag=BOPTools_AlgoTools2D::EdgeTangent(aEF1, aT1, aV1); + + if(!aFlag) { + return Standard_False; + } + + gp_Dir aDT1(aV1); + // + aFlag=aContext->ProjectPointOnEdge(aP, aEF2, aT2); + if(!aFlag) { + return Standard_False; + } + // + aFlag=BOPTools_AlgoTools2D::EdgeTangent(aEF2, aT2, aV2); + if(!aFlag) { + return Standard_False; + } + + gp_Dir aDT2(aV2); + + aScPr=aDT1*aDT2; + + return (aScPr<0.); +} + + +//======================================================================= +//function : ProjectPointOnShape +//purpose : +//======================================================================= +Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape + (const gp_Pnt& aP1, + const TopoDS_Shape& aS, + gp_Pnt& aP2, + const Handle(IntTools_Context)& aCtx) +{ + Standard_Boolean bIsDone = Standard_False; + Standard_Real aT2; + TopAbs_ShapeEnum aType; + // + aType = aS.ShapeType(); + switch (aType) + { + case TopAbs_EDGE: + { + const TopoDS_Edge& aE2 = TopoDS::Edge(aS); + // + if (BRep_Tool::Degenerated(aE2)) { // jfa + return Standard_True; + } + else { + Standard_Real f, l; + Handle(Geom_Curve) aC3D = BRep_Tool::Curve (aE2, f, l); + if (aC3D.IsNull()) { + return Standard_True; + } + bIsDone = aCtx->ProjectPointOnEdge(aP1, aE2, aT2); + } + if (!bIsDone) { + return bIsDone; + } + // + GEOMAlgo_AlgoTools::PointOnEdge(aE2, aT2, aP2); + } + break; + // + case TopAbs_FACE: + { + const TopoDS_Face& aF2 = TopoDS::Face(aS); + GeomAPI_ProjectPointOnSurf& aProj = aCtx->ProjPS(aF2); + // + aProj.Perform(aP1); + bIsDone = aProj.IsDone(); + if (!bIsDone) { + return bIsDone; + } + // + aP2 = aProj.NearestPoint(); + } + break; + // + default: + break; // Err + } + return bIsDone; +} + +//======================================================================= +//function : PointOnEdge +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, + gp_Pnt& aP3D) +{ + Standard_Real aTx, aT1, aT2; + // + BRep_Tool::Curve(aE, aT1, aT2); + aTx=IntTools_Tools::IntermediatePoint(aT1, aT2); + GEOMAlgo_AlgoTools::PointOnEdge(aE, aTx, aP3D); +} +//======================================================================= +//function : PointOnEdge +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE, + const Standard_Real aT, + gp_Pnt& aP3D) +{ + Standard_Real aT1, aT2; + Handle(Geom_Curve) aC3D; + // + aC3D=BRep_Tool::Curve(aE, aT1, aT2); + aC3D->D0(aT, aP3D); +} +//======================================================================= +//function : PointOnFace +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF, + const Standard_Real aU, + const Standard_Real aV, + gp_Pnt& aP3D) +{ + Handle(Geom_Surface) aS; + // + aS=BRep_Tool::Surface(aF); + aS->D0(aU, aV, aP3D); +} +//======================================================================= +//function : PointOnFace +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF, + gp_Pnt& aP3D) +{ + Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax; + // + BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax); + // + aU=IntTools_Tools::IntermediatePoint(aUMin, aUMax); + aV=IntTools_Tools::IntermediatePoint(aVMin, aVMax); + // + GEOMAlgo_AlgoTools::PointOnFace(aF, aU, aV, aP3D); +} +//======================================================================= +//function : PointOnShape +//purpose : +//======================================================================= +void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS, + gp_Pnt& aP3D) +{ + TopAbs_ShapeEnum aType; + // + aP3D.SetCoord(99.,99.,99.); + aType=aS.ShapeType(); + switch(aType) { + case TopAbs_EDGE: { + const TopoDS_Edge& aE=TopoDS::Edge(aS); + GEOMAlgo_AlgoTools::PointOnEdge(aE, aP3D); + } + break; + // + case TopAbs_FACE: { + const TopoDS_Face& aF=TopoDS::Face(aS); + GEOMAlgo_AlgoTools::PointOnFace(aF, aP3D); + } + break; + // + default: + break; // Err + } +} +//======================================================================= +//function : FindSDShapes +//purpose : +//======================================================================= +Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes + (const TopoDS_Shape& aE1, + const TopTools_ListOfShape& aLE, + const Standard_Real aTol, + TopTools_ListOfShape& aLESD, + const Handle(IntTools_Context)& aCtx) +{ + Standard_Boolean bIsDone; + Standard_Real aTol2, aD2; + gp_Pnt aP1, aP2; + TopTools_ListIteratorOfListOfShape aIt; + // + aTol2=aTol*aTol; + GEOMAlgo_AlgoTools::PointOnShape(aE1, aP1); + // + aIt.Initialize(aLE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE2=aIt.Value(); + if (aE2.IsSame(aE1)) { + aLESD.Append(aE2); + } + else { + bIsDone=GEOMAlgo_AlgoTools::ProjectPointOnShape(aP1, aE2, aP2, aCtx); + if (!bIsDone) { + //return 1; + continue; // jfa BUG 20361 + } + aD2=aP1.SquareDistance(aP2); + if(aD21); + // + return bRet; +} +//======================================================================= +//function : GetCount +//purpose : +//======================================================================= +void GetCount(const TopoDS_Shape& aS, + Standard_Integer& iCnt) +{ + TopoDS_Iterator aIt; + TopAbs_ShapeEnum aTS; + // + aTS=aS.ShapeType(); + // + if (aTS==TopAbs_SHAPE) { + return; + } + if (aTS!=TopAbs_COMPOUND) { + ++iCnt; + return; + } + // + aIt.Initialize(aS); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aSx=aIt.Value(); + GetCount(aSx, iCnt); + } +} +//======================================================================= +//function : PntInFace +//purpose : +//======================================================================= +Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF, + gp_Pnt& theP, + gp_Pnt2d& theP2D) +{ + Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint; + Standard_Integer iErr, aIx, aNbDomains, i; + Standard_Real aUMin, aUMax, aVMin, aVMax; + Standard_Real aVx, aUx, aV1, aV2, aU1, aU2, aEpsT; + Standard_Real aTotArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D; + gp_Dir2d aD2D (0., 1.); + gp_Pnt2d aP2D; + gp_Pnt aPx; + Handle(Geom2d_Curve) aC2D; + Handle(Geom2d_TrimmedCurve) aCT2D; + Handle(Geom2d_Line) aL2D; + Handle(Geom_Surface) aS; + TopAbs_Orientation aOrE; + TopoDS_Face aFF; + TopExp_Explorer aExp; + // + aTolHatch2D=1.e-8; + aTolHatch3D=1.e-8; + aTotArcIntr=1.e-10; + aTolTangfIntr=1.e-10; + // + Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr); + Geom2dHatch_Hatcher aHatcher(aIntr, + aTolHatch2D, aTolHatch3D, + Standard_True, Standard_False); + // + iErr=0; + aEpsT=1.e-12; + // + aFF=aF; + aFF.Orientation (TopAbs_FORWARD); + // + aS=BRep_Tool::Surface(aFF); + BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax); + // + // 1 + aExp.Init (aFF, TopAbs_EDGE); + for (; aExp.More() ; aExp.Next()) { + const TopoDS_Edge& aE=*((TopoDS_Edge*)&aExp.Current()); + aOrE=aE.Orientation(); + // + aC2D=BRep_Tool::CurveOnSurface (aE, aFF, aU1, aU2); + if (aC2D.IsNull() ) { + iErr=1; + return iErr; + } + if (fabs(aU1-aU2) < aEpsT) { + iErr=2; + return iErr; + } + // + aCT2D=new Geom2d_TrimmedCurve(aC2D, aU1, aU2); + aHatcher.AddElement(aCT2D, aOrE); + }// for (; aExp.More() ; aExp.Next()) { + // + // 2 + aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax); + aP2D.SetCoord(aUx, 0.); + aL2D=new Geom2d_Line (aP2D, aD2D); + Geom2dAdaptor_Curve aHCur(aL2D); + // + aIx=aHatcher.AddHatching(aHCur) ; + // + // 3. + aHatcher.Trim(); + bIsDone=aHatcher.TrimDone(aIx); + if (!bIsDone) { + iErr=3; + return iErr; + } + // + aHatcher.ComputeDomains(aIx); + bIsDone=aHatcher.IsDone(aIx); + if (!bIsDone) { + iErr=4; + return iErr; + } + // + // 4. + aVx=aVMin; + aNbDomains=aHatcher.NbDomains(aIx); + if (!aNbDomains) { + iErr=5; + return iErr; + } + // + i=1; + const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ; + bHasFirstPoint=aDomain.HasFirstPoint(); + if (!bHasFirstPoint) { + iErr=5; + return iErr; + } + // + aV1=aDomain.FirstPoint().Parameter(); + // + bHasSecondPoint=aDomain.HasSecondPoint(); + if (!bHasSecondPoint) { + iErr=6; + return iErr; + } + // + aV2=aDomain.SecondPoint().Parameter(); + // + aVx=IntTools_Tools::IntermediatePoint(aV1, aV2); + // + aS->D0(aUx, aVx, aPx); + // + theP2D.SetCoord(aUx, aVx); + theP=aPx; + // + return iErr; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.hxx b/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.hxx new file mode 100644 index 000000000..2470d1c41 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_AlgoTools.hxx @@ -0,0 +1,198 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// File : GEOMAlgo_AlgoTools.hxx +// Created : +// Author : Peter KURNEV + +#ifndef _GEOMAlgo_AlgoTools_HeaderFile +#define _GEOMAlgo_AlgoTools_HeaderFile + +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +//! Auxiliary tools for Algorithms
+//======================================================================= +//class : GEOMAlgo_AlgoTools +//purpose : +//======================================================================= +class GEOMAlgo_AlgoTools { + public: + + Standard_EXPORT + static void FaceNormal (const TopoDS_Face& aF, + const Standard_Real U, + const Standard_Real V, + gp_Vec& aN); + + //! Computes a point inside the face .
+ //! - 2D representation of
+ //! on the surface of
+ //! Returns 0 in case of success.
+ Standard_EXPORT + static Standard_Integer PntInFace(const TopoDS_Face& theF, + gp_Pnt& theP, + gp_Pnt2d& theP2D) ; + + Standard_EXPORT + static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS) ; + + + Standard_EXPORT + static Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS) ; + + Standard_EXPORT + static Standard_Integer RefineSDShapes + (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD, + const Standard_Real aTol, + const Handle(IntTools_Context)& aCtx) ; + + Standard_EXPORT + static Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE, + const Standard_Real aTol, + TopTools_IndexedDataMapOfShapeListOfShape& aMEE, + const Handle(IntTools_Context)& aCtx) ; + Standard_EXPORT + static Standard_Integer FindSDShapes(const TopoDS_Shape& aE1, + const TopTools_ListOfShape& aLE, + const Standard_Real aTol, + TopTools_ListOfShape& aLESD, + const Handle(IntTools_Context)& aCtx) ; + + Standard_EXPORT + static void PointOnShape(const TopoDS_Shape& aS, + gp_Pnt& aP3D) ; + + Standard_EXPORT + static void PointOnEdge(const TopoDS_Edge& aE, + gp_Pnt& aP3D) ; + + Standard_EXPORT + static void PointOnEdge(const TopoDS_Edge& aE, + const Standard_Real aT,gp_Pnt& aP3D) ; + + Standard_EXPORT + static void PointOnFace(const TopoDS_Face& aF, + gp_Pnt& aP3D) ; + + Standard_EXPORT + static void PointOnFace(const TopoDS_Face& aF, + const Standard_Real aU, + const Standard_Real aV, + gp_Pnt& aP3D) ; + Standard_EXPORT + static Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1, + const TopoDS_Shape& aS, + gp_Pnt& aP2, + const Handle(IntTools_Context)& aCtx) ; + + Standard_EXPORT + static void CorrectTolerances(const TopoDS_Shape& aShape, + const Standard_Real aMaxTol=0.0001); + + Standard_EXPORT + static void CorrectPointOnCurve(const TopoDS_Shape& S, + const Standard_Real aMaxTol=0.0001); + + Standard_EXPORT + static void CorrectCurveOnSurface(const TopoDS_Shape& S, + const Standard_Real aMaxTol=0.0001); + + + Standard_EXPORT + static Standard_Boolean IsSplitToReverse1 (const TopoDS_Edge& aEF1, + const TopoDS_Edge& aEF2, + const Handle(IntTools_Context)& aCtx) ; + Standard_EXPORT + static void RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE, + const TopoDS_Face& aF, + const Standard_Real aUMin, + const Standard_Real aUMax); + + Standard_EXPORT + static Standard_Boolean IsUPeriodic(const Handle(Geom_Surface) &aS); + + Standard_EXPORT + static void MakeContainer(const TopAbs_ShapeEnum theType, + TopoDS_Shape& theC); + + Standard_EXPORT + static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theSplit, + const TopoDS_Edge& theEdge, + const Handle(IntTools_Context)& theCtx) ; + + Standard_EXPORT + static Standard_Boolean IsSplitToReverse (const TopoDS_Face& theFSp, + const TopoDS_Face& theFSr, + const Handle(IntTools_Context)& theCtx) ; + + Standard_EXPORT + static Standard_Boolean IsSplitToReverse (const TopoDS_Shape& theSp, + const TopoDS_Shape& theSr, + const Handle(IntTools_Context)& theCtx) ; + Standard_EXPORT + static Standard_Integer BuildPCurveForEdgeOnFace (const TopoDS_Edge& aEold, + const TopoDS_Edge& aEnew, + const TopoDS_Face& aF, + const Handle(IntTools_Context)& aCtx) ; + +// + Standard_EXPORT + static void FindChains(const GEOMAlgo_ListOfCoupleOfShapes& aLCS, + GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains); + + Standard_EXPORT + static void FindChains(const GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape& aMCV, + GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape& aMapChains); + + Standard_EXPORT + static void CopyShape(const TopoDS_Shape& aS, + TopoDS_Shape& aSC) ; + + Standard_EXPORT + static void CopyShape(const TopoDS_Shape& aS, + TopoDS_Shape& aSC, + TopTools_IndexedDataMapOfShapeShape& aMSS) ; +}; +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_BndSphere.cxx b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.cxx new file mode 100644 index 000000000..e13b84bf9 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.cxx @@ -0,0 +1,57 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_BndSphere.cxx +// Created: +// Author: Peter KURNEV +// +// +#include + +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_BndSphere::GEOMAlgo_BndSphere() +{ + myCenter.SetCoord(0., 0., 0.); + myRadius=0.; + myGap=0.; +} +//======================================================================= +//function : ~ +//purpose : +//======================================================================= + GEOMAlgo_BndSphere::~GEOMAlgo_BndSphere() +{ +} +//======================================================================= +//function : IsOut +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_BndSphere::IsOut(const GEOMAlgo_BndSphere& theOther)const +{ + Standard_Real aD2, aT2; + // + aD2=myCenter.SquareDistance(theOther.myCenter); + aT2=myRadius+myGap+theOther.myRadius+theOther.myGap; + aT2=aT2*aT2; + // + return aD2>aT2; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_BndSphere.hxx b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.hxx new file mode 100644 index 000000000..3ab7e3784 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.hxx @@ -0,0 +1,73 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_BndSphere.hxx +// Created: +// Author: Peter KURNEV +// + +#ifndef _GEOMAlgo_BndSphere_HeaderFile +#define _GEOMAlgo_BndSphere_HeaderFile + +#include +#include +#include +#include +#include + +//======================================================================= +//class : GEOMAlgo_BndSphere +//purpose : +//======================================================================= +class GEOMAlgo_BndSphere { + public: + Standard_EXPORT + GEOMAlgo_BndSphere(); + + Standard_EXPORT + virtual ~GEOMAlgo_BndSphere(); + + void SetCenter(const gp_Pnt& theP) ; + + const gp_Pnt& Center() const; + + void SetRadius(const Standard_Real theR) ; + + Standard_Real Radius() const; + + void SetGap(const Standard_Real theGap) ; + + Standard_Real Gap() const; + + void Add(const GEOMAlgo_BndSphere& theOther) ; + + Standard_EXPORT + Standard_Boolean IsOut(const GEOMAlgo_BndSphere& theOther) const; + + Standard_Real SquareExtent() const; + + protected: + gp_Pnt myCenter; + Standard_Real myRadius; + Standard_Real myGap; +}; + +#include + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_BndSphere.lxx b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.lxx new file mode 100644 index 000000000..bc9b62ee7 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_BndSphere.lxx @@ -0,0 +1,108 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_BndSphere.lxx +// Created: +// Author: Peter KURNEV +// +//======================================================================= +//function : SetCenter +//purpose : +//======================================================================= + inline void GEOMAlgo_BndSphere::SetCenter(const gp_Pnt& theP) +// +{ + myCenter=theP; +} +//======================================================================= +//function : Center +//purpose : +//======================================================================= + inline const gp_Pnt& GEOMAlgo_BndSphere::Center()const +{ + return myCenter; +} +//======================================================================= +//function : SetRadius +//purpose : +//======================================================================= + inline void GEOMAlgo_BndSphere::SetRadius(const Standard_Real theR) +{ + myRadius=theR; +} +//======================================================================= +//function : Radius +//purpose : +//======================================================================= + inline Standard_Real GEOMAlgo_BndSphere::Radius()const +{ + return myRadius; +} +//======================================================================= +//function : SetGap +//purpose : +//======================================================================= + inline void GEOMAlgo_BndSphere::SetGap(const Standard_Real theGap) +{ + myGap=theGap; +} +//======================================================================= +//function : Gap +//purpose : +//======================================================================= + inline Standard_Real GEOMAlgo_BndSphere::Gap()const +{ + return myGap; +} +//======================================================================= +//function : Add +//purpose : +//======================================================================= + inline void GEOMAlgo_BndSphere::Add(const GEOMAlgo_BndSphere& theOther) +{ + Standard_Real aTmax, aR, aT, aTOther; + gp_Pnt aPc; + // + aPc.SetXYZ(0.5*(myCenter.XYZ()+theOther.myCenter.XYZ())); + // + aR=aPc.Distance(myCenter); + // + aT=myRadius+myGap; + aTOther=theOther.myRadius+theOther.myGap; + aTmax=(aT>aTOther) ? aT: aTOther; + // + aR=aR+aTmax; + // + myCenter=aPc; + myRadius=aR; +} +//======================================================================= +//function : SquareExtent +//purpose : +//======================================================================= + inline Standard_Real GEOMAlgo_BndSphere::SquareExtent()const +{ + Standard_Real aD; + // + aD=myRadius+myGap; + aD=aD+aD; + aD=aD*aD; + // + return aD; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.cxx b/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.cxx new file mode 100644 index 000000000..fa9c1fdbe --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.cxx @@ -0,0 +1,89 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_BndSphereTree.cxx +// Created: +// Author: Peter KURNEV +// +// +#include +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_BndSphereTreeSelector::GEOMAlgo_BndSphereTreeSelector() +{ +} +//======================================================================= +//function : ~ +//purpose : +//======================================================================= + GEOMAlgo_BndSphereTreeSelector::~GEOMAlgo_BndSphereTreeSelector() +{ +} +//======================================================================= +//function : Reject +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_BndSphereTreeSelector::Reject (const GEOMAlgo_BndSphere& aBox) const +{ + Standard_Boolean bRet; + // + bRet=myBox.IsOut(aBox); + return bRet; +} +//======================================================================= +//function : Accept +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_BndSphereTreeSelector::Accept (const Standard_Integer& aIndex) +{ + Standard_Boolean bRet=Standard_False; + // + if (myFence.Add(aIndex)) { + myIndices.Append(aIndex); + bRet=!bRet; + } + return bRet; +} +//======================================================================= +//function : SetBox +//purpose : +//======================================================================= + void GEOMAlgo_BndSphereTreeSelector::SetBox(const GEOMAlgo_BndSphere& aBox) +{ + myBox=aBox; +} +//======================================================================= +//function : Clear +//purpose : +//======================================================================= + void GEOMAlgo_BndSphereTreeSelector::Clear() +{ + myFence.Clear(); + myIndices.Clear(); +} +//======================================================================= +//function : Indices +//purpose : +//======================================================================= + const TColStd_ListOfInteger& GEOMAlgo_BndSphereTreeSelector::Indices() const +{ + return myIndices; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.hxx b/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.hxx new file mode 100644 index 000000000..9a7a45723 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_BndSphereTree.hxx @@ -0,0 +1,53 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_BndSphereTree.hxx +// Created: +// Author: Peter KURNEV +// +// +#ifndef GEOMAlgo_BndSphereTree_HeaderFile +#define GEOMAlgo_BndSphereTree_HeaderFile + +#include +#include +#include +#include + +typedef NCollection_UBTree GEOMAlgo_BndSphereTree; + + class GEOMAlgo_BndSphereTreeSelector : public GEOMAlgo_BndSphereTree::Selector { + public: + Standard_EXPORT GEOMAlgo_BndSphereTreeSelector(); + Standard_EXPORT virtual Standard_Boolean Reject(const GEOMAlgo_BndSphere&) const; + Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &); + Standard_EXPORT virtual ~GEOMAlgo_BndSphereTreeSelector(); + + Standard_EXPORT void Clear(); + Standard_EXPORT void SetBox(const GEOMAlgo_BndSphere&); + Standard_EXPORT const TColStd_ListOfInteger& Indices() const; + + protected: + GEOMAlgo_BndSphere myBox; + TColStd_MapOfInteger myFence; + TColStd_ListOfInteger myIndices; + + }; + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.cxx b/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.cxx new file mode 100644 index 000000000..00db0ccf5 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.cxx @@ -0,0 +1,85 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// +// File: GEOMAlgo_CoupleOfShapes.cxx +// Created: Wed Dec 15 13:03:52 2004 +// Author: Peter KURNEV +// +// +#include +//======================================================================= +//function : GEOMAlgo_CoupleOfShapes +//purpose : +//======================================================================= +GEOMAlgo_CoupleOfShapes::GEOMAlgo_CoupleOfShapes() +{} +//======================================================================= +//function : SetShapes +//purpose : +//======================================================================= +void GEOMAlgo_CoupleOfShapes::SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2) +{ + myShape1=aS1; + myShape2=aS2; +} +//======================================================================= +//function : Shapes +//purpose : +//======================================================================= +void GEOMAlgo_CoupleOfShapes::Shapes(TopoDS_Shape& aS1, + TopoDS_Shape& aS2)const +{ + aS1=myShape1; + aS2=myShape2; +} +//======================================================================= +//function : SetShape1 +//purpose : +//======================================================================= +void GEOMAlgo_CoupleOfShapes::SetShape1(const TopoDS_Shape& aS1) +{ + myShape1=aS1; +} +//======================================================================= +//function : SetShape2 +//purpose : +//======================================================================= +void GEOMAlgo_CoupleOfShapes::SetShape2(const TopoDS_Shape& aS2) +{ + myShape2=aS2; +} +//======================================================================= +//function : Shape1 +//purpose : +//======================================================================= +const TopoDS_Shape& GEOMAlgo_CoupleOfShapes::Shape1()const +{ + return myShape1; +} +//======================================================================= +//function : Shape2 +//purpose : +//======================================================================= +const TopoDS_Shape& GEOMAlgo_CoupleOfShapes::Shape2()const +{ + return myShape2; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.hxx b/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.hxx new file mode 100644 index 000000000..e7736becc --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_CoupleOfShapes.hxx @@ -0,0 +1,64 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// +// File: GEOMAlgo_CoupleOfShapes.hxx +// Created: Wed Dec 15 13:03:52 2004 +// Author: Peter KURNEV +// +// + +#ifndef _GEOMAlgo_CoupleOfShapes_HeaderFile +#define _GEOMAlgo_CoupleOfShapes_HeaderFile + +#include +#include +#include + +//======================================================================= +//class : GEOMAlgo_CoupleOfShapes +//purpose : +//======================================================================= +class GEOMAlgo_CoupleOfShapes +{ + public: + Standard_EXPORT + GEOMAlgo_CoupleOfShapes(); + + Standard_EXPORT + void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ; + + Standard_EXPORT + void SetShape1(const TopoDS_Shape& aS1) ; + + Standard_EXPORT + void SetShape2(const TopoDS_Shape& aS2) ; + + Standard_EXPORT + void Shapes(TopoDS_Shape& aS1,TopoDS_Shape& aS2) const; + + Standard_EXPORT + const TopoDS_Shape& Shape1() const; + + Standard_EXPORT + const TopoDS_Shape& Shape2() const; + +protected: + TopoDS_Shape myShape1; + TopoDS_Shape myShape2; +}; +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx new file mode 100644 index 000000000..47797b496 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx @@ -0,0 +1,45 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// +// File: GEOMAlgo_IndexedDataMapOfIntegerShape.hxx +// Created: Wed Feb 22 11:22:18 2012 +// Author: +// + + +#ifndef GEOMAlgo_IndexedDataMapOfIntegerShape_HeaderFile +#define GEOMAlgo_IndexedDataMapOfIntegerShape_HeaderFile + + + +#include +#include +#include + +#define _NCollection_MapHasher +#include + + +typedef NCollection_IndexedDataMap + GEOMAlgo_IndexedDataMapOfIntegerShape; + +#undef _NCollection_MapHasher + + + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx new file mode 100644 index 000000000..8ee4b3a80 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx @@ -0,0 +1,46 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// +// File: GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx +// Created: Wed Feb 22 11:24:27 2012 +// Author: +// + + +#ifndef GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile +#define GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_HeaderFile + +#include +#include +#include + + +#define _NCollection_MapHasher +#include + + +typedef NCollection_IndexedDataMap + GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape; + +#undef _NCollection_MapHasher + + + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx new file mode 100644 index 000000000..15d4f02eb --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx @@ -0,0 +1,46 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx +// Created: Mon Feb 20 09:17:01 2012 +// Author: +// + + +#ifndef GEOMAlgo_IndexedDataMapOfShapeBndSphere_HeaderFile +#define GEOMAlgo_IndexedDataMapOfShapeBndSphere_HeaderFile + +#include +#include +#include + +#define _NCollection_MapHasher +#include + + + +typedef NCollection_IndexedDataMap + GEOMAlgo_IndexedDataMapOfShapeBndSphere; + +#undef _NCollection_MapHasher + + + + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx new file mode 100644 index 000000000..fe13edeab --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx @@ -0,0 +1,50 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// +// File: GEOMAlgo_IndexedDataMapOfIndexedMapOfInteger.hxx +// Created: Mon Feb 20 09:20:07 2012 +// Author: +// +// File: GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx +// Created: Mon Feb 20 11:59:23 2012 +// Author: +// + + +#ifndef GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape_HeaderFile +#define GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape_HeaderFile + + +#include +#include +#include + +#define _NCollection_MapHasher +#include + + +typedef NCollection_IndexedDataMap + GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape; + +#undef _NCollection_MapHasher + + +#endif + diff --git a/src/GeomAlgoAPI/GEOMAlgo_ListOfCoupleOfShapes.hxx b/src/GeomAlgoAPI/GEOMAlgo_ListOfCoupleOfShapes.hxx new file mode 100644 index 000000000..ba97333f5 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_ListOfCoupleOfShapes.hxx @@ -0,0 +1,34 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// 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 +// + +// File: GEOMAlgo_ListOfCoupleOfShapes.hxx +// Created: Wed Feb 22 08:23:27 2012 +// Author: +// + +#ifndef GEOMAlgo_ListOfCoupleOfShapes_HeaderFile +#define GEOMAlgo_ListOfCoupleOfShapes_HeaderFile + +#include +#include + +typedef NCollection_List GEOMAlgo_ListOfCoupleOfShapes; +typedef GEOMAlgo_ListOfCoupleOfShapes::Iterator GEOMAlgo_ListIteratorOfListOfCoupleOfShapes; + +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKey.cxx b/src/GeomAlgoAPI/GEOMAlgo_PassKey.cxx new file mode 100644 index 000000000..4351e1bf5 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKey.cxx @@ -0,0 +1,240 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKey.cxx +// Created: +// Author: Peter KURNEV +// +// +#include + +#include +#include +#include +#include + +#ifdef WIN32 +#pragma warning( disable : 4101) +#endif + +static + Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv); + +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_PassKey::GEOMAlgo_PassKey() +{ + Clear(); +} +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_PassKey::GEOMAlgo_PassKey(const GEOMAlgo_PassKey& aOther) +{ + myNbIds=aOther.myNbIds; + mySum=aOther.mySum; + myMap=aOther.myMap; +} +//======================================================================= +//function :Assign +//purpose : +//======================================================================= + GEOMAlgo_PassKey& GEOMAlgo_PassKey::Assign(const GEOMAlgo_PassKey& aOther) +{ + myNbIds=aOther.myNbIds; + mySum=aOther.mySum; + myMap=aOther.myMap; + return *this; +} +//======================================================================= +//function :~ +//purpose : +//======================================================================= + GEOMAlgo_PassKey::~GEOMAlgo_PassKey() +{ +} +//======================================================================= +//function :Clear +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::Clear() +{ + myNbIds=0; + mySum=0; + myMap.Clear(); +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1) + +{ + Clear(); + myNbIds=1; + myMap.Add(aId1); + mySum=NormalizedId(aId1, myNbIds); +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1, + const Standard_Integer aId2) +{ + TColStd_ListOfInteger aLI; + // + aLI.Append(aId1); + aLI.Append(aId2); + SetIds(aLI); +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1, + const Standard_Integer aId2, + const Standard_Integer aId3) +{ + TColStd_ListOfInteger aLI; + // + aLI.Append(aId1); + aLI.Append(aId2); + aLI.Append(aId3); + SetIds(aLI); +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::SetIds(const Standard_Integer aId1, + const Standard_Integer aId2, + const Standard_Integer aId3, + const Standard_Integer aId4) +{ + TColStd_ListOfInteger aLI; + // + aLI.Append(aId1); + aLI.Append(aId2); + aLI.Append(aId3); + aLI.Append(aId4); + SetIds(aLI); +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::SetIds(const TColStd_ListOfInteger& aLI) +{ + Standard_Integer i, aId, aIdN; + TColStd_ListIteratorOfListOfInteger aIt; + // + Clear(); + aIt.Initialize(aLI); + for (; aIt.More(); aIt.Next()) { + aId=aIt.Value(); + myMap.Add(aId); + } + myNbIds=myMap.Extent(); + for(i=1; i<=myNbIds; ++i) { + aId=myMap(i); + aIdN=NormalizedId(aId, myNbIds); + mySum+=aIdN; + } +} +//======================================================================= +//function :NbIds +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKey::NbIds()const +{ + return myNbIds; +} +//======================================================================= +//function :Id +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKey::Id(const Standard_Integer aIndex) const +{ + if (aIndex<1 || aIndex>myNbIds) { + return -1; + } + return myMap(aIndex); +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_PassKey::IsEqual(const GEOMAlgo_PassKey& aOther) const +{ + Standard_Boolean bRet; + Standard_Integer i, aId; + // + bRet=Standard_False; + // + if (myNbIds!=aOther.myNbIds) { + return bRet; + } + for (i=1; i<=myNbIds; ++i) { + aId=myMap(i); + if (!aOther.myMap.Contains(aId)) { + return bRet; + } + } + return !bRet; +} +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKey::HashCode(const Standard_Integer aUpper) const +{ + return ::HashCode(mySum, aUpper); +} +//======================================================================= +//function : Dump +//purpose : +//======================================================================= + void GEOMAlgo_PassKey::Dump(const Standard_Integer )const +{ +} +//======================================================================= +// function: NormalizedId +// purpose : +//======================================================================= +Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv) +{ + Standard_Integer aMax, aTresh, aIdRet; + // + aIdRet=aId; + aMax=::IntegerLast(); + aTresh=aMax/aDiv; + if (aId>aTresh) { + aIdRet=aId%aTresh; + } + return aIdRet; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKey.hxx b/src/GeomAlgoAPI/GEOMAlgo_PassKey.hxx new file mode 100644 index 000000000..eef809475 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKey.hxx @@ -0,0 +1,105 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKey.hxx +// Created: +// Author: Peter KURNEV +// +// +#ifndef _GEOMAlgo_PassKey_HeaderFile +#define _GEOMAlgo_PassKey_HeaderFile + +#include +#include +#include +#include + +#include +#include + +//======================================================================= +//class : GEOMAlgo_PassKey +//purpose : +//======================================================================= +class GEOMAlgo_PassKey { + public: + Standard_EXPORT + GEOMAlgo_PassKey(); + + Standard_EXPORT + virtual ~GEOMAlgo_PassKey(); + + Standard_EXPORT + GEOMAlgo_PassKey(const GEOMAlgo_PassKey& Other); + + Standard_EXPORT + GEOMAlgo_PassKey& Assign(const GEOMAlgo_PassKey& Other) ; + + GEOMAlgo_PassKey& operator =(const GEOMAlgo_PassKey& Other) { + return Assign(Other); + } + + Standard_EXPORT + void Clear() ; + + Standard_EXPORT + void SetIds(const Standard_Integer aI1) ; + + Standard_EXPORT + void SetIds(const Standard_Integer aI1, + const Standard_Integer aI2) ; + + Standard_EXPORT + void SetIds(const Standard_Integer aI1, + const Standard_Integer aI2, + const Standard_Integer aI3) ; + + Standard_EXPORT + void SetIds(const Standard_Integer aI1, + const Standard_Integer aI2, + const Standard_Integer aI3, + const Standard_Integer aI4) ; + + Standard_EXPORT + void SetIds(const TColStd_ListOfInteger& aLS) ; + + Standard_EXPORT + Standard_Integer NbIds() const; + + Standard_EXPORT + Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const; + + Standard_EXPORT + Standard_Integer HashCode(const Standard_Integer Upper) const; + + Standard_EXPORT + Standard_Integer Id(const Standard_Integer aIndex) const; + + Standard_EXPORT + void Dump(const Standard_Integer aHex = 0) const; + + protected: + Standard_Integer myNbIds; + Standard_Integer mySum; + TColStd_IndexedMapOfInteger myMap; +}; +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.cxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.cxx new file mode 100644 index 000000000..af2dd2b12 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.cxx @@ -0,0 +1,47 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyMapHasher.cxx +// Created: +// Author: Peter KURNEV +// +// +#include + +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKeyMapHasher::HashCode(const GEOMAlgo_PassKey& aPK, + const Standard_Integer Upper) +{ + return aPK.HashCode(Upper); +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_PassKeyMapHasher::IsEqual(const GEOMAlgo_PassKey& aPK1, + const GEOMAlgo_PassKey& aPK2) +{ + return aPK1.IsEqual(aPK2); +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.hxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.hxx new file mode 100644 index 000000000..b320f6f55 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyMapHasher.hxx @@ -0,0 +1,51 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyMapHasher.hxx +// Created: +// Author: Peter KURNEV +// +// +#ifndef _GEOMAlgo_PassKeyMapHasher_HeaderFile +#define _GEOMAlgo_PassKeyMapHasher_HeaderFile + +#include +#include +#include +#include +#include + +//======================================================================= +//class : GEOMAlgo_PassKeyMapHasher +//purpose : +//======================================================================= +class GEOMAlgo_PassKeyMapHasher { + public: + Standard_EXPORT + static Standard_Integer HashCode(const GEOMAlgo_PassKey& aPKey, + const Standard_Integer Upper) ; + + Standard_EXPORT + static Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aPKey1, + const GEOMAlgo_PassKey& aPKey2) ; +}; +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.cxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.cxx new file mode 100644 index 000000000..bbfb279ba --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.cxx @@ -0,0 +1,229 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyShape.cxx +// Created: +// Author: Peter KURNEV +// +// +#include + +#include +#include + + +static + Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv); +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape() +{ + myUpper=432123; +} +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape(const GEOMAlgo_PassKeyShape& aOther) +{ + myUpper=432123; + myNbIds=aOther.myNbIds; + mySum=aOther.mySum; + myMap=aOther.myMap; +} +//======================================================================= +//function :~ +//purpose : +//======================================================================= + GEOMAlgo_PassKeyShape::~GEOMAlgo_PassKeyShape() +{ +} +//======================================================================= +//function :Assign +//purpose : +//======================================================================= + GEOMAlgo_PassKeyShape& GEOMAlgo_PassKeyShape::Assign(const GEOMAlgo_PassKeyShape& aOther) +{ + myUpper=432123; + myNbIds=aOther.myNbIds; + mySum=aOther.mySum; + myMap=aOther.myMap; + return *this; +} +//======================================================================= +//function :Clear +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::Clear() +{ + myNbIds=0; + mySum=0; + myMap.Clear(); +} +//======================================================================= +//function :SetShapes +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1) + +{ + Standard_Integer aHC; + // + Clear(); + myNbIds=1; + myMap.Add(aS1); + aHC=aS1.HashCode(myUpper); + mySum=NormalizedId(aHC, myNbIds); +} +//======================================================================= +//function :SetShapes +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2) +{ + TopTools_ListOfShape aLS; + // + aLS.Append(aS1); + aLS.Append(aS2); + SetShapes(aLS); +} +//======================================================================= +//function :SetShapes +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2, + const TopoDS_Shape& aS3) +{ + TopTools_ListOfShape aLS; + // + aLS.Append(aS1); + aLS.Append(aS2); + aLS.Append(aS3); + SetShapes(aLS); +} +//======================================================================= +//function :SetShapes +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2, + const TopoDS_Shape& aS3, + const TopoDS_Shape& aS4) +{ + TopTools_ListOfShape aLS; + // + aLS.Append(aS1); + aLS.Append(aS2); + aLS.Append(aS3); + aLS.Append(aS4); + SetShapes(aLS); +} +//======================================================================= +//function :SetShapes +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS) +{ + Standard_Integer i, aId, aIdN; + TopTools_ListIteratorOfListOfShape aIt; + // + Clear(); + aIt.Initialize(aLS); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aS=aIt.Value(); + myMap.Add(aS); + } + myNbIds=myMap.Extent(); + for(i=1; i<=myNbIds; ++i) { + const TopoDS_Shape& aS=myMap(i); + aId=aS.HashCode(myUpper); + aIdN=NormalizedId(aId, myNbIds); + mySum+=aIdN; + } +} +//======================================================================= +//function :NbIds +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKeyShape::NbIds()const +{ + return myNbIds; +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_PassKeyShape::IsEqual(const GEOMAlgo_PassKeyShape& aOther) const +{ + Standard_Boolean bRet; + Standard_Integer i; + // + bRet=Standard_False; + // + if (myNbIds!=aOther.myNbIds) { + return bRet; + } + for (i=1; i<=myNbIds; ++i) { + const TopoDS_Shape& aS=myMap(i); + if (!aOther.myMap.Contains(aS)) { + return bRet; + } + } + return !bRet; +} +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKeyShape::HashCode(const Standard_Integer aUpper) const +{ + return ::HashCode(mySum, aUpper); +} +//======================================================================= +//function : Dump +//purpose : +//======================================================================= + void GEOMAlgo_PassKeyShape::Dump(const Standard_Integer)const +{ +} +//======================================================================= +// function: NormalizedId +// purpose : +//======================================================================= +Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv) +{ + Standard_Integer aMax, aTresh, aIdRet; + // + aIdRet=aId; + aMax=::IntegerLast(); + aTresh=aMax/aDiv; + if (aId>aTresh) { + aIdRet=aId%aTresh; + } + return aIdRet; +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.hxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.hxx new file mode 100644 index 000000000..aca56f261 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShape.hxx @@ -0,0 +1,105 @@ + +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyShape.hxx +// Created: +// Author: Peter KURNEV +// +// +#ifndef _GEOMAlgo_PassKeyShape_HeaderFile +#define _GEOMAlgo_PassKeyShape_HeaderFile + +#include +#include +#include +#include +#include +#include +#include + + +//======================================================================= +//class : GEOMAlgo_PassKeyShape +//purpose : +//======================================================================= +class GEOMAlgo_PassKeyShape { + public: + Standard_EXPORT + GEOMAlgo_PassKeyShape(); + + Standard_EXPORT + virtual ~GEOMAlgo_PassKeyShape(); + + Standard_EXPORT + GEOMAlgo_PassKeyShape(const GEOMAlgo_PassKeyShape& Other); + + Standard_EXPORT + GEOMAlgo_PassKeyShape& Assign(const GEOMAlgo_PassKeyShape& Other) ; + + GEOMAlgo_PassKeyShape& operator =(const GEOMAlgo_PassKeyShape& Other) { + return Assign(Other); + } + + Standard_EXPORT + void SetShapes(const TopoDS_Shape& aS) ; + + Standard_EXPORT + void SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2) ; + + Standard_EXPORT + void SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2, + const TopoDS_Shape& aS3) ; + + Standard_EXPORT + void SetShapes(const TopoDS_Shape& aS1, + const TopoDS_Shape& aS2, + const TopoDS_Shape& aS3, + const TopoDS_Shape& aS4) ; + + Standard_EXPORT + void SetShapes(const TopTools_ListOfShape& aLS) ; + + Standard_EXPORT + void Clear() ; + + Standard_EXPORT + Standard_Integer NbIds() const; + + Standard_EXPORT + Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aOther) const; + + Standard_EXPORT + Standard_Integer HashCode(const Standard_Integer Upper) const; + + Standard_EXPORT + void Dump(const Standard_Integer aHex = 0) const; + +protected: + Standard_Integer myNbIds; + Standard_Integer mySum; + Standard_Integer myUpper; + TopTools_IndexedMapOfShape myMap; +}; +#endif diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.cxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.cxx new file mode 100644 index 000000000..756abe524 --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.cxx @@ -0,0 +1,47 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyMapHasher.cxx +// Created: +// Author: Peter KURNEV +// +// +#include + +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= + Standard_Integer GEOMAlgo_PassKeyShapeMapHasher::HashCode(const GEOMAlgo_PassKeyShape& aPK, + const Standard_Integer Upper) +{ + return aPK.HashCode(Upper); +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= + Standard_Boolean GEOMAlgo_PassKeyShapeMapHasher::IsEqual(const GEOMAlgo_PassKeyShape& aPK1, + const GEOMAlgo_PassKeyShape& aPK2) +{ + return aPK1.IsEqual(aPK2); +} diff --git a/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.hxx b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.hxx new file mode 100644 index 000000000..ae6bc592e --- /dev/null +++ b/src/GeomAlgoAPI/GEOMAlgo_PassKeyShapeMapHasher.hxx @@ -0,0 +1,52 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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 +// + +// File: GEOMAlgo_PassKeyMapHasher.hxx +// Created: +// Author: Peter KURNEV +// +// +#ifndef _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile +#define _GEOMAlgo_PassKeyShapeMapHasher_HeaderFile + +#include +#include +#include +#include +#include + +//======================================================================= +//class : GEOMAlgo_PassKeyShapeMapHasher +//purpose : +//======================================================================= +class GEOMAlgo_PassKeyShapeMapHasher +{ + public: + Standard_EXPORT + static Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey, + const Standard_Integer Upper) ; + + Standard_EXPORT + static Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1, + const GEOMAlgo_PassKeyShape& aPKey2) ; +}; +#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Algo.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Algo.cpp new file mode 100644 index 000000000..d49ceef5f --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Algo.cpp @@ -0,0 +1,82 @@ +// 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 +// + +#include + +//======================================================================= +// function: +// purpose: +//======================================================================= +GeomAlgoAPI_Algo::GeomAlgoAPI_Algo() +: + myErrorStatus(1), + myWarningStatus(0), + myComputeInternalShapes(Standard_True) +{} +//======================================================================= +// function: ~ +// purpose: +//======================================================================= +GeomAlgoAPI_Algo::~GeomAlgoAPI_Algo() +{ +} +//======================================================================= +// function: CheckData +// purpose: +//======================================================================= +void GeomAlgoAPI_Algo::CheckData() +{ + myErrorStatus=0; +} +//======================================================================= +// function: CheckResult +// purpose: +//======================================================================= +void GeomAlgoAPI_Algo::CheckResult() +{ + myErrorStatus=0; +} +//======================================================================= +// function: ErrorStatus +// purpose: +//======================================================================= +Standard_Integer GeomAlgoAPI_Algo::ErrorStatus()const +{ + return myErrorStatus; +} +//======================================================================= +// function: WarningStatus +// purpose: +//======================================================================= +Standard_Integer GeomAlgoAPI_Algo::WarningStatus()const +{ + return myWarningStatus; +} +// myErrorStatus +// +// 1 - object is just initialized + +//======================================================================= +//function : ComputeInternalShapes +//purpose : +//======================================================================= +void GeomAlgoAPI_Algo::ComputeInternalShapes(const Standard_Boolean theFlag) +{ + myComputeInternalShapes = theFlag; +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Algo.h b/src/GeomAlgoAPI/GeomAlgoAPI_Algo.h new file mode 100644 index 000000000..c4ce84051 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Algo.h @@ -0,0 +1,68 @@ +// 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 +// + +#ifndef GEOMALGOAPI_ALGO_H_ +#define GEOMALGOAPI_ALGO_H_ + +#include +#include +#include +#include +#include + +//======================================================================= +//class : GeomAlgoAPI_Algo +//purpose : +//======================================================================= +class GeomAlgoAPI_Algo +{ + public: + Standard_EXPORT + virtual void Perform() = 0; + + Standard_EXPORT + Standard_Integer ErrorStatus() const; + + Standard_EXPORT + Standard_Integer WarningStatus() const; + + //! Allows to omit of creation of internal shapes (manifold topology).
+ //! Needed for the SALOME/TRIPOLI module.
+ Standard_EXPORT + void ComputeInternalShapes(const Standard_Boolean theFlag) ; + +protected: + Standard_EXPORT + GeomAlgoAPI_Algo(); + + Standard_EXPORT + virtual ~GeomAlgoAPI_Algo(); + + Standard_EXPORT + virtual void CheckData() ; + + Standard_EXPORT + virtual void CheckResult() ; + + + Standard_Integer myErrorStatus; + Standard_Integer myWarningStatus; + Standard_Boolean myComputeInternalShapes; +}; +#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.cpp new file mode 100644 index 000000000..17f862f9b --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.cpp @@ -0,0 +1,142 @@ +// 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 +// + +#include "GeomAlgoAPI_DuplicatedFaces.h" + +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include + +//================================================================================================= +bool GetDuplicatedFaces(const ListOfShape& theShapes, + const Standard_Real& theTolerance, + ListOfShape & theFaces, + std::string& theError) +{ + #ifdef _DEBUG + std::cout << "GetDuplicatedFaces " << std::endl; + #endif + + TopoDS_Shape aShape; + TopTools_SequenceOfShape aShapesSeq; + + ListOfShape::const_iterator anIt = theShapes.cbegin(); + + for (; anIt != theShapes.cend(); ++anIt) { + + GeomShapePtr aShapePtr = *anIt; + + if (!aShapePtr.get()) { + theError = "GetDuplicatedFaces : An invalid argument"; + return false; + } + aShape = aShapePtr->impl(); + aShapesSeq.Append( aShape ); + } + + if (aShapesSeq.Length() > 1){ + TopoDS_Compound aCompound; + BRep_Builder aBuilder; + aBuilder.MakeCompound( aCompound ); + for (int i = 1; i <= aShapesSeq.Length(); ++i) + aBuilder.Add( aCompound, aShapesSeq( i ) ); + + aShape = aCompound; + } + + GeomAlgoAPI_GlueDetector aGluer; + aGluer.SetArgument(aShape); + aGluer.SetTolerance(theTolerance); + aGluer.Perform(); + Standard_Integer iErr = aGluer.ErrorStatus(); + if (iErr) return NULL; + + std::vector< TopTools_IndexedMapOfShape* > anIndices( aShapesSeq.Length(), NULL ); + Handle(TColStd_HArray1OfInteger) anArray; + GeomShapePtr anObj; + + ListOfShape listOnePerSet; + + const TopTools_DataMapOfShapeListOfShape& aImages = aGluer.Images(); + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS (aImages); + for (int index = 1; aItDMSLS.More(); aItDMSLS.Next(), ++index) { + // some key shape + + // list of shapes of the argument that can be glued + const TopTools_ListOfShape& aLSD = aItDMSLS.Value(); + + //listShape.Append(aLSD.First()); + TopoDS_Shape aValue = aLSD.First(); + + if (aValue.ShapeType() == TopAbs_FACE) { + GeomShapePtr aS(new GeomAPI_Shape); + aS->setImpl(new TopoDS_Shape(aValue)); + listOnePerSet.push_back(aS); + } + } + + // for stable order of returned entities + GeomAlgoAPI_SortListOfShapes::sort(listOnePerSet); + + //TopTools_ListIteratorOfListOfShape aListIt (listOnePerSet); + ListOfShape::const_iterator aListIt = listOnePerSet.cbegin(); + for (; aListIt != listOnePerSet.cend(); ++aListIt) { + TopoDS_Shape aValue = (*aListIt)->impl(); + // find a shape to add aValue as a sub-shape + anObj.reset(); + + anIt = theShapes.cbegin(); + GeomShapePtr aShapePtr; + for (int i = 0; i < theShapes.size(); ++i, ++anIt) { + aShapePtr = *anIt; + if (!anIndices[i]) { + anIndices[i] = new TopTools_IndexedMapOfShape; + aShape = aShapePtr->impl(); + TopExp::MapShapes( aShape, *anIndices[i]); + } + if (int index = anIndices[i]->FindIndex( aValue )) { + + const TopoDS_Shape& aSelShape = anIndices[i]->FindKey(index); + GeomShapePtr aS(new GeomAPI_Shape); + aS->setImpl(new TopoDS_Shape(aSelShape)); + // GeomAlgoAPI_ShapeBuilder::add(aShapePtr,aS); + if (aS.get()) + theFaces.push_back(aS); + break; + } + } + } + for (size_t i = 0 ; i < anIndices.size(); ++i) + delete anIndices[i]; + + return true; +} + diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h b/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h new file mode 100644 index 000000000..b5d8b580d --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_DuplicatedFaces.h @@ -0,0 +1,38 @@ +// 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 +// + +#ifndef GEOMALGOAPI_DUPLICATEDFACES_H_ +#define GEOMALGOAPI_DUPLICATEDFACES_H_ + +#include +#include +#include + +/// get the boundin box of theshape. +/// \param theShape the shape +/// \param theTolerance precise TRUE for precise computation; FALSE for fast one. +/// \param theFaces the duplicated faces +/// \param theError error +GEOMALGOAPI_EXPORT +bool GetDuplicatedFaces(const ListOfShape& theShapes, + const Standard_Real& theTolerance, + ListOfShape & theFaces, + std::string& theError); + +#endif //GEOMALGOAPI_DUPLICATEDFACES_H_ diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.cpp new file mode 100644 index 000000000..857d54614 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.cpp @@ -0,0 +1,594 @@ +// 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 +// + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +// +static + Standard_Integer CheckAncesstors + (const TopoDS_Shape& aVSD, + const TopTools_MapOfShape& aMVSD, + const TopTools_IndexedDataMapOfShapeListOfShape& aMVE, + const TopTools_IndexedDataMapOfShapeListOfShape& aMEV, + TopTools_IndexedDataMapOfShapeListOfShape& aMEVZ); + +//======================================================================= +//function : +//purpose : +//======================================================================= +GeomAlgoAPI_GlueDetector::GeomAlgoAPI_GlueDetector() +: + GeomAlgoAPI_GluerAlgo(), + GeomAlgoAPI_Algo() +{} +//======================================================================= +//function : ~ +//purpose : +//======================================================================= +GeomAlgoAPI_GlueDetector::~GeomAlgoAPI_GlueDetector() +{} +//======================================================================= +//function : StickedShapes +//purpose : +//======================================================================= +const TopTools_IndexedDataMapOfShapeListOfShape& + GeomAlgoAPI_GlueDetector::StickedShapes() +{ + return myStickedShapes; +} +//======================================================================= +//function : Perform +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::Perform() +{ + myErrorStatus=0; + myWarningStatus=0; + myStickedShapes.Clear(); + // + CheckData(); + if (myErrorStatus) { + return; + } + // + // Initialize the context + GeomAlgoAPI_GluerAlgo::Perform(); + // + DetectVertices(); + if (myErrorStatus) { + return; + } + // + CheckDetected(); + if (myErrorStatus) { + return; + } + // + DetectEdges(); + if (myErrorStatus) { + return; + } + // + DetectFaces(); + if (myErrorStatus) { + return; + } +} +//======================================================================= +//function : DetectVertices +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::DetectVertices() +{ + Standard_Integer j, i, aNbV, aNbVSD; + Standard_Real aTolV; + gp_Pnt aPV; + TColStd_ListIteratorOfListOfInteger aIt; + TopoDS_Shape aVF; + TopTools_IndexedMapOfShape aMV; + TopTools_MapOfShape aMVProcessed; + TopTools_ListIteratorOfListOfShape aItS; + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; + TopTools_DataMapOfShapeListOfShape aMVV; + GEOMAlgo_IndexedDataMapOfIntegerShape aMIS; + GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB; + GEOMAlgo_BndSphereTreeSelector aSelector; + GEOMAlgo_BndSphereTree aBBTree; + NCollection_UBTreeFiller aTreeFiller(aBBTree); + // + myErrorStatus=0; + // + TopExp::MapShapes(myArgument, TopAbs_VERTEX, aMV); + aNbV=aMV.Extent(); + if (!aNbV) { + myErrorStatus=2; // no vertices in source shape + return; + } + // + for (i=1; i<=aNbV; ++i) { + GEOMAlgo_BndSphere aBox; + // + const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aMV(i)); + aPV=BRep_Tool::Pnt(aV); + aTolV=BRep_Tool::Tolerance(aV); + // + aBox.SetGap(myTolerance); + aBox.SetCenter(aPV); + aBox.SetRadius(aTolV); + // + aTreeFiller.Add(i, aBox); + // + aMIS.Add(i, aV); + aMSB.Add(aV, aBox); + } + // + aTreeFiller.Fill(); + // + //--------------------------------------------------- + // Chains + for (i=1; i<=aNbV; ++i) { + const TopoDS_Shape& aV=aMV(i); + // + if (aMVProcessed.Contains(aV)) { + continue; + } + // + Standard_Integer aNbIP, aIP, aNbIP1, aIP1; + TopTools_ListOfShape aLVSD; + TColStd_MapOfInteger aMIP, aMIP1, aMIPC; + TColStd_MapIteratorOfMapOfInteger aIt1; + // + aMIP.Add(i); + for(;;) { + aNbIP=aMIP.Extent(); + aIt1.Initialize(aMIP); + for(; aIt1.More(); aIt1.Next()) { + aIP=aIt1.Key(); + if (aMIPC.Contains(aIP)) { + continue; + } + // + const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP); + const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP); + // + aSelector.Clear(); + aSelector.SetBox(aBoxVP); + // + aNbVSD=aBBTree.Select(aSelector); + if (!aNbVSD) { + continue; // it should not be so [at least IP itself] + } + // + const TColStd_ListOfInteger& aLI=aSelector.Indices(); + aIt.Initialize(aLI); + for (; aIt.More(); aIt.Next()) { + aIP1=aIt.Value(); + if (aMIP.Contains(aIP1)) { + continue; + } + aMIP1.Add(aIP1); + } //for (; aIt.More(); aIt.Next()) { + }//for(; aIt1.More(); aIt1.Next()) { + // + aNbIP1=aMIP1.Extent(); + if (!aNbIP1) { + break; + } + // + aIt1.Initialize(aMIP); + for(; aIt1.More(); aIt1.Next()) { + aIP=aIt1.Key(); + aMIPC.Add(aIP); + } + // + aMIP.Clear(); + aIt1.Initialize(aMIP1); + for(; aIt1.More(); aIt1.Next()) { + aIP=aIt1.Key(); + aMIP.Add(aIP); + } + aMIP1.Clear(); + }// while(1) + // + // Fill myImages + aNbIP=aMIPC.Extent(); + // + if (!aNbIP) {// no SD vertices is found + aMVProcessed.Add(aV); + continue; + } + //else { // SD vertices founded [ aMIPC ] + aIt1.Initialize(aMIPC); + for(j=0; aIt1.More(); aIt1.Next(), ++j) { + aIP=aIt1.Key(); + const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP); + if (!j) { + aVF=aVP; + } + aLVSD.Append(aVP); + aMVProcessed.Add(aVP); + } + //} + myImages.Bind(aVF, aLVSD); + }// for (i=1; i<=aNbV; ++i) { + //------------------------------ + // Origins + aItIm.Initialize(myImages); + for (; aItIm.More(); aItIm.Next()) { + const TopoDS_Shape& aV=aItIm.Key(); + const TopTools_ListOfShape& aLVSD=aItIm.Value(); + aItS.Initialize(aLVSD); + for (; aItS.More(); aItS.Next()) { + const TopoDS_Shape& aVSD=aItS.Value(); + if (!myOrigins.IsBound(aVSD)) { + myOrigins.Bind(aVSD, aV); + } + } + } +} +//======================================================================= +//function : DetectFaces +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::DetectFaces() +{ + DetectShapes(TopAbs_FACE); +} +//======================================================================= +//function : DetectEdges +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::DetectEdges() +{ + DetectShapes(TopAbs_EDGE); +} +//======================================================================= +//function : DetectShapes +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::DetectShapes(const TopAbs_ShapeEnum aType) +{ + Standard_Boolean bDegenerated; + Standard_Integer i, aNbF, aNbSDF, iErr; + TopTools_IndexedMapOfShape aMF; + TopTools_ListIteratorOfListOfShape aItLS; + GEOMAlgo_PassKeyShape aPKF; + GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLF; + // + myErrorStatus=0; + // + TopExp::MapShapes(myArgument, aType, aMF); + // + aNbF=aMF.Extent(); + for (i=1; i<=aNbF; ++i) { + const TopoDS_Shape& aS=aMF(i); + // + if (aType==TopAbs_FACE) { + const TopoDS_Face& aF=*((TopoDS_Face*)&aS); + FacePassKey(aF, aPKF); + } + else if (aType==TopAbs_EDGE) { + const TopoDS_Edge& aE=*((TopoDS_Edge*)&aS); + EdgePassKey(aE, aPKF); + } + // + if (myErrorStatus) { + return; + } + // + if (aMPKLF.Contains(aPKF)) { + TopTools_ListOfShape& aLSDF=aMPKLF.ChangeFromKey(aPKF); + aLSDF.Append(aS); + } + else { + TopTools_ListOfShape aLSDF; + // + aLSDF.Append(aS); + aMPKLF.Add(aPKF, aLSDF); + } + } + // check geometric coincidence + if (myCheckGeometry) { + iErr=GEOMAlgo_AlgoTools::RefineSDShapes(aMPKLF, myTolerance, myContext); + if (iErr) { + myErrorStatus=200; + return; + } + } + // + // Images/Origins + aNbF=aMPKLF.Extent(); + for (i=1; i<=aNbF; ++i) { + const TopTools_ListOfShape& aLSDF=aMPKLF(i); + aNbSDF=aLSDF.Extent(); + if (!aNbSDF) { + myErrorStatus=4; // it must not be + } + // + if (aNbSDF==1) { + continue; + } + // + const TopoDS_Shape& aS1=aLSDF.First(); + // + if (aType==TopAbs_EDGE) { + const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1); + bDegenerated=BRep_Tool::Degenerated(aE1); + if (bDegenerated) { + continue; + } + } + // + myImages.Bind(aS1, aLSDF); + // + // origins + aItLS.Initialize(aLSDF); + for (; aItLS.More(); aItLS.Next()) { + const TopoDS_Shape& aFSD=aItLS.Value(); + if (!myOrigins.IsBound(aFSD)) { + myOrigins.Bind(aFSD, aS1); + } + } + }// for (i=1; i<=aNbF; ++i) +} +//======================================================================= +//function : FacePassKey +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::FacePassKey(const TopoDS_Face& aF, + GEOMAlgo_PassKeyShape& aPK) +{ + Standard_Integer i, aNbE; + TopoDS_Shape aER; + TopTools_ListOfShape aLE; + TopTools_IndexedMapOfShape aME; + // + TopExp::MapShapes(aF, TopAbs_EDGE, aME); + // + aNbE=aME.Extent(); + for (i=1; i<=aNbE; ++i) { + const TopoDS_Shape& aE=aME(i); + // + const TopoDS_Edge& aEE=*((TopoDS_Edge*)&aE); + if (BRep_Tool::Degenerated(aEE)) { + continue; + } + // + if (myOrigins.IsBound(aE)) { + aER=myOrigins.Find(aE); + } + else { + aER=aE; + } + aLE.Append(aER); + } + aPK.SetShapes(aLE); +} +//======================================================================= +//function : EdgePassKey +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::EdgePassKey(const TopoDS_Edge& aE, + GEOMAlgo_PassKeyShape& aPK) +{ + TopAbs_Orientation aOr; + TopoDS_Shape aVR; + TopoDS_Iterator aIt; + TopTools_ListOfShape aLV; + // + aIt.Initialize(aE); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aV=aIt.Value(); + aOr=aV.Orientation(); + if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) { + if (myOrigins.IsBound(aV)) { + aVR=myOrigins.Find(aV); + } + else { + aVR=aV; + } + aLV.Append(aVR); + } + } + // + aPK.SetShapes(aLV); +} +//======================================================================= +//function : CheckDetected +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::CheckDetected() +{ + TopoDS_Iterator aItA; + TopExp_Explorer aExp; + TopTools_ListOfShape aLV; + TopTools_MapOfShape aMFence; + TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; + TopTools_IndexedDataMapOfShapeListOfShape aMVE, aMEV; + // + // 1. aMVE, aMEV + TopExp::MapShapesAndAncestors(myArgument, TopAbs_VERTEX, TopAbs_EDGE, aMVE); + // + aExp.Init(myArgument, TopAbs_EDGE); + for (; aExp.More(); aExp.Next()) { + const TopoDS_Shape& aE=aExp.Current(); + // + aLV.Clear(); + aMFence.Clear(); + aItA.Initialize(aE); + for (; aItA.More(); aItA.Next()) { + const TopoDS_Shape& aV=aItA.Value(); + if (aMFence.Add(aV)) { + aLV.Append(aV); + } + } + // + aMEV.Add(aE, aLV); + } + // 2. Checking + aItIm.Initialize(myImages); + for (; aItIm.More(); aItIm.Next()) { + //const TopoDS_Shape& aV=aItIm.Key(); + const TopTools_ListOfShape& aLVSD=aItIm.Value(); + CheckDetected(aLVSD, aMVE, aMEV); + } +} +//======================================================================= +//function : CheckDetected +//purpose : +//======================================================================= +void GeomAlgoAPI_GlueDetector::CheckDetected + (const TopTools_ListOfShape& aLVSD, + const TopTools_IndexedDataMapOfShapeListOfShape& aMVE, + const TopTools_IndexedDataMapOfShapeListOfShape& aMEV) +{ + Standard_Integer aNbVSD, iRet; + TopExp_Explorer aExp, aExpA; + TopTools_MapOfShape aMFence, aMVSD; + TopTools_ListOfShape aLV; + TopTools_ListIteratorOfListOfShape aItLS; + // + myErrorStatus=0; + // + aNbVSD=aLVSD.Extent(); + if (aNbVSD < 2) { + return ; + } + // + aItLS.Initialize(aLVSD); + for (; aItLS.More(); aItLS.Next()) { + const TopoDS_Shape& aVSD=aItLS.Value(); + aMVSD.Add(aVSD); + } + // + aItLS.Initialize(aLVSD); + for (; aItLS.More(); aItLS.Next()) { + const TopoDS_Shape& aVSD=aItLS.Value(); + // + iRet=CheckAncesstors(aVSD, aMVSD, aMVE, aMEV, myStickedShapes); + if (iRet) { + // Sticked shapes detected + myWarningStatus=2; + } + } +} +//======================================================================= +//function : CheckAncesstors +//purpose : +//======================================================================= +Standard_Integer CheckAncesstors + (const TopoDS_Shape& aVSD, + const TopTools_MapOfShape& aMVSD, + const TopTools_IndexedDataMapOfShapeListOfShape& aMVE, + const TopTools_IndexedDataMapOfShapeListOfShape& aMEV, + TopTools_IndexedDataMapOfShapeListOfShape& aMEVZ) +{ + TopTools_ListOfShape *pLE, *pLV, *pLVZ; + Standard_Integer iRet, aNbVX; + TopTools_ListIteratorOfListOfShape aItLE, aItLV; + TopTools_MapOfShape aMFence; + TopTools_ListOfShape aLVX; + // + iRet=0; + // + pLE=const_cast(aMVE).ChangeSeek(aVSD); + if (!pLE) { + return iRet; + } + aItLE.Initialize(*pLE); + for (; aItLE.More(); aItLE.Next()) { + const TopoDS_Shape& aE=aItLE.Value(); + // + pLV=const_cast(aMEV).ChangeSeek(aE); + if (!pLV) { + continue; // it should be not so + } + aLVX.Clear(); + aItLV.Initialize(*pLV); + for (; aItLV.More(); aItLV.Next()) { + const TopoDS_Shape& aV=aItLV.Value(); + if (!aV.IsSame(aVSD)) { + if (aMVSD.Contains(aV)) { + if (aMFence.Add(aV)) { + aLVX.Append(aV); + } + } + } + } + // + aNbVX=aLVX.Extent(); + if (!aNbVX) { + continue; + } + // + iRet=1; + // + pLVZ=aMEVZ.ChangeSeek(aE); + if (!pLVZ) { + aMEVZ.Add(aE, aLVX); + } + else { + TopTools_ListOfShape& aLVZ=*pLVZ; + aLVZ.Append(aLVX); + } + } + // + return iRet; +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.h b/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.h new file mode 100644 index 000000000..42764d257 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GlueDetector.h @@ -0,0 +1,91 @@ +// 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 +// + +#ifndef GEOMALGOAPI_GLUEDETECTOR_H_ +#define GEOMALGOAPI_GLUEDETECTOR_H_ + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +//======================================================================= +//function : GEOMAlgoAPI_GlueDetector +//purpose : +//======================================================================= +class GeomAlgoAPI_GlueDetector : public GeomAlgoAPI_GluerAlgo, + public GeomAlgoAPI_Algo +{ +public: + GEOMALGOAPI_EXPORT + GeomAlgoAPI_GlueDetector(); + + GEOMALGOAPI_EXPORT virtual + ~GeomAlgoAPI_GlueDetector(); + + GEOMALGOAPI_EXPORT virtual + void Perform() ; + + GEOMALGOAPI_EXPORT + const TopTools_IndexedDataMapOfShapeListOfShape& StickedShapes(); + +protected: + GEOMALGOAPI_EXPORT + void DetectVertices() ; + + GEOMALGOAPI_EXPORT + void DetectEdges() ; + + GEOMALGOAPI_EXPORT + void DetectFaces() ; + + GEOMALGOAPI_EXPORT + void DetectShapes(const TopAbs_ShapeEnum aType) ; + + GEOMALGOAPI_EXPORT + void EdgePassKey(const TopoDS_Edge& aE, + GEOMAlgo_PassKeyShape& aPK) ; + + GEOMALGOAPI_EXPORT + void FacePassKey(const TopoDS_Face& aF, + GEOMAlgo_PassKeyShape& aPK) ; + + GEOMALGOAPI_EXPORT + void CheckDetected(); + // + GEOMALGOAPI_EXPORT + void CheckDetected + (const TopTools_ListOfShape& aLVSD, + const TopTools_IndexedDataMapOfShapeListOfShape& aMVE, + const TopTools_IndexedDataMapOfShapeListOfShape& aMEV); + + + protected: + TopTools_IndexedDataMapOfShapeListOfShape myStickedShapes; + +}; +#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.cpp new file mode 100644 index 000000000..1245fe419 --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.cpp @@ -0,0 +1,138 @@ +// 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 +// + +#include +#include + +//======================================================================= +//function : GeomAlgoAPI_GluerAlgo +//purpose : +//======================================================================= +GeomAlgoAPI_GluerAlgo::GeomAlgoAPI_GluerAlgo() +{ + myTolerance=0.0001; + myCheckGeometry=Standard_True; +} +//======================================================================= +//function : ~GeomAlgoAPI_GluerAlgo +//purpose : +//======================================================================= +GeomAlgoAPI_GluerAlgo::~GeomAlgoAPI_GluerAlgo() +{ +} +//======================================================================= +//function : SetArgument +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::SetArgument(const TopoDS_Shape& theShape) +{ + myArgument=theShape; +} +//======================================================================= +//function : Argument +//purpose : +//======================================================================= +const TopoDS_Shape& GeomAlgoAPI_GluerAlgo::Argument()const +{ + return myArgument; +} +//======================================================================= +//function : SetTolerance +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::SetTolerance(const Standard_Real aT) +{ + myTolerance=aT; +} +//======================================================================= +//function : Tolerance +//purpose : +//======================================================================= +Standard_Real GeomAlgoAPI_GluerAlgo::Tolerance()const +{ + return myTolerance; +} + +//======================================================================= +//function : SetCheckGeometry +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::SetCheckGeometry(const Standard_Boolean aFlag) +{ + myCheckGeometry=aFlag; +} +//======================================================================= +//function : CheckGeometry +//purpose : +//======================================================================= +Standard_Boolean GeomAlgoAPI_GluerAlgo::CheckGeometry() const +{ + return myCheckGeometry; +} +//======================================================================= +//function : SetContext +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext) +{ + myContext=theContext; +} +//======================================================================= +//function : Context +//purpose : +//======================================================================= +const Handle(IntTools_Context)& GeomAlgoAPI_GluerAlgo::Context() +{ + return myContext; +} +//======================================================================= +//function : Images +//purpose : +//======================================================================= +const TopTools_DataMapOfShapeListOfShape& GeomAlgoAPI_GluerAlgo::Images()const +{ + return myImages; +} +//======================================================================= +//function : Origins +//purpose : +//======================================================================= +const TopTools_DataMapOfShapeShape& GeomAlgoAPI_GluerAlgo::Origins()const +{ + return myOrigins; +} +//======================================================================= +//function : Clear +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::Clear() +{ + myImages.Clear(); + myOrigins.Clear(); +} +//======================================================================= +//function : Perform +//purpose : +//======================================================================= +void GeomAlgoAPI_GluerAlgo::Perform() +{ + if (myContext.IsNull()) { + myContext=new IntTools_Context; + } +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.h b/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.h new file mode 100644 index 000000000..5cbaa687f --- /dev/null +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GluerAlgo.h @@ -0,0 +1,91 @@ +// 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 +// + +#ifndef GEOMALGOAPI_GLUERALGO_H_ +#define GEOMALGOAPI_GLUERALGO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//class : GEOMAlgo_GluerAlgo +//purpose : +//======================================================================= +class GeomAlgoAPI_GluerAlgo { +public: + + GEOMALGOAPI_EXPORT + GeomAlgoAPI_GluerAlgo(); + + GEOMALGOAPI_EXPORT + virtual ~GeomAlgoAPI_GluerAlgo(); + + GEOMALGOAPI_EXPORT + virtual void SetArgument(const TopoDS_Shape& theShape) ; + + GEOMALGOAPI_EXPORT + const TopoDS_Shape& Argument() const; + + GEOMALGOAPI_EXPORT + void SetTolerance(const Standard_Real aT) ; + + GEOMALGOAPI_EXPORT + Standard_Real Tolerance() const; + + GEOMALGOAPI_EXPORT + void SetCheckGeometry(const Standard_Boolean aFlag) ; + + GEOMALGOAPI_EXPORT + Standard_Boolean CheckGeometry() const; + + GEOMALGOAPI_EXPORT + virtual void Perform() ; + + GEOMALGOAPI_EXPORT + virtual void Clear() ; + + GEOMALGOAPI_EXPORT + void SetContext(const Handle(IntTools_Context)&) ; + + GEOMALGOAPI_EXPORT + const Handle(IntTools_Context)& Context() ; + + GEOMALGOAPI_EXPORT + const TopTools_DataMapOfShapeListOfShape& Images() const; + + GEOMALGOAPI_EXPORT + const TopTools_DataMapOfShapeShape& Origins() const; + +protected: + TopoDS_Shape myArgument; + Standard_Real myTolerance; + Standard_Boolean myCheckGeometry; + Handle(IntTools_Context) myContext; + TopTools_DataMapOfShapeListOfShape myImages; + TopTools_DataMapOfShapeShape myOrigins; + +private: +}; +#endif diff --git a/src/ModelHighAPI/CMakeLists.txt b/src/ModelHighAPI/CMakeLists.txt index 2d7a4917f..b76e425da 100644 --- a/src/ModelHighAPI/CMakeLists.txt +++ b/src/ModelHighAPI/CMakeLists.txt @@ -123,16 +123,16 @@ ADD_UNIT_TESTS(${TEST_NAMES}) if(${HAVE_SALOME}) enable_testing() set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/ModelHighAPI") - + install(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) - + set(TMP_TESTS_NAMES) foreach(tfile ${TEST_NAMES}) list(APPEND TMP_TESTS_NAMES "Test/${tfile}") endforeach(tfile ${TEST_NAMES}) - + install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY}) endif(${HAVE_SALOME}) diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 62a0ca1a8..eddd2efe6 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -32,6 +32,7 @@ from FeaturesAPI import addFusionFaces from FeaturesAPI import measureLength, measureDistance, measureRadius, measureAngle from FeaturesAPI import getPointCoordinates, getGeometryCalculation, getBoundingBox from FeaturesAPI import getNormal +from FeaturesAPI import getDuplicatedFaces from FeaturesAPI import addRemoveResults from FeaturesAPI import addCopy, addImportResult from FeaturesAPI import addDefeaturing -- 2.39.2