Commit ed60f5cf authored by schultezub's avatar schultezub
Browse files

* Fixed VisualizationPipeline's viewport size not being updated

 * Fixed TrackballNavigationEventHandler's viewport size not being updated

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@255 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 4c017151
......@@ -119,4 +119,8 @@ namespace TUMVis {
_trackball->setCenter(center);
}
void TrackballNavigationEventHandler::setViewportSize(const tgt::ivec2& viewportSize) {
_trackball->setViewprtSize(viewportSize);
}
}
......@@ -36,6 +36,9 @@
namespace TUMVis {
class CameraProperty;
/**
* Wrapper to adapt a CameraProperty to the tgt::Trackball interface.
*/
class CamPropNavigationWrapper : public tgt::IHasCamera {
public:
CamPropNavigationWrapper(CameraProperty* camProp);
......@@ -84,8 +87,24 @@ namespace TUMVis {
*/
virtual void execute(tgt::Event* e);
/**
* Sets the viewport size to \a viewportSize.
* \param viewportSize The new viewport size.
*/
void setViewportSize(const tgt::ivec2& viewportSize);
/**
* Reinitalizes the camera by the given parameters.
* \param position New camera position
* \param focus New camera focus
* \param upVector New camera up vector
*/
void reinitializeCamera(const tgt::vec3& position, const tgt::vec3& focus, const tgt::vec3& upVector);
/**
* Sets the trackball's center.
* \param center The new trackball's center.
*/
void setCenter(const tgt::vec3& center);
protected:
......
......@@ -30,7 +30,7 @@
#include "tgt/event/keyevent.h"
#include "tgt/glcontext.h"
#include "tgt/qt/qtcontextmanager.h"
#include "tgt/qt/qtcontextmanager.h"
#include "core/datastructures/imagedataconverter.h"
namespace TUMVis {
......@@ -105,6 +105,9 @@ namespace TUMVis {
_drrraycater.s_invalidated.connect<DVRVis>(this, &DVRVis::onProcessorInvalidated);
_simpleRaycaster.s_invalidated.connect<DVRVis>(this, &DVRVis::onProcessorInvalidated);
_clRaycaster.s_invalidated.connect<DVRVis>(this, &DVRVis::onProcessorInvalidated);
_trackballEH->setViewportSize(_renderTargetSize.getValue());
_renderTargetSize.s_changed.connect<DVRVis>(this, &DVRVis::onRenderTargetSizeChanged);
}
void DVRVis::execute() {
......@@ -146,7 +149,7 @@ namespace TUMVis {
lockGLContextAndExecuteProcessor(&_simpleRaycaster);
}
if (! _eepGenerator.getInvalidationLevel().isValid() || !_clRaycaster.getInvalidationLevel().isValid()) {
lockGLContextAndExecuteProcessor(&_clRaycaster);
//lockGLContextAndExecuteProcessor(&_clRaycaster);
}
}
......@@ -154,4 +157,8 @@ namespace TUMVis {
return "DVRVis";
}
void DVRVis::onRenderTargetSizeChanged(const AbstractProperty* prop) {
_trackballEH->setViewportSize(_renderTargetSize.getValue());
}
}
\ No newline at end of file
......@@ -63,6 +63,8 @@ namespace TUMVis {
**/
virtual void execute();
void onRenderTargetSizeChanged(const AbstractProperty* prop);
protected:
CameraProperty _camera;
MhdImageReader _imageReader;
......
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