]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #278 Threat "Action" features as valid, even if it has no data.
authorsbh <sergey.belash@opencascade.com>
Thu, 27 Nov 2014 11:10:19 +0000 (14:10 +0300)
committersbh <sergey.belash@opencascade.com>
Thu, 27 Nov 2014 11:10:19 +0000 (14:10 +0300)
src/Model/Model_FeatureValidator.cpp
src/Model/Model_Validator.cpp

index 2bbad12d176b27e3f24b3067235b69657732e48a..9f3ab4a1305e9dd08e70a551a58eb4c160c10eb4 100644 (file)
@@ -15,8 +15,10 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& th
   const std::list<std::string>& theArguments) const
 {
   std::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-  if (!aData)
-    return false;
+  // "Action" features has no data, but still valid. e.g "Remove Part"  
+  if (!aData) {
+    return theFeature->isAction();
+  }
   if (!aData->isValid())
     return false;
   const std::string kAllTypes = "";
index 501b91b2f1072b47e1775a12cb0d331606c8b6c1..d8967d0e69d2bfa180c7a10b77ccf4766bb6a41b 100644 (file)
@@ -175,10 +175,12 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr<ModelAPI_Feature>&
         return false;
     }
   }
+  
   // check all attributes for validity
   std::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-  if (!aData || !aData->isValid())
-    return false;
+  // Validity of data is checked by "Model_FeatureValidator" (kDefaultId)
+  // if (!aData || !aData->isValid())
+  //   return false;
   static const std::string kAllTypes = "";
   std::map<std::string, std::map<std::string, AttrValidators> >::const_iterator aFeatureIter = 
     myAttrs.find(theFeature->getKind());