From bdae5cb5ced067b164d2b20b579addbadc408b67 Mon Sep 17 00:00:00 2001 From: azv Date: Tue, 22 May 2018 16:03:39 +0300 Subject: [PATCH] Task 2.6. Behavior of the Symmetry feature * Symmetry has been renamed to Mirror Copy * Original shape is kept when mirroring --- src/FeaturesAPI/FeaturesAPI_Symmetry.cpp | 12 +- src/FeaturesAPI/FeaturesAPI_Symmetry.h | 14 +- .../FeaturesPlugin_Symmetry.cpp | 130 +++++++++-------- src/FeaturesPlugin/FeaturesPlugin_Symmetry.h | 18 ++- src/FeaturesPlugin/plugin-Features.xml | 2 +- src/ModelAPI/Test/TestCustomName_Recover.py | 2 +- src/PythonAPI/model/features/__init__.py | 2 +- .../SHAPER/Transformations/TestSymmetry.py | 137 +++++++++--------- 8 files changed, 168 insertions(+), 149 deletions(-) diff --git a/src/FeaturesAPI/FeaturesAPI_Symmetry.cpp b/src/FeaturesAPI/FeaturesAPI_Symmetry.cpp index 8f48cc965..6e8b8b622 100644 --- a/src/FeaturesAPI/FeaturesAPI_Symmetry.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Symmetry.cpp @@ -32,8 +32,8 @@ FeaturesAPI_Symmetry::FeaturesAPI_Symmetry(const std::shared_ptr& theFeature, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theObject) + const std::list& theMainObjects, + const ModelHighAPI_Selection& theObject) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -98,7 +98,7 @@ void FeaturesAPI_Symmetry::dump(ModelHighAPI_Dumper& theDumper) const AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Symmetry::OBJECTS_LIST_ID()); - theDumper << aBase << " = model.addSymmetry(" << aDocName << ", " << anAttrObjects; + theDumper << aBase << " = model.addMirror(" << aDocName << ", " << anAttrObjects; std::string aCreationMethod = aBase->string(FeaturesPlugin_Symmetry::CREATION_METHOD())->value(); @@ -121,9 +121,9 @@ void FeaturesAPI_Symmetry::dump(ModelHighAPI_Dumper& theDumper) const } //================================================================================================== -SymmetryPtr addSymmetry(const std::shared_ptr& thePart, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theObject) +SymmetryPtr addMirror(const std::shared_ptr& thePart, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theObject) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_Symmetry::ID()); return SymmetryPtr(new FeaturesAPI_Symmetry(aFeature, theMainObjects, theObject)); diff --git a/src/FeaturesAPI/FeaturesAPI_Symmetry.h b/src/FeaturesAPI/FeaturesAPI_Symmetry.h index 77ef64498..1b4ab9dac 100644 --- a/src/FeaturesAPI/FeaturesAPI_Symmetry.h +++ b/src/FeaturesAPI/FeaturesAPI_Symmetry.h @@ -34,7 +34,7 @@ class ModelHighAPI_Selection; /// \class FeaturesAPI_Symmetry /// \ingroup CPPHighAPI -/// \brief Interface for Symmetry feature. +/// \brief Interface for the Mirror Copy feature. class FeaturesAPI_Symmetry: public ModelHighAPI_Interface { public: @@ -45,8 +45,8 @@ public: /// Constructor with values. FEATURESAPI_EXPORT explicit FeaturesAPI_Symmetry(const std::shared_ptr& theFeature, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theObject); + const std::list& theMainObjects, + const ModelHighAPI_Selection& theObject); /// Destructor. FEATURESAPI_EXPORT @@ -89,10 +89,10 @@ public: typedef std::shared_ptr SymmetryPtr; /// \ingroup CPPHighAPI -/// \brief Create Symmetry feature. +/// \brief Create the Mirror Copy feature. FEATURESAPI_EXPORT -SymmetryPtr addSymmetry(const std::shared_ptr& thePart, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theObject); +SymmetryPtr addMirror(const std::shared_ptr& thePart, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theObject); #endif // FEATURESAPI_SYMMETRY_H_ diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp index 7121e968d..418913246 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp @@ -20,6 +20,7 @@ #include +#include #include #include @@ -81,27 +82,36 @@ void FeaturesPlugin_Symmetry::execute() } //================================================================================================= -void FeaturesPlugin_Symmetry::performSymmetryByPoint() +bool FeaturesPlugin_Symmetry::collectSourceObjects(ListOfShape& theSourceShapes, + std::list& theSourceResults) { - // Getting objects. - ListOfShape anObjects; - std::list aContextes; AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Symmetry::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { - return; + return false; } - for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { + for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); - if(!anObject.get()) { // may be for not-activated parts + if (!anObject.get()) { // may be for not-activated parts eraseResults(); - return; + return false; } - anObjects.push_back(anObject); - aContextes.push_back(anObjectAttr->context()); + theSourceShapes.push_back(anObject); + theSourceResults.push_back(anObjectAttr->context()); } + return true; +} + +//================================================================================================= +void FeaturesPlugin_Symmetry::performSymmetryByPoint() +{ + // Getting objects. + ListOfShape anObjects; + std::list aContextes; + if (!collectSourceObjects(anObjects, aContextes)) + return; //Getting point. std::shared_ptr aPoint; @@ -130,10 +140,9 @@ void FeaturesPlugin_Symmetry::performSymmetryByPoint() std::shared_ptr aTrsf(new GeomAPI_Trsf()); aTrsf->setSymmetry(aPoint); ResultPartPtr anOrigin = std::dynamic_pointer_cast(*aContext); - ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex); - aResultPart->setTrsf(*aContext, aTrsf); - setResult(aResultPart, aResultIndex); - } else { + buildResult(anOrigin, aTrsf, aResultIndex); + } + else { GeomAlgoAPI_Symmetry aSymmetryAlgo(aBaseShape, aPoint); if (!aSymmetryAlgo.check()) { @@ -160,9 +169,7 @@ void FeaturesPlugin_Symmetry::performSymmetryByPoint() break; } - ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aSymmetryAlgo, aResultBody, aBaseShape); - setResult(aResultBody, aResultIndex); + buildResult(aSymmetryAlgo, aBaseShape, aResultIndex); } aResultIndex++; } @@ -177,22 +184,8 @@ void FeaturesPlugin_Symmetry::performSymmetryByAxis() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = - selectionList(FeaturesPlugin_Symmetry::OBJECTS_LIST_ID()); - if (anObjectsSelList->size() == 0) { + if (!collectSourceObjects(anObjects, aContextes)) return; - } - for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = - anObjectsSelList->value(anObjectsIndex); - std::shared_ptr anObject = anObjectAttr->value(); - if(!anObject.get()) { // may be for not-activated parts - eraseResults(); - return; - } - anObjects.push_back(anObject); - aContextes.push_back(anObjectAttr->context()); - } //Getting axis. std::shared_ptr anAxis; @@ -223,10 +216,9 @@ void FeaturesPlugin_Symmetry::performSymmetryByAxis() std::shared_ptr aTrsf(new GeomAPI_Trsf()); aTrsf->setSymmetry(anAxis); ResultPartPtr anOrigin = std::dynamic_pointer_cast(*aContext); - ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex); - aResultPart->setTrsf(*aContext, aTrsf); - setResult(aResultPart, aResultIndex); - } else { + buildResult(anOrigin, aTrsf, aResultIndex); + } + else { GeomAlgoAPI_Symmetry aSymmetryAlgo(aBaseShape, anAxis); if (!aSymmetryAlgo.check()) { @@ -253,9 +245,7 @@ void FeaturesPlugin_Symmetry::performSymmetryByAxis() break; } - ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aSymmetryAlgo, aResultBody, aBaseShape); - setResult(aResultBody, aResultIndex); + buildResult(aSymmetryAlgo, aBaseShape, aResultIndex); } aResultIndex++; } @@ -270,22 +260,8 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = - selectionList(FeaturesPlugin_Symmetry::OBJECTS_LIST_ID()); - if (anObjectsSelList->size() == 0) { + if (!collectSourceObjects(anObjects, aContextes)) return; - } - for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = - anObjectsSelList->value(anObjectsIndex); - std::shared_ptr anObject = anObjectAttr->value(); - if(!anObject.get()) { // may be for not-activated parts - eraseResults(); - return; - } - anObjects.push_back(anObject); - aContextes.push_back(anObjectAttr->context()); - } //Getting axis. std::shared_ptr aPlane; @@ -318,9 +294,7 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane() std::shared_ptr aTrsf(new GeomAPI_Trsf()); aTrsf->setSymmetry(aPlane); ResultPartPtr anOrigin = std::dynamic_pointer_cast(*aContext); - ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex); - aResultPart->setTrsf(*aContext, aTrsf); - setResult(aResultPart, aResultIndex); + buildResult(anOrigin, aTrsf, aResultIndex); } else { GeomAlgoAPI_Symmetry aSymmetryAlgo(aBaseShape, aPlane); @@ -348,9 +322,7 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane() break; } - ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aSymmetryAlgo, aResultBody, aBaseShape); - setResult(aResultBody, aResultIndex); + buildResult(aSymmetryAlgo, aBaseShape, aResultIndex); } aResultIndex++; } @@ -359,14 +331,46 @@ void FeaturesPlugin_Symmetry::performSymmetryByPlane() removeResults(aResultIndex); } +//================================================================================================= +void FeaturesPlugin_Symmetry::buildResult(GeomAlgoAPI_Symmetry& theSymmetryAlgo, + std::shared_ptr theBaseShape, + int theResultIndex) +{ + // Compose source shape and the result of symmetry. + ListOfShape aShapes; + aShapes.push_back(theBaseShape); + aShapes.push_back(theSymmetryAlgo.shape()); + std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); + + // Store and name the result. + ResultBodyPtr aResultBody = document()->createBody(data(), theResultIndex); + aResultBody->storeModified(theBaseShape, aCompound); + loadNamingDS(theSymmetryAlgo, aResultBody, theBaseShape); + setResult(aResultBody, theResultIndex); +} + +//================================================================================================= +void FeaturesPlugin_Symmetry::buildResult(ResultPartPtr theOriginal, + std::shared_ptr theTrsf, + int& theResultIndex) +{ + std::shared_ptr anIdentity(new GeomAPI_Trsf()); + ResultPartPtr aCopy = document()->copyPart(theOriginal, data(), theResultIndex); + aCopy->setTrsf(theOriginal, anIdentity); + setResult(aCopy, theResultIndex); + + ++theResultIndex; + + ResultPartPtr aResultPart = document()->copyPart(theOriginal, data(), theResultIndex); + aResultPart->setTrsf(theOriginal, theTrsf); + setResult(aResultPart, theResultIndex); +} + //================================================================================================= void FeaturesPlugin_Symmetry::loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo, std::shared_ptr theResultBody, std::shared_ptr theBaseShape) { - // Store and name the result. - theResultBody->storeModified(theBaseShape, theSymmetryAlgo.shape()); - // Name the faces std::shared_ptr aSubShapes = theSymmetryAlgo.mapOfSubShapes(); std::string aReflectedName = "Symmetried"; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h index aa67bd79b..edb152dd1 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h @@ -27,6 +27,8 @@ #include +class GeomAPI_Trsf; + /** \class FeaturesPlugin_Symmetry * \ingroup Plugins * \brief Feature that performs reflection with respect to a point, axis, or plane. @@ -37,7 +39,7 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature /// Symmetry kind. inline static const std::string& ID() { - static const std::string MY_SYMMETRY_ID("Symmetry"); + static const std::string MY_SYMMETRY_ID("MirrorCopy"); return MY_SYMMETRY_ID; } @@ -114,6 +116,10 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature FeaturesPlugin_Symmetry(); private: + /// Obtain list of source objects of the mirror + bool collectSourceObjects(ListOfShape& theSourceShapes, + std::list>& theSourceResults); + /// Perform symmetry with respect to a point. void performSymmetryByPoint(); @@ -127,6 +133,16 @@ private: void loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo, std::shared_ptr theResultBody, std::shared_ptr theBaseShape); + + /// Create new result on given shapes and the index of result + void buildResult(GeomAlgoAPI_Symmetry& theSymmetryAlgo, + std::shared_ptr theBaseShape, + int theResultIndex); + + /// Create new result for the given part and transformation + void buildResult(std::shared_ptr theOriginal, + std::shared_ptr theTrsf, + int& theResultIndex); }; #endif // FEATURESPLUGIN_SYMMETRY_H_ diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index 88c1c0290..31d9e2903 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -97,7 +97,7 @@ email : webmaster.salome@opencascade.com - + diff --git a/src/ModelAPI/Test/TestCustomName_Recover.py b/src/ModelAPI/Test/TestCustomName_Recover.py index e069c44fb..cae44462d 100644 --- a/src/ModelAPI/Test/TestCustomName_Recover.py +++ b/src/ModelAPI/Test/TestCustomName_Recover.py @@ -27,7 +27,7 @@ Part_1_doc = Part_1.document() Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) Cylinder_1.result().setName("cylinder") Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "cylinder/Face_2"), 10, False) -Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("FACE", "Plane_1")) +Symmetry_1 = model.addMirror(Part_1_doc, [model.selection("SOLID", "cylinder")], model.selection("FACE", "Plane_1")) model.do() # check the name of the Symmetry diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 0347b26b2..fb5939d5f 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -1,7 +1,7 @@ """Package for Features plugin for the Parametric Geometry API of the Modeler. """ -from FeaturesAPI import addPlacement, addRotation, addScale, addSymmetry, addTranslation +from FeaturesAPI import addPlacement, addRotation, addScale, addMirror, addTranslation from FeaturesAPI import addMultiTranslation, addMultiRotation from FeaturesAPI import addExtrusion, addExtrusionCut, addExtrusionFuse from FeaturesAPI import addRevolution, addRevolutionCut, addRevolutionFuse diff --git a/test.API/SHAPER/Transformations/TestSymmetry.py b/test.API/SHAPER/Transformations/TestSymmetry.py index 161a53449..d7e0195fa 100644 --- a/test.API/SHAPER/Transformations/TestSymmetry.py +++ b/test.API/SHAPER/Transformations/TestSymmetry.py @@ -104,26 +104,26 @@ Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-Sketc # Symmetries -Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "PartSet/Origin")) -Symmetry_2 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("VERTEX", "Point_1")) -Symmetry_3 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("VERTEX", "Box_3_1/Front&Box_3_1/Right&Box_3_1/Top")) -Symmetry_4 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")) -Symmetry_5 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_5_1")], model.selection("VERTEX", "Vertex_1_1")) -Symmetry_6 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_6_1")], model.selection("VERTEX", "InvalidName")) - -Symmetry_7 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_7_1")], model.selection("EDGE", "PartSet/OZ")) -Symmetry_8 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_8_1")], model.selection("EDGE", "Axis_1")) -Symmetry_9 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_9_1")], model.selection("EDGE", "Box_9_1/Front&Box_9_1/Top")) -Symmetry_10 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_10_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")) -Symmetry_11 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_11_1")], model.selection("EDGE", "Edge_1_1")) -Symmetry_12 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_12_1")], model.selection("EDGE", "InvalidName")) - -Symmetry_13 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_13_1")], model.selection("FACE", "PartSet/XOY")) -Symmetry_14 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_14_1")], model.selection("FACE", "Plane_1")) -Symmetry_15 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_15_1")], model.selection("FACE", "Box_15_1/Front")) -Symmetry_16 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_16_1")], model.selection("FACE", "Face_1_1")) -Symmetry_17 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Box_17_1")], model.selection("FACE", "InvalidName")) -Symmetry_18 = model.addSymmetry(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")], model.selection("FACE", "Plane_2")) +Symmetry_1 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("VERTEX", "PartSet/Origin")) +Symmetry_2 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_2_1")], model.selection("VERTEX", "Point_1")) +Symmetry_3 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_3_1")], model.selection("VERTEX", "Box_3_1/Front&Box_3_1/Right&Box_3_1/Top")) +Symmetry_4 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_4_1")], model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1e")) +Symmetry_5 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_5_1")], model.selection("VERTEX", "Vertex_1_1")) +Symmetry_6 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_6_1")], model.selection("VERTEX", "InvalidName")) + +Symmetry_7 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_7_1")], model.selection("EDGE", "PartSet/OZ")) +Symmetry_8 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_8_1")], model.selection("EDGE", "Axis_1")) +Symmetry_9 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_9_1")], model.selection("EDGE", "Box_9_1/Front&Box_9_1/Top")) +Symmetry_10 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_10_1")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_1")) +Symmetry_11 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_11_1")], model.selection("EDGE", "Edge_1_1")) +Symmetry_12 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_12_1")], model.selection("EDGE", "InvalidName")) + +Symmetry_13 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_13_1")], model.selection("FACE", "PartSet/XOY")) +Symmetry_14 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_14_1")], model.selection("FACE", "Plane_1")) +Symmetry_15 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_15_1")], model.selection("FACE", "Box_15_1/Front")) +Symmetry_16 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_16_1")], model.selection("FACE", "Face_1_1")) +Symmetry_17 = model.addMirror(Part_1_doc, [model.selection("SOLID", "Box_17_1")], model.selection("FACE", "InvalidName")) +Symmetry_18 = model.addMirror(Part_1_doc, [model.selection("SHELL", "Extrusion_1_1")], model.selection("FACE", "Plane_2")) model.do() model.end() @@ -132,87 +132,87 @@ model.end() from GeomAPI import GeomAPI_Shape model.testNbResults(Symmetry_1, 1) -model.testNbSubResults(Symmetry_1, [0]) -model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_1, [2]) +model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_1, model, Part_1_doc) model.testNbResults(Symmetry_2, 1) -model.testNbSubResults(Symmetry_2, [0]) -model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_2, [2]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_2, model, Part_1_doc) model.testNbResults(Symmetry_3, 1) -model.testNbSubResults(Symmetry_3, [0]) -model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_3, [2]) +model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_3, model, Part_1_doc) model.testNbResults(Symmetry_4, 1) -model.testNbSubResults(Symmetry_4, [0]) -model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_4, [2]) +model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_4, model, Part_1_doc) model.testNbResults(Symmetry_5, 1) -model.testNbSubResults(Symmetry_5, [0]) -model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_5, [2]) +model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_5, model, Part_1_doc) model.testNbResults(Symmetry_7, 1) -model.testNbSubResults(Symmetry_7, [0]) -model.testNbSubShapes(Symmetry_7, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_7, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_7, [2]) +model.testNbSubShapes(Symmetry_7, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_7, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_7, model, Part_1_doc) model.testNbResults(Symmetry_8, 1) -model.testNbSubResults(Symmetry_8, [0]) -model.testNbSubShapes(Symmetry_8, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_8, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_8, [2]) +model.testNbSubShapes(Symmetry_8, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_8, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_8, model, Part_1_doc) model.testNbResults(Symmetry_9, 1) -model.testNbSubResults(Symmetry_9, [0]) -model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_9, [2]) +model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_9, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_9, model, Part_1_doc) model.testNbResults(Symmetry_10, 1) -model.testNbSubResults(Symmetry_10, [0]) -model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_10, [2]) +model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_10, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_10, model, Part_1_doc) model.testNbResults(Symmetry_11, 1) -model.testNbSubResults(Symmetry_11, [0]) -model.testNbSubShapes(Symmetry_11, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_11, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_11, [2]) +model.testNbSubShapes(Symmetry_11, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_11, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_11, model, Part_1_doc) model.testNbResults(Symmetry_13, 1) -model.testNbSubResults(Symmetry_13, [0]) -model.testNbSubShapes(Symmetry_13, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_13, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_13, [2]) +model.testNbSubShapes(Symmetry_13, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_13, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_13, model, Part_1_doc) model.testNbResults(Symmetry_14, 1) -model.testNbSubResults(Symmetry_14, [0]) -model.testNbSubShapes(Symmetry_14, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_14, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_14, [2]) +model.testNbSubShapes(Symmetry_14, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_14, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_14, model, Part_1_doc) model.testNbResults(Symmetry_15, 1) -model.testNbSubResults(Symmetry_15, [0]) -model.testNbSubShapes(Symmetry_15, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_15, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_15, [2]) +model.testNbSubShapes(Symmetry_15, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_15, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_15, model, Part_1_doc) model.testNbResults(Symmetry_16, 1) -model.testNbSubResults(Symmetry_16, [0]) -model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.FACE, [6]) +model.testNbSubResults(Symmetry_16, [2]) +model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.SOLID, [2]) +model.testNbSubShapes(Symmetry_16, GeomAPI_Shape.FACE, [12]) model.testHaveNamingFaces(Symmetry_16, model, Part_1_doc) model.testNbResults(Symmetry_6, 0) @@ -224,10 +224,9 @@ assert(Symmetry_12.feature().error() == 'Attribute "axis_object" is not initiali model.testNbResults(Symmetry_17, 0) assert(Symmetry_17.feature().error() == 'Attribute "plane_object" is not initialized.') -# To uncomment when #2046 will be performed -#model.testNbResults(Symmetry_18, 1) -#model.testNbSubResults(Symmetry_18, [0]) -#model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.SOLID, [0]) -#model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.SHELL, [1]) -#model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.FACE, [5]) -#model.testHaveNamingFaces(Symmetry_18, model, Part_1_doc) \ No newline at end of file +model.testNbResults(Symmetry_18, 1) +model.testNbSubResults(Symmetry_18, [2]) +model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.SOLID, [0]) +model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.SHELL, [2]) +model.testNbSubShapes(Symmetry_18, GeomAPI_Shape.FACE, [10]) +model.testHaveNamingFaces(Symmetry_18, model, Part_1_doc) -- 2.39.2