Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

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

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

work on #135: changed VisualizationProcessor::_renderTargetSize to pointer and...

work on #135: changed VisualizationProcessor::_renderTargetSize to pointer and introducing VisualizationProcessor::setViewportSizeProperty()
parent 31d6af0f
......@@ -70,8 +70,8 @@ int main(int argc, char** argv) {
//app.addVisualizationPipeline("Confidence Map Generation", new CmBatchGeneration());
// app.addVisualizationPipeline("IXPV", new IxpvDemo());
//app.addVisualizationPipeline("SliceVis", new SliceVis());
//app.addVisualizationPipeline("DVRVis", new DVRVis());
app.addVisualizationPipeline("VolumeRendererDemo", new VolumeRendererDemo());
app.addVisualizationPipeline("DVRVis", new DVRVis());
//app.addVisualizationPipeline("VolumeRendererDemo", new VolumeRendererDemo());
app.addVisualizationPipeline("VolumeExplorerDemo", new VolumeExplorerDemo());
#ifdef HAS_KISSCL
//app.addVisualizationPipeline("DVR with OpenCL", new OpenCLPipeline());
......
......@@ -41,8 +41,8 @@
namespace campvis {
const std::string RaycastingProcessor::loggerCat_ = "CAMPVis.modules.vis.RaycastingProcessor";
RaycastingProcessor::RaycastingProcessor(IVec2Property& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures)
: VisualizationProcessor(renderTargetSize)
RaycastingProcessor::RaycastingProcessor(IVec2Property* viewportSizeProp, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures)
: VisualizationProcessor(viewportSizeProp)
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_entryImageID("entryImageID", "Input Entry Points Image", "", DataNameProperty::READ)
, p_exitImageID("exitImageID", "Input Exit Points Image", "", DataNameProperty::READ)
......@@ -106,7 +106,7 @@ namespace campvis {
_shader->setIgnoreUniformLocationError(true);
decorateRenderProlog(data, _shader);
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_renderTargetSize.getValue()));
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_viewportSizeProperty->getValue()));
_shader->setUniform("_jitterEntryPoints", p_jitterEntryPoints.getValue());
_shader->setUniform("_jitterStepSizeMultiplier", p_jitterStepSizeMultiplier.getValue());
......
......@@ -64,11 +64,11 @@ namespace campvis {
* \note The render target size property of this RaycastingProcessor will automatically
* be assigned as shared property of the given \a renderTargetSize property.
* \see VisualizationProcessor
* \param renderTargetSize Reference to the parent pipeline's render target size property.
* \param viewportSizeProp Pointer to the parent pipeline's render target size property.
* \param fragmentShaderFileName Filename for the fragment shader being automatically loaded.
* \param bindEntryExitDepthTextures Flag whether to also bind the depth textures of the entry-/exit points.
*/
RaycastingProcessor(IVec2Property& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures);
RaycastingProcessor(IVec2Property* viewportSizeProp, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures);
/**
* Destructor
......
......@@ -38,25 +38,26 @@ namespace campvis {
// ================================================================================================
VisualizationProcessor::VisualizationProcessor(IVec2Property& renderTargetSize)
VisualizationProcessor::VisualizationProcessor(IVec2Property* viewportSizeProp)
: AbstractProcessor()
, _fbo(0)
, _renderTargetSize("renderTargetSize", "Canvas Size", renderTargetSize.getValue(), renderTargetSize.getMinValue(), renderTargetSize.getMaxValue())
, _viewportSizeProperty(viewportSizeProp)
{
renderTargetSize.addSharedProperty(&_renderTargetSize);
_renderTargetSize.s_changed.connect<VisualizationProcessor>(this, &VisualizationProcessor::onPropertyChanged);
tgtAssert(_viewportSizeProperty != 0, "Pointer must not be 0!");
}
VisualizationProcessor::~VisualizationProcessor() {
}
void VisualizationProcessor::init() {
AbstractProcessor::init();
_fbo = new tgt::FramebufferObject();
_viewportSizeProperty->s_changed.connect<VisualizationProcessor>(this, &VisualizationProcessor::onPropertyChanged);
}
void VisualizationProcessor::deinit() {
_viewportSizeProperty->s_changed.disconnect(this);
_fbo->detachAll();
delete _fbo;
AbstractProcessor::deinit();
......@@ -152,7 +153,7 @@ namespace campvis {
}
tgt::ivec3 VisualizationProcessor::getRenderTargetSize() const {
return tgt::ivec3(_renderTargetSize.getValue(), 1);
return tgt::ivec3(_viewportSizeProperty->getValue(), 1);
}
void VisualizationProcessor::createAndAttachColorTexture() {
......@@ -163,4 +164,12 @@ namespace campvis {
createAndAttachTexture(GL_DEPTH_COMPONENT24);
}
void VisualizationProcessor::setViewportSizeProperty(IVec2Property* viewportSizeProp) {
tgtAssert(viewportSizeProp != 0, "Pointer must not be 0.");
_viewportSizeProperty->s_changed.disconnect(this);
_viewportSizeProperty = viewportSizeProp;
_viewportSizeProperty->s_changed.connect<VisualizationProcessor>(this, &VisualizationProcessor::onPropertyChanged);
}
}
......@@ -64,7 +64,7 @@ namespace campvis {
tgtAssert(_fbo != 0, "FBO must not be 0.");
_fbo->activate();
const tgt::ivec2& windowSize = vp->_renderTargetSize.getValue();
const tgt::ivec2& windowSize = vp->_viewportSizeProperty->getValue();
glViewport(0, 0, static_cast<GLsizei>(windowSize.x), static_cast<GLsizei>(windowSize.y));
}
......@@ -81,11 +81,16 @@ namespace campvis {
/**
* Creates a VisualizationProcessor.
*
* \note The render target size property of this VisualizationProcessor will automatically
* be assigned as shared property of the given \a renderTargetSize property.
* \param renderTargetSize Reference to the parent pipeline's render target size property.
* \note This processor will keep and access \a renderTargetSize, so make sure the referenced
* property exists at least as long as this processor or you set it to a different
* property before using setViewportSizeProperty().
*
* \param viewportSizeProp Pointer to the property defining the viewport size, must not be 0.
*/
VisualizationProcessor(IVec2Property& renderTargetSize);
VisualizationProcessor(IVec2Property* viewportSizeProp);
/**
* Virtual Destructor
......@@ -100,6 +105,17 @@ namespace campvis {
virtual void deinit();
/**
* Sets the property defining the viewport size to \a viewportSizeProp.
* \note This processor will keep and access this pointer, so make sure the referenced
* property exists at least as long as this processor or you set it to a different
* property before.
* \param viewportSizeProp Pointer to the property defining the viewport size, must not be 0.
*/
virtual void setViewportSizeProperty(IVec2Property* viewportSizeProp);
protected:
/**
* Creates a texture with the given format and attaches it to the FBO to \a attachment.
* \param internalFormat Internal OpenGL texture format
......@@ -127,12 +143,15 @@ namespace campvis {
*/
void createAndAttachDepthTexture();
// protected:
/**
* Returns the current viewport size as ivec3.
* \return tgt::ivec3(_viewportSizeProperty->getValue(), 1)
*/
tgt::ivec3 getRenderTargetSize() const;
tgt::FramebufferObject* _fbo;
IVec2Property _renderTargetSize; ///< Viewport size of target canvas
tgt::FramebufferObject* _fbo; ///< The FBO used by this VisualizationProcessor
IVec2Property* _viewportSizeProperty; ///< Pointer to the property defining the viewport size.
static const std::string loggerCat_;
};
......
......@@ -46,16 +46,16 @@ namespace campvis {
, _confidenceGenerator()
, _gvg()
, _lhh()
, _usFusion1(_effectiveRenderTargetSize)
, _usFusion2(_effectiveRenderTargetSize)
, _usFusion3(_effectiveRenderTargetSize)
, _usFusion4(_effectiveRenderTargetSize)
, _usFusion1(&_effectiveRenderTargetSize)
, _usFusion2(&_effectiveRenderTargetSize)
, _usFusion3(&_effectiveRenderTargetSize)
, _usFusion4(&_effectiveRenderTargetSize)
, _usBlurFilter()
, _quadView(_effectiveRenderTargetSize)
, _quadView(&_effectiveRenderTargetSize)
, _usDenoiseilter()
, _usProxy()
, _usEEP(_effectiveRenderTargetSize)
, _usDVR(_effectiveRenderTargetSize)
, _usEEP(&_effectiveRenderTargetSize)
, _usDVR(&_effectiveRenderTargetSize)
, _wheelHandler(&_usFusion1.p_sliceNumber)
, _tfWindowingHandler(&_usFusion1.p_transferFunction)
, _trackballEH(0)
......
......@@ -52,10 +52,10 @@ namespace campvis {
CmBatchGeneration::CmBatchGeneration()
: VisualizationPipeline()
, _usReader(_effectiveRenderTargetSize)
, _usReader(&_effectiveRenderTargetSize)
, _confidenceGenerator()
, _usBlurFilter()
, _usFusion(_effectiveRenderTargetSize)
, _usFusion(&_effectiveRenderTargetSize)
, p_autoExecution("AutoExecution", "Automatic Execution", false)
, p_sourcePath("SourcePath", "Source Files Path", "")
, p_targetPathColor("TargetPathColor", "Target Path Color Files", "")
......
......@@ -61,8 +61,8 @@ namespace campvis {
GenericOption<std::string>("pixelate", "Pixelate (Experimental)")
};
AdvancedUsFusion::AdvancedUsFusion(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
AdvancedUsFusion::AdvancedUsFusion(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_usImageId("UsImageId", "Ultrasound Input Image", "", DataNameProperty::READ)
, p_blurredImageId("BlurredImageId", "Blurred Ultrasound Image", "", DataNameProperty::READ)
, p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ)
......
......@@ -55,7 +55,7 @@ namespace campvis {
/**
* Constructs a new AdvancedUsFusion Processor
**/
AdvancedUsFusion(IVec2Property& canvasSize);
AdvancedUsFusion(IVec2Property* viewportSizeProp);
/**
* Destructor
......
......@@ -46,13 +46,13 @@ namespace campvis {
, _imageReader()
, _flowReader()
, _vtkReader()
, _vr(_effectiveRenderTargetSize)
, _sr(_effectiveRenderTargetSize)
, _src(_effectiveRenderTargetSize)
, _gr(_effectiveRenderTargetSize)
, _vr(&_effectiveRenderTargetSize)
, _sr(&_effectiveRenderTargetSize)
, _src(&_effectiveRenderTargetSize)
, _gr(&_effectiveRenderTargetSize)
, _sft()
, _sfr(_effectiveRenderTargetSize)
, _compositor(_effectiveRenderTargetSize)
, _sfr(&_effectiveRenderTargetSize)
, _compositor(&_effectiveRenderTargetSize)
, _trackballEH(0)
{
addProperty(&_camera);
......
......@@ -43,8 +43,8 @@
namespace campvis {
const std::string GeometryStrainRenderer::loggerCat_ = "CAMPVis.modules.vis.GeometryStrainRenderer";
GeometryStrainRenderer::GeometryStrainRenderer(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
GeometryStrainRenderer::GeometryStrainRenderer(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_geometryID("geometryID", "Input Geometry ID", "gr.geometry", DataNameProperty::READ)
, p_strainId("StrainDataId", "Input Strain Data ID", "gr.strain", DataNameProperty::READ)
, p_renderTargetID("p_renderTargetID", "Output Image", "gr.output", DataNameProperty::WRITE)
......
......@@ -52,7 +52,7 @@ namespace campvis {
/**
* Constructs a new GeometryStrainRenderer Processor
**/
GeometryStrainRenderer(IVec2Property& canvasSize);
GeometryStrainRenderer(IVec2Property* viewportSizeProp);
/**
* Destructor
......
......@@ -49,8 +49,8 @@ namespace campvis {
const std::string StrainFiberRenderer::loggerCat_ = "CAMPVis.modules.vis.StrainFiberRenderer";
StrainFiberRenderer::StrainFiberRenderer(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
StrainFiberRenderer::StrainFiberRenderer(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_strainId("StrainDataId", "Input Strain Data ID", "gr.strain", DataNameProperty::READ)
, p_renderTargetID("p_renderTargetID", "Output Image", "gr.output", DataNameProperty::WRITE)
, p_camera("Camera", "Camera ID")//, "camera", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT, DataNameProperty::CameraData)
......
......@@ -59,7 +59,7 @@ namespace campvis {
/**
* Constructs a new StrainFiberRenderer Processor
**/
StrainFiberRenderer(IVec2Property& canvasSize);
StrainFiberRenderer(IVec2Property* viewportSizeProp);
/**
* Destructor
......
......@@ -36,8 +36,8 @@
namespace campvis {
const std::string StrainRaycaster::loggerCat_ = "CAMPVis.modules.vis.StrainRaycaster";
StrainRaycaster::StrainRaycaster(IVec2Property& canvasSize)
: RaycastingProcessor(canvasSize, "modules/columbia/glsl/strainraycaster.frag", true)
StrainRaycaster::StrainRaycaster(IVec2Property* viewportSizeProp)
: RaycastingProcessor(viewportSizeProp, "modules/columbia/glsl/strainraycaster.frag", true)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_enableShadowing("EnableShadowing", "Enable Hard Shadows", false, AbstractProcessor::INVALID_SHADER)
, p_shadowIntensity("ShadowIntensity", "Shadow Intensity", .5f, .0f, 1.f)
......
......@@ -50,7 +50,7 @@ namespace campvis {
/**
* Constructs a new StrainRaycaster Processor
**/
StrainRaycaster(IVec2Property& canvasSize);
StrainRaycaster(IVec2Property* viewportSizeProp);
/**
* Destructor
......
......@@ -56,8 +56,8 @@ namespace campvis {
GenericOption<std::string>("localIntensity", "Local Intensity Image")
};
DevilImageReader::DevilImageReader(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
DevilImageReader::DevilImageReader(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, p_url("url", "Image URL", "")
, p_targetImageID("targetImageName", "Target Image ID", "DevilImageReader.output", DataNameProperty::WRITE)
, p_importType("ImportType", "Import Type", importOptions, 3)
......@@ -99,8 +99,8 @@ namespace campvis {
_shader->activate();
_shader->setIgnoreUniformLocationError(true);
_shader->setUniform("_viewportSize", _renderTargetSize.getValue());
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_renderTargetSize.getValue()));
_shader->setUniform("_viewportSize", _viewportSizeProperty->getValue());
_shader->setUniform("_viewportSizeRCP", 1.f / tgt::vec2(_viewportSizeProperty->getValue()));
_shader->setIgnoreUniformLocationError(false);
tgt::TextureUnit texUnit;
......
......@@ -54,7 +54,7 @@ namespace campvis {
/**
* Constructs a new DevilImageReader Processor
**/
DevilImageReader(IVec2Property& canvasSize);
DevilImageReader(IVec2Property* viewportSizeProp);
/**
* Destructor
......
......@@ -45,8 +45,8 @@ namespace campvis {
, _camera("camera", "Camera")
, _imageReader()
, _pgGenerator()
, _eepGenerator(_effectiveRenderTargetSize)
, _clRaycaster(_effectiveRenderTargetSize)
, _eepGenerator(&_effectiveRenderTargetSize)
, _clRaycaster(&_effectiveRenderTargetSize)
, _trackballEH(0)
{
addProperty(&_camera);
......
......@@ -50,8 +50,8 @@
namespace campvis {
const std::string CLRaycaster::loggerCat_ = "CAMPVis.modules.vis.CLRaycaster";
CLRaycaster::CLRaycaster(IVec2Property& renderTargetSize)
: VisualizationProcessor(renderTargetSize)
CLRaycaster::CLRaycaster(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp)
, _sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, _entryImageID("entryImageID", "Output Entry Points Image", "", DataNameProperty::READ)
, _exitImageID("exitImageID", "Output Exit Points Image", "", DataNameProperty::READ)
......
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