libopencad
Main Page
Classes
Files
File List
cadheader.h
1
/*******************************************************************************
2
* Project: libopencad
3
* Purpose: OpenSource CAD formats support library
4
* Author: Alexandr Borzykh, mush3d at gmail.com
5
* Author: Dmitry Baryshnikov, bishop.dev@gmail.com
6
* Language: C++
7
*******************************************************************************
8
* The MIT License (MIT)
9
*
10
* Copyright (c) 2016 Alexandr Borzykh
11
* Copyright (c) 2016 NextGIS, <info@nextgis.com>
12
*
13
* Permission is hereby granted, free of charge, to any person obtaining a copy
14
* of this software and associated documentation files (the "Software"), to deal
15
* in the Software without restriction, including without limitation the rights
16
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
* copies of the Software, and to permit persons to whom the Software is
18
* furnished to do so, subject to the following conditions:
19
*
20
* The above copyright notice and this permission notice shall be included in all
21
* copies or substantial portions of the Software.
22
*
23
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
* SOFTWARE.
30
*******************************************************************************/
31
#ifndef CADHEADER_H
32
#define CADHEADER_H
33
34
#include "opencad.h"
35
#include <map>
36
#include <string>
37
#include <vector>
38
39
class
OCAD_EXTERN
CADHandle
final
40
{
41
public
:
42
CADHandle
(
unsigned
char
codeIn = 0);
43
CADHandle
(
const
CADHandle
& other);
44
CADHandle
& operator = (
const
CADHandle
& other);
45
void
addOffset(
unsigned
char
val);
46
bool
isNull()
const
;
47
long
getAsLong()
const
;
48
long
getAsLong(
const
CADHandle
&ref_handle )
const
;
49
protected
:
50
unsigned
char
code;
51
std::vector<unsigned char> handleOrOffset;
52
};
53
54
class
OCAD_EXTERN
CADVariant
final
55
{
56
public
:
57
enum class
DataType
58
{
59
INVALID = 0,
60
DECIMAL,
61
REAL,
62
STRING,
63
DATETIME,
64
COORDINATES,
65
HANDLE
66
};
67
68
public
:
69
CADVariant
();
70
CADVariant
(
const
char
* val);
71
CADVariant
(
int
val);
72
CADVariant
(
short
val);
73
CADVariant
(
double
val);
74
CADVariant
(
double
x,
double
y,
double
z = 0);
75
CADVariant
(
const
CADHandle
& val);
76
CADVariant
(
const
std::string &val);
77
CADVariant
(time_t val);
78
public
:
79
CADVariant
(
const
CADVariant
& orig);
80
CADVariant
& operator = (
const
CADVariant
& orig);
81
public
:
82
long
getDecimal()
const
;
83
double
getReal()
const
;
84
const
std::string &getString()
const
;
85
enum
DataType getType()
const
;
86
double
getX()
const
;
87
double
getY()
const
;
88
double
getZ()
const
;
89
const
CADHandle
&getHandle()
const
;
90
protected
:
91
enum
DataType type;
92
long
decimalVal;
93
double
xVal;
94
double
yVal;
95
double
zVal;
96
std::string stringVal;
97
CADHandle
handleVal;
98
time_t dateTimeVal;
99
};
100
101
105
class
OCAD_EXTERN
CADHeader
106
{
107
public
:
112
enum
CADHeaderConstants
113
{
114
OPENCADVER = 1,
115
ACADMAINTVER
,
116
ACADVER,
126
ANGBASE
,
127
ANGDIR
,
128
ATTMODE
,
129
ATTREQ
,
130
ATTDIA
,
131
AUNITS
,
132
AUPREC
,
133
CECOLOR
,
134
CELTSCALE
,
135
CELTYPE
,
136
CELWEIGHT
,
137
CEPSNID,
140
CEPSNTYPE,
145
CHAMFERA
,
146
CHAMFERB
,
147
CHAMFERC
,
148
CHAMFERD
,
149
CLAYER
,
150
CMLJUST,
154
CMLSCALE
,
155
CMLSTYLE
,
156
CSHADOW,
161
DIMADEC,
163
DIMALT
,
164
DIMALTD
,
165
DIMALTF
,
166
DIMALTRND
,
167
DIMALTTD,
169
DIMALTTZ,
175
DIMALTU,
184
DIMALTZ,
190
DIMAPOST
,
191
DIMASO,
193
DIMASSOC,
208
DIMASZ
,
209
DIMATFIT,
219
DIMAUNIT,
225
DIMAZIN,
231
DIMBLK
,
232
DIMBLK1
,
233
DIMBLK2
,
234
DIMCEN
,
235
DIMCLRD,
237
DIMCLRE,
239
DIMCLRT,
241
DIMDEC,
243
DIMDLE
,
244
DIMDLI
,
245
DIMDSEP,
247
DIMEXE
,
248
DIMEXO
,
249
DIMFAC,
253
DIMGAP
,
254
DIMJUST,
265
DIMLDRBLK
,
266
DIMLFAC
,
267
DIMLIM
,
268
DIMLUNIT,
275
DIMLWD,
280
DIMLWE,
285
DIMPOST
,
286
DIMRND
,
287
DIMSAH
,
288
DIMSCALE
,
289
DIMSD1,
292
DIMSD2,
295
DIMSE1
,
296
DIMSE2
,
297
DIMSHO,
299
DIMSOXD,
301
DIMSTYLE
,
302
DIMTAD
,
303
DIMTDEC,
305
DIMTFAC
,
306
DIMTIH
,
307
DIMTIX
,
308
DIMTM
,
309
DIMTMOVE,
313
DIMTOFL,
315
DIMTOH
,
316
DIMTOL
,
317
DIMTOLJ,
321
DIMTP
,
322
DIMTSZ,
324
DIMTVP
,
325
DIMTXSTY
,
326
DIMTXT
,
327
DIMTZIN,
332
DIMUPT,
336
DIMZIN,
342
DISPSILH,
346
DRAGVS,
348
DWGCODEPAGE,
351
ELEVATION
,
352
ENDCAPS,
357
EXTMAX,
359
EXTMIN,
361
EXTNAMES,
372
FILLETRAD
,
373
FILLMODE
,
374
FINGERPRINTGUID,
376
HALOGAP,
382
HANDSEED
,
383
HIDETEXT,
387
HYPERLINKBASE,
389
INDEXCTL,
395
INSBASE
,
396
INSUNITS,
419
INTERFERECOLOR,
422
INTERFEREOBJVS,
425
INTERFEREVPVS,
428
INTERSECTIONCOLOR,
434
INTERSECTIONDISPLAY,
439
JOINSTYLE,
444
LIMCHECK
,
445
LIMMAX
,
446
LIMMIN
,
447
LTSCALE
,
448
LUNITS
,
449
LUPREC
,
450
LWDISPLAY,
454
MAXACTVP
,
455
MEASUREMENT,
458
MENU
,
459
MIRRTEXT
,
460
OBSCOLOR,
468
OBSLTYPE,
485
ORTHOMODE
,
486
PDMODE
,
487
PDSIZE
,
488
PELEVATION
,
489
PEXTMAX
,
490
PEXTMIN
,
491
PINSBASE
,
492
PLIMCHECK
,
493
PLIMMAX
,
494
PLIMMIN
,
495
PLINEGEN,
501
PLINEWID
,
502
PROJECTNAME,
510
PROXYGRAPHICS
,
511
PSLTSCALE,
514
PSTYLEMODE,
520
PSVPSCALE,
523
PUCSBASE,
526
PUCSNAME
,
527
PUCSORG
,
528
PUCSORGBACK,
531
PUCSORGBOTTOM,
534
PUCSORGFRONT,
537
PUCSORGLEFT,
540
PUCSORGRIGHT,
543
PUCSORGTOP,
546
PUCSORTHOREF,
550
PUCSORTHOVIEW,
558
PUCSXDIR
,
559
PUCSYDIR
,
560
QTEXTMODE
,
561
REGENMODE
,
562
SHADEDGE,
566
SHADEDIF,
568
SHADOWPLANELOCATION,
570
SKETCHINC
,
571
SKPOLY,
573
SORTENTS,
584
SPLINESEGS
,
585
SPLINETYPE
,
586
SURFTAB1
,
587
SURFTAB2
,
588
SURFTYPE
,
589
SURFU
,
590
SURFV
,
591
TDCREATE,
593
TDINDWG
,
594
TDUCREATE
,
595
TDUPDATE
,
596
TDUSRTIMER
,
597
TDUUPDATE
,
598
TEXTSIZE
,
599
TEXTSTYLE
,
600
THICKNESS
,
601
TILEMODE,
603
TRACEWID
,
604
TREEDEPTH
,
605
UCSBASE,
607
UCSNAME
,
608
UCSORG
,
609
UCSORGBACK,
612
UCSORGBOTTOM,
615
UCSORGFRONT,
618
UCSORGLEFT,
621
UCSORGRIGHT,
624
UCSORGTOP,
627
UCSORTHOREF,
631
UCSORTHOVIEW,
639
UCSXDIR
,
640
UCSYDIR
,
641
UNITMODE,
643
USERI1,
645
USERI2,
646
USERI3,
647
USERI4,
648
USERI5,
649
USERR1,
651
USERR2,
652
USERR3,
653
USERR4,
654
USERR5,
655
USRTIMER,
657
VERSIONGUID,
659
VISRETAIN,
661
WORLDVIEW,
663
XCLIPFRAME,
667
XEDIT,
671
SPLFRAME,
672
WORDLVIEW
,
673
PELLIPSE
,
674
ISOLINES
,
675
TEXTQLTY
,
676
FACETRES
,
677
DIMFRAC
,
678
OLESTARTUP
,
679
STYLESHEET
,
680
TSTACKALIGN
,
681
TSTACKSIZE
,
682
MAX_HEADER_CONSTANT = 1000
684
};
685
public
:
686
CADHeader
();
693
int
addValue(
short
code,
const
CADVariant
& val);
694
int
addValue(
short
code,
const
char
* val);
695
int
addValue(
short
code,
long
val);
696
int
addValue(
short
code,
int
val);
697
int
addValue(
short
code,
short
val);
698
int
addValue(
short
code,
double
val);
699
int
addValue(
short
code,
const
std::string& val);
700
int
addValue(
short
code,
bool
val);
701
int
addValue(
short
code,
double
x,
double
y,
double
z = 0);
702
int
addValue(
short
code,
long
julianday,
long
milliseconds);
703
int
getGroupCode(
short
code)
const
;
704
const
CADVariant
& getValue(
short
code,
705
const
CADVariant
& val =
CADVariant
())
const
;
706
const
char
* getValueName(
short
code)
const
;
707
void
print()
const
;
708
protected
:
709
std::map<short, CADVariant> valuesMap;
710
};
711
712
#endif // CADHEADER_H
CADHeader::TSTACKSIZE
Definition:
cadheader.h:681
CADHandle
Definition:
cadheader.h:39
CADHeader::MIRRTEXT
Definition:
cadheader.h:459
CADHeader::SPLINESEGS
Definition:
cadheader.h:584
CADHeader::ATTMODE
Definition:
cadheader.h:128
CADHeader::UCSNAME
Definition:
cadheader.h:607
CADHeader::TREEDEPTH
Definition:
cadheader.h:604
CADHeader::DIMPOST
Definition:
cadheader.h:285
CADHeader::CADHeaderConstants
CADHeaderConstants
The CAD нeader сonstants enum get from dxf reference: http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-A85E8E67-27CD-4C59-BE61-4DC9FADBE74A.
Definition:
cadheader.h:112
CADHeader::ISOLINES
Definition:
cadheader.h:674
CADHeader::AUPREC
Definition:
cadheader.h:132
CADHeader::CHAMFERD
Definition:
cadheader.h:148
CADHeader::TEXTSIZE
Definition:
cadheader.h:598
CADHeader::LUNITS
Definition:
cadheader.h:448
CADHeader::TEXTQLTY
Definition:
cadheader.h:675
CADHeader::ATTREQ
Definition:
cadheader.h:129
CADHeader::DIMTIH
Definition:
cadheader.h:306
CADHeader::TSTACKALIGN
Definition:
cadheader.h:680
CADHeader::THICKNESS
Definition:
cadheader.h:600
CADHeader::DIMASZ
Definition:
cadheader.h:208
CADHeader::DIMCEN
Definition:
cadheader.h:234
CADHeader::CMLSTYLE
Definition:
cadheader.h:155
CADHeader::SURFTAB2
Definition:
cadheader.h:587
CADHeader::OLESTARTUP
Definition:
cadheader.h:678
CADHeader::DIMTM
Definition:
cadheader.h:308
CADHeader::TDUUPDATE
Definition:
cadheader.h:597
CADHeader::UCSYDIR
Definition:
cadheader.h:640
CADHeader::CELTSCALE
Definition:
cadheader.h:134
CADHeader::SKETCHINC
Definition:
cadheader.h:570
CADHeader::ANGBASE
Definition:
cadheader.h:126
CADHeader::FILLMODE
Definition:
cadheader.h:373
CADHeader::PELLIPSE
Definition:
cadheader.h:673
CADHeader::STYLESHEET
Definition:
cadheader.h:679
CADHeader::INSBASE
Definition:
cadheader.h:395
CADHeader::WORDLVIEW
Definition:
cadheader.h:672
CADHeader::LIMMIN
Definition:
cadheader.h:446
CADHeader::DIMLIM
Definition:
cadheader.h:267
CADHeader::PLIMMIN
Definition:
cadheader.h:494
CADHeader::PDSIZE
Definition:
cadheader.h:487
CADHeader::PLIMCHECK
Definition:
cadheader.h:492
CADHeader::PDMODE
Definition:
cadheader.h:486
CADHeader::SURFTYPE
Definition:
cadheader.h:588
CADHeader::PUCSYDIR
Definition:
cadheader.h:559
CADHeader::TDUCREATE
Definition:
cadheader.h:594
CADHeader::DIMALTD
Definition:
cadheader.h:164
CADHeader::QTEXTMODE
Definition:
cadheader.h:560
CADHeader::TDUPDATE
Definition:
cadheader.h:595
CADHeader::UCSXDIR
Definition:
cadheader.h:639
CADHeader::CECOLOR
Definition:
cadheader.h:133
CADHeader::DIMGAP
Definition:
cadheader.h:253
CADHeader::ORTHOMODE
Definition:
cadheader.h:485
CADHeader::CLAYER
Definition:
cadheader.h:149
CADHeader
The common CAD header class.
Definition:
cadheader.h:105
CADHeader::CMLSCALE
Definition:
cadheader.h:154
CADHeader::DIMSE2
Definition:
cadheader.h:296
CADHeader::CHAMFERB
Definition:
cadheader.h:146
CADHeader::PELEVATION
Definition:
cadheader.h:488
CADHeader::DIMTVP
Definition:
cadheader.h:324
CADHeader::DIMBLK2
Definition:
cadheader.h:233
CADHeader::DIMSAH
Definition:
cadheader.h:287
CADHeader::TDUSRTIMER
Definition:
cadheader.h:596
CADHeader::PEXTMIN
Definition:
cadheader.h:490
CADHeader::DIMEXO
Definition:
cadheader.h:248
CADHeader::TDINDWG
Definition:
cadheader.h:593
CADHeader::PLINEWID
Definition:
cadheader.h:501
CADHeader::UCSORG
Definition:
cadheader.h:608
CADHeader::CHAMFERC
Definition:
cadheader.h:147
CADHeader::CELTYPE
Definition:
cadheader.h:135
CADHeader::DIMTXT
Definition:
cadheader.h:326
CADHeader::SPLINETYPE
Definition:
cadheader.h:585
CADHeader::HANDSEED
Definition:
cadheader.h:382
CADHeader::PINSBASE
Definition:
cadheader.h:491
CADHeader::SURFTAB1
Definition:
cadheader.h:586
CADHeader::DIMTIX
Definition:
cadheader.h:307
CADVariant
Definition:
cadheader.h:54
CADHeader::DIMTOL
Definition:
cadheader.h:316
CADHeader::PEXTMAX
Definition:
cadheader.h:489
CADHeader::DIMLDRBLK
Definition:
cadheader.h:265
CADHeader::DIMTFAC
Definition:
cadheader.h:305
CADHeader::DIMSTYLE
Definition:
cadheader.h:301
CADHeader::CELWEIGHT
Definition:
cadheader.h:136
CADHeader::DIMALTRND
Definition:
cadheader.h:166
CADHeader::DIMTP
Definition:
cadheader.h:321
CADHeader::PROXYGRAPHICS
Definition:
cadheader.h:510
CADHeader::CHAMFERA
Definition:
cadheader.h:145
CADHeader::DIMALTF
Definition:
cadheader.h:165
CADHeader::SURFV
Definition:
cadheader.h:590
CADHeader::DIMBLK
Definition:
cadheader.h:231
CADHeader::DIMSE1
Definition:
cadheader.h:295
CADHeader::LIMCHECK
Definition:
cadheader.h:444
CADHeader::DIMTAD
Definition:
cadheader.h:302
CADHeader::ATTDIA
Definition:
cadheader.h:130
CADHeader::LUPREC
Definition:
cadheader.h:449
CADHeader::MENU
Definition:
cadheader.h:458
CADHeader::TRACEWID
Definition:
cadheader.h:603
CADHeader::ELEVATION
Definition:
cadheader.h:351
CADHeader::DIMRND
Definition:
cadheader.h:286
CADHeader::DIMAPOST
Definition:
cadheader.h:190
CADHeader::DIMBLK1
Definition:
cadheader.h:232
CADHeader::DIMSCALE
Definition:
cadheader.h:288
CADHeader::LTSCALE
Definition:
cadheader.h:447
CADHeader::ACADMAINTVER
Definition:
cadheader.h:115
CADHeader::DIMLFAC
Definition:
cadheader.h:266
CADHeader::TEXTSTYLE
Definition:
cadheader.h:599
CADHeader::REGENMODE
Definition:
cadheader.h:561
CADHeader::DIMDLI
Definition:
cadheader.h:244
CADHeader::ANGDIR
Definition:
cadheader.h:127
CADHeader::DIMTOH
Definition:
cadheader.h:315
CADHeader::AUNITS
Definition:
cadheader.h:131
CADHeader::DIMEXE
Definition:
cadheader.h:247
CADHeader::PUCSXDIR
Definition:
cadheader.h:558
CADHeader::DIMALT
Definition:
cadheader.h:163
CADHeader::PUCSNAME
Definition:
cadheader.h:526
CADHeader::PLIMMAX
Definition:
cadheader.h:493
CADHeader::DIMDLE
Definition:
cadheader.h:243
CADHeader::FACETRES
Definition:
cadheader.h:676
CADHeader::MAXACTVP
Definition:
cadheader.h:454
CADHeader::DIMFRAC
Definition:
cadheader.h:677
CADHeader::FILLETRAD
Definition:
cadheader.h:372
CADHeader::DIMTXSTY
Definition:
cadheader.h:325
CADHeader::SURFU
Definition:
cadheader.h:589
CADHeader::PUCSORG
Definition:
cadheader.h:527
CADHeader::LIMMAX
Definition:
cadheader.h:445
Generated by
1.8.11