Add a VOLUMETYPES macro to avoid repeating ourselves.

This commit is contained in:
Matt Williams 2012-11-24 14:16:52 +00:00
parent a932d060f2
commit 63e0298fbf
4 changed files with 13 additions and 27 deletions

View File

@ -9,12 +9,4 @@
%include "Density.h"
%include "BaseVolume.h"
%template(BaseVolumeDensity8) PolyVox::BaseVolume<PolyVox::Density8>;
%template(BaseVolumeMaterial8) PolyVox::BaseVolume<PolyVox::Material8>;
%template(BaseVolumeMaterial16) PolyVox::BaseVolume<PolyVox::Material16>;
%template(BaseVolumeMaterialDensityPair44) PolyVox::BaseVolume<PolyVox::MaterialDensityPair44>;
%template(BaseVolumeMaterialDensityPair88) PolyVox::BaseVolume<PolyVox::MaterialDensityPair88>;
VOLUMETYPES(BaseVolume, PolyVox::BaseVolume)

View File

@ -24,6 +24,16 @@ const char* __str__() {
}
%enddef
//Centralise this to avoid repeating ourselves
//This macro will be called in the volume interface files to define the various volume types.
%define VOLUMETYPES(shortname, class)
%template(shortname ## Density8) class<PolyVox::Density8>;
%template(shortname ## Material8) class<PolyVox::Material8>;
%template(shortname ## Material16) class<PolyVox::Material16>;
%template(shortname ## MaterialDensityPair44) class<PolyVox::MaterialDensityPair44>;
%template(shortname ## MaterialDensityPair88) class<PolyVox::MaterialDensityPair88>;
%enddef
%feature("autodoc", "1");
//This will rename "operator=" to "assign" since Python doesn't have assignment

View File

@ -9,12 +9,4 @@
%include "Density.h"
%include "RawVolume.h"
%template(RawVolumeDensity8) PolyVox::RawVolume<PolyVox::Density8>;
%template(RawVolumeMaterial8) PolyVox::RawVolume<PolyVox::Material8>;
%template(RawVolumeMaterial16) PolyVox::RawVolume<PolyVox::Material16>;
%template(RawVolumeMaterialDensityPair44) PolyVox::RawVolume<PolyVox::MaterialDensityPair44>;
%template(RawVolumeMaterialDensityPair88) PolyVox::RawVolume<PolyVox::MaterialDensityPair88>;
VOLUMETYPES(RawVolume, PolyVox::RawVolume)

View File

@ -9,12 +9,4 @@
%include "Density.h"
%include "SimpleVolume.h"
%template(SimpleVolumeDensity8) PolyVox::SimpleVolume<PolyVox::Density8>;
%template(SimpleVolumeMaterial8) PolyVox::SimpleVolume<PolyVox::Material8>;
%template(SimpleVolumeMaterial16) PolyVox::SimpleVolume<PolyVox::Material16>;
%template(SimpleVolumeMaterialDensityPair44) PolyVox::SimpleVolume<PolyVox::MaterialDensityPair44>;
%template(SimpleVolumeMaterialDensityPair88) PolyVox::SimpleVolume<PolyVox::MaterialDensityPair88>;
VOLUMETYPES(SimpleVolume, PolyVox::SimpleVolume)