Salome HOME
Right reset of the selection attribute: to be tested on all cases
[modules/shaper.git] / src / Model / Model_AttributeSelection.cpp
index af3b9cb9d854fe384b84ee2bbf6c0e41a80e0277..d2456c85e199fa4bb5f7838cf14d78549250d2a8 100644 (file)
@@ -273,6 +273,8 @@ GeomShapePtr centerByEdge(GeomShapePtr theEdge, ModelAPI_AttributeSelection::Cen
 
 std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::value()
 {
+  if (!ModelAPI_AttributeSelection::isInitialized() && !myTmpContext.get() && !myTmpSubShape.get())
+    return std::shared_ptr<GeomAPI_Shape>();
   CenterType aType = NOT_CENTER;
   std::shared_ptr<GeomAPI_Shape> aResult = internalValue(aType);
   return centerByEdge(aResult, aType);
@@ -407,6 +409,11 @@ void Model_AttributeSelection::setID(const std::string theID)
 }
 
 ResultPtr Model_AttributeSelection::context() {
+  /*
+  if (!ModelAPI_AttributeSelection::isInitialized() && !myTmpContext.get() && !myTmpSubShape.get())
+    return ResultPtr();
+  */
+
   if (myTmpContext.get() || myTmpSubShape.get()) {
     return myTmpContext;
   }