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:
		| @@ -3,6 +3,8 @@ | |||||||
| #include "Density.h" | #include "Density.h" | ||||||
| %} | %} | ||||||
|  |  | ||||||
|  | %include "Voxel.h" | ||||||
|  | %include "SurfaceExtractor.h" | ||||||
| %include "Density.h" | %include "Density.h" | ||||||
|  |  | ||||||
| %template(Density8) PolyVox::Density<uint8_t>; | %template(Density8) PolyVox::Density<uint8_t>; | ||||||
|   | |||||||
| @@ -2,33 +2,40 @@ | |||||||
|  |  | ||||||
| #define POLYVOX_API | #define POLYVOX_API | ||||||
|  |  | ||||||
| %rename(equals) operator==; | //This macro allows us to use Python properties on our classes | ||||||
| %rename(notEqualTo) operator!=; | %define PROPERTY(type,name,getter,setter) | ||||||
| %rename(lessThan) operator<; | %extend type { | ||||||
| %rename(greaterThan) operator>; | 	%pythoncode %{ | ||||||
| %rename(lessThanOrEqualTo) operator<=; | 		__swig_getmethods__["name"] = getter | ||||||
| %rename(greaterThanOrEqualTo) operator>=; | 		__swig_setmethods__["name"] = setter | ||||||
| %rename(assignment) operator=; | 		if _newclass: name = property(getter, setter) | ||||||
| %rename(additionAssignment) operator+=; | 	%} | ||||||
| %rename(subtractionAssignment) operator-=; | }; | ||||||
| %rename(multiplicationAssignment) operator*=; | %enddef | ||||||
| %rename(divisionAssignment) operator/=; |  | ||||||
| %rename(arrayOperator) operator[]; | //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 "stdint.i" | ||||||
| %include "std_vector.i" | %include "std_vector.i" | ||||||
| %include "Vector.i" | %include "Vector.i" | ||||||
|  | %include "Density.i" | ||||||
| //%include "Material.i" | //%include "Material.i" | ||||||
| //%include "Density.i" | %include "Region.i" | ||||||
| //%include "Region.i" | %include "SimpleVolume.i" | ||||||
| //%include "SimpleVolume.i" |  | ||||||
| //%include "TypeDef.i" | //%include "TypeDef.i" | ||||||
| //%include "SubArray.i" | //%include "SubArray.i" | ||||||
| //%include "Array.i" | //%include "Array.i" | ||||||
| //%include "VertexTypes.i" | %include "VertexTypes.i" | ||||||
| //%include "SurfaceMesh.i" | %include "SurfaceMesh.i" | ||||||
| //%include "SimpleVolumeSampler.i" | //%include "SimpleVolumeSampler.i" | ||||||
| //%include "SurfaceExtractor.i" | %include "SurfaceExtractor.i" | ||||||
| //%include "CubicSurfaceExtractor.i" | //%include "CubicSurfaceExtractor.i" | ||||||
| //%include "CubicSurfaceExtractorWithNormals.i" | //%include "CubicSurfaceExtractorWithNormals.i" | ||||||
| //%include "MeshDecimator.i" | //%include "MeshDecimator.i" | ||||||
| @@ -5,9 +5,12 @@ | |||||||
| #include "SimpleVolume.h" | #include "SimpleVolume.h" | ||||||
| %} | %} | ||||||
|  |  | ||||||
|  | %import "BaseVolume.h" | ||||||
| %include "Material.h" | %include "Material.h" | ||||||
| %include "Density.h" | %include "Density.h" | ||||||
| %include "SimpleVolume.h" | %include "SimpleVolume.h" | ||||||
|  |  | ||||||
| %template(SimpleVolumeMaterial8) PolyVox::SimpleVolume<PolyVox::Material8>; | %template(BaseVolumeDensity8) PolyVox::BaseVolume<PolyVox::Density8>; | ||||||
|  |  | ||||||
|  | //%template(SimpleVolumeMaterial8) PolyVox::SimpleVolume<PolyVox::Material8>; | ||||||
| %template(SimpleVolumeDensity8) PolyVox::SimpleVolume<PolyVox::Density8>; | %template(SimpleVolumeDensity8) PolyVox::SimpleVolume<PolyVox::Density8>; | ||||||
| @@ -1,30 +1,11 @@ | |||||||
| %module SurfaceExtractor | %module SurfaceExtractor | ||||||
| %{ | %{ | ||||||
| #include "SimpleVolume.h" | #include "SimpleVolume.h" | ||||||
|  | #include "Material.h" | ||||||
| #include "SurfaceExtractor.h" | #include "SurfaceExtractor.h" | ||||||
| #include "PolyVoxCore/Material.h" |  | ||||||
|  |  | ||||||
| namespace PolyVox |  | ||||||
| { |  | ||||||
| 	class SurfaceExtractorSimpleVolumeMaterial8 : public SurfaceExtractor<SimpleVolume, Material8> |  | ||||||
| 	{ |  | ||||||
| 		public: |  | ||||||
| 			SurfaceExtractorSimpleVolumeMaterial8(SimpleVolume<Material8>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result) |  | ||||||
| 			: SurfaceExtractor<SimpleVolume, Material8>(volData, region, result) {} |  | ||||||
| 			void execute() { SurfaceExtractor<SimpleVolume, Material8>::execute(); } |  | ||||||
| 	}; |  | ||||||
| }; |  | ||||||
| %} | %} | ||||||
|  |  | ||||||
| %include "SimpleVolume.h" | %include "SimpleVolume.h" | ||||||
| %include "SurfaceExtractor.h" | %include "SurfaceExtractor.h" | ||||||
|  |  | ||||||
| namespace PolyVox | %template(SurfaceExtractorSimpleVolumeDensity8) PolyVox::SurfaceExtractor<PolyVox::SimpleVolume<PolyVox::Density8> >; | ||||||
| { |  | ||||||
| 	class SurfaceExtractorSimpleVolumeMaterial8 : public SurfaceExtractor<SimpleVolume, Material8> |  | ||||||
| 	{ |  | ||||||
| 		public: |  | ||||||
| 			SurfaceExtractorSimpleVolumeMaterial8(SimpleVolume<Material8>* volData, Region region, SurfaceMesh<PositionMaterialNormal>* result); |  | ||||||
| 			void execute(); |  | ||||||
| 	}; |  | ||||||
| }; |  | ||||||
|   | |||||||
| @@ -1,10 +1,37 @@ | |||||||
| %module Vector | %module Vector | ||||||
| %{ | %{ | ||||||
| #include "Vector.h" | #include "Vector.h" | ||||||
|  | #include <sstream> | ||||||
| %} | %} | ||||||
|  |  | ||||||
| %include "Vector.h" | %include "Vector.h" | ||||||
|  |  | ||||||
|  | PROPERTY(PolyVox::Vector, x, getX, setX) | ||||||
|  | PROPERTY(PolyVox::Vector, y, getY, setY) | ||||||
|  | PROPERTY(PolyVox::Vector, z, getZ, setZ) | ||||||
|  |  | ||||||
|  | %extend PolyVox::Vector { | ||||||
|  | 	PolyVox::Vector __add__(const PolyVox::Vector& rhs) { | ||||||
|  | 		return *$self + rhs; | ||||||
|  | 	} | ||||||
|  | 	PolyVox::Vector __sub__(const PolyVox::Vector& rhs) { | ||||||
|  | 		return *$self - rhs; | ||||||
|  | 	} | ||||||
|  | 	PolyVox::Vector __div__(const PolyVox::Vector& rhs) { | ||||||
|  | 		return *$self / rhs; | ||||||
|  | 	} | ||||||
|  | 	PolyVox::Vector __div__(const Type& rhs) { | ||||||
|  | 		return *$self / rhs; | ||||||
|  | 	} | ||||||
|  | 	PolyVox::Vector __mul__(const PolyVox::Vector& rhs) { | ||||||
|  | 		return *$self * rhs; | ||||||
|  | 	} | ||||||
|  | 	PolyVox::Vector __mul__(const Type& rhs) { | ||||||
|  | 		return *$self * rhs; | ||||||
|  | 	} | ||||||
|  | 	STR() | ||||||
|  | }; | ||||||
|  |  | ||||||
| %template(Vector3DFloat) PolyVox::Vector<3,float>; | %template(Vector3DFloat) PolyVox::Vector<3,float>; | ||||||
| %template(Vector3DDouble) PolyVox::Vector<3,double>; | %template(Vector3DDouble) PolyVox::Vector<3,double>; | ||||||
| %template(Vector3DInt8) PolyVox::Vector<3,int8_t>; | %template(Vector3DInt8) PolyVox::Vector<3,int8_t>; | ||||||
| @@ -14,4 +41,4 @@ | |||||||
| %template(Vector3DInt32) PolyVox::Vector<3,int32_t>; | %template(Vector3DInt32) PolyVox::Vector<3,int32_t>; | ||||||
| %template(Vector3DUint32) PolyVox::Vector<3,uint32_t>; | %template(Vector3DUint32) PolyVox::Vector<3,uint32_t>; | ||||||
|  |  | ||||||
| %rename(assign) Vector3DFloat::operator=; | //%rename(assign) Vector3DFloat::operator=; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user