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

Added onDataContainerDataAdded overload to AbstractPipeline to set pipeline...

Added onDataContainerDataAdded overload to AbstractPipeline to set pipeline dirty when the render target image has changed. Rendering of multiple canvases at the same time still broken though.

refs #641
parent fef9f926
......@@ -64,6 +64,8 @@ namespace campvis {
}
void AbstractPipeline::init() {
_data->s_dataAdded.connect(this, &AbstractPipeline::onDataContainerDataAdded);
initAllProperties();
// initialize all processors:
......@@ -81,6 +83,8 @@ namespace campvis {
}
void AbstractPipeline::deinit() {
_data->s_dataAdded.disconnect(this);
// use trigger signal to enforce blocking call
s_deinit.triggerSignal();
......@@ -276,6 +280,10 @@ namespace campvis {
return _processors[index];
}
void AbstractPipeline::onDataContainerDataAdded(std::string name, DataHandle dh) {
if (name == _renderTargetID.getValue())
setPipelineDirty();
}
void AbstractPipeline::forceExecuteProcessor(AbstractProcessor* processor) {
bool enabledState = processor->getEnabled();
......@@ -287,5 +295,4 @@ namespace campvis {
}
}
......@@ -231,6 +231,14 @@ namespace campvis {
*/
void executeProcessorAndCheckOpenGLState(AbstractProcessor* processor);
/**
* Gets called when the data collection of this pipeline has changed and thus has notified its observers.
* If \a name equals the name of the renderTarget, setPipelineDirty will be called.
* \param name Name of the added data.
* \param dh DataHandle to the newly added data.
*/
virtual void onDataContainerDataAdded(std::string name, DataHandle dh);
/**
* Slot getting called when one of the observed properties changed and notifies its observers.
* The default behaviour is just to set the invalidation level to invalid.
......
......@@ -44,12 +44,9 @@ namespace campvis {
void AutoEvaluationPipeline::init() {
AbstractPipeline::init();
_data->s_dataAdded.connect(this, &AutoEvaluationPipeline::onDataContainerDataAdded);
}
void AutoEvaluationPipeline::deinit() {
_data->s_dataAdded.disconnect(this);
for (std::vector<AbstractProcessor*>::iterator it = _processors.begin(); it != _processors.end(); ++it) {
(*it)->s_invalidated.disconnect(this);
}
......@@ -129,6 +126,8 @@ namespace campvis {
void AutoEvaluationPipeline::onDataContainerDataAdded(std::string name, DataHandle dh) {
{
AbstractPipeline::onDataContainerDataAdded(name, dh);
// acquire read lock
tbb::spin_rw_mutex::scoped_lock lock(_pmMutex, false);
......
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