Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1608 - in trunk: Core/Util Engine/Display Engine/ImageTraversers Engine/PixelSamplers Engine/Renderers Model/Cameras Model/Groups StandAlone UserInterface fox/dm_demo scenes
- Date: Fri, 3 Aug 2007 14:56:50 -0600 (MDT)
Author: bigler
Date: Fri Aug 3 14:56:45 2007
New Revision: 1608
Modified:
trunk/Core/Util/Args.cc
trunk/Core/Util/Args.h
trunk/Engine/Display/FileDisplay.cc
trunk/Engine/Display/OpenGLDisplay.cc
trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc
trunk/Engine/ImageTraversers/DissolveImageTraverser.cc
trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc
trunk/Engine/ImageTraversers/FilteredImageTraverser.cc
trunk/Engine/ImageTraversers/TiledImageTraverser.cc
trunk/Engine/PixelSamplers/JitterSampler.cc
trunk/Engine/PixelSamplers/TimeViewSampler.cc
trunk/Engine/Renderers/Moire.cc
trunk/Engine/Renderers/Noise.cc
trunk/Model/Cameras/EnvironmentCamera.cc
trunk/Model/Cameras/FisheyeCamera.cc
trunk/Model/Cameras/OrthogonalCamera.cc
trunk/Model/Cameras/PinholeCamera.cc
trunk/Model/Groups/BVH.cc
trunk/Model/Groups/GriddedGroup.cc
trunk/StandAlone/manta.cc
trunk/UserInterface/CameraPathAutomator.cc
trunk/UserInterface/XWindowUI.cc
trunk/fox/dm_demo/dm_demo.cc
trunk/scenes/0.cc
trunk/scenes/BARTReader.cc
trunk/scenes/ParticleBVHTest.cc
trunk/scenes/acceltest.cc
trunk/scenes/boeing777.cc
trunk/scenes/cube.cc
trunk/scenes/dynlt.cc
trunk/scenes/gridisovol.cc
trunk/scenes/iwviewer.cc
trunk/scenes/objviewer.cc
trunk/scenes/octisovol.cc
trunk/scenes/perf.cc
trunk/scenes/primtest.cc
trunk/scenes/triangleSceneViewer.cc
trunk/scenes/volume.cc
trunk/scenes/vorpal.cc
Log:
Core/Util/Args.cc
Core/Util/Args.h
Loop variable is now a size_t instead of an int.
Removed tabs.
Added getArg function that simply tries to parse out the value from
the string.
Engine/Display/FileDisplay.cc
Engine/Display/OpenGLDisplay.cc
Engine/ImageTraversers/DeadlineImageTraverser.cc
Engine/ImageTraversers/DissolveImageTraverser.cc
Engine/ImageTraversers/DissolveTiledImageTraverser.cc
Engine/ImageTraversers/FilteredImageTraverser.cc
Engine/ImageTraversers/TiledImageTraverser.cc
Engine/PixelSamplers/JitterSampler.cc
Engine/PixelSamplers/TimeViewSampler.cc
Engine/Renderers/Moire.cc
Engine/Renderers/Noise.cc
Model/Cameras/EnvironmentCamera.cc
Model/Cameras/FisheyeCamera.cc
Model/Cameras/OrthogonalCamera.cc
Model/Cameras/PinholeCamera.cc
Model/Groups/BVH.cc
Model/Groups/GriddedGroup.cc
StandAlone/manta.cc
UserInterface/CameraPathAutomator.cc
UserInterface/XWindowUI.cc
fox/dm_demo/dm_demo.cc
scenes/0.cc
scenes/BARTReader.cc
scenes/ParticleBVHTest.cc
scenes/acceltest.cc
scenes/boeing777.cc
scenes/cube.cc
scenes/dynlt.cc
scenes/gridisovol.cc
scenes/iwviewer.cc
scenes/objviewer.cc
scenes/octisovol.cc
scenes/perf.cc
scenes/primtest.cc
scenes/triangleSceneViewer.cc
scenes/volume.cc
scenes/vorpal.cc
Loop variable is now a size_t instead of an int.
Modified: trunk/Core/Util/Args.cc
==============================================================================
--- trunk/Core/Util/Args.cc (original)
+++ trunk/Core/Util/Args.cc Fri Aug 3 14:56:45 2007
@@ -8,9 +8,9 @@
using SCIRun::IllegalValue;
namespace Manta {
- bool getStringArg(int& i, const vector<string>& args, string& result)
+ bool getStringArg(size_t& i, const vector<string>& args, string& result)
{
- if(++i >= static_cast<int>(args.size())){
+ if(++i >= args.size()){
result="";
i--;
return false;
@@ -20,25 +20,25 @@
}
}
- bool getLongArg(int& i, const vector<string>& args, long& result)
+ bool getLongArg(size_t& i, const vector<string>& args, long& result)
{
return getArg<long>(i, args, result);
}
- bool getIntArg(int& i, const vector<string>& args, int& result)
+ bool getIntArg(size_t& i, const vector<string>& args, int& result)
{
return getArg<int>(i, args, result);
}
- bool getDoubleArg(int& i, const vector<string>& args, double& result)
+ bool getDoubleArg(size_t& i, const vector<string>& args, double& result)
{
return getArg<double>(i, args, result);
}
// Parse an argument of the form NxM, where N and M are integers
- bool getResolutionArg(int& i, const vector<string>& args, int& xres, int&
yres)
+ bool getResolutionArg(size_t& i, const vector<string>& args, int& xres,
int& yres)
{
- if(++i >= static_cast<int>(args.size())){
+ if(++i >= args.size()){
i--;
return false;
} else {
@@ -68,7 +68,7 @@
return true;
}
- bool getVectorArg(int& i, const vector<string>& args, Vector& v)
+ bool getVectorArg(size_t& i, const vector<string>& args, Vector& v)
{
double x,y,z;
if(!getDoubleArg(i, args, x))
@@ -85,7 +85,7 @@
return true;
}
- bool getColorArg(int& i, const vector<string>& args, Color& color)
+ bool getColorArg(size_t& i, const vector<string>& args, Color& color)
{
string name;
if (!getStringArg(i, args, name)) {
@@ -140,7 +140,7 @@
int paren = end;
while(paren < len && spec[paren] != '('){
if(spec[paren] != ' ' && spec[paren] != '\t' && spec[paren] != '\n')
- throw IllegalValue<string>("Error parsing argument, garbage before
(", spec);
+ throw IllegalValue<string>("Error parsing argument, garbage before
(", spec);
paren++;
}
if(paren == len){
@@ -150,31 +150,31 @@
paren++;
while(len > 0 && spec[len-1] != ')'){
if(spec[len-1] != ' ' && spec[len-1] != '\t' && spec[len-1] != '\n')
- throw IllegalValue<string>("Error parsing argument, no matching ) or
garbage after )", spec);
+ throw IllegalValue<string>("Error parsing argument, no matching ) or
garbage after )", spec);
len--;
}
len--;
while(paren < len){
while(paren < len && spec[paren] == ' ' || spec[paren] == '\t' ||
spec[paren] == '\n')
- paren++;
+ paren++;
int to = paren+1;
while(to < len && spec[to] != ' ' && spec[to] != '\t' && spec[to] !=
'\n' && spec[to] != '(')
- to++;
+ to++;
int to2 = to;
while(to2 < len && spec[to2] == ' ' || spec[to2] == '\t' || spec[to2]
== '\n')
- to2++;
+ to2++;
if(spec[to2] == '('){
- // Skip to the matching paren
- to2++;
- int pcount = 1;
- while(to2 < len && pcount > 0){
- if(spec[to2] == '(')
- pcount++;
- else if(spec[to2] == ')')
- pcount--;
- to2++;
- }
- to = to2;
+ // Skip to the matching paren
+ to2++;
+ int pcount = 1;
+ while(to2 < len && pcount > 0){
+ if(spec[to2] == '(')
+ pcount++;
+ else if(spec[to2] == ')')
+ pcount--;
+ to2++;
+ }
+ to = to2;
}
string arg = spec.substr(paren, to-paren);
args.push_back(arg);
@@ -189,7 +189,7 @@
#include <sgi_stl_warnings_off.h>
#include <iostream>
#include <sgi_stl_warnings_on.h>
- using namespace std;
+using namespace std;
namespace Manta {
void parseArgs(const string& input, vector<string>& args) {
@@ -202,42 +202,42 @@
if (arg_debug) cout << "start = "<<start<<endl;
// Skip leading white space
while(start < len && input[start] == ' ' || input[start] == '\t' ||
- input[start] == '\n')
- start++;
+ input[start] == '\n')
+ start++;
int end = start;
if (arg_debug) cout << "After whitespace skip, start = "<<start<<",
end = "<<end<<endl;
// Now that we are past the whitespace check to see if we have a
// quote or not.
if (input[start] == '\'') {
- if (arg_debug) cout << "Found a quote\n";
- // Then we need to search for the matching quote
- start++;
- do {
- end++;
- } while(end < len && input[end] != '\'');
- // We need to check to find the matching paren
- if (end == len)
- throw IllegalValue<string>("Error parsing arguments, no matching '
or garbage after '", input);
+ if (arg_debug) cout << "Found a quote\n";
+ // Then we need to search for the matching quote
+ start++;
+ do {
+ end++;
+ } while(end < len && input[end] != '\'');
+ // We need to check to find the matching paren
+ if (end == len)
+ throw IllegalValue<string>("Error parsing arguments, no matching '
or garbage after '", input);
- // Back off the last character
- // end--;
+ // Back off the last character
+ // end--;
} else {
- if (arg_debug) cout << "Parsing regular arg\n";
- // just look for the next whitespace character
- while(end < len && input[end] != ' ' && input[end] != '\t' &&
- input[end] != '\n') {
- if (arg_debug) cout << "input["<<end<<"] = "<<input[end]<<endl;
- end++;
- }
- // Back off the whitespace character
- //end--;
+ if (arg_debug) cout << "Parsing regular arg\n";
+ // just look for the next whitespace character
+ while(end < len && input[end] != ' ' && input[end] != '\t' &&
+ input[end] != '\n') {
+ if (arg_debug) cout << "input["<<end<<"] = "<<input[end]<<endl;
+ end++;
+ }
+ // Back off the whitespace character
+ //end--;
}
if (arg_debug) cout << "grabbing arg from "<<start<<" to "<<end<<endl;
if (end-start > 0) {
- string arg = input.substr(start, end-start);
- if (arg_debug) cout << "arg = "<<arg<<endl;
- args.push_back(arg);
+ string arg = input.substr(start, end-start);
+ if (arg_debug) cout << "arg = "<<arg<<endl;
+ args.push_back(arg);
}
// Now we can start where we left off
Modified: trunk/Core/Util/Args.h
==============================================================================
--- trunk/Core/Util/Args.h (original)
+++ trunk/Core/Util/Args.h Fri Aug 3 14:56:45 2007
@@ -13,12 +13,12 @@
class Vector;
using namespace std;
- bool getStringArg(int& i, const vector<string>&, string& result);
- bool getDoubleArg(int& i, const vector<string>&, double& result);
- bool getIntArg(int& i, const vector<string>&, int& result);
- bool getLongArg(int& i, const vector<string>&, long& result);
- bool getResolutionArg(int& i, const vector<string>&, int& xres, int& yres);
- bool getVectorArg(int& i, const vector<string>&, Vector& p);
+ bool getStringArg(size_t& i, const vector<string>&, string& result);
+ bool getDoubleArg(size_t& i, const vector<string>&, double& result);
+ bool getIntArg(size_t& i, const vector<string>&, int& result);
+ bool getLongArg(size_t& i, const vector<string>&, long& result);
+ bool getResolutionArg(size_t& i, const vector<string>&, int& xres, int&
yres);
+ bool getVectorArg(size_t& i, const vector<string>&, Vector& p);
void parseSpec(const string& spec, string& name, vector<string>& args);
// This parsers out a color argument from the commandline.
@@ -27,21 +27,14 @@
// 1. colorName - the color is looked up in the ColorDB.
// 2. RGB8 r g b - RGB components in [0,255]
// 3. RGBfloat r g b - RGB components in [0,1]
- bool getColorArg(int& i, const vector<string>&, Color& color);
+ bool getColorArg(size_t& i, const vector<string>&, Color& color);
// Parse a resolution value from a string.
bool getResolutionArg(const string& arg, int& xres, int& yres);
-
- // Generic version that grabs an argument of type T.
+
template<typename T>
- bool getArg(int& i, const vector<string>& args, T& result) {
- // Check to make sure args[i] exists.
- if(++i >= static_cast<int>(args.size())) {
- i--;
- return false;
- }
-
- istringstream in(args[i]);
+ bool parseValue(const string& arg, T& result) {
+ istringstream in(arg);
T temp;
// Attempt to pull in the value
in >> temp;
@@ -50,6 +43,21 @@
result = temp;
return true;
} else {
+ return false;
+ }
+ }
+ // Generic version that grabs an argument of type T.
+ template<typename T>
+ bool getArg(size_t& i, const vector<string>& args, T& result) {
+ // Check to make sure args[i] exists.
+ if(++i >= args.size()) {
+ i--;
+ return false;
+ }
+ if (parseValue(args[i], result)) {
+ return true;
+ } else {
+ i--;
return false;
}
}
Modified: trunk/Engine/Display/FileDisplay.cc
==============================================================================
--- trunk/Engine/Display/FileDisplay.cc (original)
+++ trunk/Engine/Display/FileDisplay.cc Fri Aug 3 14:56:45 2007
@@ -67,7 +67,7 @@
/////////////////////////////////////////////////////////////////////////////
// Parse args.
- for (int i=0;i<static_cast<int>(args.size());++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-prefix") {
if (!getArg( i, args, prefix )) {
throw IllegalArgument( "FileDisplay", i, args );
Modified: trunk/Engine/Display/OpenGLDisplay.cc
==============================================================================
--- trunk/Engine/Display/OpenGLDisplay.cc (original)
+++ trunk/Engine/Display/OpenGLDisplay.cc Fri Aug 3 14:56:45 2007
@@ -35,8 +35,7 @@
{
// Open X window
setDefaults();
- int argc = (int)args.size();
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
if(args[i] == "-parentWindow"){
long window;
if(!getLongArg(i, args, window))
Modified: trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/DeadlineImageTraverser.cc Fri Aug 3
14:56:45 2007
@@ -81,8 +81,7 @@
xrefinementRatio = 2;
yrefinementRatio = 2;
priority = LuminanceVariance;
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-packetsize"){
if(!getResolutionArg(i, args, xpacketsize, ypacketsize))
Modified: trunk/Engine/ImageTraversers/DissolveImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DissolveImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/DissolveImageTraverser.cc Fri Aug 3
14:56:45 2007
@@ -60,8 +60,7 @@
DissolveImageTraverser::DissolveImageTraverser(const vector<string>& args):
iters_per_frame(16)
{
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-itersPerFrame"){
if(!getArg<unsigned int>(i, args, iters_per_frame))
Modified: trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc Fri Aug 3
14:56:45 2007
@@ -61,8 +61,7 @@
DissolveTiledImageTraverser::DissolveTiledImageTraverser(const
vector<string>& args):
xtilesize(32), ytilesize(2), iters_per_frame(16)
{
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-itersPerFrame"){
if(!getArg<unsigned int>(i, args, iters_per_frame))
Modified: trunk/Engine/ImageTraversers/FilteredImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/FilteredImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/FilteredImageTraverser.cc Fri Aug 3
14:56:45 2007
@@ -52,8 +52,7 @@
{
xtilesize = 32;
ytilesize = 2;
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-tilesize"){
if(!getResolutionArg(i, args, xtilesize, ytilesize))
Modified: trunk/Engine/ImageTraversers/TiledImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/TiledImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/TiledImageTraverser.cc Fri Aug 3 14:56:45
2007
@@ -65,8 +65,7 @@
xtilesize = Fragment::MaxSize;
ytilesize = Fragment::MaxSize;
shape = Fragment::LineShape;
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-tilesize"){
if(!getResolutionArg(i, args, xtilesize, ytilesize))
Modified: trunk/Engine/PixelSamplers/JitterSampler.cc
==============================================================================
--- trunk/Engine/PixelSamplers/JitterSampler.cc (original)
+++ trunk/Engine/PixelSamplers/JitterSampler.cc Fri Aug 3 14:56:45 2007
@@ -26,8 +26,7 @@
JitterSampler::JitterSampler(const vector<string>& args):
num_samples(4), use_cheaprng(true), random(0)
{
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-numberOfSamples"){
if(!getIntArg(i, args, num_samples))
Modified: trunk/Engine/PixelSamplers/TimeViewSampler.cc
==============================================================================
--- trunk/Engine/PixelSamplers/TimeViewSampler.cc (original)
+++ trunk/Engine/PixelSamplers/TimeViewSampler.cc Fri Aug 3 14:56:45
2007
@@ -31,8 +31,7 @@
state(0),
active(true)
{
- int argc = static_cast<int>(args.size());
- for(int i = 0; i<argc;i++){
+ for(size_t i = 0; i<args.size();i++){
string arg = args[i];
if(arg == "-scale"){
if(!getArg<ColorComponent>(i, args, scale))
Modified: trunk/Engine/Renderers/Moire.cc
==============================================================================
--- trunk/Engine/Renderers/Moire.cc (original)
+++ trunk/Engine/Renderers/Moire.cc Fri Aug 3 14:56:45 2007
@@ -20,8 +20,7 @@
{
rate=2;
cycles = 100;
- int argc = (int)args.size();
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-rate"){
if(!getDoubleArg(i, args, rate))
Modified: trunk/Engine/Renderers/Noise.cc
==============================================================================
--- trunk/Engine/Renderers/Noise.cc (original)
+++ trunk/Engine/Renderers/Noise.cc Fri Aug 3 14:56:45 2007
@@ -22,8 +22,7 @@
{
sse = false;
rate=0.1;
- int argc = (int)args.size();
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-rate"){
if(!getDoubleArg(i, args, rate))
Modified: trunk/Model/Cameras/EnvironmentCamera.cc
==============================================================================
--- trunk/Model/Cameras/EnvironmentCamera.cc (original)
+++ trunk/Model/Cameras/EnvironmentCamera.cc Fri Aug 3 14:56:45 2007
@@ -35,8 +35,7 @@
bool gotLookat=false;
bool gotUp=false;
normalizeRays=false;
- int argc=static_cast<int>(args.size());
- for (int i=0; i<argc; i++) {
+ for (size_t i=0; i<args.size(); i++) {
string arg=args[i];
if (arg=="-eye") {
if (!getVectorArg(i, args, eye))
Modified: trunk/Model/Cameras/FisheyeCamera.cc
==============================================================================
--- trunk/Model/Cameras/FisheyeCamera.cc (original)
+++ trunk/Model/Cameras/FisheyeCamera.cc Fri Aug 3 14:56:45 2007
@@ -41,8 +41,7 @@
bool gotLookat = false;
bool gotFov = false;
bool gotUp = false;
- int argc = static_cast<int>(args.size());
- for(int i=0; i< argc; i++){
+ for(size_t i=0; i< args.size(); i++){
string arg = args[i];
if(arg == "-eye"){
if(!getVectorArg(i, args, eye))
Modified: trunk/Model/Cameras/OrthogonalCamera.cc
==============================================================================
--- trunk/Model/Cameras/OrthogonalCamera.cc (original)
+++ trunk/Model/Cameras/OrthogonalCamera.cc Fri Aug 3 14:56:45 2007
@@ -31,8 +31,7 @@
bool gotLookat = false;
bool gotScale = false;
bool gotUp = false;
- int argc = static_cast<int>(args.size());
- for(int i=0; i< argc; i++){
+ for(size_t i=0; i< args.size(); i++){
string arg = args[i];
if(arg == "-eye"){
if(!getVectorArg(i, args, eye))
Modified: trunk/Model/Cameras/PinholeCamera.cc
==============================================================================
--- trunk/Model/Cameras/PinholeCamera.cc (original)
+++ trunk/Model/Cameras/PinholeCamera.cc Fri Aug 3 14:56:45 2007
@@ -42,8 +42,7 @@
up = Vector( 0, 0, 1 );
hfov = 60;
vfov = 60;
- int argc = static_cast<int>(args.size());
- for(int i=0; i< argc; i++){
+ for(size_t i=0; i< args.size(); i++){
string arg = args[i];
if (arg == "-offset") {
if(!getArg(i, args, stereo_offset))
Modified: trunk/Model/Groups/BVH.cc
==============================================================================
--- trunk/Model/Groups/BVH.cc (original)
+++ trunk/Model/Groups/BVH.cc Fri Aug 3 14:56:45 2007
@@ -33,7 +33,7 @@
BVH::BVH(const vector<string>& args)
{
buildMode="naive";
- for(int i=0; i<static_cast<int>(args.size()); i++){
+ for(size_t i=0; i< args.size(); i++){
string arg = args[i];
if(arg == "-table"){
buildMode = "table";
Modified: trunk/Model/Groups/GriddedGroup.cc
==============================================================================
--- trunk/Model/Groups/GriddedGroup.cc (original)
+++ trunk/Model/Groups/GriddedGroup.cc Fri Aug 3 14:56:45 2007
@@ -22,8 +22,7 @@
GriddedGroup::GriddedGroup( const vector< string > &args )
{
bool gotCellfactor = false;
- int argc = static_cast<int>(args.size());
- for(int i=0; i< argc; i++){
+ for(size_t i=0; i< args.size(); i++){
string arg = args[i];
if(arg == "-cellfactor"){
if(!getArg<Real>(i, args, cellfactor))
Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc (original)
+++ trunk/StandAlone/manta.cc Fri Aug 3 14:56:45 2007
@@ -242,7 +242,7 @@
// Parse command line args.
try {
- for(int i=0;i<static_cast<int>(args.size());i++){
+ for(size_t i=0;i < args.size();i++){
string arg = args[i];
if(arg == "-help"){
usage(factory);
@@ -532,7 +532,7 @@
throw InternalError("default renderer not found", __FILE__, __LINE__ );
// Parse command line args.
- for (int i=0; i < static_cast<int>(args.size()); ++i) {
+ for (size_t i=0; i < args.size(); ++i) {
string arg = args[i];
if(arg == "-imagetraverser"){
Modified: trunk/UserInterface/CameraPathAutomator.cc
==============================================================================
--- trunk/UserInterface/CameraPathAutomator.cc (original)
+++ trunk/UserInterface/CameraPathAutomator.cc Fri Aug 3 14:56:45 2007
@@ -193,23 +193,20 @@
fgets( line, 127, file );
parseSpec( line, name, args );
- // Set i so that ++i == 0 to trick getArg
- int i = -1;
-
///////////////////////////////////////////////////////////////////////////
// Parse the args.
// Line should be in the form "delta_t( 0.25 )"
if (name == "delta_t") {
- if (!getArg(i,args,delta_t)) {
+ if (args.size() == 0 || !parseValue(args[0],delta_t)) {
sprintf(error_message, "CameraPathAutomator input line: %d",
line_num );
- throw IllegalArgument(error_message, i, args);
+ throw IllegalArgument(error_message, 0, args);
}
}
else if (name == "delta_time") {
- if (!getArg(i,args,delta_time)) {
+ if (args.size() == 0 || !parseValue(args[0],delta_time)) {
sprintf(error_message, "CameraPathAutomator input line: %d",
line_num );
- throw IllegalArgument(error_message, i, args);
+ throw IllegalArgument(error_message, 0, args);
}
}
else if (name == "control") {
@@ -222,7 +219,7 @@
bool got_lookat = false;
bool got_up = false;
- for (int i=0;i<(int)args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-eye") {
if (!getVectorArg(i,args,eye_)) {
sprintf(error_message, "CameraPathAutomator -eye input line:
%d", line_num );
@@ -298,7 +295,7 @@
Real delta_t = 0;
Real delta_time = 0;
- for (int i=0; i<static_cast<int>(args.size()); ++i) {
+ for (size_t i=0; i < args.size(); ++i) {
if (args[i] == "-file") {
file_name = args[++i];
}
Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc (original)
+++ trunk/UserInterface/XWindowUI.cc Fri Aug 3 14:56:45 2007
@@ -82,7 +82,7 @@
string fname="";
// Parse command line args.
- for (int i=0;i<static_cast<int>(args.size());++i) {
+ for (size_t i=0;i<args.size();++i) {
const string &arg = args[i];
if (arg=="-loop") {
if (!getIntArg(i, args, max_count))
Modified: trunk/fox/dm_demo/dm_demo.cc
==============================================================================
--- trunk/fox/dm_demo/dm_demo.cc (original)
+++ trunk/fox/dm_demo/dm_demo.cc Fri Aug 3 14:56:45 2007
@@ -430,7 +430,7 @@
throw InternalError("default renderer not found", __FILE__, __LINE__ );
// Parse command line args.
- for (int i=0;i<args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
string arg = args[i];
if(arg == "-imagetraverser"){
Modified: trunk/scenes/0.cc
==============================================================================
--- trunk/scenes/0.cc (original)
+++ trunk/scenes/0.cc Fri Aug 3 14:56:45 2007
@@ -138,12 +138,11 @@
{
int scenesize=2;
double light_radius=0.8;
- int argc = static_cast<int>(args.size());
Group* group = 0;
Factory factory( context.manta_interface );
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-size"){
if(!getIntArg(i, args, scenesize))
Modified: trunk/scenes/BARTReader.cc
==============================================================================
--- trunk/scenes/BARTReader.cc (original)
+++ trunk/scenes/BARTReader.cc Fri Aug 3 14:56:45 2007
@@ -20,8 +20,7 @@
{
string filename;
- int argc = static_cast<int>(args.size());
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-filename"){
if(!getStringArg(i, args, filename))
Modified: trunk/scenes/ParticleBVHTest.cc
==============================================================================
--- trunk/scenes/ParticleBVHTest.cc (original)
+++ trunk/scenes/ParticleBVHTest.cc Fri Aug 3 14:56:45 2007
@@ -52,8 +52,7 @@
int occlusion_rays = 0;
double minimum_value = numeric_limits< double >::max();
double maximum_value = -numeric_limits< double >::max();
- int argc = static_cast< int >( args.size() );
- for ( int i = 0; i < argc; i++ ) {
+ for ( size_t i = 0; i < args.size(); i++ ) {
string arg = args[ i ];
if ( arg == "-model" ) {
if ( !getStringArg( i, args, model_name ) )
Modified: trunk/scenes/acceltest.cc
==============================================================================
--- trunk/scenes/acceltest.cc (original)
+++ trunk/scenes/acceltest.cc Fri Aug 3 14:56:45 2007
@@ -36,8 +36,7 @@
Group *world = 0;
string model_name = "/usr/sci/data/Geometry/particle/sd022-crop.mpm";
- int argc = static_cast< int >( args.size() );
- for ( int i = 0; i < argc; i++ ) {
+ for ( size_t i = 0; i < args.size(); i++ ) {
string arg = args[ i ];
if ( arg == "-group" ) {
string s;
Modified: trunk/scenes/boeing777.cc
==============================================================================
--- trunk/scenes/boeing777.cc (original)
+++ trunk/scenes/boeing777.cc Fri Aug 3 14:56:45 2007
@@ -119,7 +119,7 @@
string bg_method = "";
// Parse args.i
- for (int i=0;i<static_cast<int>(args.size());++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file") {
// Determine the index of the filename.
if (!getStringArg(i, args, file_name))
Modified: trunk/scenes/cube.cc
==============================================================================
--- trunk/scenes/cube.cc (original)
+++ trunk/scenes/cube.cc Fri Aug 3 14:56:45 2007
@@ -69,9 +69,8 @@
{
Factory factory( context.manta_interface );
- int argc = static_cast<int>(args.size());
Group* world = 0;
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-bv"){
string s;
Modified: trunk/scenes/dynlt.cc
==============================================================================
--- trunk/scenes/dynlt.cc (original)
+++ trunk/scenes/dynlt.cc Fri Aug 3 14:56:45 2007
@@ -71,8 +71,7 @@
float kd = 0.5;
float ka = 1.0;
- int argc=static_cast<int>(args.size());
- for(int i=0; i<argc; ++i) {
+ for(size_t i=0; i<args.size(); ++i) {
string arg=args[i];
if (arg=="-cidx") {
if (!getIntArg(i, args, cidx))
Modified: trunk/scenes/gridisovol.cc
==============================================================================
--- trunk/scenes/gridisovol.cc (original)
+++ trunk/scenes/gridisovol.cc Fri Aug 3 14:56:45 2007
@@ -51,7 +51,7 @@
//CuttingPlaneType cutting_type = CUTTING_NONE;
// Parse args.i
- for (int i=0;i<args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file") {
if (!getStringArg(i, args, filename))
throw IllegalArgument("gridisovol -file <filename>", i, args);
Modified: trunk/scenes/iwviewer.cc
==============================================================================
--- trunk/scenes/iwviewer.cc (original)
+++ trunk/scenes/iwviewer.cc Fri Aug 3 14:56:45 2007
@@ -83,7 +83,7 @@
Scene* make_scene(const ReadContext& context, const vector<string>& args) {
// Check the arguments.
- for (int i=0;i<args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file" || args[i] == "-iwfile") {
// Read in the file name.
Modified: trunk/scenes/objviewer.cc
==============================================================================
--- trunk/scenes/objviewer.cc (original)
+++ trunk/scenes/objviewer.cc Fri Aug 3 14:56:45 2007
@@ -124,7 +124,7 @@
Scene* make_scene(const ReadContext& context, const vector<string>& args) {
// Check the arguments.
- for (int i=0;i<static_cast<int>(args.size());++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file") {
// Read in the file name.
Modified: trunk/scenes/octisovol.cc
==============================================================================
--- trunk/scenes/octisovol.cc (original)
+++ trunk/scenes/octisovol.cc Fri Aug 3 14:56:45 2007
@@ -51,7 +51,7 @@
double isovalue = 100;
// Parse args.i
- for (int i=0;i<(int)args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file") {
if (!getStringArg(i, args, filename))
throw IllegalArgument("octisovol -file <filename>", i, args);
Modified: trunk/scenes/perf.cc
==============================================================================
--- trunk/scenes/perf.cc (original)
+++ trunk/scenes/perf.cc Fri Aug 3 14:56:45 2007
@@ -66,7 +66,7 @@
Scene* make_scene(const ReadContext& context, const vector<string>& args)
{
bool use_wald = false;
- for ( int i = 0; i < args.size(); i++ )
+ for ( size_t i = 0; i < args.size(); i++ )
{
if ( args[i] == "-Wald" )
{
Modified: trunk/scenes/primtest.cc
==============================================================================
--- trunk/scenes/primtest.cc (original)
+++ trunk/scenes/primtest.cc Fri Aug 3 14:56:45 2007
@@ -83,8 +83,7 @@
bool set_primtype = false;
bool bgpoly = true;
bool bgpoly_first = false;
- int argc = static_cast<int>(args.size());
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-scale"){
if(!getArg<Real>(i, args, scale))
Modified: trunk/scenes/triangleSceneViewer.cc
==============================================================================
--- trunk/scenes/triangleSceneViewer.cc (original)
+++ trunk/scenes/triangleSceneViewer.cc Fri Aug 3 14:56:45 2007
@@ -44,8 +44,7 @@
bool setModel = false;
- int argc = static_cast<int>(args.size());
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-model"){
fileNames.push_back("");
Modified: trunk/scenes/volume.cc
==============================================================================
--- trunk/scenes/volume.cc (original)
+++ trunk/scenes/volume.cc Fri Aug 3 14:56:45 2007
@@ -73,7 +73,7 @@
int workers_np = 1;
// Parse args.i
- for (int i=0;i<args.size();++i) {
+ for (size_t i=0;i<args.size();++i) {
if (args[i] == "-file") {
// Determine the index of the filename.
if (!getStringArg(i, args, file_name))
Modified: trunk/scenes/vorpal.cc
==============================================================================
--- trunk/scenes/vorpal.cc (original)
+++ trunk/scenes/vorpal.cc Fri Aug 3 14:56:45 2007
@@ -77,8 +77,7 @@
std::cout << "Make_scene args: " << args.size() << std::endl;
string heightfield_filename, particles_filename;
- int argc = static_cast<int>(args.size());
- for(int i=0;i<argc;i++){
+ for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-heightfield"){
if(!getStringArg(i, args, heightfield_filename))
- [MANTA] r1608 - in trunk: Core/Util Engine/Display Engine/ImageTraversers Engine/PixelSamplers Engine/Renderers Model/Cameras Model/Groups StandAlone UserInterface fox/dm_demo scenes, bigler, 08/03/2007
Archive powered by MHonArc 2.6.16.