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