Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1529 - in trunk: Model/Groups include
- Date: Sat, 21 Jul 2007 20:12:28 -0600 (MDT)
Author: abe
Date: Sat Jul 21 20:12:27 2007
New Revision: 1529
Added:
trunk/include/DynBVH_Parameters.h.CMakeTemplate
Modified:
trunk/Model/Groups/DynBVH.cc
trunk/include/CMakeLists.txt
Log:
Added a cmake cache variable to enable and disable the
USE_DYNBVH_PORTS option in DynBVH.cc. Configure using the cmake
MANTA_USE_DYNBVH_PORTS variable in ccmake. Default is on.
This can be used in Manta-projects to check the build configuration at
compile time:
// Check DynBVH configuration in a Manta-project build
#include <DynBVH_Parameters.h>
#if USE_DYNBVH_PORTS != 1
#error USE_DYNBVH_PORTS is enabled in Manta build.
#endif
M include/CMakeLists.txt
A include/DynBVH_Parameters.h.CMakeTemplate
M Model/Groups/DynBVH.cc
Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc (original)
+++ trunk/Model/Groups/DynBVH.cc Sat Jul 21 20:12:27 2007
@@ -1,4 +1,5 @@
#include <Model/Groups/DynBVH.h>
+#include <DynBVH_Parameters.h>
#include <stdio.h>
#include <stdlib.h>
#include <float.h>
@@ -12,12 +13,6 @@
// these constants control the SAH cost model
const float BVH_C_isec = 10.f;
const float BVH_C_trav = 10.f;
-
-#ifdef MANTA_SSE
-#define USE_DYNBVH_PORTS 1
-#else
-#define USE_DYNBVH_PORTS 0
-#endif
void DynBVH::intersect(const RenderContext& context, RayPacket& rays) const
{
Modified: trunk/include/CMakeLists.txt
==============================================================================
--- trunk/include/CMakeLists.txt (original)
+++ trunk/include/CMakeLists.txt Sat Jul 21 20:12:27 2007
@@ -84,3 +84,19 @@
${CMAKE_CURRENT_SOURCE_DIR}/RegisterConfigurableComponents.h.CMakeTemplate
${CMAKE_BINARY_DIR}/include/RegisterConfigurableComponents.h
)
+
+###############################################################################
+## Configure DynBVH_Parameters.h
+
+SET(MANTA_USE_DYNBVH_PORTS ON CACHE BOOL "Use templated DynBVH Code")
+
+IF(MANTA_USE_DYNBVH_PORTS)
+ SET(MANTA_USE_DYNBVH_PORTS_DEF "1")
+ELSE(MANTA_USE_DYNBVH_PORTS)
+ SET(MANTA_USE_DYNBVH_PORTS_DEF "0")
+ENDIF(MANTA_USE_DYNBVH_PORTS)
+
+CONFIGURE_FILE(
+ ${CMAKE_CURRENT_SOURCE_DIR}/DynBVH_Parameters.h.CMakeTemplate
+ ${CMAKE_BINARY_DIR}/include/DynBVH_Parameters.h
+ )
\ No newline at end of file
Added: trunk/include/DynBVH_Parameters.h.CMakeTemplate
==============================================================================
--- (empty file)
+++ trunk/include/DynBVH_Parameters.h.CMakeTemplate Sat Jul 21 20:12:27
2007
@@ -0,0 +1,47 @@
+
+
+/*
+ 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.
+*/
+
+#ifndef DynBVH_Parameters_h
+#define DynBVH_Parameters_h
+
+#include <MantaSSE.h>
+
+#ifdef MANTA_SSE
+#define USE_DYNBVH_PORTS ${MANTA_USE_DYNBVH_PORTS_DEF}
+#else
+#define USE_DYNBVH_PORTS 0
+#endif
+
+#endif
+
+
+
+
+
- [MANTA] r1529 - in trunk: Model/Groups include, abe, 07/21/2007
Archive powered by MHonArc 2.6.16.