Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1214 - in trunk: CMake Image Model/Materials SwigInterface
- Date: Tue, 10 Oct 2006 02:11:41 -0600 (MDT)
Author: abe
Date: Tue Oct 10 02:11:37 2006
New Revision: 1214
Added:
trunk/SwigInterface/mantart.i
Modified:
trunk/CMake/MantaUseSWIG.cmake
trunk/Image/TGAFile.cc
trunk/Model/Materials/Lambertian.cc
trunk/Model/Materials/Lambertian.h
trunk/SwigInterface/CMakeLists.txt
trunk/SwigInterface/kdtreedyn.py
trunk/SwigInterface/manta.i
trunk/SwigInterface/runmanta.py
trunk/SwigInterface/wxManta.py
Log:
Separated swig build into two pieces:
-- manta.i contains wrappers for Manta Interfaces and core utilities.
-- mantart.i (rt == run-time) contains wrappers for everything else.
manta.i should be %imported into swig builds for outside libraries
that will link to the Manta shared libraries. Both generated python
modules will be imported into scripts.
See:
http://code.sci.utah.edu/Manta/index.php/Manta_project
M SwigInterface/kdtreedyn.py
M SwigInterface/manta.i
A SwigInterface/mantart.i
M SwigInterface/CMakeLists.txt
Added import statements for both manta and mantart modules.
M SwigInterface/wxManta.py
M SwigInterface/runmanta.py
Added code to write out empty.depend.in, but commented it out after
cmake printed a warning on every build.
M CMake/MantaUseSWIG.cmake
Added license text.
M Model/Materials/Lambertian.cc
M Model/Materials/Lambertian.h
Clarified exception message. We need to implement conversion methods
for the new pixel formats.
M Image/TGAFile.cc
Modified: trunk/CMake/MantaUseSWIG.cmake
==============================================================================
--- trunk/CMake/MantaUseSWIG.cmake (original)
+++ trunk/CMake/MantaUseSWIG.cmake Tue Oct 10 02:11:37 2006
@@ -47,6 +47,15 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Generate the empty.depend.in file necessary for
+# dependency checking.
+#
+
+# Output the empty depend file.
+# FILE(WRITE ${CMAKE_SOURCE_DIR}/CMake/empty.depend.in "")
+
+
# We need python to do some dependency checks
FIND_PACKAGE(PythonInterp)
IF(NOT PYTHONINTERP_FOUND)
@@ -346,4 +355,6 @@
MESSAGE(SEND_ERROR "Cannot find Swig library \"${name}\".")
ENDIF(SWIG_MODULE_${name}_REAL_NAME)
ENDMACRO(SWIG_LINK_LIBRARIES name)
+
+
Modified: trunk/Image/TGAFile.cc
==============================================================================
--- trunk/Image/TGAFile.cc (original)
+++ trunk/Image/TGAFile.cc Tue Oct 10 02:11:37 2006
@@ -157,7 +157,7 @@
++buffer;
}
} else {
- throw InternalError( "Unknown image type in writeTGA()", __FILE__,
__LINE__ );
+ throw InternalError( "Unknown image/pixel type in writeTGA()",
__FILE__, __LINE__ );
}
}
Modified: trunk/Model/Materials/Lambertian.cc
==============================================================================
--- trunk/Model/Materials/Lambertian.cc (original)
+++ trunk/Model/Materials/Lambertian.cc Tue Oct 10 02:11:37 2006
@@ -1,3 +1,30 @@
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005-2006
+ Scientific Computing and Imaging Institute, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
#include <Model/Materials/Lambertian.h>
#include <Interface/Light.h>
Modified: trunk/Model/Materials/Lambertian.h
==============================================================================
--- trunk/Model/Materials/Lambertian.h (original)
+++ trunk/Model/Materials/Lambertian.h Tue Oct 10 02:11:37 2006
@@ -2,6 +2,34 @@
#ifndef Manta_Model_Lambertian_h
#define Manta_Model_Lambertian_h
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005-2006
+ Scientific Computing and Imaging Institute, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
#include <Model/Materials/LitMaterial.h>
#include <Core/Color/Color.h>
#include <Interface/Texture.h>
Modified: trunk/SwigInterface/CMakeLists.txt
==============================================================================
--- trunk/SwigInterface/CMakeLists.txt (original)
+++ trunk/SwigInterface/CMakeLists.txt Tue Oct 10 02:11:37 2006
@@ -34,7 +34,7 @@
# SWIG_LINK_LIBRARIES(example ${PYTHON_LIBRARIES})
############################################################
-# Manta Swig/Python
+# Manta Interface.
SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES SWIG_FLAGS
"-Wall;-DSCI_NOPERSISTENT")
SWIG_ADD_MODULE(manta python manta.i manta.cc manta.h)
@@ -48,6 +48,22 @@
-lm)
ADD_DEPENDENCIES(_manta ${MANTA_TARGET_LINK_LIBRARIES})
+############################################################
+# Manta Runtime.
+SET_SOURCE_FILES_PROPERTIES(mantart.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(mantart.i PROPERTIES SWIG_FLAGS
"-Wall;-DSCI_NOPERSISTENT")
+SWIG_ADD_MODULE(mantart python mantart.i manta.cc manta.h)
+
+SWIG_LINK_LIBRARIES(mantart
+ ${PYTHON_LIBRARIES}
+ ${MANTA_TARGET_LINK_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
+ ${OPENGL_LIBRARIES}
+ ${X11_LIBRARIES}
+ -lm)
+ADD_DEPENDENCIES(_mantart ${MANTA_TARGET_LINK_LIBRARIES})
+
+# X11 Interface.
PYTHON_POST_BUILD_COPY(runmanta.py)
############################################################
Modified: trunk/SwigInterface/kdtreedyn.py
==============================================================================
--- trunk/SwigInterface/kdtreedyn.py (original)
+++ trunk/SwigInterface/kdtreedyn.py Tue Oct 10 02:11:37 2006
@@ -4,6 +4,7 @@
import getopt, sys
from manta import *
+from mantart import *
from KDTreeDynFrame import *
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Tue Oct 10 02:11:37 2006
@@ -1,10 +1,38 @@
/* manta.i */
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005-2006
+ Scientific Computing and Imaging Institute, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
%module manta
+
%include "std_string.i"
%include "std_vector.i"
%include "exception.i"
-
%{
#include <MantaTypes.h>
#include <Core/Geometry/Vector.h>
@@ -23,6 +51,9 @@
%template(VectorT_Real3) VectorT<Manta::Real, 3>;
}
+///////////////////////////////////////////////////////
+// Exceptions
+
%{
#include <Core/Exceptions/share.h>
#include <Core/Exceptions/Exception.h>
@@ -282,33 +313,17 @@
%{
#include <Interface/ImageDisplay.h>
-#include <Engine/Display/SyncDisplay.h>
-#include <Engine/Display/OpenGLDisplay.h>
-#include <Engine/Display/PureOpenGLDisplay.h>
-#include <Engine/Display/NullDisplay.h>
%}
-%manta_Release_PythonGIL(Manta::SyncDisplay::waitOnFrameReady);
-%manta_SCIRun_Exception(Manta::PureOpenGLDisplay::PureOpenGLDisplay);
-%manta_SCIRun_Exception(Manta::PureOpenGLDisplay::setMode);
-
%include <Interface/ImageDisplay.h>
-%include <Engine/Display/SyncDisplay.h>
-%include <Engine/Display/OpenGLDisplay.h>
-%include <Engine/Display/PureOpenGLDisplay.h>
-%include <Engine/Display/NullDisplay.h>
///////////////////////////////////////////////////////
// UI
%{
#include <Interface/UserInterface.h>
-#include <UserInterface/AutomatorUI.h>
-#include <UserInterface/SyncFrameAutomator.h>
%}
%include <Interface/UserInterface.h>
-%include <UserInterface/AutomatorUI.h>
-%include <UserInterface/SyncFrameAutomator.h>
////////////////////////////////////////////////////////
@@ -317,21 +332,13 @@
#include <Interface/Light.h>
#include <Interface/LightSet.h>
#include <Interface/AmbientLight.h>
-#include <Model/AmbientLights/ConstantAmbient.h>
#include <Interface/Background.h>
-#include <Model/Backgrounds/ConstantBackground.h>
-#include <Model/Lights/PointLight.h>
-#include <Model/Lights/HeadLight.h>
%}
%include <Interface/Light.h>
%include <Interface/LightSet.h>
%include <Interface/AmbientLight.h>
-%include <Model/AmbientLights/ConstantAmbient.h>
%include <Interface/Background.h>
-%include <Model/Backgrounds/ConstantBackground.h>
-%include <Model/Lights/PointLight.h>
-%include <Model/Lights/HeadLight.h>
namespace Manta {
// This tells SWIG to deallocate the memory from toString functions.
@@ -350,197 +357,59 @@
}
};
- %extend Light {
- Manta::PointLight* asPointLight() {
- return dynamic_cast<Manta::PointLight*>(self);
- }
- };
-
- %extend Light {
- Manta::HeadLight* asHeadLight() {
- return dynamic_cast<Manta::HeadLight*>(self);
- }
- };
-
-// %extend PointLight {
-// static PointLight* fromLight(Light* parent) {
-// return dynamic_cast<Manta::PointLight*>(parent);
-// }
-// };
}
/////////////////////////////////////////////////////
// Image stuff
-%{
-#include <Image/TGAFile.h>
-%}
-
-%include <Image/TGAFile.h>
/////////////////////////////////////////////////////
// Textures
%{
#include <Interface/Texture.h>
#include <Interface/Packet.h>
-#include <Model/Textures/Constant.h>
-#include <Model/Textures/CheckerTexture.h>
-#include <Model/Textures/ImageTexture.h>
%}
%include <Interface/Texture.h>
%include <Interface/Packet.h>
-%include <Model/Textures/Constant.h>
-%include <Model/Textures/CheckerTexture.h>
-%include <Model/Textures/ImageTexture.h>
-namespace Manta {
- // Textures. If you add a new texture like FunkyTexture<MagicType>,
- // you also need to add a template for Texture<MagicType> to reduce
- // warnings.
- %template(Texture_Color) Texture<Color>;
- %template(Texture_Real) Texture<Manta::Real>;
- %template(Texture_ColorComponent) Texture<Manta::ColorComponent>;
-
- %template(CheckerTexture_Color) CheckerTexture<Color>;
- %template(CheckerTexture_Real) CheckerTexture<Manta::Real>;
- %template(CheckerTexture_ColorComponent)
CheckerTexture<Manta::ColorComponent>;
- %template(Constant_Color) Constant<Color>;
- %template(ImageTexture_Color) ImageTexture<Manta::Color>;
-}
/////////////////////////////////////////////////////
// Materials and Primitivs
%{
#include <Interface/Material.h>
-#include <Model/Materials/LitMaterial.h>
-#include <Model/Materials/Phong.h>
-#include <Model/Materials/Lambertian.h>
-#include <Model/Materials/MetalMaterial.h>
-#include <Model/Materials/Dielectric.h>
-#include <Model/Materials/Flat.h>
-#include <Model/Materials/Transparent.h>
-#include <Model/Groups/Group.h>
-#include <Model/Primitives/PrimitiveCommon.h>
#include <Interface/TexCoordMapper.h>
-#include <Model/Primitives/Parallelogram.h>
-#include <Model/Primitives/Sphere.h>
-#include <Model/Primitives/Plane.h>
-#include <Model/Primitives/Ring.h>
-#include <Model/Primitives/Cube.h>
-#include <Model/TexCoordMappers/UniformMapper.h>
-#include <Model/Groups/RealisticBvh.h>
%}
%include <Interface/Material.h>
-%include <Model/Materials/LitMaterial.h>
-%include <Model/Materials/Phong.h>
-%include <Model/Materials/Lambertian.h>
-%include <Model/Materials/MetalMaterial.h>
-%include <Model/Materials/Dielectric.h>
-%include <Model/Materials/Flat.h>
-%include <Model/Materials/Transparent.h>
-%include <Model/Groups/Group.h>
-%include <Model/Primitives/PrimitiveCommon.h>
%include <Interface/TexCoordMapper.h>
-%include <Model/Primitives/Parallelogram.h>
-%include <Model/Primitives/Sphere.h>
-%include <Model/Primitives/Plane.h>
-%include <Model/Primitives/Ring.h>
-%include <Model/Primitives/Cube.h>
-%include <Model/TexCoordMappers/UniformMapper.h>
-%include <Model/Groups/RealisticBvh.h>
///////////////////////////////////////////////////////////////////////////////
// Groups
-%{
-#include <Model/Textures/NormalTexture.h>
-#include <Model/Groups/KDTree.h>
-%}
-
-%include <Model/Textures/NormalTexture.h>
-
-namespace Manta {
- %template(WireframeTexture_Color)
WireframeTexture<Manta::Kdtree::KDTree::ScratchPadInfo,Color>;
- %template(WireframeTexture_ColorComponent)
WireframeTexture<Manta::Kdtree::KDTree::ScratchPadInfo,Manta::ColorComponent>;
-}
-
-%{
-#include <Model/Groups/KDTreeDyn.h>
-#include <Model/Groups/Load_OBJ_KDTreeDyn.h>
-#include <Model/Groups/Build_OnLogn_cc.h>
-#include <Model/Groups/Build_Approx_cc.h>
-%}
-
-%include <Model/Groups/KDTreeDyn.h>
-%include <Model/Groups/Load_OBJ_KDTreeDyn.h>
-%include <Model/Groups/Build_OnLogn_cc.h>
-%include <Model/Groups/Build_Approx_cc.h>
-
/////////////////////////////////////////////////
// GLM.
-%{
-#include <Model/Readers/glm/glm.h>
-%}
-
-%include <Model/Readers/glm/glm.h>
/////////////////////////////////////////////////
// The Array Containers
-%{
-#include <SCIRun/Core/Containers/Array1.h>
-%}
-%include <SCIRun/Core/Containers/Array1.h>
-
-%template(Array1_ObjectP) SCIRun::Array1<Manta::Object*>;
///////////////////////////////////////////////////////
// Engine Control
-%{
-#include <Engine/Control/RTRT.h>
-%}
-
-%include <Engine/Control/RTRT.h>
-
-
////////////////////////////////////////////////
// Thread stuff
-%{
-#include <SCIRun/Core/Thread/Thread.h>
-%}
-
-// yield is a "future" reserved word for some versions of python.
-// This renames it to be something else.
-%rename(yieldProcess) yield;
-%include <SCIRun/Core/Thread/Thread.h>
-%rename(yield) yield;
-
-// namespace SCIRun {
-// struct Thread {
-// public:
-// static int numProcessors();
-// };
-// }
////////////////////////////////////////////////
// Python specific code
%pythoncode %{
-# This code is to do crazy stuff like
-# myobj = CoolThing(new Stuff());
-#
-# myobj = CoolThing(manta_new(Stuff()))
-
+
def manta_new(obj):
obj.thisown = 0
return obj
def manta_delete(obj):
obj.thisown = 1
- return obj
-
-
+ return obj
%}
Added: trunk/SwigInterface/mantart.i
==============================================================================
--- (empty file)
+++ trunk/SwigInterface/mantart.i Tue Oct 10 02:11:37 2006
@@ -0,0 +1,265 @@
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005-2006
+ Scientific Computing and Imaging Institute, University of Utah
+
+ License for the specific language governing rights and limitations under
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+*/
+
+%module mantart
+
+%include "std_string.i"
+%include "std_vector.i"
+%include "exception.i"
+
+%import manta.i
+
+///////////////////////////////////////////////////////
+// Exceptions
+
+// Wrappers for these are generated in manta.i, only
+// the headers are needed here.
+%{
+#include <Core/Exceptions/Exception.h>
+#include <Core/Exceptions/IllegalArgument.h>
+#include <Core/Exceptions/IllegalValue.h>
+#include <Core/Exceptions/BadPrimitive.h>
+#include <Core/Exceptions/InvalidState.h>
+#include <Core/Exceptions/UnknownColor.h>
+%}
+
+///////////////////////////////////////////////////////
+// ImageDisplay
+typedef int Window;
+
+%{
+#include <Engine/Display/SyncDisplay.h>
+#include <Engine/Display/OpenGLDisplay.h>
+#include <Engine/Display/PureOpenGLDisplay.h>
+#include <Engine/Display/NullDisplay.h>
+%}
+
+%manta_Release_PythonGIL(Manta::SyncDisplay::waitOnFrameReady);
+%manta_SCIRun_Exception(Manta::PureOpenGLDisplay::PureOpenGLDisplay);
+%manta_SCIRun_Exception(Manta::PureOpenGLDisplay::setMode);
+
+%include <Engine/Display/SyncDisplay.h>
+%include <Engine/Display/OpenGLDisplay.h>
+%include <Engine/Display/PureOpenGLDisplay.h>
+%include <Engine/Display/NullDisplay.h>
+
+///////////////////////////////////////////////////////
+// UI
+%{
+#include <UserInterface/AutomatorUI.h>
+#include <UserInterface/SyncFrameAutomator.h>
+%}
+
+%include <UserInterface/AutomatorUI.h>
+%include <UserInterface/SyncFrameAutomator.h>
+
+
+////////////////////////////////////////////////////////
+// Lights and backgrounds
+%{
+#include <Model/AmbientLights/ConstantAmbient.h>
+#include <Model/Backgrounds/ConstantBackground.h>
+#include <Model/Lights/PointLight.h>
+#include <Model/Lights/HeadLight.h>
+%}
+
+%include <Model/AmbientLights/ConstantAmbient.h>
+%include <Model/Backgrounds/ConstantBackground.h>
+%include <Model/Lights/PointLight.h>
+%include <Model/Lights/HeadLight.h>
+
+namespace Manta {
+
+ %extend Light {
+ Manta::PointLight* asPointLight() {
+ return dynamic_cast<Manta::PointLight*>(self);
+ }
+ };
+
+ %extend Light {
+ Manta::HeadLight* asHeadLight() {
+ return dynamic_cast<Manta::HeadLight*>(self);
+ }
+ };
+
+// %extend PointLight {
+// static PointLight* fromLight(Light* parent) {
+// return dynamic_cast<Manta::PointLight*>(parent);
+// }
+// };
+}
+
+/////////////////////////////////////////////////////
+// Image stuff
+%{
+#include <Image/TGAFile.h>
+%}
+
+%include <Image/TGAFile.h>
+
+/////////////////////////////////////////////////////
+// Textures
+%{
+#include <Model/Textures/Constant.h>
+#include <Model/Textures/CheckerTexture.h>
+#include <Model/Textures/ImageTexture.h>
+%}
+
+%include <Model/Textures/Constant.h>
+%include <Model/Textures/CheckerTexture.h>
+%include <Model/Textures/ImageTexture.h>
+
+namespace Manta {
+ // Textures. If you add a new texture like FunkyTexture<MagicType>,
+ // you also need to add a template for Texture<MagicType> to reduce
+ // warnings.
+ %template(Texture_Color) Texture<Color>;
+ %template(Texture_Real) Texture<Manta::Real>;
+ %template(Texture_ColorComponent) Texture<Manta::ColorComponent>;
+
+ %template(CheckerTexture_Color) CheckerTexture<Color>;
+ %template(CheckerTexture_Real) CheckerTexture<Manta::Real>;
+ %template(CheckerTexture_ColorComponent)
CheckerTexture<Manta::ColorComponent>;
+ %template(Constant_Color) Constant<Color>;
+ %template(ImageTexture_Color) ImageTexture<Manta::Color>;
+}
+
+/////////////////////////////////////////////////////
+// Materials and Primitivs
+%{
+#include <Model/Materials/LitMaterial.h>
+#include <Model/Materials/Phong.h>
+#include <Model/Materials/Lambertian.h>
+#include <Model/Materials/MetalMaterial.h>
+#include <Model/Materials/Dielectric.h>
+#include <Model/Materials/Flat.h>
+#include <Model/Materials/Transparent.h>
+#include <Model/Groups/Group.h>
+#include <Model/Primitives/PrimitiveCommon.h>
+#include <Model/Primitives/Parallelogram.h>
+#include <Model/Primitives/Sphere.h>
+#include <Model/Primitives/Plane.h>
+#include <Model/Primitives/Ring.h>
+#include <Model/Primitives/Cube.h>
+#include <Model/TexCoordMappers/UniformMapper.h>
+#include <Model/Groups/RealisticBvh.h>
+%}
+
+%include <Model/Materials/LitMaterial.h>
+%include <Model/Materials/Phong.h>
+%include <Model/Materials/Lambertian.h>
+%include <Model/Materials/MetalMaterial.h>
+%include <Model/Materials/Dielectric.h>
+%include <Model/Materials/Flat.h>
+%include <Model/Materials/Transparent.h>
+%include <Model/Groups/Group.h>
+%include <Model/Primitives/PrimitiveCommon.h>
+%include <Model/Primitives/Parallelogram.h>
+%include <Model/Primitives/Sphere.h>
+%include <Model/Primitives/Plane.h>
+%include <Model/Primitives/Ring.h>
+%include <Model/Primitives/Cube.h>
+%include <Model/TexCoordMappers/UniformMapper.h>
+%include <Model/Groups/RealisticBvh.h>
+
+///////////////////////////////////////////////////////////////////////////////
+// Groups
+
+%{
+#include <Model/Textures/NormalTexture.h>
+#include <Model/Groups/KDTree.h>
+%}
+
+%include <Model/Textures/NormalTexture.h>
+
+namespace Manta {
+ %template(WireframeTexture_Color)
WireframeTexture<Manta::Kdtree::KDTree::ScratchPadInfo,Color>;
+ %template(WireframeTexture_ColorComponent)
WireframeTexture<Manta::Kdtree::KDTree::ScratchPadInfo,Manta::ColorComponent>;
+}
+
+%{
+#include <Model/Groups/KDTreeDyn.h>
+#include <Model/Groups/Load_OBJ_KDTreeDyn.h>
+#include <Model/Groups/Build_OnLogn_cc.h>
+#include <Model/Groups/Build_Approx_cc.h>
+%}
+
+%include <Model/Groups/KDTreeDyn.h>
+%include <Model/Groups/Load_OBJ_KDTreeDyn.h>
+%include <Model/Groups/Build_OnLogn_cc.h>
+%include <Model/Groups/Build_Approx_cc.h>
+
+/////////////////////////////////////////////////
+// GLM.
+%{
+#include <Model/Readers/glm/glm.h>
+%}
+
+%include <Model/Readers/glm/glm.h>
+
+/////////////////////////////////////////////////
+// The Array Containers
+%{
+#include <SCIRun/Core/Containers/Array1.h>
+%}
+%include <SCIRun/Core/Containers/Array1.h>
+
+%template(Array1_ObjectP) SCIRun::Array1<Manta::Object*>;
+
+///////////////////////////////////////////////////////
+// Engine Control
+%{
+#include <Engine/Control/RTRT.h>
+%}
+
+%include <Engine/Control/RTRT.h>
+
+
+
+////////////////////////////////////////////////
+// Thread stuff
+%{
+#include <SCIRun/Core/Thread/Thread.h>
+%}
+
+// yield is a "future" reserved word for some versions of python.
+// This renames it to be something else.
+%rename(yieldProcess) yield;
+
+%include <SCIRun/Core/Thread/Thread.h>
+
+%rename(yield) yield;
+
+// namespace SCIRun {
+// struct Thread {
+// public:
+// static int numProcessors();
+// };
+// }
+
Modified: trunk/SwigInterface/runmanta.py
==============================================================================
--- trunk/SwigInterface/runmanta.py (original)
+++ trunk/SwigInterface/runmanta.py Tue Oct 10 02:11:37 2006
@@ -1,4 +1,5 @@
from manta import *
+from mantart import *
def createDefaultScenePython():
scene = manta_new(Scene())
Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py (original)
+++ trunk/SwigInterface/wxManta.py Tue Oct 10 02:11:37 2006
@@ -10,6 +10,7 @@
import os
from manta import *
+from mantart import *
from pycallback import *
import FloatSpin as FS
- [MANTA] r1214 - in trunk: CMake Image Model/Materials SwigInterface, abe, 10/10/2006
Archive powered by MHonArc 2.6.16.