Commit 65cc4f5f authored by Hossain Mahmud's avatar Hossain Mahmud
Browse files

property explorer updates correctly if raycaster is changed

Conflicts:
	modules/vis/processors/volumerenderer.cpp
	modules/vis/processors/volumerenderer.h
parent e3cb6c9c
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "core/classification/simpletransferfunction.h" #include "core/classification/simpletransferfunction.h"
#include "../../raycasterfactory.h" #include "../../raycasterfactory.h"
#include "cgt/opengljobprocessor.h"
namespace campvis { namespace campvis {
const std::string VolumeRenderer::loggerCat_ = "CAMPVis.modules.vis.VolumeRenderer"; const std::string VolumeRenderer::loggerCat_ = "CAMPVis.modules.vis.VolumeRenderer";
...@@ -203,22 +204,26 @@ namespace campvis { ...@@ -203,22 +204,26 @@ namespace campvis {
_orientationOverlay.p_passThroughImageId.setValue(p_outputImage.getValue() + ".raycasted"); _orientationOverlay.p_passThroughImageId.setValue(p_outputImage.getValue() + ".raycasted");
} }
if (prop == &p_raycastingProcSelector) { if (prop == &p_raycastingProcSelector) {
RaycastingProcessor *currentRaycaster = _raycaster;
// Change to previous raycaster if "Select Processor" is selected // Change to previous raycaster if "Select Processor" is selected
if (p_raycastingProcSelector.getOptionId() == p_raycastingProcSelector.getOptions()[0]._id) { if (p_raycastingProcSelector.getOptionId() == p_raycastingProcSelector.getOptions()[0]._id) {
p_raycastingProcSelector.selectById(_raycaster->getName()); p_raycastingProcSelector.selectById(currentRaycaster->getName());
return; return;
} }
if (p_raycastingProcSelector.getOptionId() == _raycaster->getName()) { if (p_raycastingProcSelector.getOptionId() == currentRaycaster->getName()) {
return; return;
} }
RaycastingProcessor *currentRaycaster = _raycaster; p_lqMode.removeSharedProperty(&currentRaycaster->p_lqMode);
removeProperty(p_raycasterProps); p_inputVolume.removeSharedProperty(&currentRaycaster->p_sourceImageID);
//p_raycasterProps.deinitAllProperties(); p_camera.removeSharedProperty(&currentRaycaster->p_camera);
p_outputImage.removeSharedProperty(&currentRaycaster->p_targetImageID);
p_raycasterProps.clearProperties(); p_raycasterProps.clearProperties();
p_raycasterProps.deinitAllProperties();
removeProperty(p_raycasterProps);
currentRaycaster->s_invalidated.disconnect(this);
_raycaster = RaycasterFactory::getRef().createRaycaster(p_raycastingProcSelector.getOptionId(), p_viewportSizeProp); _raycaster = RaycasterFactory::getRef().createRaycaster(p_raycastingProcSelector.getOptionId(), p_viewportSizeProp);
p_raycasterProps.addPropertyCollection(*_raycaster); p_raycasterProps.addPropertyCollection(*_raycaster);
//_raycaster->p_lqMode.setVisible(false); //_raycaster->p_lqMode.setVisible(false);
//_raycaster->p_camera.setVisible(false); //_raycaster->p_camera.setVisible(false);
...@@ -226,9 +231,16 @@ namespace campvis { ...@@ -226,9 +231,16 @@ namespace campvis {
//_raycaster->p_entryImageID.setVisible(false); //_raycaster->p_entryImageID.setVisible(false);
//_raycaster->p_exitImageID.setVisible(false); //_raycaster->p_exitImageID.setVisible(false);
//_raycaster->p_targetImageID.setVisible(false); //_raycaster->p_targetImageID.setVisible(false);
addProperty(p_raycasterProps, AbstractProcessor::VALID); addProperty(p_raycasterProps, AbstractProcessor::VALID);
p_lqMode.addSharedProperty(&_raycaster->p_lqMode);
p_inputVolume.addSharedProperty(&_raycaster->p_sourceImageID);
p_camera.addSharedProperty(&_raycaster->p_camera);
p_outputImage.addSharedProperty(&_raycaster->p_targetImageID);
_raycaster->s_invalidated.connect(this, &VolumeRenderer::onProcessorInvalidated);
cgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
currentRaycaster->deinit();
delete currentRaycaster; delete currentRaycaster;
invalidate(RAYCASTER_INVALID); invalidate(RAYCASTER_INVALID);
} }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#ifndef VOLUMERENDERER_H__ #ifndef VOLUMERENDERER_H__
#define VOLUMERENDERER_H__ #define VOLUMERENDERER_H__
#include "sigslot/sigslot.h"
#include "core/pipeline/visualizationprocessor.h" #include "core/pipeline/visualizationprocessor.h"
#include "core/pipeline/raycastingprocessor.h" #include "core/pipeline/raycastingprocessor.h"
#include "core/properties/allproperties.h" #include "core/properties/allproperties.h"
...@@ -106,6 +107,8 @@ namespace campvis { ...@@ -106,6 +107,8 @@ namespace campvis {
MetaProperty p_eepProps; ///< MetaProperty for properties of the EEPGenerator processor MetaProperty p_eepProps; ///< MetaProperty for properties of the EEPGenerator processor
MetaProperty p_raycasterProps; ///< MetaProperty for properties of the raycasting processor MetaProperty p_raycasterProps; ///< MetaProperty for properties of the raycasting processor
MetaProperty p_orientationOverlayProps; ///< MetaProperty for properties of the OrientationOverlay processor MetaProperty p_orientationOverlayProps; ///< MetaProperty for properties of the OrientationOverlay processor
sigslot::signal2<RaycastingProcessor*, RaycastingProcessor*> s_raycasterChanged; ///< Signal emited when the raycaster is changed
protected: protected:
/// \see AbstractProcessor::updateResult /// \see AbstractProcessor::updateResult
......
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