[372] | 1 | // ================================================================
|
---|
| 2 | // $Id: environ.cpp,v 1.1 2004/02/16 14:45:59 bittner Exp $
|
---|
| 3 | //
|
---|
| 4 | // environ.cpp
|
---|
| 5 | // Implementation of the environment operations, ie. reading
|
---|
| 6 | // environment file, reading command line parameters etc.
|
---|
| 7 | //
|
---|
| 8 |
|
---|
| 9 | //#define _DEBUG_PARAMS
|
---|
| 10 |
|
---|
| 11 | #include <math.h>
|
---|
| 12 | #include <stdlib.h>
|
---|
| 13 | #include <stdio.h>
|
---|
| 14 | #include <string.h>
|
---|
| 15 | #include <fstream>
|
---|
| 16 |
|
---|
| 17 | #include "gzstream.h"
|
---|
| 18 | #include "common.h"
|
---|
| 19 | #include "Environment.h"
|
---|
| 20 | #include "Vector3.h"
|
---|
| 21 |
|
---|
[863] | 22 | using namespace std;
|
---|
[372] | 23 |
|
---|
[863] | 24 | namespace GtpVisibilityPreprocessor {
|
---|
[860] | 25 |
|
---|
[863] | 26 |
|
---|
[1004] | 27 | Environment *Environment::sEnvironment = NULL;
|
---|
[372] | 28 |
|
---|
[1004] | 29 |
|
---|
| 30 | Environment *Environment::GetSingleton()
|
---|
| 31 | {
|
---|
| 32 | if (!sEnvironment)
|
---|
| 33 | {
|
---|
| 34 | sEnvironment = new Environment();
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | return sEnvironment;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
[1416] | 40 |
|
---|
[1004] | 41 | void Environment::DelSingleton()
|
---|
| 42 | {
|
---|
| 43 | DEL_PTR(sEnvironment);
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 |
|
---|
[372] | 47 | Environment::~Environment()
|
---|
| 48 | {
|
---|
| 49 | int i, j;
|
---|
| 50 |
|
---|
| 51 | // delete the params structure
|
---|
| 52 | for (i = 0; i < numParams; i++) {
|
---|
| 53 | for (j = 0; j < paramRows; j++)
|
---|
| 54 | if (params[i][j] != NULL)
|
---|
| 55 | delete[] params[i][j];
|
---|
| 56 | if (params[i] != NULL)
|
---|
| 57 | delete[] params[i];
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | if (params != NULL)
|
---|
| 61 | delete[] params;
|
---|
| 62 |
|
---|
| 63 | // delete the options structure
|
---|
| 64 | if (options != NULL)
|
---|
| 65 | delete[] options;
|
---|
| 66 |
|
---|
| 67 | if (optionalParams != NULL)
|
---|
[938] | 68 | DEL_PTR(optionalParams);
|
---|
[372] | 69 | }
|
---|
| 70 |
|
---|
| 71 | bool
|
---|
| 72 | Environment::CheckForSwitch(const int argc,
|
---|
[492] | 73 | char **argv,
|
---|
| 74 | const char swtch) const
|
---|
[372] | 75 | {
|
---|
| 76 | for (int i = 1; i < argc; i++)
|
---|
| 77 | if ((argv[i][0] == '-') && (argv[i][1] == swtch))
|
---|
| 78 | return true;
|
---|
| 79 | return false;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | bool
|
---|
| 83 | Environment::CheckType(const char *value,
|
---|
| 84 | const EOptType type) const
|
---|
| 85 | {
|
---|
| 86 | char *s, *t, *u;
|
---|
| 87 |
|
---|
| 88 | switch (type) {
|
---|
| 89 | case optInt: {
|
---|
| 90 | strtol(value, &t, 10);
|
---|
| 91 | if (value + strlen(value) != t)
|
---|
| 92 | return false;
|
---|
| 93 | else
|
---|
| 94 | return true;
|
---|
| 95 | }
|
---|
| 96 | case optFloat: {
|
---|
| 97 | strtod(value, &t);
|
---|
| 98 | if (value + strlen(value) != t)
|
---|
| 99 | return false;
|
---|
| 100 | else
|
---|
| 101 | return true;
|
---|
| 102 | }
|
---|
| 103 | case optBool: {
|
---|
| 104 | if (!strcasecmp(value, "true") ||
|
---|
| 105 | !strcasecmp(value, "false") ||
|
---|
| 106 | !strcasecmp(value, "YES") ||
|
---|
| 107 | !strcasecmp(value, "NO") ||
|
---|
| 108 | !strcmp(value, "+") ||
|
---|
| 109 | !strcmp(value, "-") ||
|
---|
| 110 | !strcasecmp(value, "ON") ||
|
---|
| 111 | !strcasecmp(value, "OFF"))
|
---|
| 112 | return true;
|
---|
| 113 | return false;
|
---|
| 114 | }
|
---|
| 115 | case optVector:{
|
---|
| 116 | strtod(value, &s);
|
---|
| 117 | if (*s == ' ' || *s == '\t') {
|
---|
| 118 | while (*s == ' ' || *s == '\t')
|
---|
| 119 | s++;
|
---|
| 120 | if (*s != ',')
|
---|
| 121 | s--;
|
---|
| 122 | }
|
---|
| 123 | if ((*s != ',' && *s != ' ' && *s != '\t') || value == s)
|
---|
| 124 | return false;
|
---|
| 125 | t = s;
|
---|
| 126 | strtod(s + 1, &u);
|
---|
| 127 | if (*u == ' ' || *u == '\t') {
|
---|
| 128 | while (*u == ' ' || *u == '\t')
|
---|
| 129 | u++;
|
---|
| 130 | if (*u != ',')
|
---|
| 131 | u--;
|
---|
| 132 | }
|
---|
| 133 | if ((*u != ',' && *s != ' ' && *s != '\t') || t == u)
|
---|
| 134 | return false;
|
---|
| 135 | t = u;
|
---|
| 136 | strtod(u + 1, &s);
|
---|
| 137 | if (t == s || value + strlen(value) != s)
|
---|
| 138 | return false;
|
---|
| 139 | return true;
|
---|
| 140 | }
|
---|
| 141 | case optString: {
|
---|
| 142 | return true;
|
---|
| 143 | }
|
---|
| 144 | default: {
|
---|
| 145 | Debug << "Internal error: Unknown type of option.\n" << flush;
|
---|
| 146 | exit(1);
|
---|
| 147 | }
|
---|
| 148 | }
|
---|
| 149 | return false;
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | void
|
---|
| 153 | Environment::ReadCmdlineParams(const int argc,
|
---|
[492] | 154 | char **argv,
|
---|
| 155 | const char *optParams)
|
---|
[372] | 156 | {
|
---|
| 157 | int i;
|
---|
| 158 |
|
---|
| 159 | // Make sure we are called for the first time
|
---|
| 160 | if (optionalParams != NULL)
|
---|
| 161 | return;
|
---|
| 162 |
|
---|
[472] | 163 | numParams = (int)strlen(optParams) + 1;
|
---|
[372] | 164 | optionalParams = new char[numParams];
|
---|
| 165 | strcpy(optionalParams, optParams);
|
---|
| 166 |
|
---|
| 167 | // First, count all non-optional parameters on the command line
|
---|
| 168 | for (i = 1; i < argc; i++)
|
---|
| 169 | if (argv[i][0] != '-')
|
---|
| 170 | paramRows++;
|
---|
| 171 |
|
---|
| 172 | // if there is no non-optional parameter add a default one...
|
---|
| 173 | if (paramRows == 0)
|
---|
| 174 | paramRows = 1;
|
---|
| 175 |
|
---|
| 176 | // allocate and initialize the table for parameters
|
---|
| 177 | params = new char **[numParams];
|
---|
| 178 | for (i = 0; i < numParams; i++) {
|
---|
| 179 | params[i] = new char *[paramRows];
|
---|
| 180 | for (int j = 0; j < paramRows; j++)
|
---|
| 181 | params[i][j] = NULL;
|
---|
| 182 | }
|
---|
| 183 | // Now read all non-optional and optional parameters into the table
|
---|
| 184 | curRow = -1;
|
---|
| 185 | for (i = 1; i < argc; i++) {
|
---|
| 186 | if (argv[i][0] != '-') {
|
---|
| 187 | // non-optional parameter encountered
|
---|
| 188 | curRow++;
|
---|
| 189 | params[0][curRow] = new char[strlen(argv[i]) + 1];
|
---|
| 190 | strcpy(params[0][curRow], argv[i]);
|
---|
| 191 | }
|
---|
| 192 | else {
|
---|
| 193 | // option encountered
|
---|
| 194 | char *t = strchr(optionalParams, argv[i][1]);
|
---|
| 195 | if (t != NULL) {
|
---|
| 196 | // this option is optional parameter
|
---|
| 197 | int index = t - optionalParams + 1;
|
---|
| 198 | if (curRow < 0) {
|
---|
| 199 | // it's a global parameter
|
---|
| 200 | for (int j = 0; j < paramRows; j++) {
|
---|
| 201 | params[index][j] = new char[strlen(argv[i] + 2) + 1];
|
---|
| 202 | strcpy(params[index][j], argv[i] + 2);
|
---|
| 203 | }
|
---|
| 204 | }
|
---|
| 205 | else {
|
---|
| 206 | // it's a scene parameter
|
---|
| 207 | if (params[index][curRow] != NULL) {
|
---|
| 208 | delete[] params[index][curRow];
|
---|
| 209 | }
|
---|
| 210 | params[index][curRow] = new char[strlen(argv[i] + 2) + 1];
|
---|
| 211 | strcpy(params[index][curRow], argv[i] + 2);
|
---|
| 212 | }
|
---|
| 213 | }
|
---|
| 214 | }
|
---|
| 215 | }
|
---|
| 216 | curRow = 0;
|
---|
| 217 |
|
---|
| 218 | #ifdef _DEBUG_PARAMS
|
---|
| 219 | // write out the parameter table
|
---|
| 220 | cerr << "Parameter table for " << numParams << " columns and "
|
---|
| 221 | << paramRows << " rows:\n";
|
---|
| 222 | for (int j = 0; j < paramRows; j++) {
|
---|
| 223 | for (i = 0; i < numParams; i++) {
|
---|
| 224 | if (params[i][j] != NULL)
|
---|
| 225 | cerr << params[i][j];
|
---|
| 226 | else
|
---|
| 227 | cerr << "NULL";
|
---|
| 228 | cerr << "\t";
|
---|
| 229 | }
|
---|
| 230 | cerr << "\n";
|
---|
| 231 | }
|
---|
| 232 | cerr << "Params done.\n" << flush;
|
---|
| 233 | #endif // _DEBUG_PARAMS
|
---|
| 234 | }
|
---|
| 235 |
|
---|
| 236 | bool
|
---|
| 237 | Environment::GetParam(const char name,
|
---|
[1545] | 238 | const int index,
|
---|
| 239 | char *value) const
|
---|
[372] | 240 | {
|
---|
| 241 | int column;
|
---|
| 242 |
|
---|
| 243 | if (index >= paramRows || index < 0)
|
---|
| 244 | return false;
|
---|
| 245 | if (name == ' ')
|
---|
| 246 | column = 0;
|
---|
| 247 | else {
|
---|
| 248 | char *t = strchr(optionalParams, name);
|
---|
| 249 |
|
---|
| 250 | if (t == NULL)
|
---|
| 251 | return false;
|
---|
| 252 | column = t - optionalParams + 1;
|
---|
| 253 | }
|
---|
| 254 |
|
---|
| 255 | if (params[column][index] == NULL)
|
---|
| 256 | return false;
|
---|
| 257 | // value = new char[strlen(params[column][index]) + 1];
|
---|
| 258 | strcpy(value, params[column][index]);
|
---|
| 259 | return true;
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 | void
|
---|
| 263 | Environment::RegisterOption(const char *name,
|
---|
[1002] | 264 | const EOptType type,
|
---|
| 265 | const char *abbrev,
|
---|
| 266 | const char *defValue)
|
---|
[372] | 267 | {
|
---|
| 268 | int i;
|
---|
| 269 |
|
---|
| 270 | // make sure this option was not yet registered
|
---|
| 271 | for (i = 0; i < numOptions; i++)
|
---|
| 272 | if (!strcmp(name, options[i].name)) {
|
---|
| 273 | Debug << "Error: Option " << name << " registered twice.\n";
|
---|
| 274 | exit(1);
|
---|
| 275 | }
|
---|
| 276 | // make sure we have enough room in memory
|
---|
| 277 | if (numOptions >= maxOptions) {
|
---|
| 278 | Debug << "Error: Too many options. Try enlarge the maxOptions "
|
---|
| 279 | << "definition.\n";
|
---|
| 280 | exit(1);
|
---|
| 281 | }
|
---|
| 282 |
|
---|
| 283 | // make sure the abbreviation doesn't start with 'D'
|
---|
| 284 | if (abbrev != NULL && (abbrev[0] == 'D' )) {
|
---|
| 285 | Debug << "Internal error: reserved switch " << abbrev
|
---|
| 286 | << " used as an abbreviation.\n";
|
---|
| 287 | exit(1);
|
---|
| 288 | }
|
---|
| 289 | // new option
|
---|
| 290 | options[numOptions].type = type;
|
---|
[863] | 291 | options[numOptions].name = ::strdup(name);
|
---|
[372] | 292 | // assign abbreviation, if requested
|
---|
| 293 | if (abbrev != NULL) {
|
---|
[863] | 294 | options[numOptions].abbrev = ::strdup(abbrev);
|
---|
[372] | 295 | }
|
---|
| 296 | // assign default value, if requested
|
---|
| 297 | if (defValue != NULL) {
|
---|
[863] | 298 | options[numOptions].defaultValue = ::strdup(defValue);
|
---|
[372] | 299 | if (!CheckType(defValue, type)) {
|
---|
| 300 | Debug << "Internal error: Inconsistent type and default value in option "
|
---|
| 301 | << name << ".\n";
|
---|
| 302 | exit(1);
|
---|
| 303 | }
|
---|
| 304 | }
|
---|
| 305 | // new option registered
|
---|
| 306 | numOptions++;
|
---|
| 307 | }
|
---|
| 308 |
|
---|
| 309 | bool
|
---|
| 310 | Environment::OptionPresent(const char *name) const
|
---|
| 311 | {
|
---|
| 312 | bool found = false;
|
---|
| 313 | int i;
|
---|
| 314 |
|
---|
| 315 | for (i = 0; i < numOptions; i++)
|
---|
| 316 | if (!strcmp(options[i].name, name)) {
|
---|
| 317 | found = true;
|
---|
| 318 | break;
|
---|
| 319 | }
|
---|
| 320 | if (!found) {
|
---|
| 321 | Debug << "Internal error: Option " << name << " not registered.\n" << flush;
|
---|
| 322 | exit(1);
|
---|
| 323 | }
|
---|
| 324 | if (options[i].value != NULL || options[i].defaultValue != NULL)
|
---|
| 325 | return true;
|
---|
| 326 | else
|
---|
| 327 | return false;
|
---|
| 328 | }
|
---|
| 329 |
|
---|
| 330 | int
|
---|
[938] | 331 | Environment::FindOption(const char *name, const bool isFatal) const
|
---|
[372] | 332 | {
|
---|
| 333 | int i;
|
---|
| 334 | bool found = false;
|
---|
| 335 | // is this option registered ?
|
---|
| 336 | for (i = 0; i < numOptions; i++)
|
---|
| 337 | if (!strcmp(options[i].name, name)) {
|
---|
| 338 | found = true;
|
---|
| 339 | break;
|
---|
| 340 | }
|
---|
| 341 | if (!found) {
|
---|
| 342 | // no registration found
|
---|
| 343 | Debug << "Internal error: Required option " << name
|
---|
| 344 | << " not registered.\n" << flush;
|
---|
| 345 | exit(1);
|
---|
| 346 | }
|
---|
| 347 | if (options[i].value == NULL && options[i].defaultValue == NULL)
|
---|
| 348 | // this option was not initialised to some value
|
---|
| 349 | if (isFatal) {
|
---|
| 350 | Debug << "Error: Required option " << name << " not found.\n" << flush;
|
---|
| 351 | exit(1);
|
---|
| 352 | }
|
---|
| 353 | else {
|
---|
| 354 | Debug << "Error: Required option " << name << " not found.\n" << flush;
|
---|
| 355 | return -1;
|
---|
| 356 | }
|
---|
| 357 | return i;
|
---|
| 358 | }
|
---|
| 359 |
|
---|
| 360 | bool
|
---|
| 361 | Environment::GetIntValue(const char *name,
|
---|
| 362 | int &value,
|
---|
| 363 | const bool isFatal) const
|
---|
| 364 | {
|
---|
| 365 | int i = FindOption(name, isFatal);
|
---|
| 366 |
|
---|
| 367 | if (i<0)
|
---|
| 368 | return false;
|
---|
| 369 |
|
---|
| 370 | if (options[i].value != NULL) {
|
---|
| 371 | // option was explicitly specified
|
---|
| 372 | value = strtol(options[i].value, NULL, 10);
|
---|
| 373 | } else {
|
---|
| 374 | // option was not read, so use the default
|
---|
| 375 | value = strtol(options[i].defaultValue, NULL, 10);
|
---|
| 376 | }
|
---|
| 377 |
|
---|
| 378 | return true;
|
---|
| 379 | }
|
---|
| 380 |
|
---|
| 381 | bool
|
---|
| 382 | Environment::GetDoubleValue(const char *name,
|
---|
| 383 | double &value,
|
---|
| 384 | const bool isFatal) const
|
---|
| 385 | {
|
---|
| 386 | int i = FindOption(name, isFatal);
|
---|
| 387 |
|
---|
| 388 | if (i<0)
|
---|
| 389 | return false;
|
---|
| 390 |
|
---|
| 391 | if (options[i].value != NULL) {
|
---|
| 392 | // option was explicitly specified
|
---|
| 393 | value = strtod(options[i].value, NULL);
|
---|
| 394 | } else {
|
---|
| 395 | // option was not read, so use the default
|
---|
| 396 | value = strtod(options[i].defaultValue, NULL);
|
---|
| 397 | }
|
---|
| 398 | return true;
|
---|
| 399 | }
|
---|
| 400 |
|
---|
| 401 | bool
|
---|
| 402 | Environment::GetRealValue(const char *name,
|
---|
| 403 | Real &value,
|
---|
| 404 | const bool isFatal) const
|
---|
| 405 | {
|
---|
| 406 | int i = FindOption(name, isFatal);
|
---|
| 407 |
|
---|
| 408 | if (i<0)
|
---|
| 409 | return false;
|
---|
| 410 |
|
---|
| 411 | if (options[i].value != NULL) {
|
---|
| 412 | // option was explicitly specified
|
---|
[472] | 413 | value = (Real)strtod(options[i].value, NULL);
|
---|
[372] | 414 | } else {
|
---|
| 415 | // option was not read, so use the default
|
---|
[472] | 416 | value = (Real)strtod(options[i].defaultValue, NULL);
|
---|
[372] | 417 | }
|
---|
| 418 | return true;
|
---|
| 419 | }
|
---|
| 420 |
|
---|
| 421 | bool
|
---|
| 422 | Environment::GetFloatValue(const char *name,
|
---|
| 423 | float &value,
|
---|
| 424 | const bool isFatal) const
|
---|
| 425 | {
|
---|
| 426 | int i = FindOption(name, isFatal);
|
---|
| 427 |
|
---|
| 428 | if (i<0)
|
---|
| 429 | return false;
|
---|
| 430 |
|
---|
| 431 | if (options[i].value != NULL) {
|
---|
| 432 | // option was explicitly specified
|
---|
| 433 | value = (float)strtod(options[i].value, NULL);
|
---|
| 434 | } else {
|
---|
| 435 | // option was not read, so use the default
|
---|
| 436 | value = (float)strtod(options[i].defaultValue, NULL);
|
---|
| 437 | }
|
---|
| 438 | return true;
|
---|
| 439 | }
|
---|
| 440 |
|
---|
| 441 | bool
|
---|
| 442 | Environment::GetBool(const char *name,
|
---|
| 443 | const bool isFatal) const
|
---|
| 444 | {
|
---|
| 445 | bool ret;
|
---|
| 446 | if (GetBoolValue(name, ret, isFatal))
|
---|
| 447 | return ret;
|
---|
| 448 | else
|
---|
| 449 | return false;
|
---|
| 450 | }
|
---|
| 451 |
|
---|
| 452 | bool
|
---|
| 453 | Environment::ParseBool(const char *name) const
|
---|
| 454 | {
|
---|
| 455 |
|
---|
| 456 | bool value = true;
|
---|
| 457 |
|
---|
| 458 | if (!strcasecmp(name, "false") ||
|
---|
| 459 | !strcasecmp(name, "NO") ||
|
---|
| 460 | !strcmp(name, "-") ||
|
---|
| 461 | !strcasecmp(name, "OFF"))
|
---|
| 462 | value = false;
|
---|
| 463 |
|
---|
| 464 | return value;
|
---|
| 465 | }
|
---|
| 466 |
|
---|
| 467 | void
|
---|
| 468 | Environment::ParseVector(const char *name, Vector3 &v) const
|
---|
| 469 | {
|
---|
| 470 | // option was not read, so use the default
|
---|
| 471 | char *s, *t;
|
---|
| 472 |
|
---|
| 473 | v.x = (Real)strtod(name, &s);
|
---|
| 474 | v.y = (Real)strtod(s + 1, &t);
|
---|
| 475 | v.z = (Real)strtod(t + 1, NULL);
|
---|
| 476 |
|
---|
| 477 | }
|
---|
| 478 |
|
---|
| 479 | bool
|
---|
| 480 | Environment::GetBoolValue(const char *name,
|
---|
| 481 | bool &value,
|
---|
| 482 | const bool isFatal) const
|
---|
| 483 | {
|
---|
| 484 | int i = FindOption(name, isFatal);
|
---|
| 485 |
|
---|
| 486 | if (i<0)
|
---|
| 487 | return false;
|
---|
| 488 |
|
---|
| 489 |
|
---|
| 490 | if (options[i].value != NULL)
|
---|
| 491 | value = ParseBool(options[i].value);
|
---|
| 492 | else
|
---|
| 493 | value = ParseBool(options[i].defaultValue);
|
---|
| 494 |
|
---|
| 495 | return true;
|
---|
| 496 | }
|
---|
| 497 |
|
---|
| 498 | bool
|
---|
| 499 | Environment::GetVectorValue(const char *name,
|
---|
| 500 | Vector3 &v,
|
---|
| 501 | const bool isFatal) const
|
---|
| 502 | {
|
---|
| 503 | int i = FindOption(name, isFatal);
|
---|
| 504 | if (i<0)
|
---|
| 505 | return false;
|
---|
| 506 |
|
---|
| 507 | if (options[i].value != NULL)
|
---|
| 508 |
|
---|
| 509 |
|
---|
| 510 | if (options[i].value != NULL) {
|
---|
| 511 | ParseVector(options[i].value, v);
|
---|
| 512 | }
|
---|
| 513 | else {
|
---|
| 514 | ParseVector(options[i].defaultValue, v);
|
---|
| 515 | }
|
---|
| 516 | return true;
|
---|
| 517 | }
|
---|
| 518 |
|
---|
| 519 | bool
|
---|
| 520 | Environment::GetStringValue(const char *name,
|
---|
[1579] | 521 | char *value,
|
---|
| 522 | const bool isFatal) const
|
---|
[372] | 523 | {
|
---|
| 524 | int i = FindOption(name, isFatal);
|
---|
| 525 |
|
---|
| 526 | if (i<0)
|
---|
| 527 | return false;
|
---|
| 528 |
|
---|
| 529 |
|
---|
| 530 | if (options[i].value != NULL) {
|
---|
| 531 | // option was not read, so use the default
|
---|
| 532 | strcpy(value, options[i].value);
|
---|
| 533 | }
|
---|
| 534 | else {
|
---|
| 535 | // option was explicitly specified
|
---|
| 536 | strcpy(value, options[i].defaultValue);
|
---|
| 537 | }
|
---|
| 538 | return true;
|
---|
| 539 | }
|
---|
| 540 |
|
---|
| 541 | void
|
---|
| 542 | Environment::SetInt(const char *name, const int value)
|
---|
| 543 | {
|
---|
| 544 |
|
---|
| 545 | int i = FindOption(name);
|
---|
| 546 | if (i<0)
|
---|
| 547 | return;
|
---|
| 548 |
|
---|
| 549 | if (options[i].type == optInt) {
|
---|
| 550 | delete options[i].value;
|
---|
| 551 | options[i].value = new char[16];
|
---|
| 552 | sprintf(options[i].value, "%.15d", value);
|
---|
| 553 | }
|
---|
| 554 | else {
|
---|
| 555 | Debug << "Internal error: Trying to set non-integer option " << name
|
---|
| 556 | << " to integral value.\n" << flush;
|
---|
| 557 | exit(1);
|
---|
| 558 | }
|
---|
| 559 | }
|
---|
| 560 |
|
---|
| 561 | void
|
---|
| 562 | Environment::SetFloat(const char *name, const Real value)
|
---|
| 563 | {
|
---|
| 564 | int i = FindOption(name);
|
---|
| 565 | if (i<0)
|
---|
| 566 | return;
|
---|
| 567 |
|
---|
| 568 | if (options[i].type == optFloat) {
|
---|
| 569 | delete options[i].value;
|
---|
| 570 | options[i].value = new char[25];
|
---|
| 571 | sprintf(options[i].value, "%.15e", value);
|
---|
| 572 | }
|
---|
| 573 | else {
|
---|
| 574 | Debug << "Internal error: Trying to set non-Real option " << name
|
---|
| 575 | << " to Real value.\n" << flush;
|
---|
| 576 | exit(1);
|
---|
| 577 | }
|
---|
| 578 | }
|
---|
| 579 |
|
---|
| 580 | void
|
---|
| 581 | Environment::SetBool(const char *name, const bool value)
|
---|
| 582 | {
|
---|
| 583 | int i = FindOption(name);
|
---|
| 584 | if (i<0)
|
---|
| 585 | return;
|
---|
| 586 |
|
---|
| 587 | if (options[i].type == optBool) {
|
---|
| 588 | delete options[i].value;
|
---|
| 589 | options[i].value = new char[6];
|
---|
| 590 | if (value)
|
---|
| 591 | sprintf(options[i].value, "true");
|
---|
| 592 | else
|
---|
| 593 | sprintf(options[i].value, "false");
|
---|
| 594 | }
|
---|
| 595 | else {
|
---|
| 596 | Debug << "Internal error: Trying to set non-bool option " << name
|
---|
| 597 | << " to boolean value.\n" << flush;
|
---|
| 598 | exit(1);
|
---|
| 599 | }
|
---|
| 600 | }
|
---|
| 601 |
|
---|
| 602 | void
|
---|
| 603 | Environment::SetVector(const char *name,
|
---|
| 604 | const Vector3 &v)
|
---|
| 605 | {
|
---|
| 606 | int i = FindOption(name);
|
---|
| 607 | if (i<0)
|
---|
| 608 | return;
|
---|
| 609 |
|
---|
| 610 | if (options[i].type == optVector) {
|
---|
| 611 | delete options[i].value;
|
---|
| 612 | options[i].value = new char[128];
|
---|
| 613 | sprintf(options[i].value, "%.15e,%.15e,%.15e", v.x, v.y, v.z);
|
---|
| 614 | }
|
---|
| 615 | else {
|
---|
| 616 | Debug << "Internal error: Trying to set non-vector option " << name
|
---|
| 617 | << " to vector value.\n" << flush;
|
---|
| 618 | exit(1);
|
---|
| 619 | }
|
---|
| 620 | }
|
---|
| 621 |
|
---|
| 622 | void
|
---|
| 623 | Environment::SetString(const char *name, const char *value)
|
---|
| 624 | {
|
---|
| 625 | int i = FindOption(name);
|
---|
| 626 | if (i<0)
|
---|
| 627 | return;
|
---|
| 628 |
|
---|
| 629 | if (options[i].type == optString) {
|
---|
| 630 | delete options[i].value;
|
---|
[863] | 631 | options[i].value = ::strdup(value);
|
---|
[372] | 632 | }
|
---|
| 633 | else {
|
---|
| 634 | Debug << "Internal error: Trying to set non-string option " << name
|
---|
| 635 | << " to string value.\n" << flush;
|
---|
| 636 | exit(1);
|
---|
| 637 | }
|
---|
| 638 | }
|
---|
| 639 |
|
---|
| 640 | void
|
---|
| 641 | Environment::ParseCmdline(const int argc,
|
---|
[492] | 642 | char **argv,
|
---|
| 643 | const int index)
|
---|
[372] | 644 | {
|
---|
| 645 | int curIndex = -1;
|
---|
| 646 |
|
---|
| 647 | for (int i = 1; i < argc; i++) {
|
---|
| 648 | // if this parameter is non-optional, skip it and increment the counter
|
---|
| 649 | if (argv[i][0] != '-') {
|
---|
| 650 | curIndex++;
|
---|
| 651 | continue;
|
---|
| 652 | }
|
---|
| 653 | // make sure to skip all non-optional parameters
|
---|
| 654 | char *t = strchr(optionalParams, argv[i][1]);
|
---|
| 655 | if (t != NULL)
|
---|
| 656 | continue;
|
---|
| 657 |
|
---|
| 658 | // if we are in the scope of the current parameter, parse it
|
---|
| 659 | if (curIndex == -1 || curIndex == index) {
|
---|
| 660 | if (argv[i][1] == 'D') {
|
---|
| 661 | // it's a full name definition
|
---|
| 662 | bool found = false;
|
---|
| 663 | int j;
|
---|
| 664 |
|
---|
| 665 | char *t = strchr(argv[i] + 2, '=');
|
---|
| 666 | if (t == NULL) {
|
---|
| 667 | Debug << "Error: Missing '=' in option. "
|
---|
| 668 | << "Syntax is -D<name>=<value>.\n" << flush;
|
---|
| 669 | exit(1);
|
---|
| 670 | }
|
---|
| 671 | for (j = 0; j < numOptions; j++)
|
---|
| 672 | if (!strncmp(options[j].name, argv[i] + 2, t - argv[i] - 2) &&
|
---|
| 673 | (unsigned)(t - argv[i] - 2) == strlen(options[j].name)) {
|
---|
| 674 | found = true;
|
---|
| 675 | break;
|
---|
| 676 | }
|
---|
| 677 | if (!found) {
|
---|
| 678 | Debug << "Warning: Unregistered option " << argv[i] << ".\n" << flush;
|
---|
| 679 | // exit(1);
|
---|
| 680 | }
|
---|
| 681 | if (found) {
|
---|
| 682 | if (!CheckType(t + 1, options[j].type)) {
|
---|
| 683 | Debug << "Error: invalid type of value " << t + 1 << " in option "
|
---|
| 684 | << options[j].name << ".\n";
|
---|
| 685 | exit(1);
|
---|
| 686 | }
|
---|
| 687 | if (options[j].value != NULL)
|
---|
| 688 | delete options[j].value;
|
---|
| 689 | options[j].value = strdup(t + 1);
|
---|
| 690 | }
|
---|
| 691 | }
|
---|
| 692 | else {
|
---|
| 693 | // it's an abbreviation
|
---|
| 694 | bool found = false;
|
---|
| 695 | int j;
|
---|
| 696 |
|
---|
| 697 | for (j = 0; j < numOptions; j++)
|
---|
| 698 | if (options[j].abbrev != NULL &&
|
---|
| 699 | !strncmp(options[j].abbrev, argv[i] + 1, strlen(options[j].abbrev))) {
|
---|
| 700 | found = true;
|
---|
| 701 | break;
|
---|
| 702 | }
|
---|
| 703 | if (!found) {
|
---|
| 704 | Debug << "Warning: Unregistered option " << argv[i] << ".\n" << flush;
|
---|
| 705 | // exit(1);
|
---|
| 706 | }
|
---|
| 707 | if (found) {
|
---|
| 708 | if (!CheckType(argv[i] + 1 + strlen(options[j].abbrev), options[j].type)) {
|
---|
| 709 | Debug << "Error: invalid type of value "
|
---|
| 710 | << argv[i] + 1 + strlen(options[j].abbrev) << "in option "
|
---|
| 711 | << options[j].name << ".\n";
|
---|
| 712 | exit(1);
|
---|
| 713 | }
|
---|
| 714 | if (options[j].value != NULL)
|
---|
| 715 | delete options[j].value;
|
---|
| 716 | options[j].value = strdup(argv[i] + 1 + strlen(options[j].abbrev));
|
---|
| 717 | }
|
---|
| 718 | }
|
---|
| 719 | }
|
---|
| 720 | }
|
---|
| 721 | #ifdef _DEBUG_PARAMS
|
---|
| 722 | // write out the options table
|
---|
| 723 | cerr << "Options table for " << numOptions << " options:\n";
|
---|
| 724 | for (int j = 0; j < numOptions; j++) {
|
---|
| 725 | cerr << options[j];
|
---|
| 726 | cerr << "\n";
|
---|
| 727 | }
|
---|
| 728 | cerr << "Options done.\n" << flush;
|
---|
| 729 | #endif // _DEBUG_PARAMS
|
---|
| 730 | }
|
---|
| 731 |
|
---|
| 732 |
|
---|
| 733 | char *
|
---|
| 734 | Environment::ParseString(char *buffer, char *string) const
|
---|
| 735 | {
|
---|
| 736 | char *s = buffer;
|
---|
| 737 | char *t = string + strlen(string);
|
---|
| 738 |
|
---|
| 739 | // skip leading whitespaces
|
---|
| 740 | while (*s == ' ' || *s == '\t')
|
---|
| 741 | s++;
|
---|
| 742 | if (*s == '\0')
|
---|
| 743 | return NULL;
|
---|
| 744 | while ((*s >= 'a' && *s <= 'z') ||
|
---|
| 745 | (*s >= 'A' && *s <= 'Z') ||
|
---|
| 746 | (*s >= '0' && *s <= '9') ||
|
---|
| 747 | *s == '_')
|
---|
| 748 | *t++ = *s++;
|
---|
| 749 | *t = '\0';
|
---|
| 750 | // skip trailing whitespaces
|
---|
| 751 | while (*s == ' ' || *s == '\t')
|
---|
| 752 | s++;
|
---|
| 753 | return s;
|
---|
| 754 | }
|
---|
| 755 |
|
---|
| 756 | const char code[] = "JIDHipewhfdhyd74387hHO&{WK:DOKQEIDKJPQ*H#@USX:#FWCQ*EJMQAHPQP(@G#RD";
|
---|
| 757 |
|
---|
| 758 | void
|
---|
| 759 | Environment::DecodeString(char *buff, int max)
|
---|
| 760 | {
|
---|
| 761 | buff[max] = 0;
|
---|
| 762 | char *p = buff;
|
---|
| 763 | const char *cp = code;
|
---|
| 764 | for (; *p; p++) {
|
---|
| 765 | if (*p != '\n')
|
---|
| 766 | *p = *p ^ *cp;
|
---|
| 767 | ++cp;
|
---|
| 768 | if (*cp == 0)
|
---|
| 769 | cp = code;
|
---|
| 770 | }
|
---|
| 771 | }
|
---|
| 772 |
|
---|
| 773 | void
|
---|
| 774 | Environment::CodeString(char *buff, int max)
|
---|
| 775 | {
|
---|
| 776 | buff[max] = 0;
|
---|
| 777 | char *p = buff;
|
---|
| 778 | const char *cp = code;
|
---|
| 779 | for (; *p; p++) {
|
---|
| 780 | if (*p != '\n')
|
---|
| 781 | *p = *p ^ *cp;
|
---|
| 782 | ++cp;
|
---|
| 783 | if (*cp == 0)
|
---|
| 784 | cp = code;
|
---|
| 785 | }
|
---|
| 786 | }
|
---|
| 787 |
|
---|
| 788 | void
|
---|
| 789 | Environment::SaveCodedFile(char *filenameText,
|
---|
| 790 | char *filenameCoded)
|
---|
| 791 | {
|
---|
| 792 | ifstream envStream(filenameText);
|
---|
| 793 |
|
---|
| 794 | // some error had occured
|
---|
| 795 | if (envStream.fail()) {
|
---|
| 796 | cerr << "Error: Can't open file " << filenameText << " for reading (err. "
|
---|
| 797 | << envStream.rdstate() << ").\n";
|
---|
| 798 | return;
|
---|
| 799 | }
|
---|
[1876] | 800 |
|
---|
[372] | 801 | char buff[256];
|
---|
| 802 | envStream.getline(buff, 255);
|
---|
| 803 | buff[8] = 0;
|
---|
| 804 | if (strcmp(buff, "CGX_CF10") == 0)
|
---|
| 805 | return;
|
---|
| 806 |
|
---|
| 807 | ofstream cStream(filenameCoded);
|
---|
| 808 | cStream<<"CGX_CF10";
|
---|
| 809 |
|
---|
| 810 | // main loop
|
---|
| 811 | for (;;) {
|
---|
| 812 | // read in one line
|
---|
| 813 | envStream.getline(buff, 255);
|
---|
| 814 | if (!envStream)
|
---|
| 815 | break;
|
---|
| 816 | CodeString(buff, 255);
|
---|
| 817 | cStream<<buff;
|
---|
| 818 | }
|
---|
| 819 |
|
---|
| 820 | }
|
---|
| 821 |
|
---|
| 822 | bool
|
---|
| 823 | Environment::ReadEnvFile(const char *envFilename)
|
---|
[975] | 824 | {
|
---|
[372] | 825 | char buff[MaxStringLength], name[MaxStringLength];
|
---|
| 826 | char *s, *t;
|
---|
| 827 | int i, line = 0;
|
---|
| 828 | bool found;
|
---|
| 829 | igzstream envStream(envFilename);
|
---|
| 830 |
|
---|
| 831 | // some error had occured
|
---|
| 832 | if (envStream.fail()) {
|
---|
| 833 | cerr << "Error: Can't open file " << envFilename << " for reading (err. "
|
---|
| 834 | << envStream.rdstate() << ").\n";
|
---|
| 835 | return false;
|
---|
| 836 | }
|
---|
[971] | 837 |
|
---|
[372] | 838 | name[0] = '\0';
|
---|
| 839 |
|
---|
| 840 | // bool coded;
|
---|
| 841 | // envStream.getline(buff, 255);
|
---|
| 842 | // buff[8] = 0;
|
---|
| 843 | // if (strcmp(buff, "CGX_CF10") == 0)
|
---|
| 844 | // coded = true;
|
---|
| 845 | // else {
|
---|
| 846 | // coded = false;
|
---|
| 847 | // envStream.Rewind();
|
---|
| 848 | // }
|
---|
| 849 |
|
---|
| 850 | // main loop
|
---|
| 851 | for (;;) {
|
---|
| 852 | // read in one line
|
---|
[1876] | 853 | envStream.getline(buff, MaxStringLength-1);
|
---|
[372] | 854 |
|
---|
| 855 | if (!envStream)
|
---|
| 856 | break;
|
---|
| 857 |
|
---|
| 858 | // if (coded)
|
---|
| 859 | // DecodeString(buff, 255);
|
---|
| 860 |
|
---|
| 861 | line++;
|
---|
| 862 | // get rid of comments
|
---|
| 863 | s = strchr(buff, '#');
|
---|
| 864 | if (s != NULL)
|
---|
| 865 | *s = '\0';
|
---|
| 866 |
|
---|
| 867 | // get one identifier
|
---|
| 868 | s = ParseString(buff, name);
|
---|
| 869 | // parse line
|
---|
| 870 | while (s != NULL) {
|
---|
| 871 | // it's a group name - make the full name
|
---|
| 872 | if (*s == '{') {
|
---|
| 873 | strcat(name, ".");
|
---|
| 874 | s++;
|
---|
| 875 | s = ParseString(s, name);
|
---|
| 876 | continue;
|
---|
| 877 | }
|
---|
| 878 | // end of group
|
---|
| 879 | if (*s == '}') {
|
---|
| 880 | if (strlen(name) == 0) {
|
---|
| 881 | cerr << "Error: unpaired } in " << envFilename << " (line "
|
---|
| 882 | << line << ").\n";
|
---|
| 883 | envStream.close();
|
---|
| 884 | return false;
|
---|
| 885 | }
|
---|
| 886 | name[strlen(name) - 1] = '\0';
|
---|
| 887 | t = strrchr(name, '.');
|
---|
| 888 | if (t == NULL)
|
---|
| 889 | name[0] = '\0';
|
---|
| 890 | else
|
---|
| 891 | *(t + 1) = '\0';
|
---|
| 892 | s++;
|
---|
| 893 | s = ParseString(s, name);
|
---|
| 894 | continue;
|
---|
| 895 | }
|
---|
| 896 | // find variable name in the table
|
---|
| 897 | found = false;
|
---|
| 898 | for (i = 0; i < numOptions; i++)
|
---|
| 899 | if (!strcmp(name, options[i].name)) {
|
---|
| 900 | found = true;
|
---|
| 901 | break;
|
---|
| 902 | }
|
---|
| 903 | if (!found) {
|
---|
| 904 | cerr << "Warning: unknown option " << name << " in environment file "
|
---|
| 905 | << envFilename << " (line " << line << ").\n";
|
---|
| 906 | } else
|
---|
| 907 | switch (options[i].type) {
|
---|
| 908 | case optInt: {
|
---|
| 909 | strtol(s, &t, 10);
|
---|
| 910 | if (t == s || (*t != ' ' && *t != '\t' &&
|
---|
| 911 | *t != '\0' && *t != '}')) {
|
---|
| 912 | cerr << "Error: Mismatch in int variable " << name << " in "
|
---|
| 913 | << "environment file " << envFilename << " (line "
|
---|
| 914 | << line << ").\n";
|
---|
| 915 | envStream.close();
|
---|
| 916 | return false;
|
---|
| 917 | }
|
---|
| 918 | if (options[i].value != NULL)
|
---|
| 919 | delete options[i].value;
|
---|
| 920 | options[i].value = new char[t - s + 1];
|
---|
| 921 | strncpy(options[i].value, s, t - s);
|
---|
| 922 | options[i].value[t - s] = '\0';
|
---|
| 923 | s = t;
|
---|
| 924 | break;
|
---|
| 925 | }
|
---|
| 926 | case optFloat: {
|
---|
| 927 | strtod(s, &t);
|
---|
| 928 | if (t == s || (*t != ' ' && *t != '\t' &&
|
---|
| 929 | *t != '\0' && *t != '}')) {
|
---|
| 930 | cerr << "Error: Mismatch in Real variable " << name << " in "
|
---|
| 931 | << "environment file " << envFilename << " (line "
|
---|
| 932 | << line << ").\n";
|
---|
| 933 | envStream.close();
|
---|
| 934 | return false;
|
---|
| 935 | }
|
---|
| 936 | if (options[i].value != NULL)
|
---|
| 937 | delete options[i].value;
|
---|
| 938 | options[i].value = new char[t - s + 1];
|
---|
| 939 | strncpy(options[i].value, s, t - s);
|
---|
| 940 | options[i].value[t - s] = '\0';
|
---|
| 941 | s = t;
|
---|
| 942 | break;
|
---|
| 943 | }
|
---|
| 944 | case optBool: {
|
---|
| 945 | t = s;
|
---|
| 946 | while ((*t >= 'a' && *t <= 'z') ||
|
---|
| 947 | (*t >= 'A' && *t <= 'Z') ||
|
---|
| 948 | *t == '+' || *t == '-')
|
---|
| 949 | t++;
|
---|
| 950 | if (((!strncasecmp(s, "true", t - s) && t - s == 4) ||
|
---|
| 951 | (!strncasecmp(s, "false", t - s) && t - s == 5) ||
|
---|
| 952 | (!strncasecmp(s, "YES", t -s) && t - s == 3) ||
|
---|
| 953 | (!strncasecmp(s, "NO", t - s) && t - s == 2) ||
|
---|
| 954 | (!strncasecmp(s, "ON", t - s) && t - s == 2) ||
|
---|
| 955 | (!strncasecmp(s, "OFF", t - s) && t - s == 3) ||
|
---|
| 956 | (t - s == 1 && (*s == '+' || *s == '-'))) &&
|
---|
| 957 | (*t == ' ' || *t == '\t' || *t == '\0' || *t == '}')) {
|
---|
| 958 | if (options[i].value != NULL)
|
---|
| 959 | delete options[i].value;
|
---|
| 960 | options[i].value = new char[t - s + 1];
|
---|
| 961 | strncpy(options[i].value, s, t - s);
|
---|
| 962 | options[i].value[t - s] = '\0';
|
---|
| 963 | s = t;
|
---|
| 964 | }
|
---|
| 965 | else {
|
---|
| 966 | cerr << "Error: Mismatch in bool variable " << name << " in "
|
---|
| 967 | << "environment file " << envFilename << " (line "
|
---|
| 968 | << line << ").\n";
|
---|
| 969 | envStream.close();
|
---|
| 970 | return false;
|
---|
| 971 | }
|
---|
| 972 | break;
|
---|
| 973 | }
|
---|
| 974 | case optVector:{
|
---|
| 975 | strtod(s, &t);
|
---|
| 976 | if (*t == ' ' || *t == '\t') {
|
---|
| 977 | while (*t == ' ' || *t == '\t')
|
---|
| 978 | t++;
|
---|
| 979 | if (*t != ',')
|
---|
| 980 | t--;
|
---|
| 981 | }
|
---|
| 982 | if (t == s || (*t != ' ' && *t != '\t' && *t != ',')) {
|
---|
| 983 | cerr << "Error: Mismatch in vector variable " << name << " in "
|
---|
| 984 | << "environment file " << envFilename << " (line "
|
---|
| 985 | << line << ").\n";
|
---|
| 986 | envStream.close();
|
---|
| 987 | return false;
|
---|
| 988 | }
|
---|
| 989 | char *u;
|
---|
| 990 | strtod(t, &u);
|
---|
| 991 | t = u;
|
---|
| 992 | if (*t == ' ' || *t == '\t') {
|
---|
| 993 | while (*t == ' ' || *t == '\t')
|
---|
| 994 | t++;
|
---|
| 995 | if (*t != ',')
|
---|
| 996 | t--;
|
---|
| 997 | }
|
---|
| 998 | if (t == s || (*t != ' ' && *t != '\t' && *t != ',')) {
|
---|
| 999 | cerr << "Error: Mismatch in vector variable " << name << " in "
|
---|
| 1000 | << "environment file " << envFilename << " (line "
|
---|
| 1001 | << line << ").\n";
|
---|
| 1002 | envStream.close();
|
---|
| 1003 | return false;
|
---|
| 1004 | }
|
---|
| 1005 | strtod(t, &u);
|
---|
| 1006 | t = u;
|
---|
| 1007 | if (t == s || (*t != ' ' && *t != '\t' &&
|
---|
| 1008 | *t != '\0' && *t != '}')) {
|
---|
| 1009 | cerr << "Error: Mismatch in vector variable " << name << " in "
|
---|
| 1010 | << "environment file " << envFilename << " (line "
|
---|
| 1011 | << line << ").\n";
|
---|
| 1012 | envStream.close();
|
---|
| 1013 | return false;
|
---|
| 1014 | }
|
---|
| 1015 | if (options[i].value != NULL)
|
---|
| 1016 | delete options[i].value;
|
---|
| 1017 | options[i].value = new char[t - s + 1];
|
---|
| 1018 | strncpy(options[i].value, s, t - s);
|
---|
| 1019 | options[i].value[t - s] = '\0';
|
---|
| 1020 | s = t;
|
---|
| 1021 | break;
|
---|
| 1022 | }
|
---|
| 1023 | case optString: {
|
---|
| 1024 | if (options[i].value != NULL)
|
---|
| 1025 | delete options[i].value;
|
---|
| 1026 | options[i].value = new char[strlen(s) + 1];
|
---|
| 1027 | strcpy(options[i].value, s);
|
---|
| 1028 | s += strlen(s);
|
---|
| 1029 | break;
|
---|
| 1030 | }
|
---|
| 1031 | default: {
|
---|
| 1032 | Debug << "Internal error: Unknown type of option.\n" << flush;
|
---|
| 1033 | exit(1);
|
---|
| 1034 | }
|
---|
| 1035 | }
|
---|
| 1036 | // prepare the variable name for next pass
|
---|
| 1037 | t = strrchr(name, '.');
|
---|
| 1038 | if (t == NULL)
|
---|
| 1039 | name[0] = '\0';
|
---|
| 1040 | else
|
---|
| 1041 | *(t + 1) = '\0';
|
---|
| 1042 | // get next identifier
|
---|
| 1043 | s = ParseString(s, name);
|
---|
| 1044 | }
|
---|
| 1045 | }
|
---|
| 1046 | envStream.close();
|
---|
| 1047 | return true;
|
---|
| 1048 | }
|
---|
| 1049 |
|
---|
| 1050 | void
|
---|
| 1051 | Environment::PrintUsage(ostream &s) const
|
---|
| 1052 | {
|
---|
| 1053 | // Print out all environment variable names
|
---|
| 1054 | s << "Registered options:\n";
|
---|
| 1055 | for (int j = 0; j < numOptions; j++)
|
---|
| 1056 | s << options[j] << "\n";
|
---|
| 1057 | s << flush;
|
---|
| 1058 | }
|
---|
| 1059 |
|
---|
[859] | 1060 | /**
|
---|
| 1061 | Input scene filename. Currently simplified X3D (.x3d), Unigraphics (.dat),
|
---|
| 1062 | and UNC (.ply) formats are supported.
|
---|
| 1063 | */
|
---|
[372] | 1064 |
|
---|
| 1065 | Environment::Environment()
|
---|
| 1066 | {
|
---|
| 1067 | optionalParams = NULL;
|
---|
| 1068 | paramRows = 0;
|
---|
| 1069 | numParams = 0;
|
---|
| 1070 | params = NULL;
|
---|
[539] | 1071 | maxOptions = 500;
|
---|
[372] | 1072 |
|
---|
| 1073 |
|
---|
| 1074 | // this is maximal nuber of options.
|
---|
| 1075 | numOptions = 0;
|
---|
| 1076 |
|
---|
| 1077 | options = new COption[maxOptions];
|
---|
| 1078 |
|
---|
| 1079 | if (options == NULL ) {
|
---|
| 1080 | Debug << "Error: Memory allocation failed.\n";
|
---|
| 1081 | exit(1);
|
---|
| 1082 | }
|
---|
| 1083 |
|
---|
| 1084 | // register all basic options
|
---|
| 1085 |
|
---|
| 1086 | RegisterOption("Limits.threshold", optFloat, NULL, "0.01");
|
---|
| 1087 | RegisterOption("Limits.small", optFloat, NULL, "1e-6");
|
---|
| 1088 | RegisterOption("Limits.infinity", optFloat, NULL, "1e6");
|
---|
| 1089 |
|
---|
| 1090 | RegisterOption("Scene.filename",
|
---|
[492] | 1091 | optString,
|
---|
| 1092 | "scene_filename=",
|
---|
| 1093 | "atlanta2.x3d");
|
---|
[372] | 1094 |
|
---|
| 1095 | RegisterOption("Unigraphics.meshGrouping",
|
---|
[492] | 1096 | optInt,
|
---|
| 1097 | "unigraphics_mesh_grouping=",
|
---|
| 1098 | "0");
|
---|
[372] | 1099 |
|
---|
[1221] | 1100 | RegisterOption("ObjParser.meshGrouping",
|
---|
| 1101 | optInt,
|
---|
| 1102 | "objparser_mesh_grouping=",
|
---|
| 1103 | "0");
|
---|
[372] | 1104 |
|
---|
| 1105 | RegisterOption("KdTree.Termination.minCost",
|
---|
[492] | 1106 | optInt,
|
---|
| 1107 | "kd_term_min_cost=",
|
---|
| 1108 | "10");
|
---|
[859] | 1109 |
|
---|
[752] | 1110 | RegisterOption("KdTree.Termination.maxNodes",
|
---|
| 1111 | optInt,
|
---|
| 1112 | "kd_term_max_nodes=",
|
---|
| 1113 | "200000");
|
---|
[859] | 1114 |
|
---|
[372] | 1115 | RegisterOption("KdTree.Termination.maxDepth",
|
---|
[492] | 1116 | optInt,
|
---|
| 1117 | "kd_term_max_depth=",
|
---|
| 1118 | "20");
|
---|
[372] | 1119 |
|
---|
| 1120 | RegisterOption("KdTree.Termination.maxCostRatio",
|
---|
[492] | 1121 | optFloat,
|
---|
| 1122 | "kd_term_max_cost_ratio=",
|
---|
| 1123 | "1.5");
|
---|
[372] | 1124 |
|
---|
| 1125 | RegisterOption("KdTree.Termination.ct_div_ci",
|
---|
[492] | 1126 | optFloat,
|
---|
| 1127 | "kd_term_ct_div_ci=",
|
---|
| 1128 | "1.0");
|
---|
[372] | 1129 |
|
---|
| 1130 | RegisterOption("KdTree.splitMethod",
|
---|
[492] | 1131 | optString,
|
---|
| 1132 | "kd_split_method=",
|
---|
| 1133 | "spatialMedian");
|
---|
[372] | 1134 |
|
---|
[2524] | 1135 |
|
---|
| 1136 | RegisterOption("KdTree.pvsArea",
|
---|
| 1137 | optFloat,
|
---|
| 1138 | "kd_pvs_area=",
|
---|
| 1139 | "1e-4");
|
---|
| 1140 |
|
---|
[372] | 1141 | RegisterOption("KdTree.splitBorder",
|
---|
| 1142 | optFloat,
|
---|
[492] | 1143 | "kd_split_border=",
|
---|
[372] | 1144 | "0.1");
|
---|
| 1145 |
|
---|
| 1146 | RegisterOption("KdTree.sahUseFaces",
|
---|
| 1147 | optBool,
|
---|
[492] | 1148 | "kd_sah_use_faces=",
|
---|
[372] | 1149 | "true");
|
---|
| 1150 |
|
---|
| 1151 | RegisterOption("MeshKdTree.Termination.minCost",
|
---|
| 1152 | optInt,
|
---|
[492] | 1153 | "kd_term_min_cost=",
|
---|
[372] | 1154 | "10");
|
---|
| 1155 |
|
---|
| 1156 | RegisterOption("MeshKdTree.Termination.maxDepth",
|
---|
| 1157 | optInt,
|
---|
[492] | 1158 | "kd_term_max_depth=",
|
---|
[372] | 1159 | "20");
|
---|
| 1160 |
|
---|
| 1161 | RegisterOption("MeshKdTree.Termination.maxCostRatio",
|
---|
| 1162 | optFloat,
|
---|
[492] | 1163 | "kd_term_max_cost_ratio=",
|
---|
[372] | 1164 | "1.5");
|
---|
| 1165 |
|
---|
| 1166 | RegisterOption("MeshKdTree.Termination.ct_div_ci",
|
---|
| 1167 | optFloat,
|
---|
[492] | 1168 | "kd_term_ct_div_ci=",
|
---|
[372] | 1169 | "1.0");
|
---|
| 1170 |
|
---|
| 1171 | RegisterOption("MeshKdTree.splitMethod",
|
---|
| 1172 | optString,
|
---|
[492] | 1173 | "kd_split_method=",
|
---|
[372] | 1174 | "spatialMedian");
|
---|
| 1175 |
|
---|
| 1176 | RegisterOption("MeshKdTree.splitBorder",
|
---|
| 1177 | optFloat,
|
---|
[492] | 1178 | "kd_split_border=",
|
---|
[372] | 1179 | "0.1");
|
---|
| 1180 |
|
---|
[1966] | 1181 | RegisterOption("Preprocessor.totalSamples",
|
---|
| 1182 | optInt,
|
---|
| 1183 | "total_samples=",
|
---|
| 1184 | "10000000");
|
---|
[372] | 1185 |
|
---|
[2046] | 1186 | RegisterOption("Preprocessor.totalTime",
|
---|
| 1187 | optInt,
|
---|
| 1188 | "total_time=",
|
---|
| 1189 | "-1");
|
---|
| 1190 |
|
---|
[1966] | 1191 | RegisterOption("Preprocessor.samplesPerPass",
|
---|
| 1192 | optInt,
|
---|
| 1193 | "samples_per_pass=",
|
---|
| 1194 | "100000");
|
---|
| 1195 |
|
---|
| 1196 | RegisterOption("Preprocessor.samplesPerEvaluation",
|
---|
| 1197 | optInt,
|
---|
| 1198 | "samples_per_evaluation=",
|
---|
| 1199 | "1000000");
|
---|
[372] | 1200 |
|
---|
[1968] | 1201 | RegisterOption("Preprocessor.useHwGlobalLines",
|
---|
| 1202 | optBool,
|
---|
| 1203 | "preprocessor_use_hw_global_lines=",
|
---|
| 1204 | "false");
|
---|
| 1205 |
|
---|
| 1206 | RegisterOption("Preprocessor.HwGlobalLines.texHeight",
|
---|
| 1207 | optInt,
|
---|
| 1208 | "preprocessor_hw_global_lines_texheight=",
|
---|
| 1209 | "128");
|
---|
| 1210 |
|
---|
| 1211 | RegisterOption("Preprocessor.HwGlobalLines.texWidth",
|
---|
| 1212 | optInt,
|
---|
| 1213 | "preprocessor_hw_global_lines_texwidth=",
|
---|
| 1214 | "128");
|
---|
| 1215 |
|
---|
| 1216 | RegisterOption("Preprocessor.HwGlobalLines.stepSize",
|
---|
| 1217 | optFloat,
|
---|
| 1218 | "preprocessor_hw_global_lines_stepsize=",
|
---|
| 1219 | "0.0001");
|
---|
| 1220 |
|
---|
| 1221 | RegisterOption("Preprocessor.HwGlobalLines.maxDepth",
|
---|
| 1222 | optInt,
|
---|
| 1223 | "preprocessor_hw_global_lines_max_depth=",
|
---|
| 1224 | "50");
|
---|
| 1225 |
|
---|
| 1226 | RegisterOption("Preprocessor.HwGlobalLines.sampleReverse",
|
---|
| 1227 | optBool,
|
---|
| 1228 | "preprocessor_hw_global_lines_sample_reverse=",
|
---|
| 1229 | "true");
|
---|
| 1230 |
|
---|
[811] | 1231 | RegisterOption("RenderSampler.samples",
|
---|
| 1232 | optInt,
|
---|
| 1233 | "render_sampler_samples=",
|
---|
| 1234 | "1000");
|
---|
| 1235 |
|
---|
[1001] | 1236 | RegisterOption("RenderSampler.visibleThreshold",
|
---|
| 1237 | optInt,
|
---|
| 1238 | "render_sampler_visible_threshold=",
|
---|
| 1239 | "0");
|
---|
| 1240 |
|
---|
[997] | 1241 | RegisterOption("RenderSampler.useOcclusionQueries",
|
---|
| 1242 | optBool,
|
---|
| 1243 | "render_sampler_use_occlusion_queries=",
|
---|
| 1244 | "true");
|
---|
[492] | 1245 |
|
---|
[1001] | 1246 | RegisterOption("VssPreprocessor.testBeamSampling",
|
---|
| 1247 | optBool,
|
---|
[1486] | 1248 | "vss_beam_sampling=",
|
---|
[1001] | 1249 | "false");
|
---|
[532] | 1250 |
|
---|
[403] | 1251 | RegisterOption("VssPreprocessor.useImportanceSampling",
|
---|
[492] | 1252 | optBool,
|
---|
| 1253 | "vss_use_importance=",
|
---|
| 1254 | "true");
|
---|
[403] | 1255 |
|
---|
[1785] | 1256 |
|
---|
[674] | 1257 | RegisterOption("VssPreprocessor.enlargeViewSpace",
|
---|
| 1258 | optBool,
|
---|
| 1259 | "vss_enlarge_viewspace=",
|
---|
[675] | 1260 | "false");
|
---|
[674] | 1261 |
|
---|
[490] | 1262 | RegisterOption("VssPreprocessor.loadInitialSamples",
|
---|
| 1263 | optBool,
|
---|
[674] | 1264 | "vss_load_loadInitialSamples=",
|
---|
[490] | 1265 | "false");
|
---|
[445] | 1266 |
|
---|
[490] | 1267 | RegisterOption("VssPreprocessor.storeInitialSamples",
|
---|
| 1268 | optBool,
|
---|
[674] | 1269 | "vss_store_storedInitialSamples=",
|
---|
[490] | 1270 | "false");
|
---|
[1723] | 1271 |
|
---|
[501] | 1272 |
|
---|
[445] | 1273 |
|
---|
[1968] | 1274 | /*************************************************************************/
|
---|
[2060] | 1275 | /* Mutation strategy related options */
|
---|
| 1276 | /*************************************************************************/
|
---|
| 1277 |
|
---|
| 1278 | RegisterOption("Mutation.bufferSize",
|
---|
| 1279 | optInt,
|
---|
| 1280 | "mutation_buffer_size=",
|
---|
| 1281 | "500000");
|
---|
| 1282 |
|
---|
| 1283 | RegisterOption("Mutation.radiusOrigin",
|
---|
| 1284 | optFloat,
|
---|
| 1285 | "mutation_radius_origin=",
|
---|
| 1286 | "0.5");
|
---|
| 1287 |
|
---|
| 1288 | RegisterOption("Mutation.radiusTermination",
|
---|
| 1289 | optFloat,
|
---|
| 1290 | "mutation_radius_termination=",
|
---|
| 1291 | "0.5");
|
---|
| 1292 |
|
---|
| 1293 | RegisterOption("Mutation.useReverseSamples",
|
---|
| 1294 | optBool,
|
---|
| 1295 | "mutation_use_reverse_samples",
|
---|
| 1296 | "true");
|
---|
| 1297 |
|
---|
| 1298 | RegisterOption("Mutation.reverseSamplesDistance",
|
---|
| 1299 | optFloat,
|
---|
[2076] | 1300 | "mutation_reverse_samples_distance=",
|
---|
[2060] | 1301 | "3.0");
|
---|
| 1302 |
|
---|
| 1303 | RegisterOption("Mutation.useSilhouetteSamples",
|
---|
| 1304 | optBool,
|
---|
| 1305 | "mutation_use_silhouette_samples",
|
---|
| 1306 | "true");
|
---|
| 1307 |
|
---|
| 1308 | RegisterOption("Mutation.silhouetteSearchSteps",
|
---|
| 1309 | optInt,
|
---|
| 1310 | "mutation_silhouette_search_steps=",
|
---|
| 1311 | "3");
|
---|
| 1312 |
|
---|
| 1313 | RegisterOption("Mutation.silhouetteProb",
|
---|
| 1314 | optFloat,
|
---|
| 1315 | "mutation_silhouette_prob=",
|
---|
| 1316 | "0.8");
|
---|
| 1317 |
|
---|
| 1318 | RegisterOption("Mutation.usePassImportance",
|
---|
| 1319 | optBool,
|
---|
| 1320 | "mutation_use_pass_importance",
|
---|
| 1321 | "true");
|
---|
| 1322 |
|
---|
| 1323 | RegisterOption("Mutation.useUnsuccCountImportance",
|
---|
| 1324 | optBool,
|
---|
| 1325 | "mutation_use_unsucc_count_importance",
|
---|
| 1326 | "false");
|
---|
| 1327 |
|
---|
| 1328 |
|
---|
| 1329 | /*************************************************************************/
|
---|
[1968] | 1330 | /* GvsPrerpocessor related options */
|
---|
| 1331 | /*************************************************************************/
|
---|
[445] | 1332 |
|
---|
[1486] | 1333 |
|
---|
| 1334 | RegisterOption("GvsPreprocessor.totalSamples",
|
---|
| 1335 | optInt,
|
---|
| 1336 | "gvs_total_samples=",
|
---|
| 1337 | "1000000");
|
---|
| 1338 |
|
---|
[2048] | 1339 | RegisterOption("GvsPreprocessor.gvsSamplesPerPass",
|
---|
[1486] | 1340 | optInt,
|
---|
| 1341 | "gvs_samples_per_pass=",
|
---|
| 1342 | "100000");
|
---|
| 1343 |
|
---|
| 1344 | RegisterOption("GvsPreprocessor.initialSamples",
|
---|
| 1345 | optInt,
|
---|
| 1346 | "gvs_initial_samples=",
|
---|
| 1347 | "256");
|
---|
| 1348 |
|
---|
| 1349 | RegisterOption("GvsPreprocessor.epsilon",
|
---|
| 1350 | optFloat,
|
---|
[1522] | 1351 | "gvs_epsilon=",
|
---|
[1486] | 1352 | "0.00001");
|
---|
| 1353 |
|
---|
[1500] | 1354 | RegisterOption("GvsPreprocessor.threshold",
|
---|
| 1355 | optFloat,
|
---|
[1522] | 1356 | "gvs_threshold=",
|
---|
[1500] | 1357 | "1.5");
|
---|
[1486] | 1358 |
|
---|
[1976] | 1359 | RegisterOption("GvsPreprocessor.perViewCell",
|
---|
| 1360 | optBool,
|
---|
| 1361 | "gvs_per_viewcell=",
|
---|
[2360] | 1362 | "true");
|
---|
[1976] | 1363 |
|
---|
[1934] | 1364 | RegisterOption("GvsPreprocessor.stats",
|
---|
[1996] | 1365 | optString,
|
---|
| 1366 | "gvs_stats=",
|
---|
| 1367 | "gvsStats.log");
|
---|
| 1368 |
|
---|
| 1369 | RegisterOption("GvsPreprocessor.minContribution",
|
---|
| 1370 | optInt,
|
---|
| 1371 | "gvs_min_contribution=",
|
---|
| 1372 | "50");
|
---|
| 1373 |
|
---|
| 1374 | RegisterOption("GvsPreprocessor.maxViewCells",
|
---|
| 1375 | optInt,
|
---|
| 1376 | "gvs_max_viewcells=",
|
---|
| 1377 | "5");
|
---|
| 1378 |
|
---|
| 1379 |
|
---|
[1968] | 1380 | /**********************************************************************/
|
---|
| 1381 | /* View cells related options */
|
---|
| 1382 | /**********************************************************************/
|
---|
[1486] | 1383 |
|
---|
| 1384 |
|
---|
[508] | 1385 | RegisterOption("ViewCells.type",
|
---|
[2124] | 1386 | optString,
|
---|
| 1387 | "view_cells_type=",
|
---|
| 1388 | "vspBspTree");
|
---|
[372] | 1389 |
|
---|
[662] | 1390 | RegisterOption("ViewCells.samplingType",
|
---|
[2124] | 1391 | optString,
|
---|
| 1392 | "view_cells_sampling_type=",
|
---|
| 1393 | "box");
|
---|
[662] | 1394 |
|
---|
[666] | 1395 | RegisterOption("ViewCells.mergeStats",
|
---|
[660] | 1396 | optString,
|
---|
[666] | 1397 | "view_cells_merge_stats=",
|
---|
| 1398 | "mergeStats.log");
|
---|
[660] | 1399 |
|
---|
[664] | 1400 | RegisterOption("ViewCells.Evaluation.statsPrefix",
|
---|
[660] | 1401 | optString,
|
---|
[664] | 1402 | "view_cells_evaluation_stats_prefix=",
|
---|
[660] | 1403 | "viewCells");
|
---|
[1418] | 1404 |
|
---|
[735] | 1405 | RegisterOption("ViewCells.Evaluation.histogram",
|
---|
| 1406 | optBool,
|
---|
| 1407 | "view_cells_evaluation_histogram=",
|
---|
| 1408 | "false");
|
---|
| 1409 |
|
---|
[997] | 1410 | RegisterOption("ViewCells.Evaluation.histoStepSize",
|
---|
[735] | 1411 | optInt,
|
---|
[997] | 1412 | "view_cells_evaluation_histo_step_size=",
|
---|
[744] | 1413 | "5000");
|
---|
[735] | 1414 |
|
---|
[1919] | 1415 | RegisterOption("ViewCells.Evaluation.histoMem",
|
---|
| 1416 | optInt,
|
---|
| 1417 | "view_cells_evaluation_histo_mem=",
|
---|
| 1418 | "50");
|
---|
| 1419 |
|
---|
[728] | 1420 | RegisterOption("ViewCells.renderCostEvaluationType",
|
---|
| 1421 | optString,
|
---|
| 1422 | "view_cells_render_cost_evaluation=",
|
---|
| 1423 | "perobject");
|
---|
| 1424 |
|
---|
[660] | 1425 | RegisterOption("ViewCells.active",
|
---|
| 1426 | optInt,
|
---|
[664] | 1427 | "view_cells_active=",
|
---|
[660] | 1428 | "1000");
|
---|
[581] | 1429 |
|
---|
[574] | 1430 | RegisterOption("ViewCells.Construction.samples",
|
---|
| 1431 | optInt,
|
---|
| 1432 | "view_cells_construction_samples=",
|
---|
[1134] | 1433 | "0");
|
---|
[574] | 1434 |
|
---|
| 1435 | RegisterOption("ViewCells.Construction.samplesPerPass",
|
---|
| 1436 | optInt,
|
---|
| 1437 | "view_cells_construction_samples_per_pass=",
|
---|
| 1438 | "500000");
|
---|
| 1439 |
|
---|
[508] | 1440 | RegisterOption("ViewCells.PostProcess.samples",
|
---|
| 1441 | optInt,
|
---|
[712] | 1442 | "view_cells_post_process_samples=",
|
---|
[1134] | 1443 | "0");
|
---|
[421] | 1444 |
|
---|
[508] | 1445 | RegisterOption("ViewCells.Visualization.samples",
|
---|
| 1446 | optInt,
|
---|
| 1447 | "view_cells_visualization_samples=",
|
---|
[1134] | 1448 | "0");
|
---|
[372] | 1449 |
|
---|
[1020] | 1450 | RegisterOption("ViewCells.Visualization.maxOutput",
|
---|
| 1451 | optInt,
|
---|
| 1452 | "view_cells_visualization_max_output=",
|
---|
| 1453 | "20");
|
---|
| 1454 |
|
---|
[697] | 1455 | RegisterOption("ViewCells.Filter.maxSize",
|
---|
| 1456 | optInt,
|
---|
| 1457 | "view_cells_filter_max_size=",
|
---|
| 1458 | "4");
|
---|
| 1459 |
|
---|
| 1460 | RegisterOption("ViewCells.Filter.width",
|
---|
| 1461 | optFloat,
|
---|
| 1462 | "view_cells_filter_width=",
|
---|
[2051] | 1463 | "1.0");
|
---|
[697] | 1464 |
|
---|
[508] | 1465 | RegisterOption("ViewCells.loadFromFile",
|
---|
| 1466 | optBool,
|
---|
[664] | 1467 | "view_cells_load_from_file=",
|
---|
[508] | 1468 | "false");
|
---|
[485] | 1469 |
|
---|
[586] | 1470 | RegisterOption("ViewCells.PostProcess.refine",
|
---|
| 1471 | optBool,
|
---|
[664] | 1472 | "view_cells_refine=",
|
---|
[586] | 1473 | "false");
|
---|
| 1474 |
|
---|
| 1475 | RegisterOption("ViewCells.PostProcess.compress",
|
---|
| 1476 | optBool,
|
---|
[664] | 1477 | "view_cells_post_process_compress=",
|
---|
[586] | 1478 | "false");
|
---|
| 1479 |
|
---|
[662] | 1480 | RegisterOption("ViewCells.Evaluation.samples",
|
---|
| 1481 | optInt,
|
---|
| 1482 | "view_cells_evaluation_samples=",
|
---|
| 1483 | "8000000");
|
---|
| 1484 |
|
---|
[722] | 1485 | RegisterOption("ViewCells.Evaluation.samplingType",
|
---|
[837] | 1486 | optString,
|
---|
| 1487 | "view_cells_evaluation_sampling_type=",
|
---|
| 1488 | "box");
|
---|
[722] | 1489 |
|
---|
[662] | 1490 | RegisterOption("ViewCells.Evaluation.samplesPerPass",
|
---|
| 1491 | optInt,
|
---|
| 1492 | "view_cells_evaluation_samples_per_pass=",
|
---|
| 1493 | "300000");
|
---|
| 1494 |
|
---|
[1695] | 1495 | RegisterOption("ViewCells.Evaluation.samplesForStats",
|
---|
| 1496 | optInt,
|
---|
| 1497 | "view_cells_evaluation_samples_for_stats=",
|
---|
| 1498 | "300000");
|
---|
| 1499 |
|
---|
[508] | 1500 | RegisterOption("ViewCells.exportToFile",
|
---|
| 1501 | optBool,
|
---|
[676] | 1502 | "view_cells_export_to_file=",
|
---|
[508] | 1503 | "false");
|
---|
| 1504 |
|
---|
[844] | 1505 | RegisterOption("ViewCells.exportPvs",
|
---|
| 1506 | optBool,
|
---|
| 1507 | "view_cells_export_pvs=",
|
---|
| 1508 | "false");
|
---|
| 1509 |
|
---|
[840] | 1510 | RegisterOption("ViewCells.exportBboxesForPvs",
|
---|
| 1511 | optBool,
|
---|
[844] | 1512 | "view_cells_export_bounding_boxes=",
|
---|
[840] | 1513 | "true");
|
---|
| 1514 |
|
---|
| 1515 | RegisterOption("ViewCells.boxesFilename",
|
---|
| 1516 | optString,
|
---|
| 1517 | "view_cells_boxes_filename=",
|
---|
| 1518 | "boxes.out");
|
---|
| 1519 |
|
---|
[664] | 1520 | RegisterOption("ViewCells.evaluateViewCells",
|
---|
| 1521 | optBool,
|
---|
[670] | 1522 | "view_cells_evaluate=",
|
---|
[664] | 1523 | "false");
|
---|
| 1524 |
|
---|
[508] | 1525 | RegisterOption("ViewCells.maxViewCells",
|
---|
[667] | 1526 | optInt,
|
---|
| 1527 | "view_cells_max_view_cells=",
|
---|
| 1528 | "0");
|
---|
[508] | 1529 |
|
---|
[1713] | 1530 | RegisterOption("ViewCells.Evaluation.stepSize",
|
---|
| 1531 | optInt,
|
---|
| 1532 | "view_cells_evaluation_step_size=",
|
---|
| 1533 | "100");
|
---|
| 1534 |
|
---|
[511] | 1535 | RegisterOption("ViewCells.maxPvsRatio",
|
---|
| 1536 | optFloat,
|
---|
| 1537 | "view_cells_max_pvs_ratio=",
|
---|
| 1538 | "0.1");
|
---|
[508] | 1539 |
|
---|
[2332] | 1540 | RegisterOption("ViewCells.triangleWeight",
|
---|
| 1541 | optFloat,
|
---|
| 1542 | "view_cells_triangle_weight=",
|
---|
| 1543 | "1.0");
|
---|
| 1544 |
|
---|
| 1545 | RegisterOption("ViewCells.objectWeight",
|
---|
| 1546 | optFloat,
|
---|
| 1547 | "view_cells_object_weight=",
|
---|
| 1548 | "0.0");
|
---|
| 1549 |
|
---|
[508] | 1550 | RegisterOption("ViewCells.filename",
|
---|
[667] | 1551 | optString,
|
---|
| 1552 | "view_cells_filename=",
|
---|
| 1553 | "atlanta_viewcells_large.x3d");
|
---|
[508] | 1554 |
|
---|
| 1555 | RegisterOption("ViewCells.height",
|
---|
[667] | 1556 | optFloat,
|
---|
| 1557 | "view_cells_height=",
|
---|
| 1558 | "5.0");
|
---|
[508] | 1559 |
|
---|
| 1560 | RegisterOption("ViewCells.Visualization.colorCode",
|
---|
[667] | 1561 | optString,
|
---|
[708] | 1562 | "view_cells_visualization_color_code=",
|
---|
[667] | 1563 | "PVS");
|
---|
[482] | 1564 |
|
---|
[667] | 1565 | RegisterOption("ViewCells.Visualization.clipPlanePos",
|
---|
| 1566 | optFloat,
|
---|
[708] | 1567 | "view_cells_visualization_clip_plane_pos=",
|
---|
[667] | 1568 | "0.35");
|
---|
[579] | 1569 |
|
---|
[508] | 1570 | RegisterOption("ViewCells.Visualization.exportGeometry",
|
---|
[667] | 1571 | optBool,
|
---|
[708] | 1572 | "view_cells_visualization_export_geometry=",
|
---|
[667] | 1573 | "false");
|
---|
[445] | 1574 |
|
---|
[667] | 1575 | RegisterOption("ViewCells.Visualization.exportRays",
|
---|
| 1576 | optBool,
|
---|
[708] | 1577 | "view_cells_visualization_export_rays=",
|
---|
[667] | 1578 | "false");
|
---|
| 1579 |
|
---|
[564] | 1580 | RegisterOption("ViewCells.processOnlyValidViewCells",
|
---|
[667] | 1581 | optBool,
|
---|
[1761] | 1582 | "view_cells_process_only_valid_view_cells",
|
---|
[667] | 1583 | "false");
|
---|
[660] | 1584 |
|
---|
[580] | 1585 | RegisterOption("ViewCells.PostProcess.maxCostRatio",
|
---|
| 1586 | optFloat,
|
---|
[667] | 1587 | "view_cells_post_process_max_cost_ratio=",
|
---|
[580] | 1588 | "0.9");
|
---|
| 1589 |
|
---|
| 1590 | RegisterOption("ViewCells.PostProcess.renderCostWeight",
|
---|
| 1591 | optFloat,
|
---|
[667] | 1592 | "view_cells_post_process_render_cost_weight",
|
---|
[580] | 1593 | "0.5");
|
---|
| 1594 |
|
---|
| 1595 | RegisterOption("ViewCells.PostProcess.avgCostMaxDeviation",
|
---|
| 1596 | optFloat,
|
---|
[1143] | 1597 | "view_cells_avgcost_max_deviations",
|
---|
[580] | 1598 | "0.5");
|
---|
| 1599 |
|
---|
| 1600 | RegisterOption("ViewCells.PostProcess.maxMergesPerPass",
|
---|
| 1601 | optInt,
|
---|
[667] | 1602 | "view_cells_post_process_max_merges_per_pass=",
|
---|
[580] | 1603 | "500");
|
---|
| 1604 |
|
---|
| 1605 | RegisterOption("ViewCells.PostProcess.minViewCells",
|
---|
| 1606 | optInt,
|
---|
[667] | 1607 | "view_cells_post_process_min_view_cells=",
|
---|
[580] | 1608 | "1000");
|
---|
| 1609 |
|
---|
| 1610 | RegisterOption("ViewCells.PostProcess.useRaysForMerge",
|
---|
| 1611 | optBool,
|
---|
| 1612 | "view_cells_post_process_use_rays_for_merge=",
|
---|
| 1613 | "false");
|
---|
[591] | 1614 |
|
---|
| 1615 | RegisterOption("ViewCells.PostProcess.merge",
|
---|
| 1616 | optBool,
|
---|
[666] | 1617 | "view_cells_post_process_merge=",
|
---|
[591] | 1618 | "true");
|
---|
[580] | 1619 |
|
---|
| 1620 | RegisterOption("ViewCells.Visualization.exportMergedViewCells",
|
---|
| 1621 | optBool,
|
---|
| 1622 | "view_cells_viz_export_merged_viewcells=",
|
---|
| 1623 | "false");
|
---|
| 1624 |
|
---|
[582] | 1625 | RegisterOption("ViewCells.maxStaticMemory",
|
---|
| 1626 | optFloat,
|
---|
| 1627 | "view_cells_max_static_mem=",
|
---|
| 1628 | "8.0");
|
---|
[580] | 1629 |
|
---|
[660] | 1630 | RegisterOption("ViewCells.Visualization.useClipPlane",
|
---|
[591] | 1631 | optBool,
|
---|
[660] | 1632 | "view_cells_viz_use_clip_plane=",
|
---|
[591] | 1633 | "false");
|
---|
| 1634 |
|
---|
[666] | 1635 | RegisterOption("ViewCells.showVisualization",
|
---|
| 1636 | optBool,
|
---|
| 1637 | "view_cells_show_visualization=",
|
---|
| 1638 | "false");
|
---|
| 1639 |
|
---|
[660] | 1640 | RegisterOption("ViewCells.Visualization.clipPlaneAxis",
|
---|
[591] | 1641 | optInt,
|
---|
[660] | 1642 | "view_cells_viz_clip_plane_axis=",
|
---|
[591] | 1643 | "0");
|
---|
| 1644 |
|
---|
[1545] | 1645 | RegisterOption("ViewCells.loadGeometry",
|
---|
| 1646 | optBool,
|
---|
| 1647 | "view_cells_load_geometry=",
|
---|
| 1648 | "false");
|
---|
[1159] | 1649 |
|
---|
[1545] | 1650 | RegisterOption("ViewCells.geometryFilename",
|
---|
| 1651 | optString,
|
---|
| 1652 | "view_cells_geometry_filename=",
|
---|
| 1653 | "viewCellsGeometry.x3d");
|
---|
| 1654 |
|
---|
| 1655 | RegisterOption("ViewCells.useBaseTrianglesAsGeometry",
|
---|
| 1656 | optBool,
|
---|
| 1657 | "view_cells_use_base_triangles_as_geometry=",
|
---|
| 1658 | "false");
|
---|
| 1659 |
|
---|
[1887] | 1660 | RegisterOption("ViewCells.compressObjects",
|
---|
| 1661 | optBool,
|
---|
| 1662 | "view_cells_compress_objects=",
|
---|
| 1663 | "false");
|
---|
[2010] | 1664 |
|
---|
[1902] | 1665 | RegisterOption("ViewCells.useKdPvs",
|
---|
| 1666 | optBool,
|
---|
[2006] | 1667 | "view_cells_use_kd_pvs",
|
---|
[1902] | 1668 | "false");
|
---|
[1887] | 1669 |
|
---|
[1974] | 1670 | RegisterOption("ViewCells.useKdPvsAfterFiltering",
|
---|
| 1671 | optBool,
|
---|
[2010] | 1672 | "af_use_kd_pvs",
|
---|
[1974] | 1673 | "false");
|
---|
[1902] | 1674 |
|
---|
[2048] | 1675 | RegisterOption("ViewCells.importRandomViewCells",
|
---|
| 1676 | optBool,
|
---|
| 1677 | "view_cells_import_random_viewcells=",
|
---|
| 1678 | "false");
|
---|
[1902] | 1679 |
|
---|
[2048] | 1680 | RegisterOption("ViewCells.exportRandomViewCells",
|
---|
| 1681 | optBool,
|
---|
| 1682 | "view_cells_export_random_viewcells=",
|
---|
| 1683 | "false");
|
---|
[1974] | 1684 |
|
---|
[2048] | 1685 |
|
---|
| 1686 |
|
---|
[1418] | 1687 | /****************************************************************************/
|
---|
| 1688 | /* Render simulation related options */
|
---|
| 1689 | /****************************************************************************/
|
---|
[372] | 1690 |
|
---|
[406] | 1691 |
|
---|
[508] | 1692 | RegisterOption("Simulation.objRenderCost",
|
---|
| 1693 | optFloat,
|
---|
| 1694 | "simulation_obj_render_cost",
|
---|
| 1695 | "1.0");
|
---|
[409] | 1696 |
|
---|
[508] | 1697 | RegisterOption("Simulation.vcOverhead",
|
---|
| 1698 | optFloat,
|
---|
| 1699 | "simulation_vc_overhead",
|
---|
| 1700 | "0.05");
|
---|
[445] | 1701 |
|
---|
[508] | 1702 | RegisterOption("Simulation.moveSpeed",
|
---|
| 1703 | optFloat,
|
---|
| 1704 | "simulation_moveSpeed",
|
---|
| 1705 | "1.0");
|
---|
[445] | 1706 |
|
---|
| 1707 |
|
---|
| 1708 |
|
---|
[1486] | 1709 | /******************************************************************/
|
---|
| 1710 | /* Bsp tree related options */
|
---|
| 1711 | /******************************************************************/
|
---|
[445] | 1712 |
|
---|
[372] | 1713 |
|
---|
[508] | 1714 | RegisterOption("BspTree.Construction.input",
|
---|
| 1715 | optString,
|
---|
| 1716 | "bsp_construction_input=",
|
---|
| 1717 | "fromViewCells");
|
---|
[1867] | 1718 |
|
---|
[660] | 1719 | RegisterOption("BspTree.subdivisionStats",
|
---|
| 1720 | optString,
|
---|
[666] | 1721 | "bsp_subdivision_stats=",
|
---|
[660] | 1722 | "bspSubdivisionStats.log");
|
---|
| 1723 |
|
---|
[508] | 1724 | RegisterOption("BspTree.Construction.samples",
|
---|
| 1725 | optInt,
|
---|
| 1726 | "bsp_construction_samples=",
|
---|
| 1727 | "100000");
|
---|
[390] | 1728 |
|
---|
[508] | 1729 | RegisterOption("BspTree.Construction.epsilon",
|
---|
| 1730 | optFloat,
|
---|
[1023] | 1731 | "bsp_construction_epsilon=",
|
---|
[508] | 1732 | "0.002");
|
---|
[397] | 1733 |
|
---|
[508] | 1734 | RegisterOption("BspTree.Termination.minPolygons",
|
---|
| 1735 | optInt,
|
---|
| 1736 | "bsp_term_min_polygons=",
|
---|
| 1737 | "5");
|
---|
[409] | 1738 |
|
---|
[508] | 1739 | RegisterOption("BspTree.Termination.minPvs",
|
---|
| 1740 | optInt,
|
---|
| 1741 | "bsp_term_min_pvs=",
|
---|
| 1742 | "20");
|
---|
[372] | 1743 |
|
---|
[587] | 1744 | RegisterOption("BspTree.Termination.minProbability",
|
---|
[508] | 1745 | optFloat,
|
---|
[587] | 1746 | "bsp_term_min_probability=",
|
---|
[508] | 1747 | "0.001");
|
---|
[424] | 1748 |
|
---|
[508] | 1749 | RegisterOption("BspTree.Termination.maxRayContribution",
|
---|
| 1750 | optFloat,
|
---|
| 1751 | "bsp_term_ray_contribution=",
|
---|
| 1752 | "0.005");
|
---|
[372] | 1753 |
|
---|
[508] | 1754 | RegisterOption("BspTree.Termination.minAccRayLenght",
|
---|
| 1755 | optFloat,
|
---|
| 1756 | "bsp_term_min_acc_ray_length=",
|
---|
| 1757 | "50");
|
---|
[372] | 1758 |
|
---|
[508] | 1759 | RegisterOption("BspTree.Termination.minRays",
|
---|
| 1760 | optInt,
|
---|
| 1761 | "bsp_term_min_rays=",
|
---|
| 1762 | "-1");
|
---|
[372] | 1763 |
|
---|
[508] | 1764 | RegisterOption("BspTree.Termination.ct_div_ci",
|
---|
| 1765 | optFloat,
|
---|
| 1766 | "bsp_term_ct_div_ci=",
|
---|
| 1767 | "0.0");
|
---|
[372] | 1768 |
|
---|
[508] | 1769 | RegisterOption("BspTree.Termination.maxDepth",
|
---|
| 1770 | optInt,
|
---|
| 1771 | "bsp_term_max_depth=",
|
---|
| 1772 | "100");
|
---|
[372] | 1773 |
|
---|
[508] | 1774 | RegisterOption("BspTree.Termination.maxCostRatio",
|
---|
| 1775 | optFloat,
|
---|
| 1776 | "bsp_term_axis_aligned_max_cost_ratio=",
|
---|
| 1777 | "1.5");
|
---|
[372] | 1778 |
|
---|
[508] | 1779 | RegisterOption("BspTree.Termination.AxisAligned.ct_div_ci",
|
---|
| 1780 | optFloat,
|
---|
| 1781 | "bsp_term_axis_aligned_ct_div_ci=",
|
---|
| 1782 | "0.5");
|
---|
[372] | 1783 |
|
---|
[508] | 1784 | RegisterOption("BspTree.AxisAligned.splitBorder",
|
---|
| 1785 | optFloat,
|
---|
| 1786 | "bsp__axis_aligned_split_border=",
|
---|
| 1787 | "0.1");
|
---|
[372] | 1788 |
|
---|
[508] | 1789 | RegisterOption("BspTree.Termination.AxisAligned.minPolys",
|
---|
| 1790 | optInt,
|
---|
| 1791 | "bsp_term_axis_aligned_max_polygons=",
|
---|
| 1792 | "50");
|
---|
[379] | 1793 |
|
---|
[508] | 1794 | RegisterOption("BspTree.Termination.AxisAligned.minObjects",
|
---|
| 1795 | optInt,
|
---|
| 1796 | "bsp_term_min_objects=",
|
---|
| 1797 | "3");
|
---|
[441] | 1798 |
|
---|
[508] | 1799 | RegisterOption("BspTree.Termination.AxisAligned.minRays",
|
---|
| 1800 | optInt,
|
---|
| 1801 | "bsp_term_axis_aligned_min_rays=",
|
---|
| 1802 | "-1");
|
---|
[374] | 1803 |
|
---|
[508] | 1804 | RegisterOption("BspTree.splitPlaneStrategy",
|
---|
| 1805 | optString,
|
---|
| 1806 | "bsp_split_method=",
|
---|
| 1807 | "leastSplits");
|
---|
[424] | 1808 |
|
---|
[508] | 1809 | RegisterOption("BspTree.maxPolyCandidates",
|
---|
| 1810 | optInt,
|
---|
| 1811 | "bsp_max_poly_candidates=",
|
---|
| 1812 | "20");
|
---|
[469] | 1813 |
|
---|
[508] | 1814 | RegisterOption("BspTree.maxRayCandidates",
|
---|
| 1815 | optInt,
|
---|
| 1816 | "bsp_max_plane_candidates=",
|
---|
| 1817 | "20");
|
---|
[382] | 1818 |
|
---|
[508] | 1819 | RegisterOption("BspTree.maxTests",
|
---|
| 1820 | optInt,
|
---|
| 1821 | "bsp_max_tests=",
|
---|
| 1822 | "5000");
|
---|
[382] | 1823 |
|
---|
[587] | 1824 | RegisterOption("BspTree.Termination.maxViewCells",
|
---|
| 1825 | optInt,
|
---|
| 1826 | "bsp_max_view_cells=",
|
---|
| 1827 | "5000");
|
---|
| 1828 |
|
---|
[508] | 1829 | RegisterOption("BspTree.Visualization.exportSplits",
|
---|
| 1830 | optBool,
|
---|
[1545] | 1831 | "bsp_visualization.export_splits=",
|
---|
[508] | 1832 | "false");
|
---|
[445] | 1833 |
|
---|
[508] | 1834 | RegisterOption("BspTree.Factor.verticalSplits", optFloat, "bsp_factor_vertical=", "1.0");
|
---|
| 1835 | RegisterOption("BspTree.Factor.largestPolyArea", optFloat, "bsp_factor_largest_poly=", "1.0");
|
---|
| 1836 | RegisterOption("BspTree.Factor.blockedRays", optFloat, "bsp_factor_blocked=", "1.0");
|
---|
| 1837 | RegisterOption("BspTree.Factor.leastSplits", optFloat, "bsp_factor_least_splits=", "1.0");
|
---|
| 1838 | RegisterOption("BspTree.Factor.balancedPolys", optFloat, "bsp_factor_balanced_polys=", "1.0");
|
---|
| 1839 | RegisterOption("BspTree.Factor.balancedViewCells", optFloat, "bsp_factor_balanced_view_cells=", "1.0");
|
---|
| 1840 | RegisterOption("BspTree.Factor.leastRaySplits", optFloat, "bsp_factor_least_ray_splits=", "1.0");
|
---|
| 1841 | RegisterOption("BspTree.Factor.balancedRays", optFloat, "bsp_factor_balanced_rays=", "1.0");
|
---|
| 1842 | RegisterOption("BspTree.Factor.pvs", optFloat, "bsp_factor_pvs=", "1.0");
|
---|
[408] | 1843 |
|
---|
| 1844 |
|
---|
[2048] | 1845 |
|
---|
| 1846 |
|
---|
| 1847 | /**********************************************************************/
|
---|
| 1848 | /* Preprocessor related options */
|
---|
| 1849 | /**********************************************************************/
|
---|
| 1850 |
|
---|
[508] | 1851 | RegisterOption("Preprocessor.type",
|
---|
| 1852 | optString,
|
---|
| 1853 | "preprocessor=",
|
---|
| 1854 | "sampling");
|
---|
[408] | 1855 |
|
---|
[1771] | 1856 | RegisterOption("Preprocessor.stats",
|
---|
| 1857 | optString,
|
---|
| 1858 | "preprocessor_stats=",
|
---|
| 1859 | "stats.log");
|
---|
| 1860 |
|
---|
[508] | 1861 | RegisterOption("Preprocessor.samplesFilename",
|
---|
| 1862 | optString,
|
---|
[676] | 1863 | "preprocessor_samples_filename=",
|
---|
[508] | 1864 | "rays.out");
|
---|
[408] | 1865 |
|
---|
[1379] | 1866 | RegisterOption("Preprocessor.loadMeshes",
|
---|
[658] | 1867 | optBool,
|
---|
[1942] | 1868 | "preprocessor_load_meshes",
|
---|
[1379] | 1869 | "true");
|
---|
[658] | 1870 |
|
---|
[1785] | 1871 | RegisterOption("Preprocessor.evaluateFilter",
|
---|
| 1872 | optBool,
|
---|
[1942] | 1873 | "preprocessor_evaluate_filter",
|
---|
[1785] | 1874 | "false");
|
---|
| 1875 |
|
---|
[1613] | 1876 | RegisterOption("Preprocessor.delayVisibilityComputation",
|
---|
| 1877 | optBool,
|
---|
[1942] | 1878 | "preprocessor_delay_computation",
|
---|
[1613] | 1879 | "true");
|
---|
| 1880 |
|
---|
[563] | 1881 | RegisterOption("Preprocessor.pvsRenderErrorSamples",
|
---|
| 1882 | optInt,
|
---|
[1444] | 1883 | "preprocessor_pvs_rendererror_samples=",
|
---|
[563] | 1884 | "10000");
|
---|
[682] | 1885 |
|
---|
| 1886 | RegisterOption("Preprocessor.useGlRenderer",
|
---|
| 1887 | optBool,
|
---|
[1942] | 1888 | "preprocessor_use_gl_renderer",
|
---|
[682] | 1889 | "false");
|
---|
| 1890 |
|
---|
[538] | 1891 | RegisterOption("Preprocessor.useGlDebugger",
|
---|
| 1892 | optBool,
|
---|
[1942] | 1893 | "preprocessor_use_gl_debugger",
|
---|
[538] | 1894 | "false");
|
---|
| 1895 |
|
---|
[534] | 1896 | RegisterOption("Preprocessor.detectEmptyViewSpace",
|
---|
| 1897 | optBool,
|
---|
[1942] | 1898 | "preprocessor_detect_empty_viewspace",
|
---|
[534] | 1899 | "false");
|
---|
| 1900 |
|
---|
[599] | 1901 | RegisterOption("Preprocessor.quitOnFinish",
|
---|
| 1902 | optBool,
|
---|
[1942] | 1903 | "preprocessor_quit_on_finish",
|
---|
[599] | 1904 | "true");
|
---|
[534] | 1905 |
|
---|
[685] | 1906 | RegisterOption("Preprocessor.computeVisibility",
|
---|
| 1907 | optBool,
|
---|
[1942] | 1908 | "preprocessor_compute_visibility",
|
---|
[685] | 1909 | "true");
|
---|
[682] | 1910 |
|
---|
[871] | 1911 | RegisterOption("Preprocessor.exportVisibility",
|
---|
| 1912 | optBool,
|
---|
[1942] | 1913 | "preprocessor_export_visibility",
|
---|
[871] | 1914 | "true");
|
---|
[682] | 1915 |
|
---|
[871] | 1916 | RegisterOption("Preprocessor.visibilityFile",
|
---|
| 1917 | optString,
|
---|
| 1918 | "preprocessor_visibility_file=",
|
---|
| 1919 | "visibility.xml");
|
---|
| 1920 |
|
---|
| 1921 | RegisterOption("Preprocessor.applyVisibilityFilter",
|
---|
| 1922 | optBool,
|
---|
[1942] | 1923 | "preprocessor_apply_filter",
|
---|
[1756] | 1924 | "false");
|
---|
[904] | 1925 |
|
---|
[2048] | 1926 | RegisterOption("Preprocessor.evaluatePixelError",
|
---|
| 1927 | optBool,
|
---|
| 1928 | "preprocessor_evaluatePixelError",
|
---|
| 1929 | "false");
|
---|
| 1930 |
|
---|
[904] | 1931 | RegisterOption("Preprocessor.applyVisibilitySpatialFilter",
|
---|
| 1932 | optBool,
|
---|
[1942] | 1933 | "preprocessor_apply_spatial_filter",
|
---|
[1756] | 1934 | "false");
|
---|
[871] | 1935 |
|
---|
[878] | 1936 | RegisterOption("Preprocessor.visibilityFilterWidth",
|
---|
| 1937 | optFloat,
|
---|
| 1938 | "preprocessor_visibility_filter_width=",
|
---|
| 1939 | "0.02");
|
---|
[871] | 1940 |
|
---|
[991] | 1941 | RegisterOption("Preprocessor.histogram.maxValue",
|
---|
| 1942 | optInt,
|
---|
| 1943 | "preprocessor_histogram_max_value=",
|
---|
| 1944 | "1000");
|
---|
[871] | 1945 |
|
---|
[1221] | 1946 | RegisterOption("Preprocessor.rayCastMethod",
|
---|
| 1947 | optInt,
|
---|
| 1948 | "preprocessor_ray_cast_method=",
|
---|
| 1949 | "0");
|
---|
| 1950 |
|
---|
[991] | 1951 | RegisterOption("Preprocessor.histogram.intervals",
|
---|
| 1952 | optInt,
|
---|
| 1953 | "preprocessor_histogram_intervals=",
|
---|
| 1954 | "20");
|
---|
[878] | 1955 |
|
---|
[1771] | 1956 | RegisterOption("Preprocessor.histogram.file",
|
---|
| 1957 | optString,
|
---|
| 1958 | "preprocessor_histogram_file=",
|
---|
| 1959 | "histogram.log");
|
---|
| 1960 |
|
---|
[1414] | 1961 | RegisterOption("Preprocessor.exportKdTree",
|
---|
| 1962 | optBool,
|
---|
| 1963 | "preprocessor_export_kd_tree=",
|
---|
| 1964 | "false");
|
---|
[991] | 1965 |
|
---|
[1414] | 1966 | RegisterOption("Preprocessor.loadKdTree",
|
---|
| 1967 | optBool,
|
---|
| 1968 | "preprocessor_load_kd_tree=",
|
---|
| 1969 | "false");
|
---|
| 1970 |
|
---|
[1415] | 1971 | RegisterOption("Preprocessor.kdTreeFilename",
|
---|
| 1972 | optString,
|
---|
| 1973 | "preprocessor_kd_tree_filename=",
|
---|
| 1974 | "vienna_kdtree.bin.gz");
|
---|
[1414] | 1975 |
|
---|
[1695] | 1976 | RegisterOption("Preprocessor.exportObj",
|
---|
| 1977 | optBool,
|
---|
| 1978 | "preprocessor_export_obj=",
|
---|
| 1979 | "false");
|
---|
| 1980 |
|
---|
[1723] | 1981 | RegisterOption("Preprocessor.useViewSpaceBox",
|
---|
[1923] | 1982 | optBool,
|
---|
| 1983 | "preprocessor_use_viewspace_box=",
|
---|
| 1984 | "false");
|
---|
[1900] | 1985 |
|
---|
[2008] | 1986 | RegisterOption("Preprocessor.Export.rays", optBool, "export_rays", "false");
|
---|
| 1987 | RegisterOption("Preprocessor.Export.animation", optBool, "export_animation", "false");
|
---|
| 1988 | RegisterOption("Preprocessor.Export.numRays", optInt, "export_num_rays=", "5000");
|
---|
[1723] | 1989 |
|
---|
[1415] | 1990 | /*************************************************************************/
|
---|
| 1991 | /* VSS Preprocessor cells related options */
|
---|
| 1992 | /*************************************************************************/
|
---|
[1414] | 1993 |
|
---|
[469] | 1994 | RegisterOption("VssTree.maxDepth", optInt, "kd_depth=", "12");
|
---|
| 1995 | RegisterOption("VssTree.minPvs", optInt, "kd_minpvs=", "1");
|
---|
| 1996 | RegisterOption("VssTree.minRays", optInt, "kd_minrays=", "10");
|
---|
| 1997 | RegisterOption("VssTree.maxCostRatio", optFloat, "maxcost=", "0.95");
|
---|
| 1998 | RegisterOption("VssTree.maxRayContribution", optFloat, "maxraycontrib=", "0.5");
|
---|
[382] | 1999 |
|
---|
[469] | 2000 | RegisterOption("VssTree.epsilon", optFloat, "kd_eps=", "1e-6");
|
---|
| 2001 | RegisterOption("VssTree.ct_div_ci", optFloat, "kd_ctdivci=", "1.0");
|
---|
| 2002 | RegisterOption("VssTree.randomize", optBool, "randomize", "false");
|
---|
| 2003 | RegisterOption("VssTree.splitType", optString, "split=", "queries");
|
---|
| 2004 | RegisterOption("VssTree.splitUseOnlyDrivingAxis", optBool, "splitdriving=", "false");
|
---|
| 2005 | RegisterOption("VssTree.useRss", optBool, "rss=", "false");
|
---|
| 2006 | RegisterOption("VssTree.numberOfEndPointDomains", optInt, "endpoints=", "10000");
|
---|
[382] | 2007 |
|
---|
[469] | 2008 | RegisterOption("VssTree.minSize", optFloat, "minsize=", "0.001");
|
---|
[382] | 2009 |
|
---|
[469] | 2010 | RegisterOption("VssTree.maxTotalMemory", optFloat, "mem=", "60.0");
|
---|
| 2011 | RegisterOption("VssTree.maxStaticMemory", optFloat, "statmem=", "8.0");
|
---|
[438] | 2012 |
|
---|
[469] | 2013 | RegisterOption("VssTree.queryType", optString, "qtype=", "static");
|
---|
[438] | 2014 |
|
---|
[532] | 2015 |
|
---|
| 2016 |
|
---|
[469] | 2017 | RegisterOption("VssTree.queryPosWeight", optFloat, "qposweight=", "0.0");
|
---|
[997] | 2018 | RegisterOption("VssTree.useRefDirSplits", optBool, "refdir=", "false");
|
---|
[469] | 2019 | RegisterOption("VssTree.refDirAngle", optFloat, "refangle=", "10");
|
---|
| 2020 | RegisterOption("VssTree.refDirBoxMaxSize", optFloat, "refboxsize=", "0.1");
|
---|
| 2021 | RegisterOption("VssTree.accessTimeThreshold", optInt, "accesstime=", "1000");
|
---|
| 2022 | RegisterOption("VssTree.minCollapseDepth", optInt, "colldepth=", "4");
|
---|
[446] | 2023 |
|
---|
[469] | 2024 | RegisterOption("VssTree.interleaveDirSplits", optBool, "interleavedirsplits", "true");
|
---|
| 2025 | RegisterOption("VssTree.dirSplitDepth", optInt, "dirsplidepth=", "10");
|
---|
| 2026 |
|
---|
| 2027 |
|
---|
[1966] | 2028 | // RegisterOption("RssPreprocessor.initialSamples",
|
---|
| 2029 | // optInt,
|
---|
| 2030 | // "rss_initial_samples=",
|
---|
| 2031 | // "100000");
|
---|
[469] | 2032 |
|
---|
[1966] | 2033 | // RegisterOption("RssPreprocessor.vssSamples",
|
---|
| 2034 | // optInt,
|
---|
| 2035 | // "rss_vss_samples=",
|
---|
| 2036 | // "1000000");
|
---|
[508] | 2037 |
|
---|
[1966] | 2038 | // RegisterOption("RssPreprocessor.vssSamplesPerPass",
|
---|
| 2039 | // optInt,
|
---|
| 2040 | // "rss_vss_samples_per_pass=",
|
---|
| 2041 | // "1000");
|
---|
[508] | 2042 |
|
---|
[1966] | 2043 | // RegisterOption("RssPreprocessor.samplesPerPass",
|
---|
| 2044 | // optInt,
|
---|
| 2045 | // "rss_samples_per_pass=",
|
---|
| 2046 | // "100000");
|
---|
[508] | 2047 |
|
---|
[469] | 2048 | RegisterOption("RssPreprocessor.useImportanceSampling",
|
---|
[508] | 2049 | optBool,
|
---|
[1112] | 2050 | "rss_use_importance",
|
---|
[508] | 2051 | "true");
|
---|
| 2052 |
|
---|
[1785] | 2053 | RegisterOption("RssPreprocessor.useRssTree",
|
---|
| 2054 | optBool,
|
---|
| 2055 | "rss_use_rss_tree",
|
---|
| 2056 | "true");
|
---|
| 2057 |
|
---|
[492] | 2058 | RegisterOption("RssPreprocessor.objectBasedSampling",
|
---|
[508] | 2059 | optBool,
|
---|
[1112] | 2060 | "rss_object_based_sampling",
|
---|
[508] | 2061 | "true");
|
---|
| 2062 |
|
---|
[492] | 2063 | RegisterOption("RssPreprocessor.directionalSampling",
|
---|
[508] | 2064 | optBool,
|
---|
[1112] | 2065 | "rss_directional_sampling",
|
---|
[508] | 2066 | "false");
|
---|
| 2067 |
|
---|
[1877] | 2068 | RegisterOption("RssPreprocessor.distributions",
|
---|
| 2069 | optString,
|
---|
| 2070 | "rss_distributions=",
|
---|
| 2071 | "rss+spatial+object");
|
---|
| 2072 |
|
---|
[1199] | 2073 | RegisterOption("RssTree.hybridDepth", optInt, "hybrid_depth=", "10");
|
---|
[469] | 2074 | RegisterOption("RssTree.maxDepth", optInt, "kd_depth=", "12");
|
---|
| 2075 | RegisterOption("RssTree.minPvs", optInt, "kd_minpvs=", "1");
|
---|
| 2076 | RegisterOption("RssTree.minRays", optInt, "kd_minrays=", "10");
|
---|
| 2077 | RegisterOption("RssTree.maxCostRatio", optFloat, "maxcost=", "0.95");
|
---|
| 2078 | RegisterOption("RssTree.maxRayContribution", optFloat, "maxraycontrib=", "0.5");
|
---|
[508] | 2079 |
|
---|
[469] | 2080 | RegisterOption("RssTree.epsilon", optFloat, "kd_eps=", "1e-6");
|
---|
| 2081 | RegisterOption("RssTree.ct_div_ci", optFloat, "kd_ctdivci=", "1.0");
|
---|
[997] | 2082 | RegisterOption("RssTree.randomize", optBool, "randomize=", "false");
|
---|
[1199] | 2083 | RegisterOption("RssTree.splitType", optString, "rss_split=", "queries");
|
---|
[469] | 2084 | RegisterOption("RssTree.splitUseOnlyDrivingAxis", optBool, "splitdriving=", "false");
|
---|
[508] | 2085 |
|
---|
[469] | 2086 | RegisterOption("RssTree.numberOfEndPointDomains", optInt, "endpoints=", "10000");
|
---|
[508] | 2087 |
|
---|
[469] | 2088 | RegisterOption("RssTree.minSize", optFloat, "minsize=", "0.001");
|
---|
[508] | 2089 |
|
---|
[469] | 2090 | RegisterOption("RssTree.maxTotalMemory", optFloat, "mem=", "60.0");
|
---|
| 2091 | RegisterOption("RssTree.maxStaticMemory", optFloat, "statmem=", "8.0");
|
---|
[508] | 2092 |
|
---|
[469] | 2093 | RegisterOption("RssTree.queryType", optString, "qtype=", "static");
|
---|
[508] | 2094 |
|
---|
[469] | 2095 | RegisterOption("RssTree.queryPosWeight", optFloat, "qposweight=", "0.0");
|
---|
| 2096 | RegisterOption("RssTree.useRefDirSplits", optBool, "refdir", "false");
|
---|
| 2097 | RegisterOption("RssTree.refDirAngle", optFloat, "refangle=", "10");
|
---|
| 2098 | RegisterOption("RssTree.refDirBoxMaxSize", optFloat, "refboxsize=", "0.1");
|
---|
| 2099 | RegisterOption("RssTree.accessTimeThreshold", optInt, "accesstime=", "1000");
|
---|
| 2100 | RegisterOption("RssTree.minCollapseDepth", optInt, "colldepth=", "4");
|
---|
[508] | 2101 |
|
---|
[997] | 2102 | RegisterOption("RssTree.interleaveDirSplits", optBool, "interleavedirsplits=", "true");
|
---|
[469] | 2103 | RegisterOption("RssTree.dirSplitDepth", optInt, "dirsplidepth=", "10");
|
---|
[997] | 2104 | RegisterOption("RssTree.importanceBasedCost", optBool, "importance_based_cost=", "true");
|
---|
[492] | 2105 | RegisterOption("RssTree.maxRays", optInt, "rss_max_rays=", "2000000");
|
---|
[508] | 2106 |
|
---|
[516] | 2107 | RegisterOption("RssTree.perObjectTree", optBool, "rss_per_object_tree", "false");
|
---|
| 2108 |
|
---|
[997] | 2109 | RegisterOption("RssPreprocessor.Export.pvs", optBool, "rss_export_pvs=", "false");
|
---|
| 2110 | RegisterOption("RssPreprocessor.Export.rssTree", optBool, "rss_export_rss_tree=", "false");
|
---|
[1900] | 2111 |
|
---|
[997] | 2112 | RegisterOption("RssPreprocessor.useViewcells", optBool, "rss_use_viewcells=", "false");
|
---|
[563] | 2113 | RegisterOption("RssPreprocessor.updateSubdivision",
|
---|
| 2114 | optBool,
|
---|
[997] | 2115 | "rss_update_subdivision=",
|
---|
[563] | 2116 | "false");
|
---|
[463] | 2117 |
|
---|
[492] | 2118 |
|
---|
[508] | 2119 | /************************************************************************************/
|
---|
[1023] | 2120 | /* Rss preprocessor related options */
|
---|
[508] | 2121 | /************************************************************************************/
|
---|
| 2122 |
|
---|
| 2123 |
|
---|
[490] | 2124 | RegisterOption("RssPreprocessor.loadInitialSamples",
|
---|
[508] | 2125 | optBool,
|
---|
| 2126 | "vss_load_loadInitialSamples=",
|
---|
| 2127 | "false");
|
---|
[445] | 2128 |
|
---|
[490] | 2129 | RegisterOption("RssPreprocessor.storeInitialSamples",
|
---|
[508] | 2130 | optBool,
|
---|
| 2131 | "vss_store_storeInitialSamples=",
|
---|
| 2132 | "false");
|
---|
[490] | 2133 |
|
---|
[508] | 2134 |
|
---|
| 2135 | /************************************************************************************/
|
---|
[1023] | 2136 | /* View space partition BSP tree related options */
|
---|
[508] | 2137 | /************************************************************************************/
|
---|
| 2138 |
|
---|
[654] | 2139 | RegisterOption("VspBspTree.Termination.minGlobalCostRatio",
|
---|
| 2140 | optFloat,
|
---|
[997] | 2141 | "vsp_bsp_term_min_global_cost_ratio=",
|
---|
[654] | 2142 | "0.0001");
|
---|
[508] | 2143 |
|
---|
[655] | 2144 | RegisterOption("VspBspTree.useSplitCostQueue",
|
---|
[1902] | 2145 | optBool,
|
---|
| 2146 | "vsp_bsp_use_split_cost_queue=",
|
---|
| 2147 | "true");
|
---|
[655] | 2148 |
|
---|
[654] | 2149 | RegisterOption("VspBspTree.Termination.globalCostMissTolerance",
|
---|
| 2150 | optInt,
|
---|
[997] | 2151 | "vsp_bsp_term_global_cost_miss_tolerance=",
|
---|
[654] | 2152 | "4");
|
---|
| 2153 |
|
---|
[469] | 2154 | RegisterOption("VspBspTree.Termination.minPolygons",
|
---|
[508] | 2155 | optInt,
|
---|
| 2156 | "vsp_bsp_term_min_polygons=",
|
---|
[1134] | 2157 | "-1");
|
---|
[445] | 2158 |
|
---|
[469] | 2159 | RegisterOption("VspBspTree.Termination.minPvs",
|
---|
[508] | 2160 | optInt,
|
---|
| 2161 | "vsp_bsp_term_min_pvs=",
|
---|
| 2162 | "20");
|
---|
[660] | 2163 |
|
---|
[547] | 2164 | RegisterOption("VspBspTree.Termination.minProbability",
|
---|
[508] | 2165 | optFloat,
|
---|
[547] | 2166 | "vsp_bsp_term_min_probability=",
|
---|
[508] | 2167 | "0.001");
|
---|
[445] | 2168 |
|
---|
[660] | 2169 | RegisterOption("VspBspTree.subdivisionStats",
|
---|
| 2170 | optString,
|
---|
| 2171 | "vsp_bsp_subdivision_stats=",
|
---|
| 2172 | "vspBspSubdivisionStats.log");
|
---|
| 2173 |
|
---|
[469] | 2174 | RegisterOption("VspBspTree.Termination.maxRayContribution",
|
---|
[508] | 2175 | optFloat,
|
---|
| 2176 | "vsp_bsp_term_ray_contribution=",
|
---|
[1134] | 2177 | "2");
|
---|
[463] | 2178 |
|
---|
[469] | 2179 | RegisterOption("VspBspTree.Termination.minAccRayLenght",
|
---|
[508] | 2180 | optFloat,
|
---|
| 2181 | "vsp_bsp_term_min_acc_ray_length=",
|
---|
| 2182 | "50");
|
---|
[445] | 2183 |
|
---|
[469] | 2184 | RegisterOption("VspBspTree.Termination.minRays",
|
---|
[508] | 2185 | optInt,
|
---|
| 2186 | "vsp_bsp_term_min_rays=",
|
---|
| 2187 | "-1");
|
---|
[445] | 2188 |
|
---|
[469] | 2189 | RegisterOption("VspBspTree.Termination.ct_div_ci",
|
---|
[508] | 2190 | optFloat,
|
---|
| 2191 | "vsp_bsp_term_ct_div_ci=",
|
---|
| 2192 | "0.0");
|
---|
[445] | 2193 |
|
---|
[469] | 2194 | RegisterOption("VspBspTree.Termination.maxDepth",
|
---|
[508] | 2195 | optInt,
|
---|
| 2196 | "vsp_bsp_term_max_depth=",
|
---|
[1134] | 2197 | "50");
|
---|
[445] | 2198 |
|
---|
[469] | 2199 | RegisterOption("VspBspTree.Termination.AxisAligned.maxCostRatio",
|
---|
[2124] | 2200 | optFloat,
|
---|
| 2201 | "vsp_bsp_term_axis_aligned_max_cost_ratio=",
|
---|
| 2202 | "1.5");
|
---|
[445] | 2203 |
|
---|
[612] | 2204 | RegisterOption("VspBspTree.useCostHeuristics",
|
---|
[2124] | 2205 | optBool,
|
---|
| 2206 | "vsp_bsp_use_cost_heuristics=",
|
---|
| 2207 | "false");
|
---|
[612] | 2208 |
|
---|
[478] | 2209 | RegisterOption("VspBspTree.Termination.maxViewCells",
|
---|
[2124] | 2210 | optInt,
|
---|
| 2211 | "vsp_bsp_term_max_view_cells=",
|
---|
| 2212 | "10000");
|
---|
[478] | 2213 |
|
---|
[472] | 2214 | RegisterOption("VspBspTree.Termination.maxCostRatio",
|
---|
[2124] | 2215 | optFloat,
|
---|
| 2216 | "vsp_bsp_term_max_cost_ratio=",
|
---|
| 2217 | "1.5");
|
---|
[445] | 2218 |
|
---|
[472] | 2219 | RegisterOption("VspBspTree.Termination.missTolerance",
|
---|
[2124] | 2220 | optInt,
|
---|
| 2221 | "vsp_bsp_term_miss_tolerance=",
|
---|
| 2222 | "4");
|
---|
[997] | 2223 |
|
---|
[469] | 2224 | RegisterOption("VspBspTree.splitPlaneStrategy",
|
---|
[1134] | 2225 | optInt,
|
---|
[508] | 2226 | "vsp_bsp_split_method=",
|
---|
[1134] | 2227 | "1026");
|
---|
[448] | 2228 |
|
---|
[469] | 2229 | RegisterOption("VspBspTree.maxPolyCandidates",
|
---|
[508] | 2230 | optInt,
|
---|
| 2231 | "vsp_bsp_max_poly_candidates=",
|
---|
| 2232 | "20");
|
---|
[1134] | 2233 |
|
---|
[469] | 2234 | RegisterOption("VspBspTree.maxRayCandidates",
|
---|
[508] | 2235 | optInt,
|
---|
| 2236 | "vsp_bsp_max_plane_candidates=",
|
---|
| 2237 | "20");
|
---|
[469] | 2238 |
|
---|
| 2239 | RegisterOption("VspBspTree.maxTests",
|
---|
[508] | 2240 | optInt,
|
---|
| 2241 | "vsp_bsp_max_tests=",
|
---|
| 2242 | "5000");
|
---|
[469] | 2243 |
|
---|
| 2244 | RegisterOption("VspBspTree.Construction.samples",
|
---|
[508] | 2245 | optInt,
|
---|
[673] | 2246 | "vsp_bsp_construction_samples=",
|
---|
[508] | 2247 | "100000");
|
---|
[469] | 2248 |
|
---|
[801] | 2249 | RegisterOption("VspBspTree.Construction.minBand",
|
---|
| 2250 | optFloat,
|
---|
| 2251 | "vsp_bsp_construction_min_band=",
|
---|
[1074] | 2252 | "0.01");
|
---|
[801] | 2253 |
|
---|
| 2254 | RegisterOption("VspBspTree.Construction.maxBand",
|
---|
| 2255 | optFloat,
|
---|
[1147] | 2256 | "vsp_bsp_construction_max_band=",
|
---|
[1074] | 2257 | "0.99");
|
---|
[801] | 2258 |
|
---|
[822] | 2259 | RegisterOption("VspBspTree.Construction.useDrivingAxisForMaxCost",
|
---|
| 2260 | optBool,
|
---|
| 2261 | "vsp_bsp_construction_use_drivingaxis_for_maxcost=",
|
---|
| 2262 | "false");
|
---|
| 2263 |
|
---|
[469] | 2264 | RegisterOption("VspBspTree.Construction.epsilon",
|
---|
[508] | 2265 | optFloat,
|
---|
[1023] | 2266 | "vsp_bsp_construction_epsilon=",
|
---|
[508] | 2267 | "0.002");
|
---|
[469] | 2268 |
|
---|
| 2269 | RegisterOption("VspBspTree.Visualization.exportSplits",
|
---|
[508] | 2270 | optBool,
|
---|
| 2271 | "vsp_bsp_visualization.export_splits",
|
---|
| 2272 | "false");
|
---|
| 2273 |
|
---|
[485] | 2274 | RegisterOption("VspBspTree.splitUseOnlyDrivingAxis",
|
---|
[508] | 2275 | optBool,
|
---|
[667] | 2276 | "vsp_bsp_split_only_driving_axis=",
|
---|
[508] | 2277 | "false");
|
---|
| 2278 |
|
---|
[607] | 2279 | RegisterOption("VspBspTree.usePolygonSplitIfAvailable",
|
---|
| 2280 | optBool,
|
---|
| 2281 | "vsp_bsp_usePolygonSplitIfAvailable=",
|
---|
[611] | 2282 | "false");
|
---|
[607] | 2283 |
|
---|
[508] | 2284 | RegisterOption("VspBspTree.Termination.AxisAligned.minRays",
|
---|
| 2285 | optInt,
|
---|
| 2286 | "bsp_term_axis_aligned_min_rays=",
|
---|
[1134] | 2287 | "0");
|
---|
[492] | 2288 |
|
---|
[508] | 2289 | RegisterOption("VspBspTree.Termination.AxisAligned.maxRayContribution",
|
---|
| 2290 | optFloat,
|
---|
| 2291 | "bsp_term_axis_aligned_min_rays=",
|
---|
[1134] | 2292 | "2");
|
---|
[508] | 2293 |
|
---|
[676] | 2294 | RegisterOption("VspBspTree.Factor.leastRaySplits",
|
---|
| 2295 | optFloat,
|
---|
| 2296 | "vsp_bsp_factor_least_ray_splits=",
|
---|
| 2297 | "1.0");
|
---|
| 2298 |
|
---|
| 2299 | RegisterOption("VspBspTree.Factor.balancedRays",
|
---|
| 2300 | optFloat,
|
---|
| 2301 | "vsp_bsp_factor_balanced_rays=",
|
---|
| 2302 | "1.0");
|
---|
| 2303 |
|
---|
| 2304 | RegisterOption("VspBspTree.Factor.pvs",
|
---|
| 2305 | optFloat,
|
---|
| 2306 | "vsp_bsp_factor_pvs=",
|
---|
| 2307 | "1.0");
|
---|
[664] | 2308 |
|
---|
[580] | 2309 | RegisterOption("VspBspTree.Construction.renderCostWeight",
|
---|
[478] | 2310 | optFloat,
|
---|
[1002] | 2311 | "vsp_bsp_post_process_render_cost_weight=",
|
---|
[1134] | 2312 | "1.0");
|
---|
[478] | 2313 |
|
---|
[1020] | 2314 | RegisterOption("VspBspTree.Construction.renderCostDecreaseWeight",
|
---|
| 2315 | optFloat,
|
---|
[1121] | 2316 | "vsp_bsp_construction_render_cost_decrease_weight=",
|
---|
[1020] | 2317 | "0.99");
|
---|
| 2318 |
|
---|
[486] | 2319 | RegisterOption("VspBspTree.Construction.randomize",
|
---|
| 2320 | optBool,
|
---|
| 2321 | "vsp_bsp_construction_randomize=",
|
---|
| 2322 | "false");
|
---|
[508] | 2323 |
|
---|
[663] | 2324 | RegisterOption("VspBspTree.simulateOctree",
|
---|
| 2325 | optBool,
|
---|
| 2326 | "vsp_bsp_simulate_octree=",
|
---|
| 2327 | "false");
|
---|
| 2328 |
|
---|
[735] | 2329 | RegisterOption("VspBspTree.nodePriorityQueueType",
|
---|
| 2330 | optInt,
|
---|
| 2331 | "vsp_bsp_node_queue_type=",
|
---|
| 2332 | "0");
|
---|
[664] | 2333 |
|
---|
| 2334 | RegisterOption("VspBspTree.useRandomAxis",
|
---|
| 2335 | optBool,
|
---|
| 2336 | "-vsp_bsp_use_random_axis=",
|
---|
| 2337 | "false");
|
---|
| 2338 |
|
---|
[508] | 2339 | RegisterOption("VspBspTree.maxTotalMemory",
|
---|
| 2340 | optFloat,
|
---|
| 2341 | "vsp_bsp_max_total_mem=",
|
---|
| 2342 | "60.0");
|
---|
| 2343 |
|
---|
| 2344 | RegisterOption("VspBspTree.maxStaticMemory",
|
---|
| 2345 | optFloat,
|
---|
| 2346 | "vsp_bsp_max_static_mem=",
|
---|
| 2347 | "8.0");
|
---|
[564] | 2348 |
|
---|
[1023] | 2349 |
|
---|
| 2350 |
|
---|
[1027] | 2351 | /***************************************************************************/
|
---|
| 2352 | /* View space partition tree related options */
|
---|
| 2353 | /***************************************************************************/
|
---|
[1023] | 2354 |
|
---|
[580] | 2355 |
|
---|
[1027] | 2356 | RegisterOption("VspTree.Construction.samples",
|
---|
| 2357 | optInt,
|
---|
| 2358 | "vsp_construction_samples=",
|
---|
| 2359 | "10000");
|
---|
| 2360 |
|
---|
[1121] | 2361 | RegisterOption("VspTree.Construction.renderCostDecreaseWeight",
|
---|
[1576] | 2362 | optFloat,
|
---|
| 2363 | "vsp_construction_render_cost_decrease_weight=",
|
---|
[1665] | 2364 | "0.99");
|
---|
[1121] | 2365 |
|
---|
[1023] | 2366 | RegisterOption("VspTree.Termination.maxDepth",
|
---|
| 2367 | optInt,
|
---|
| 2368 | "vsp_term_max_depth=",
|
---|
| 2369 | "100");
|
---|
| 2370 |
|
---|
| 2371 | RegisterOption("VspTree.Termination.minRays",
|
---|
| 2372 | optInt,
|
---|
| 2373 | "vsp_term_min_rays=",
|
---|
| 2374 | "-1");
|
---|
| 2375 |
|
---|
| 2376 |
|
---|
| 2377 | RegisterOption("VspTree.Termination.minPvs",
|
---|
| 2378 | optInt,
|
---|
| 2379 | "vsp_term_min_pvs=",
|
---|
| 2380 | "20");
|
---|
| 2381 |
|
---|
| 2382 | RegisterOption("VspTree.Termination.minProbability",
|
---|
| 2383 | optFloat,
|
---|
| 2384 | "vsp_term_min_probability=",
|
---|
[1576] | 2385 | "0.0000001");
|
---|
[1023] | 2386 |
|
---|
| 2387 | RegisterOption("VspTree.Termination.maxRayContribution",
|
---|
[1576] | 2388 | optFloat,
|
---|
| 2389 | "vsp_term_ray_contribution=",
|
---|
| 2390 | "0.9");
|
---|
[1023] | 2391 |
|
---|
| 2392 | RegisterOption("VspTree.Termination.maxCostRatio",
|
---|
[1576] | 2393 | optFloat,
|
---|
| 2394 | "vsp_term_max_cost_ratio=",
|
---|
| 2395 | "1.5");
|
---|
[1023] | 2396 |
|
---|
| 2397 | RegisterOption("VspTree.Termination.maxViewCells",
|
---|
[1576] | 2398 | optInt,
|
---|
| 2399 | "vsp_term_max_view_cells=",
|
---|
| 2400 | "10000");
|
---|
[564] | 2401 |
|
---|
[1023] | 2402 |
|
---|
| 2403 | RegisterOption("VspTree.Termination.missTolerance",
|
---|
[1576] | 2404 | optInt,
|
---|
| 2405 | "vsp_term_miss_tolerance=",
|
---|
| 2406 | "4");
|
---|
[1023] | 2407 |
|
---|
| 2408 | RegisterOption("VspTree.Termination.minGlobalCostRatio",
|
---|
| 2409 | optFloat,
|
---|
| 2410 | "vsp_term_min_global_cost_ratio=",
|
---|
| 2411 | "0.0001");
|
---|
| 2412 |
|
---|
| 2413 | RegisterOption("VspTree.Termination.globalCostMissTolerance",
|
---|
| 2414 | optInt,
|
---|
| 2415 | "vsp_term_global_cost_miss_tolerance=",
|
---|
| 2416 | "4");
|
---|
| 2417 |
|
---|
| 2418 | RegisterOption("VspTree.Termination.ct_div_ci",
|
---|
| 2419 | optFloat,
|
---|
| 2420 | "vsp_term_ct_div_ci=",
|
---|
| 2421 | "0.0");
|
---|
| 2422 |
|
---|
| 2423 | RegisterOption("VspTree.Construction.epsilon",
|
---|
| 2424 | optFloat,
|
---|
| 2425 | "vsp_construction_epsilon=",
|
---|
| 2426 | "0.002");
|
---|
| 2427 |
|
---|
| 2428 | RegisterOption("VspTree.splitUseOnlyDrivingAxis",
|
---|
| 2429 | optBool,
|
---|
| 2430 | "vsp_split_only_driving_axis=",
|
---|
| 2431 | "false");
|
---|
| 2432 |
|
---|
| 2433 | RegisterOption("VspTree.maxStaticMemory",
|
---|
[1576] | 2434 | optFloat,
|
---|
| 2435 | "vsp_max_static_mem=",
|
---|
| 2436 | "8.0");
|
---|
[1023] | 2437 |
|
---|
| 2438 | RegisterOption("VspTree.useCostHeuristics",
|
---|
[1576] | 2439 | optBool,
|
---|
| 2440 | "vsp_use_cost_heuristics=",
|
---|
| 2441 | "false");
|
---|
[1023] | 2442 |
|
---|
| 2443 | RegisterOption("VspTree.simulateOctree",
|
---|
[1576] | 2444 | optBool,
|
---|
| 2445 | "vsp_simulate_octree=",
|
---|
| 2446 | "false");
|
---|
[1023] | 2447 |
|
---|
| 2448 | RegisterOption("VspTree.Construction.randomize",
|
---|
[1576] | 2449 | optBool,
|
---|
| 2450 | "vsp_construction_randomize=",
|
---|
| 2451 | "false");
|
---|
[1023] | 2452 |
|
---|
| 2453 | RegisterOption("VspTree.subdivisionStats",
|
---|
| 2454 | optString,
|
---|
| 2455 | "vsp_subdivision_stats=",
|
---|
| 2456 | "vspSubdivisionStats.log");
|
---|
| 2457 |
|
---|
| 2458 | RegisterOption("VspTree.Construction.minBand",
|
---|
| 2459 | optFloat,
|
---|
| 2460 | "vsp_construction_min_band=",
|
---|
[1074] | 2461 | "0.01");
|
---|
[1023] | 2462 |
|
---|
| 2463 | RegisterOption("VspTree.Construction.maxBand",
|
---|
| 2464 | optFloat,
|
---|
[1074] | 2465 | "vsp_construction_max_band=",
|
---|
| 2466 | "0.99");
|
---|
[1106] | 2467 |
|
---|
[1149] | 2468 | RegisterOption("VspTree.maxTests",
|
---|
| 2469 | optInt,
|
---|
| 2470 | "vsp_max_tests=",
|
---|
[1161] | 2471 | "5000");
|
---|
[1143] | 2472 |
|
---|
| 2473 |
|
---|
[1074] | 2474 |
|
---|
[1288] | 2475 | /***********************************************************************/
|
---|
| 2476 | /* Object space partition tree related options */
|
---|
| 2477 | /***********************************************************************/
|
---|
[1143] | 2478 |
|
---|
[1294] | 2479 |
|
---|
[1106] | 2480 | RegisterOption("OspTree.Construction.randomize",
|
---|
[1288] | 2481 | optBool,
|
---|
| 2482 | "osp_construction_randomize=",
|
---|
| 2483 | "false");
|
---|
[1106] | 2484 |
|
---|
| 2485 | RegisterOption("OspTree.Termination.maxDepth",
|
---|
| 2486 | optInt,
|
---|
| 2487 | "osp_term_max_depth=",
|
---|
| 2488 | "30");
|
---|
| 2489 |
|
---|
| 2490 | RegisterOption("OspTree.Termination.maxLeaves",
|
---|
| 2491 | optInt,
|
---|
| 2492 | "osp_term_max_leaves=",
|
---|
| 2493 | "1000");
|
---|
| 2494 |
|
---|
| 2495 | RegisterOption("OspTree.Termination.minObjects",
|
---|
| 2496 | optInt,
|
---|
| 2497 | "osp_term_min_objects=",
|
---|
| 2498 | "1");
|
---|
| 2499 |
|
---|
| 2500 | RegisterOption("OspTree.Termination.minProbability",
|
---|
| 2501 | optFloat,
|
---|
| 2502 | "osp_term_min_objects=",
|
---|
[1288] | 2503 | "0.00001");
|
---|
[1106] | 2504 |
|
---|
| 2505 | RegisterOption("OspTree.Termination.missTolerance",
|
---|
| 2506 | optInt,
|
---|
| 2507 | "osp_term_miss_tolerance=",
|
---|
[1288] | 2508 | "8");
|
---|
[1106] | 2509 |
|
---|
| 2510 | RegisterOption("OspTree.Termination.maxCostRatio",
|
---|
| 2511 | optFloat,
|
---|
| 2512 | "osp_term_max_cost_ratio=",
|
---|
| 2513 | "0.99");
|
---|
| 2514 |
|
---|
| 2515 | RegisterOption("OspTree.Termination.minGlobalCostRatio",
|
---|
| 2516 | optFloat,
|
---|
| 2517 | "osp_term_min_global_cost_ratio=",
|
---|
| 2518 | "0.00001");
|
---|
| 2519 |
|
---|
| 2520 | RegisterOption("OspTree.Termination.globalCostMissTolerance",
|
---|
| 2521 | optInt,
|
---|
| 2522 | "osp_term_global_cost_miss_tolerance=",
|
---|
| 2523 | "4");
|
---|
| 2524 |
|
---|
| 2525 | RegisterOption("OspTree.Termination.ct_div_ci",
|
---|
| 2526 | optFloat,
|
---|
| 2527 | "osp_term_ct_div_ci=",
|
---|
| 2528 | "0");
|
---|
| 2529 |
|
---|
| 2530 | RegisterOption("OspTree.Construction.epsilon",
|
---|
[1288] | 2531 | optFloat,
|
---|
| 2532 | "osp_construction_epsilon=",
|
---|
| 2533 | "0.00001");
|
---|
[1106] | 2534 |
|
---|
| 2535 | // if only the driving axis is used for axis aligned split
|
---|
| 2536 | RegisterOption("OspTree.splitUseOnlyDrivingAxis",
|
---|
[1288] | 2537 | optBool,
|
---|
| 2538 | "osp_split_only_driving_axis=",
|
---|
| 2539 | "false");
|
---|
[1106] | 2540 |
|
---|
| 2541 | RegisterOption("OspTree.maxStaticMemory",
|
---|
[1288] | 2542 | optFloat,
|
---|
| 2543 | "osp_max_static_mem=",
|
---|
| 2544 | "8.0");
|
---|
[1106] | 2545 |
|
---|
| 2546 | RegisterOption("OspTree.useCostHeuristics",
|
---|
[1288] | 2547 | optBool,
|
---|
| 2548 | "osp_use_cost_heuristics=",
|
---|
| 2549 | "true");
|
---|
[1106] | 2550 |
|
---|
| 2551 | RegisterOption("OspTree.subdivisionStats",
|
---|
| 2552 | optString,
|
---|
| 2553 | "osp_subdivision_stats=",
|
---|
| 2554 | "ospSubdivisionStats.log");
|
---|
| 2555 |
|
---|
| 2556 | RegisterOption("OspTree.Construction.splitBorder",
|
---|
| 2557 | optFloat,
|
---|
| 2558 | "osp_construction_split_border=",
|
---|
| 2559 | "0.01");
|
---|
| 2560 |
|
---|
[1121] | 2561 | RegisterOption("OspTree.Construction.renderCostDecreaseWeight",
|
---|
[1288] | 2562 | optFloat,
|
---|
| 2563 | "osp_construction_render_cost_decrease_weight=",
|
---|
| 2564 | "0.99");
|
---|
[1106] | 2565 |
|
---|
| 2566 |
|
---|
[1288] | 2567 |
|
---|
[1297] | 2568 | /**********************************************************************/
|
---|
| 2569 | /* Bounding Volume Hierarchy related options */
|
---|
| 2570 | /**********************************************************************/
|
---|
[1288] | 2571 |
|
---|
| 2572 | RegisterOption("BvHierarchy.Construction.randomize",
|
---|
| 2573 | optBool,
|
---|
| 2574 | "bvh_construction_randomize=",
|
---|
| 2575 | "false");
|
---|
| 2576 |
|
---|
| 2577 | RegisterOption("BvHierarchy.Termination.maxDepth",
|
---|
| 2578 | optInt,
|
---|
| 2579 | "bvh_term_max_depth=",
|
---|
| 2580 | "30");
|
---|
| 2581 |
|
---|
| 2582 | RegisterOption("BvHierarchy.Termination.maxLeaves",
|
---|
| 2583 | optInt,
|
---|
| 2584 | "bvh_term_max_leaves=",
|
---|
| 2585 | "1000");
|
---|
| 2586 |
|
---|
| 2587 | RegisterOption("BvHierarchy.Termination.minObjects",
|
---|
| 2588 | optInt,
|
---|
| 2589 | "bvh_term_min_objects=",
|
---|
| 2590 | "1");
|
---|
| 2591 |
|
---|
| 2592 | RegisterOption("BvHierarchy.Termination.minProbability",
|
---|
| 2593 | optFloat,
|
---|
| 2594 | "bvh_term_min_objects=",
|
---|
[1576] | 2595 | "0.0000001");
|
---|
[1288] | 2596 |
|
---|
[1370] | 2597 | RegisterOption("BvHierarchy.Termination.minRays",
|
---|
| 2598 | optInt,
|
---|
| 2599 | "bvh_term_min_rays=",
|
---|
| 2600 | "0");
|
---|
| 2601 |
|
---|
[1288] | 2602 | RegisterOption("BvHierarchy.Termination.missTolerance",
|
---|
| 2603 | optInt,
|
---|
| 2604 | "osp_term_miss_tolerance=",
|
---|
| 2605 | "8");
|
---|
| 2606 |
|
---|
| 2607 | RegisterOption("BvHierarchy.Termination.maxCostRatio",
|
---|
| 2608 | optFloat,
|
---|
| 2609 | "bvh_term_max_cost_ratio=",
|
---|
| 2610 | "0.99");
|
---|
| 2611 |
|
---|
| 2612 | RegisterOption("BvHierarchy.Termination.minGlobalCostRatio",
|
---|
| 2613 | optFloat,
|
---|
| 2614 | "bvh_term_min_global_cost_ratio=",
|
---|
| 2615 | "0.00001");
|
---|
| 2616 |
|
---|
| 2617 | RegisterOption("BvHierarchy.Termination.globalCostMissTolerance",
|
---|
| 2618 | optInt,
|
---|
| 2619 | "bvh_term_global_cost_miss_tolerance=",
|
---|
| 2620 | "4");
|
---|
| 2621 |
|
---|
| 2622 | // if only the driving axis is used for axis aligned split
|
---|
| 2623 | RegisterOption("BvHierarchy.splitUseOnlyDrivingAxis",
|
---|
| 2624 | optBool,
|
---|
| 2625 | "bvh_split_only_driving_axis=",
|
---|
| 2626 | "false");
|
---|
| 2627 |
|
---|
| 2628 | RegisterOption("BvHierarchy.maxStaticMemory",
|
---|
| 2629 | optFloat,
|
---|
| 2630 | "bvh_max_static_mem=",
|
---|
| 2631 | "8.0");
|
---|
| 2632 |
|
---|
| 2633 | RegisterOption("BvHierarchy.useCostHeuristics",
|
---|
| 2634 | optBool,
|
---|
| 2635 | "bvh_use_cost_heuristics=",
|
---|
| 2636 | "true");
|
---|
[1643] | 2637 |
|
---|
| 2638 | RegisterOption("BvHierarchy.useSah",
|
---|
| 2639 | optBool,
|
---|
| 2640 | "bvh_use_sah=",
|
---|
| 2641 | "false");
|
---|
| 2642 |
|
---|
[1288] | 2643 | RegisterOption("BvHierarchy.subdivisionStats",
|
---|
[1174] | 2644 | optString,
|
---|
[1288] | 2645 | "bvh_subdivision_stats=",
|
---|
| 2646 | "bvhSubdivisionStats.log");
|
---|
[1174] | 2647 |
|
---|
[1288] | 2648 | RegisterOption("BvHierarchy.Construction.renderCostDecreaseWeight",
|
---|
| 2649 | optFloat,
|
---|
| 2650 | "bvh_construction_render_cost_decrease_weight=",
|
---|
[1665] | 2651 | "0.99");
|
---|
[1359] | 2652 |
|
---|
| 2653 | RegisterOption("BvHierarchy.Construction.useGlobalSorting",
|
---|
| 2654 | optBool,
|
---|
| 2655 | "bvh_construction_use_global_sorting=",
|
---|
[1489] | 2656 | "true");
|
---|
[1779] | 2657 |
|
---|
[1784] | 2658 | RegisterOption("BvHierarchy.Construction.useInitialSubdivision",
|
---|
[1779] | 2659 | optBool,
|
---|
| 2660 | "bvh_construction_use_initial_subdivision=",
|
---|
| 2661 | "false");
|
---|
[1288] | 2662 |
|
---|
[1786] | 2663 | RegisterOption("BvHierarchy.Construction.Initial.minObjects",
|
---|
| 2664 | optInt,
|
---|
| 2665 | "bvh_construction_use_initial_min_objects=",
|
---|
| 2666 | "100000");
|
---|
| 2667 |
|
---|
| 2668 | RegisterOption("BvHierarchy.Construction.Initial.minArea",
|
---|
| 2669 | optFloat,
|
---|
| 2670 | "bvh_construction_use_initial_min_area=",
|
---|
| 2671 | "0.0001");
|
---|
| 2672 |
|
---|
| 2673 | RegisterOption("BvHierarchy.Construction.Initial.maxAreaRatio",
|
---|
| 2674 | optFloat,
|
---|
| 2675 | "bvh_construction_use_initial_max_area_ratio=",
|
---|
[1825] | 2676 | "0.9");
|
---|
[1786] | 2677 |
|
---|
[1676] | 2678 | RegisterOption("BvHierarchy.minRaysForVisibility",
|
---|
| 2679 | optInt,
|
---|
| 2680 | "bvh_min_rays_for_vis=",
|
---|
| 2681 | "0");
|
---|
[1640] | 2682 |
|
---|
[1727] | 2683 | RegisterOption("BvHierarchy.maxTests",
|
---|
| 2684 | optInt,
|
---|
| 2685 | "bvh_max_tests=",
|
---|
| 2686 | "50000");
|
---|
[1676] | 2687 |
|
---|
[1727] | 2688 |
|
---|
[1359] | 2689 | /*******************************************************************/
|
---|
| 2690 | /* Hierarchy Manager related options */
|
---|
| 2691 | /*******************************************************************/
|
---|
[1288] | 2692 |
|
---|
[1640] | 2693 | RegisterOption("Hierarchy.Construction.samples",
|
---|
| 2694 | optInt,
|
---|
[1642] | 2695 | "hierarchy_construction_samples=",
|
---|
[1640] | 2696 | "100000");
|
---|
| 2697 |
|
---|
[2228] | 2698 | RegisterOption("Hierarchy.minRenderCost",
|
---|
| 2699 | optFloat,
|
---|
| 2700 | "hierarchy_minRenderCost=",
|
---|
| 2701 | "0");
|
---|
| 2702 |
|
---|
[1288] | 2703 | RegisterOption("Hierarchy.subdivisionStats",
|
---|
| 2704 | optString,
|
---|
| 2705 | "hierarchy_subdivision_stats=",
|
---|
| 2706 | "hierarchySubdivisionStats.log");
|
---|
| 2707 |
|
---|
| 2708 | RegisterOption("Hierarchy.type",
|
---|
| 2709 | optString,
|
---|
| 2710 | "hierarchy_type=",
|
---|
| 2711 | "bvh");
|
---|
| 2712 |
|
---|
| 2713 | RegisterOption("Hierarchy.Termination.minGlobalCostRatio",
|
---|
| 2714 | optFloat,
|
---|
| 2715 | "hierarchy_term_min_global_cost_ratio=",
|
---|
[1444] | 2716 | "0.000000001");
|
---|
[1288] | 2717 |
|
---|
| 2718 | RegisterOption("Hierarchy.Termination.globalCostMissTolerance",
|
---|
| 2719 | optInt,
|
---|
| 2720 | "hierarchy_term_global_cost_miss_tolerance=",
|
---|
| 2721 | "4");
|
---|
| 2722 |
|
---|
| 2723 | RegisterOption("Hierarchy.Termination.maxLeaves",
|
---|
| 2724 | optInt,
|
---|
| 2725 | "hierarchy_term_max_leaves=",
|
---|
| 2726 | "1000");
|
---|
| 2727 |
|
---|
[1293] | 2728 | RegisterOption("Hierarchy.Construction.type",
|
---|
| 2729 | optInt,
|
---|
| 2730 | "hierarchy_construction_type=",
|
---|
| 2731 | "0");
|
---|
| 2732 |
|
---|
[1311] | 2733 | RegisterOption("Hierarchy.Construction.minDepthForOsp",
|
---|
| 2734 | optInt,
|
---|
| 2735 | "hierarchy_construction_min_depth_for_osp=",
|
---|
| 2736 | "-1");
|
---|
| 2737 |
|
---|
[1370] | 2738 | RegisterOption("Hierarchy.Construction.startWithObjectSpace",
|
---|
| 2739 | optBool,
|
---|
| 2740 | "hierarchy_construction_start_with_osp=",
|
---|
| 2741 | "true");
|
---|
| 2742 |
|
---|
[1662] | 2743 | RegisterOption("Hierarchy.Construction.considerMemory",
|
---|
| 2744 | optBool,
|
---|
| 2745 | "hierarchy_construction_consider_memory=",
|
---|
[1744] | 2746 | "true");
|
---|
[1662] | 2747 |
|
---|
[1314] | 2748 | RegisterOption("Hierarchy.Construction.repairQueue",
|
---|
| 2749 | optBool,
|
---|
| 2750 | "hierarchy_construction_repair_queue=",
|
---|
| 2751 | "true");
|
---|
[1311] | 2752 |
|
---|
[1370] | 2753 | RegisterOption("Hierarchy.Construction.minDepthForVsp",
|
---|
| 2754 | optInt,
|
---|
| 2755 | "hierarchy_construction_min_depth_for_vsp=",
|
---|
| 2756 | "-1");
|
---|
[1359] | 2757 |
|
---|
[1649] | 2758 | RegisterOption("Hierarchy.Termination.maxMemory",
|
---|
| 2759 | optFloat,
|
---|
[1653] | 2760 | "hierarchy_term_max_memory=",
|
---|
[1649] | 2761 | "1");
|
---|
| 2762 |
|
---|
[1666] | 2763 | RegisterOption("Hierarchy.Termination.memoryConst",
|
---|
| 2764 | optFloat,
|
---|
| 2765 | "hierarchy_term_memory_const=",
|
---|
| 2766 | "1.0");
|
---|
| 2767 |
|
---|
[1545] | 2768 | RegisterOption("Hierarchy.Construction.useMultiLevel",
|
---|
[1449] | 2769 | optBool,
|
---|
[1545] | 2770 | "hierarchy_construction_multilevel=",
|
---|
[1449] | 2771 | "false");
|
---|
| 2772 |
|
---|
[1576] | 2773 | RegisterOption("Hierarchy.Construction.levels",
|
---|
| 2774 | optInt,
|
---|
| 2775 | "hierarchy_construction_levels=",
|
---|
| 2776 | "4");
|
---|
[1727] | 2777 |
|
---|
| 2778 | RegisterOption("Hierarchy.Construction.maxRepairs",
|
---|
| 2779 | optInt,
|
---|
[1843] | 2780 | "hierarchy_construction_max_repairs=",
|
---|
[1727] | 2781 | "1000");
|
---|
| 2782 |
|
---|
[1640] | 2783 | RegisterOption("Hierarchy.Construction.minStepsOfSameType",
|
---|
| 2784 | optInt,
|
---|
| 2785 | "hierarchy_construction_min_steps_same_type=",
|
---|
| 2786 | "200");
|
---|
[1576] | 2787 |
|
---|
[1684] | 2788 | RegisterOption("Hierarchy.Construction.maxStepsOfSameType",
|
---|
| 2789 | optInt,
|
---|
| 2790 | "hierarchy_construction_max_steps_same_type=",
|
---|
| 2791 | "700");
|
---|
| 2792 |
|
---|
[1633] | 2793 | RegisterOption("Hierarchy.Construction.recomputeSplitPlaneOnRepair",
|
---|
| 2794 | optBool,
|
---|
| 2795 | "hierarchy_construction_recompute_split_on_repair=",
|
---|
| 2796 | "true");
|
---|
| 2797 |
|
---|
[2227] | 2798 | RegisterOption("Hierarchy.Construction.maxAvgRaysPerObject",
|
---|
[1895] | 2799 | optFloat,
|
---|
[2227] | 2800 | "hierarchy_construction_max_avg_rays_per_object=",
|
---|
[2228] | 2801 | "0");
|
---|
[1895] | 2802 |
|
---|
[2227] | 2803 | RegisterOption("Hierarchy.Construction.minAvgRaysPerObject",
|
---|
[1912] | 2804 | optFloat,
|
---|
[2227] | 2805 | "hierarchy_construction_min_avg_rays_per_object=",
|
---|
[2228] | 2806 | "0");
|
---|
[1912] | 2807 |
|
---|
[2130] | 2808 | RegisterOption("Hierarchy.useTraversalTree",
|
---|
| 2809 | optBool,
|
---|
| 2810 | "hierarchy_use_traversal_tree=",
|
---|
| 2811 | "false");
|
---|
[2124] | 2812 |
|
---|
| 2813 | ///////////////////////////////////////////////////////
|
---|
| 2814 |
|
---|
| 2815 | RegisterOption("TraversalTree.Termination.minCost",
|
---|
| 2816 | optInt,
|
---|
| 2817 | "kd_term_min_cost=",
|
---|
| 2818 | "1");
|
---|
| 2819 |
|
---|
| 2820 | RegisterOption("TraversalTree.Termination.maxNodes",
|
---|
| 2821 | optInt,
|
---|
| 2822 | "kd_term_max_nodes=",
|
---|
| 2823 | "200000");
|
---|
| 2824 |
|
---|
| 2825 | RegisterOption("TraversalTree.Termination.maxDepth",
|
---|
| 2826 | optInt,
|
---|
| 2827 | "kd_term_max_depth=",
|
---|
| 2828 | "20");
|
---|
| 2829 |
|
---|
| 2830 | RegisterOption("TraversalTree.Termination.maxCostRatio",
|
---|
| 2831 | optFloat,
|
---|
| 2832 | "kd_term_max_cost_ratio=",
|
---|
| 2833 | "1.5");
|
---|
| 2834 |
|
---|
| 2835 | RegisterOption("TraversalTree.Termination.ct_div_ci",
|
---|
| 2836 | optFloat,
|
---|
| 2837 | "kd_term_ct_div_ci=",
|
---|
| 2838 | "1.0");
|
---|
| 2839 |
|
---|
| 2840 | RegisterOption("TraversalTree.splitMethod",
|
---|
| 2841 | optString,
|
---|
| 2842 | "kd_split_method=",
|
---|
| 2843 | "spatialMedian");
|
---|
| 2844 |
|
---|
| 2845 | RegisterOption("TraversalTree.splitBorder",
|
---|
| 2846 | optFloat,
|
---|
| 2847 | "kd_split_border=",
|
---|
| 2848 | "0.1");
|
---|
| 2849 |
|
---|
| 2850 | RegisterOption("TraversalTree.sahUseFaces",
|
---|
| 2851 | optBool,
|
---|
| 2852 | "kd_sah_use_faces=",
|
---|
| 2853 | "true");
|
---|
| 2854 |
|
---|
[1458] | 2855 | /////////////////////////////////////////////////////////////////
|
---|
[1895] | 2856 |
|
---|
[372] | 2857 | }
|
---|
| 2858 |
|
---|
| 2859 | void
|
---|
| 2860 | Environment::SetStaticOptions()
|
---|
| 2861 | {
|
---|
| 2862 |
|
---|
| 2863 | // get Global option values
|
---|
| 2864 | GetRealValue("Limits.threshold", Limits::Threshold);
|
---|
| 2865 | GetRealValue("Limits.small", Limits::Small);
|
---|
| 2866 | GetRealValue("Limits.infinity", Limits::Infinity);
|
---|
| 2867 |
|
---|
| 2868 |
|
---|
| 2869 | }
|
---|
| 2870 |
|
---|
[938] | 2871 | bool
|
---|
[492] | 2872 | Environment::Parse(const int argc, char **argv, bool useExePath)
|
---|
[372] | 2873 | {
|
---|
[938] | 2874 | bool result = true;
|
---|
[372] | 2875 | // Read the names of the scene, environment and output files
|
---|
| 2876 | ReadCmdlineParams(argc, argv, "");
|
---|
| 2877 |
|
---|
| 2878 | char *envFilename = new char[128];
|
---|
| 2879 |
|
---|
| 2880 | char filename[64];
|
---|
| 2881 |
|
---|
| 2882 | // Get the environment file name
|
---|
| 2883 | if (!GetParam(' ', 0, filename)) {
|
---|
| 2884 | // user didn't specified environment file explicitly, so
|
---|
[1199] | 2885 | strcpy(filename, "default.env");
|
---|
[372] | 2886 | }
|
---|
[1757] | 2887 |
|
---|
[372] | 2888 |
|
---|
| 2889 | if (useExePath) {
|
---|
| 2890 | char *path = GetPath(argv[0]);
|
---|
| 2891 | if (*path != 0)
|
---|
| 2892 | sprintf(envFilename, "%s/%s", path, filename);
|
---|
| 2893 | else
|
---|
| 2894 | strcpy(envFilename, filename);
|
---|
| 2895 |
|
---|
| 2896 | delete path;
|
---|
| 2897 | }
|
---|
| 2898 | else
|
---|
| 2899 | strcpy(envFilename, filename);
|
---|
| 2900 |
|
---|
| 2901 |
|
---|
| 2902 | // Now it's time to read in environment file.
|
---|
| 2903 | if (!ReadEnvFile(envFilename)) {
|
---|
| 2904 | // error - bad input file name specified ?
|
---|
| 2905 | cerr<<"Error parsing environment file "<<envFilename<<endl;
|
---|
[938] | 2906 | result = false;
|
---|
[372] | 2907 | }
|
---|
| 2908 | delete envFilename;
|
---|
| 2909 |
|
---|
| 2910 | // Parse the command line; options given on the command line subsume
|
---|
| 2911 | // stuff specified in the input environment file.
|
---|
| 2912 | ParseCmdline(argc, argv, 0);
|
---|
| 2913 |
|
---|
| 2914 | SetStaticOptions();
|
---|
| 2915 |
|
---|
| 2916 | // Check for request for help
|
---|
| 2917 | if (CheckForSwitch(argc, argv, '?')) {
|
---|
| 2918 | PrintUsage(cout);
|
---|
| 2919 | exit(0);
|
---|
| 2920 | }
|
---|
[938] | 2921 |
|
---|
| 2922 | return true;
|
---|
[372] | 2923 | }
|
---|
[860] | 2924 |
|
---|
[878] | 2925 | }
|
---|