theDumper.myDumpBuffer << theEndl;
if (!theDumper.myEntitiesStack.empty()) {
- // Name for composite feature is dumped when all sub-entities are dumped
- // (see method ModelHighAPI_Dumper::processSubs).
- const ModelHighAPI_Dumper::LastDumpedEntity& aLastDumped = theDumper.myEntitiesStack.top();
- CompositeFeaturePtr aComposite =
- std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aLastDumped.myEntity);
- if (!aComposite)
- theDumper.dumpEntitySetName();
+ bool isCopy;
+ // all copies have been stored into stack, pop them all
+ do {
+ isCopy = false;
+ // Name for composite feature is dumped when all sub-entities are dumped
+ // (see method ModelHighAPI_Dumper::processSubs).
+ const ModelHighAPI_Dumper::LastDumpedEntity& aLastDumped = theDumper.myEntitiesStack.top();
+ CompositeFeaturePtr aComposite =
+ std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aLastDumped.myEntity);
+ if (!aComposite) {
+ theDumper.dumpEntitySetName();
+ FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLastDumped.myEntity);
+ if (aFeature) {
+ AttributeBooleanPtr aCopyAttr = aFeature->boolean("Copy");
+ isCopy = aCopyAttr.get() && aCopyAttr->value();
+ }
+ }
+ } while (isCopy);
}
// store all not-dumped entities first
--- /dev/null
+"""
+ Test1924.py
+ Test case for issue #1924 "Wrong naming of multiple-rotated sketch edges on python dump"
+"""
+
+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(70, 120, 50, 25)
+SketchLine_2 = Sketch_1.addLine(50, 25, 170, 50)
+SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin"))
+SketchMultiRotation_1_objects = [SketchLine_1.result(), SketchLine_2.result()]
+# names of rotated objects: "SketchLine_3", "SketchLine_4"
+SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchPoint_1.coordinates(), 90, 2)
+# line named "SketchLine_5"
+SketchLine_5 = Sketch_1.addLine(0, 100, 100, 100)
+# change number of rotated objects.
+# names of rotated objects: "SketchLine_3", "SketchLine_4", "SketchLine_6", "SketchLine_7"
+SketchMultiRotation_1.numberOfObjects().setValue(3)
+
+model.end()
+
+assert(model.checkPythonDump())