]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2024: Redesign of circle and arc of circle
authordbv <dbv@opencascade.com>
Mon, 27 Mar 2017 15:21:49 +0000 (18:21 +0300)
committerdbv <dbv@opencascade.com>
Mon, 27 Mar 2017 15:22:06 +0000 (18:22 +0300)
Validators update

src/SketchPlugin/SketchPlugin_Validators.cpp

index 398827f61b2867a51a21f83f7f58063d9f1d42c1..6683c906f8606418ddedbcba9616a6075f1741f6 100755 (executable)
@@ -1293,7 +1293,9 @@ bool SketchPlugin_ArcEndPointValidator::isValid(
     return true;
   }
 
-  if(!anEndPointRef->isInitialized()) {
+  ObjectPtr anObject = anEndPointRef->object();
+  AttributePtr anAttr = anEndPointRef->attr();
+  if(!anObject.get() && !anAttr.get()) {
     return true;
   }
 
@@ -1301,7 +1303,6 @@ bool SketchPlugin_ArcEndPointValidator::isValid(
     return false;
   }
 
-  ObjectPtr anObject = anEndPointRef->object();
   ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
   if(aResult.get()) {
     GeomShapePtr aShape = aResult->shape();
@@ -1333,10 +1334,6 @@ bool SketchPlugin_ArcEndPointIntersectionValidator::isValid(
     return true;
   }
 
-  if(!anEndPointRef->isInitialized()) {
-    return true;
-  }
-
   GeomShapePtr anArcShape = anArcFeature->getArcShape();
 
   if(!anArcShape.get() || anArcShape->isNull()) {
@@ -1344,6 +1341,11 @@ bool SketchPlugin_ArcEndPointIntersectionValidator::isValid(
   }
 
   ObjectPtr anObject = anEndPointRef->object();
+  AttributePtr anAttr = anEndPointRef->attr();
+  if(!anObject.get() && !anAttr.get()) {
+    return true;
+  }
+
   ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
   if(aResult.get()) {
     GeomShapePtr aShape = aResult->shape();