File: thlayout.h

package info (click to toggle)
therion 5.3.16-10
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 19,400 kB
  • ctags: 16,579
  • sloc: ansic: 126,508; cpp: 100,089; tcl: 25,682; perl: 2,002; makefile: 1,114; asm: 219; python: 121; sh: 4
file content (739 lines) | stat: -rw-r--r-- 16,350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
/**
 * @file thlayout.h
 * Map layout module.
 */
  
/* Copyright (C) 2000 Stacho Mudrak
 * 
 * $Date: $
 * $RCSfile: $
 * $Revision: $
 *
 * -------------------------------------------------------------------- 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 * --------------------------------------------------------------------
 */
 
#ifndef thlayout_h
#define thlayout_h


#include "thdataobject.h"
#include "thlayoutln.h"
#include "thsymbolset.h"
#include "thlocale.h"
#include "thlayoutclr.h"
#include <list>

/**
 * layout command options tokens.
 */
 
enum {
  TT_LAYOUT_UNKNOWN = 2000,
  TT_LAYOUT_SCALE = 2001,
  TT_LAYOUT_ORIGIN = 2002,
  TT_LAYOUT_SIZE = 2003,
  TT_LAYOUT_GRID_SIZE = 2004,
  TT_LAYOUT_GRID_ORIGIN = 2005,
  TT_LAYOUT_ORIGIN_LABEL = 2006,
  TT_LAYOUT_NAV_SIZE = 2007,
  TT_LAYOUT_NAV_FACTOR = 2008,
  TT_LAYOUT_OWN_PAGES = 2009,
  TT_LAYOUT_TITLE_PAGES = 2010,
  TT_LAYOUT_OPACITY = 2011,
  TT_LAYOUT_OVERLAP = 2012,
  TT_LAYOUT_PAGE_NUMBERS = 2013,
  TT_LAYOUT_PAGE_SETUP = 2014,
  TT_LAYOUT_COPY = 2015,
  TT_LAYOUT_DOC_TITLE = 2016,
  TT_LAYOUT_DOC_AUTHOR = 2017,
  TT_LAYOUT_DOC_SUBJECT = 2018,
  TT_LAYOUT_DOC_KEYWORDS = 2019,
  TT_LAYOUT_EXCLUDE_PAGES = 2020,
  TT_LAYOUT_GRID = 2021,
  TT_LAYOUT_PAGE_GRID = 2022,
  TT_LAYOUT_TRANSPARENCY = 2023,
  TT_LAYOUT_LAYERS = 2024,
  TT_LAYOUT_CODE = 2025,
  TT_LAYOUT_BASE_SCALE = 2026,
  TT_LAYOUT_SYMBOL_DEFAULTS = 2027,
  TT_LAYOUT_SYMBOL_ASSIGN = 2028,
  TT_LAYOUT_SYMBOL_HIDE = 2029,
  TT_LAYOUT_COLOR = 2030,
  TT_LAYOUT_SYMBOL_SHOW = 2031,
  TT_LAYOUT_LEGEND = 2032,
  TT_LAYOUT_DOC_COMMENT = 2033,
  TT_LAYOUT_MAP_HEADER = 2034,
  TT_LAYOUT_LANG = 2035,
  TT_LAYOUT_MAP_ITEM = 2036,
  TT_LAYOUT_SCALE_BAR = 2037,
  TT_LAYOUT_DEBUG = 2038,
  TT_LAYOUT_LEGEND_WIDTH = 2039,
  TT_LAYOUT_LEGEND_COLUMNS = 2040,
  TT_LAYOUT_SURFACE = 2041,
  TT_LAYOUT_SURFACE_OPACITY = 2042,
  TT_LAYOUT_ROTATE = 2043,
  TT_LAYOUT_ENDCODE = 2044,
  TT_LAYOUT_COLOR_LEGEND = 2045,
  TT_LAYOUT_MAP_HEADER_BG = 2046,
	TT_LAYOUT_UNITS = 2047,
	TT_LAYOUT_SURVEY_LEVEL = 2048,
	TT_LAYOUT_SKETCHES = 2049,
	TT_LAYOUT_NORTH = 2050,
  TT_LAYOUT_MAP_IMAGE = 2051,
  TT_LAYOUT_GRID_COORDS = 2052,
  TT_LAYOUT_SYMBOL_COLOR = 2053,
};


/**
 * Layout grid tokens.
 */

enum {
  TT_LAYOUT_GRID_UNKNOWN = 0,
  TT_LAYOUT_GRID_OFF,
  TT_LAYOUT_GRID_TOP,
  TT_LAYOUT_GRID_BOTTOM,
};


/**
 * Layout grid token table.
 */
 
static const thstok thtt_layout_grid[] = {
  {"bottom", TT_LAYOUT_GRID_BOTTOM},
  {"off", TT_LAYOUT_GRID_OFF},
  {"top", TT_LAYOUT_GRID_TOP},
  {NULL, TT_LAYOUT_GRID_UNKNOWN}
};


/**
 * Layout grid tokens.
 */

enum {
  TT_LAYOUT_GRIDCOORDS_UNKNOWN = 0,
  TT_LAYOUT_GRIDCOORDS_OFF,
  TT_LAYOUT_GRIDCOORDS_BORDER,
  TT_LAYOUT_GRIDCOORDS_ALL,
};


/**
 * Layout grid token table.
 */
 
static const thstok thtt_layout_gridcoords[] = {
  {"all", TT_LAYOUT_GRIDCOORDS_ALL},
  {"border", TT_LAYOUT_GRIDCOORDS_BORDER},
  {"off", TT_LAYOUT_GRIDCOORDS_OFF},
  {NULL, TT_LAYOUT_GRIDCOORDS_UNKNOWN}
};


/**
 * Layout map-item token table.
 */
 
//static const thstok thtt_layout_mapitem[] = {
//  {"north-arrow", SYMS_NORTHARROW},
//  {"scale-bar", SYMS_SCALEBAR},
//  {NULL, SYMS_ZZZ}
//};

/**
 * Layout legend tokens.
 */

enum {
  TT_LAYOUT_LEGEND_UNKNOWN = 0,
  TT_LAYOUT_LEGEND_OFF,
  TT_LAYOUT_LEGEND_ON,
  TT_LAYOUT_LEGEND_ALL,
};


/**
 * Layout legend token table.
 */
 
static const thstok thtt_layout_legend[] = {
  {"all", TT_LAYOUT_LEGEND_ALL},
  {"off", TT_LAYOUT_LEGEND_OFF},
  {"on", TT_LAYOUT_LEGEND_ON},
  {NULL, TT_LAYOUT_LEGEND_UNKNOWN},
};


/**
 * Layout debug tokens.
 */

enum {
  TT_LAYOUT_DEBUG_OFF,
  TT_LAYOUT_DEBUG_STATIONS,
  TT_LAYOUT_DEBUG_JOINS,
  TT_LAYOUT_DEBUG_SCRAPNAMES,
  TT_LAYOUT_DEBUG_STATIONNAMES,
  TT_LAYOUT_DEBUG_ALL,
  TT_LAYOUT_DEBUG_UNKNOWN,
};


/**
 * Layout legend token table.
 */
 
static const thstok thtt_layout_debug[] = {
  {"all", TT_LAYOUT_DEBUG_ALL},
  {"first", TT_LAYOUT_DEBUG_STATIONS},
  {"off", TT_LAYOUT_DEBUG_OFF},
  {"on", TT_LAYOUT_DEBUG_ALL},
  {"scrap-names", TT_LAYOUT_DEBUG_SCRAPNAMES},
  {"second", TT_LAYOUT_DEBUG_JOINS},
  {"station-names", TT_LAYOUT_DEBUG_STATIONNAMES},
  {NULL, TT_LAYOUT_DEBUG_UNKNOWN},
};


/**
 * Layout surface tokens.
 */

enum {
  TT_LAYOUT_SURFACE_OFF,
  TT_LAYOUT_SURFACE_TOP,
  TT_LAYOUT_SURFACE_BOTTOM,
  TT_LAYOUT_SURFACE_UNKNOWN,
};


/**
 * Layout legend token table.
 */
 
static const thstok thtt_layout_surface[] = {
  {"bottom", TT_LAYOUT_SURFACE_BOTTOM},
  {"off", TT_LAYOUT_SURFACE_OFF},
  {"top", TT_LAYOUT_SURFACE_TOP},
  {NULL, TT_LAYOUT_SURFACE_UNKNOWN},
};








/**
 * Layout legend tokens.
 */

enum {
  TT_LAYOUT_MAP_HEADER_UNKNOWN = 0,
  TT_LAYOUT_MAP_HEADER_N,
  TT_LAYOUT_MAP_HEADER_NW,
  TT_LAYOUT_MAP_HEADER_NE,
  TT_LAYOUT_MAP_HEADER_E,
  TT_LAYOUT_MAP_HEADER_W,
  TT_LAYOUT_MAP_HEADER_S,
  TT_LAYOUT_MAP_HEADER_SW,
  TT_LAYOUT_MAP_HEADER_SE,
  TT_LAYOUT_MAP_HEADER_OFF,
  TT_LAYOUT_MAP_HEADER_CENTER,
};


/**
 * Layout legend token table.
 */
 
static const thstok thtt_layout_map_header[] = {
  {"c", TT_LAYOUT_MAP_HEADER_CENTER},
  {"center", TT_LAYOUT_MAP_HEADER_CENTER},
  {"e", TT_LAYOUT_MAP_HEADER_E},
  {"n", TT_LAYOUT_MAP_HEADER_N},
  {"ne", TT_LAYOUT_MAP_HEADER_NE},
  {"nw", TT_LAYOUT_MAP_HEADER_NW},
  {"off", TT_LAYOUT_MAP_HEADER_OFF},
  {"s", TT_LAYOUT_MAP_HEADER_S},
  {"se", TT_LAYOUT_MAP_HEADER_SE},
  {"sw", TT_LAYOUT_MAP_HEADER_SW},
  {"w", TT_LAYOUT_MAP_HEADER_W},
  {NULL, TT_LAYOUT_MAP_HEADER_UNKNOWN},
};



/**
 * Layout code tokens.
 */

enum {
  TT_LAYOUT_CODE_UNKNOWN = 0,
  TT_LAYOUT_CODE_TEX_ATLAS,
  TT_LAYOUT_CODE_TEX_MAP,
  TT_LAYOUT_CODE_METAPOST,
  TT_LAYOUT_CODE_SYMBOL_DEFAULTS,
  TT_LAYOUT_CODE_SYMBOL_ASSIGN,
  TT_LAYOUT_CODE_SYMBOL_HIDE,
  TT_LAYOUT_CODE_SYMBOL_SHOW,
  TT_LAYOUT_CODE_SYMBOL_COLOR,
  TT_LAYOUT_CODE_MAP_ITEM,
};


/**
 * Layout grid token table.
 */
 
static const thstok thtt_layout_code[] = {
  {"metapost", TT_LAYOUT_CODE_METAPOST},
  {"mpost", TT_LAYOUT_CODE_METAPOST},
  {"tex-atlas", TT_LAYOUT_CODE_TEX_ATLAS},
  {"tex-map", TT_LAYOUT_CODE_TEX_MAP},
  {NULL, TT_LAYOUT_CODE_UNKNOWN}
};


/**
 * Layout north tokens.
 */

enum {
  TT_LAYOUT_NORTH_UNKNOWN = 0,
  TT_LAYOUT_NORTH_TRUE,
  TT_LAYOUT_NORTH_GRID,
};


/**
 * Layout color token table.
 */
 
static const thstok thtt_layout_north[] = {
  {"grid", TT_LAYOUT_NORTH_GRID},
  {"true", TT_LAYOUT_NORTH_TRUE},
  {NULL, TT_LAYOUT_NORTH_UNKNOWN}
};

/**
 * Layout length statistics tokens.
 */

enum {
  TT_LAYOUT_LENSTAT_UNKNOWN = 0,
  TT_LAYOUT_LENSTAT_OFF,
  TT_LAYOUT_LENSTAT_HIDE,
  TT_LAYOUT_LENSTAT_ON,
};


/**
 * Layout color token table.
 */
 
static const thstok thtt_layout_lenstat[] = {
  {"hide", TT_LAYOUT_LENSTAT_HIDE},
  {"off", TT_LAYOUT_LENSTAT_OFF},
  {"on", TT_LAYOUT_LENSTAT_ON},
  {NULL, TT_LAYOUT_LENSTAT_UNKNOWN}
};


/**
 * Layout color tokens.
 */

enum {
  TT_LAYOUT_COLOR_UNKNOWN = 0,
  TT_LAYOUT_COLOR_MAP_BG,
  TT_LAYOUT_COLOR_MAP_FG,
  TT_LAYOUT_COLOR_PREVIEW_BELOW,
  TT_LAYOUT_COLOR_PREVIEW_ABOVE,
  TT_LAYOUT_COLOR_LABELS,
};


/**
 * Layout color token table.
 */
 
static const thstok thtt_layout_color[] = {
  {"labels", TT_LAYOUT_COLOR_LABELS},
  {"map-bg", TT_LAYOUT_COLOR_MAP_BG},
  {"map-fg", TT_LAYOUT_COLOR_MAP_FG},
  {"preview-above", TT_LAYOUT_COLOR_PREVIEW_ABOVE},
  {"preview-below", TT_LAYOUT_COLOR_PREVIEW_BELOW},
  {NULL, TT_LAYOUT_COLOR_UNKNOWN}
};


/**
 * Layout color criterion tokens.
 */

enum {
  TT_LAYOUT_CCRIT_UNKNOWN = 0,
  TT_LAYOUT_CCRIT_ALTITUDE,
  TT_LAYOUT_CCRIT_DEPTH,
  TT_LAYOUT_CCRIT_TOPODATE,
  TT_LAYOUT_CCRIT_EXPLODATE,
  TT_LAYOUT_CCRIT_MAP,
  TT_LAYOUT_CCRIT_SCRAP,
};

static const thstok thtt_layout_ccrit[] = {
  {"altitude", TT_LAYOUT_CCRIT_ALTITUDE},
  {"altitudes", TT_LAYOUT_CCRIT_ALTITUDE},
  {"depth", TT_LAYOUT_CCRIT_DEPTH},
  {"topo-date", TT_LAYOUT_CCRIT_TOPODATE},
  {"explo-date", TT_LAYOUT_CCRIT_EXPLODATE},
  {"map", TT_LAYOUT_CCRIT_MAP},
  {"maps", TT_LAYOUT_CCRIT_MAP},
  {"scrap", TT_LAYOUT_CCRIT_SCRAP},
  {"scraps", TT_LAYOUT_CCRIT_SCRAP},
  {NULL, TT_LAYOUT_CCRIT_UNKNOWN}
};


/**
 * Layout color tables.
 */

enum {
  TT_LAYOUT_CTABLE_UNKNOWN = 0,
  TT_LAYOUT_CTABLE_HSV,
};

static const thstok thtt_layout_ctable[] = {
  {"hsv", TT_LAYOUT_CTABLE_HSV},
  {NULL, TT_LAYOUT_CTABLE_UNKNOWN}
};

enum {
  TT_LAYOUT_CMODE_AUTO,
  TT_LAYOUT_CMODE_TABLE,
  TT_LAYOUT_CMODE_MANUAL,
};



class thlayout_copy_src {

  public:
  
  const char * srcn;
  thlayout * srcptr;
  class thlayout_copy_src * next_src;
  thlayout_copy_src () : srcn(NULL), srcptr(NULL), next_src(NULL) {};
  
};


/**
 * layout command options parsing table.
 */
 
static const thstok thtt_layout_opt[] = {
  {"base-scale",TT_LAYOUT_BASE_SCALE},
  {"code",TT_LAYOUT_CODE},
  {"color",TT_LAYOUT_COLOR},
  {"color-legend",TT_LAYOUT_COLOR_LEGEND},
  {"colour",TT_LAYOUT_COLOR},
  {"colour-legend",TT_LAYOUT_COLOR_LEGEND},
  {"copy",TT_LAYOUT_COPY},
  {"debug",TT_LAYOUT_DEBUG},
  {"doc-author",TT_LAYOUT_DOC_AUTHOR},
  {"doc-keywords",TT_LAYOUT_DOC_KEYWORDS},
  {"doc-subject",TT_LAYOUT_DOC_SUBJECT},
  {"doc-title",TT_LAYOUT_DOC_TITLE},
  {"endcode",TT_LAYOUT_ENDCODE},
  {"exclude-pages",TT_LAYOUT_EXCLUDE_PAGES},
  {"grid",TT_LAYOUT_GRID},
  {"grid-coords",TT_LAYOUT_GRID_COORDS},
  {"grid-origin",TT_LAYOUT_GRID_ORIGIN},
  {"grid-size",TT_LAYOUT_GRID_SIZE},
  {"language",TT_LAYOUT_LANG},
  {"layers",TT_LAYOUT_LAYERS},
  {"legend",TT_LAYOUT_LEGEND},
  {"legend-columns",TT_LAYOUT_LEGEND_COLUMNS},
  {"legend-width",TT_LAYOUT_LEGEND_WIDTH},
  {"map-comment",TT_LAYOUT_DOC_COMMENT},
  {"map-header",TT_LAYOUT_MAP_HEADER},
  {"map-header-bg",TT_LAYOUT_MAP_HEADER_BG},
  {"map-image",TT_LAYOUT_MAP_IMAGE},
  {"nav-factor",TT_LAYOUT_NAV_FACTOR},
  {"nav-size",TT_LAYOUT_NAV_SIZE},
  {"north",TT_LAYOUT_NORTH},
  {"opacity",TT_LAYOUT_OPACITY},
  {"origin",TT_LAYOUT_ORIGIN},
  {"origin-label",TT_LAYOUT_ORIGIN_LABEL},
  {"overlap",TT_LAYOUT_OVERLAP},
  {"own-pages",TT_LAYOUT_OWN_PAGES},
  {"page-grid",TT_LAYOUT_PAGE_GRID},
  {"page-numbers",TT_LAYOUT_PAGE_NUMBERS},
  {"page-setup",TT_LAYOUT_PAGE_SETUP},
  {"rotate",TT_LAYOUT_ROTATE},
  {"scale", TT_LAYOUT_SCALE},
  {"scale-bar", TT_LAYOUT_SCALE_BAR},
  {"size", TT_LAYOUT_SIZE},
  {"sketches", TT_LAYOUT_SKETCHES},
  {"statistics",TT_LAYOUT_MAP_ITEM},
  {"surface",TT_LAYOUT_SURFACE},
  {"surface-opacity",TT_LAYOUT_SURFACE_OPACITY},
  {"survey-level",TT_LAYOUT_SURVEY_LEVEL},
  {"symbol-assign", TT_LAYOUT_SYMBOL_ASSIGN},
  {"symbol-color", TT_LAYOUT_SYMBOL_COLOR},
  {"symbol-colour", TT_LAYOUT_SYMBOL_COLOR},
  {"symbol-hide", TT_LAYOUT_SYMBOL_HIDE},
  {"symbol-set", TT_LAYOUT_SYMBOL_DEFAULTS},
  {"symbol-show", TT_LAYOUT_SYMBOL_SHOW},
  {"title-pages",TT_LAYOUT_TITLE_PAGES},
  {"transparency",TT_LAYOUT_TRANSPARENCY},
  {"units",TT_LAYOUT_UNITS},
  {NULL, TT_LAYOUT_UNKNOWN},
};



struct thlayout_map_image {
  double m_x, m_y;
  const char * m_fn;
  int m_align;
  thlayout_map_image() : m_x(0.0), m_y(0.0), m_fn(""), m_align(TT_LAYOUT_MAP_HEADER_OFF) {}
  bool defined();
  void parse(char ** args, const char * cpath);
};

typedef std::list<thlayout_map_image> thlayout_map_image_list;


/**
 * layout class.
 */

class thlayout : public thdataobject {

  public:

  class thconfig * m_pconfig;
    
  double scale, scale_bar, base_scale, ox, oy, oz, hsize, vsize, paphs, papvs, paghs, pagvs, marls, marts, gxs, gys, gzs, gox, goy, goz, navf, overlap, opacity,
    map_header_x, map_header_y, legend_width, surface_opacity, rotate;
  
  const char * olx, * oly, 
    * doc_title, * doc_comment, * doc_author, * doc_subject, * doc_keywords, * excl_list;
  
  unsigned navsx, navsy, ownp, legend_columns;
  
  char grid, ccode;
  
  int legend, color_legend, map_header, lang, north, max_explos, max_topos, max_cartos, max_copys,
    debug, survey_level, surface, grid_coords;
  
  thlayout_color color_map_bg, color_map_fg, color_preview_below, color_preview_above;
  int color_crit, // none, altitude, ...
   color_mode, // auto - values and colors, table - colors, manual
   color_table; // hsv, cool, hot ...

  
  thlayoutln * first_line, * last_line;
  
  bool titlep, transparency, layers, pgsnum, lock, excl_pages, page_grid, 
    map_header_bg, sketches, color_labels;

  int explo_lens, topo_lens;
		
	thlocale units;

  thlayout_map_image_list map_image_list;
  
  int def_grid_size, def_grid_origin, def_nav_factor, def_nav_size, 
    def_opacity, def_transparency, def_layers, def_base_scale,
    def_rotate, def_sketches, def_north,
    def_origin, def_origin_label, def_overlap, def_own_pages,
    def_page_numbers, def_page_setup, def_scale, def_size, def_title_pages,
    def_tex_lines, def_doc_title, def_doc_comment, def_doc_author, def_doc_subject,
    def_doc_keywords, def_excl_pages, def_grid, def_page_grid,
    def_legend, def_color_legend, def_legend_width, def_legend_columns, 
    def_map_header, def_lang, def_scale_bar, def_map_header_bg,
    def_max_explos, def_max_topos, def_max_cartos,
    def_max_copys, def_explo_lens, def_topo_lens, def_debug, def_survey_level, def_surface,
    def_surface_opacity, def_units, def_grid_coords, def_color_labels;
    
  
  thlayout_copy_src * first_copy_src, * last_copy_src;
  
  /**
   * Standard constructor.
   */
  
  thlayout();
  
  
  /**
   * Standard destructor.
   */
   
  ~thlayout();
  
  
  /**
   * Return class identifier.
   */
  
  virtual int get_class_id();
  
  
  /**
   * Return class name.
   */
   
  virtual const char * get_class_name() {return "thlayout";};
  
  
  /**
   * Return true, if son of given class.
   */
  
  virtual bool is(int class_id);
  
  
  /**
   * Return number of command arguments.
   */
   
  virtual int get_cmd_nargs();
  
  
  /**
   * Return command name.
   */
   
  virtual const char * get_cmd_name();
  
  
  /**
   * Return command end option.
   */
   
  virtual const char * get_cmd_end();
  
  
  /**
   * Return option description.
   */
   
  virtual thcmd_option_desc get_cmd_option_desc(const char * opts);
  thcmd_option_desc get_default_cod(int id);
  
  /**
   * Set command option.
   *
   * @param cod Command option description.
   * @param args Option arguments arry.
   * @param argenc Arguments encoding.
   */
   
  virtual void set(thcmd_option_desc cod, char ** args, int argenc, unsigned long indataline);


  /**
   * Delete this object.
   *
   * @warn Always use this methos instead of delete function.
   */
   
  virtual void self_delete();


  /**
   * Print object properties.
   */
   
  virtual void self_print_properties(FILE * outf); 
  

  /**
   * Print object in C++ format.
   */
   
  void self_print_library(); 
  

  /**
   * Get context for object.
   */
   
  virtual int get_context();
  
  /**
   * Parse option with 3 or 2 or 1 numbers and units.
   */
   
  void parse_len(double & d1, double & d2, double & d3, int nargs, char ** args, int nonneg = -1);
  void parse_len6(double & d1, double & d2, double & d3, double & d4, double & d5, double & d6, int nargs, char ** args, int nonneg = -1);


  /**
   * Export configuration file.
   */
   
  void export_config(FILE * o, thdb2dprj * prj, double x_scale, double x_origin_shx, double x_origin_shy);
  
  /**
   * Export main tex file.
   */
   
  void export_pdftex(FILE * o, thdb2dprj * prj, char mode);
  void export_mpost(FILE * o);
  void export_mpost_symbols(FILE * o, struct thsymbolset * symset);
  
  /**
   * Process copy.
   */
   
  void process_copy();
  
  bool is_debug_stations();
  bool is_debug_joins();
  bool is_debug_scrapnames();
  bool is_debug_stationnames();

  
  /**
   * set LAYOUT variable.
   */
   
  void set_thpdf_layout(thdb2dprj * prj, double x_scale, double x_origin_shx, double x_origin_shy);
   

};

/**
 * Copy src list.
 */
 
extern std::list <thlayout_copy_src> thlayout_copy_src_list;

#endif