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

Lua bindings: wrap and instantiate tgt::Vector4

TGT-related glue code has been moved to a new interface file: tgt.i. It
wraps and instantiates tgt::Vector2 and (starting with this commit)
tgt::Vector4.

Many methods of those classes and a lot of typedefs haven't been wrapped
yet. This will be fixed when necessary in future commits.

References #1
parent 8079c98c
%module campvis
%include "std_string.i"
%include std_string.i
%include tgt.i
%{
#include "ext/tgt/vector.h"
#include "core/properties/genericproperty.h"
#include "core/properties/numericproperty.h"
#include "core/properties/datanameproperty.h"
......@@ -10,18 +10,6 @@
#include "core/pipeline/visualizationprocessor.h"
%}
namespace tgt {
template<class T>
struct Vector2 {
Vector2(T t);
Vector2(T t1, T t2);
static Vector2<T> zero;
};
%template(ivec2) Vector2<int>;
typedef Vector2<int> ivec2;
}
namespace campvis {
class AbstractProcessor {
......
%module tgt
%include "stdint.i"
%{
#include "ext/tgt/vector.h"
%}
namespace tgt {
/* Vector2 */
template<class T>
struct Vector2 {
Vector2(T t);
Vector2(T t1, T t2);
static Vector2<T> zero;
};
%template(ivec2) Vector2<int>;
typedef Vector2<int> ivec2;
%template(vec2) Vector2<float>;
typedef Vector2<float> vec2;
/* Vector4 */
template<class T>
struct Vector4 {
Vector4() {}
explicit Vector4(T init);
explicit Vector4(const T* init);
Vector4(T t1, T t2, T t3, T t4);
Vector4(const Vector2<T>& v1, const Vector2<T>& v2);
Vector4(const Vector2<T>& vec, T z_, T w_);
Vector4(T _x, T _y, const Vector2<T>& v);
};
%template(vec4) Vector4<float>;
typedef Vector4<float> vec4;
%template(col4) Vector4<uint8_t>;
typedef Vector4<uint8_t> col4;
}
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