Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid crash if there is no parent of selection attribute.
[modules/shaper.git]
/
src
/
SketchAPI
/
SketchAPI_Mirror.cpp
diff --git
a/src/SketchAPI/SketchAPI_Mirror.cpp
b/src/SketchAPI/SketchAPI_Mirror.cpp
index b13e94f03abc6cc5a233985f818d0e65fe86db20..73f13635d9f67e51c5193374021b197da88b3723 100644
(file)
--- a/
src/SketchAPI/SketchAPI_Mirror.cpp
+++ b/
src/SketchAPI/SketchAPI_Mirror.cpp
@@
-70,8
+70,16
@@
void SketchAPI_Mirror::dump(ModelHighAPI_Dumper& theDumper) const
FeaturePtr aBase = feature();
const std::string& aSketchName = theDumper.parentName(aBase);
FeaturePtr aBase = feature();
const std::string& aSketchName = theDumper.parentName(aBase);
+
AttributeRefAttrPtr aMirrorLine = mirrorLine();
AttributeRefListPtr aMirrorObjects = mirrorList();
AttributeRefAttrPtr aMirrorLine = mirrorLine();
AttributeRefListPtr aMirrorObjects = mirrorList();
+
+ // Check all attributes are already dumped. If not, store the constraint as postponed.
+ if (!theDumper.isDumped(aMirrorLine) || !theDumper.isDumped(aMirrorObjects)) {
+ theDumper.postpone(aBase);
+ return;
+ }
+
theDumper << aBase << " = " << aSketchName << ".addMirror(" << aMirrorLine << ", "
<< aMirrorObjects << ")" << std::endl;
theDumper << aBase << " = " << aSketchName << ".addMirror(" << aMirrorLine << ", "
<< aMirrorObjects << ")" << std::endl;