Commit d41681ec authored by Artur Grunau's avatar Artur Grunau
Browse files

Get rid of ExtendedAutoEvaluationPipeline

Lua pipelines need to access certain protected properties of
AbstractPipeline but can't reference them directly as they don't
actually inherit from any class. ExtendedAutoEvaluationPipeline was
added to generated bindings to expose public getters for the properties
in question. LuaPipeline instances could then be cast to
ExtendedAutoEvaluationPipeline to give Lua code access to these new
methods.

However, now that HasPropertyCollection has been wrapped, the protected
properties can be accessed via its getProperty method. This approach is
preferred as it's much cleaner and simplifies our interface files. As a
result, ExtendedAutoEvaluationPipeline has been removed.

References #1
parent de05bfe3
......@@ -337,27 +337,9 @@ namespace campvis {
%inline {
static const char* const SOURCE_DIR = CAMPVIS_SOURCE_DIR;
namespace campvis {
/*
* Lua pipelines need to access certain protected properties of AbstractPipeline but can't
* reference them directly as they don't actually inherit from any class. This subclass exposes
* public getters for the properties in question. LuaPipeline instances can then be cast to
* ExtendedAutoEvaluationPipeline to give Lua code access to these new methods.
*/
class ExtendedAutoEvaluationPipeline : public AutoEvaluationPipeline {
public:
const IVec2Property& ExtendedAutoEvaluationPipeline::getCanvasSizeProperty() const {
return _canvasSize;
}
const DataNameProperty& ExtendedAutoEvaluationPipeline::getRenderTargetIDProperty() const {
return _renderTargetID;
}
};
}
}
%luacode {
function campvis.newPipeline (name, o)
if not name then
......
......@@ -10,8 +10,9 @@ function pipeline:ctor()
self.image_reader = cvio.MhdImageReader()
self.addProcessor(instance, self.image_reader)
self.ve = vis.VolumeExplorer(self.getCanvasSizeProperty(instance))
self.resampler = preprocessing.GlImageResampler(self.getCanvasSizeProperty(instance))
local canvas_size = self.getProperty(instance, "CanvasSize")
self.ve = vis.VolumeExplorer(canvas_size)
self.resampler = preprocessing.GlImageResampler(canvas_size)
self.addProcessor(instance, self.resampler)
self.addProcessor(instance, self.ve)
......@@ -23,7 +24,7 @@ function pipeline:init()
print("I'm being inited!")
self.ve.p_outputImage:setValue("result")
self.getRenderTargetIDProperty(instance):setValue("result")
self.getProperty(instance, "renderTargetID"):setValue("result")
self.image_reader.p_url:setValue(campvis.SOURCE_DIR .. "/modules/vis/sampledata/smallHeart.mhd")
self.image_reader.p_targetImageID:setValue("reader.output")
......
......@@ -26,7 +26,7 @@ namespace campvis {
if (!_luaVmState->execString("require(\"campvis\")"))
return;
if (!_luaVmState->injectObjectPointer(this, "campvis::ExtendedAutoEvaluationPipeline *", "instance"))
if (!_luaVmState->injectObjectPointer(this, "campvis::AutoEvaluationPipeline *", "instance"))
return;
// Try executing the pipeline's Lua script
......
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