Test1922.py
Test1942.py
Test1915.py
+ Test2023.py
)
//load result
theResultBody->storeModified(theBaseShape, theTransformAlgo.shape());
- int aPlacedTag = 1;
std::string aPlacedName = "Placed";
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTransformAlgo.mapOfSubShapes();
FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody,
- theBaseShape, aPlacedTag, aPlacedName,
+ theBaseShape, 1, 2, 3, aPlacedName,
*aSubShapes.get());
}
// Store result.
theResultBody->storeModified(theBaseShape, theRotaionAlgo.shape());
- int aRotatedTag = 1;
std::string aRotatedName = "Rotated";
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
- theBaseShape, aRotatedTag, aRotatedName,
+ theBaseShape, 1, 2, 3, aRotatedName,
*aSubShapes.get());
}
void FeaturesPlugin_Tools::storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
std::shared_ptr<GeomAPI_Shape> theBaseShape,
- int& theTag,
+ const int theFaceTag,
+ const int theEdgeTag,
+ const int theVertexTag,
const std::string theName,
GeomAPI_DataMapOfShapeShape& theSubShapes)
{
case GeomAPI_Shape::COMPOUND: {
for(GeomAPI_ShapeIterator anIt(theBaseShape); anIt.more(); anIt.next())
{
- storeModifiedShapes(theAlgo, theResultBody, theBaseShape, theTag, theName, theSubShapes);
+ storeModifiedShapes(theAlgo,
+ theResultBody,
+ anIt.current(),
+ theFaceTag,
+ theEdgeTag,
+ theVertexTag,
+ theName,
+ theSubShapes);
}
break;
}
case GeomAPI_Shape::SHELL: {
theResultBody->loadAndOrientModifiedShapes(&theAlgo,
theBaseShape, GeomAPI_Shape::FACE,
- theTag, theName + "_Face", theSubShapes);
+ theFaceTag, theName + "_Face", theSubShapes);
if (theBaseShape->shapeType() == GeomAPI_Shape::COMPSOLID
|| theBaseShape->shapeType() == GeomAPI_Shape::SOLID) {
break;
}
- ++theTag;
}
case GeomAPI_Shape::FACE:
case GeomAPI_Shape::WIRE: {
theResultBody->loadAndOrientModifiedShapes(&theAlgo,
theBaseShape, GeomAPI_Shape::EDGE,
- theTag, theName + "_Edge", theSubShapes);
- ++theTag;
+ theEdgeTag, theName + "_Edge", theSubShapes);
}
case GeomAPI_Shape::EDGE: {
theResultBody->loadAndOrientModifiedShapes(&theAlgo,
theBaseShape, GeomAPI_Shape::VERTEX,
- theTag, theName + "_Vertex", theSubShapes);
- ++theTag;
+ theVertexTag, theName + "_Vertex", theSubShapes);
}
}
}
static void storeModifiedShapes(GeomAlgoAPI_MakeShape& theAlgo,
std::shared_ptr<ModelAPI_ResultBody> theResultBody,
std::shared_ptr<GeomAPI_Shape> theBaseShape,
- int& theTag,
+ const int theFaceTag,
+ const int theEdgeTag,
+ const int theVertexTag,
const std::string theName,
GeomAPI_DataMapOfShapeShape& theSubShapes);
};
// Store result.
theResultBody->storeModified(theBaseShape, theTranslationAlgo.shape());
- int aTranslatedTag = 1;
std::string aTranslatedName = "Translated";
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTranslationAlgo.mapOfSubShapes();
FeaturesPlugin_Tools::storeModifiedShapes(theTranslationAlgo, theResultBody,
- theBaseShape, aTranslatedTag, aTranslatedName,
+ theBaseShape, 1, 2, 3, aTranslatedName,
*aSubShapes.get());
}
--- /dev/null
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(178.3876500857632, 167.2384219554031, -133.7907375643225, 167.2384219554031)
+SketchLine_2 = Sketch_1.addLine(-133.7907375643225, 167.2384219554031, -133.7907375643225, -134.6483704974271)
+SketchLine_3 = Sketch_1.addLine(-133.7907375643225, -134.6483704974271, 178.3876500857632, -134.6483704974271)
+SketchLine_4 = Sketch_1.addLine(178.3876500857632, -134.6483704974271, 178.3876500857632, 167.2384219554031)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f")], model.selection(), 100, 0)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+SketchLine_5 = Sketch_2.addLine(99.48542024013722, 69.46826758147516, -34.30531732418524, 69.46826758147516)
+SketchLine_6 = Sketch_2.addLine(-34.30531732418524, 69.46826758147516, -34.30531732418524, -62.60720411663805)
+SketchLine_7 = Sketch_2.addLine(-34.30531732418524, -62.60720411663805, 99.48542024013722, -62.60720411663805)
+SketchLine_8 = Sketch_2.addLine(99.48542024013722, -62.60720411663805, 99.48542024013722, 69.46826758147516)
+SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchLine_5.startPoint())
+SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchLine_5.endPoint(), SketchLine_6.startPoint())
+SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchLine_6.endPoint(), SketchLine_7.startPoint())
+SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchLine_7.endPoint(), SketchLine_8.startPoint())
+SketchConstraintHorizontal_3 = Sketch_2.setHorizontal(SketchLine_5.result())
+SketchConstraintVertical_3 = Sketch_2.setVertical(SketchLine_6.result())
+SketchConstraintHorizontal_4 = Sketch_2.setHorizontal(SketchLine_7.result())
+SketchConstraintVertical_4 = Sketch_2.setVertical(SketchLine_8.result())
+model.do()
+Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_5f-SketchLine_6f-SketchLine_7f-SketchLine_8f")], model.selection(), 10, 110)
+Intersection_1 = model.addIntersection(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_2_1")])
+Rotation_1 = model.addRotation(Part_1_doc, [model.selection("COMPOUND", "Intersection_1_1")], model.selection("EDGE", "PartSet/OZ"), 45)
+model.end()
+
+assert(model.checkPythonDump())