<source>
<doublevalue id="x" label="X:" max="50" step="1.0" default="0" icon=":pictures/x_point.png" tooltip="Set X">
- <validator id="between" parameters="a,b"/>
+ <!-- validator id="between" parameters="a,b"/ -->
</doublevalue>
<doublevalue id="y" label="Y:" min="x" default="1" icon=":pictures/y_point.png" tooltip="Set Y"/>
<doublevalue id="z" label="Z:" min="-20" step="0.1" default="2" icon=":pictures/z_point.png" tooltip="Set Z"/>
if (isModified)
aName->Set(theName.c_str());
}
- if (isModified) {
+ // to do not cause the update of the result on name change
+ /*if (isModified) {
static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent, false);
- }
+ }*/
}
void Model_Data::addAttribute(string theID, string theAttrType)
void Model_Data::sendAttributeUpdated(ModelAPI_Attribute* theAttr)
{
theAttr->setInitialized();
- static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
- ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);
+ if (theAttr->isArgument()) {
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
+ ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent);
+ }
}
boost::shared_ptr<ModelAPI_Object> myObject;
protected: // accessible from the attributes
bool myIsInitialized;
+ bool myIsArgument;
public:
/// Returns the type of this class of attributes, not static method
/// Makes attribute initialized
MODELAPI_EXPORT void setInitialized() {myIsInitialized = true;}
+ /// Set this attribute is argument for result (change of this attribute requires update of result).
+ /// By default it is true.
+ MODELAPI_EXPORT void setIsArgument(const bool theFlag) {myIsArgument = theFlag;}
+
+ /// Returns true if attribute causes the result change
+ MODELAPI_EXPORT bool isArgument() {return myIsArgument;}
+
protected:
/// Objects are created for features automatically
- ModelAPI_Attribute() {myIsInitialized = false;}
+ ModelAPI_Attribute() {myIsInitialized = false; myIsArgument = true;}
};