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

Added virtual AbstractPipeline::paint(), which is called by CampvisPainter at...

Added virtual AbstractPipeline::paint(), which is called by CampvisPainter at the very end of rendering. This method can be used to render additional overlays directly in the pipeline.
parent 6cf92ae4
......@@ -74,7 +74,8 @@ namespace campvis {
const ImageRepresentationGL* repGL = nullptr;
if (dh.getData() != nullptr) {
rd = dynamic_cast<const RenderData*>(dh.getData());
repGL = dynamic_cast<const ImageRepresentationGL*>(dh.getData());
if (const ImageData* id = dynamic_cast<const ImageData*>(dh.getData()))
repGL = id->getRepresentation<ImageRepresentationGL>();
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
......@@ -119,6 +120,8 @@ namespace campvis {
_copyShader->deactivate();
LGL_ERROR;
_pipeline->paint();
getCanvas()->swap();
}
......
......@@ -145,6 +145,10 @@ namespace campvis {
}
}
void AbstractPipeline::paint() {
// render nothing. May be overridden in sub classes.
}
const DataContainer& AbstractPipeline::getDataContainer() const {
return *_data;
}
......@@ -293,6 +297,5 @@ namespace campvis {
processor->setEnabled(enabledState);
}
}
......@@ -127,6 +127,13 @@ namespace campvis {
*/
virtual void executePipeline() = 0;
/**
* Paints an additional overlay directly onto the frame buffer.
* Gets called from CampvisPainter just after copying the rendered image and just before
* swapping the canvas' buffers. The default implementation performs nothing.
*/
virtual void paint();
/**
* Returns the DataContainer of this pipeline, const version.
* \return _data
......
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