Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1000 - in trunk: . Core/Color Core/Geometry Interface Model/Primitives SwigInterface fox/FManta scenes
- Date: Tue, 4 Apr 2006 11:10:19 -0600 (MDT)
Author: bigler
Date: Tue Apr 4 11:10:18 2006
New Revision: 1000
Modified:
trunk/CMakeLists.txt
trunk/Core/Color/ColorSpace.h
trunk/Core/Geometry/Vector.h
trunk/Interface/RayPacket.h
trunk/Model/Primitives/Triangle.cc
trunk/SwigInterface/CMakeLists.txt
trunk/SwigInterface/manta.i
trunk/fox/FManta/CMakeLists.txt
trunk/scenes/iwviewer.cc
Log:
CMakeLists.txt
fox/FManta/CMakeLists.txt
Change path variables from STRING to PATH. This will allow some
autocompletion in ccmake and different dialogues in the windows
version.
Core/Color/ColorSpace.h
Core/Geometry/Vector.h
Interface/RayPacket.h
Some Swig fixes as well as making some of the cast constructors
private.
Model/Primitives/Triangle.cc
Normal was backwards from everyone else.
SwigInterface/CMakeLists.txt
Add -Wall to the swig compilation.
SwigInterface/manta.i
Some reorganization of the texture stuff.
scenes/iwviewer.cc
Added ability to use different types of materials like Flat and
Normal.
Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt (original)
+++ trunk/CMakeLists.txt Tue Apr 4 11:10:18 2006
@@ -16,8 +16,8 @@
# Set default search directory prefixes for third party libraries like
# fox and teem.
-SET(THIRD_PARTY_LIBRARY_PATH "" CACHE STRING "Default search path for
third-party libraries")
-SET(THIRD_PARTY_INCLUDE_PATH "" CACHE STRING "Default search path for
third-party headers")
+SET(THIRD_PARTY_LIBRARY_PATH "" CACHE PATH "Default search path for
third-party libraries")
+SET(THIRD_PARTY_INCLUDE_PATH "" CACHE PATH "Default search path for
third-party headers")
# Default to building release. I can't tell you how many times folks
# cry because Manta suddenly got slower. This will hopefully
@@ -260,7 +260,7 @@
# Look for Teem
http://teem.sourceforge.net/
# Look for library here before you look in Thirdparty path
-SET(TEEM_INSTALL_PATH "" CACHE STRING "Default search path for Teem install")
+SET(TEEM_INSTALL_PATH "" CACHE PATH "Default search path for Teem install")
FIND_LIBRARY( FOUND_TEEM_LIB NAMES teem
PATHS ${TEEM_INSTALL_PATH}/lib
${THIRD_PARTY_LIBRARY_PATH} /usr/local/lib /usr/lib
Modified: trunk/Core/Color/ColorSpace.h
==============================================================================
--- trunk/Core/Color/ColorSpace.h (original)
+++ trunk/Core/Color/ColorSpace.h Tue Apr 4 11:10:18 2006
@@ -241,11 +241,13 @@
return Traits::luminance(data);
}
-// protected:
- // DO NOT MAKE THIS PUBLIC!
-#ifndef SWIG
+#ifndef SWIG // Swig gets confused about NumComponents, and you can
+ // use the regular [] operators.
ComponentType data[NumComponents];
#endif
+
+ protected:
+ // DO NOT MAKE THIS PUBLIC!
ColorSpace(ComponentType fillValue) {
for(int i=0;i<NumComponents;i++)
data[i] = fillValue;
Modified: trunk/Core/Geometry/Vector.h
==============================================================================
--- trunk/Core/Geometry/Vector.h (original)
+++ trunk/Core/Geometry/Vector.h Tue Apr 4 11:10:18 2006
@@ -327,6 +327,8 @@
return Vector(1,1,1);
}
+#ifndef SWIG // Swig balks about these functions, but when I rename
+ // them it doesn't do anything.
// Friend functions. These will allow the functions to access
// data without having to use a function (hopefully).
template<typename S >
@@ -338,6 +340,7 @@
friend Vector Min(const Vector& v1, const Vector& v2);
friend Vector Max(const Vector& v1, const Vector& v2);
friend Vector Interpolate(const Vector& v1, const Vector& v2, Real
weight);
+#endif
//private:
Real data[3];
Modified: trunk/Interface/RayPacket.h
==============================================================================
--- trunk/Interface/RayPacket.h (original)
+++ trunk/Interface/RayPacket.h Tue Apr 4 11:10:18 2006
@@ -560,10 +560,11 @@
RayPacketData::MaxScratchpadSize);
}
- // private:
+ private:
RayPacket(const RayPacket&);
RayPacket& operator=(const RayPacket&);
+ public:
RayPacketData* data;
int rayBegin;
int rayEnd;
Modified: trunk/Model/Primitives/Triangle.cc
==============================================================================
--- trunk/Model/Primitives/Triangle.cc (original)
+++ trunk/Model/Primitives/Triangle.cc Tue Apr 4 11:10:18 2006
@@ -78,7 +78,7 @@
{
rays.computeHitPositions();
for(int i=rays.begin(); i<rays.end(); i++)
- rays.setNormal(i, Cross((p3-p1),(p2-p1)));
+ rays.setNormal(i, Cross((p2-p1),(p3-p1)));
}
Modified: trunk/SwigInterface/CMakeLists.txt
==============================================================================
--- trunk/SwigInterface/CMakeLists.txt (original)
+++ trunk/SwigInterface/CMakeLists.txt Tue Apr 4 11:10:18 2006
@@ -18,7 +18,7 @@
SWIG_LINK_LIBRARIES(example ${PYTHON_LIBRARIES})
SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES SWIG_FLAGS
"-DSCI_NOPERSISTENT")
+SET_SOURCE_FILES_PROPERTIES(manta.i PROPERTIES SWIG_FLAGS
"-Wall;-DSCI_NOPERSISTENT")
SWIG_ADD_MODULE(manta python manta.i manta.cc manta.h)
Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Tue Apr 4 11:10:18 2006
@@ -243,15 +243,12 @@
#include <Model/Textures/Constant.h>
#include <Model/Textures/CheckerTexture.h>
#include <Model/Textures/ImageTexture.h>
-#include <Model/Textures/NormalTexture.h>
-#include <Model/Groups/KDTree.h>
%}
%include <Interface/Texture.h>
%include <Model/Textures/Constant.h>
%include <Model/Textures/CheckerTexture.h>
%include <Model/Textures/ImageTexture.h>
-%include <Model/Textures/NormalTexture.h>
namespace Manta {
// Textures. If you add a new texture like FunkyTexture<MagicType>,
@@ -266,6 +263,16 @@
%template(CheckerTexture_ColorComponent)
CheckerTexture<Manta::ColorComponent>;
%template(Constant_Color) Constant<Color>;
%template(ImageTexture_Color) ImageTexture<Manta::Color>;
+}
+
+%{
+#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>;
}
Modified: trunk/fox/FManta/CMakeLists.txt
==============================================================================
--- trunk/fox/FManta/CMakeLists.txt (original)
+++ trunk/fox/FManta/CMakeLists.txt Tue Apr 4 11:10:18 2006
@@ -1,5 +1,5 @@
# Look for library here before you look in Thirdparty path
-SET(FOX_INSTALL_PATH "" CACHE STRING "Default search path for Fox install")
+SET(FOX_INSTALL_PATH "" CACHE PATH "Default search path for Fox install")
# Determine the version of fox to use. Case sensitive
SET(FOX_STATIC FOX-1.5 CACHE STRING "Fox Library version string")
Modified: trunk/scenes/iwviewer.cc
==============================================================================
--- trunk/scenes/iwviewer.cc (original)
+++ trunk/scenes/iwviewer.cc Tue Apr 4 11:10:18 2006
@@ -39,6 +39,8 @@
#include <Model/Primitives/Triangle.h>
#include <Model/Primitives/WaldTriangle.h>
#include <Model/Materials/Lambertian.h>
+#include <Model/Materials/Flat.h>
+#include <Model/Textures/NormalTexture.h>
#include <Model/Groups/DynBVH.h>
#include <iostream>
@@ -52,9 +54,16 @@
Tri
};
+enum {
+ Lambertian_Material,
+ Flat_Material,
+ Normal_Material,
+};
+
static string file_name;
static int tri_type = WaldTri;
static bool use_default_color = false;
+static int material_type = Lambertian_Material;
static BBox bounds;
extern "C"
@@ -69,6 +78,10 @@
throw IllegalArgument("iwviewer -file <filename>", i, args);
} else if (args[i] == "-tri" ) {
tri_type = Tri;
+ } else if (args[i] == "-flat" ) {
+ material_type = Flat_Material;
+ } else if (args[i] == "-normal" ) {
+ material_type = Normal_Material;
}
}
@@ -81,7 +94,17 @@
// Make the materials
vector<Material*> materials;
for(size_t i = 0; i < iw->shaders.size(); ++i) {
- materials.push_back(new Lambertian(iw->shaders[i]));
+ switch (material_type) {
+ case Lambertian_Material:
+ materials.push_back(new Lambertian(iw->shaders[i]));
+ break;
+ case Flat_Material:
+ materials.push_back(new Flat(iw->shaders[i]));
+ break;
+ case Normal_Material:
+ materials.push_back(new Flat( new NormalTexture() ));
+ break;
+ }
}
Material* default_material = new Lambertian(Color(RGBColor(0.5,0.6,0.5)));
- [MANTA] r1000 - in trunk: . Core/Color Core/Geometry Interface Model/Primitives SwigInterface fox/FManta scenes, bigler, 04/04/2006
Archive powered by MHonArc 2.6.16.