]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Optimization of working with parameters
authormpv <mpv@opencascade.com>
Mon, 25 May 2015 08:44:03 +0000 (11:44 +0300)
committermpv <mpv@opencascade.com>
Mon, 25 May 2015 08:44:03 +0000 (11:44 +0300)
src/Model/Model_AttributeDouble.cpp
src/Model/Model_Update.cpp

index 86cbc9e14bfbe5e7083d86a5f1a9b8b8ab5e70e0..29ca7be4e70d4b9bfcc6dae4a98dd792b91be369 100644 (file)
@@ -44,7 +44,7 @@ void Model_AttributeDouble::setText(const std::string& theValue)
   TCollection_ExtendedString aValue(theValue.c_str());
   if (myText->Get() != aValue) {
     myText->Set(aValue);
-    //owner()->data()->sendAttributeUpdated(this); ?
+    owner()->data()->sendAttributeUpdated(this);
   }
 }
 
index 50d73e311f387c2eb1397214d80b95df2aca868a..8eae85c9308a51cfbe38bdd10527573f685482e8 100644 (file)
@@ -197,6 +197,7 @@ void Model_Update::updateInDoc(std::shared_ptr<ModelAPI_Document> theDoc)
         // number of subs can be changed in execution: like fillet
         for(int a = 0; a < aComposite->numberOfSubs(); a++) {
           FeaturePtr aSub = aComposite->subFeature(a);
+          updateArguments(aSub);
           updateFeature(aSub);
           alreadyProcessed.insert(aSub);
         }
@@ -257,7 +258,10 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
 
   bool aJustUpdated = false;
   ModelAPI_ExecState aState = theFeature->data()->execState();
+  if (aState == ModelAPI_StateInvalidArgument) // a chance to be corrected
+    aState = ModelAPI_StateMustBeUpdated;
   // check the parameters: values can be changed
+  /* parameters evaluator now does this
   std::list<AttributePtr> aDoubles = 
     theFeature->data()->attributes(ModelAPI_AttributeDouble::typeId()); 
   std::list<AttributePtr>::iterator aDoubleIter = aDoubles.begin();
@@ -276,6 +280,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
       }
     }
   }
+  */
 
   //if (aState == ModelAPI_StateDone) {// all referenced objects are ready to be used
     //std::cout<<"Execute feature "<<theFeature->getKind()<<std::endl;
@@ -333,7 +338,8 @@ void Model_Update::updateFeature(FeaturePtr theFeature)
   // check all features this feature depended on (recursive call of updateFeature)
   static ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
 
-  if (theFeature->isDisabled()) // nothing to do with disabled feature
+  if (theFeature->isDisabled() ||  // nothing to do with disabled feature
+      theFeature->data()->execState() == ModelAPI_StateInvalidArgument)
     return;
   bool aJustUpdated = false;