Add a new PropertyType enum Prop_NoRecompute to reduce possible inconsistencies between touched and recomputed features.
At the moment many feature classes lack of the mustExecute() method and thus can cause a touched feature not to be recomputed and causes the feature to be in a broken state. Now this new enum value virtually makes the mustExecute() superfluous and thus guarantees to recompute a feature if a modified property has not set the Prop_NoRecompute flag. On the other hand there are properties that should only touch a feature but not enforce a recompute. This guarantees a better performance and avoids unnecessary recomputes. For example this is useful for placements where a change can be applied on-the-fly and the feature is up-to-date. Other features that depend on the touched feature will still be recomputed.
This commit is contained in:
@@ -527,9 +527,13 @@ void DocumentObject::onChanged(const Property* prop)
|
||||
_pDoc->signalRelabelObject(*this);
|
||||
|
||||
// set object touched if it is an input property
|
||||
if (!(prop->getType() & Prop_Output))
|
||||
if (!(prop->getType() & Prop_Output)) {
|
||||
StatusBits.set(ObjectStatus::Touch);
|
||||
|
||||
// must execute on document recompute
|
||||
if (!(prop->getType() & Prop_NoRecompute))
|
||||
StatusBits.set(ObjectStatus::Enforce);
|
||||
}
|
||||
|
||||
//call the parent for appropriate handling
|
||||
TransactionalObject::onChanged(prop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user