From: mzn Date: Fri, 17 Aug 2018 07:48:11 +0000 (+0300) Subject: Issue #2577: Remove fusion faces functionality from master. X-Git-Tag: SHAPER_V9_1_0RC1~69 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f38016c371e0f1fe21b68a2469f82318e278bd93;p=modules%2Fshaper.git Issue #2577: Remove fusion faces functionality from master. --- diff --git a/doc/gui/FeaturesPlugin/fusionFacesFeature.rst b/doc/gui/FeaturesPlugin/fusionFacesFeature.rst deleted file mode 100644 index 1fd7f2f99..000000000 --- a/doc/gui/FeaturesPlugin/fusionFacesFeature.rst +++ /dev/null @@ -1,6 +0,0 @@ - -Fusion faces -============ - -.. centered:: - Fusion faces diff --git a/src/BuildPlugin/Test/TestInterpolation.py b/src/BuildPlugin/Test/TestInterpolation.py index 656351a48..abeda2393 100644 --- a/src/BuildPlugin/Test/TestInterpolation.py +++ b/src/BuildPlugin/Test/TestInterpolation.py @@ -60,17 +60,17 @@ model.do() model.checkResult(Interpolation_1, model, 1, [0], [0], [0], [1], [2]) -# ============================================================================= -# Test 2. Create curve 1-2-3-4-5-1, closed on, reorder off, without tangents -# ============================================================================= +# # ============================================================================= +# # Test 2. Create curve 1-2-3-4-5-1, closed on, reorder off, without tangents +# # ============================================================================= Interpolation_2 = model.addInterpolation(Part_1_doc, [p_1, p_2, p_3, p_4, p_5], True, False) model.do() model.checkResult(Interpolation_2, model, 1, [0], [0], [0], [1], [2]) -# ============================================================================= -# Test 3. Create curve 1-2-3-4, closed off, reorder on, without tangents -# ============================================================================= +# # ============================================================================= +# # Test 3. Create curve 1-2-3-4, closed off, reorder on, without tangents +# # ============================================================================= Interpolation_3 = model.addInterpolation(Part_1_doc, [p_1, p_2, p_3, p_4], False, True) model.do() diff --git a/src/FeaturesAPI/CMakeLists.txt b/src/FeaturesAPI/CMakeLists.txt index 76c17d1eb..b511fc640 100644 --- a/src/FeaturesAPI/CMakeLists.txt +++ b/src/FeaturesAPI/CMakeLists.txt @@ -46,7 +46,6 @@ SET(PROJECT_HEADERS FeaturesAPI_Symmetry.h FeaturesAPI_Translation.h FeaturesAPI_Union.h - FeaturesAPI_FusionFaces.h ) SET(PROJECT_SOURCES @@ -74,7 +73,6 @@ SET(PROJECT_SOURCES FeaturesAPI_Symmetry.cpp FeaturesAPI_Translation.cpp FeaturesAPI_Union.cpp - FeaturesAPI_FusionFaces.cpp ) SET(PROJECT_LIBRARIES diff --git a/src/FeaturesAPI/FeaturesAPI.i b/src/FeaturesAPI/FeaturesAPI.i index e9668c42c..dd6b5897f 100644 --- a/src/FeaturesAPI/FeaturesAPI.i +++ b/src/FeaturesAPI/FeaturesAPI.i @@ -66,7 +66,6 @@ %shared_ptr(FeaturesAPI_Symmetry) %shared_ptr(FeaturesAPI_Translation) %shared_ptr(FeaturesAPI_Union) -%shared_ptr(FeaturesAPI_FusionFaces) // all supported interfaces %include "FeaturesAPI_BooleanCut.h" @@ -93,4 +92,3 @@ %include "FeaturesAPI_Symmetry.h" %include "FeaturesAPI_Translation.h" %include "FeaturesAPI_Union.h" -%include "FeaturesAPI_FusionFaces.h" diff --git a/src/FeaturesAPI/FeaturesAPI_FusionFaces.cpp b/src/FeaturesAPI/FeaturesAPI_FusionFaces.cpp deleted file mode 100644 index 0a2efc8b2..000000000 --- a/src/FeaturesAPI/FeaturesAPI_FusionFaces.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2014-2017 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_FusionFaces.h" - -#include -#include - -//================================================================================================== -FeaturesAPI_FusionFaces::FeaturesAPI_FusionFaces( - const std::shared_ptr& theFeature) -: ModelHighAPI_Interface(theFeature) -{ - initialize(); -} - -//================================================================================================== -FeaturesAPI_FusionFaces::FeaturesAPI_FusionFaces( - const std::shared_ptr& theFeature, - const ModelHighAPI_Selection& theBase) -: ModelHighAPI_Interface(theFeature) -{ - if(initialize()) { - setBase(theBase); - } -} - -//================================================================================================== -FeaturesAPI_FusionFaces::~FeaturesAPI_FusionFaces() -{ - -} - -//================================================================================================== -void FeaturesAPI_FusionFaces::setBase(const ModelHighAPI_Selection& theBase) -{ - fillAttribute(theBase, mybase); - - execute(); -} - -//================================================================================================== -void FeaturesAPI_FusionFaces::dump(ModelHighAPI_Dumper& theDumper) const -{ - FeaturePtr aBase = feature(); - const std::string& aPartName = theDumper.name(aBase->document()); - - AttributeSelectionPtr anAttrBaseShape = - aBase->selection(FeaturesPlugin_FusionFaces::BASE_SHAPE_ID()); - - theDumper << aBase << " = model.addFusionFaces(" - << aPartName << ", " << anAttrBaseShape << ")" << std::endl; -} - -//================================================================================================== -FusionFacesPtr addFusionFaces(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theBase) -{ - std::shared_ptr aFeature = - thePart->addFeature(FeaturesAPI_FusionFaces::ID()); - return FusionFacesPtr(new FeaturesAPI_FusionFaces(aFeature, theBase)); -} diff --git a/src/FeaturesAPI/FeaturesAPI_FusionFaces.h b/src/FeaturesAPI/FeaturesAPI_FusionFaces.h deleted file mode 100644 index 054f7ac2f..000000000 --- a/src/FeaturesAPI/FeaturesAPI_FusionFaces.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2014-2017 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_FusionFaces_H_ -#define FeaturesAPI_FusionFaces_H_ - -#include "FeaturesAPI.h" - -#include - -#include -#include - -class ModelHighAPI_Dumper; -class ModelHighAPI_Selection; - -/// \class FeaturesAPI_FusionFaces -/// \ingroup CPPHighAPI -/// \brief Interface for FusionFaces feature. -class FeaturesAPI_FusionFaces: public ModelHighAPI_Interface -{ -public: - /// Constructor without values. - FEATURESAPI_EXPORT - explicit FeaturesAPI_FusionFaces(const std::shared_ptr& theFeature); - - /// Constructor with values. - FEATURESAPI_EXPORT - explicit FeaturesAPI_FusionFaces(const std::shared_ptr& theFeature, - const ModelHighAPI_Selection& theBase); - - /// Destructor. - FEATURESAPI_EXPORT - virtual ~FeaturesAPI_FusionFaces(); - - INTERFACE_1(FeaturesPlugin_FusionFaces::ID(), - base, FeaturesPlugin_FusionFaces::BASE_SHAPE_ID(), - ModelAPI_AttributeSelection, /** Base */) - - /// Modify base object attribute of the feature. - FEATURESAPI_EXPORT - void setBase(const ModelHighAPI_Selection& theBase); - - /// Dump wrapped feature - FEATURESAPI_EXPORT - virtual void dump(ModelHighAPI_Dumper& theDumper) const; -}; - -/// Pointer on FusionFaces object. -typedef std::shared_ptr FusionFacesPtr; - -/// \ingroup CPPHighAPI -/// \brief Create FusionFaces feature. -FEATURESAPI_EXPORT -FusionFacesPtr addFusionFaces(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theBase); - -#endif // FeaturesAPI_FusionFaces_H_ diff --git a/src/FeaturesAPI/FeaturesAPI_swig.h b/src/FeaturesAPI/FeaturesAPI_swig.h index e6e4435a1..1c7d2d40b 100644 --- a/src/FeaturesAPI/FeaturesAPI_swig.h +++ b/src/FeaturesAPI/FeaturesAPI_swig.h @@ -48,6 +48,5 @@ #include "FeaturesAPI_Symmetry.h" #include "FeaturesAPI_Translation.h" #include "FeaturesAPI_Union.h" - #include "FeaturesAPI_FusionFaces.h" #endif // FeaturesAPI_swig_H_ diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index 0b8054f01..a49cd84fd 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -58,7 +58,6 @@ SET(PROJECT_HEADERS FeaturesPlugin_MultiRotation.h FeaturesPlugin_Fillet.h FeaturesPlugin_Measurement.h - FeaturesPlugin_FusionFaces.h ) SET(PROJECT_SOURCES @@ -95,7 +94,6 @@ SET(PROJECT_SOURCES FeaturesPlugin_MultiRotation.cpp FeaturesPlugin_Fillet.cpp FeaturesPlugin_Measurement.cpp - FeaturesPlugin_FusionFaces.cpp ) SET(XML_RESOURCES @@ -124,7 +122,6 @@ SET(XML_RESOURCES multirotation_widget.xml fillet_widget.xml measurement_widget.xml - fusion_faces_widget.xml ) SET(TEXT_RESOURCES @@ -244,7 +241,6 @@ ADD_UNIT_TESTS(TestExtrusion.py TestMeasurementDistance.py TestMeasurementRadius.py TestMeasurementAngle.py - TestFusionFaces.py Test1379.py Test1922.py Test1942.py diff --git a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp deleted file mode 100644 index b3cc312c5..000000000 --- a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (C) 2014-2017 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_FusionFaces.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - - -//================================================================================================== -FeaturesPlugin_FusionFaces::FeaturesPlugin_FusionFaces() -{ -} - -//================================================================================================== -void FeaturesPlugin_FusionFaces::initAttributes() -{ - data()->addAttribute(BASE_SHAPE_ID(), ModelAPI_AttributeSelection::typeId()); -} - -//================================================================================================== -void FeaturesPlugin_FusionFaces::execute() -{ - // Get selection. - AttributeSelectionPtr aShapeAttrSelection = selection(BASE_SHAPE_ID()); - if (!aShapeAttrSelection.get()) { - return; - } - - // Get shape. - GeomShapePtr aBaseShape = aShapeAttrSelection->value(); - - // Make fusion - std::shared_ptr anAlgo(new GeomAlgoAPI_UnifySameDomain(aBaseShape)); - - // Check algo status - if (!anAlgo->isDone()) { - setError("Error: Fusion algorithm failed."); - return; - } - if (anAlgo->shape()->isNull()) { - setError("Error: Resulting shape is Null."); - return; - } - if (!anAlgo->isValid()) { - setError("Error: Resulting shape is not valid."); - return; - } - - // Store result - GeomShapePtr aResultShape = anAlgo->shape(); - ResultBodyPtr aResultBody = document()->createBody(data()); - if (aResultShape->isEqual(aBaseShape)) { - aResultBody->store(aResultShape); - } else { - aResultBody->storeModified(aBaseShape, aResultShape); - - const int aModifyEdgeTag = 1; - const int aModifyFaceTag = 2; - const std::string aModEName = "Modified_Edge"; - const std::string aModFName = "Modified_Face"; - std::shared_ptr aMapOfShapes = anAlgo->mapOfSubShapes(); - aResultBody->loadAndOrientModifiedShapes(anAlgo.get(), aBaseShape, GeomAPI_Shape::EDGE, - aModifyEdgeTag, aModEName, *aMapOfShapes.get(), true); - aResultBody->loadAndOrientModifiedShapes(anAlgo.get(), aBaseShape, GeomAPI_Shape::FACE, - aModifyFaceTag, aModFName, *aMapOfShapes.get(), true); - } - setResult(aResultBody); -} diff --git a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.h b/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.h deleted file mode 100644 index 3b919257c..000000000 --- a/src/FeaturesPlugin/FeaturesPlugin_FusionFaces.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2014-2017 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_FusionFaces_H_ -#define FeaturesPlugin_FusionFaces_H_ - -#include "FeaturesPlugin.h" - -#include - -/// \class FeaturesPlugin_FusionFaces -/// \ingroup Plugins -/// \brief Feature for fusion of connected faces. -class FeaturesPlugin_FusionFaces : public ModelAPI_Feature -{ -public: - /// Use plugin manager for features creation - FeaturesPlugin_FusionFaces(); - - /// Feature kind. - inline static const std::string& ID() - { - static const std::string MY_ID("FusionFaces"); - return MY_ID; - } - - /// Attribute name of base shape. - inline static const std::string& BASE_SHAPE_ID() - { - static const std::string MY_BASE_SHAPE_ID("base_shape"); - return MY_BASE_SHAPE_ID; - } - - /// \return the kind of a feature. - FEATURESPLUGIN_EXPORT virtual const std::string& getKind() - { - static std::string MY_KIND = FeaturesPlugin_FusionFaces::ID(); - return MY_KIND; - } - - /// Request for initialization of data model of the feature: adding all attributes. - FEATURESPLUGIN_EXPORT virtual void initAttributes(); - - /// Executes the faces fusion and stores the modififed shape. - FEATURESPLUGIN_EXPORT virtual void execute(); -}; - -#endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index 3f1da2fd1..a53331c23 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include @@ -152,8 +151,6 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(std::string theFeatureID) return FeaturePtr(new FeaturesPlugin_RemoveSubShapes); } else if (theFeatureID == FeaturesPlugin_Union::ID()) { return FeaturePtr(new FeaturesPlugin_Union); - } else if (theFeatureID == FeaturesPlugin_FusionFaces::ID()) { - return FeaturePtr(new FeaturesPlugin_FusionFaces); } else if (theFeatureID == FeaturesPlugin_Symmetry::ID()) { return FeaturePtr(new FeaturesPlugin_Symmetry); } else if (theFeatureID == FeaturesPlugin_Scale::ID()) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts index aa489e343..5a46be254 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_en.ts @@ -3692,11 +3692,4 @@ "Base objects" should contain at least 2 items. - - FusionFaces:Model_FeatureValidator - - Attribute "base_shape" is not initialized. - Base shape is not selected. - - diff --git a/src/FeaturesPlugin/Test/TestFusionFaces.py b/src/FeaturesPlugin/Test/TestFusionFaces.py deleted file mode 100644 index 537375470..000000000 --- a/src/FeaturesPlugin/Test/TestFusionFaces.py +++ /dev/null @@ -1,137 +0,0 @@ -## Copyright (C) 2014-2017 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 -## - -from salome.shaper import model - -# Create document -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() - -# ============================================================================= -# Test 1. Fusion faces for shell of 2 adjacent faces lying on plane -# ============================================================================= -Box_1 = model.addBox(Part_1_doc, 10, 10, 10) -Box_2 = model.addBox(Part_1_doc, 10, 10, 10) -Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("EDGE", "PartSet/OX"), 10) - -Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Box_1_1/Top"), model.selection("FACE", "Translation_1_1/Translated_Face_1")]) -model.do() - -model.checkResult(Shell_1, model, 1, [0], [0], [2], [8], [16]) - -FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SHELL", "Shell_1_1")) -model.do() - -model.checkResult(FusionFaces_1, model, 1, [0], [0], [1], [4], [8]) - -# ============================================================================= -# Test 2. Fusion faces for solid of 2 adjacent boxes -# ============================================================================= -Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Translation_1_1")], []) -model.do() - -model.checkResult(Fuse_1, model, 1, [0], [1], [10], [40], [80]) - -FusionFaces_2 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", "Fuse_1_1")) -model.do() - -model.checkResult(FusionFaces_2, model, 1, [0], [1], [6], [24], [48]) - -# ============================================================================= -# Test 3. Fusion faces for shell of adjacent faces lying on cylindrical surface -# ============================================================================= -Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) -Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Cylinder_1_1/Face_1")]) -Point_1 = model.addPoint(Part_1_doc, 0, 0, 5) -Plane_1 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OZ"), model.selection("VERTEX", "Point_1"), True) - -Partition_1 = model.addPartition(Part_1_doc, [model.selection("SHELL", "Shell_2_1"), model.selection("FACE", "Plane_1")]) -model.do() - -model.checkResult(Partition_1, model, 1, [0], [0], [2], [8], [16]) - -FusionFaces_3 = model.addFusionFaces(Part_1_doc, model.selection("SHELL", "Partition_1_1")) -model.do() - -model.checkResult(FusionFaces_3, model, 1, [0], [0], [1], [4], [8]) - -# ============================================================================= -# Test 4. Fusion faces for compsolid -# ============================================================================= -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchLine_1 = Sketch_1.addLine(25, 40, -50, 40) -SketchLine_2 = Sketch_1.addLine(-50, 40, -50, 0) -SketchLine_3 = Sketch_1.addLine(-50, 0, 25, 0) -SketchLine_4 = Sketch_1.addLine(25, 0, 25, 40) -SketchLine_5 = Sketch_1.addLine(-20, 40, -20, 0) -model.do() - -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 10, 0) -Box_3 = model.addBox(Part_1_doc, 10, 10, 10) - -Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1_2"), model.selection("SOLID", "Box_3_1")], []) -model.do() - -model.checkResult(Fuse_2, model, 1, [2], [2], [16], [72], [144]) - -FusionFaces_4 = model.addFusionFaces(Part_1_doc, model.selection("COMPSOLID", "Fuse_2_1")) -model.do() - -model.checkResult(FusionFaces_4, model, 1, [2], [2], [12], [48], [96]) - -# ============================================================================= -# Test 5. Fusion faces for compound -# ============================================================================= -Box_4 = model.addBox(Part_1_doc, 10, 10, 10) -Box_5 = model.addBox(Part_1_doc, 10, 10, 10) -Translation_2 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_5_1")], 0, 0, 5) -Box_6 = model.addBox(Part_1_doc, 10, 10, 10) -Translation_3 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_6_1")], 20, 0, 0) -Box_7 = model.addBox(Part_1_doc, 10, 10, 10) -Translation_4 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Box_7_1")], 20, 0, 5) -Fuse_3 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Box_4_1"), model.selection("SOLID", "Translation_2_1")], []) -Fuse_4 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Translation_3_1"), model.selection("SOLID", "Translation_4_1")], []) - -Compound_1 = model.addCompound(Part_1_doc, [model.selection("SOLID", "Fuse_3_1"), model.selection("SOLID", "Fuse_4_1")]) -model.do() - -model.checkResult(Compound_1, model, 1, [2], [2], [28], [112], [224]) - -FusionFaces_5 = model.addFusionFaces(Part_1_doc, model.selection("COMPOUND", "Compound_1_1")) -model.do() - -model.checkResult(FusionFaces_5, model, 1, [2], [2], [12], [48], [96]) - -# ============================================================================= -# Test 6. Check subshapes naming -# ============================================================================= -#model.testHaveNamingSubshapes(FusionFaces_1, model, Part_1_doc) -model.testHaveNamingSubshapes(FusionFaces_2, model, Part_1_doc) -#model.testHaveNamingSubshapes(FusionFaces_3, model, Part_1_doc) -model.testHaveNamingSubshapes(FusionFaces_4, model, Part_1_doc) -model.testHaveNamingSubshapes(FusionFaces_5, model, Part_1_doc) -model.end() - -# ============================================================================= -# Test 7. Check Python dump -# ============================================================================= -assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/fusion_faces_widget.xml b/src/FeaturesPlugin/fusion_faces_widget.xml deleted file mode 100644 index eb123bf15..000000000 --- a/src/FeaturesPlugin/fusion_faces_widget.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - diff --git a/src/FeaturesPlugin/icons/fusion_faces.png b/src/FeaturesPlugin/icons/fusion_faces.png deleted file mode 100644 index 2020164b4..000000000 Binary files a/src/FeaturesPlugin/icons/fusion_faces.png and /dev/null differ diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index 68b139b51..36433dec5 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -120,12 +120,6 @@ email : webmaster.salome@opencascade.com - - - - - diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp index ee9c6feca..a2a27ba5d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp @@ -33,13 +33,6 @@ GeomAlgoAPI_UnifySameDomain::GeomAlgoAPI_UnifySameDomain(const ListOfShape& theS build(theShapes); } -//================================================================================================== -GeomAlgoAPI_UnifySameDomain::GeomAlgoAPI_UnifySameDomain(const GeomShapePtr& theShape) -{ - build(theShape, false); -} - -//================================================================================================== void GeomAlgoAPI_UnifySameDomain::build(const ListOfShape& theShapes) { if(theShapes.empty()) { @@ -61,20 +54,10 @@ void GeomAlgoAPI_UnifySameDomain::build(const ListOfShape& theShapes) const TopoDS_Shape& aShell = aCombined.front()->impl(); - std::shared_ptr aShape(new GeomAPI_Shape()); - aShape->setImpl(new TopoDS_Shape(aShell)); - build(aShape, true); -} - -//================================================================================================== -void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape, - const bool theIsToSimplifyShell) -{ ShapeUpgrade_UnifySameDomain* aUnifyAlgo = new ShapeUpgrade_UnifySameDomain(); this->setImpl(aUnifyAlgo); - const TopoDS_Shape& aShape = theShape->impl(); - aUnifyAlgo->Initialize(aShape); + aUnifyAlgo->Initialize(aShell); aUnifyAlgo->Build(); TopoDS_Shape aResult = aUnifyAlgo->Shape(); @@ -82,7 +65,7 @@ void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape, return; } - if (theIsToSimplifyShell && aResult.ShapeType() == TopAbs_SHELL) { + if (aResult.ShapeType() == TopAbs_SHELL) { int aNb = 0; TopoDS_Iterator anIt(aResult); for (; anIt.More(); anIt.Next()) { @@ -95,9 +78,9 @@ void GeomAlgoAPI_UnifySameDomain::build(const GeomShapePtr& theShape, } } - std::shared_ptr aResShape(new GeomAPI_Shape()); - aResShape->setImpl(new TopoDS_Shape(aResult)); - this->setShape(aResShape); + std::shared_ptr aShape(new GeomAPI_Shape()); + aShape->setImpl(new TopoDS_Shape(aResult)); + this->setShape(aShape); this->setDone(true); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.h b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.h index 101484737..a18366672 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.h @@ -35,9 +35,6 @@ public: /// Constructor. GEOMALGOAPI_EXPORT GeomAlgoAPI_UnifySameDomain(const ListOfShape& theShapes); - /// Constructor. - GEOMALGOAPI_EXPORT GeomAlgoAPI_UnifySameDomain(const GeomShapePtr& theShape); - /// \return the list of shapes modified from the shape \a theShape. /// \param[in] theShape base shape. /// \param[out] theHistory modified shapes. @@ -45,11 +42,8 @@ public: ListOfShape& theHistory); private: - /// Builds resulting shape from lisy of shapes. + /// Builds resulting shape. void build(const ListOfShape& theShapes); - - /// Builds resulting shape from the shape. - void build(const GeomShapePtr& theShape, const bool theIsToSimplifyShell); }; #endif diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 273a282d2..b74ad9b4e 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -10,5 +10,4 @@ from FeaturesAPI import addCut, addFuse, addCommon, addSmash, addFill from FeaturesAPI import addIntersection, addPartition, addUnion, addRemoveSubShapes from FeaturesAPI import addRecover from FeaturesAPI import addFillet -from FeaturesAPI import addFusionFaces from FeaturesAPI import measureLength, measureDistance, measureRadius, measureAngle