From: azv Date: Thu, 11 Aug 2016 10:35:44 +0000 (+0300) Subject: Dump Python in the High Level Parameterized Geometry API (issue #1648) X-Git-Tag: V_2.5.0~137^2~70 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=959230561ac3fcbb0dac8914aa20d67dffafa165;p=modules%2Fshaper.git Dump Python in the High Level Parameterized Geometry API (issue #1648) * Avoid to dump additional "Fixed" constraint for external features --- diff --git a/src/SketchAPI/SketchAPI_Constraint.cpp b/src/SketchAPI/SketchAPI_Constraint.cpp index 6870cc63d..617a0bfa6 100644 --- a/src/SketchAPI/SketchAPI_Constraint.cpp +++ b/src/SketchAPI/SketchAPI_Constraint.cpp @@ -132,6 +132,16 @@ void SketchAPI_Constraint::dump(ModelHighAPI_Dumper& theDumper) const if (!aConstraint) return; // dump constraints only + // do not need to dump "Fixed" constraint for external object + if (aConstraint->getKind() == SketchPlugin_ConstraintRigid::ID()) { + AttributeRefAttrPtr aRefAttr = aConstraint->refattr(SketchPlugin_Constraint::ENTITY_A()); + std::shared_ptr aSketchFeature = + std::dynamic_pointer_cast( + ModelAPI_Feature::feature(aRefAttr->object())); + if (!aSketchFeature || aSketchFeature->isExternal()) + return; + } + const std::string& aSetter = constraintTypeToSetter(aConstraint->getKind()); if (aSetter.empty()) return; // incorrect constraint type