2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit cbd8ddaa authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Introducing AbstractProcessor::forceProcess().

parent 151a2cf3
...@@ -155,6 +155,11 @@ namespace campvis { ...@@ -155,6 +155,11 @@ namespace campvis {
} }
} }
void AbstractProcessor::forceProcess(DataContainer& dataContainer, int invalidationLevel) {
invalidate(invalidationLevel);
process(dataContainer);
}
void AbstractProcessor::updateShader() { void AbstractProcessor::updateShader() {
LDEBUG("Called non-overriden updateShader() in " << getName() << ". Did you forget to override your method?"); LDEBUG("Called non-overriden updateShader() in " << getName() << ". Did you forget to override your method?");
} }
...@@ -163,11 +168,7 @@ namespace campvis { ...@@ -163,11 +168,7 @@ namespace campvis {
LDEBUG("Called non-overriden updateProperties() in " << getName() << ". Did you forget to override your method?"); LDEBUG("Called non-overriden updateProperties() in " << getName() << ". Did you forget to override your method?");
} }
void AbstractProcessor::addProperty(AbstractProperty& prop) { void AbstractProcessor::addProperty(AbstractProperty& prop, int invalidationLevel /* = INVALID_RESULT*/) {
this->addProperty(prop, INVALID_RESULT);
}
void AbstractProcessor::addProperty(AbstractProperty& prop, int invalidationLevel) {
HasPropertyCollection::addProperty(prop); HasPropertyCollection::addProperty(prop);
setPropertyInvalidationLevel(prop, invalidationLevel); setPropertyInvalidationLevel(prop, invalidationLevel);
} }
......
...@@ -149,13 +149,6 @@ namespace campvis { ...@@ -149,13 +149,6 @@ namespace campvis {
*/ */
virtual ProcessorState getProcessorState() const = 0; virtual ProcessorState getProcessorState() const = 0;
/**
* Registers \a prop as property with the default invalidation level of INVALID_RESULT.
* \see HasPropertyCollection::addProperty()
* \param prop Property to register
*/
virtual void addProperty(AbstractProperty& prop);
/** /**
* Registers \a prop as property with the provided invalidation level. Registered properties * Registers \a prop as property with the provided invalidation level. Registered properties
* can be accessed from the outside, e.g. via getProperty(), and will automatically invalidate * can be accessed from the outside, e.g. via getProperty(), and will automatically invalidate
...@@ -164,7 +157,7 @@ namespace campvis { ...@@ -164,7 +157,7 @@ namespace campvis {
* \param prop Property to add * \param prop Property to add
* \param invalidationLevel Invalidation level of this property * \param invalidationLevel Invalidation level of this property
*/ */
void addProperty(AbstractProperty& prop, int invalidationLevel); void addProperty(AbstractProperty& prop, int invalidationLevel = INVALID_RESULT);
/** /**
* Sets the property invalidation level to the specified value. * Sets the property invalidation level to the specified value.
...@@ -183,6 +176,16 @@ namespace campvis { ...@@ -183,6 +176,16 @@ namespace campvis {
**/ **/
void process(DataContainer& data); void process(DataContainer& data);
/**
* Forces the execution of this processor according to the given invalidation level and
* independent of its current invalidation level. Sets this processor's invalidation level
* to \a invalidationLevel and then calles process().
*
* \param dataContainer DataContainer to work on
* \param invalidationLevel Invalidation level to enforce prior to calling process.
*/
void forceProcess(DataContainer& dataContainer, int invalidationLevel);
/** /**
* Gets the flag whether this processor is currently enabled. * Gets the flag whether this processor is currently enabled.
* \return _enabled * \return _enabled
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment