[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");
|
---|
[2524] | 1134 |
|
---|
| 1135 | RegisterOption("KdTree.pvsArea",
|
---|
| 1136 | optFloat,
|
---|
| 1137 | "kd_pvs_area=",
|
---|
| 1138 | "1e-4");
|
---|
| 1139 |
|
---|
[372] | 1140 | RegisterOption("KdTree.splitBorder",
|
---|
| 1141 | optFloat,
|
---|
[492] | 1142 | "kd_split_border=",
|
---|
[372] | 1143 | "0.1");
|
---|
| 1144 |
|
---|
| 1145 | RegisterOption("KdTree.sahUseFaces",
|
---|
| 1146 | optBool,
|
---|
[492] | 1147 | "kd_sah_use_faces=",
|
---|
[372] | 1148 | "true");
|
---|
| 1149 |
|
---|
| 1150 | RegisterOption("MeshKdTree.Termination.minCost",
|
---|
| 1151 | optInt,
|
---|
[492] | 1152 | "kd_term_min_cost=",
|
---|
[372] | 1153 | "10");
|
---|
| 1154 |
|
---|
| 1155 | RegisterOption("MeshKdTree.Termination.maxDepth",
|
---|
| 1156 | optInt,
|
---|
[492] | 1157 | "kd_term_max_depth=",
|
---|
[372] | 1158 | "20");
|
---|
| 1159 |
|
---|
| 1160 | RegisterOption("MeshKdTree.Termination.maxCostRatio",
|
---|
| 1161 | optFloat,
|
---|
[492] | 1162 | "kd_term_max_cost_ratio=",
|
---|
[372] | 1163 | "1.5");
|
---|
| 1164 |
|
---|
| 1165 | RegisterOption("MeshKdTree.Termination.ct_div_ci",
|
---|
| 1166 | optFloat,
|
---|
[492] | 1167 | "kd_term_ct_div_ci=",
|
---|
[372] | 1168 | "1.0");
|
---|
| 1169 |
|
---|
| 1170 | RegisterOption("MeshKdTree.splitMethod",
|
---|
| 1171 | optString,
|
---|
[492] | 1172 | "kd_split_method=",
|
---|
[372] | 1173 | "spatialMedian");
|
---|
| 1174 |
|
---|
| 1175 | RegisterOption("MeshKdTree.splitBorder",
|
---|
| 1176 | optFloat,
|
---|
[492] | 1177 | "kd_split_border=",
|
---|
[372] | 1178 | "0.1");
|
---|
| 1179 |
|
---|
[1966] | 1180 | RegisterOption("Preprocessor.totalSamples",
|
---|
| 1181 | optInt,
|
---|
| 1182 | "total_samples=",
|
---|
| 1183 | "10000000");
|
---|
[372] | 1184 |
|
---|
[2046] | 1185 | RegisterOption("Preprocessor.totalTime",
|
---|
| 1186 | optInt,
|
---|
| 1187 | "total_time=",
|
---|
| 1188 | "-1");
|
---|
| 1189 |
|
---|
[1966] | 1190 | RegisterOption("Preprocessor.samplesPerPass",
|
---|
| 1191 | optInt,
|
---|
| 1192 | "samples_per_pass=",
|
---|
| 1193 | "100000");
|
---|
| 1194 |
|
---|
| 1195 | RegisterOption("Preprocessor.samplesPerEvaluation",
|
---|
| 1196 | optInt,
|
---|
| 1197 | "samples_per_evaluation=",
|
---|
| 1198 | "1000000");
|
---|
[372] | 1199 |
|
---|
[1968] | 1200 | RegisterOption("Preprocessor.useHwGlobalLines",
|
---|
| 1201 | optBool,
|
---|
| 1202 | "preprocessor_use_hw_global_lines=",
|
---|
| 1203 | "false");
|
---|
| 1204 |
|
---|
| 1205 | RegisterOption("Preprocessor.HwGlobalLines.texHeight",
|
---|
| 1206 | optInt,
|
---|
| 1207 | "preprocessor_hw_global_lines_texheight=",
|
---|
| 1208 | "128");
|
---|
| 1209 |
|
---|
| 1210 | RegisterOption("Preprocessor.HwGlobalLines.texWidth",
|
---|
| 1211 | optInt,
|
---|
| 1212 | "preprocessor_hw_global_lines_texwidth=",
|
---|
| 1213 | "128");
|
---|
| 1214 |
|
---|
| 1215 | RegisterOption("Preprocessor.HwGlobalLines.stepSize",
|
---|
| 1216 | optFloat,
|
---|
| 1217 | "preprocessor_hw_global_lines_stepsize=",
|
---|
| 1218 | "0.0001");
|
---|
| 1219 |
|
---|
| 1220 | RegisterOption("Preprocessor.HwGlobalLines.maxDepth",
|
---|
| 1221 | optInt,
|
---|
| 1222 | "preprocessor_hw_global_lines_max_depth=",
|
---|
| 1223 | "50");
|
---|
| 1224 |
|
---|
| 1225 | RegisterOption("Preprocessor.HwGlobalLines.sampleReverse",
|
---|
| 1226 | optBool,
|
---|
| 1227 | "preprocessor_hw_global_lines_sample_reverse=",
|
---|
| 1228 | "true");
|
---|
| 1229 |
|
---|
[811] | 1230 | RegisterOption("RenderSampler.samples",
|
---|
| 1231 | optInt,
|
---|
| 1232 | "render_sampler_samples=",
|
---|
| 1233 | "1000");
|
---|
| 1234 |
|
---|
[1001] | 1235 | RegisterOption("RenderSampler.visibleThreshold",
|
---|
| 1236 | optInt,
|
---|
| 1237 | "render_sampler_visible_threshold=",
|
---|
| 1238 | "0");
|
---|
| 1239 |
|
---|
[997] | 1240 | RegisterOption("RenderSampler.useOcclusionQueries",
|
---|
| 1241 | optBool,
|
---|
| 1242 | "render_sampler_use_occlusion_queries=",
|
---|
| 1243 | "true");
|
---|
[492] | 1244 |
|
---|
[1001] | 1245 | RegisterOption("VssPreprocessor.testBeamSampling",
|
---|
| 1246 | optBool,
|
---|
[1486] | 1247 | "vss_beam_sampling=",
|
---|
[1001] | 1248 | "false");
|
---|
[532] | 1249 |
|
---|
[403] | 1250 | RegisterOption("VssPreprocessor.useImportanceSampling",
|
---|
[492] | 1251 | optBool,
|
---|
| 1252 | "vss_use_importance=",
|
---|
| 1253 | "true");
|
---|
[403] | 1254 |
|
---|
[1785] | 1255 |
|
---|
[674] | 1256 | RegisterOption("VssPreprocessor.enlargeViewSpace",
|
---|
| 1257 | optBool,
|
---|
| 1258 | "vss_enlarge_viewspace=",
|
---|
[675] | 1259 | "false");
|
---|
[674] | 1260 |
|
---|
[490] | 1261 | RegisterOption("VssPreprocessor.loadInitialSamples",
|
---|
| 1262 | optBool,
|
---|
[674] | 1263 | "vss_load_loadInitialSamples=",
|
---|
[490] | 1264 | "false");
|
---|
[445] | 1265 |
|
---|
[490] | 1266 | RegisterOption("VssPreprocessor.storeInitialSamples",
|
---|
| 1267 | optBool,
|
---|
[674] | 1268 | "vss_store_storedInitialSamples=",
|
---|
[490] | 1269 | "false");
|
---|
[1723] | 1270 |
|
---|
[501] | 1271 |
|
---|
[445] | 1272 |
|
---|
[1968] | 1273 | /*************************************************************************/
|
---|
[2060] | 1274 | /* Mutation strategy related options */
|
---|
| 1275 | /*************************************************************************/
|
---|
| 1276 |
|
---|
| 1277 | RegisterOption("Mutation.bufferSize",
|
---|
| 1278 | optInt,
|
---|
| 1279 | "mutation_buffer_size=",
|
---|
| 1280 | "500000");
|
---|
| 1281 |
|
---|
| 1282 | RegisterOption("Mutation.radiusOrigin",
|
---|
| 1283 | optFloat,
|
---|
| 1284 | "mutation_radius_origin=",
|
---|
| 1285 | "0.5");
|
---|
| 1286 |
|
---|
| 1287 | RegisterOption("Mutation.radiusTermination",
|
---|
| 1288 | optFloat,
|
---|
| 1289 | "mutation_radius_termination=",
|
---|
| 1290 | "0.5");
|
---|
| 1291 |
|
---|
| 1292 | RegisterOption("Mutation.useReverseSamples",
|
---|
| 1293 | optBool,
|
---|
| 1294 | "mutation_use_reverse_samples",
|
---|
| 1295 | "true");
|
---|
| 1296 |
|
---|
| 1297 | RegisterOption("Mutation.reverseSamplesDistance",
|
---|
| 1298 | optFloat,
|
---|
[2076] | 1299 | "mutation_reverse_samples_distance=",
|
---|
[2060] | 1300 | "3.0");
|
---|
| 1301 |
|
---|
| 1302 | RegisterOption("Mutation.useSilhouetteSamples",
|
---|
| 1303 | optBool,
|
---|
| 1304 | "mutation_use_silhouette_samples",
|
---|
| 1305 | "true");
|
---|
| 1306 |
|
---|
| 1307 | RegisterOption("Mutation.silhouetteSearchSteps",
|
---|
| 1308 | optInt,
|
---|
| 1309 | "mutation_silhouette_search_steps=",
|
---|
| 1310 | "3");
|
---|
| 1311 |
|
---|
| 1312 | RegisterOption("Mutation.silhouetteProb",
|
---|
| 1313 | optFloat,
|
---|
| 1314 | "mutation_silhouette_prob=",
|
---|
| 1315 | "0.8");
|
---|
| 1316 |
|
---|
| 1317 | RegisterOption("Mutation.usePassImportance",
|
---|
| 1318 | optBool,
|
---|
| 1319 | "mutation_use_pass_importance",
|
---|
| 1320 | "true");
|
---|
| 1321 |
|
---|
| 1322 | RegisterOption("Mutation.useUnsuccCountImportance",
|
---|
| 1323 | optBool,
|
---|
| 1324 | "mutation_use_unsucc_count_importance",
|
---|
| 1325 | "false");
|
---|
| 1326 |
|
---|
| 1327 |
|
---|
| 1328 | /*************************************************************************/
|
---|
[1968] | 1329 | /* GvsPrerpocessor related options */
|
---|
| 1330 | /*************************************************************************/
|
---|
[445] | 1331 |
|
---|
[1486] | 1332 |
|
---|
| 1333 | RegisterOption("GvsPreprocessor.totalSamples",
|
---|
| 1334 | optInt,
|
---|
| 1335 | "gvs_total_samples=",
|
---|
| 1336 | "1000000");
|
---|
| 1337 |
|
---|
[2048] | 1338 | RegisterOption("GvsPreprocessor.gvsSamplesPerPass",
|
---|
[1486] | 1339 | optInt,
|
---|
| 1340 | "gvs_samples_per_pass=",
|
---|
| 1341 | "100000");
|
---|
| 1342 |
|
---|
| 1343 | RegisterOption("GvsPreprocessor.initialSamples",
|
---|
| 1344 | optInt,
|
---|
| 1345 | "gvs_initial_samples=",
|
---|
| 1346 | "256");
|
---|
| 1347 |
|
---|
| 1348 | RegisterOption("GvsPreprocessor.epsilon",
|
---|
| 1349 | optFloat,
|
---|
[1522] | 1350 | "gvs_epsilon=",
|
---|
[1486] | 1351 | "0.00001");
|
---|
| 1352 |
|
---|
[1500] | 1353 | RegisterOption("GvsPreprocessor.threshold",
|
---|
| 1354 | optFloat,
|
---|
[1522] | 1355 | "gvs_threshold=",
|
---|
[1500] | 1356 | "1.5");
|
---|
[1486] | 1357 |
|
---|
[1976] | 1358 | RegisterOption("GvsPreprocessor.perViewCell",
|
---|
| 1359 | optBool,
|
---|
| 1360 | "gvs_per_viewcell=",
|
---|
[2360] | 1361 | "true");
|
---|
[1976] | 1362 |
|
---|
[1934] | 1363 | RegisterOption("GvsPreprocessor.stats",
|
---|
[1996] | 1364 | optString,
|
---|
| 1365 | "gvs_stats=",
|
---|
| 1366 | "gvsStats.log");
|
---|
| 1367 |
|
---|
| 1368 | RegisterOption("GvsPreprocessor.minContribution",
|
---|
| 1369 | optInt,
|
---|
| 1370 | "gvs_min_contribution=",
|
---|
| 1371 | "50");
|
---|
| 1372 |
|
---|
| 1373 | RegisterOption("GvsPreprocessor.maxViewCells",
|
---|
| 1374 | optInt,
|
---|
| 1375 | "gvs_max_viewcells=",
|
---|
| 1376 | "5");
|
---|
| 1377 |
|
---|
| 1378 |
|
---|
[1968] | 1379 | /**********************************************************************/
|
---|
| 1380 | /* View cells related options */
|
---|
| 1381 | /**********************************************************************/
|
---|
[1486] | 1382 |
|
---|
| 1383 |
|
---|
[508] | 1384 | RegisterOption("ViewCells.type",
|
---|
[2124] | 1385 | optString,
|
---|
| 1386 | "view_cells_type=",
|
---|
| 1387 | "vspBspTree");
|
---|
[372] | 1388 |
|
---|
[662] | 1389 | RegisterOption("ViewCells.samplingType",
|
---|
[2124] | 1390 | optString,
|
---|
| 1391 | "view_cells_sampling_type=",
|
---|
| 1392 | "box");
|
---|
[662] | 1393 |
|
---|
[666] | 1394 | RegisterOption("ViewCells.mergeStats",
|
---|
[660] | 1395 | optString,
|
---|
[666] | 1396 | "view_cells_merge_stats=",
|
---|
| 1397 | "mergeStats.log");
|
---|
[660] | 1398 |
|
---|
[664] | 1399 | RegisterOption("ViewCells.Evaluation.statsPrefix",
|
---|
[660] | 1400 | optString,
|
---|
[664] | 1401 | "view_cells_evaluation_stats_prefix=",
|
---|
[660] | 1402 | "viewCells");
|
---|
[1418] | 1403 |
|
---|
[735] | 1404 | RegisterOption("ViewCells.Evaluation.histogram",
|
---|
| 1405 | optBool,
|
---|
| 1406 | "view_cells_evaluation_histogram=",
|
---|
| 1407 | "false");
|
---|
| 1408 |
|
---|
[997] | 1409 | RegisterOption("ViewCells.Evaluation.histoStepSize",
|
---|
[735] | 1410 | optInt,
|
---|
[997] | 1411 | "view_cells_evaluation_histo_step_size=",
|
---|
[744] | 1412 | "5000");
|
---|
[735] | 1413 |
|
---|
[1919] | 1414 | RegisterOption("ViewCells.Evaluation.histoMem",
|
---|
| 1415 | optInt,
|
---|
| 1416 | "view_cells_evaluation_histo_mem=",
|
---|
| 1417 | "50");
|
---|
| 1418 |
|
---|
[728] | 1419 | RegisterOption("ViewCells.renderCostEvaluationType",
|
---|
| 1420 | optString,
|
---|
| 1421 | "view_cells_render_cost_evaluation=",
|
---|
| 1422 | "perobject");
|
---|
| 1423 |
|
---|
[660] | 1424 | RegisterOption("ViewCells.active",
|
---|
| 1425 | optInt,
|
---|
[664] | 1426 | "view_cells_active=",
|
---|
[660] | 1427 | "1000");
|
---|
[581] | 1428 |
|
---|
[574] | 1429 | RegisterOption("ViewCells.Construction.samples",
|
---|
| 1430 | optInt,
|
---|
| 1431 | "view_cells_construction_samples=",
|
---|
[1134] | 1432 | "0");
|
---|
[574] | 1433 |
|
---|
| 1434 | RegisterOption("ViewCells.Construction.samplesPerPass",
|
---|
| 1435 | optInt,
|
---|
| 1436 | "view_cells_construction_samples_per_pass=",
|
---|
| 1437 | "500000");
|
---|
| 1438 |
|
---|
[508] | 1439 | RegisterOption("ViewCells.PostProcess.samples",
|
---|
| 1440 | optInt,
|
---|
[712] | 1441 | "view_cells_post_process_samples=",
|
---|
[1134] | 1442 | "0");
|
---|
[421] | 1443 |
|
---|
[508] | 1444 | RegisterOption("ViewCells.Visualization.samples",
|
---|
| 1445 | optInt,
|
---|
| 1446 | "view_cells_visualization_samples=",
|
---|
[1134] | 1447 | "0");
|
---|
[372] | 1448 |
|
---|
[1020] | 1449 | RegisterOption("ViewCells.Visualization.maxOutput",
|
---|
| 1450 | optInt,
|
---|
| 1451 | "view_cells_visualization_max_output=",
|
---|
| 1452 | "20");
|
---|
| 1453 |
|
---|
[697] | 1454 | RegisterOption("ViewCells.Filter.maxSize",
|
---|
| 1455 | optInt,
|
---|
| 1456 | "view_cells_filter_max_size=",
|
---|
| 1457 | "4");
|
---|
| 1458 |
|
---|
| 1459 | RegisterOption("ViewCells.Filter.width",
|
---|
| 1460 | optFloat,
|
---|
| 1461 | "view_cells_filter_width=",
|
---|
[2051] | 1462 | "1.0");
|
---|
[697] | 1463 |
|
---|
[508] | 1464 | RegisterOption("ViewCells.loadFromFile",
|
---|
| 1465 | optBool,
|
---|
[664] | 1466 | "view_cells_load_from_file=",
|
---|
[508] | 1467 | "false");
|
---|
[485] | 1468 |
|
---|
[586] | 1469 | RegisterOption("ViewCells.PostProcess.refine",
|
---|
| 1470 | optBool,
|
---|
[664] | 1471 | "view_cells_refine=",
|
---|
[586] | 1472 | "false");
|
---|
| 1473 |
|
---|
| 1474 | RegisterOption("ViewCells.PostProcess.compress",
|
---|
| 1475 | optBool,
|
---|
[664] | 1476 | "view_cells_post_process_compress=",
|
---|
[586] | 1477 | "false");
|
---|
| 1478 |
|
---|
[662] | 1479 | RegisterOption("ViewCells.Evaluation.samples",
|
---|
| 1480 | optInt,
|
---|
| 1481 | "view_cells_evaluation_samples=",
|
---|
| 1482 | "8000000");
|
---|
| 1483 |
|
---|
[722] | 1484 | RegisterOption("ViewCells.Evaluation.samplingType",
|
---|
[837] | 1485 | optString,
|
---|
| 1486 | "view_cells_evaluation_sampling_type=",
|
---|
| 1487 | "box");
|
---|
[722] | 1488 |
|
---|
[662] | 1489 | RegisterOption("ViewCells.Evaluation.samplesPerPass",
|
---|
| 1490 | optInt,
|
---|
| 1491 | "view_cells_evaluation_samples_per_pass=",
|
---|
| 1492 | "300000");
|
---|
| 1493 |
|
---|
[1695] | 1494 | RegisterOption("ViewCells.Evaluation.samplesForStats",
|
---|
| 1495 | optInt,
|
---|
| 1496 | "view_cells_evaluation_samples_for_stats=",
|
---|
| 1497 | "300000");
|
---|
| 1498 |
|
---|
[508] | 1499 | RegisterOption("ViewCells.exportToFile",
|
---|
| 1500 | optBool,
|
---|
[676] | 1501 | "view_cells_export_to_file=",
|
---|
[508] | 1502 | "false");
|
---|
| 1503 |
|
---|
[844] | 1504 | RegisterOption("ViewCells.exportPvs",
|
---|
| 1505 | optBool,
|
---|
| 1506 | "view_cells_export_pvs=",
|
---|
| 1507 | "false");
|
---|
| 1508 |
|
---|
[840] | 1509 | RegisterOption("ViewCells.exportBboxesForPvs",
|
---|
| 1510 | optBool,
|
---|
[844] | 1511 | "view_cells_export_bounding_boxes=",
|
---|
[840] | 1512 | "true");
|
---|
| 1513 |
|
---|
| 1514 | RegisterOption("ViewCells.boxesFilename",
|
---|
| 1515 | optString,
|
---|
| 1516 | "view_cells_boxes_filename=",
|
---|
| 1517 | "boxes.out");
|
---|
| 1518 |
|
---|
[664] | 1519 | RegisterOption("ViewCells.evaluateViewCells",
|
---|
| 1520 | optBool,
|
---|
[670] | 1521 | "view_cells_evaluate=",
|
---|
[664] | 1522 | "false");
|
---|
| 1523 |
|
---|
[508] | 1524 | RegisterOption("ViewCells.maxViewCells",
|
---|
[667] | 1525 | optInt,
|
---|
| 1526 | "view_cells_max_view_cells=",
|
---|
| 1527 | "0");
|
---|
[508] | 1528 |
|
---|
[1713] | 1529 | RegisterOption("ViewCells.Evaluation.stepSize",
|
---|
| 1530 | optInt,
|
---|
| 1531 | "view_cells_evaluation_step_size=",
|
---|
| 1532 | "100");
|
---|
| 1533 |
|
---|
[511] | 1534 | RegisterOption("ViewCells.maxPvsRatio",
|
---|
| 1535 | optFloat,
|
---|
| 1536 | "view_cells_max_pvs_ratio=",
|
---|
| 1537 | "0.1");
|
---|
[508] | 1538 |
|
---|
[2332] | 1539 | RegisterOption("ViewCells.triangleWeight",
|
---|
| 1540 | optFloat,
|
---|
| 1541 | "view_cells_triangle_weight=",
|
---|
| 1542 | "1.0");
|
---|
| 1543 |
|
---|
| 1544 | RegisterOption("ViewCells.objectWeight",
|
---|
| 1545 | optFloat,
|
---|
| 1546 | "view_cells_object_weight=",
|
---|
| 1547 | "0.0");
|
---|
| 1548 |
|
---|
[508] | 1549 | RegisterOption("ViewCells.filename",
|
---|
[667] | 1550 | optString,
|
---|
| 1551 | "view_cells_filename=",
|
---|
| 1552 | "atlanta_viewcells_large.x3d");
|
---|
[508] | 1553 |
|
---|
| 1554 | RegisterOption("ViewCells.height",
|
---|
[667] | 1555 | optFloat,
|
---|
| 1556 | "view_cells_height=",
|
---|
| 1557 | "5.0");
|
---|
[508] | 1558 |
|
---|
| 1559 | RegisterOption("ViewCells.Visualization.colorCode",
|
---|
[667] | 1560 | optString,
|
---|
[708] | 1561 | "view_cells_visualization_color_code=",
|
---|
[667] | 1562 | "PVS");
|
---|
[482] | 1563 |
|
---|
[667] | 1564 | RegisterOption("ViewCells.Visualization.clipPlanePos",
|
---|
| 1565 | optFloat,
|
---|
[708] | 1566 | "view_cells_visualization_clip_plane_pos=",
|
---|
[667] | 1567 | "0.35");
|
---|
[579] | 1568 |
|
---|
[508] | 1569 | RegisterOption("ViewCells.Visualization.exportGeometry",
|
---|
[667] | 1570 | optBool,
|
---|
[708] | 1571 | "view_cells_visualization_export_geometry=",
|
---|
[667] | 1572 | "false");
|
---|
[445] | 1573 |
|
---|
[667] | 1574 | RegisterOption("ViewCells.Visualization.exportRays",
|
---|
| 1575 | optBool,
|
---|
[708] | 1576 | "view_cells_visualization_export_rays=",
|
---|
[667] | 1577 | "false");
|
---|
| 1578 |
|
---|
[564] | 1579 | RegisterOption("ViewCells.processOnlyValidViewCells",
|
---|
[667] | 1580 | optBool,
|
---|
[1761] | 1581 | "view_cells_process_only_valid_view_cells",
|
---|
[667] | 1582 | "false");
|
---|
[660] | 1583 |
|
---|
[580] | 1584 | RegisterOption("ViewCells.PostProcess.maxCostRatio",
|
---|
| 1585 | optFloat,
|
---|
[667] | 1586 | "view_cells_post_process_max_cost_ratio=",
|
---|
[580] | 1587 | "0.9");
|
---|
| 1588 |
|
---|
| 1589 | RegisterOption("ViewCells.PostProcess.renderCostWeight",
|
---|
| 1590 | optFloat,
|
---|
[667] | 1591 | "view_cells_post_process_render_cost_weight",
|
---|
[580] | 1592 | "0.5");
|
---|
| 1593 |
|
---|
| 1594 | RegisterOption("ViewCells.PostProcess.avgCostMaxDeviation",
|
---|
| 1595 | optFloat,
|
---|
[1143] | 1596 | "view_cells_avgcost_max_deviations",
|
---|
[580] | 1597 | "0.5");
|
---|
| 1598 |
|
---|
| 1599 | RegisterOption("ViewCells.PostProcess.maxMergesPerPass",
|
---|
| 1600 | optInt,
|
---|
[667] | 1601 | "view_cells_post_process_max_merges_per_pass=",
|
---|
[580] | 1602 | "500");
|
---|
| 1603 |
|
---|
| 1604 | RegisterOption("ViewCells.PostProcess.minViewCells",
|
---|
| 1605 | optInt,
|
---|
[667] | 1606 | "view_cells_post_process_min_view_cells=",
|
---|
[580] | 1607 | "1000");
|
---|
| 1608 |
|
---|
| 1609 | RegisterOption("ViewCells.PostProcess.useRaysForMerge",
|
---|
| 1610 | optBool,
|
---|
| 1611 | "view_cells_post_process_use_rays_for_merge=",
|
---|
| 1612 | "false");
|
---|
[591] | 1613 |
|
---|
| 1614 | RegisterOption("ViewCells.PostProcess.merge",
|
---|
| 1615 | optBool,
|
---|
[666] | 1616 | "view_cells_post_process_merge=",
|
---|
[591] | 1617 | "true");
|
---|
[580] | 1618 |
|
---|
| 1619 | RegisterOption("ViewCells.Visualization.exportMergedViewCells",
|
---|
| 1620 | optBool,
|
---|
| 1621 | "view_cells_viz_export_merged_viewcells=",
|
---|
| 1622 | "false");
|
---|
| 1623 |
|
---|
[582] | 1624 | RegisterOption("ViewCells.maxStaticMemory",
|
---|
| 1625 | optFloat,
|
---|
| 1626 | "view_cells_max_static_mem=",
|
---|
| 1627 | "8.0");
|
---|
[580] | 1628 |
|
---|
[660] | 1629 | RegisterOption("ViewCells.Visualization.useClipPlane",
|
---|
[591] | 1630 | optBool,
|
---|
[660] | 1631 | "view_cells_viz_use_clip_plane=",
|
---|
[591] | 1632 | "false");
|
---|
| 1633 |
|
---|
[666] | 1634 | RegisterOption("ViewCells.showVisualization",
|
---|
| 1635 | optBool,
|
---|
| 1636 | "view_cells_show_visualization=",
|
---|
| 1637 | "false");
|
---|
| 1638 |
|
---|
[660] | 1639 | RegisterOption("ViewCells.Visualization.clipPlaneAxis",
|
---|
[591] | 1640 | optInt,
|
---|
[660] | 1641 | "view_cells_viz_clip_plane_axis=",
|
---|
[591] | 1642 | "0");
|
---|
| 1643 |
|
---|
[1545] | 1644 | RegisterOption("ViewCells.loadGeometry",
|
---|
| 1645 | optBool,
|
---|
| 1646 | "view_cells_load_geometry=",
|
---|
| 1647 | "false");
|
---|
[1159] | 1648 |
|
---|
[1545] | 1649 | RegisterOption("ViewCells.geometryFilename",
|
---|
| 1650 | optString,
|
---|
| 1651 | "view_cells_geometry_filename=",
|
---|
| 1652 | "viewCellsGeometry.x3d");
|
---|
| 1653 |
|
---|
| 1654 | RegisterOption("ViewCells.useBaseTrianglesAsGeometry",
|
---|
| 1655 | optBool,
|
---|
| 1656 | "view_cells_use_base_triangles_as_geometry=",
|
---|
| 1657 | "false");
|
---|
| 1658 |
|
---|
[1887] | 1659 | RegisterOption("ViewCells.compressObjects",
|
---|
| 1660 | optBool,
|
---|
| 1661 | "view_cells_compress_objects=",
|
---|
| 1662 | "false");
|
---|
[2010] | 1663 |
|
---|
[1902] | 1664 | RegisterOption("ViewCells.useKdPvs",
|
---|
| 1665 | optBool,
|
---|
[2006] | 1666 | "view_cells_use_kd_pvs",
|
---|
[1902] | 1667 | "false");
|
---|
[1887] | 1668 |
|
---|
[1974] | 1669 | RegisterOption("ViewCells.useKdPvsAfterFiltering",
|
---|
| 1670 | optBool,
|
---|
[2010] | 1671 | "af_use_kd_pvs",
|
---|
[1974] | 1672 | "false");
|
---|
[1902] | 1673 |
|
---|
[2048] | 1674 | RegisterOption("ViewCells.importRandomViewCells",
|
---|
| 1675 | optBool,
|
---|
| 1676 | "view_cells_import_random_viewcells=",
|
---|
| 1677 | "false");
|
---|
[1902] | 1678 |
|
---|
[2048] | 1679 | RegisterOption("ViewCells.exportRandomViewCells",
|
---|
| 1680 | optBool,
|
---|
| 1681 | "view_cells_export_random_viewcells=",
|
---|
| 1682 | "false");
|
---|
[1974] | 1683 |
|
---|
[2048] | 1684 |
|
---|
| 1685 |
|
---|
[1418] | 1686 | /****************************************************************************/
|
---|
| 1687 | /* Render simulation related options */
|
---|
| 1688 | /****************************************************************************/
|
---|
[372] | 1689 |
|
---|
[406] | 1690 |
|
---|
[508] | 1691 | RegisterOption("Simulation.objRenderCost",
|
---|
| 1692 | optFloat,
|
---|
| 1693 | "simulation_obj_render_cost",
|
---|
| 1694 | "1.0");
|
---|
[409] | 1695 |
|
---|
[508] | 1696 | RegisterOption("Simulation.vcOverhead",
|
---|
| 1697 | optFloat,
|
---|
| 1698 | "simulation_vc_overhead",
|
---|
| 1699 | "0.05");
|
---|
[445] | 1700 |
|
---|
[508] | 1701 | RegisterOption("Simulation.moveSpeed",
|
---|
| 1702 | optFloat,
|
---|
| 1703 | "simulation_moveSpeed",
|
---|
| 1704 | "1.0");
|
---|
[445] | 1705 |
|
---|
| 1706 |
|
---|
| 1707 |
|
---|
[1486] | 1708 | /******************************************************************/
|
---|
| 1709 | /* Bsp tree related options */
|
---|
| 1710 | /******************************************************************/
|
---|
[445] | 1711 |
|
---|
[372] | 1712 |
|
---|
[508] | 1713 | RegisterOption("BspTree.Construction.input",
|
---|
| 1714 | optString,
|
---|
| 1715 | "bsp_construction_input=",
|
---|
| 1716 | "fromViewCells");
|
---|
[1867] | 1717 |
|
---|
[660] | 1718 | RegisterOption("BspTree.subdivisionStats",
|
---|
| 1719 | optString,
|
---|
[666] | 1720 | "bsp_subdivision_stats=",
|
---|
[660] | 1721 | "bspSubdivisionStats.log");
|
---|
| 1722 |
|
---|
[508] | 1723 | RegisterOption("BspTree.Construction.samples",
|
---|
| 1724 | optInt,
|
---|
| 1725 | "bsp_construction_samples=",
|
---|
| 1726 | "100000");
|
---|
[390] | 1727 |
|
---|
[508] | 1728 | RegisterOption("BspTree.Construction.epsilon",
|
---|
| 1729 | optFloat,
|
---|
[1023] | 1730 | "bsp_construction_epsilon=",
|
---|
[508] | 1731 | "0.002");
|
---|
[397] | 1732 |
|
---|
[508] | 1733 | RegisterOption("BspTree.Termination.minPolygons",
|
---|
| 1734 | optInt,
|
---|
| 1735 | "bsp_term_min_polygons=",
|
---|
| 1736 | "5");
|
---|
[409] | 1737 |
|
---|
[508] | 1738 | RegisterOption("BspTree.Termination.minPvs",
|
---|
| 1739 | optInt,
|
---|
| 1740 | "bsp_term_min_pvs=",
|
---|
| 1741 | "20");
|
---|
[372] | 1742 |
|
---|
[587] | 1743 | RegisterOption("BspTree.Termination.minProbability",
|
---|
[508] | 1744 | optFloat,
|
---|
[587] | 1745 | "bsp_term_min_probability=",
|
---|
[508] | 1746 | "0.001");
|
---|
[424] | 1747 |
|
---|
[508] | 1748 | RegisterOption("BspTree.Termination.maxRayContribution",
|
---|
| 1749 | optFloat,
|
---|
| 1750 | "bsp_term_ray_contribution=",
|
---|
| 1751 | "0.005");
|
---|
[372] | 1752 |
|
---|
[508] | 1753 | RegisterOption("BspTree.Termination.minAccRayLenght",
|
---|
| 1754 | optFloat,
|
---|
| 1755 | "bsp_term_min_acc_ray_length=",
|
---|
| 1756 | "50");
|
---|
[372] | 1757 |
|
---|
[508] | 1758 | RegisterOption("BspTree.Termination.minRays",
|
---|
| 1759 | optInt,
|
---|
| 1760 | "bsp_term_min_rays=",
|
---|
| 1761 | "-1");
|
---|
[372] | 1762 |
|
---|
[508] | 1763 | RegisterOption("BspTree.Termination.ct_div_ci",
|
---|
| 1764 | optFloat,
|
---|
| 1765 | "bsp_term_ct_div_ci=",
|
---|
| 1766 | "0.0");
|
---|
[372] | 1767 |
|
---|
[508] | 1768 | RegisterOption("BspTree.Termination.maxDepth",
|
---|
| 1769 | optInt,
|
---|
| 1770 | "bsp_term_max_depth=",
|
---|
| 1771 | "100");
|
---|
[372] | 1772 |
|
---|
[508] | 1773 | RegisterOption("BspTree.Termination.maxCostRatio",
|
---|
| 1774 | optFloat,
|
---|
| 1775 | "bsp_term_axis_aligned_max_cost_ratio=",
|
---|
| 1776 | "1.5");
|
---|
[372] | 1777 |
|
---|
[508] | 1778 | RegisterOption("BspTree.Termination.AxisAligned.ct_div_ci",
|
---|
| 1779 | optFloat,
|
---|
| 1780 | "bsp_term_axis_aligned_ct_div_ci=",
|
---|
| 1781 | "0.5");
|
---|
[372] | 1782 |
|
---|
[508] | 1783 | RegisterOption("BspTree.AxisAligned.splitBorder",
|
---|
| 1784 | optFloat,
|
---|
| 1785 | "bsp__axis_aligned_split_border=",
|
---|
| 1786 | "0.1");
|
---|
[372] | 1787 |
|
---|
[508] | 1788 | RegisterOption("BspTree.Termination.AxisAligned.minPolys",
|
---|
| 1789 | optInt,
|
---|
| 1790 | "bsp_term_axis_aligned_max_polygons=",
|
---|
| 1791 | "50");
|
---|
[379] | 1792 |
|
---|
[508] | 1793 | RegisterOption("BspTree.Termination.AxisAligned.minObjects",
|
---|
| 1794 | optInt,
|
---|
| 1795 | "bsp_term_min_objects=",
|
---|
| 1796 | "3");
|
---|
[441] | 1797 |
|
---|
[508] | 1798 | RegisterOption("BspTree.Termination.AxisAligned.minRays",
|
---|
| 1799 | optInt,
|
---|
| 1800 | "bsp_term_axis_aligned_min_rays=",
|
---|
| 1801 | "-1");
|
---|
[374] | 1802 |
|
---|
[508] | 1803 | RegisterOption("BspTree.splitPlaneStrategy",
|
---|
| 1804 | optString,
|
---|
| 1805 | "bsp_split_method=",
|
---|
| 1806 | "leastSplits");
|
---|
[424] | 1807 |
|
---|
[508] | 1808 | RegisterOption("BspTree.maxPolyCandidates",
|
---|
| 1809 | optInt,
|
---|
| 1810 | "bsp_max_poly_candidates=",
|
---|
| 1811 | "20");
|
---|
[469] | 1812 |
|
---|
[508] | 1813 | RegisterOption("BspTree.maxRayCandidates",
|
---|
| 1814 | optInt,
|
---|
| 1815 | "bsp_max_plane_candidates=",
|
---|
| 1816 | "20");
|
---|
[382] | 1817 |
|
---|
[508] | 1818 | RegisterOption("BspTree.maxTests",
|
---|
| 1819 | optInt,
|
---|
| 1820 | "bsp_max_tests=",
|
---|
| 1821 | "5000");
|
---|
[382] | 1822 |
|
---|
[587] | 1823 | RegisterOption("BspTree.Termination.maxViewCells",
|
---|
| 1824 | optInt,
|
---|
| 1825 | "bsp_max_view_cells=",
|
---|
| 1826 | "5000");
|
---|
| 1827 |
|
---|
[508] | 1828 | RegisterOption("BspTree.Visualization.exportSplits",
|
---|
| 1829 | optBool,
|
---|
[1545] | 1830 | "bsp_visualization.export_splits=",
|
---|
[508] | 1831 | "false");
|
---|
[445] | 1832 |
|
---|
[508] | 1833 | RegisterOption("BspTree.Factor.verticalSplits", optFloat, "bsp_factor_vertical=", "1.0");
|
---|
| 1834 | RegisterOption("BspTree.Factor.largestPolyArea", optFloat, "bsp_factor_largest_poly=", "1.0");
|
---|
| 1835 | RegisterOption("BspTree.Factor.blockedRays", optFloat, "bsp_factor_blocked=", "1.0");
|
---|
| 1836 | RegisterOption("BspTree.Factor.leastSplits", optFloat, "bsp_factor_least_splits=", "1.0");
|
---|
| 1837 | RegisterOption("BspTree.Factor.balancedPolys", optFloat, "bsp_factor_balanced_polys=", "1.0");
|
---|
| 1838 | RegisterOption("BspTree.Factor.balancedViewCells", optFloat, "bsp_factor_balanced_view_cells=", "1.0");
|
---|
| 1839 | RegisterOption("BspTree.Factor.leastRaySplits", optFloat, "bsp_factor_least_ray_splits=", "1.0");
|
---|
| 1840 | RegisterOption("BspTree.Factor.balancedRays", optFloat, "bsp_factor_balanced_rays=", "1.0");
|
---|
| 1841 | RegisterOption("BspTree.Factor.pvs", optFloat, "bsp_factor_pvs=", "1.0");
|
---|
[408] | 1842 |
|
---|
| 1843 |
|
---|
[2048] | 1844 |
|
---|
| 1845 |
|
---|
| 1846 | /**********************************************************************/
|
---|
| 1847 | /* Preprocessor related options */
|
---|
| 1848 | /**********************************************************************/
|
---|
| 1849 |
|
---|
[508] | 1850 | RegisterOption("Preprocessor.type",
|
---|
| 1851 | optString,
|
---|
| 1852 | "preprocessor=",
|
---|
| 1853 | "sampling");
|
---|
[408] | 1854 |
|
---|
[1771] | 1855 | RegisterOption("Preprocessor.stats",
|
---|
| 1856 | optString,
|
---|
| 1857 | "preprocessor_stats=",
|
---|
| 1858 | "stats.log");
|
---|
| 1859 |
|
---|
[508] | 1860 | RegisterOption("Preprocessor.samplesFilename",
|
---|
| 1861 | optString,
|
---|
[676] | 1862 | "preprocessor_samples_filename=",
|
---|
[508] | 1863 | "rays.out");
|
---|
[408] | 1864 |
|
---|
[1379] | 1865 | RegisterOption("Preprocessor.loadMeshes",
|
---|
[658] | 1866 | optBool,
|
---|
[1942] | 1867 | "preprocessor_load_meshes",
|
---|
[1379] | 1868 | "true");
|
---|
[658] | 1869 |
|
---|
[1785] | 1870 | RegisterOption("Preprocessor.evaluateFilter",
|
---|
| 1871 | optBool,
|
---|
[1942] | 1872 | "preprocessor_evaluate_filter",
|
---|
[1785] | 1873 | "false");
|
---|
| 1874 |
|
---|
[1613] | 1875 | RegisterOption("Preprocessor.delayVisibilityComputation",
|
---|
| 1876 | optBool,
|
---|
[1942] | 1877 | "preprocessor_delay_computation",
|
---|
[1613] | 1878 | "true");
|
---|
| 1879 |
|
---|
[563] | 1880 | RegisterOption("Preprocessor.pvsRenderErrorSamples",
|
---|
| 1881 | optInt,
|
---|
[1444] | 1882 | "preprocessor_pvs_rendererror_samples=",
|
---|
[563] | 1883 | "10000");
|
---|
[682] | 1884 |
|
---|
| 1885 | RegisterOption("Preprocessor.useGlRenderer",
|
---|
| 1886 | optBool,
|
---|
[1942] | 1887 | "preprocessor_use_gl_renderer",
|
---|
[682] | 1888 | "false");
|
---|
| 1889 |
|
---|
[538] | 1890 | RegisterOption("Preprocessor.useGlDebugger",
|
---|
| 1891 | optBool,
|
---|
[1942] | 1892 | "preprocessor_use_gl_debugger",
|
---|
[538] | 1893 | "false");
|
---|
| 1894 |
|
---|
[534] | 1895 | RegisterOption("Preprocessor.detectEmptyViewSpace",
|
---|
| 1896 | optBool,
|
---|
[1942] | 1897 | "preprocessor_detect_empty_viewspace",
|
---|
[534] | 1898 | "false");
|
---|
| 1899 |
|
---|
[599] | 1900 | RegisterOption("Preprocessor.quitOnFinish",
|
---|
| 1901 | optBool,
|
---|
[1942] | 1902 | "preprocessor_quit_on_finish",
|
---|
[599] | 1903 | "true");
|
---|
[534] | 1904 |
|
---|
[685] | 1905 | RegisterOption("Preprocessor.computeVisibility",
|
---|
| 1906 | optBool,
|
---|
[1942] | 1907 | "preprocessor_compute_visibility",
|
---|
[685] | 1908 | "true");
|
---|
[682] | 1909 |
|
---|
[871] | 1910 | RegisterOption("Preprocessor.exportVisibility",
|
---|
| 1911 | optBool,
|
---|
[1942] | 1912 | "preprocessor_export_visibility",
|
---|
[871] | 1913 | "true");
|
---|
[682] | 1914 |
|
---|
[871] | 1915 | RegisterOption("Preprocessor.visibilityFile",
|
---|
| 1916 | optString,
|
---|
| 1917 | "preprocessor_visibility_file=",
|
---|
| 1918 | "visibility.xml");
|
---|
| 1919 |
|
---|
| 1920 | RegisterOption("Preprocessor.applyVisibilityFilter",
|
---|
| 1921 | optBool,
|
---|
[1942] | 1922 | "preprocessor_apply_filter",
|
---|
[1756] | 1923 | "false");
|
---|
[904] | 1924 |
|
---|
[2048] | 1925 | RegisterOption("Preprocessor.evaluatePixelError",
|
---|
| 1926 | optBool,
|
---|
| 1927 | "preprocessor_evaluatePixelError",
|
---|
| 1928 | "false");
|
---|
| 1929 |
|
---|
[904] | 1930 | RegisterOption("Preprocessor.applyVisibilitySpatialFilter",
|
---|
| 1931 | optBool,
|
---|
[1942] | 1932 | "preprocessor_apply_spatial_filter",
|
---|
[1756] | 1933 | "false");
|
---|
[871] | 1934 |
|
---|
[878] | 1935 | RegisterOption("Preprocessor.visibilityFilterWidth",
|
---|
| 1936 | optFloat,
|
---|
| 1937 | "preprocessor_visibility_filter_width=",
|
---|
| 1938 | "0.02");
|
---|
[871] | 1939 |
|
---|
[991] | 1940 | RegisterOption("Preprocessor.histogram.maxValue",
|
---|
| 1941 | optInt,
|
---|
| 1942 | "preprocessor_histogram_max_value=",
|
---|
| 1943 | "1000");
|
---|
[871] | 1944 |
|
---|
[1221] | 1945 | RegisterOption("Preprocessor.rayCastMethod",
|
---|
| 1946 | optInt,
|
---|
| 1947 | "preprocessor_ray_cast_method=",
|
---|
| 1948 | "0");
|
---|
| 1949 |
|
---|
[991] | 1950 | RegisterOption("Preprocessor.histogram.intervals",
|
---|
| 1951 | optInt,
|
---|
| 1952 | "preprocessor_histogram_intervals=",
|
---|
| 1953 | "20");
|
---|
[878] | 1954 |
|
---|
[1771] | 1955 | RegisterOption("Preprocessor.histogram.file",
|
---|
| 1956 | optString,
|
---|
| 1957 | "preprocessor_histogram_file=",
|
---|
| 1958 | "histogram.log");
|
---|
| 1959 |
|
---|
[1414] | 1960 | RegisterOption("Preprocessor.exportKdTree",
|
---|
| 1961 | optBool,
|
---|
| 1962 | "preprocessor_export_kd_tree=",
|
---|
| 1963 | "false");
|
---|
[991] | 1964 |
|
---|
[1414] | 1965 | RegisterOption("Preprocessor.loadKdTree",
|
---|
| 1966 | optBool,
|
---|
| 1967 | "preprocessor_load_kd_tree=",
|
---|
| 1968 | "false");
|
---|
| 1969 |
|
---|
[1415] | 1970 | RegisterOption("Preprocessor.kdTreeFilename",
|
---|
| 1971 | optString,
|
---|
| 1972 | "preprocessor_kd_tree_filename=",
|
---|
| 1973 | "vienna_kdtree.bin.gz");
|
---|
[1414] | 1974 |
|
---|
[1695] | 1975 | RegisterOption("Preprocessor.exportObj",
|
---|
| 1976 | optBool,
|
---|
| 1977 | "preprocessor_export_obj=",
|
---|
| 1978 | "false");
|
---|
| 1979 |
|
---|
[1723] | 1980 | RegisterOption("Preprocessor.useViewSpaceBox",
|
---|
[1923] | 1981 | optBool,
|
---|
| 1982 | "preprocessor_use_viewspace_box=",
|
---|
| 1983 | "false");
|
---|
[1900] | 1984 |
|
---|
[2008] | 1985 | RegisterOption("Preprocessor.Export.rays", optBool, "export_rays", "false");
|
---|
| 1986 | RegisterOption("Preprocessor.Export.animation", optBool, "export_animation", "false");
|
---|
| 1987 | RegisterOption("Preprocessor.Export.numRays", optInt, "export_num_rays=", "5000");
|
---|
[1723] | 1988 |
|
---|
[1415] | 1989 | /*************************************************************************/
|
---|
| 1990 | /* VSS Preprocessor cells related options */
|
---|
| 1991 | /*************************************************************************/
|
---|
[1414] | 1992 |
|
---|
[469] | 1993 | RegisterOption("VssTree.maxDepth", optInt, "kd_depth=", "12");
|
---|
| 1994 | RegisterOption("VssTree.minPvs", optInt, "kd_minpvs=", "1");
|
---|
| 1995 | RegisterOption("VssTree.minRays", optInt, "kd_minrays=", "10");
|
---|
| 1996 | RegisterOption("VssTree.maxCostRatio", optFloat, "maxcost=", "0.95");
|
---|
| 1997 | RegisterOption("VssTree.maxRayContribution", optFloat, "maxraycontrib=", "0.5");
|
---|
[382] | 1998 |
|
---|
[469] | 1999 | RegisterOption("VssTree.epsilon", optFloat, "kd_eps=", "1e-6");
|
---|
| 2000 | RegisterOption("VssTree.ct_div_ci", optFloat, "kd_ctdivci=", "1.0");
|
---|
| 2001 | RegisterOption("VssTree.randomize", optBool, "randomize", "false");
|
---|
| 2002 | RegisterOption("VssTree.splitType", optString, "split=", "queries");
|
---|
| 2003 | RegisterOption("VssTree.splitUseOnlyDrivingAxis", optBool, "splitdriving=", "false");
|
---|
| 2004 | RegisterOption("VssTree.useRss", optBool, "rss=", "false");
|
---|
| 2005 | RegisterOption("VssTree.numberOfEndPointDomains", optInt, "endpoints=", "10000");
|
---|
[382] | 2006 |
|
---|
[469] | 2007 | RegisterOption("VssTree.minSize", optFloat, "minsize=", "0.001");
|
---|
[382] | 2008 |
|
---|
[469] | 2009 | RegisterOption("VssTree.maxTotalMemory", optFloat, "mem=", "60.0");
|
---|
| 2010 | RegisterOption("VssTree.maxStaticMemory", optFloat, "statmem=", "8.0");
|
---|
[438] | 2011 |
|
---|
[469] | 2012 | RegisterOption("VssTree.queryType", optString, "qtype=", "static");
|
---|
[438] | 2013 |
|
---|
[532] | 2014 |
|
---|
| 2015 |
|
---|
[469] | 2016 | RegisterOption("VssTree.queryPosWeight", optFloat, "qposweight=", "0.0");
|
---|
[997] | 2017 | RegisterOption("VssTree.useRefDirSplits", optBool, "refdir=", "false");
|
---|
[469] | 2018 | RegisterOption("VssTree.refDirAngle", optFloat, "refangle=", "10");
|
---|
| 2019 | RegisterOption("VssTree.refDirBoxMaxSize", optFloat, "refboxsize=", "0.1");
|
---|
| 2020 | RegisterOption("VssTree.accessTimeThreshold", optInt, "accesstime=", "1000");
|
---|
| 2021 | RegisterOption("VssTree.minCollapseDepth", optInt, "colldepth=", "4");
|
---|
[446] | 2022 |
|
---|
[469] | 2023 | RegisterOption("VssTree.interleaveDirSplits", optBool, "interleavedirsplits", "true");
|
---|
| 2024 | RegisterOption("VssTree.dirSplitDepth", optInt, "dirsplidepth=", "10");
|
---|
| 2025 |
|
---|
| 2026 |
|
---|
[1966] | 2027 | // RegisterOption("RssPreprocessor.initialSamples",
|
---|
| 2028 | // optInt,
|
---|
| 2029 | // "rss_initial_samples=",
|
---|
| 2030 | // "100000");
|
---|
[469] | 2031 |
|
---|
[1966] | 2032 | // RegisterOption("RssPreprocessor.vssSamples",
|
---|
| 2033 | // optInt,
|
---|
| 2034 | // "rss_vss_samples=",
|
---|
| 2035 | // "1000000");
|
---|
[508] | 2036 |
|
---|
[1966] | 2037 | // RegisterOption("RssPreprocessor.vssSamplesPerPass",
|
---|
| 2038 | // optInt,
|
---|
| 2039 | // "rss_vss_samples_per_pass=",
|
---|
| 2040 | // "1000");
|
---|
[508] | 2041 |
|
---|
[1966] | 2042 | // RegisterOption("RssPreprocessor.samplesPerPass",
|
---|
| 2043 | // optInt,
|
---|
| 2044 | // "rss_samples_per_pass=",
|
---|
| 2045 | // "100000");
|
---|
[508] | 2046 |
|
---|
[469] | 2047 | RegisterOption("RssPreprocessor.useImportanceSampling",
|
---|
[508] | 2048 | optBool,
|
---|
[1112] | 2049 | "rss_use_importance",
|
---|
[508] | 2050 | "true");
|
---|
| 2051 |
|
---|
[1785] | 2052 | RegisterOption("RssPreprocessor.useRssTree",
|
---|
| 2053 | optBool,
|
---|
| 2054 | "rss_use_rss_tree",
|
---|
| 2055 | "true");
|
---|
| 2056 |
|
---|
[492] | 2057 | RegisterOption("RssPreprocessor.objectBasedSampling",
|
---|
[508] | 2058 | optBool,
|
---|
[1112] | 2059 | "rss_object_based_sampling",
|
---|
[508] | 2060 | "true");
|
---|
| 2061 |
|
---|
[492] | 2062 | RegisterOption("RssPreprocessor.directionalSampling",
|
---|
[508] | 2063 | optBool,
|
---|
[1112] | 2064 | "rss_directional_sampling",
|
---|
[508] | 2065 | "false");
|
---|
| 2066 |
|
---|
[1877] | 2067 | RegisterOption("RssPreprocessor.distributions",
|
---|
| 2068 | optString,
|
---|
| 2069 | "rss_distributions=",
|
---|
| 2070 | "rss+spatial+object");
|
---|
| 2071 |
|
---|
[1199] | 2072 | RegisterOption("RssTree.hybridDepth", optInt, "hybrid_depth=", "10");
|
---|
[469] | 2073 | RegisterOption("RssTree.maxDepth", optInt, "kd_depth=", "12");
|
---|
| 2074 | RegisterOption("RssTree.minPvs", optInt, "kd_minpvs=", "1");
|
---|
| 2075 | RegisterOption("RssTree.minRays", optInt, "kd_minrays=", "10");
|
---|
| 2076 | RegisterOption("RssTree.maxCostRatio", optFloat, "maxcost=", "0.95");
|
---|
| 2077 | RegisterOption("RssTree.maxRayContribution", optFloat, "maxraycontrib=", "0.5");
|
---|
[508] | 2078 |
|
---|
[469] | 2079 | RegisterOption("RssTree.epsilon", optFloat, "kd_eps=", "1e-6");
|
---|
| 2080 | RegisterOption("RssTree.ct_div_ci", optFloat, "kd_ctdivci=", "1.0");
|
---|
[997] | 2081 | RegisterOption("RssTree.randomize", optBool, "randomize=", "false");
|
---|
[1199] | 2082 | RegisterOption("RssTree.splitType", optString, "rss_split=", "queries");
|
---|
[469] | 2083 | RegisterOption("RssTree.splitUseOnlyDrivingAxis", optBool, "splitdriving=", "false");
|
---|
[508] | 2084 |
|
---|
[469] | 2085 | RegisterOption("RssTree.numberOfEndPointDomains", optInt, "endpoints=", "10000");
|
---|
[508] | 2086 |
|
---|
[469] | 2087 | RegisterOption("RssTree.minSize", optFloat, "minsize=", "0.001");
|
---|
[508] | 2088 |
|
---|
[469] | 2089 | RegisterOption("RssTree.maxTotalMemory", optFloat, "mem=", "60.0");
|
---|
| 2090 | RegisterOption("RssTree.maxStaticMemory", optFloat, "statmem=", "8.0");
|
---|
[508] | 2091 |
|
---|
[469] | 2092 | RegisterOption("RssTree.queryType", optString, "qtype=", "static");
|
---|
[508] | 2093 |
|
---|
[469] | 2094 | RegisterOption("RssTree.queryPosWeight", optFloat, "qposweight=", "0.0");
|
---|
| 2095 | RegisterOption("RssTree.useRefDirSplits", optBool, "refdir", "false");
|
---|
| 2096 | RegisterOption("RssTree.refDirAngle", optFloat, "refangle=", "10");
|
---|
| 2097 | RegisterOption("RssTree.refDirBoxMaxSize", optFloat, "refboxsize=", "0.1");
|
---|
| 2098 | RegisterOption("RssTree.accessTimeThreshold", optInt, "accesstime=", "1000");
|
---|
| 2099 | RegisterOption("RssTree.minCollapseDepth", optInt, "colldepth=", "4");
|
---|
[508] | 2100 |
|
---|
[997] | 2101 | RegisterOption("RssTree.interleaveDirSplits", optBool, "interleavedirsplits=", "true");
|
---|
[469] | 2102 | RegisterOption("RssTree.dirSplitDepth", optInt, "dirsplidepth=", "10");
|
---|
[997] | 2103 | RegisterOption("RssTree.importanceBasedCost", optBool, "importance_based_cost=", "true");
|
---|
[492] | 2104 | RegisterOption("RssTree.maxRays", optInt, "rss_max_rays=", "2000000");
|
---|
[508] | 2105 |
|
---|
[516] | 2106 | RegisterOption("RssTree.perObjectTree", optBool, "rss_per_object_tree", "false");
|
---|
| 2107 |
|
---|
[997] | 2108 | RegisterOption("RssPreprocessor.Export.pvs", optBool, "rss_export_pvs=", "false");
|
---|
| 2109 | RegisterOption("RssPreprocessor.Export.rssTree", optBool, "rss_export_rss_tree=", "false");
|
---|
[1900] | 2110 |
|
---|
[997] | 2111 | RegisterOption("RssPreprocessor.useViewcells", optBool, "rss_use_viewcells=", "false");
|
---|
[563] | 2112 | RegisterOption("RssPreprocessor.updateSubdivision",
|
---|
| 2113 | optBool,
|
---|
[997] | 2114 | "rss_update_subdivision=",
|
---|
[563] | 2115 | "false");
|
---|
[463] | 2116 |
|
---|
[492] | 2117 |
|
---|
[508] | 2118 | /************************************************************************************/
|
---|
[1023] | 2119 | /* Rss preprocessor related options */
|
---|
[508] | 2120 | /************************************************************************************/
|
---|
| 2121 |
|
---|
| 2122 |
|
---|
[490] | 2123 | RegisterOption("RssPreprocessor.loadInitialSamples",
|
---|
[508] | 2124 | optBool,
|
---|
| 2125 | "vss_load_loadInitialSamples=",
|
---|
| 2126 | "false");
|
---|
[445] | 2127 |
|
---|
[490] | 2128 | RegisterOption("RssPreprocessor.storeInitialSamples",
|
---|
[508] | 2129 | optBool,
|
---|
| 2130 | "vss_store_storeInitialSamples=",
|
---|
| 2131 | "false");
|
---|
[490] | 2132 |
|
---|
[508] | 2133 |
|
---|
| 2134 | /************************************************************************************/
|
---|
[1023] | 2135 | /* View space partition BSP tree related options */
|
---|
[508] | 2136 | /************************************************************************************/
|
---|
| 2137 |
|
---|
[654] | 2138 | RegisterOption("VspBspTree.Termination.minGlobalCostRatio",
|
---|
| 2139 | optFloat,
|
---|
[997] | 2140 | "vsp_bsp_term_min_global_cost_ratio=",
|
---|
[654] | 2141 | "0.0001");
|
---|
[508] | 2142 |
|
---|
[655] | 2143 | RegisterOption("VspBspTree.useSplitCostQueue",
|
---|
[1902] | 2144 | optBool,
|
---|
| 2145 | "vsp_bsp_use_split_cost_queue=",
|
---|
| 2146 | "true");
|
---|
[655] | 2147 |
|
---|
[654] | 2148 | RegisterOption("VspBspTree.Termination.globalCostMissTolerance",
|
---|
| 2149 | optInt,
|
---|
[997] | 2150 | "vsp_bsp_term_global_cost_miss_tolerance=",
|
---|
[654] | 2151 | "4");
|
---|
| 2152 |
|
---|
[469] | 2153 | RegisterOption("VspBspTree.Termination.minPolygons",
|
---|
[508] | 2154 | optInt,
|
---|
| 2155 | "vsp_bsp_term_min_polygons=",
|
---|
[1134] | 2156 | "-1");
|
---|
[445] | 2157 |
|
---|
[469] | 2158 | RegisterOption("VspBspTree.Termination.minPvs",
|
---|
[508] | 2159 | optInt,
|
---|
| 2160 | "vsp_bsp_term_min_pvs=",
|
---|
| 2161 | "20");
|
---|
[660] | 2162 |
|
---|
[547] | 2163 | RegisterOption("VspBspTree.Termination.minProbability",
|
---|
[508] | 2164 | optFloat,
|
---|
[547] | 2165 | "vsp_bsp_term_min_probability=",
|
---|
[508] | 2166 | "0.001");
|
---|
[445] | 2167 |
|
---|
[660] | 2168 | RegisterOption("VspBspTree.subdivisionStats",
|
---|
| 2169 | optString,
|
---|
| 2170 | "vsp_bsp_subdivision_stats=",
|
---|
| 2171 | "vspBspSubdivisionStats.log");
|
---|
| 2172 |
|
---|
[469] | 2173 | RegisterOption("VspBspTree.Termination.maxRayContribution",
|
---|
[508] | 2174 | optFloat,
|
---|
| 2175 | "vsp_bsp_term_ray_contribution=",
|
---|
[1134] | 2176 | "2");
|
---|
[463] | 2177 |
|
---|
[469] | 2178 | RegisterOption("VspBspTree.Termination.minAccRayLenght",
|
---|
[508] | 2179 | optFloat,
|
---|
| 2180 | "vsp_bsp_term_min_acc_ray_length=",
|
---|
| 2181 | "50");
|
---|
[445] | 2182 |
|
---|
[469] | 2183 | RegisterOption("VspBspTree.Termination.minRays",
|
---|
[508] | 2184 | optInt,
|
---|
| 2185 | "vsp_bsp_term_min_rays=",
|
---|
| 2186 | "-1");
|
---|
[445] | 2187 |
|
---|
[469] | 2188 | RegisterOption("VspBspTree.Termination.ct_div_ci",
|
---|
[508] | 2189 | optFloat,
|
---|
| 2190 | "vsp_bsp_term_ct_div_ci=",
|
---|
| 2191 | "0.0");
|
---|
[445] | 2192 |
|
---|
[469] | 2193 | RegisterOption("VspBspTree.Termination.maxDepth",
|
---|
[508] | 2194 | optInt,
|
---|
| 2195 | "vsp_bsp_term_max_depth=",
|
---|
[1134] | 2196 | "50");
|
---|
[445] | 2197 |
|
---|
[469] | 2198 | RegisterOption("VspBspTree.Termination.AxisAligned.maxCostRatio",
|
---|
[2124] | 2199 | optFloat,
|
---|
| 2200 | "vsp_bsp_term_axis_aligned_max_cost_ratio=",
|
---|
| 2201 | "1.5");
|
---|
[445] | 2202 |
|
---|
[612] | 2203 | RegisterOption("VspBspTree.useCostHeuristics",
|
---|
[2124] | 2204 | optBool,
|
---|
| 2205 | "vsp_bsp_use_cost_heuristics=",
|
---|
| 2206 | "false");
|
---|
[612] | 2207 |
|
---|
[478] | 2208 | RegisterOption("VspBspTree.Termination.maxViewCells",
|
---|
[2124] | 2209 | optInt,
|
---|
| 2210 | "vsp_bsp_term_max_view_cells=",
|
---|
| 2211 | "10000");
|
---|
[478] | 2212 |
|
---|
[472] | 2213 | RegisterOption("VspBspTree.Termination.maxCostRatio",
|
---|
[2124] | 2214 | optFloat,
|
---|
| 2215 | "vsp_bsp_term_max_cost_ratio=",
|
---|
| 2216 | "1.5");
|
---|
[445] | 2217 |
|
---|
[472] | 2218 | RegisterOption("VspBspTree.Termination.missTolerance",
|
---|
[2124] | 2219 | optInt,
|
---|
| 2220 | "vsp_bsp_term_miss_tolerance=",
|
---|
| 2221 | "4");
|
---|
[997] | 2222 |
|
---|
[469] | 2223 | RegisterOption("VspBspTree.splitPlaneStrategy",
|
---|
[1134] | 2224 | optInt,
|
---|
[508] | 2225 | "vsp_bsp_split_method=",
|
---|
[1134] | 2226 | "1026");
|
---|
[448] | 2227 |
|
---|
[469] | 2228 | RegisterOption("VspBspTree.maxPolyCandidates",
|
---|
[508] | 2229 | optInt,
|
---|
| 2230 | "vsp_bsp_max_poly_candidates=",
|
---|
| 2231 | "20");
|
---|
[1134] | 2232 |
|
---|
[469] | 2233 | RegisterOption("VspBspTree.maxRayCandidates",
|
---|
[508] | 2234 | optInt,
|
---|
| 2235 | "vsp_bsp_max_plane_candidates=",
|
---|
| 2236 | "20");
|
---|
[469] | 2237 |
|
---|
| 2238 | RegisterOption("VspBspTree.maxTests",
|
---|
[508] | 2239 | optInt,
|
---|
| 2240 | "vsp_bsp_max_tests=",
|
---|
| 2241 | "5000");
|
---|
[469] | 2242 |
|
---|
| 2243 | RegisterOption("VspBspTree.Construction.samples",
|
---|
[508] | 2244 | optInt,
|
---|
[673] | 2245 | "vsp_bsp_construction_samples=",
|
---|
[508] | 2246 | "100000");
|
---|
[469] | 2247 |
|
---|
[801] | 2248 | RegisterOption("VspBspTree.Construction.minBand",
|
---|
| 2249 | optFloat,
|
---|
| 2250 | "vsp_bsp_construction_min_band=",
|
---|
[1074] | 2251 | "0.01");
|
---|
[801] | 2252 |
|
---|
| 2253 | RegisterOption("VspBspTree.Construction.maxBand",
|
---|
| 2254 | optFloat,
|
---|
[1147] | 2255 | "vsp_bsp_construction_max_band=",
|
---|
[1074] | 2256 | "0.99");
|
---|
[801] | 2257 |
|
---|
[822] | 2258 | RegisterOption("VspBspTree.Construction.useDrivingAxisForMaxCost",
|
---|
| 2259 | optBool,
|
---|
| 2260 | "vsp_bsp_construction_use_drivingaxis_for_maxcost=",
|
---|
| 2261 | "false");
|
---|
| 2262 |
|
---|
[469] | 2263 | RegisterOption("VspBspTree.Construction.epsilon",
|
---|
[508] | 2264 | optFloat,
|
---|
[1023] | 2265 | "vsp_bsp_construction_epsilon=",
|
---|
[508] | 2266 | "0.002");
|
---|
[469] | 2267 |
|
---|
| 2268 | RegisterOption("VspBspTree.Visualization.exportSplits",
|
---|
[508] | 2269 | optBool,
|
---|
| 2270 | "vsp_bsp_visualization.export_splits",
|
---|
| 2271 | "false");
|
---|
| 2272 |
|
---|
[485] | 2273 | RegisterOption("VspBspTree.splitUseOnlyDrivingAxis",
|
---|
[508] | 2274 | optBool,
|
---|
[667] | 2275 | "vsp_bsp_split_only_driving_axis=",
|
---|
[508] | 2276 | "false");
|
---|
| 2277 |
|
---|
[607] | 2278 | RegisterOption("VspBspTree.usePolygonSplitIfAvailable",
|
---|
| 2279 | optBool,
|
---|
| 2280 | "vsp_bsp_usePolygonSplitIfAvailable=",
|
---|
[611] | 2281 | "false");
|
---|
[607] | 2282 |
|
---|
[508] | 2283 | RegisterOption("VspBspTree.Termination.AxisAligned.minRays",
|
---|
| 2284 | optInt,
|
---|
| 2285 | "bsp_term_axis_aligned_min_rays=",
|
---|
[1134] | 2286 | "0");
|
---|
[492] | 2287 |
|
---|
[508] | 2288 | RegisterOption("VspBspTree.Termination.AxisAligned.maxRayContribution",
|
---|
| 2289 | optFloat,
|
---|
| 2290 | "bsp_term_axis_aligned_min_rays=",
|
---|
[1134] | 2291 | "2");
|
---|
[508] | 2292 |
|
---|
[676] | 2293 | RegisterOption("VspBspTree.Factor.leastRaySplits",
|
---|
| 2294 | optFloat,
|
---|
| 2295 | "vsp_bsp_factor_least_ray_splits=",
|
---|
| 2296 | "1.0");
|
---|
| 2297 |
|
---|
| 2298 | RegisterOption("VspBspTree.Factor.balancedRays",
|
---|
| 2299 | optFloat,
|
---|
| 2300 | "vsp_bsp_factor_balanced_rays=",
|
---|
| 2301 | "1.0");
|
---|
| 2302 |
|
---|
| 2303 | RegisterOption("VspBspTree.Factor.pvs",
|
---|
| 2304 | optFloat,
|
---|
| 2305 | "vsp_bsp_factor_pvs=",
|
---|
| 2306 | "1.0");
|
---|
[664] | 2307 |
|
---|
[580] | 2308 | RegisterOption("VspBspTree.Construction.renderCostWeight",
|
---|
[478] | 2309 | optFloat,
|
---|
[1002] | 2310 | "vsp_bsp_post_process_render_cost_weight=",
|
---|
[1134] | 2311 | "1.0");
|
---|
[478] | 2312 |
|
---|
[1020] | 2313 | RegisterOption("VspBspTree.Construction.renderCostDecreaseWeight",
|
---|
| 2314 | optFloat,
|
---|
[1121] | 2315 | "vsp_bsp_construction_render_cost_decrease_weight=",
|
---|
[1020] | 2316 | "0.99");
|
---|
| 2317 |
|
---|
[486] | 2318 | RegisterOption("VspBspTree.Construction.randomize",
|
---|
| 2319 | optBool,
|
---|
| 2320 | "vsp_bsp_construction_randomize=",
|
---|
| 2321 | "false");
|
---|
[508] | 2322 |
|
---|
[663] | 2323 | RegisterOption("VspBspTree.simulateOctree",
|
---|
| 2324 | optBool,
|
---|
| 2325 | "vsp_bsp_simulate_octree=",
|
---|
| 2326 | "false");
|
---|
| 2327 |
|
---|
[735] | 2328 | RegisterOption("VspBspTree.nodePriorityQueueType",
|
---|
| 2329 | optInt,
|
---|
| 2330 | "vsp_bsp_node_queue_type=",
|
---|
| 2331 | "0");
|
---|
[664] | 2332 |
|
---|
| 2333 | RegisterOption("VspBspTree.useRandomAxis",
|
---|
| 2334 | optBool,
|
---|
| 2335 | "-vsp_bsp_use_random_axis=",
|
---|
| 2336 | "false");
|
---|
| 2337 |
|
---|
[508] | 2338 | RegisterOption("VspBspTree.maxTotalMemory",
|
---|
| 2339 | optFloat,
|
---|
| 2340 | "vsp_bsp_max_total_mem=",
|
---|
| 2341 | "60.0");
|
---|
| 2342 |
|
---|
| 2343 | RegisterOption("VspBspTree.maxStaticMemory",
|
---|
| 2344 | optFloat,
|
---|
| 2345 | "vsp_bsp_max_static_mem=",
|
---|
| 2346 | "8.0");
|
---|
[564] | 2347 |
|
---|
[1023] | 2348 |
|
---|
| 2349 |
|
---|
[1027] | 2350 | /***************************************************************************/
|
---|
| 2351 | /* View space partition tree related options */
|
---|
| 2352 | /***************************************************************************/
|
---|
[1023] | 2353 |
|
---|
[580] | 2354 |
|
---|
[1027] | 2355 | RegisterOption("VspTree.Construction.samples",
|
---|
| 2356 | optInt,
|
---|
| 2357 | "vsp_construction_samples=",
|
---|
| 2358 | "10000");
|
---|
| 2359 |
|
---|
[1121] | 2360 | RegisterOption("VspTree.Construction.renderCostDecreaseWeight",
|
---|
[1576] | 2361 | optFloat,
|
---|
| 2362 | "vsp_construction_render_cost_decrease_weight=",
|
---|
[1665] | 2363 | "0.99");
|
---|
[1121] | 2364 |
|
---|
[1023] | 2365 | RegisterOption("VspTree.Termination.maxDepth",
|
---|
| 2366 | optInt,
|
---|
| 2367 | "vsp_term_max_depth=",
|
---|
| 2368 | "100");
|
---|
| 2369 |
|
---|
| 2370 | RegisterOption("VspTree.Termination.minRays",
|
---|
| 2371 | optInt,
|
---|
| 2372 | "vsp_term_min_rays=",
|
---|
| 2373 | "-1");
|
---|
| 2374 |
|
---|
| 2375 |
|
---|
| 2376 | RegisterOption("VspTree.Termination.minPvs",
|
---|
| 2377 | optInt,
|
---|
| 2378 | "vsp_term_min_pvs=",
|
---|
| 2379 | "20");
|
---|
| 2380 |
|
---|
| 2381 | RegisterOption("VspTree.Termination.minProbability",
|
---|
| 2382 | optFloat,
|
---|
| 2383 | "vsp_term_min_probability=",
|
---|
[1576] | 2384 | "0.0000001");
|
---|
[1023] | 2385 |
|
---|
| 2386 | RegisterOption("VspTree.Termination.maxRayContribution",
|
---|
[1576] | 2387 | optFloat,
|
---|
| 2388 | "vsp_term_ray_contribution=",
|
---|
| 2389 | "0.9");
|
---|
[1023] | 2390 |
|
---|
| 2391 | RegisterOption("VspTree.Termination.maxCostRatio",
|
---|
[1576] | 2392 | optFloat,
|
---|
| 2393 | "vsp_term_max_cost_ratio=",
|
---|
| 2394 | "1.5");
|
---|
[1023] | 2395 |
|
---|
| 2396 | RegisterOption("VspTree.Termination.maxViewCells",
|
---|
[1576] | 2397 | optInt,
|
---|
| 2398 | "vsp_term_max_view_cells=",
|
---|
| 2399 | "10000");
|
---|
[564] | 2400 |
|
---|
[1023] | 2401 |
|
---|
| 2402 | RegisterOption("VspTree.Termination.missTolerance",
|
---|
[1576] | 2403 | optInt,
|
---|
| 2404 | "vsp_term_miss_tolerance=",
|
---|
| 2405 | "4");
|
---|
[1023] | 2406 |
|
---|
| 2407 | RegisterOption("VspTree.Termination.minGlobalCostRatio",
|
---|
| 2408 | optFloat,
|
---|
| 2409 | "vsp_term_min_global_cost_ratio=",
|
---|
| 2410 | "0.0001");
|
---|
| 2411 |
|
---|
| 2412 | RegisterOption("VspTree.Termination.globalCostMissTolerance",
|
---|
| 2413 | optInt,
|
---|
| 2414 | "vsp_term_global_cost_miss_tolerance=",
|
---|
| 2415 | "4");
|
---|
| 2416 |
|
---|
| 2417 | RegisterOption("VspTree.Termination.ct_div_ci",
|
---|
| 2418 | optFloat,
|
---|
| 2419 | "vsp_term_ct_div_ci=",
|
---|
| 2420 | "0.0");
|
---|
| 2421 |
|
---|
| 2422 | RegisterOption("VspTree.Construction.epsilon",
|
---|
| 2423 | optFloat,
|
---|
| 2424 | "vsp_construction_epsilon=",
|
---|
| 2425 | "0.002");
|
---|
| 2426 |
|
---|
| 2427 | RegisterOption("VspTree.splitUseOnlyDrivingAxis",
|
---|
| 2428 | optBool,
|
---|
| 2429 | "vsp_split_only_driving_axis=",
|
---|
| 2430 | "false");
|
---|
| 2431 |
|
---|
| 2432 | RegisterOption("VspTree.maxStaticMemory",
|
---|
[1576] | 2433 | optFloat,
|
---|
| 2434 | "vsp_max_static_mem=",
|
---|
| 2435 | "8.0");
|
---|
[1023] | 2436 |
|
---|
| 2437 | RegisterOption("VspTree.useCostHeuristics",
|
---|
[1576] | 2438 | optBool,
|
---|
| 2439 | "vsp_use_cost_heuristics=",
|
---|
| 2440 | "false");
|
---|
[1023] | 2441 |
|
---|
| 2442 | RegisterOption("VspTree.simulateOctree",
|
---|
[1576] | 2443 | optBool,
|
---|
| 2444 | "vsp_simulate_octree=",
|
---|
| 2445 | "false");
|
---|
[1023] | 2446 |
|
---|
| 2447 | RegisterOption("VspTree.Construction.randomize",
|
---|
[1576] | 2448 | optBool,
|
---|
| 2449 | "vsp_construction_randomize=",
|
---|
| 2450 | "false");
|
---|
[1023] | 2451 |
|
---|
| 2452 | RegisterOption("VspTree.subdivisionStats",
|
---|
| 2453 | optString,
|
---|
| 2454 | "vsp_subdivision_stats=",
|
---|
| 2455 | "vspSubdivisionStats.log");
|
---|
| 2456 |
|
---|
| 2457 | RegisterOption("VspTree.Construction.minBand",
|
---|
| 2458 | optFloat,
|
---|
| 2459 | "vsp_construction_min_band=",
|
---|
[1074] | 2460 | "0.01");
|
---|
[1023] | 2461 |
|
---|
| 2462 | RegisterOption("VspTree.Construction.maxBand",
|
---|
| 2463 | optFloat,
|
---|
[1074] | 2464 | "vsp_construction_max_band=",
|
---|
| 2465 | "0.99");
|
---|
[1106] | 2466 |
|
---|
[1149] | 2467 | RegisterOption("VspTree.maxTests",
|
---|
| 2468 | optInt,
|
---|
| 2469 | "vsp_max_tests=",
|
---|
[1161] | 2470 | "5000");
|
---|
[1143] | 2471 |
|
---|
| 2472 |
|
---|
[1074] | 2473 |
|
---|
[1288] | 2474 | /***********************************************************************/
|
---|
| 2475 | /* Object space partition tree related options */
|
---|
| 2476 | /***********************************************************************/
|
---|
[1143] | 2477 |
|
---|
[1294] | 2478 |
|
---|
[1106] | 2479 | RegisterOption("OspTree.Construction.randomize",
|
---|
[1288] | 2480 | optBool,
|
---|
| 2481 | "osp_construction_randomize=",
|
---|
| 2482 | "false");
|
---|
[1106] | 2483 |
|
---|
| 2484 | RegisterOption("OspTree.Termination.maxDepth",
|
---|
| 2485 | optInt,
|
---|
| 2486 | "osp_term_max_depth=",
|
---|
| 2487 | "30");
|
---|
| 2488 |
|
---|
| 2489 | RegisterOption("OspTree.Termination.maxLeaves",
|
---|
| 2490 | optInt,
|
---|
| 2491 | "osp_term_max_leaves=",
|
---|
| 2492 | "1000");
|
---|
| 2493 |
|
---|
| 2494 | RegisterOption("OspTree.Termination.minObjects",
|
---|
| 2495 | optInt,
|
---|
| 2496 | "osp_term_min_objects=",
|
---|
| 2497 | "1");
|
---|
| 2498 |
|
---|
| 2499 | RegisterOption("OspTree.Termination.minProbability",
|
---|
| 2500 | optFloat,
|
---|
| 2501 | "osp_term_min_objects=",
|
---|
[1288] | 2502 | "0.00001");
|
---|
[1106] | 2503 |
|
---|
| 2504 | RegisterOption("OspTree.Termination.missTolerance",
|
---|
| 2505 | optInt,
|
---|
| 2506 | "osp_term_miss_tolerance=",
|
---|
[1288] | 2507 | "8");
|
---|
[1106] | 2508 |
|
---|
| 2509 | RegisterOption("OspTree.Termination.maxCostRatio",
|
---|
| 2510 | optFloat,
|
---|
| 2511 | "osp_term_max_cost_ratio=",
|
---|
| 2512 | "0.99");
|
---|
| 2513 |
|
---|
| 2514 | RegisterOption("OspTree.Termination.minGlobalCostRatio",
|
---|
| 2515 | optFloat,
|
---|
| 2516 | "osp_term_min_global_cost_ratio=",
|
---|
| 2517 | "0.00001");
|
---|
| 2518 |
|
---|
| 2519 | RegisterOption("OspTree.Termination.globalCostMissTolerance",
|
---|
| 2520 | optInt,
|
---|
| 2521 | "osp_term_global_cost_miss_tolerance=",
|
---|
| 2522 | "4");
|
---|
| 2523 |
|
---|
| 2524 | RegisterOption("OspTree.Termination.ct_div_ci",
|
---|
| 2525 | optFloat,
|
---|
| 2526 | "osp_term_ct_div_ci=",
|
---|
| 2527 | "0");
|
---|
| 2528 |
|
---|
| 2529 | RegisterOption("OspTree.Construction.epsilon",
|
---|
[1288] | 2530 | optFloat,
|
---|
| 2531 | "osp_construction_epsilon=",
|
---|
| 2532 | "0.00001");
|
---|
[1106] | 2533 |
|
---|
| 2534 | // if only the driving axis is used for axis aligned split
|
---|
| 2535 | RegisterOption("OspTree.splitUseOnlyDrivingAxis",
|
---|
[1288] | 2536 | optBool,
|
---|
| 2537 | "osp_split_only_driving_axis=",
|
---|
| 2538 | "false");
|
---|
[1106] | 2539 |
|
---|
| 2540 | RegisterOption("OspTree.maxStaticMemory",
|
---|
[1288] | 2541 | optFloat,
|
---|
| 2542 | "osp_max_static_mem=",
|
---|
| 2543 | "8.0");
|
---|
[1106] | 2544 |
|
---|
| 2545 | RegisterOption("OspTree.useCostHeuristics",
|
---|
[1288] | 2546 | optBool,
|
---|
| 2547 | "osp_use_cost_heuristics=",
|
---|
| 2548 | "true");
|
---|
[1106] | 2549 |
|
---|
| 2550 | RegisterOption("OspTree.subdivisionStats",
|
---|
| 2551 | optString,
|
---|
| 2552 | "osp_subdivision_stats=",
|
---|
| 2553 | "ospSubdivisionStats.log");
|
---|
| 2554 |
|
---|
| 2555 | RegisterOption("OspTree.Construction.splitBorder",
|
---|
| 2556 | optFloat,
|
---|
| 2557 | "osp_construction_split_border=",
|
---|
| 2558 | "0.01");
|
---|
| 2559 |
|
---|
[1121] | 2560 | RegisterOption("OspTree.Construction.renderCostDecreaseWeight",
|
---|
[1288] | 2561 | optFloat,
|
---|
| 2562 | "osp_construction_render_cost_decrease_weight=",
|
---|
| 2563 | "0.99");
|
---|
[1106] | 2564 |
|
---|
| 2565 |
|
---|
[1288] | 2566 |
|
---|
[1297] | 2567 | /**********************************************************************/
|
---|
| 2568 | /* Bounding Volume Hierarchy related options */
|
---|
| 2569 | /**********************************************************************/
|
---|
[1288] | 2570 |
|
---|
| 2571 | RegisterOption("BvHierarchy.Construction.randomize",
|
---|
| 2572 | optBool,
|
---|
| 2573 | "bvh_construction_randomize=",
|
---|
| 2574 | "false");
|
---|
| 2575 |
|
---|
| 2576 | RegisterOption("BvHierarchy.Termination.maxDepth",
|
---|
| 2577 | optInt,
|
---|
| 2578 | "bvh_term_max_depth=",
|
---|
| 2579 | "30");
|
---|
| 2580 |
|
---|
| 2581 | RegisterOption("BvHierarchy.Termination.maxLeaves",
|
---|
| 2582 | optInt,
|
---|
| 2583 | "bvh_term_max_leaves=",
|
---|
| 2584 | "1000");
|
---|
| 2585 |
|
---|
| 2586 | RegisterOption("BvHierarchy.Termination.minObjects",
|
---|
| 2587 | optInt,
|
---|
| 2588 | "bvh_term_min_objects=",
|
---|
| 2589 | "1");
|
---|
| 2590 |
|
---|
| 2591 | RegisterOption("BvHierarchy.Termination.minProbability",
|
---|
| 2592 | optFloat,
|
---|
| 2593 | "bvh_term_min_objects=",
|
---|
[1576] | 2594 | "0.0000001");
|
---|
[1288] | 2595 |
|
---|
[1370] | 2596 | RegisterOption("BvHierarchy.Termination.minRays",
|
---|
| 2597 | optInt,
|
---|
| 2598 | "bvh_term_min_rays=",
|
---|
| 2599 | "0");
|
---|
| 2600 |
|
---|
[1288] | 2601 | RegisterOption("BvHierarchy.Termination.missTolerance",
|
---|
| 2602 | optInt,
|
---|
| 2603 | "osp_term_miss_tolerance=",
|
---|
| 2604 | "8");
|
---|
| 2605 |
|
---|
| 2606 | RegisterOption("BvHierarchy.Termination.maxCostRatio",
|
---|
| 2607 | optFloat,
|
---|
| 2608 | "bvh_term_max_cost_ratio=",
|
---|
| 2609 | "0.99");
|
---|
| 2610 |
|
---|
| 2611 | RegisterOption("BvHierarchy.Termination.minGlobalCostRatio",
|
---|
| 2612 | optFloat,
|
---|
| 2613 | "bvh_term_min_global_cost_ratio=",
|
---|
| 2614 | "0.00001");
|
---|
| 2615 |
|
---|
| 2616 | RegisterOption("BvHierarchy.Termination.globalCostMissTolerance",
|
---|
| 2617 | optInt,
|
---|
| 2618 | "bvh_term_global_cost_miss_tolerance=",
|
---|
| 2619 | "4");
|
---|
| 2620 |
|
---|
| 2621 | // if only the driving axis is used for axis aligned split
|
---|
| 2622 | RegisterOption("BvHierarchy.splitUseOnlyDrivingAxis",
|
---|
| 2623 | optBool,
|
---|
| 2624 | "bvh_split_only_driving_axis=",
|
---|
| 2625 | "false");
|
---|
| 2626 |
|
---|
| 2627 | RegisterOption("BvHierarchy.maxStaticMemory",
|
---|
| 2628 | optFloat,
|
---|
| 2629 | "bvh_max_static_mem=",
|
---|
| 2630 | "8.0");
|
---|
| 2631 |
|
---|
| 2632 | RegisterOption("BvHierarchy.useCostHeuristics",
|
---|
| 2633 | optBool,
|
---|
| 2634 | "bvh_use_cost_heuristics=",
|
---|
| 2635 | "true");
|
---|
[1643] | 2636 |
|
---|
| 2637 | RegisterOption("BvHierarchy.useSah",
|
---|
| 2638 | optBool,
|
---|
| 2639 | "bvh_use_sah=",
|
---|
| 2640 | "false");
|
---|
| 2641 |
|
---|
[1288] | 2642 | RegisterOption("BvHierarchy.subdivisionStats",
|
---|
[1174] | 2643 | optString,
|
---|
[1288] | 2644 | "bvh_subdivision_stats=",
|
---|
| 2645 | "bvhSubdivisionStats.log");
|
---|
[1174] | 2646 |
|
---|
[1288] | 2647 | RegisterOption("BvHierarchy.Construction.renderCostDecreaseWeight",
|
---|
| 2648 | optFloat,
|
---|
| 2649 | "bvh_construction_render_cost_decrease_weight=",
|
---|
[1665] | 2650 | "0.99");
|
---|
[1359] | 2651 |
|
---|
| 2652 | RegisterOption("BvHierarchy.Construction.useGlobalSorting",
|
---|
| 2653 | optBool,
|
---|
| 2654 | "bvh_construction_use_global_sorting=",
|
---|
[1489] | 2655 | "true");
|
---|
[1779] | 2656 |
|
---|
[1784] | 2657 | RegisterOption("BvHierarchy.Construction.useInitialSubdivision",
|
---|
[1779] | 2658 | optBool,
|
---|
| 2659 | "bvh_construction_use_initial_subdivision=",
|
---|
| 2660 | "false");
|
---|
[1288] | 2661 |
|
---|
[1786] | 2662 | RegisterOption("BvHierarchy.Construction.Initial.minObjects",
|
---|
| 2663 | optInt,
|
---|
| 2664 | "bvh_construction_use_initial_min_objects=",
|
---|
| 2665 | "100000");
|
---|
| 2666 |
|
---|
| 2667 | RegisterOption("BvHierarchy.Construction.Initial.minArea",
|
---|
| 2668 | optFloat,
|
---|
| 2669 | "bvh_construction_use_initial_min_area=",
|
---|
| 2670 | "0.0001");
|
---|
| 2671 |
|
---|
| 2672 | RegisterOption("BvHierarchy.Construction.Initial.maxAreaRatio",
|
---|
| 2673 | optFloat,
|
---|
| 2674 | "bvh_construction_use_initial_max_area_ratio=",
|
---|
[1825] | 2675 | "0.9");
|
---|
[1786] | 2676 |
|
---|
[1676] | 2677 | RegisterOption("BvHierarchy.minRaysForVisibility",
|
---|
| 2678 | optInt,
|
---|
| 2679 | "bvh_min_rays_for_vis=",
|
---|
| 2680 | "0");
|
---|
[1640] | 2681 |
|
---|
[1727] | 2682 | RegisterOption("BvHierarchy.maxTests",
|
---|
| 2683 | optInt,
|
---|
| 2684 | "bvh_max_tests=",
|
---|
| 2685 | "50000");
|
---|
[1676] | 2686 |
|
---|
[1727] | 2687 |
|
---|
[1359] | 2688 | /*******************************************************************/
|
---|
| 2689 | /* Hierarchy Manager related options */
|
---|
| 2690 | /*******************************************************************/
|
---|
[1288] | 2691 |
|
---|
[1640] | 2692 | RegisterOption("Hierarchy.Construction.samples",
|
---|
| 2693 | optInt,
|
---|
[1642] | 2694 | "hierarchy_construction_samples=",
|
---|
[1640] | 2695 | "100000");
|
---|
| 2696 |
|
---|
[2228] | 2697 | RegisterOption("Hierarchy.minRenderCost",
|
---|
| 2698 | optFloat,
|
---|
| 2699 | "hierarchy_minRenderCost=",
|
---|
| 2700 | "0");
|
---|
| 2701 |
|
---|
[1288] | 2702 | RegisterOption("Hierarchy.subdivisionStats",
|
---|
| 2703 | optString,
|
---|
| 2704 | "hierarchy_subdivision_stats=",
|
---|
| 2705 | "hierarchySubdivisionStats.log");
|
---|
| 2706 |
|
---|
| 2707 | RegisterOption("Hierarchy.type",
|
---|
| 2708 | optString,
|
---|
| 2709 | "hierarchy_type=",
|
---|
| 2710 | "bvh");
|
---|
| 2711 |
|
---|
| 2712 | RegisterOption("Hierarchy.Termination.minGlobalCostRatio",
|
---|
| 2713 | optFloat,
|
---|
| 2714 | "hierarchy_term_min_global_cost_ratio=",
|
---|
[1444] | 2715 | "0.000000001");
|
---|
[1288] | 2716 |
|
---|
| 2717 | RegisterOption("Hierarchy.Termination.globalCostMissTolerance",
|
---|
| 2718 | optInt,
|
---|
| 2719 | "hierarchy_term_global_cost_miss_tolerance=",
|
---|
| 2720 | "4");
|
---|
| 2721 |
|
---|
| 2722 | RegisterOption("Hierarchy.Termination.maxLeaves",
|
---|
| 2723 | optInt,
|
---|
| 2724 | "hierarchy_term_max_leaves=",
|
---|
| 2725 | "1000");
|
---|
| 2726 |
|
---|
[1293] | 2727 | RegisterOption("Hierarchy.Construction.type",
|
---|
| 2728 | optInt,
|
---|
| 2729 | "hierarchy_construction_type=",
|
---|
| 2730 | "0");
|
---|
| 2731 |
|
---|
[1311] | 2732 | RegisterOption("Hierarchy.Construction.minDepthForOsp",
|
---|
| 2733 | optInt,
|
---|
| 2734 | "hierarchy_construction_min_depth_for_osp=",
|
---|
| 2735 | "-1");
|
---|
| 2736 |
|
---|
[1370] | 2737 | RegisterOption("Hierarchy.Construction.startWithObjectSpace",
|
---|
| 2738 | optBool,
|
---|
| 2739 | "hierarchy_construction_start_with_osp=",
|
---|
| 2740 | "true");
|
---|
| 2741 |
|
---|
[1662] | 2742 | RegisterOption("Hierarchy.Construction.considerMemory",
|
---|
| 2743 | optBool,
|
---|
| 2744 | "hierarchy_construction_consider_memory=",
|
---|
[1744] | 2745 | "true");
|
---|
[1662] | 2746 |
|
---|
[1314] | 2747 | RegisterOption("Hierarchy.Construction.repairQueue",
|
---|
| 2748 | optBool,
|
---|
| 2749 | "hierarchy_construction_repair_queue=",
|
---|
| 2750 | "true");
|
---|
[1311] | 2751 |
|
---|
[1370] | 2752 | RegisterOption("Hierarchy.Construction.minDepthForVsp",
|
---|
| 2753 | optInt,
|
---|
| 2754 | "hierarchy_construction_min_depth_for_vsp=",
|
---|
| 2755 | "-1");
|
---|
[1359] | 2756 |
|
---|
[1649] | 2757 | RegisterOption("Hierarchy.Termination.maxMemory",
|
---|
| 2758 | optFloat,
|
---|
[1653] | 2759 | "hierarchy_term_max_memory=",
|
---|
[1649] | 2760 | "1");
|
---|
| 2761 |
|
---|
[1666] | 2762 | RegisterOption("Hierarchy.Termination.memoryConst",
|
---|
| 2763 | optFloat,
|
---|
| 2764 | "hierarchy_term_memory_const=",
|
---|
| 2765 | "1.0");
|
---|
| 2766 |
|
---|
[1545] | 2767 | RegisterOption("Hierarchy.Construction.useMultiLevel",
|
---|
[1449] | 2768 | optBool,
|
---|
[1545] | 2769 | "hierarchy_construction_multilevel=",
|
---|
[1449] | 2770 | "false");
|
---|
| 2771 |
|
---|
[1576] | 2772 | RegisterOption("Hierarchy.Construction.levels",
|
---|
| 2773 | optInt,
|
---|
| 2774 | "hierarchy_construction_levels=",
|
---|
| 2775 | "4");
|
---|
[1727] | 2776 |
|
---|
| 2777 | RegisterOption("Hierarchy.Construction.maxRepairs",
|
---|
| 2778 | optInt,
|
---|
[1843] | 2779 | "hierarchy_construction_max_repairs=",
|
---|
[1727] | 2780 | "1000");
|
---|
| 2781 |
|
---|
[1640] | 2782 | RegisterOption("Hierarchy.Construction.minStepsOfSameType",
|
---|
| 2783 | optInt,
|
---|
| 2784 | "hierarchy_construction_min_steps_same_type=",
|
---|
| 2785 | "200");
|
---|
[1576] | 2786 |
|
---|
[1684] | 2787 | RegisterOption("Hierarchy.Construction.maxStepsOfSameType",
|
---|
| 2788 | optInt,
|
---|
| 2789 | "hierarchy_construction_max_steps_same_type=",
|
---|
| 2790 | "700");
|
---|
| 2791 |
|
---|
[1633] | 2792 | RegisterOption("Hierarchy.Construction.recomputeSplitPlaneOnRepair",
|
---|
| 2793 | optBool,
|
---|
| 2794 | "hierarchy_construction_recompute_split_on_repair=",
|
---|
| 2795 | "true");
|
---|
| 2796 |
|
---|
[2227] | 2797 | RegisterOption("Hierarchy.Construction.maxAvgRaysPerObject",
|
---|
[1895] | 2798 | optFloat,
|
---|
[2227] | 2799 | "hierarchy_construction_max_avg_rays_per_object=",
|
---|
[2228] | 2800 | "0");
|
---|
[1895] | 2801 |
|
---|
[2227] | 2802 | RegisterOption("Hierarchy.Construction.minAvgRaysPerObject",
|
---|
[1912] | 2803 | optFloat,
|
---|
[2227] | 2804 | "hierarchy_construction_min_avg_rays_per_object=",
|
---|
[2228] | 2805 | "0");
|
---|
[1912] | 2806 |
|
---|
[2130] | 2807 | RegisterOption("Hierarchy.useTraversalTree",
|
---|
| 2808 | optBool,
|
---|
| 2809 | "hierarchy_use_traversal_tree=",
|
---|
| 2810 | "false");
|
---|
[2124] | 2811 |
|
---|
| 2812 | ///////////////////////////////////////////////////////
|
---|
| 2813 |
|
---|
| 2814 | RegisterOption("TraversalTree.Termination.minCost",
|
---|
| 2815 | optInt,
|
---|
| 2816 | "kd_term_min_cost=",
|
---|
| 2817 | "1");
|
---|
| 2818 |
|
---|
| 2819 | RegisterOption("TraversalTree.Termination.maxNodes",
|
---|
| 2820 | optInt,
|
---|
| 2821 | "kd_term_max_nodes=",
|
---|
| 2822 | "200000");
|
---|
| 2823 |
|
---|
| 2824 | RegisterOption("TraversalTree.Termination.maxDepth",
|
---|
| 2825 | optInt,
|
---|
| 2826 | "kd_term_max_depth=",
|
---|
| 2827 | "20");
|
---|
| 2828 |
|
---|
| 2829 | RegisterOption("TraversalTree.Termination.maxCostRatio",
|
---|
| 2830 | optFloat,
|
---|
| 2831 | "kd_term_max_cost_ratio=",
|
---|
| 2832 | "1.5");
|
---|
| 2833 |
|
---|
| 2834 | RegisterOption("TraversalTree.Termination.ct_div_ci",
|
---|
| 2835 | optFloat,
|
---|
| 2836 | "kd_term_ct_div_ci=",
|
---|
| 2837 | "1.0");
|
---|
| 2838 |
|
---|
| 2839 | RegisterOption("TraversalTree.splitMethod",
|
---|
| 2840 | optString,
|
---|
| 2841 | "kd_split_method=",
|
---|
| 2842 | "spatialMedian");
|
---|
| 2843 |
|
---|
| 2844 | RegisterOption("TraversalTree.splitBorder",
|
---|
| 2845 | optFloat,
|
---|
| 2846 | "kd_split_border=",
|
---|
| 2847 | "0.1");
|
---|
| 2848 |
|
---|
| 2849 | RegisterOption("TraversalTree.sahUseFaces",
|
---|
| 2850 | optBool,
|
---|
| 2851 | "kd_sah_use_faces=",
|
---|
| 2852 | "true");
|
---|
| 2853 |
|
---|
[1458] | 2854 | /////////////////////////////////////////////////////////////////
|
---|
[1895] | 2855 |
|
---|
[372] | 2856 | }
|
---|
| 2857 |
|
---|
| 2858 | void
|
---|
| 2859 | Environment::SetStaticOptions()
|
---|
| 2860 | {
|
---|
| 2861 |
|
---|
| 2862 | // get Global option values
|
---|
| 2863 | GetRealValue("Limits.threshold", Limits::Threshold);
|
---|
| 2864 | GetRealValue("Limits.small", Limits::Small);
|
---|
| 2865 | GetRealValue("Limits.infinity", Limits::Infinity);
|
---|
| 2866 |
|
---|
| 2867 |
|
---|
| 2868 | }
|
---|
| 2869 |
|
---|
[938] | 2870 | bool
|
---|
[492] | 2871 | Environment::Parse(const int argc, char **argv, bool useExePath)
|
---|
[372] | 2872 | {
|
---|
[938] | 2873 | bool result = true;
|
---|
[372] | 2874 | // Read the names of the scene, environment and output files
|
---|
| 2875 | ReadCmdlineParams(argc, argv, "");
|
---|
| 2876 |
|
---|
| 2877 | char *envFilename = new char[128];
|
---|
| 2878 |
|
---|
| 2879 | char filename[64];
|
---|
| 2880 |
|
---|
| 2881 | // Get the environment file name
|
---|
| 2882 | if (!GetParam(' ', 0, filename)) {
|
---|
| 2883 | // user didn't specified environment file explicitly, so
|
---|
[1199] | 2884 | strcpy(filename, "default.env");
|
---|
[372] | 2885 | }
|
---|
[1757] | 2886 |
|
---|
[372] | 2887 |
|
---|
| 2888 | if (useExePath) {
|
---|
| 2889 | char *path = GetPath(argv[0]);
|
---|
| 2890 | if (*path != 0)
|
---|
| 2891 | sprintf(envFilename, "%s/%s", path, filename);
|
---|
| 2892 | else
|
---|
| 2893 | strcpy(envFilename, filename);
|
---|
| 2894 |
|
---|
| 2895 | delete path;
|
---|
| 2896 | }
|
---|
| 2897 | else
|
---|
| 2898 | strcpy(envFilename, filename);
|
---|
| 2899 |
|
---|
| 2900 |
|
---|
| 2901 | // Now it's time to read in environment file.
|
---|
| 2902 | if (!ReadEnvFile(envFilename)) {
|
---|
| 2903 | // error - bad input file name specified ?
|
---|
| 2904 | cerr<<"Error parsing environment file "<<envFilename<<endl;
|
---|
[938] | 2905 | result = false;
|
---|
[372] | 2906 | }
|
---|
| 2907 | delete envFilename;
|
---|
| 2908 |
|
---|
| 2909 | // Parse the command line; options given on the command line subsume
|
---|
| 2910 | // stuff specified in the input environment file.
|
---|
| 2911 | ParseCmdline(argc, argv, 0);
|
---|
| 2912 |
|
---|
| 2913 | SetStaticOptions();
|
---|
| 2914 |
|
---|
| 2915 | // Check for request for help
|
---|
| 2916 | if (CheckForSwitch(argc, argv, '?')) {
|
---|
| 2917 | PrintUsage(cout);
|
---|
| 2918 | exit(0);
|
---|
| 2919 | }
|
---|
[938] | 2920 |
|
---|
| 2921 | return true;
|
---|
[372] | 2922 | }
|
---|
[860] | 2923 |
|
---|
[878] | 2924 | }
|
---|