Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1878 - trunk/SwigInterface
- Date: Tue, 27 Nov 2007 12:18:24 -0700 (MST)
Author: abe
Date: Tue Nov 27 12:18:23 2007
New Revision: 1878
Modified:
trunk/SwigInterface/manta.i
trunk/SwigInterface/mantainterface.i
Log:
Moved Array1 container into mantainterface because it is a dependency
of RegularColormap. Added Array1<Color> template.
Added Spectrum to mantainterface.
M SwigInterface/manta.i
M SwigInterface/mantainterface.i
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Tue Nov 27 12:18:23 2007
@@ -296,34 +296,6 @@
%include <Model/Readers/glm/glm.h>
-/////////////////////////////////////////////////
-// The Array Containers
-%{
-#include <Core/Containers/Array1.h>
-%}
-
-// Wrap the class here to get a customized interface to the class.
-namespace Manta {
- template<class T>
- class Array1 {
- public:
- Array1();
- void add(const T&);
- T* get_objs();
- int size();
- %extend {
- T __getitem__( int i ) {
- return self->operator[](i);
- }
- void __setitem__(int i,T val) {
- self->operator[](i) = val;
- }
- }
- };
-}
-
-%template(Array1_ObjectP) Manta::Array1<Manta::Object*>;
-
///////////////////////////////////////////////////////
// Engine Factory
%{
Modified: trunk/SwigInterface/mantainterface.i
==============================================================================
--- trunk/SwigInterface/mantainterface.i (original)
+++ trunk/SwigInterface/mantainterface.i Tue Nov 27 12:18:23 2007
@@ -287,9 +287,34 @@
}
+/////////////////////////////////////////////////
+// The Array Containers
+%{
+#include <Core/Containers/Array1.h>
+%}
+
+// Wrap the class here to get a customized interface to the class.
+namespace Manta {
+ template<class T>
+ class Array1 {
+ public:
+ Array1();
+ void add(const T&);
+ T* get_objs();
+ int size();
+ %extend {
+ T __getitem__( int i ) { return self->operator[](i); }
+ void __setitem__(int i,T val) { self->operator[](i) = val; }
+ int __len__ () { return self->size(); }
+ }
+ };
+}
+%template(Array1_ObjectP) Manta::Array1<Manta::Object*>;
+
%{
#include <MantaTypes.h>
#include <Core/Color/RGBColor.h>
+#include <Core/Color/Spectrum.h>
#include <Core/Color/RGBTraits.h>
#include <Core/Color/GrayColor.h>
#include <Core/Color/Spectrum.h>
@@ -302,6 +327,7 @@
%include <MantaTypes.h>
%include <Core/Color/RGBColor.h>
+%include <Core/Color/Spectrum.h>
%include <Core/Color/RGBTraits.h>
%include <Core/Color/GrayColor.h>
%include <Core/Color/Spectrum.h>
@@ -309,6 +335,8 @@
%include <Core/Color/ColorSpace.h>
%include <Core/Color/ColorSpace_fancy.h>
%include <Core/Color/ColorDB.h>
+
+%template(Array1_Color) Manta::Array1<Manta::Color>;
%include <Core/Color/RegularColorMap.h>
@@ -338,6 +366,7 @@
char* __str__() {
return strdup(self->toString().c_str());
}
+
};
%extend Spectrum {
%newobject __str__;
- [Manta] r1878 - trunk/SwigInterface, abe, 11/27/2007
Archive powered by MHonArc 2.6.16.