00001 #include "std/config.H"
00002 #include "std/file.H"
00003 #include "std/fstream.H"
00004 #include "data_item.H"
00005
00006
00007
00008
00009
00010
00011
00012 #define INTEGER_VARIABLE(X,Y) TAG_meth<X>(Y, &X::put_integer_var, &X::get_integer_var, 1)
00013 #define DOUBLE_VARIABLE(X,Y) TAG_meth<X>(Y, &X::put_double_var, &X::get_double_var, 1)
00014 #define STRING_VARIABLE(X,Y) TAG_meth<X>(Y, &X::put_string_var, &X::get_string_var, 1)
00015 #define BOOL_VARIABLE(X,Y) TAG_meth<X>(Y, &X::put_bool_var, &X::get_bool_var, 1)
00016
00017
00018
00019
00020 #define OLD_VARIABLE(X,Y) TAG_meth<X>(Y, &X::put_old_var, &X::get_old_var, 1)
00021
00022 class BaseJOTappConfig : public DATA_ITEM, public Config
00023 {
00024
00025
00026 private:
00027 static TAGlist* _bja_tags;
00028
00029 public:
00030
00031
00032
00033
00034 public:
00035
00036
00037 BaseJOTappConfig(Cstr_ptr &j) : Config(j) { assert(_instance == this); }
00038
00039 virtual ~BaseJOTappConfig() { }
00040
00041 protected:
00042
00043
00044
00045
00046 virtual bool save(Cstr_ptr &);
00047 virtual bool load(Cstr_ptr &);
00048
00049
00050 public:
00051 DEFINE_RTTI_METHODS_BASE("BaseJOTappConfig", CDATA_ITEM *);
00052 virtual DATA_ITEM* dup() const { return new BaseJOTappConfig(NULL_STR); }
00053 virtual CTAGlist& tags() const;
00054
00055 protected:
00056
00057 virtual void get_string_var (TAGformat &d);
00058 virtual void put_string_var (TAGformat &d) const;
00059
00060 virtual void get_integer_var (TAGformat &d);
00061 virtual void put_integer_var (TAGformat &d) const;
00062
00063 virtual void get_double_var (TAGformat &d);
00064 virtual void put_double_var (TAGformat &d) const;
00065
00066 virtual void get_bool_var (TAGformat &d);
00067 virtual void put_bool_var (TAGformat &d) const;
00068
00069 virtual void get_old_var (TAGformat &d);
00070 virtual void put_old_var (TAGformat &d) const;
00071 };
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 TAGlist* BaseJOTappConfig::_bja_tags = NULL;
00082
00083
00084
00085
00086
00087
00088
00089
00090 CTAGlist &
00091 BaseJOTappConfig::tags() const
00092 {
00093 if (!_bja_tags) {
00094 _bja_tags = new TAGlist;
00095
00096
00097
00098
00099
00100
00101 }
00102 return *_bja_tags;
00103 }
00104
00105
00106
00107
00108 bool
00109 BaseJOTappConfig::save(Cstr_ptr &filename)
00110 {
00111 assert(_instance);
00112
00113 fstream fout;
00114 fout.open(**filename,ios::out);
00115
00116 if (!fout) {
00117 cerr << "BaseJOTappConfig::save() - ERROR! Could not open file '" << filename << "'\n";
00118 return false;
00119 }
00120
00121 STDdstream stream(&fout);
00122 ((BaseJOTappConfig*)_instance)->format(stream);
00123
00124 fout.close();
00125
00126 return true;
00127 }
00128
00129
00130
00131
00132
00133 bool
00134 BaseJOTappConfig::load(Cstr_ptr &filename)
00135 {
00136 assert(_instance);
00137 if (!filename) {
00138 cerr << "BaseJOTappConfig::load: error: filename is NULL" << endl;
00139 return false;
00140 }
00141
00142 fstream fin;
00143 #if (defined (WIN32) && defined(_MSC_VER) && (_MSC_VER <=1300))
00144
00145 fin.open(**filename, ios::in | ios::nocreate);
00146 #else
00147 fin.open(**filename, ios::in);
00148 #endif
00149
00150 if (!fin) {
00151
00152
00153 return false;
00154 }
00155
00156 STDdstream stream(&fin);
00157
00158 str_ptr class_name;
00159 stream >> class_name;
00160
00161 if (class_name != ((BaseJOTappConfig*)_instance)->class_name()) {
00162 cerr << "BaseJOTappConfig::load: loaded class name '"
00163 << class_name << "' is not correct config class '"
00164 << ((BaseJOTappConfig*)_instance)->class_name() << endl;
00165 return false;
00166 }
00167
00168 ((BaseJOTappConfig*)_instance)->decode(stream);
00169
00170 return true;
00171 }
00172
00173
00174
00175
00176
00177 void
00178 BaseJOTappConfig::get_string_var(TAGformat &d)
00179 {
00180
00181
00182 str_ptr str_val = (*d).get_string_with_spaces();
00183
00184
00185
00186 if (str_val == "NULL_STR")
00187 str_val = NULL_STR;
00188
00189 set_var_str(d.name(),str_val);
00190
00191 }
00192
00193
00194
00195
00196 void
00197 BaseJOTappConfig::put_string_var(TAGformat &d) const
00198 {
00199
00200
00201 if (get_var_is_set(d.name())) {
00202 str_ptr str_val;
00203
00204 str_val = get_var_str(d.name());
00205
00206 if (str_val == NULL_STR)
00207 str_val = "NULL_STR";
00208
00209 cerr << "BaseJOTappConfig::put_string_var() [" << d.name() << "] - Writing string '" << str_val << "'\n";
00210
00211 d.id();
00212 *d << str_val << " ";
00213 d.end_id();
00214 } else {
00215 cerr << "BaseJOTappConfig::put_string_var() [" << d.name() << "] - Not set...\n";
00216 }
00217 }
00218
00219
00220
00221
00222
00223 void
00224 BaseJOTappConfig::get_old_var(TAGformat &d)
00225 {
00226
00227
00228 str_ptr str_val = (*d).get_string_with_spaces();
00229
00230 cerr << "BaseJOTappConfig::get_old_var() [" << d.name() << "] - **Deprecated Variable** Loaded string: '" << str_val << "'\n";
00231
00232
00233
00234 }
00235
00236
00237
00238
00239 void
00240 BaseJOTappConfig::put_old_var(TAGformat &d) const
00241 {
00242
00243 }
00244
00245
00246
00247
00248 void
00249 BaseJOTappConfig::get_integer_var(TAGformat &d)
00250 {
00251
00252
00253 int int_val;
00254 *d >> int_val;
00255
00256
00257
00258 set_var_int(d.name(),int_val);
00259
00260 }
00261
00262
00263
00264
00265 void
00266 BaseJOTappConfig::put_integer_var(TAGformat &d) const
00267 {
00268
00269
00270 if (get_var_is_set(d.name())) {
00271 int int_val;
00272
00273 int_val = get_var_int(d.name());
00274
00275 cerr << "BaseJOTappConfig::put_integer_var() [" << d.name() << "] - Writing integer '" << int_val << "'\n";
00276
00277 d.id();
00278
00279 *d << int_val;
00280
00281 d.end_id();
00282 } else {
00283 cerr << "BaseJOTappConfig::put_integer_var() [" << d.name() << "] - Not set...\n";
00284 }
00285 }
00286
00287
00288
00289
00290 void
00291 BaseJOTappConfig::get_double_var(TAGformat &d)
00292 {
00293
00294
00295 double dbl_val;
00296 *d >> dbl_val;
00297
00298
00299
00300 set_var_dbl(d.name(),dbl_val);
00301
00302 }
00303
00304
00305
00306
00307 void
00308 BaseJOTappConfig::put_double_var(TAGformat &d) const
00309 {
00310
00311
00312 if (get_var_is_set(d.name())) {
00313 double dbl_val;
00314
00315 dbl_val = get_var_dbl(d.name());
00316
00317 cerr << "BaseJOTappConfig::put_double_var() [" << d.name() << "] - Writing double '" << dbl_val << "'\n";
00318
00319 d.id();
00320
00321 *d << dbl_val;
00322
00323 d.end_id();
00324 } else {
00325 cerr << "BaseJOTappConfig::put_double_var() [" << d.name() << "] - Not set...\n";
00326 }
00327 }
00328
00329
00330
00331
00332 void
00333 BaseJOTappConfig::get_bool_var(TAGformat &d)
00334 {
00335
00336
00337 str_ptr foo;
00338 *d >> foo;
00339
00340 bool bool_val;
00341 if (foo == "true") {
00342 bool_val = true;
00343
00344 } else if (foo == "false") {
00345 bool_val= false;
00346
00347 } else {
00348 bool_val = false;
00349 cerr << "BaseJOTappConfig::get_bool_var() [" << d.name() << "] - ERROR!! Loaded bool: '" << foo << "', but should be 'true' or 'false'. Assuming 'false'...\n";
00350 }
00351
00352 set_var_bool(d.name(),bool_val);
00353
00354 }
00355
00356
00357
00358
00359 void
00360 BaseJOTappConfig::put_bool_var(TAGformat &d) const
00361 {
00362
00363
00364 if (get_var_is_set(d.name())) {
00365
00366 bool bool_val;
00367 bool_val = get_var_bool(d.name());
00368
00369 str_ptr foo;
00370 foo = ((bool_val)?("true"):("false"));
00371
00372 cerr << "BaseJOTappConfig::put_bool_var() ["
00373 << d.name() << "] - Writing bool '" << foo << "'\n";
00374
00375 d.id();
00376 *d << foo << " ";
00377 d.end_id();
00378 } else {
00379 cerr << "BaseJOTappConfig::put_bool_var() ["
00380 << d.name() << "] - Not set...\n";
00381 }
00382 }
00383
00384
00385
00386
00387
00388 class JOTappConfig : public BaseJOTappConfig
00389 {
00390 private:
00391
00392 static TAGlist* _ja_tags;
00393
00394 public:
00395
00396
00397
00398
00399
00400 public:
00401
00402
00403 JOTappConfig(Cstr_ptr& j) : BaseJOTappConfig(j) { assert(_instance == this); }
00404
00405 virtual ~JOTappConfig() { }
00406
00407 protected:
00408
00409
00410
00411 public:
00412 DEFINE_RTTI_METHODS2("JOTappConfig", BaseJOTappConfig, CDATA_ITEM *);
00413 virtual DATA_ITEM* dup() const { return new JOTappConfig(NULL_STR); }
00414 virtual CTAGlist& tags() const;
00415
00416 };
00417
00418
00419
00420
00421
00422 TAGlist* JOTappConfig::_ja_tags = NULL;
00423
00424
00425
00426
00427
00428
00429
00430
00431 CTAGlist &
00432 JOTappConfig::tags() const
00433 {
00434 if (!_ja_tags) {
00435 _ja_tags = new TAGlist;
00436 *_ja_tags += BaseJOTappConfig::tags();
00437
00438
00439
00440
00441
00442
00443 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"REF_IMAGE_SIZE");
00444 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"BGCOLOR");
00445 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"START_WITH_LINE_PEN");
00446 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"START_WITH_HATCHING_PEN");
00447 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"START_WITH_BASECOAT_PEN");
00448 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SUPPRESS_NPR");
00449 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ENABLE_FFS");
00450 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SHOW_JOT_APP");
00451 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_RECENTER");
00452 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ANTIALIAS_SILS");
00453 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ANTIALIAS_WIREFRAME");
00454 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DRAW_BACKFACING");
00455 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"GRAB_ALPHA");
00456 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"GOOCH_NO_LINE");
00457 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SIGMA_ONE");
00458 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FIT_SIGMA");
00459 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FIT_PHASE");
00460 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FIT_INTERPOLATE");
00461 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"COVER_MAJORITY");
00462 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"COVER_ONE_TO_ONE");
00463 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"SIL_DEBUG_W");
00464 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"SIL_DEBUG_H");
00465 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"FIT_PIX");
00466 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"WEIGHT_FIT");
00467 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"WEIGHT_SCALE");
00468 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"WEIGHT_DISTORT");
00469 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"WEIGHT_HEAL");
00470 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HACK_EYE_POS");
00471 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"REALLY_HACK_EYE_POS");
00472 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"PRINT_ERRS");
00473 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_REPORT_SIL_STATS");
00474 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_NO_FACE_CULLING");
00475 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"GRID_USE_UV");
00476 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ZX_NO_DOTS");
00477 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ZX_NO_COLOR");
00478 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ZX_CLOSED");
00479 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SILS_IGNORE_MESH_XFORM");
00480 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_SAVE_XFORMED_MESH");
00481 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_USE_NEW_BFACE_IO");
00482 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SUPPRESS_CREASES");
00483 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ALLOW_CHECK_ALL");
00484 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"PRINT_MESH_SIZE");
00485 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_RANDOM_SILS");
00486 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"JOT_CREASE_THRESH");
00487 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"UV_RESOLUTION");
00488 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"CHECK_ALL_UNDER");
00489 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"RANDOMIZED_MIN_FACES");
00490 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"RANDOMIZED_MIN_EDGES");
00491 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"PRINT_TRIS_PER_STRIP");
00492 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_EXT_compiled_vertex_array");
00493 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_NV_vertex_program");
00494 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_ARB_multitexture");
00495 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_NV_register_combiners");
00496 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_ARB_vertex_program");
00497 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_ARB_fragment_program");
00498 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_GL_ATI_fragment_shader");
00499 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SCREEN_BOX");
00500 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ZX_NEW_BRANCH");
00501 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"COUNT_STROKES");
00502 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ADD_CURVE_PLOT");
00503 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HACK_ID_UPDATE");
00504 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ADD_GRID_SHADER");
00505 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"OPAQUE_COMPOSITE");
00506 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HATCHING_GROUP_SLIDE_FIT");
00507 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"NPR_SELECT_ALPHA");
00508 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"BMESH_OFFSET_FACTOR");
00509 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"BMESH_OFFSET_UNITS");
00510 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SIL_VIS_SAMPLE_SPACING");
00511 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"VIS_ID_RAD");
00512 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"INVIS_ID_RAD");
00513 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"MAX_LUBO_STEPS");
00514 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"LUBO_SAMPLE_STEP");
00515 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"SIL_VIS_PATH_WIDTH");
00516 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DRAW_PROPAGATION");
00517 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"USE_OLD_LENGTH_ENCODING");
00518 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"LONG_LUBO");
00519 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_BOX_CHECK");
00520 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"VERIFY_IDREF_RANGE");
00521 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HACK_NOISE");
00522 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SIL_TO_STROKE_PIX_SAMPLING");
00523 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"HEAL_DRAG_PIX_THRESH");
00524 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"HEAL_JOIN_PIX_THRESH");
00525 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SPARSE_FACTOR");
00526 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"MIN_FRAC_PER_GROUP");
00527 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"MIN_PIX_PER_GROUP");
00528 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"MIN_PATH_PIX");
00529 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"MIN_VOTES_PER_GROUP");
00530 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"BASE_STROKE_REPAIR_INTERSECTIONS");
00531 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FIX_CREASE_OFFSETS");
00532 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"CREASE_EXACT_VISIBILITY");
00533 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"REFINE_LIMIT_HACK");
00534 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_WINDOW_WIDTH");
00535 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_WINDOW_HEIGHT");
00536 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_WINDOW_X");
00537 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_WINDOW_Y");
00538 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"GEST_ADD_MIN_DIST");
00539 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"TRIM_DIST");
00540 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"TRIM_ANGLE");
00541 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"ELLIPSE_ERR_FACTOR");
00542 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"ELLIPSE_LO_FACTOR");
00543 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"ELLIPSE_HI_FACTOR");
00544 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"EPC_RATIO");
00545 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SELECT_EDGE_CHAIN_PT_THRESH");
00546 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SHININESS");
00547 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"KEYLINE_SIL_WIDTH");
00548 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"MAX_CURVATURE");
00549 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"CURV_REMAP_SCALE");
00550 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"ANTI_DISTORT_TIP_FACTOR");
00551 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"FADE_DUR");
00552 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"HATCHING_PIX_SAMPLING");
00553 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"PIX_RES");
00554 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"JOT_WINDOW_NAME");
00555 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"JOT_RENDER_STYLE");
00556 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"KBD_NAVIGATION");
00557 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FADE_TEXTURES");
00558 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HATCHING_KEEP_OLD_TRANSITIONS");
00559 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HATCHING_GROUP_SLIDE_FIT");
00560 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NO_CONNECT_ERRS");
00561 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DO_TCP_DELAY");
00562 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FLIP_CAM_MANIP");
00563 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_PRINT_LINE_WIDTHS");
00564 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_PRINT_POINT_SIZES");
00565 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DONT_QUIT_ALL");
00566 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"QUIT_ALL");
00567 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DISTRIB_CAMERA");
00568 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_DL_PER_VIEW");
00569 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"TABLET_SIZE_SMALL");
00570 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_NUM_WINS");
00571 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"TTY_TIMEOUT");
00572 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"MAX_TRY");
00573 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"RADJUST");
00574 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"LADJUST");
00575 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"GLUT_WAIT");
00576 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"TABLET_OFFSET_X");
00577 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"TABLET_OFFSET_Y");
00578 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"IOD");
00579 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"DISPLAY_ASPECT");
00580 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"PIXEL_WARP_FACTOR");
00581 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"JOT_GAMMA");
00582 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"DISPLAY");
00583 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"DOT_TEXTURE");
00584 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_GLUT_REDRAW_TIMEOUT_MS");
00585 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_GLUT_REDRAW_SLEEP_MS");
00586 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"GEST_STARTUP_DIST_THRESH");
00587
00588
00589
00590
00591
00592
00593
00594 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_EASELS");
00595 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"PRINT_SIMPLEX_BITS");
00596 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_TABLET");
00597 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_CAM_HISTORY");
00598 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_CONNECT_EDIT_INIT");
00599 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_CONNECT_EDIT_ALL");
00600 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_MINIMAL_RENDER_STYLES");
00601 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_DTAP_GUARD");
00602 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_EDGE_SELECT");
00603 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"GEST_DEBUG_TRIM");
00604 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_GEST_STROKE_DRAW");
00605 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_GEST_DRAWER");
00606 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_INFLATE_ALL");
00607 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DOUG");
00608 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_GESTURES");
00609 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_SELECT_WIDGET_INIT");
00610 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_SELECT_WIDGET_ALL");
00611 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ALWAYS_UPDATE");
00612 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_SWEEP_ALL");
00613 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SUG_VALLEY");
00614 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_MOUSE_BUTTON_CALLBACK");
00615 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_CONTROL_FRAME");
00616 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ENABLE_SUGCON");
00617 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SUG_THRESHGRAD");
00618 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SUG_THRESHGRAD2");
00619 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SUG_THRESHANGLE");
00620 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SUG_THRESHANGLE2");
00621 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_LPATCH");
00622 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"SKIN_INHIBIT_UV");
00623 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_ADAPTIVE");
00624 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_BMESH_DESTRUCTOR");
00625 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_BUILD_ZX_STRIPS");
00626 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_CLEAN_PATCHES");
00627 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"FORCE_FACE_PICK");
00628 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_SUBDIVISION");
00629 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_GL_EXTENSIONS");
00630 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_HATCH_FIXED");
00631 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ADD_DITHER");
00632 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HATCHING_DEBUG_VIS");
00633 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"PUT_VIEW_STUFF_IN_SM");
00634 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_STROKES");
00635 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_ZX_STROKES");
00636 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_LUBO");
00637 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"NEW_IDREF_METHOD");
00638 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HACK_FIX_LOOP_POS");
00639 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"HACK_USES_MINTEST");
00640 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"SUGKEYLINE_SIL_WIDTH");
00641 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_BASE_STROKES");
00642 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_BCURVE_RES_LEVEL");
00643 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_EXTRUDE");
00644 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_EXTENDER");
00645 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_PANEL");
00646 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_RSURF");
00647 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"DEBUG_TESSELLATE");
00648 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"CONTROL_FRAME_RATIO");
00649 *_ja_tags += new DOUBLE_VARIABLE(JOTappConfig,"CTRL_FRAME_TOP_THICKNESS");
00650 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"USE_STEREO");
00651 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ASYNCH");
00652 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"BIRD_CAM");
00653 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"ORTHO_CAM");
00654 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_DEBUG_THREADS");
00655 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"JOT_MULTITHREAD");
00656
00657 *_ja_tags += new INTEGER_VARIABLE(JOTappConfig,"JOT_WARNING_LEVEL");
00658
00659
00660 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"ENABLE_MARBLE");
00661 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"ENABLE_HALFTONE_EX");
00662 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"ENABLE_DOTS_EX");
00663
00664 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"SHOW_SKYBOX");
00665 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"SHOW_HALOS");
00666
00667 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"DO_VIEW_HALOS");
00668 *_ja_tags += new STRING_VARIABLE(JOTappConfig,"DO_REF_HALOS");
00669
00670
00671
00672
00673
00674 *_ja_tags += new OLD_VARIABLE(JOTappConfig,"DEBUG_DOUBLE_TAP");
00675 *_ja_tags += new OLD_VARIABLE(JOTappConfig,"DEBUG_WIN_PICK");
00676 *_ja_tags += new OLD_VARIABLE(JOTappConfig,"DEBUG_UV_INTERSECT");
00677 *_ja_tags += new OLD_VARIABLE(JOTappConfig,"DEBUG_SLASH_CB");
00678
00679
00680
00681 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"WRITE_SUBDIV_MESHES");
00682 *_ja_tags += new BOOL_VARIABLE(JOTappConfig,"WRITE_BNODES_INFO");
00683
00684 }
00685 return *_ja_tags;
00686 }
00687
00688
00689
00690
00691 void
00692 main_config(bool init)
00693 {
00694 static JOTappConfig* config = NULL;
00695
00696 if (init) {
00697
00698
00699
00700
00701
00702
00703
00704
00705 Config::no_warn("JOT_WARNING_LEVEL");
00706
00707
00708 if (!getenv("JOT_ROOT")) {
00709 err_msg("main_config: JOT_ROOT environment variable NOT found...");
00710 err_msg("main_config: Will use current working directory instead...");
00711 str_ptr cwd = getcwd_();
00712 if (cwd != NULL_STR) {
00713 putenv(**(str_ptr("JOT_ROOT=") + cwd));
00714 } else {
00715 err_msg("main_config: failed retrieving current working directory!");
00716 exit(0);
00717 }
00718 }
00719
00720
00721
00722
00723 config = new JOTappConfig(str_ptr(getenv("JOT_ROOT")) + str_ptr("/"));
00724 assert(config);
00725
00726 if (!(Config::load_config(Config::JOT_ROOT() + "jot.cfg") ||
00727 Config::load_config(Config::JOT_ROOT() + "jot-default.cfg"))) {
00728 err_msg("main_config: *FAILED* config load from %s or %s",
00729 **(Config::JOT_ROOT() + "jot.cfg"),
00730 **(Config::JOT_ROOT() + "jot-default.cfg"));
00731 }
00732 } else {
00733 err_mesg(ERR_LEV_SPAM, "main_config: Cleanup...");
00734 assert(config);
00735 delete config;
00736 config = NULL;
00737 }
00738 }
00739
00740