Text archives Help
- From: thiago@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1256 - in trunk: Interface Model/Groups Model/Materials include scenes
- Date: Fri, 8 Dec 2006 18:45:28 -0700 (MST)
Author: thiago
Date: Fri Dec 8 18:45:27 2006
New Revision: 1256
Added:
trunk/Model/Materials/Null.h
trunk/include/UsePrivateCode.h.CMakeTemplate
Modified:
trunk/Interface/Context.h
trunk/Interface/RayPacket.h
trunk/Model/Groups/CMakeLists.txt
trunk/include/CMakeLists.txt
trunk/scenes/primtest.cc
Log:
Support code for the Coherent Grid Traverser.
scenes/primtest.cc: If you load a ply file it will use the coherent
grid traverser.
include/UsePrivateCode.h.CMakeTemplate,
include/CMakeLists.txt,
Model/Groups/CMakeLists.txt: If you have "private" directory it will
use code from inside it, otherwise it won't.
Interface/Context.h: Allow for parallelizable preprocess by including
the number of total preprocess threads and the current thread id.
Interface/RayPacket.h: The CGT needs sse corner rays. Not sure if this
is too intrusive to the rest of manta...
Model/Materials/Null.h: Material that does nothing. Useful if you
don't want materials to factor into benchmarks or profiling.
Modified: trunk/Interface/Context.h
==============================================================================
--- trunk/Interface/Context.h (original)
+++ trunk/Interface/Context.h Fri Dec 8 18:45:27 2006
@@ -185,8 +185,10 @@
class PreprocessContext {
public:
PreprocessContext() {}
- PreprocessContext(MantaInterface* manta_interface, LightSet*
globalLights)
- : manta_interface(manta_interface), globalLights(globalLights)
+ PreprocessContext(MantaInterface* manta_interface, LightSet*
globalLights,
+ int proc=0, int numProcs=1)
+ : manta_interface(manta_interface), globalLights(globalLights),
+ proc(proc), numProcs(numProcs)
{
}
~PreprocessContext()
@@ -195,6 +197,9 @@
MantaInterface* manta_interface;
LightSet* globalLights;
+ int proc;
+ int numProcs;
+
private:
PreprocessContext(const PreprocessContext&);
PreprocessContext& operator=(const PreprocessContext&);
Modified: trunk/Interface/RayPacket.h
==============================================================================
--- trunk/Interface/RayPacket.h (original)
+++ trunk/Interface/RayPacket.h Fri Dec 8 18:45:27 2006
@@ -87,6 +87,10 @@
MaterialCP hitMatl[MaxSize];
TexCoordMapperCP hitTex[MaxSize];
+#ifdef MANTA_SSE
+ sse_t corner_dir[3];
+#endif
+
// Real-based arrays
MANTA_ALIGN(16) Real origin[3][MaxSize];
MANTA_ALIGN(16) Real direction[3][MaxSize];
Modified: trunk/Model/Groups/CMakeLists.txt
==============================================================================
--- trunk/Model/Groups/CMakeLists.txt (original)
+++ trunk/Model/Groups/CMakeLists.txt Fri Dec 8 18:45:27 2006
@@ -64,6 +64,20 @@
)
ENDIF(MANTA_SSE)
+# Include private code if available
+IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Groups/private )
+# SUBDIRS (Groups/private)
+ INCLUDE (Groups/private/CMakeLists.txt)
+ELSE (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Groups/private)
+ SET(USE_PRIVATE_CODE_DEF "0" CACHE INTERNAL "Disable use of private code")
+ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Groups/private)
+
+CONFIGURE_FILE(
+ ${CMAKE_SOURCE_DIR}/include/UsePrivateCode.h.CMakeTemplate
+ ${CMAKE_BINARY_DIR}/include/UsePrivateCode.h
+)
+
+
IF(BUILD_NRRDPARTICLES)
SET(Manta_Groups_SRCS
${Manta_Groups_SRCS}
Added: trunk/Model/Materials/Null.h
==============================================================================
--- (empty file)
+++ trunk/Model/Materials/Null.h Fri Dec 8 18:45:27 2006
@@ -0,0 +1,51 @@
+
+#ifndef Manta_Model_Flat_h
+#define Manta_Model_Flat_h
+
+/*
+ For more information, please see:
http://software.sci.utah.edu
+
+ The MIT License
+
+ Copyright (c) 2005
+ 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 <Core/Color/Color.h>
+
+#include <Interface/Material.h>
+#include <Interface/Texture.h>
+
+
+
+namespace Manta {
+ class Null : public Material {
+ public:
+
+ virtual void preprocess(const PreprocessContext&) { }
+ virtual void shade(const RenderContext& context, RayPacket& rays) const
{ }
+
+ private:
+ };
+}
+
+#endif
Modified: trunk/include/CMakeLists.txt
==============================================================================
--- trunk/include/CMakeLists.txt (original)
+++ trunk/include/CMakeLists.txt Fri Dec 8 18:45:27 2006
@@ -4,7 +4,7 @@
IF(MANTA_SSE)
# If we want to use sse we need to have MANTA_REAL be float
IF(MANTA_REAL STREQUAL "double")
- MESSAGE("For SSE, MANTA_REAL must be double. Changing...")
+ MESSAGE("For SSE, MANTA_REAL must be float. Changing...")
ENDIF(MANTA_REAL STREQUAL "double")
SET(MANTA_REAL float CACHE STRING "Typedef for Real" FORCE)
ELSE(MANTA_SSE)
Added: trunk/include/UsePrivateCode.h.CMakeTemplate
==============================================================================
--- (empty file)
+++ trunk/include/UsePrivateCode.h.CMakeTemplate Fri Dec 8 18:45:27
2006
@@ -0,0 +1,8 @@
+#ifndef Manta_Use_Private_Code_h
+#define Manta_Use_Private_Code_h
+
+#if ${USE_PRIVATE_CODE_DEF}
+#define USE_PRIVATE_CODE 1
+#endif
+
+#endif
Modified: trunk/scenes/primtest.cc
==============================================================================
--- trunk/scenes/primtest.cc (original)
+++ trunk/scenes/primtest.cc Fri Dec 8 18:45:27 2006
@@ -7,6 +7,7 @@
#include <Interface/Scene.h>
#include <Model/AmbientLights/ArcAmbient.h>
#include <Model/Backgrounds/LinearBackground.h>
+#include <Model/Backgrounds/ConstantBackground.h>
#include <Model/MiscObjects/Difference.h>
#include <Model/MiscObjects/Intersection.h>
#include <Model/Groups/Group.h>
@@ -16,6 +17,7 @@
#include <Model/Materials/Lambertian.h>
#include <Model/Materials/MetalMaterial.h>
#include <Model/Materials/Phong.h>
+#include <Model/Materials/Null.h>
#include <Model/Instances/Instance.h>
#include <Model/Instances/InstanceRT.h>
#include <Model/Instances/InstanceRST.h>
@@ -44,6 +46,13 @@
#include <iostream>
#include <sgi_stl_warnings_on.h>
+#include "UsePrivateCode.h"
+#ifdef USE_PRIVATE_CODE
+#include <Model/Groups/private/CGT.h>
+#include <fstream>
+#endif
+
+
using namespace Manta;
using namespace std;
@@ -110,6 +119,8 @@
32, (ColorComponent)0.4);
else if(material == "redlambertian")
matl=new Lambertian(Color(RGB(.6,0,0)));
+ else if(material == "null")
+ matl=new Null();
else if(material == "metal")
matl = new MetalMaterial(Color(RGB(0.7,0.7,0.8)));
else if(material == "checker")
@@ -270,12 +281,25 @@
prim->setTexCoordMapper( mapr );
spinprim = prim;
} else if(primtype == "ply"){
+#ifdef USE_PRIVATE_CODE
+ bgpoly = false;
AffineTransform t;
- t.initWithScale(Vector(scale/max*30, scale/max*30, scale/max*30));
- Group *model = new Group();
- if (!readPlyFile(modelName, t, model, 0, matl))
- printf("error loading or reading ply file: %s\n",
modelName.c_str()); //would be better to throw an error.
- group->add(model);
+ //t.initWithScale(Vector(100, 100, 100));
+ t.initWithScale(Vector(1, 1, 1));
+ delete group; group = new Grid();
+ /*
+ ifstream in(modelName.c_str());
+ while (in) {
+ float x,y,z, d1, d2, d3, id;
+ in >>x >>y>>z>>d1>> d2>> d3>> id;
+ Vector center(x,y,z);
+ group->add(new Sphere(matl, center, .001 ));
+ }
+ */
+
+ if (!readPlyFile(modelName, t, group, 0, matl))
+ printf("error loading or reading ply file: %s\n", modelName.c_str());
//would be better to throw an error.
+#endif //USE_PRIVATE_CODE
} else if (primtype == "heightfield") {
Primitive* prim = new Heightfield(matl, "../sinc200x200.hf",
Vector(-0.2, -0.2, 0.2), Vector(0.2, 0.2, 0.4));
if ( mapr )
- [MANTA] r1256 - in trunk: Interface Model/Groups Model/Materials include scenes, thiago, 12/08/2006
Archive powered by MHonArc 2.6.16.