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

Moved invalidation level from AbstractProperty to AbstractProcessor:

To now, each property hat an _invalidationLevel field that was evaluated by processors when the property had changed in order to determine what has to be done. However, since properties could also be owned by other classes, this design was semantically misleading.
Therefore, it was removed with this commit and replaced by the invalidation map of each processor. Now, this per-processor mapping of property -> invalidation level is managed by the processor itself. Furthermore, the invalidation level is no longer setup during property creation but during AbstractProcessor::addProperty(), which also makes much more sense.

ATTENTION: Due to these intrusive API changes, the code of all processors and other classes handling properties needs to be changed. As a reminder, the implementation of addProperty() also now takes a reference instead of a pointer, so that old code does no longer compile.

refs #542
parent 94a730da
...@@ -101,8 +101,8 @@ namespace campvis { ...@@ -101,8 +101,8 @@ namespace campvis {
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.05f, .8f)); Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.05f, .8f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 0), tgt::col4(255, 255, 255, 255))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 0), tgt::col4(255, 255, 255, 255)));
static_cast<TransferFunctionProperty*>(_ve.getProperty("TransferFunction"))->setAutoFitWindowToData(false); static_cast<TransferFunctionProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::TransferFunction"))->setAutoFitWindowToData(false);
static_cast<TransferFunctionProperty*>(_ve.getProperty("TransferFunction"))->replaceTF(dvrTF); static_cast<TransferFunctionProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::TransferFunction"))->replaceTF(dvrTF);
static_cast<FloatProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::GradientLod"))->setValue(0.5f); static_cast<FloatProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::GradientLod"))->setValue(0.5f);
static_cast<FloatProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::SamplingRate"))->setValue(1.f); static_cast<FloatProperty*>(_ve.getNestedProperty("VolumeRendererProperties::RaycasterProps::SamplingRate"))->setValue(1.f);
...@@ -147,7 +147,7 @@ namespace campvis { ...@@ -147,7 +147,7 @@ namespace campvis {
histogram->addPredicate(vpToAdd); histogram->addPredicate(vpToAdd);
histogram->resetPredicates(); histogram->resetPredicates();
addProperty(php); addProperty(*php);
} }
} }
......
...@@ -58,7 +58,7 @@ namespace campvis { ...@@ -58,7 +58,7 @@ namespace campvis {
AdvancedUsFusion::AdvancedUsFusion(IVec2Property* viewportSizeProp) AdvancedUsFusion::AdvancedUsFusion(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp) : VisualizationProcessor(viewportSizeProp)
, p_usImageId("UsImageId", "Ultrasound Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT) , p_usImageId("UsImageId", "Ultrasound Input Image", "", DataNameProperty::READ)
, p_blurredImageId("BlurredImageId", "Blurred Ultrasound Image", "", DataNameProperty::READ) , p_blurredImageId("BlurredImageId", "Blurred Ultrasound Image", "", DataNameProperty::READ)
, p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ) , p_gradientImageID("GradientImageId", "Gradient Input Image", "", DataNameProperty::READ)
, p_confidenceImageID("ConfidenceImageId", "Confidence Map Input", "", DataNameProperty::READ) , p_confidenceImageID("ConfidenceImageId", "Confidence Map Input", "", DataNameProperty::READ)
...@@ -73,18 +73,18 @@ namespace campvis { ...@@ -73,18 +73,18 @@ namespace campvis {
, p_use3DTexture("Use3DTexture", "Use 3D Texture", false) , p_use3DTexture("Use3DTexture", "Use 3D Texture", false)
, _shader(0) , _shader(0)
{ {
addProperty(&p_usImageId); addProperty(p_usImageId, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(&p_blurredImageId); addProperty(p_blurredImageId);
addProperty(&p_gradientImageID); addProperty(p_gradientImageID);
addProperty(&p_confidenceImageID); addProperty(p_confidenceImageID);
addProperty(&p_blurredScaling); addProperty(p_blurredScaling);
addProperty(&p_targetImageID); addProperty(p_targetImageID);
addProperty(&p_sliceNumber); addProperty(p_sliceNumber);
addProperty(&p_transferFunction); addProperty(p_transferFunction);
addProperty(&p_confidenceTF); addProperty(p_confidenceTF);
addProperty(&p_view); addProperty(p_view);
addProperty(&p_confidenceScaling); addProperty(p_confidenceScaling);
addProperty(&p_hue); addProperty(p_hue);
Geometry1DTransferFunction* tf = static_cast<Geometry1DTransferFunction*>(p_confidenceTF.getTF()); Geometry1DTransferFunction* tf = static_cast<Geometry1DTransferFunction*>(p_confidenceTF.getTF());
tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 96), tgt::col4(0, 0, 0, 0))); tf->addGeometry(TFGeometry1D::createQuad(tgt::vec2(0.f, 1.f), tgt::col4(0, 0, 0, 96), tgt::col4(0, 0, 0, 0)));
......
...@@ -49,8 +49,8 @@ namespace campvis { ...@@ -49,8 +49,8 @@ namespace campvis {
PointPredicateEvaluator::PointPredicateEvaluator(IVec2Property* viewportSizeProp) PointPredicateEvaluator::PointPredicateEvaluator(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp) : VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT) , p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_inputLabels("InputLabels", "Input Label Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT) , p_inputLabels("InputLabels", "Input Label Image", "", DataNameProperty::READ)
, p_inputSnr("InputSnr", "Input SNR", "", DataNameProperty::READ) , p_inputSnr("InputSnr", "Input SNR", "", DataNameProperty::READ)
, p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ) , p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ)
, p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ) , p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ)
...@@ -59,15 +59,15 @@ namespace campvis { ...@@ -59,15 +59,15 @@ namespace campvis {
, p_histogram("PredicateHistogram", "Point Predicate Histogram") , p_histogram("PredicateHistogram", "Point Predicate Histogram")
, _shader(0) , _shader(0)
{ {
addProperty(&p_inputImage); addProperty(p_inputImage, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(&p_inputLabels); addProperty(p_inputLabels, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(&p_inputSnr); addProperty(p_inputSnr);
addProperty(&p_inputVesselness); addProperty(p_inputVesselness);
addProperty(&p_inputConfidence); addProperty(p_inputConfidence);
addProperty(&p_outputImage); addProperty(p_outputImage);
addProperty(&p_camera); addProperty(p_camera);
addProperty(&p_histogram); addProperty(p_histogram);
} }
PointPredicateEvaluator::~PointPredicateEvaluator() { PointPredicateEvaluator::~PointPredicateEvaluator() {
...@@ -137,7 +137,7 @@ namespace campvis { ...@@ -137,7 +137,7 @@ namespace campvis {
glViewport(0, 0, static_cast<GLsizei>(viewportSize.x), static_cast<GLsizei>(viewportSize.y)); glViewport(0, 0, static_cast<GLsizei>(viewportSize.x), static_cast<GLsizei>(viewportSize.y));
// render quad to compute difference measure by shader // render quad to compute difference measure by shader
for (int z = 0; z < size.z; ++z) { for (int z = 0; z < static_cast<int>(size.z); ++z) {
float zTexCoord = static_cast<float>(z)/static_cast<float>(size.z) + .5f/static_cast<float>(size.z); float zTexCoord = static_cast<float>(z)/static_cast<float>(size.z) + .5f/static_cast<float>(size.z);
_shader->setUniform("_zTexCoord", zTexCoord); _shader->setUniform("_zTexCoord", zTexCoord);
_fbo->attachTexture(resultTexture, GL_COLOR_ATTACHMENT0, 0, z); _fbo->attachTexture(resultTexture, GL_COLOR_ATTACHMENT0, 0, z);
......
...@@ -35,7 +35,7 @@ namespace campvis { ...@@ -35,7 +35,7 @@ namespace campvis {
PointPredicateRaycaster::PointPredicateRaycaster(IVec2Property* viewportSizeProp) PointPredicateRaycaster::PointPredicateRaycaster(IVec2Property* viewportSizeProp)
: RaycastingProcessor(viewportSizeProp, "modules/advancedusvis/glsl/pointpredicateraycaster.frag", true, "400") : RaycastingProcessor(viewportSizeProp, "modules/advancedusvis/glsl/pointpredicateraycaster.frag", true, "400")
, p_inputLabels("InputLabels", "Input Label Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT) , p_inputLabels("InputLabels", "Input Label Image", "", DataNameProperty::READ)
, p_inputSnr("InputSnr", "Input SNR", "", DataNameProperty::READ) , p_inputSnr("InputSnr", "Input SNR", "", DataNameProperty::READ)
, p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ) , p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ)
, p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ) , p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ)
...@@ -43,11 +43,11 @@ namespace campvis { ...@@ -43,11 +43,11 @@ namespace campvis {
{ {
addDecorator(new ProcessorDecoratorShading()); addDecorator(new ProcessorDecoratorShading());
addProperty(&p_inputLabels); addProperty(p_inputLabels, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(&p_inputSnr); addProperty(p_inputSnr);
addProperty(&p_inputVesselness); addProperty(p_inputVesselness);
addProperty(&p_inputConfidence); addProperty(p_inputConfidence);
addProperty(&p_predicateHistogram); addProperty(p_predicateHistogram);
decoratePropertyCollection(this); decoratePropertyCollection(this);
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// //
// ================================================================================================ // ================================================================================================
#include "PredicateVolumeExplorer.h" #include "predicatevolumeexplorer.h"
#include "tgt/logmanager.h" #include "tgt/logmanager.h"
#include "tgt/shadermanager.h" #include "tgt/shadermanager.h"
#include "tgt/textureunit.h" #include "tgt/textureunit.h"
...@@ -48,31 +48,31 @@ namespace campvis { ...@@ -48,31 +48,31 @@ namespace campvis {
, p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ) , p_inputVesselness("InputVesselness", "Input Vesselness", "", DataNameProperty::READ)
, p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ) , p_inputConfidence("InputConfidence", "Input Confidence", "", DataNameProperty::READ)
, p_histogram("PredicateHistogram", "Point Predicate Histogram") , p_histogram("PredicateHistogram", "Point Predicate Histogram")
, p_pbProperties("PredicateBitsetProperties", "Predicate Bitset Properties", VALID) , p_pbProperties("PredicateBitsetProperties", "Predicate Bitset Properties")
, _predicateEvaluation(_viewportSizeProperty) , _predicateEvaluation(_viewportSizeProperty)
, _bitmaskHandle(nullptr) , _bitmaskHandle(nullptr)
{ {
p_inputVolume.addSharedProperty(&_predicateEvaluation.p_inputImage); p_inputVolume.addSharedProperty(&_predicateEvaluation.p_inputImage);
addProperty(&p_inputLabels); addProperty(p_inputLabels);
p_inputLabels.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputLabels); p_inputLabels.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputLabels);
p_inputLabels.addSharedProperty(&_predicateEvaluation.p_inputLabels); p_inputLabels.addSharedProperty(&_predicateEvaluation.p_inputLabels);
addProperty(&p_inputSnr); addProperty(p_inputSnr);
p_inputSnr.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputSnr); p_inputSnr.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputSnr);
p_inputSnr.addSharedProperty(&_predicateEvaluation.p_inputSnr); p_inputSnr.addSharedProperty(&_predicateEvaluation.p_inputSnr);
addProperty(&p_inputVesselness); addProperty(p_inputVesselness);
p_inputVesselness.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputVesselness); p_inputVesselness.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputVesselness);
p_inputVesselness.addSharedProperty(&_predicateEvaluation.p_inputVesselness); p_inputVesselness.addSharedProperty(&_predicateEvaluation.p_inputVesselness);
addProperty(&p_inputConfidence); addProperty(p_inputConfidence);
p_inputConfidence.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputConfidence); p_inputConfidence.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor()))->p_inputConfidence);
p_inputConfidence.addSharedProperty(&_predicateEvaluation.p_inputConfidence); p_inputConfidence.addSharedProperty(&_predicateEvaluation.p_inputConfidence);
addProperty(&p_histogram); addProperty(p_histogram);
p_pbProperties.addPropertyCollection(_predicateEvaluation); p_pbProperties.addPropertyCollection(_predicateEvaluation);
addProperty(&p_pbProperties); addProperty(p_pbProperties, VALID);
p_histogram.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor())->p_predicateHistogram)); p_histogram.addSharedProperty(&(static_cast<PointPredicateRaycaster*>(_raycaster.getRaycastingProcessor())->p_predicateHistogram));
p_histogram.addSharedProperty(&_predicateEvaluation.p_histogram); p_histogram.addSharedProperty(&_predicateEvaluation.p_histogram);
......
...@@ -49,19 +49,19 @@ namespace campvis { ...@@ -49,19 +49,19 @@ namespace campvis {
ScanlineDistributionComputation::ScanlineDistributionComputation(IVec2Property* viewportSizeProp) ScanlineDistributionComputation::ScanlineDistributionComputation(IVec2Property* viewportSizeProp)
: VisualizationProcessor(viewportSizeProp) : VisualizationProcessor(viewportSizeProp)
, p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ, AbstractProcessor::INVALID_PROPERTIES | AbstractProcessor::INVALID_RESULT) , p_inputImage("InputImage", "Input Image", "", DataNameProperty::READ)
, p_outputImage("OutputImage", "Output Image", "predicatemask", DataNameProperty::WRITE) , p_outputImage("OutputImage", "Output Image", "predicatemask", DataNameProperty::WRITE)
, p_scanningDirection("ScanningDirection", "US Scanning Direction", tgt::vec3(0.f, 1.f, 0.f), tgt::vec3(-1.f), tgt::vec3(1.f)) , p_scanningDirection("ScanningDirection", "US Scanning Direction", tgt::vec3(0.f, 1.f, 0.f), tgt::vec3(-1.f), tgt::vec3(1.f))
, p_threshold("Threshold", "Threshold", .1f, .01f, 1.f) , p_threshold("Threshold", "Threshold", .1f, .01f, 1.f)
, p_stepSize("StepSize", "Step Size", 2.f, 1.f, 16.f, 1.f, 1) , p_stepSize("StepSize", "Step Size", 2.f, 1.f, 16.f, 1.f, 1)
, _shader(0) , _shader(0)
{ {
addProperty(&p_inputImage); addProperty(p_inputImage, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(&p_outputImage); addProperty(p_outputImage);
addProperty(&p_scanningDirection); addProperty(p_scanningDirection);
addProperty(&p_threshold); addProperty(p_threshold);
addProperty(&p_stepSize); addProperty(p_stepSize);
} }
ScanlineDistributionComputation::~ScanlineDistributionComputation() { ScanlineDistributionComputation::~ScanlineDistributionComputation() {
...@@ -76,7 +76,7 @@ namespace campvis { ...@@ -76,7 +76,7 @@ namespace campvis {
_shader->setAttributeLocation(1, "in_TexCoord"); _shader->setAttributeLocation(1, "in_TexCoord");
_viewportSizeProperty->s_changed.disconnect(this); _viewportSizeProperty->s_changed.disconnect(this);
_viewportSizeProperty->setInvalidationLevel(AbstractProcessor::VALID); setPropertyInvalidationLevel(*_viewportSizeProperty, VALID);
} }
void ScanlineDistributionComputation::deinit() { void ScanlineDistributionComputation::deinit() {
...@@ -112,7 +112,7 @@ namespace campvis { ...@@ -112,7 +112,7 @@ namespace campvis {
glViewport(0, 0, static_cast<GLsizei>(viewportSize.x), static_cast<GLsizei>(viewportSize.y)); glViewport(0, 0, static_cast<GLsizei>(viewportSize.x), static_cast<GLsizei>(viewportSize.y));
// render quad to compute difference measure by shader // render quad to compute difference measure by shader
for (int z = 0; z < size.z; ++z) { for (int z = 0; z < static_cast<int>(size.z); ++z) {
float zTexCoord = static_cast<float>(z)/static_cast<float>(size.z) + .5f/static_cast<float>(size.z); float zTexCoord = static_cast<float>(z)/static_cast<float>(size.z) + .5f/static_cast<float>(size.z);
_shader->setUniform("_zTexCoord", zTexCoord); _shader->setUniform("_zTexCoord", zTexCoord);
_fbo->attachTexture(distanceTexture, GL_COLOR_ATTACHMENT0, 0, z); _fbo->attachTexture(distanceTexture, GL_COLOR_ATTACHMENT0, 0, z);
......
...@@ -32,8 +32,8 @@ namespace campvis { ...@@ -32,8 +32,8 @@ namespace campvis {
const std::string PointPredicateHistogramProperty::loggerCat_ = "CAMPVis.modules.advancedusvis.PointPredicateHistogramProperty"; const std::string PointPredicateHistogramProperty::loggerCat_ = "CAMPVis.modules.advancedusvis.PointPredicateHistogramProperty";
PointPredicateHistogramProperty::PointPredicateHistogramProperty(const std::string& name, const std::string& title, int invalidationLevel /*= AbstractProcessor::INVALID_RESULT*/) PointPredicateHistogramProperty::PointPredicateHistogramProperty(const std::string& name, const std::string& title)
: AbstractProperty(name, title, invalidationLevel) : AbstractProperty(name, title)
{ {
_ignoreSignals = 0; _ignoreSignals = 0;
std::shared_ptr<PointPredicateHistogram> ptr(new PointPredicateHistogram()); std::shared_ptr<PointPredicateHistogram> ptr(new PointPredicateHistogram());
......
...@@ -51,9 +51,8 @@ namespace campvis { ...@@ -51,9 +51,8 @@ namespace campvis {
* Creates a new PointPredicateHistogramProperty * Creates a new PointPredicateHistogramProperty
* \param name Property name (unchangable!) * \param name Property name (unchangable!)
* \param title Property title (e.g. used for GUI) * \param title Property title (e.g. used for GUI)
* \param invalidationLevel Invalidation level that this property triggers
*/ */
PointPredicateHistogramProperty(const std::string& name, const std::string& title, int invalidationLevel = AbstractProcessor::INVALID_RESULT); PointPredicateHistogramProperty(const std::string& name, const std::string& title);
/** /**
* Virtual Destructor * Virtual Destructor
......
...@@ -36,7 +36,7 @@ namespace campvis { ...@@ -36,7 +36,7 @@ namespace campvis {
CampcomMhdReceiver::CampcomMhdReceiver() CampcomMhdReceiver::CampcomMhdReceiver()
: AbstractProcessor() : AbstractProcessor()
, p_address("ServerAddress", "Server Address", "127.0.0.1") , p_address("ServerAddress", "Server Address", "127.0.0.1")
, p_connect("Connect", "Connect to Server", AbstractProcessor::VALID) , p_connect("Connect", "Connect to Server")
, p_targetImageID("targetImageName", "Target Image ID", "CampcomMhdReceiver.output", DataNameProperty::WRITE) , p_targetImageID("targetImageName", "Target Image ID", "CampcomMhdReceiver.output", DataNameProperty::WRITE)
, p_imageOffset("ImageOffset", "Image Offset in mm", tgt::vec3(0.f), tgt::vec3(-10000.f), tgt::vec3(10000.f), tgt::vec3(0.1f)) , p_imageOffset("ImageOffset", "Image Offset in mm", tgt::vec3(0.f), tgt::vec3(-10000.f), tgt::vec3(10000.f), tgt::vec3(0.1f))
, p_voxelSize("VoxelSize", "Voxel Size in mm", tgt::vec3(1.f), tgt::vec3(-100.f), tgt::vec3(100.f), tgt::vec3(0.1f)) , p_voxelSize("VoxelSize", "Voxel Size in mm", tgt::vec3(1.f), tgt::vec3(-100.f), tgt::vec3(100.f), tgt::vec3(0.1f))
...@@ -44,11 +44,11 @@ namespace campvis { ...@@ -44,11 +44,11 @@ namespace campvis {
{ {
_incomingMhd = 0; _incomingMhd = 0;
addProperty(&p_address); addProperty(p_address, VALID);
addProperty(&p_targetImageID); addProperty(p_targetImageID, VALID);
addProperty(&p_connect); addProperty(p_connect, VALID);
addProperty(&p_imageOffset); addProperty(p_imageOffset, VALID);
addProperty(&p_voxelSize); addProperty(p_voxelSize, VALID);
} }
...@@ -70,8 +70,6 @@ namespace campvis { ...@@ -70,8 +70,6 @@ namespace campvis {
} }
void CampcomMhdReceiver::updateResult(DataContainer& data) { void CampcomMhdReceiver::updateResult(DataContainer& data) {
validate(INVALID_RESULT);
// Get the last received MHD file: // Get the last received MHD file:
// Use atomic fetch and store because at the same time CAMPCom may receive another file! // Use atomic fetch and store because at the same time CAMPCom may receive another file!
campcom::MHDImageData* mid = _incomingMhd.fetch_and_store(0); campcom::MHDImageData* mid = _incomingMhd.fetch_and_store(0);
...@@ -117,6 +115,8 @@ namespace campvis { ...@@ -117,6 +115,8 @@ namespace campvis {
ImageRepresentationLocal::create(image, wtp); ImageRepresentationLocal::create(image, wtp);
image->setMappingInformation(ImageMappingInformation(size, imageOffset + p_imageOffset.getValue(), voxelSize * p_voxelSize.getValue())); image->setMappingInformation(ImageMappingInformation(size, imageOffset + p_imageOffset.getValue(), voxelSize * p_voxelSize.getValue()));
data.addData(p_targetImageID.getValue(), image); data.addData(p_targetImageID.getValue(), image);
validate(INVALID_RESULT);
} }
void CampcomMhdReceiver::onBtnConnectClicked() { void CampcomMhdReceiver::onBtnConnectClicked() {
......
...@@ -48,8 +48,8 @@ namespace campvis { ...@@ -48,8 +48,8 @@ namespace campvis {
, _compositor(&_canvasSize) , _compositor(&_canvasSize)
, _trackballEH(0) , _trackballEH(0)
{ {
addProperty(&_camera); addProperty(_camera);
addProperty(&_boundsData); addProperty(_boundsData);
_trackballEH = new TrackballNavigationEventListener(&_camera, &_canvasSize); _trackballEH = new TrackballNavigationEventListener(&_camera, &_canvasSize);
_trackballEH->addLqModeProcessor(&_vr); _trackballEH->addLqModeProcessor(&_vr);
...@@ -126,7 +126,7 @@ namespace campvis { ...@@ -126,7 +126,7 @@ namespace campvis {
Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f)); Geometry1DTransferFunction* dvrTF = new Geometry1DTransferFunction(128, tgt::vec2(0.f, 1.f));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.1f, .125f), tgt::col4(255, 0, 0, 32), tgt::col4(255, 0, 0, 32))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.1f, .125f), tgt::col4(255, 0, 0, 32), tgt::col4(255, 0, 0, 32)));
dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128))); dvrTF->addGeometry(TFGeometry1D::createQuad(tgt::vec2(.4f, .5f), tgt::col4(0, 255, 0, 128), tgt::col4(0, 255, 0, 128)));
static_cast<TransferFunctionProperty*>(_vr.getProperty("TransferFunction"))->replaceTF(dvrTF); static_cast<TransferFunctionProperty*>(_vr.getNestedProperty("RaycasterProps::TransferFunction"))->replaceTF(dvrTF);
_vr.p_outputImage.addSharedProperty(&_compositor.p_secondImageId); _vr.p_outputImage.addSharedProperty(&_compositor.p_secondImageId);
_gr.p_renderTargetID.setValue("gr"); _gr.p_renderTargetID.setValue("gr");
......
...@@ -49,10 +49,10 @@ namespace campvis { ...@@ -49,10 +49,10 @@ namespace campvis {
{ {
addDecorator(new ProcessorDecoratorShading()); addDecorator(new ProcessorDecoratorShading());
addProperty(&p_geometryID); addProperty(p_geometryID);
addProperty(&p_renderTargetID); addProperty(p_renderTargetID);
addProperty(&p_camera); addProperty(p_camera);
addProperty(&p_color); addProperty(p_color);
decoratePropertyCollection(this); decoratePropertyCollection(this);
} }
......
...@@ -31,13 +31,13 @@ namespace campvis { ...@@ -31,13 +31,13 @@ namespace campvis {
ImageSeriesSplitter::ImageSeriesSplitter() ImageSeriesSplitter::ImageSeriesSplitter()
: AbstractProcessor() : AbstractProcessor()
, p_inputID("InputID", "Input Image Series ID", "input", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES) , p_inputID("InputID", "Input Image Series ID", "input", DataNameProperty::READ)
, p_outputID("OutputID", "Output Image ID", "output", DataNameProperty::WRITE) , p_outputID("OutputID", "Output Image ID", "output", DataNameProperty::WRITE)
, p_imageIndex("ImageIndex", "Image to Select", 0, 0, 0) , p_imageIndex("ImageIndex", "Image to Select", 0, 0, 0)
{ {
addProperty(&p_inputID); addProperty(p_inputID, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(&p_outputID); addProperty(p_outputID);
addProperty(&p_imageIndex); addProperty(p_imageIndex);
} }
ImageSeriesSplitter::~ImageSeriesSplitter() { ImageSeriesSplitter::~ImageSeriesSplitter() {
......
...@@ -48,20 +48,20 @@ namespace campvis { ...@@ -48,20 +48,20 @@ namespace campvis {
: VisualizationProcessor(viewportSizeProp) : VisualizationProcessor(viewportSizeProp)
, p_strainId("StrainDataId", "Input Strain Data ID", "gr.strain", DataNameProperty::READ) , p_strainId("StrainDataId", "Input Strain Data ID", "gr.strain", DataNameProperty::READ)
, p_renderTargetID("p_renderTargetID", "Output Image", "gr.output", DataNameProperty::WRITE) , p_renderTargetID("p_renderTargetID", "Output Image", "gr.output", DataNameProperty::WRITE)
, p_camera("Camera", "Camera ID")//, "camera", DataNameProperty::READ, AbstractProcessor::INVALID_RESULT, DataNameProperty::CameraData) , p_camera("Camera", "Camera ID")
, p_renderMode("RenderMode", "Render Mode", renderModeOptions, 2, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_SHADER) , p_renderMode("RenderMode", "Render Mode", renderModeOptions, 2)
, p_lineWidth("LineWidth", "Line width", 3.f, .5f, 10.f, 0.1f) , p_lineWidth("LineWidth", "Line width", 3.f, .5f, 10.f, 0.1f)
, p_color("color", "Rendering Color", tgt::vec4(1.f), tgt::vec4(0.f), tgt::vec4(1.f)) , p_color("color", "Rendering Color", tgt::vec4(1.f), tgt::vec4(0.f), tgt::vec4(1.f))
, _shader(0) , _shader(0)
{ {
addDecorator(new ProcessorDecoratorShading()); addDecorator(new ProcessorDecoratorShading());
addProperty(&p_strainId); addProperty(p_strainId);
addProperty(&p_renderTargetID); addProperty(p_renderTargetID);
addProperty(&p_camera); addProperty(p_camera);
addProperty(&p_color); addProperty(p_color);
addProperty(&p_renderMode); addProperty(p_renderMode, INVALID_RESULT | INVALID_SHADER);
addProperty(&p_lineWidth); addProperty(p_lineWidth);
decoratePropertyCollection(this); decoratePropertyCollection(this);
} }
...@@ -72,7 +72,7 @@ namespace campvis { ...@@ -72,7 +72,7 @@ namespace campvis {
void StrainFiberRenderer::init() { void StrainFiberRenderer::init() {
VisualizationProcessor::init(); VisualizationProcessor::init();
_shader = ShdrMgr.load("modules/columbia/glsl/strainfiberrenderer.vert", "modules/columbia/glsl/strainfiberrenderer.geom", "modules/columbia/glsl/strainfiberrenderer.frag", ""); _shader = ShdrMgr.load("modules/columbia/glsl/strainfiberrenderer.vert", "modules/columbia/glsl/strainfiberrenderer.geom", "modules/columbia/glsl/strainfiberrenderer.frag", generateGlslHeader());
if (_shader != 0) { if (_shader != 0) {
_shader->setAttributeLocation(0, "in_Position"); _shader->setAttributeLocation(0, "in_Position");
_shader->setAttributeLocation(1, "in_TexCoord"); _shader->setAttributeLocation(1, "in_TexCoord");
......
...@@ -161,23 +161,23 @@ namespace campvis { ...@@ -161,23 +161,23 @@ namespace campvis {
StrainFiberTracker::StrainFiberTracker() StrainFiberTracker::StrainFiberTracker()
: AbstractProcessor() : AbstractProcessor()
, p_strainId("StrainId", "Input Strain Data", "input", DataNameProperty::READ, AbstractProcessor::VALID) , p_strainId("StrainId", "Input Strain Data", "input", DataNameProperty::READ)
, p_outputID("OutputId", "Output Fiber Data", "output", DataNameProperty::WRITE, AbstractProcessor::VALID) , p_outputID("OutputId", "Output Fiber Data", "output", DataNameProperty::WRITE)
, p_updateButton("UpdateButton", "Perform Tracking") , p_updateButton("UpdateButton", "Perform Tracking")
, p_seedDistance("SeedDistance", "Seed Distance", 4, 1, 16, 1, AbstractProcessor::VALID) , p_seedDistance("SeedDistance", "Seed Distance", 4, 1, 16, 1)
, p_numSteps("NumSteps", "Maximum Number of Steps", 256, 16, 1024, 1, AbstractProcessor::VALID) , p_numSteps("NumSteps", "Maximum Number of Steps", 256, 16, 1024, 1)
, p_stepSize("StepSize", "Base Step Size", 1.f, .01f, 10.f, 0.01f, 2, AbstractProcessor::VALID) , p_stepSize("StepSize", "Base Step Size", 1.f, .01f, 10.f, 0.01f, 2)
, p_strainThreshold("StrainThreshold", "Local Strain Threshold", .5f, .1f, 1.f, 0.01f, 2, AbstractProcessor::VALID) , p_strainThreshold("StrainThreshold", "Local Strain Threshold", .5f, .1f, 1.f, 0.01f, 2)
, p_maximumAngle("MaximumAngle", "Maxium Angle", 25.f, 0.f, 100.f, 0.1f, 2, AbstractProcessor::VALID) , p_maximumAngle("MaximumAngle", "Maxium Angle", 25.f, 0.f, 100.f, 0.1f, 2)