Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 78025428 authored by schultezub's avatar schultezub
Browse files

converted VisualizationPipeline::_canvasSize to property an let it change the Qt widget canvas size

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@470 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 695fdc4a
......@@ -43,7 +43,7 @@
namespace campvis {
const std::string RaycastingProcessor::loggerCat_ = "CAMPVis.modules.vis.RaycastingProcessor";
RaycastingProcessor::RaycastingProcessor(GenericProperty<tgt::ivec2>& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures)
RaycastingProcessor::RaycastingProcessor(IVec2Property& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures)
: VisualizationProcessor(renderTargetSize)
, p_sourceImageID("sourceImageID", "Input Image", "", DataNameProperty::READ)
, p_entryImageID("entryImageID", "Input Entry Points Image", "", DataNameProperty::READ)
......
......@@ -66,7 +66,7 @@ namespace campvis {
* \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(GenericProperty<tgt::ivec2>& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures);
RaycastingProcessor(IVec2Property& renderTargetSize, const std::string& fragmentShaderFileName, bool bindEntryExitDepthTextures);
/**
* Destructor
......
......@@ -44,12 +44,14 @@ namespace campvis {
: AbstractPipeline()
, tgt::EventListener()
, _lqMode(false)
, _effectiveRenderTargetSize("canvasSize", "Canvas Size", tgt::ivec2(128, 128))
, _canvasSize("CanvasSize", "Canvas Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096))
, _effectiveRenderTargetSize("EffectiveRenderTargetSize", "Render Target Size", tgt::ivec2(128, 128), tgt::ivec2(1, 1), tgt::ivec2(4096, 4096))
, _renderTargetID("renderTargetID", "Render Target ID", "VisualizationPipeline.renderTarget")
, _canvas(0)
{
_data.s_dataAdded.connect(this, &VisualizationPipeline::onDataContainerDataAdded);
addProperty(&_renderTargetID);
addProperty(&_canvasSize);
_renderTargetID.s_changed.connect<VisualizationPipeline>(this, &VisualizationPipeline::onPropertyChanged);
}
......@@ -79,11 +81,13 @@ namespace campvis {
}
const tgt::ivec2& VisualizationPipeline::getRenderTargetSize() const {
return _renderTargetSize;
return _canvasSize.getValue();
}
void VisualizationPipeline::setRenderTargetSize(const tgt::ivec2& size) {
_renderTargetSize = size;
if (_canvasSize.getValue() != size)
_canvasSize.setValue(size);
updateEffectiveRenderTargetSize();
}
......@@ -112,6 +116,10 @@ namespace campvis {
void VisualizationPipeline::onPropertyChanged(const AbstractProperty* prop) {
if (prop == &_renderTargetID)
s_renderTargetChanged();
else if (prop == &_canvasSize && _canvas != 0) {
if (_canvasSize.getValue() != _canvas->getSize())
_canvas->setSize(_canvasSize.getValue());
}
else
AbstractPipeline::onPropertyChanged(prop);
}
......@@ -133,9 +141,9 @@ namespace campvis {
void VisualizationPipeline::updateEffectiveRenderTargetSize() {
if (_lqMode)
_effectiveRenderTargetSize.setValue(_renderTargetSize / 2);
_effectiveRenderTargetSize.setValue(_canvasSize.getValue() / 2);
else
_effectiveRenderTargetSize.setValue(_renderTargetSize);
_effectiveRenderTargetSize.setValue(_canvasSize.getValue());
}
void VisualizationPipeline::onProcessorInvalidated(AbstractProcessor* processor) {
......
......@@ -36,7 +36,7 @@
#include "tgt/event/eventlistener.h"
#include "core/eventhandlers/abstracteventhandler.h"
#include "core/pipeline/abstractpipeline.h"
#include "core/properties/genericproperty.h"
#include "core/properties/numericproperty.h"
#include <vector>
......@@ -178,10 +178,10 @@ namespace campvis {
tbb::concurrent_hash_map<AbstractProcessor*, bool> _isVisProcessorMap;
tgt::ivec2 _renderTargetSize; ///< original render target size
IVec2Property _canvasSize; ///< original canvas size
bool _lqMode; ///< Flag whether low quality mode is enables
GenericProperty<tgt::ivec2> _effectiveRenderTargetSize; ///< actual size of the render targets (considering LQ mode)
IVec2Property _effectiveRenderTargetSize; ///< actual size of the render targets (considering LQ mode)
StringProperty _renderTargetID; ///< ID of the render target image to be rendered to the canvas
std::vector<AbstractEventHandler*> _eventHandlers; ///< List of registered event handlers for the pipeline
......
......@@ -31,11 +31,11 @@
namespace campvis {
VisualizationProcessor::VisualizationProcessor(GenericProperty<tgt::ivec2>& canvasSize)
VisualizationProcessor::VisualizationProcessor(IVec2Property& renderTargetSize)
: AbstractProcessor()
, _renderTargetSize("canvasSize", "Canvas Size", canvasSize.getValue())
, _renderTargetSize("renderTargetSize", "Canvas Size", renderTargetSize.getValue(), renderTargetSize.getMinValue(), renderTargetSize.getMaxValue())
{
canvasSize.addSharedProperty(&_renderTargetSize);
renderTargetSize.addSharedProperty(&_renderTargetSize);
_renderTargetSize.s_changed.connect<VisualizationProcessor>(this, &VisualizationProcessor::onPropertyChanged);
}
......
......@@ -32,7 +32,7 @@
#include "tgt/vector.h"
#include "core/pipeline/abstractprocessor.h"
#include "core/properties/genericproperty.h"
#include "core/properties/numericproperty.h"
namespace campvis {
......@@ -55,7 +55,7 @@ namespace campvis {
* be assigned as shared property of the given \a renderTargetSize property.
* \param renderTargetSize Reference to the parent pipeline's render target size property.
*/
VisualizationProcessor(GenericProperty<tgt::ivec2>& renderTargetSize);
VisualizationProcessor(IVec2Property& renderTargetSize);
/**
* Virtual Destructor
......@@ -64,7 +64,7 @@ namespace campvis {
protected:
GenericProperty<tgt::ivec2> _renderTargetSize; ///< Viewport size of target canvas
IVec2Property _renderTargetSize; ///< Viewport size of target canvas
};
}
......
......@@ -175,6 +175,8 @@ public:
/// Getter
ivec2 getSize() const;
virtual void setSize(ivec2 newSize) = 0;
/// Getter
int getWidth() const;
......
......@@ -571,4 +571,9 @@ KeyEvent::KeyCode QtCanvas::getKey(int key) {
}
}
void QtCanvas::setSize(ivec2 newSize) {
QWidget::resize(newSize.x, newSize.y);
}
} // namespace
......@@ -84,6 +84,8 @@ public:
*/
virtual void resizeGL(int w, int h);
virtual void setSize(ivec2 newSize);
/**
* Called by Qt if there is a paint event; it uses the \a painter_ to paint() something.
*/
......
......@@ -79,7 +79,7 @@ namespace campvis {
addEventHandler(&_wheelHandler);
//addEventHandler(&_tfWindowingHandler);
_trackballEH = new TrackballNavigationEventHandler(this, &_camera, _renderTargetSize);
_trackballEH = new TrackballNavigationEventHandler(this, &_camera, _canvasSize.getValue());
_eventHandlers.push_back(_trackballEH);
}
......@@ -239,7 +239,7 @@ namespace campvis {
}
void AdvancedUsVis::onRenderTargetSizeChanged(const AbstractProperty* prop) {
_trackballEH->setViewportSize(_renderTargetSize);
_trackballEH->setViewportSize(_canvasSize.getValue());
float ratio = static_cast<float>(_effectiveRenderTargetSize.getValue().x) / static_cast<float>(_effectiveRenderTargetSize.getValue().y);
_camera.setWindowRatio(ratio);
}
......
......@@ -57,7 +57,7 @@ namespace campvis {
GenericOption<std::string>("mappingSharpness", "Mapping Uncertainty to Sharpness")
};
AdvancedUsFusion::AdvancedUsFusion(GenericProperty<tgt::ivec2>& canvasSize)
AdvancedUsFusion::AdvancedUsFusion(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
, p_usImageId("UsImageId", "Ultrasound Input Image", "", DataNameProperty::READ)
, p_blurredImageId("BlurredImageId", "Blurred Ultrasound Image", "", DataNameProperty::READ)
......
......@@ -55,7 +55,7 @@ namespace campvis {
/**
* Constructs a new AdvancedUsFusion Processor
**/
AdvancedUsFusion(GenericProperty<tgt::ivec2>& canvasSize);
AdvancedUsFusion(IVec2Property& canvasSize);
/**
* Destructor
......
......@@ -48,7 +48,7 @@
namespace campvis {
const std::string DevilImageReader::loggerCat_ = "CAMPVis.modules.io.DevilImageReader";
DevilImageReader::DevilImageReader(GenericProperty<tgt::ivec2>& canvasSize)
DevilImageReader::DevilImageReader(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
, p_url("url", "Image URL", "")
, p_targetImageID("targetImageName", "Target Image ID", "DevilImageReader.output", DataNameProperty::WRITE)
......
......@@ -53,7 +53,7 @@ namespace campvis {
/**
* Constructs a new DevilImageReader Processor
**/
DevilImageReader(GenericProperty<tgt::ivec2>& canvasSize);
DevilImageReader(IVec2Property& canvasSize);
/**
* Destructor
......
......@@ -56,7 +56,7 @@ namespace campvis {
{
addProperty(&_camera);
_trackballEH = new TrackballNavigationEventHandler(this, &_camera, _renderTargetSize);
_trackballEH = new TrackballNavigationEventHandler(this, &_camera, _canvasSize.getValue());
_eventHandlers.push_back(_trackballEH);
addProcessor(&_imageReader);
......@@ -156,7 +156,7 @@ namespace campvis {
}
void DVRVis::onRenderTargetSizeChanged(const AbstractProperty* prop) {
_trackballEH->setViewportSize(_renderTargetSize);
_trackballEH->setViewportSize(_canvasSize.getValue());
float ratio = static_cast<float>(_effectiveRenderTargetSize.getValue().x) / static_cast<float>(_effectiveRenderTargetSize.getValue().y);
_camera.setWindowRatio(ratio);
}
......
......@@ -76,7 +76,7 @@ namespace campvis {
addProperty(&_camera);
_trackballHandler = new TrackballNavigationEventHandler(this, &_camera, _renderTargetSize);
_trackballHandler = new TrackballNavigationEventHandler(this, &_camera, _canvasSize.getValue());
addEventHandler(&_wheelHandler);
addEventHandler(_trackballHandler);
}
......@@ -185,7 +185,7 @@ namespace campvis {
_renderTargetID.setValue("ixpv");
_trackballHandler->setViewportSize(_renderTargetSize);
_trackballHandler->setViewportSize(_canvasSize.getValue());
}
const std::string IxpvDemo::getName() const {
......@@ -193,7 +193,7 @@ namespace campvis {
}
void IxpvDemo::onRenderTargetSizeChanged(const AbstractProperty* prop) {
_trackballHandler->setViewportSize(_renderTargetSize);
_trackballHandler->setViewportSize(_canvasSize.getValue());
float ratio = static_cast<float>(_effectiveRenderTargetSize.getValue().x) / static_cast<float>(_effectiveRenderTargetSize.getValue().y);
_camera.setWindowRatio(ratio);
}
......
......@@ -44,7 +44,7 @@
namespace campvis {
const std::string DepthDarkening::loggerCat_ = "CAMPVis.modules.vis.DepthDarkening";
DepthDarkening::DepthDarkening(GenericProperty<tgt::ivec2>& canvasSize)
DepthDarkening::DepthDarkening(IVec2Property& canvasSize)
: VisualizationProcessor(canvasSize)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Image", "dd.output", DataNameProperty::WRITE)
......
......@@ -51,7 +51,7 @@ namespace campvis {
/**
* Constructs a new DepthDarkening Processor
**/
DepthDarkening(GenericProperty<tgt::ivec2>& canvasSize);
DepthDarkening(IVec2Property& canvasSize);
/**
* Destructor
......
......@@ -35,7 +35,7 @@
namespace campvis {
const std::string DRRRaycaster::loggerCat_ = "CAMPVis.modules.vis.DRRRaycaster";
DRRRaycaster::DRRRaycaster(GenericProperty<tgt::ivec2>& canvasSize)
DRRRaycaster::DRRRaycaster(IVec2Property& canvasSize)
: RaycastingProcessor(canvasSize, "modules/vis/glsl/drrraycaster.frag", false)
, p_targetImageID("targetImageID", "Output Image", "", DataNameProperty::WRITE)
, p_shift("shift", "Normalization Shift", 0.f, -10.f, 10.f)
......
......@@ -52,7 +52,7 @@ namespace campvis {
/**
* Constructs a new DRRRaycaster Processor
**/
DRRRaycaster(GenericProperty<tgt::ivec2>& canvasSize);
DRRRaycaster(IVec2Property& canvasSize);
/**
* Destructor
......
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