Commit 080b3ae3 authored by Artur Grunau's avatar Artur Grunau
Browse files

Add a light source to Lua pipelines

Starting with commit d6fec679, pipelines need to provide their own light
source to function properly. Lua pipelines didn't, which caused them to
fail to render.

Add a SWIG wrapper for LightSourceProvider to make it accessible from
Lua. Instantiate and attach a light source in existing Lua pipelines.

References #1
parent 16ee3af2
%module base
%include std_string.i
%import "core/bindings/campvis.i"
%{
#include "core/pipeline/autoevaluationpipeline.h"
#include "core/pipeline/visualizationprocessor.h"
#include "modules/base/processors/lightsourceprovider.h"
%}
namespace campvis {
class LightSourceProvider : public AbstractProcessor {
public:
LightSourceProvider();
virtual ~LightSourceProvider();
const std::string getName() const;
};
}
require("tgt")
require("base")
require("cvio")
require("vis")
require("preprocessing")
......@@ -7,6 +8,9 @@ pipeline = campvis.newPipeline("ResamplingDemoLua")
function pipeline:ctor()
print("I'm being constructed!")
self.lsp = base.LightSourceProvider()
self.addProcessor(instance, self.lsp)
self.image_reader = cvio.MhdImageReader()
self.addProcessor(instance, self.image_reader)
......
require("tgt")
require("base")
require("cvio")
require("vis")
require("preprocessing")
......@@ -9,6 +10,9 @@ function pipeline:ctor()
self.camera = campvis.CameraProperty("camera", "Camera")
self.addProperty(instance, self.camera)
self.lsp = base.LightSourceProvider()
self.addProcessor(instance, self.lsp)
self.image_reader = cvio.MhdImageReader()
self.addProcessor(instance, self.image_reader)
......
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