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

Added a field _pipelineName to AutoEvaluationPipeline. This allows to...

Added a field _pipelineName to AutoEvaluationPipeline. This allows to implement AutoEvaluationPipeline::getName() so that AutoEvaluationPipeline is no longer abstract. Consequently, the LuaPipeline is no longer needed.

This change was also used to change the AbstractPipeline constructor signature to pass-by-reference instead of pass-by-pointer for the pipeline's DataContainer. This presents the semantics more clearly since the DataContainer must not be 0.
parent 50c0b05d
...@@ -50,9 +50,11 @@ namespace campvis { ...@@ -50,9 +50,11 @@ namespace campvis {
class CAMPVIS_MODULES_API IxpvDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API IxpvDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a IxpvDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit IxpvDemo(DataContainer* dc); explicit IxpvDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -62,8 +64,6 @@ namespace campvis { ...@@ -62,8 +64,6 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "IxpvDemo"; }; static const std::string getId() { return "IxpvDemo"; };
//virtual void keyEvent(cgt::KeyEvent* e); //virtual void keyEvent(cgt::KeyEvent* e);
......
...@@ -34,10 +34,9 @@ ...@@ -34,10 +34,9 @@
namespace campvis { namespace campvis {
MicroscopyImageSegmentationDemo::MicroscopyImageSegmentationDemo(DataContainer* dc) MicroscopyImageSegmentationDemo::MicroscopyImageSegmentationDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
//, _imageReader(new IVec2Property("CanvasSize", "Canvas Size", cgt::ivec2(128, 128), cgt::ivec2(1, 1), cgt::ivec2(4096, 4096)))
, _ve(&_canvasSize) , _ve(&_canvasSize)
{ {
addProcessor(&_lsp); addProcessor(&_lsp);
......
...@@ -39,9 +39,11 @@ namespace campvis { ...@@ -39,9 +39,11 @@ namespace campvis {
class CAMPVIS_MODULES_API MicroscopyImageSegmentationDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API MicroscopyImageSegmentationDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a MicroscopyImageSegmentationDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit MicroscopyImageSegmentationDemo(DataContainer* dc); explicit MicroscopyImageSegmentationDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -50,13 +52,9 @@ namespace campvis { ...@@ -50,13 +52,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "MicroscopyImageSegmentationDemo"; }; static const std::string getId() { return "MicroscopyImageSegmentationDemo"; };
protected: protected:
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
namespace campvis { namespace campvis {
NeuroDemo::NeuroDemo(DataContainer* dc) NeuroDemo::NeuroDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
, _tcp(&_canvasSize) , _tcp(&_canvasSize)
, _ctReader() , _ctReader()
......
...@@ -41,9 +41,11 @@ namespace campvis { ...@@ -41,9 +41,11 @@ namespace campvis {
class CAMPVIS_MODULES_API NeuroDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API NeuroDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a NeuroDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit NeuroDemo(DataContainer* dc); explicit NeuroDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -54,9 +56,6 @@ namespace campvis { ...@@ -54,9 +56,6 @@ namespace campvis {
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "NeuroDemo"; }; static const std::string getId() { return "NeuroDemo"; };
/// \see AbstractPipeline::executePipeline() /// \see AbstractPipeline::executePipeline()
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
namespace campvis { namespace campvis {
ViscontestDemo::ViscontestDemo(DataContainer* dc) ViscontestDemo::ViscontestDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
, _tcp(&_canvasSize) , _tcp(&_canvasSize)
, _fiberReader() , _fiberReader()
......
...@@ -43,9 +43,11 @@ namespace campvis { ...@@ -43,9 +43,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ViscontestDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API ViscontestDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a ViscontestDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit ViscontestDemo(DataContainer* dc); explicit ViscontestDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -56,9 +58,6 @@ namespace campvis { ...@@ -56,9 +58,6 @@ namespace campvis {
virtual void init(); virtual void init();
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "ViscontestDemo"; }; static const std::string getId() { return "ViscontestDemo"; };
/// \see AbstractPipeline::executePipeline() /// \see AbstractPipeline::executePipeline()
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
namespace campvis { namespace campvis {
StreamingOIGTLDemo::StreamingOIGTLDemo(DataContainer* dc) StreamingOIGTLDemo::StreamingOIGTLDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
{ {
addProcessor(&_igtlClient); addProcessor(&_igtlClient);
addProcessor(&_matrixProcessor); addProcessor(&_matrixProcessor);
......
...@@ -36,9 +36,11 @@ namespace campvis { ...@@ -36,9 +36,11 @@ namespace campvis {
class CAMPVIS_MODULES_API StreamingOIGTLDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API StreamingOIGTLDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a StreamingOIGTLDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit StreamingOIGTLDemo(DataContainer *dc); explicit StreamingOIGTLDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -47,12 +49,9 @@ namespace campvis { ...@@ -47,12 +49,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "StreamingOpenIGTLinkDemo"; }; static const std::string getId() { return "StreamingOpenIGTLinkDemo"; };
void onRenderTargetSizeChanged(const AbstractProperty *prop); void onRenderTargetSizeChanged(const AbstractProperty *prop);
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
namespace campvis { namespace campvis {
MorphologyDemo::MorphologyDemo(DataContainer* dc) MorphologyDemo::MorphologyDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
, _imageReader() , _imageReader()
, _morphologyFilter(&_canvasSize) , _morphologyFilter(&_canvasSize)
......
...@@ -37,9 +37,11 @@ namespace campvis { ...@@ -37,9 +37,11 @@ namespace campvis {
class CAMPVIS_MODULES_API MorphologyDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API MorphologyDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a MorphologyDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit MorphologyDemo(DataContainer* dc); explicit MorphologyDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -48,12 +50,9 @@ namespace campvis { ...@@ -48,12 +50,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "MorphologyDemo"; }; static const std::string getId() { return "MorphologyDemo"; };
protected: protected:
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
namespace campvis { namespace campvis {
ResamplingDemo::ResamplingDemo(DataContainer* dc) ResamplingDemo::ResamplingDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
, _imageReader() , _imageReader()
, _resampler(&_canvasSize) , _resampler(&_canvasSize)
......
...@@ -37,9 +37,11 @@ namespace campvis { ...@@ -37,9 +37,11 @@ namespace campvis {
class CAMPVIS_MODULES_API ResamplingDemo : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API ResamplingDemo : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a ResamplingDemo pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit ResamplingDemo(DataContainer* dc); explicit ResamplingDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -48,12 +50,9 @@ namespace campvis { ...@@ -48,12 +50,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "ResamplingDemo"; }; static const std::string getId() { return "ResamplingDemo"; };
protected: protected:
......
...@@ -59,8 +59,8 @@ namespace registration { ...@@ -59,8 +59,8 @@ namespace registration {
GenericOption<nlopt::algorithm>("neldermead", "Nelder-Mead Simplex", nlopt::LN_NELDERMEAD) GenericOption<nlopt::algorithm>("neldermead", "Nelder-Mead Simplex", nlopt::LN_NELDERMEAD)
}; };
NloptRegistration::NloptRegistration(DataContainer* dc) NloptRegistration::NloptRegistration(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, p_optimizer("Optimizer", "Optimizer", optimizers, 3) , p_optimizer("Optimizer", "Optimizer", optimizers, 3)
, p_liveUpdate("LiveUpdate", "Live Update of Difference Image", false) , p_liveUpdate("LiveUpdate", "Live Update of Difference Image", false)
, p_performOptimization("PerformOptimization", "Perform Optimization") , p_performOptimization("PerformOptimization", "Perform Optimization")
...@@ -202,7 +202,7 @@ namespace registration { ...@@ -202,7 +202,7 @@ namespace registration {
_sm.p_rotation.setValue(r); _sm.p_rotation.setValue(r);
// compute difference image and render difference volume // compute difference image and render difference volume
_sm.generateDifferenceImage(_data, referenceImage, movingImage, t, r); _sm.generateDifferenceImage(_dataContainer, referenceImage, movingImage, t, r);
_ve.process(getDataContainer()); _ve.process(getDataContainer());
} }
......
...@@ -47,9 +47,11 @@ namespace registration { ...@@ -47,9 +47,11 @@ namespace registration {
class CAMPVIS_MODULES_API NloptRegistration : public AutoEvaluationPipeline { class CAMPVIS_MODULES_API NloptRegistration : public AutoEvaluationPipeline {
public: public:
/** /**
* Creates a AutoEvaluationPipeline. * Creates a NloptRegistration pipeline.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit NloptRegistration(DataContainer* dc); explicit NloptRegistration(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -61,8 +63,6 @@ namespace registration { ...@@ -61,8 +63,6 @@ namespace registration {
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
static const std::string getId() { return "registration::NloptRegistration"; }; static const std::string getId() { return "registration::NloptRegistration"; };
GenericOptionProperty<nlopt::algorithm> p_optimizer; ///< Optimizer Algorithm GenericOptionProperty<nlopt::algorithm> p_optimizer; ///< Optimizer Algorithm
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
namespace campvis { namespace campvis {
TensorDemo::TensorDemo(DataContainer* dc) TensorDemo::TensorDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _tcp(&_canvasSize) , _tcp(&_canvasSize)
, _lsp() , _lsp()
, _imageReader() , _imageReader()
......
...@@ -43,8 +43,10 @@ namespace campvis { ...@@ -43,8 +43,10 @@ namespace campvis {
public: public:
/** /**
* Small demo pipeline for tensor data visualization. * Small demo pipeline for tensor data visualization.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit TensorDemo(DataContainer* dc); explicit TensorDemo(DataContainer& dataContainer);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -54,9 +56,6 @@ namespace campvis { ...@@ -54,9 +56,6 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "TensorDemo"; }; static const std::string getId() { return "TensorDemo"; };
protected: protected:
......
...@@ -37,8 +37,8 @@ namespace campvis { ...@@ -37,8 +37,8 @@ namespace campvis {
GenericOption<std::string>("particles", "Particle Simulation"), GenericOption<std::string>("particles", "Particle Simulation"),
}; };
VectorFieldDemo::VectorFieldDemo(DataContainer* dc) VectorFieldDemo::VectorFieldDemo(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _tcp(&_canvasSize) , _tcp(&_canvasSize)
, _lsp() , _lsp()
, _imageReader() , _imageReader()
...@@ -132,7 +132,7 @@ namespace campvis { ...@@ -132,7 +132,7 @@ namespace campvis {
void VectorFieldDemo::onProcessorValidated(AbstractProcessor* processor) { void VectorFieldDemo::onProcessorValidated(AbstractProcessor* processor) {
if (processor == &_imageReader) { if (processor == &_imageReader) {
// update camera // update camera
ScopedTypedData<ImageData> img(*_data, _sliceRenderer.p_sourceImageID.getValue()); ScopedTypedData<ImageData> img(*_dataContainer, _sliceRenderer.p_sourceImageID.getValue());
if (img) { if (img) {
p_sliceNumber.setMaxValue(static_cast<int>(img->getSize().z)); p_sliceNumber.setMaxValue(static_cast<int>(img->getSize().z));
} }
......
...@@ -43,8 +43,10 @@ namespace campvis { ...@@ -43,8 +43,10 @@ namespace campvis {
public: public:
/** /**
* Small demo pipeline for vector field visualization. * Small demo pipeline for vector field visualization.
* \param dataContainer Reference to the DataContainer containing local working set of data
* for this pipeline, must be valid the whole lifetime of this pipeline.
*/ */
explicit VectorFieldDemo(DataContainer* dc); explicit VectorFieldDemo(DataContainer& dc);
/** /**
* Virtual Destructor * Virtual Destructor
...@@ -53,13 +55,9 @@ namespace campvis { ...@@ -53,13 +55,9 @@ namespace campvis {
/// \see AutoEvaluationPipeline::init() /// \see AutoEvaluationPipeline::init()
virtual void init(); virtual void init();
/// \see AutoEvaluationPipeline::deinit() /// \see AutoEvaluationPipeline::deinit()
virtual void deinit(); virtual void deinit();
/// \see AbstractPipeline::getName()
virtual const std::string getName() const { return getId(); };
/// \see AbstractPipeline::getId()
static const std::string getId() { return "VectorFieldDemo"; }; static const std::string getId() { return "VectorFieldDemo"; };
protected: protected:
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
namespace campvis { namespace campvis {
AdvDVRVis::AdvDVRVis(DataContainer* dc) AdvDVRVis::AdvDVRVis(DataContainer& dc)
: AutoEvaluationPipeline(dc) : AutoEvaluationPipeline(dc, getId())
, _lsp() , _lsp()
, _imageReader() , _imageReader()
, _resampler(&_canvasSize) , _resampler(&_canvasSize)
......
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