]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Dump Python in the High Level Parameterized Geometry API (issue #1648)
authorazv <azv@opencascade.com>
Thu, 11 Aug 2016 10:35:44 +0000 (13:35 +0300)
committerazv <azv@opencascade.com>
Thu, 11 Aug 2016 10:36:42 +0000 (13:36 +0300)
* Avoid to dump additional "Fixed" constraint for external features

src/SketchAPI/SketchAPI_Constraint.cpp

index 6870cc63dabc3c30ec06159a208be514e0f714b2..617a0bfa62485d90f16239ea548cbce261122ba0 100644 (file)
@@ -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<SketchPlugin_Feature> aSketchFeature =
+        std::dynamic_pointer_cast<SketchPlugin_Feature>(
+        ModelAPI_Feature::feature(aRefAttr->object()));
+    if (!aSketchFeature || aSketchFeature->isExternal())
+      return;
+  }
+
   const std::string& aSetter = constraintTypeToSetter(aConstraint->getKind());
   if (aSetter.empty())
     return; // incorrect constraint type