libopencad
cadobjects.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 
32 #ifndef CADOBJECTS_H
33 #define CADOBJECTS_H
34 
35 #include "cadheader.h"
36 
37 using namespace std;
38 
39 class CADVector
40 {
41 public:
42  CADVector();
43  CADVector( double dx, double dy);
44  CADVector( double dx, double dy, double dz);
45  CADVector(const CADVector& other);
46  bool operator == (const CADVector& second);
47  CADVector operator = (const CADVector& second);
48  double getX() const;
49  void setX(double value);
50 
51  double getY() const;
52  void setY(double value);
53 
54  double getZ() const;
55  void setZ(double value);
56 
57  bool getBHasZ() const;
58  void setBHasZ(bool value);
59 
60 protected:
61  inline bool fcmp(double x, double y);
62 protected:
63  double X;
64  double Y;
65  double Z;
66  bool bHasZ;
67 };
68 
69 typedef struct _Eed
70 {
71  short dLength = 0;
72  CADHandle hApplication;
73  vector<unsigned char> acData;
74 } CADEed;
75 
76 typedef vector<CADHandle> CADHandleArray;
77 typedef vector<CADEed> CADEedArray;
78 
82 class CADObject
83 {
84 public:
85  enum ObjectType
86  {
87  UNUSED = 0x0,
88  TEXT = 0x1,
89  ATTRIB = 0x2,
90  ATTDEF = 0x3,
91  BLOCK = 0x4,
92  ENDBLK = 0x5,
93  SEQEND = 0x6,
94  INSERT = 0x7,
95  MINSERT1 = 0x8,
96  MINSERT2 = 0x9,
97  VERTEX2D = 0x0A,
98  VERTEX3D = 0x0B,
99  VERTEX_MESH = 0x0C,
100  VERTEX_PFACE = 0x0D,
101  VERTEX_PFACE_FACE = 0x0E,
102  POLYLINE2D = 0x0F,
103  POLYLINE3D = 0x10,
104  ARC = 0x11,
105  CIRCLE = 0x12,
106  LINE = 0x13,
107  DIMENSION_ORDINATE = 0x14,
108  DIMENSION_LINEAR = 0x15,
109  DIMENSION_ALIGNED = 0x16,
110  DIMENSION_ANG_3PT = 0x17,
111  DIMENSION_ANG_2LN = 0x18,
112  DIMENSION_RADIUS = 0x19,
113  DIMENSION_DIAMETER = 0x1A,
114  POINT = 0x1B,
115  FACE3D = 0x1C,
116  POLYLINE_PFACE = 0x1D,
117  POLYLINE_MESH = 0x1E,
118  SOLID = 0x1F,
119  TRACE = 0x20,
120  SHAPE = 0x21,
121  VIEWPORT = 0x22,
122  ELLIPSE = 0x23,
123  SPLINE = 0x24,
124  REGION = 0x25,
125  SOLID3D = 0x26,
126  BODY = 0x27,
127  RAY = 0x28,
128  XLINE = 0x29,
129  DICTIONARY = 0x2A,
130  OLEFRAME = 0x2B,
131  MTEXT = 0x2C,
132  LEADER = 0x2D,
133  TOLERANCE = 0x2E,
134  MLINE = 0x2F,
135  BLOCK_CONTROL_OBJ = 0x30,
136  BLOCK_HEADER = 0x31,
137  LAYER_CONTROL_OBJ = 0x32,
138  LAYER = 0x33,
139  STYLE_CONTROL_OBJ = 0x34,
140  STYLE1 = 0x35,
141  STYLE2 = 0x36,
142  STYLE3 = 0x37,
143  LTYPE_CONTROL_OBJ = 0x38,
144  LTYPE1 = 0x39,
145  LTYPE2 = 0x3A,
146  LTYPE3 = 0x3B,
147  VIEW_CONTROL_OBJ = 0x3C,
148  VIEW = 0x3D,
149  UCS_CONTROL_OBJ = 0x3E,
150  UCS = 0x3F,
151  VPORT_CONTROL_OBJ = 0x40,
152  VPORT = 0x41,
153  APPID_CONTROL_OBJ = 0x42,
154  APPID = 0x43,
155  DIMSTYLE_CONTROL_OBJ = 0x44,
156  DIMSTYLE = 0x45,
157  VP_ENT_HDR_CTRL_OBJ = 0x46,
158  VP_ENT_HDR = 0x47,
159  GROUP = 0x48,
160  MLINESTYLE = 0x49,
161  OLE2FRAME = 0x4A,
162  DUMMY = 0x4B,
163  LONG_TRANSACTION = 0x4C,
164  LWPOLYLINE = 0x4D,
165  HATCH = 0x4E,
166  XRECORD = 0x4F,
167  ACDBPLACEHOLDER = 0x50,
168  VBA_PROJECT = 0x51,
169  LAYOUT = 0x52,
170  // Codes below arent fixed, libopencad uses it for reading, in writing it will be different!
171  CELLSTYLEMAP = 0x53,
172  DBCOLOR = 0x54,
173  DICTIONARYVAR = 0x55,
174  DICTIONARYWDFLT = 0x56,
175  FIELD = 0x57,
176  GROUP_UNFIXED = 0x58,
177  HATCH_UNFIXED = 0x59,
178  IDBUFFER = 0x5A,
179  IMAGE = 0x5B,
180  IMAGEDEF = 0x5C,
181  IMAGEDEFREACTOR = 0x5D,
182  LAYER_INDEX = 0x5E,
183  LAYOUT_UNFIXED = 0x5F,
184  LWPOLYLINE_UNFIXED = 0x60,
185  MATERIAL = 0x61,
186  MLEADER = 0x62,
187  MLEADERSTYLE = 0x63,
188  OLE2FRAME_UNFIXED = 0x64,
189  PLACEHOLDER = 0x65,
190  PLOTSETTINGS = 0x66,
191  RASTERVARIABLES = 0x67,
192  SCALE = 0x68,
193  SORTENTSTABLE = 0x69,
194  SPATIAL_FILTER = 0x6A,
195  SPATIAL_INDEX = 0x6B,
196  TABLEGEOMETRY = 0x6C,
197  TABLESTYLES = 0x6D,
198  VBA_PROJECT_UNFIXED = 0x6E,
199  VISUALSTYLE = 0x6F,
200  WIPEOUTVARIABLE = 0x70,
201  XRECORD_UNFIXED = 0x71
202  };
203 
204 
205  ObjectType getType() const;
206  long getSize() const;
207 
208  void setSize(long value);
209 
210  void setType(const ObjectType &value);
211 
212  short getCRC() const;
213  void setCRC(short value);
214 
215 protected:
216  long size;
217  ObjectType type;
218  short CRC;
219 };
220 
221 
222 
223 string getNameByType(CADObject::ObjectType eType);
224 bool isGeometryType(short nType);
225 
230 {
231  long nObjectSizeInBits;
232  CADHandle hObjectHandle;
233  CADEedArray aEED;
234 
235  bool bGraphicsPresented;
236  vector<char> abyGraphicsData;
237 
238  unsigned char bbEntMode;
239  long nNumReactors;
240 
241  bool bNoXDictionaryHandlePresent;
242  bool bBinaryDataPresent;
243 
244  bool bIsByLayerLT; // R13-14 only
245 
246  bool bNoLinks;
247  short nCMColor;
248 
249  double dfLTypeScale;
250  unsigned char bbLTypeFlags;
251  unsigned char bbPlotStyleFlags;
252  char bbMaterialFlags;
253  char nShadowFlags;
254 
255  short nInvisibility;
256  unsigned char nLineWeight;
257 };
258 
263 {
264  CADHandle hOwner; // depends on entmode.
265  CADHandleArray hReactors;
266  CADHandle hXDictionary;
267  CADHandle hLayer;
268  CADHandle hLType;
269 
270  CADHandle hPrevEntity;
271  CADHandle hNextEntity;
272 
273  CADHandle hColorBookHandle;
274 
275  CADHandle hMaterial;
276  CADHandle hPlotStyle;
277 
278  CADHandle hFullVisualStyle;
279  CADHandle hFaceVisualStyle;
280  CADHandle hEdgeVisualStyle;
281 };
282 
283 /*
284  * @brief The abstract class, which contains data common to all entities
285  */
287 {
288 public:
289  struct CADCommonED stCed;
290  struct CADCommonEHD stChed;
291 };
292 
297 {
298 public:
299  CADTextObject();
300  unsigned char DataFlags;
301  double dfElevation;
302  CADVector vertInsetionPoint;
303  CADVector vertAlignmentPoint;
304  CADVector vectExtrusion;
305  double dfThickness;
306  double dfObliqueAng;
307  double dfRotationAng;
308  double dfHeight;
309  double dfWidthFactor;
310  string sTextValue;
311  short dGeneration;
312  short dHorizAlign;
313  short dVertAlign;
314 
315  CADHandle hStyle;
316 };
317 
322 {
323 public:
324  CADAttribObject();
325  unsigned char DataFlags;
326  double dfElevation;
327  CADVector vertInsetionPoint;
328  CADVector vertAlignmentPoint;
329  CADVector vectExtrusion;
330  double dfThickness;
331  double dfObliqueAng;
332  double dfRotationAng;
333  double dfHeight;
334  double dfWidthFactor;
335  string sTextValue;
336  short dGeneration;
337  short dHorizAlign;
338  short dVertAlign;
339  char dVersion; // R2010+
340  string sTag;
341  short nFieldLength;
342  unsigned char nFlags;
343  bool bLockPosition;
344 
345  CADHandle hStyle;
346 };
347 
352 {
353 public:
354  CADAttdefObject();
355  string sPrompt;
356 };
357 
362 {
363 public:
364  CADBlockObject();
365  string sBlockName;
366 };
367 
371 //TODO: do we need this class? Maybe CADEntityObject enouth?
373 {
374 public:
375  CADEndblkObject();
376  // it actually has nothing more thatn CED and CEHD.
377 };
378 
382 //TODO: do we need this class? Maybe CADEntityObject enouth?
384 {
385 public:
386  CADSeqendObject();
387  // it actually has nothing more thatn CED and CEHD.
388 };
389 
394 {
395 public:
396  CADInsertObject();
397  CADVector vertInsertionPoint;
398  CADVector vertScales;
399  double dfRotation;
400  CADVector vectExtrusion;
401  bool bHasAttribs;
402  long nObjectsOwned;
403 
404  CADHandle hBlockHeader;
405  CADHandleArray hAtrribs;
406  CADHandle hSeqend; // if bHasAttribs == true
407 };
408 
413 {
414 public:
416  CADVector vertInsertionPoint;
417  CADVector vertScales;
418  double dfRotation;
419  CADVector vectExtrusion;
420  bool bHasAttribs;
421  long nObjectsOwned;
422 
423  short nNumCols;
424  short nNumRows;
425  short nColSpacing;
426  short nRowSpacing;
427 
428  CADHandle hBlockHeader;
429  CADHandleArray hAtrribs;
430  CADHandle hSeqend; // if bHasAttribs == true
431 };
432 
437 {
438 public:
440  CADVector vertPosition; // Z must be taken from 2d polyline elevation.
441  double dfStartWidth;
442  double dfEndWidth;
443  double dfBulge;
444  long nVertexID;
445  double dfTangentDir;
446 
447 /* NOTES: Neither elevation nor thickness are present in the 2D VERTEX data.
448  * Both should be taken from the 2D POLYLINE entity (15)
449  */
450 };
451 
455 // TODO: do we need so many identical classes. Maybe CADVector(enum ObjectType eType)
456 // for all cases?
458 {
459 public:
461 
462  CADVector vertPosition;
463 };
464 
469 {
470 public:
472  CADVector vertPosition;
473 };
474 
479 {
480 public:
482  CADVector vertPosition;
483 };
484 
489 {
490 public:
492  // TODO: check DXF ref to get info what does it mean.
493  short iVertexIndex1;
494  short iVertexIndex2;
495  short iVertexIndex3;
496  short iVertexIndex4;
497 };
498 
503 {
504 public:
506 
507  short dFlags;
508  short dCurveNSmoothSurfType;
509  double dfStartWidth;
510  double dfEndWidth;
511  double dfThickness;
512  double dfElevation;
513  CADVector vectExtrusion;
514 
515  long nObjectsOwned;
516 
517  CADHandleArray hVertexes; // content really depends on DWG version.
518 
519  CADHandle hSeqend;
520 };
521 
526 {
527 public:
529  unsigned char SplinedFlags;
530  unsigned char ClosedFlags;
531 
532  long nObjectsOwned;
533 
534  CADHandleArray hVertexes; // content really depends on DWG version.
535 
536  CADHandle hSeqend;
537 };
538 
543 {
544 public:
545  CADArcObject();
546  CADVector vertPosition;
547  double dfRadius;
548  double dfThickness;
549  CADVector vectExtrusion;
550  double dfStartAngle;
551  double dfEndAngle;
552 };
553 
558 {
559 public:
560  CADCircleObject();
561  CADVector vertPosition;
562  double dfRadius;
563  double dfThickness;
564  CADVector vectExtrusion;
565 };
566 
571 {
572 public:
573  CADLineObject();
574  CADVector vertStart;
575  CADVector vertEnd;
576  double dfThickness;
577  CADVector vectExtrusion;
578 };
579 
584 {
585 public:
587  long nObjectSizeInBits;
588  CADHandle hObjectHandle;
589  CADEedArray aEED;
590  long nNumReactors;
591  bool bNoXDictionaryPresent;
592  long nNumEntries; // doesnt count MODELSPACE and PAPERSPACE
593  CADHandle hNull;
594  CADHandle hXDictionary;
595  CADHandleArray hBlocks; // ends with modelspace and paperspace handles.
596 };
597 
602 {
603 public:
605  long nObjectSizeInBits;
606  CADHandle hObjectHandle;
607  CADEedArray aEED;
608  long nNumReactors;
609  bool bNoXDictionaryPresent;
610  string sEntryName;
611  bool b64Flag;
612  short dXRefIndex;
613  bool bXDep;
614  bool bAnonymous;
615  bool bHasAtts;
616  bool bBlkisXRef;
617  bool bXRefOverlaid;
618  bool bLoadedBit;
619  long nOwnedObjectsCount;
620  CADVector vertBasePoint;
621  string sXRefPName;
622  vector<unsigned char> adInsertCount; // TODO: ???
623  string sBlockDescription;
624  long nSizeOfPreviewData;
625  vector<unsigned char> abyBinaryPreviewData;
626  short nInsertUnits;
627  bool bExplodable;
628  char dBlockScaling;
629  CADHandle hBlockControl;
630  vector<CADHandle> hReactors;
631  CADHandle hXDictionary;
632  CADHandle hNull;
633  CADHandle hBlockEntity;
634  CADHandleArray hEntities;
635  CADHandle hEndBlk;
636  CADHandleArray hInsertHandles;
637  CADHandle hLayout;
638 };
639 
644 {
645 public:
647 
648  long nObjectSizeInBits;
649  CADHandle hObjectHandle;
650  CADEedArray aEED;
651  long nNumReactors;
652  bool bNoXDictionaryPresent;
653  long nNumEntries; // counts layer "0"
654  CADHandle hNull;
655  CADHandle hXDictionary;
656  CADHandleArray hLayers;
657 };
658 
662 class CADLayerObject : public CADObject
663 {
664 public:
665  CADLayerObject();
666 
667  long nObjectSizeInBits;
668  CADHandle hObjectHandle;
669  CADEedArray aEED;
670  long nNumReactors;
671  bool bNoXDictionaryPresent;
672  string sLayerName;
673  bool b64Flag;
674  short dXRefIndex;
675  bool bXDep;
676  bool bFrozen;
677  bool bOn;
678  bool bFrozenInNewVPORT;
679  bool bLocked;
680  bool bPlottingFlag;
681  short dLineWeight;
682  short dCMColor;
683 
684  CADHandle hLayerControl;
685  CADHandleArray hReactors;
686  CADHandle hXDictionary;
687  CADHandle hExternalRefBlockHandle;
688  CADHandle hPlotStyle;
689  CADHandle hMaterial;
690  CADHandle hLType;
691  CADHandle hUnknownHandle;
692 };
693 
698 {
699 public:
701 
702  long nObjectSizeInBits;
703  CADHandle hObjectHandle;
704  CADEedArray aEED;
705  long nNumReactors;
706  bool bNoXDictionaryPresent;
707  long nNumEntries; // doesnt count BYBLOCK / BYLAYER.
708  CADHandle hNull;
709  CADHandle hXDictionary;
710  CADHandleArray hLTypes;
711 };
712 
713 
714 typedef struct _dash
715 {
716  double dfLength;
717  short dComplexShapecode;
718  double dfXOffset;
719  double dfYOffset;
720  double dfScale;
721  double dfRotation;
722  short dShapeflag;
723 } CADDash;
724 
729 {
730 public:
732 
733  long nObjectSizeInBits;
734  CADHandle hObjectHandle;
735  CADEedArray aEED;
736  long nNumReactors;
737  bool bNoXDictionaryPresent;
738  string sEntryName;
739  bool b64Flag;
740  short dXRefIndex;
741  bool bXDep;
742  string sDescription;
743  double dfPatternLen;
744  unsigned char dAlignment;
745  unsigned char nNumDashes;
746  vector<CADDash> astDashes;
747  vector<unsigned char> abyTextArea; // TODO: what is it?
748  CADHandle hLTControl;
749  CADHandleArray hReactors;
750  CADHandle hXDictionary;
751  CADHandle hXRefBlock;
752  CADHandleArray hShapefiles; // TODO: one for each dash?
753 };
754 
759 {
760 public:
761  CADPointObject();
762 
763  CADVector vertPosition;
764  double dfThickness;
765  CADVector vectExtrusion;
766  double dfXAxisAng;
767 };
768 
773 {
774 public:
775  CADSolidObject();
776 
777  double dfThickness;
778  double dfElevation;
779  vector<CADVector> avertCorners;
780  CADVector vectExtrusion;
781 };
782 
787 {
788 public:
790 
791  CADVector vertPosition;
792  CADVector vectSMAxis;
793  CADVector vectExtrusion;
794  double dfAxisRatio;
795  double dfBegAngle;
796  double dfEndAngle;
797 };
798 
803 {
804 public:
805  CADRayObject();
806 
807  CADVector vertPosition;
808  CADVector vectVector;
809 };
810 
815 {
816 public:
817  CADXLineObject();
818 
819  CADVector vertPosition;
820  CADVector vectVector;
821 };
822 
827 {
828 public:
830 
831  long nObjectSizeInBits;
832  CADHandle hObjectHandle;
833  CADEedArray aEED;
834  long nNumReactors;
835  bool bNoXDictionaryPresent;
836  long nNumItems;
837  short dCloningFlag;
838  unsigned char dHardOwnerFlag;
839 
840  string sDictionaryEntryName;
841  vector<string> sItemNames;
842 
843  CADHandle hParentHandle;
844  CADHandleArray hReactors;
845  CADHandle hXDictionary;
846  CADHandleArray hItemHandles;
847 };
848 
853 {
854 public:
856 
857  double dfConstWidth;
858  double dfElevation;
859  double dfThickness;
860  CADVector vectExtrusion;
861  vector<CADVector> avertVertexes;
862  vector<double> adfBulges;
863  vector<short> adVertexesID;
864  vector<pair<double, double>> astWidths; // start, end.
865 };
866 
871 {
872 public:
873  CADSplineObject();
874 
875  long dScenario;
876  long dSplineFlags; // 2013+
877  long dKnotParameter; // 2013+
878 
879  long dDegree;
880  double dfFitTol;
881  CADVector vectBegTangDir;
882  CADVector vectEndTangDir;
883  long nNumFitPts;
884 
885  bool bRational;
886  bool bClosed;
887  bool bPeriodic;
888  double dfKnotTol;
889  double dfCtrlTol;
890  long nNumKnots;
891  long nNumCtrlPts;
892  bool bWeight;
893 
894  vector<double> adfKnots;
895  vector<double> adfCtrlPointsWeight;
896  vector<CADVector> avertCtrlPoints;
897  vector<CADVector> averFitPoints;
898 };
899 
903 typedef struct _dimdata
904 {
905  char dVersion;
906  CADVector vectExtrusion;
907  CADVector vertTextMidPt;
908  double dfElevation;
909  unsigned char dFlags;
910  string sUserText;
911  double dfTextRotation;
912  double dfHorizDir;
913  double dfInsXScale;
914  double dfInsYScale;
915  double dfInsZScale;
916  double dfInsRotation;
917 
918  short dAttachmentPoint;
919  short dLineSpacingStyle;
920  double dfLineSpacingFactor;
921  double dfActualMeasurement;
922 
923  bool bUnknown;
924  bool bFlipArrow1;
925  bool bFlipArrow2;
926 
927  CADVector vert12Pt;
929 
934 {
935 public:
937  CADVector vert10pt;
938  CADHandle hDimstyle;
939  CADHandle hAnonymousBlock;
940 };
941 
946 {
947 public:
949  CADVector vert13pt, vert14pt;
950  unsigned char Flags2;
951 };
952 
957 {
958 public:
960  CADVector vert13pt, vert14pt;
961 
962  double dfExtLnRot;
963  double dfDimRot;
964 };
965 
970 {
971 public:
973  CADVector vert13pt, vert14pt;
974 
975  double dfExtLnRot;
976 };
977 
982 {
983 public:
985  CADVector vert13pt, vert14pt;
986  CADVector vert15pt;
987 };
988 
993 {
994 public:
996 
997  CADVector vert16pt;
998 
999 };
1000 
1005 {
1006 public:
1008 
1009  CADVector vert15pt;
1010  double dfLeaderLen;
1011 };
1012 
1017 {
1018 public:
1020 };
1021 
1026 {
1027 public:
1028  CADImageObject();
1029 
1030  long dClassVersion;
1031  CADVector vertInsertion;
1032  CADVector vectUDirection;
1033  CADVector vectVDirection;
1034  double dfSizeX;
1035  double dfSizeY;
1036  /* display properties (bit coded), 1==show image,
1037  2==show image when not aligned with screen, 4==use
1038  clipping boundary, 8==transparency on */
1039  short dDisplayProps;
1040 
1041  bool bClipping;
1042  unsigned char dBrightness;
1043  unsigned char dContrast;
1044  unsigned char dFade;
1045  bool bClipMode; // R2010+
1046 
1047  short dClipBoundaryType;
1048 
1049  long nNumberVertexesInClipPolygon;
1050  vector < CADVector > avertClippingPolygonVertexes;
1051 
1052  CADHandle hImageDef;
1053  CADHandle hImageDefReactor;
1054 };
1055 
1060 {
1061 public:
1063 
1064  long nObjectSizeInBits;
1065  CADHandle hObjectHandle;
1066  vector < CADEed > aEED;
1067  long nNumReactors;
1068  bool bNoXDictionaryPresent;
1069  long dClassVersion;
1070  CADHandle hParentHandle;
1071  vector < CADHandle > hReactors;
1072  CADHandle hXDictionary;
1073 };
1074 
1079 {
1080 public:
1082 
1083  double dfXImageSizeInPx;
1084  double dfYImageSizeInPx;
1085  string sFilePath;
1086  bool bIsLoaded;
1087  unsigned char dResUnits; // 0 == none, 2 == centimeters, 5 == inches
1088  double dfXPixelSize; // size of 1 pixel in autocad units
1089  double dfYPixelSize;
1090 };
1091 
1096 {
1097 public:
1098  CADMTextObject();
1099 
1100  CADVector vertInsertionPoint;
1101  CADVector vectExtrusion;
1102  CADVector vectXAxisDir;
1103  double dfRectWidth;
1104  double dfTextHeight;
1105  short dAttachment; // TODO: meaning unknown
1106  short dDrawingDir;
1107  double dfExtents; // TODO: meaning unknown
1108  double dfExtentsWidth; // TODO: meaning unknown
1109  string sTextValue;
1110  short dLineSpacingStyle;
1111  double dLineSpacingFactor;
1112  bool bUnknownBit;
1113  long dBackgroundFlags;
1114  long dBackgroundScaleFactor;
1115  short dBackgroundColor;
1116  long dBackgroundTransparency;
1117  CADHandle hStyle;
1118 };
1119 
1123 typedef struct _linestyle
1124 {
1125  short nNumSegParms;
1126  vector<double> adfSegparms;
1127  short nAreaFillParms;
1128  vector<double> adfAreaFillParameters;
1129 } CADLineStyle;
1130 
1134 typedef struct _mlinevertex
1135 {
1136  CADVector vertPosition;
1137  CADVector vectDirection;
1138  CADVector vectMIterDirection;
1139  vector < CADLineStyle > astLStyles;
1140 } CADMLineVertex;
1141 
1146 {
1147 public:
1148  CADMLineObject();
1149 
1150  double dfScale;
1151  unsigned char dJust;
1152  CADVector vertBasePoint;
1153  CADVector vectExtrusion;
1154  short dOpenClosed; // 1 open, 3 closed
1155  unsigned char nLinesInStyle;
1156  short nNumVertexes;
1157 
1158  vector < CADMLineVertex > avertVertexes;
1159 
1160  CADHandle hMLineStyle;
1161 };
1162 
1167 {
1168 public:
1169  CAD3DFaceObject();
1170 
1171  bool bHasNoFlagInd; // 2000+
1172  bool bZZero;
1173  vector < CADVector > avertCorners;
1174  short dInvisFlags;
1175 };
1176 
1181 {
1182 public:
1184 
1185  short nNumVertexes;
1186  short nNumFaces;
1187  long nObjectsOwned;
1188  vector < CADHandle > hVertexes; // content really depends on DWG version.
1189  CADHandle hSeqend;
1190 };
1191 
1192 #endif //CADOBJECTS_H
The CAD Block Object class.
Definition: cadobjects.h:361
Definition: cadheader.h:39
The CAD3DFaceObject class.
Definition: cadobjects.h:1166
The CADVertexPFaceObject class.
Definition: cadobjects.h:478
The CADVertex3DObject class.
Definition: cadobjects.h:457
The CADArc class.
Definition: cadobjects.h:542
The CADVertex2DObject class.
Definition: cadobjects.h:436
The CADPolyline3DObject class.
Definition: cadobjects.h:525
The CAD Attribute definition Object class.
Definition: cadobjects.h:351
The CADDimensionAngular3PtObject class.
Definition: cadobjects.h:981
The CADDimensionAngular2LnObject class.
Definition: cadobjects.h:992
The CADCircleObject class.
Definition: cadobjects.h:557
The CADLWPolylineObject class.
Definition: cadobjects.h:852
Definition: cadobjects.h:714
The CADSolidObject class.
Definition: cadobjects.h:772
The base CAD object class.
Definition: cadobjects.h:82
The CAD End block Object class.
Definition: cadobjects.h:372
The CADPolylinePFaceObject class.
Definition: cadobjects.h:1180
The CADLineTypeObject class.
Definition: cadobjects.h:728
The CADDimensionRadiusObject class.
Definition: cadobjects.h:1004
The CADSeqendObject class.
Definition: cadobjects.h:383
The CADDimensionLinearObject class.
Definition: cadobjects.h:956
The CADImageObject class.
Definition: cadobjects.h:1025
Definition: cadobjects.h:39
The CADCommonED struct.
Definition: cadobjects.h:229
The CADMLineObject class.
Definition: cadobjects.h:1145
The CADImageDefObject class.
Definition: cadobjects.h:1078
The CAD Text Object class.
Definition: cadobjects.h:296
The CADVertexPFaceFaceObject class.
Definition: cadobjects.h:488
The CADLayerObject class.
Definition: cadobjects.h:662
MLine vertex data structure.
Definition: cadobjects.h:1134
The CADLayerControlObject class.
Definition: cadobjects.h:643
The CADXLineObject class.
Definition: cadobjects.h:814
The CADSplineObject class.
Definition: cadobjects.h:870
The CADImageDefReactorObject class.
Definition: cadobjects.h:1059
The CADMTextObject class.
Definition: cadobjects.h:1095
Linestyle data structure.
Definition: cadobjects.h:1123
The CADEllipseObject class.
Definition: cadobjects.h:786
The CADDimensionDiameterObject class.
Definition: cadobjects.h:1016
The CADDimensionAlignedObject class.
Definition: cadobjects.h:969
The CADInsertObject class.
Definition: cadobjects.h:393
The CAD Attribute Object class.
Definition: cadobjects.h:321
The CADVertexMesh class.
Definition: cadobjects.h:468
The CADLineTypeControlObject class.
Definition: cadobjects.h:697
The CADRayObject class.
Definition: cadobjects.h:802
The CADMInsertObject class.
Definition: cadobjects.h:412
The CADLineObject class.
Definition: cadobjects.h:570
Common Dimensional Data structure.
Definition: cadobjects.h:903
The CADDictionaryObject class.
Definition: cadobjects.h:826
Definition: cadobjects.h:286
The CADBlockHeaderObject class.
Definition: cadobjects.h:601
The CADPolyline2DObject class.
Definition: cadobjects.h:502
The CADCommonEHD struct.
Definition: cadobjects.h:262
The CADBlockControlObject class.
Definition: cadobjects.h:583
Definition: cadobjects.h:69
The CADPointObject class.
Definition: cadobjects.h:758
The CADDimensionObject class.
Definition: cadobjects.h:933
The CADDimensionOrdinateObject class.
Definition: cadobjects.h:945