Re-enable more of the bindings

This should enable enough of the bindings to be able to extract a surface
mesh.
This commit is contained in:
Matt Williams
2012-06-21 22:24:04 +01:00
parent d79b1006f3
commit 869d1a8d6a
5 changed files with 61 additions and 41 deletions

View File

@ -2,33 +2,40 @@
#define POLYVOX_API
%rename(equals) operator==;
%rename(notEqualTo) operator!=;
%rename(lessThan) operator<;
%rename(greaterThan) operator>;
%rename(lessThanOrEqualTo) operator<=;
%rename(greaterThanOrEqualTo) operator>=;
%rename(assignment) operator=;
%rename(additionAssignment) operator+=;
%rename(subtractionAssignment) operator-=;
%rename(multiplicationAssignment) operator*=;
%rename(divisionAssignment) operator/=;
%rename(arrayOperator) operator[];
//This macro allows us to use Python properties on our classes
%define PROPERTY(type,name,getter,setter)
%extend type {
%pythoncode %{
__swig_getmethods__["name"] = getter
__swig_setmethods__["name"] = setter
if _newclass: name = property(getter, setter)
%}
};
%enddef
//Put this in an %extend section to wrap operator<< as __str__
%define STR()
const char* __str__() {
std::ostringstream out;
out << *$self;
return out.str().c_str();
}
%enddef
%include "stdint.i"
%include "std_vector.i"
%include "Vector.i"
%include "Density.i"
//%include "Material.i"
//%include "Density.i"
//%include "Region.i"
//%include "SimpleVolume.i"
%include "Region.i"
%include "SimpleVolume.i"
//%include "TypeDef.i"
//%include "SubArray.i"
//%include "Array.i"
//%include "VertexTypes.i"
//%include "SurfaceMesh.i"
%include "VertexTypes.i"
%include "SurfaceMesh.i"
//%include "SimpleVolumeSampler.i"
//%include "SurfaceExtractor.i"
%include "SurfaceExtractor.i"
//%include "CubicSurfaceExtractor.i"
//%include "CubicSurfaceExtractorWithNormals.i"
//%include "MeshDecimator.i"