Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1005 - in trunk: . SCIRun/include/sci_defs scenes


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1005 - in trunk: . SCIRun/include/sci_defs scenes
  • Date: Mon, 10 Apr 2006 12:41:27 -0600 (MDT)

Author: bigler
Date: Mon Apr 10 12:41:27 2006
New Revision: 1005

Added:
   trunk/SCIRun/include/sci_defs/CMakeLists.txt
   trunk/SCIRun/include/sci_defs/error_defs.h.CMakeTemplate
Removed:
   trunk/SCIRun/include/sci_defs/error_defs.h
Modified:
   trunk/CMakeLists.txt
   trunk/scenes/iwviewer.cc
Log:

CMakeLists.txt

  Added SCIRun/include/sci_defs directory for parsing, so that we can
  binary file configured definitions for the files in here.

SCIRun/include/sci_defs/CMakeLists.txt

  Configurations for error_defs.h.  You should now configure the
  assertion level through CMake.

SCIRun/include/sci_defs/error_defs.h.CMakeTemplate
SCIRun/include/sci_defs/error_defs.h

  Replaced the statically defined version with CMake configurable
  version.

scenes/iwviewer.cc

  Added a -reverse command line option that will reverse the triangle
  winding for the BVH and Linear list builds.


Modified: trunk/CMakeLists.txt
==============================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Mon Apr 10 12:41:27 2006
@@ -202,6 +202,7 @@
                     ${CMAKE_SOURCE_DIR}/SCIRun/include)
 SET(MAIN_SUBDIRS
   SCIRun/Core
+  SCIRun/include/sci_defs
   Core
   include
   Interface

Added: trunk/SCIRun/include/sci_defs/CMakeLists.txt
==============================================================================
--- (empty file)
+++ trunk/SCIRun/include/sci_defs/CMakeLists.txt        Mon Apr 10 12:41:27 
2006
@@ -0,0 +1,18 @@
+##################################################################
+## Configure error_defs.h
+
+SET(SCI_ASSERTION_LEVEL 0 CACHE INT "Level for assertions [0-3]")
+
+SET(USE_SCI_THROW 0 CACHE INTERNAL "Level for exception throwing [0-3]")
+
+SET(UNHANDLED_EXCEPTIONS_CAUGHT TRUE CACHE INTERNAL "Are unhandled 
exceptions caught by the library")
+
+IF(NOT UNHANDLED_EXCEPTIONS_CAUGHT)
+  SET(EXCEPTIONS_CRASH_DEF "#define EXCEPTIONS_CRASH 1" INTERNAL)
+ENDIF(NOT UNHANDLED_EXCEPTIONS_CAUGHT)
+
+CONFIGURE_FILE(
+  ${CMAKE_SOURCE_DIR}/SCIRun/include/sci_defs/error_defs.h.CMakeTemplate
+  ${CMAKE_BINARY_DIR}/include/sci_defs/error_defs.h
+  )
+

Added: trunk/SCIRun/include/sci_defs/error_defs.h.CMakeTemplate
==============================================================================
--- (empty file)
+++ trunk/SCIRun/include/sci_defs/error_defs.h.CMakeTemplate    Mon Apr 10 
12:41:27 2006
@@ -0,0 +1,37 @@
+/*
+   For more information, please see: http://software.sci.utah.edu
+
+   The MIT License
+
+   Copyright (c) 2004 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.
+*/
+
+
+#ifndef SCI_ERROR_DEFS_H
+#define SCI_ERROR_DEFS_H
+
+#define SCI_ASSERTION_LEVEL ${SCI_ASSERTION_LEVEL}
+#define USE_SCI_THROW ${USE_SCI_THROW}
+${EXCEPTIONS_CRASH_DEF}
+
+#endif

Modified: trunk/scenes/iwviewer.cc
==============================================================================
--- trunk/scenes/iwviewer.cc    (original)
+++ trunk/scenes/iwviewer.cc    Mon Apr 10 12:41:27 2006
@@ -74,6 +74,7 @@
 static bool use_default_color = false;
 static int material_type = Lambertian_Material;
 static BBox bounds;
+static bool reverse_tri_order = false;
 
 static Object* buildDynBVH(IWObject* iw);
 static Object* buildKDTree2(IWObject* iw);
@@ -101,6 +102,8 @@
       material_type = Flat_Material;
     } else if (args[i] == "-normal" ) {
       material_type = Normal_Material;
+    } else if (args[i] == "-reverse" ) {
+      reverse_tri_order = true;
     }
   }
 
@@ -187,7 +190,10 @@
         matl = default_material;
       else
         matl = materials[iw->triangles[i][3]];
-      bvh_group->add(new WaldTriangle(matl, iw->va(i), iw->vb(i), 
iw->vc(i)));
+      if (!reverse_tri_order)
+        bvh_group->add(new WaldTriangle(matl, iw->va(i), iw->vb(i), 
iw->vc(i)));
+      else
+        bvh_group->add(new WaldTriangle(matl, iw->va(i), iw->vc(i), 
iw->vb(i)));
     }
     break;
   case Tri:
@@ -197,7 +203,10 @@
         matl = default_material;
       else
         matl = materials[iw->triangles[i][3]];
-      bvh_group->add(new Triangle(matl, iw->va(i), iw->vb(i), iw->vc(i)));
+      if (!reverse_tri_order)
+        bvh_group->add(new Triangle(matl, iw->va(i), iw->vb(i), iw->vc(i)));
+      else
+        bvh_group->add(new Triangle(matl, iw->va(i), iw->vc(i), iw->vb(i)));
     }
     break;
   }




  • [MANTA] r1005 - in trunk: . SCIRun/include/sci_defs scenes, bigler, 04/10/2006

Archive powered by MHonArc 2.6.16.

Top of page