Text archives Help
- From: knolla@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1094 - in trunk: Model/Primitives StandAlone scenes
- Date: Sat, 3 Jun 2006 02:47:15 -0600 (MDT)
Author: knolla
Date: Sat Jun 3 02:47:12 2006
New Revision: 1094
Added:
trunk/StandAlone/octvol_build.cc
Modified:
trunk/Model/Primitives/OctreeVolume.cc
trunk/StandAlone/CMakeLists.txt
trunk/scenes/octisovol.cc
Log:
added standalone octree build application.
Modified: trunk/Model/Primitives/OctreeVolume.cc
==============================================================================
--- trunk/Model/Primitives/OctreeVolume.cc (original)
+++ trunk/Model/Primitives/OctreeVolume.cc Sat Jun 3 02:47:12 2006
@@ -186,7 +186,7 @@
current_timestep = 0;
}
- cout << "\nDone creating OctISOVolume!" << endl;
+ cout << "\nDone creating Octree Volume!" << endl;
}
OctreeVolume::~OctreeVolume()
Modified: trunk/StandAlone/CMakeLists.txt
==============================================================================
--- trunk/StandAlone/CMakeLists.txt (original)
+++ trunk/StandAlone/CMakeLists.txt Sat Jun 3 02:47:12 2006
@@ -12,6 +12,10 @@
TARGET_LINK_LIBRARIES(barrier_test SCIRun_Core
${CMAKE_THREAD_LIBS_INIT})
+ADD_EXECUTABLE(octvol_build octvol_build.cc)
+TARGET_LINK_LIBRARIES(octvol_build SCIRun_Core Manta_Model
+ ${CMAKE_THREAD_LIBS_INIT})
+
#ADD_EXECUTABLE(frust-test frust-test.cc)
#TARGET_LINK_LIBRARIES(frust-test ${MANTA_TARGET_LINK_LIBRARIES}
# ${CMAKE_THREAD_LIBS_INIT}
Added: trunk/StandAlone/octvol_build.cc
==============================================================================
--- (empty file)
+++ trunk/StandAlone/octvol_build.cc Sat Jun 3 02:47:12 2006
@@ -0,0 +1,109 @@
+// This program allows us to build octree volumes from a standalone program,
without
+// having to use the full Manta footprint.
+//
+// Author: Aaron Knoll
+// Date: June 3, 2006
+
+
+#include <Model/Primitives/OctreeVolume.h>
+#include <Core/Exceptions/IllegalArgument.h>
+#include <Core/Exceptions/InputError.h>
+#include <Core/Util/Args.h>
+#include <iostream>
+#include <SCIRun/Core/Thread/Time.h>
+
+using namespace Manta;
+using namespace SCIRun;
+using namespace std;
+
+static void printUsage()
+{
+ cerr << "octvol_build usage:" << endl;
+ cerr << " -buildfrom <filename> " << endl;
+ cerr << "options:" << endl;
+ cerr << " -tstart <tstart>" << endl;
+ cerr << " -tend <tend>" << endl;
+ cerr << " -variance <variance>" << endl;
+ cerr << " -kernel_width <kernel_width>" << endl;
+ cerr << " -mres_levels <mres_levels>" << endl;
+ cerr << " -isomin <isomin>" << endl;
+ cerr << " -isomax <isomax>" << endl;
+}
+
+int main(int argc, char* argv[]) {
+
+ // Copy args into a vector<string>
+ vector<string> args;
+ for(int i=1;i<argc;i++)
+ args.push_back(argv[i]);
+
+ if (argc == 0)
+ {
+ printUsage();
+ return 0;
+ }
+
+
+ string buildfrom_filename = "";
+ int tstart = 0;
+ int tend = 0;
+ double variance = 0.1;
+ int kernel_width = 2;
+ int mres_levels = 0;
+ double isomin = 0;
+ double isomax = 255;
+
+ // Parse args.i
+ for (int i=0;i<args.size();++i)
+ {
+ if (args[i] == "-buildfrom") {
+ if (!getStringArg(i, args, buildfrom_filename))
+ throw IllegalArgument("octisovol -buildfrom
<filename>", i, args);
+ }
+ else if (args[i] == "-tstart") {
+ if (!getIntArg(i, args, tstart))
+ throw IllegalArgument("octisovol -tstart
<tstart>", i, args);
+ }
+ else if (args[i] == "-tend") {
+ if (!getIntArg(i, args, tend))
+ throw IllegalArgument("octisovol -tend
<tend>", i, args);
+ }
+ else if (args[i] == "-variance") {
+ if (!getDoubleArg(i, args, variance))
+ throw IllegalArgument("octisovol -variance
<variance>", i, args);
+ }
+ else if (args[i] == "-kernel_width") {
+ if (!getIntArg(i, args, kernel_width))
+ throw IllegalArgument("octisovol
-kernel_width <kernel_width>", i, args);
+ }
+ else if (args[i] == "-mres_levels") {
+ if (!getIntArg(i, args, mres_levels))
+ throw IllegalArgument("octisovol -mres_levels
<mres_levels>", i, args);
+ }
+ else if (args[i] == "-isomin") {
+ if (!getDoubleArg(i, args, isomin))
+ throw IllegalArgument("octisovol -isomin
<isomin>", i, args);
+ }
+ else if (args[i] == "-isomax") {
+ if (!getDoubleArg(i, args, isomin))
+ throw IllegalArgument("octisovol -isomax
<isomax>", i, args);
+ }
+ else {
+ printUsage();
+ return 0;
+ }
+ }
+
+
+ if (buildfrom_filename == "")
+ {
+ printUsage();
+ return 0;
+ }
+
+ OctreeVolume ov((char*)buildfrom_filename.c_str(), tstart, tend,
variance, kernel_width, (double)isomin, (double)isomax);
+
+ return 0;
+}
+
+
Modified: trunk/scenes/octisovol.cc
==============================================================================
--- trunk/scenes/octisovol.cc (original)
+++ trunk/scenes/octisovol.cc Sat Jun 3 02:47:12 2006
@@ -34,8 +34,6 @@
using namespace Manta;
using namespace SCIRun;
-enum CuttingPlaneType { CUTTING_NONE, CUTTING_DEFAULT, CUTTING_SPECIFIED };
-
///////////////////////////////////////////////////////////////////////////
extern "C"
Scene* make_scene(const ReadContext& context, const vector<string>& args) {
@@ -50,11 +48,6 @@
int mres_levels = 0;
double isomin = 0;
double isomax = 255;
-
- Vector plane_point;
- Vector plane_normal;
-
- CuttingPlaneType cutting_type = CUTTING_NONE;
// Parse args.i
for (int i=0;i<args.size();++i) {
- [MANTA] r1094 - in trunk: Model/Primitives StandAlone scenes, knolla, 06/03/2006
Archive powered by MHonArc 2.6.16.