1 /**********************************************************
2  * Version $Id: dl_entities.h 911 2011-02-14 16:38:15Z reklov_w $
3  *********************************************************/
4 /****************************************************************************
5 ** $Id: dl_entities.h 911 2011-02-14 16:38:15Z reklov_w $
6 **
7 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
8 **
9 ** This file is part of the dxflib project.
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU General Public License version 2 as published by the Free Software
13 ** Foundation and appearing in the file LICENSE.GPL included in the
14 ** packaging of this file.
15 **
16 ** Licensees holding valid dxflib Professional Edition licenses may use
17 ** this file in accordance with the dxflib Commercial License
18 ** Agreement provided with the Software.
19 **
20 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22 **
23 ** See http://www.ribbonsoft.com for further details.
24 **
25 ** Contact info@ribbonsoft.com if any conditions of this licensing are
26 ** not clear to you.
27 **
28 **********************************************************************/
29 
30 #ifndef DL_ENTITIES_H
31 #define DL_ENTITIES_H
32 
33 
34 #include <string>
35 using std::string;
36 
37 /**
38  * Layer Data.
39  *
40  * @author Andrew Mustun
41  */
42 struct DL_LayerData {
43     /**
44      * Constructor.
45      * Parameters: see member variables.
46      */
DL_LayerDataDL_LayerData47     DL_LayerData(const string& lName,
48                  int lFlags) {
49         name = lName;
50         flags = lFlags;
51     }
52 
53     /** Layer name. */
54     string name;
55     /** Layer flags. (1 = frozen, 2 = frozen by default, 4 = locked) */
56     int flags;
57 };
58 
59 
60 
61 /**
62  * Block Data.
63  *
64  * @author Andrew Mustun
65  */
66 struct DL_BlockData {
67     /**
68      * Constructor.
69      * Parameters: see member variables.
70      */
DL_BlockDataDL_BlockData71     DL_BlockData(const string& bName,
72                  int bFlags,
73                  double bbpx, double bbpy, double bbpz) {
74         name = bName;
75         flags = bFlags;
76         bpx = bbpx;
77         bpy = bbpy;
78         bpz = bbpz;
79     }
80 
81     /** Block name. */
82     string name;
83     /** Block flags. (not used currently) */
84     int flags;
85     /** X Coordinate of base point. */
86     double bpx;
87     /** Y Coordinate of base point. */
88     double bpy;
89     /** Z Coordinate of base point. */
90     double bpz;
91 };
92 
93 
94 
95 /**
96  * Line Type Data.
97  *
98  * @author Andrew Mustun
99  */
100 struct DL_LineTypeData {
101     /**
102      * Constructor.
103      * Parameters: see member variables.
104      */
DL_LineTypeDataDL_LineTypeData105     DL_LineTypeData(const string& lName,
106                     int lFlags) {
107         name = lName;
108         flags = lFlags;
109     }
110 
111     /** Line type name. */
112     string name;
113     /** Line type flags. */
114     int flags;
115 };
116 
117 
118 
119 /**
120  * Point Data.
121  *
122  * @author Andrew Mustun
123  */
124 struct DL_PointData {
125     /**
126      * Constructor.
127      * Parameters: see member variables.
128      */
129     DL_PointData(double px=0.0, double py=0.0, double pz=0.0) {
130         x = px;
131         y = py;
132         z = pz;
133     }
134 
135     /*! X Coordinate of the point. */
136     double x;
137     /*! Y Coordinate of the point. */
138     double y;
139     /*! Z Coordinate of the point. */
140     double z;
141 };
142 
143 
144 
145 /**
146  * Line Data.
147  *
148  * @author Andrew Mustun
149  */
150 struct DL_LineData {
151     /**
152      * Constructor.
153      * Parameters: see member variables.
154      */
DL_LineDataDL_LineData155     DL_LineData(double lx1, double ly1, double lz1,
156                 double lx2, double ly2, double lz2) {
157         x1 = lx1;
158         y1 = ly1;
159         z1 = lz1;
160 
161         x2 = lx2;
162         y2 = ly2;
163         z2 = lz2;
164     }
165 
166     /*! X Start coordinate of the point. */
167     double x1;
168     /*! Y Start coordinate of the point. */
169     double y1;
170     /*! Z Start coordinate of the point. */
171     double z1;
172 
173     /*! X End coordinate of the point. */
174     double x2;
175     /*! Y End coordinate of the point. */
176     double y2;
177     /*! Z End coordinate of the point. */
178     double z2;
179 };
180 
181 
182 
183 /**
184  * Arc Data.
185  *
186  * @author Andrew Mustun
187  */
188 struct DL_ArcData {
189     /**
190      * Constructor.
191      * Parameters: see member variables.
192      */
DL_ArcDataDL_ArcData193     DL_ArcData(double acx, double acy, double acz,
194                double aRadius,
195                double aAngle1, double aAngle2) {
196 
197         cx = acx;
198         cy = acy;
199         cz = acz;
200         radius = aRadius;
201         angle1 = aAngle1;
202         angle2 = aAngle2;
203     }
204 
205     /*! X Coordinate of center point. */
206     double cx;
207     /*! Y Coordinate of center point. */
208     double cy;
209     /*! Z Coordinate of center point. */
210     double cz;
211 
212     /*! Radius of arc. */
213     double radius;
214     /*! Startangle of arc in degrees. */
215     double angle1;
216     /*! Endangle of arc in degrees. */
217     double angle2;
218 };
219 
220 
221 
222 /**
223  * Circle Data.
224  *
225  * @author Andrew Mustun
226  */
227 struct DL_CircleData {
228     /**
229      * Constructor.
230      * Parameters: see member variables.
231      */
DL_CircleDataDL_CircleData232     DL_CircleData(double acx, double acy, double acz,
233                   double aRadius) {
234 
235         cx = acx;
236         cy = acy;
237         cz = acz;
238         radius = aRadius;
239     }
240 
241     /*! X Coordinate of center point. */
242     double cx;
243     /*! Y Coordinate of center point. */
244     double cy;
245     /*! Z Coordinate of center point. */
246     double cz;
247 
248     /*! Radius of arc. */
249     double radius;
250 };
251 
252 
253 
254 /**
255  * Polyline Data.
256  *
257  * @author Andrew Mustun
258  */
259 struct DL_PolylineData {
260     /**
261      * Constructor.
262      * Parameters: see member variables.
263      */
DL_PolylineDataDL_PolylineData264     DL_PolylineData(int pNumber, int pMVerteces, int pNVerteces, int pFlags) {
265         number = pNumber;
266         m = pMVerteces;
267         n = pNVerteces;
268         flags = pFlags;
269     }
270 
271     /*! Number of vertices in this polyline. */
272     unsigned int number;
273 
274     /*! Number of vertices in m direction if polyline is a polygon mesh. */
275     unsigned int m;
276 
277     /*! Number of vertices in n direction if polyline is a polygon mesh. */
278     unsigned int n;
279 
280     /*! Flags */
281     int flags;
282 };
283 
284 
285 
286 /**
287  * Vertex Data.
288  *
289  * @author Andrew Mustun
290  */
291 struct DL_VertexData {
292     /**
293      * Constructor.
294      * Parameters: see member variables.
295      */
296     DL_VertexData(double px=0.0, double py=0.0, double pz=0.0,
297                   double pBulge=0.0) {
298         x = px;
299         y = py;
300         z = pz;
301         bulge = pBulge;
302     }
303 
304     /*! X Coordinate of the vertex. */
305     double x;
306     /*! Y Coordinate of the vertex. */
307     double y;
308     /*! Z Coordinate of the vertex. */
309     double z;
310     /*! Bulge of vertex.
311      * (The tangent of 1/4 of the arc angle or 0 for lines) */
312     double bulge;
313 };
314 
315 
316 /**
317  * Trace Data / solid data / 3d face data.
318  *
319  * @author Andrew Mustun
320  */
321 struct DL_TraceData {
DL_TraceDataDL_TraceData322     DL_TraceData() {
323         thickness = 0.0;
324         for (int i=0; i<4; i++) {
325             x[i] = 0.0;
326             y[i] = 0.0;
327             z[i] = 0.0;
328         }
329     }
330 
331     /**
332      * Constructor.
333      * Parameters: see member variables.
334      */
335     DL_TraceData(double sx1, double sy1, double sz1,
336                 double sx2, double sy2, double sz2,
337                 double sx3, double sy3, double sz3,
338                 double sx4, double sy4, double sz4,
339                 double sthickness=0.0) {
340 
341         thickness = sthickness;
342 
343         x[0] = sx1;
344         y[0] = sy1;
345         z[0] = sz1;
346 
347         x[1] = sx2;
348         y[1] = sy2;
349         z[1] = sz2;
350 
351         x[2] = sx3;
352         y[2] = sy3;
353         z[2] = sz3;
354 
355         x[3] = sx4;
356         y[3] = sy4;
357         z[3] = sz4;
358     }
359 
360     /*! Thickness */
361     double thickness;
362 
363     /*! Points */
364     double x[4];
365     double y[4];
366     double z[4];
367 };
368 
369 
370 
371 
372 
373 /**
374  * Solid Data.
375  *
376  * @author AHM
377  */
378 typedef DL_TraceData DL_SolidData;
379 
380 
381 /**
382  * 3dface Data.
383  */
384 typedef DL_TraceData DL_3dFaceData;
385 
386 
387 /**
388  * Spline Data.
389  *
390  * @author Andrew Mustun
391  */
392 struct DL_SplineData {
393     /**
394      * Constructor.
395      * Parameters: see member variables.
396      */
DL_SplineDataDL_SplineData397     DL_SplineData(int pDegree, int pNKnots, int pNControl, int pFlags) {
398 		degree = pDegree;
399 		nKnots = pNKnots;
400 		nControl = pNControl;
401         flags = pFlags;
402     }
403 
404     /*! Degree of the spline curve. */
405     unsigned int degree;
406 
407     /*! Number of knots. */
408     unsigned int nKnots;
409 
410     /*! Number of control points. */
411     unsigned int nControl;
412 
413     /*! Flags */
414     int flags;
415 };
416 
417 
418 
419 /**
420  * Spline knot data.
421  *
422  * @author Andrew Mustun
423  */
424 struct DL_KnotData {
DL_KnotDataDL_KnotData425     DL_KnotData() {}
426     /**
427      * Constructor.
428      * Parameters: see member variables.
429      */
DL_KnotDataDL_KnotData430     DL_KnotData(double pk) {
431         k = pk;
432     }
433 
434     /*! Knot value. */
435     double k;
436 };
437 
438 
439 
440 /**
441  * Spline control point data.
442  *
443  * @author Andrew Mustun
444  */
445 struct DL_ControlPointData {
446     /**
447      * Constructor.
448      * Parameters: see member variables.
449      */
DL_ControlPointDataDL_ControlPointData450     DL_ControlPointData(double px, double py, double pz) {
451         x = px;
452         y = py;
453         z = pz;
454     }
455 
456     /*! X coordinate of the control point. */
457     double x;
458     /*! Y coordinate of the control point. */
459     double y;
460     /*! Z coordinate of the control point. */
461     double z;
462 };
463 
464 
465 /**
466  * Ellipse Data.
467  *
468  * @author Andrew Mustun
469  */
470 struct DL_EllipseData {
471     /**
472      * Constructor.
473      * Parameters: see member variables.
474      */
DL_EllipseDataDL_EllipseData475     DL_EllipseData(double ecx, double ecy, double ecz,
476                    double emx, double emy, double emz,
477                    double eRatio,
478                    double eAngle1, double eAngle2) {
479 
480         cx = ecx;
481         cy = ecy;
482         cz = ecz;
483         mx = emx;
484         my = emy;
485         mz = emz;
486         ratio = eRatio;
487         angle1 = eAngle1;
488         angle2 = eAngle2;
489     }
490 
491     /*! X Coordinate of center point. */
492     double cx;
493     /*! Y Coordinate of center point. */
494     double cy;
495     /*! Z Coordinate of center point. */
496     double cz;
497 
498     /*! X coordinate of the endpoint of the major axis. */
499     double mx;
500     /*! Y coordinate of the endpoint of the major axis. */
501     double my;
502     /*! Z coordinate of the endpoint of the major axis. */
503     double mz;
504 
505     /*! Ratio of minor axis to major axis.. */
506     double ratio;
507     /*! Startangle of ellipse in rad. */
508     double angle1;
509     /*! Endangle of ellipse in rad. */
510     double angle2;
511 };
512 
513 
514 
515 /**
516  * Insert Data.
517  *
518  * @author Andrew Mustun
519  */
520 struct DL_InsertData {
521     /**
522      * Constructor.
523      * Parameters: see member variables.
524      */
DL_InsertDataDL_InsertData525     DL_InsertData(const string& iName,
526                   double iipx, double iipy, double iipz,
527                   double isx, double isy, double isz,
528                   double iAngle,
529                   int iCols, int iRows,
530                   double iColSp, double iRowSp) {
531         name = iName;
532         ipx = iipx;
533         ipy = iipy;
534         ipz = iipz;
535         sx = isx;
536         sy = isy;
537         sz = isz;
538         angle = iAngle;
539         cols = iCols;
540         rows = iRows;
541         colSp = iColSp;
542         rowSp = iRowSp;
543     }
544 
545     /*! Name of the referred block. */
546     string name;
547     /*! X Coordinate of insertion point. */
548     double ipx;
549     /*! Y Coordinate of insertion point. */
550     double ipy;
551     /*! Z Coordinate of insertion point. */
552     double ipz;
553     /*! X Scale factor. */
554     double sx;
555     /*! Y Scale factor. */
556     double sy;
557     /*! Z Scale factor. */
558     double sz;
559     /*! Rotation angle in rad. */
560     double angle;
561     /*! Number of colums if we insert an array of the block or 1. */
562     int cols;
563     /*! Number of rows if we insert an array of the block or 1. */
564     int rows;
565     /*! Values for the spacing between cols. */
566     double colSp;
567     /*! Values for the spacing between rows. */
568     double rowSp;
569 };
570 
571 
572 
573 /**
574  * MText Data.
575  *
576  * @author Andrew Mustun
577  */
578 struct DL_MTextData {
579     /**
580      * Constructor.
581      * Parameters: see member variables.
582      */
DL_MTextDataDL_MTextData583     DL_MTextData(double tipx, double tipy, double tipz,
584                  double tHeight, double tWidth,
585                  int tAttachmentPoint,
586                  int tDrawingDirection,
587                  int tLineSpacingStyle,
588                  double tLineSpacingFactor,
589                  const string& tText,
590                  const string& tStyle,
591                  double tAngle) {
592         ipx = tipx;
593         ipy = tipy;
594         ipz = tipz;
595 
596         height = tHeight;
597         width = tWidth;
598         attachmentPoint = tAttachmentPoint;
599         drawingDirection = tDrawingDirection;
600         lineSpacingStyle = tLineSpacingStyle;
601         lineSpacingFactor = tLineSpacingFactor;
602         text = tText;
603         style = tStyle;
604         angle = tAngle;
605     }
606 
607     /*! X Coordinate of insertion point. */
608     double ipx;
609     /*! Y Coordinate of insertion point. */
610     double ipy;
611     /*! Z Coordinate of insertion point. */
612     double ipz;
613     /*! Text height */
614     double height;
615     /*! Width of the text box. */
616     double width;
617     /**
618      * Attachment point.
619      *
620      * 1 = Top left, 2 = Top center, 3 = Top right,
621      * 4 = Middle left, 5 = Middle center, 6 = Middle right,
622      * 7 = Bottom left, 8 = Bottom center, 9 = Bottom right
623      */
624     int attachmentPoint;
625     /**
626      * Drawing direction.
627      *
628      * 1 = left to right, 3 = top to bottom, 5 = by style
629      */
630     int drawingDirection;
631     /**
632      * Line spacing style.
633      *
634      * 1 = at least, 2 = exact
635      */
636     int lineSpacingStyle;
637     /**
638      * Line spacing factor. 0.25 .. 4.0
639      */
640     double lineSpacingFactor;
641     /*! Text string. */
642     string text;
643     /*! Style string. */
644     string style;
645     /*! Rotation angle. */
646     double angle;
647 };
648 
649 
650 
651 /**
652  * Text Data.
653  *
654  * @author Andrew Mustun
655  */
656 struct DL_TextData {
657     /**
658      * Constructor.
659      * Parameters: see member variables.
660      */
DL_TextDataDL_TextData661     DL_TextData(double tipx, double tipy, double tipz,
662                 double tapx, double tapy, double tapz,
663                 double tHeight, double tXScaleFactor,
664                 int tTextGenerationFlags,
665                 int tHJustification,
666                 int tVJustification,
667                 const string& tText,
668                 const string& tStyle,
669                 double tAngle) {
670         ipx = tipx;
671         ipy = tipy;
672         ipz = tipz;
673 
674         apx = tapx;
675         apy = tapy;
676         apz = tapz;
677 
678         height = tHeight;
679         xScaleFactor = tXScaleFactor;
680         textGenerationFlags = tTextGenerationFlags;
681         hJustification = tHJustification;
682         vJustification = tVJustification;
683         text = tText;
684         style = tStyle;
685         angle = tAngle;
686     }
687 
688     /*! X Coordinate of insertion point. */
689     double ipx;
690     /*! Y Coordinate of insertion point. */
691     double ipy;
692     /*! Z Coordinate of insertion point. */
693     double ipz;
694 
695     /*! X Coordinate of alignment point. */
696     double apx;
697     /*! Y Coordinate of alignment point. */
698     double apy;
699     /*! Z Coordinate of alignment point. */
700     double apz;
701 
702     /*! Text height */
703     double height;
704     /*! Relative X scale factor. */
705     double xScaleFactor;
706     /*! 0 = default, 2 = Backwards, 4 = Upside down */
707     int textGenerationFlags;
708     /**
709      * Horizontal justification.
710      *
711      * 0 = Left (default), 1 = Center, 2 = Right,
712      * 3 = Aligned, 4 = Middle, 5 = Fit
713      * For 3, 4, 5 the vertical alignment has to be 0.
714      */
715     int hJustification;
716     /**
717      * Vertical justification.
718      *
719      * 0 = Baseline (default), 1 = Bottom, 2 = Middle, 3= Top
720      */
721     int vJustification;
722     /*! Text string. */
723     string text;
724     /*! Style (font). */
725     string style;
726     /*! Rotation angle of dimension text away from default orientation. */
727     double angle;
728 };
729 
730 
731 
732 /**
733  * Generic Dimension Data.
734  *
735  * @author Andrew Mustun
736  */
737 struct DL_DimensionData {
738     /**
739     * Constructor.
740     * Parameters: see member variables.
741     */
DL_DimensionDataDL_DimensionData742     DL_DimensionData(double ddpx, double ddpy, double ddpz,
743                      double dmpx, double dmpy, double dmpz,
744                      int dType,
745                      int dAttachmentPoint,
746                      int dLineSpacingStyle,
747                      double dLineSpacingFactor,
748                      const string& dText,
749                      const string& dStyle,
750                      double dAngle) {
751 
752         dpx = ddpx;
753         dpy = ddpy;
754         dpz = ddpz;
755 
756         mpx = dmpx;
757         mpy = dmpy;
758         mpz = dmpz;
759 
760         type = dType;
761 
762         attachmentPoint = dAttachmentPoint;
763         lineSpacingStyle = dLineSpacingStyle;
764         lineSpacingFactor = dLineSpacingFactor;
765         text = dText;
766         style = dStyle;
767         angle = dAngle;
768     }
769 
770     /*! X Coordinate of definition point. */
771     double dpx;
772     /*! Y Coordinate of definition point. */
773     double dpy;
774     /*! Z Coordinate of definition point. */
775     double dpz;
776     /*! X Coordinate of middle point of the text. */
777     double mpx;
778     /*! Y Coordinate of middle point of the text. */
779     double mpy;
780     /*! Z Coordinate of middle point of the text. */
781     double mpz;
782     /**
783      * Dimension type.
784      *
785      * 0   Rotated, horizontal, or vertical
786      * 1   Aligned
787      * 2   Angular
788      * 3   Diametric
789      * 4   Radius
790      * 5   Angular 3-point
791      * 6   Ordinate
792      * 64  Ordinate type. This is a bit value (bit 7)
793      *     used only with integer value 6. If set,
794      *     ordinate is X-type; if not set, ordinate is
795      *     Y-type
796      * 128 This is a bit value (bit 8) added to the
797      *     other group 70 values if the dimension text
798      *     has been positioned at a user-defined
799      *    location rather than at the default location
800      */
801     int type;
802     /**
803      * Attachment point.
804      *
805      * 1 = Top left, 2 = Top center, 3 = Top right,
806      * 4 = Middle left, 5 = Middle center, 6 = Middle right,
807      * 7 = Bottom left, 8 = Bottom center, 9 = Bottom right,
808      */
809     int attachmentPoint;
810     /**
811      * Line spacing style.
812      *
813      * 1 = at least, 2 = exact
814      */
815     int lineSpacingStyle;
816     /**
817      * Line spacing factor. 0.25 .. 4.0
818      */
819     double lineSpacingFactor;
820     /**
821      * Text string.
822      *
823      * Text string entered explicitly by user or null
824      * or "<>" for the actual measurement or " " (one blank space).
825      * for supressing the text.
826      */
827     string text;
828     /*! Dimension style (font name). */
829     string style;
830     /**
831     * Rotation angle of dimension text away from
832      * default orientation.
833     */
834     double angle;
835 };
836 
837 
838 
839 /**
840  * Aligned Dimension Data.
841  *
842  * @author Andrew Mustun
843  */
844 struct DL_DimAlignedData {
845     /**
846      * Constructor.
847      * Parameters: see member variables.
848      */
DL_DimAlignedDataDL_DimAlignedData849     DL_DimAlignedData(double depx1, double depy1, double depz1,
850                       double depx2, double depy2, double depz2) {
851 
852         epx1 = depx1;
853         epy1 = depy1;
854         epz1 = depz1;
855 
856         epx2 = depx2;
857         epy2 = depy2;
858         epz2 = depz2;
859     }
860 
861     /*! X Coordinate of Extension point 1. */
862     double epx1;
863     /*! Y Coordinate of Extension point 1. */
864     double epy1;
865     /*! Z Coordinate of Extension point 1. */
866     double epz1;
867 
868     /*! X Coordinate of Extension point 2. */
869     double epx2;
870     /*! Y Coordinate of Extension point 2. */
871     double epy2;
872     /*! Z Coordinate of Extension point 2. */
873     double epz2;
874 };
875 
876 
877 
878 /**
879  * Linear Dimension Data.
880  *
881  * @author Andrew Mustun
882  */
883 struct DL_DimLinearData {
884     /**
885      * Constructor.
886      * Parameters: see member variables.
887      */
DL_DimLinearDataDL_DimLinearData888     DL_DimLinearData(double ddpx1, double ddpy1, double ddpz1,
889                      double ddpx2, double ddpy2, double ddpz2,
890                      double dAngle, double dOblique) {
891 
892         dpx1 = ddpx1;
893         dpy1 = ddpy1;
894         dpz1 = ddpz1;
895 
896         dpx2 = ddpx2;
897         dpy2 = ddpy2;
898         dpz2 = ddpz2;
899 
900         angle = dAngle;
901         oblique = dOblique;
902     }
903 
904     /*! X Coordinate of Extension point 1. */
905     double dpx1;
906     /*! Y Coordinate of Extension point 1. */
907     double dpy1;
908     /*! Z Coordinate of Extension point 1. */
909     double dpz1;
910 
911     /*! X Coordinate of Extension point 2. */
912     double dpx2;
913     /*! Y Coordinate of Extension point 2. */
914     double dpy2;
915     /*! Z Coordinate of Extension point 2. */
916     double dpz2;
917 
918     /*! Rotation angle (angle of dimension line) in degrees. */
919     double angle;
920     /*! Oblique angle in degrees. */
921     double oblique;
922 };
923 
924 
925 
926 /**
927  * Radial Dimension Data.
928  *
929  * @author Andrew Mustun
930  */
931 struct DL_DimRadialData {
932     /**
933      * Constructor.
934      * Parameters: see member variables.
935      */
DL_DimRadialDataDL_DimRadialData936     DL_DimRadialData(double ddpx, double ddpy, double ddpz, double dleader) {
937         dpx = ddpx;
938         dpy = ddpy;
939         dpz = ddpz;
940 
941         leader = dleader;
942     }
943 
944     /*! X Coordinate of definition point. */
945     double dpx;
946     /*! Y Coordinate of definition point. */
947     double dpy;
948     /*! Z Coordinate of definition point. */
949     double dpz;
950 
951     /*! Leader length */
952     double leader;
953 };
954 
955 
956 
957 /**
958  * Diametric Dimension Data.
959  *
960  * @author Andrew Mustun
961  */
962 struct DL_DimDiametricData {
963     /**
964      * Constructor.
965      * Parameters: see member variables.
966      */
DL_DimDiametricDataDL_DimDiametricData967     DL_DimDiametricData(double ddpx, double ddpy, double ddpz, double dleader) {
968         dpx = ddpx;
969         dpy = ddpy;
970         dpz = ddpz;
971 
972         leader = dleader;
973     }
974 
975     /*! X Coordinate of definition point. */
976     double dpx;
977     /*! Y Coordinate of definition point. */
978     double dpy;
979     /*! Z Coordinate of definition point. */
980     double dpz;
981 
982     /*! Leader length */
983     double leader;
984 };
985 
986 
987 
988 /**
989  * Angular Dimension Data.
990  *
991  * @author Andrew Mustun
992  */
993 struct DL_DimAngularData {
994     /**
995      * Constructor.
996      * Parameters: see member variables.
997      */
DL_DimAngularDataDL_DimAngularData998     DL_DimAngularData(double ddpx1, double ddpy1, double ddpz1,
999                       double ddpx2, double ddpy2, double ddpz2,
1000                       double ddpx3, double ddpy3, double ddpz3,
1001                       double ddpx4, double ddpy4, double ddpz4) {
1002 
1003         dpx1 = ddpx1;
1004         dpy1 = ddpy1;
1005         dpz1 = ddpz1;
1006 
1007         dpx2 = ddpx2;
1008         dpy2 = ddpy2;
1009         dpz2 = ddpz2;
1010 
1011         dpx3 = ddpx3;
1012         dpy3 = ddpy3;
1013         dpz3 = ddpz3;
1014 
1015         dpx4 = ddpx4;
1016         dpy4 = ddpy4;
1017         dpz4 = ddpz4;
1018     }
1019 
1020     /*! X Coordinate of definition point 1. */
1021     double dpx1;
1022     /*! Y Coordinate of definition point 1. */
1023     double dpy1;
1024     /*! Z Coordinate of definition point 1. */
1025     double dpz1;
1026 
1027     /*! X Coordinate of definition point 2. */
1028     double dpx2;
1029     /*! Y Coordinate of definition point 2. */
1030     double dpy2;
1031     /*! Z Coordinate of definition point 2. */
1032     double dpz2;
1033 
1034     /*! X Coordinate of definition point 3. */
1035     double dpx3;
1036     /*! Y Coordinate of definition point 3. */
1037     double dpy3;
1038     /*! Z Coordinate of definition point 3. */
1039     double dpz3;
1040 
1041     /*! X Coordinate of definition point 4. */
1042     double dpx4;
1043     /*! Y Coordinate of definition point 4. */
1044     double dpy4;
1045     /*! Z Coordinate of definition point 4. */
1046     double dpz4;
1047 };
1048 
1049 
1050 /**
1051  * Angular Dimension Data (3 points version).
1052  *
1053  * @author Andrew Mustun
1054  */
1055 struct DL_DimAngular3PData {
1056     /**
1057      * Constructor.
1058      * Parameters: see member variables.
1059      */
DL_DimAngular3PDataDL_DimAngular3PData1060     DL_DimAngular3PData(double ddpx1, double ddpy1, double ddpz1,
1061                         double ddpx2, double ddpy2, double ddpz2,
1062                         double ddpx3, double ddpy3, double ddpz3) {
1063 
1064         dpx1 = ddpx1;
1065         dpy1 = ddpy1;
1066         dpz1 = ddpz1;
1067 
1068         dpx2 = ddpx2;
1069         dpy2 = ddpy2;
1070         dpz2 = ddpz2;
1071 
1072         dpx3 = ddpx3;
1073         dpy3 = ddpy3;
1074         dpz3 = ddpz3;
1075     }
1076 
1077     /*! X Coordinate of definition point 1. */
1078     double dpx1;
1079     /*! Y Coordinate of definition point 1. */
1080     double dpy1;
1081     /*! Z Coordinate of definition point 1. */
1082     double dpz1;
1083 
1084     /*! X Coordinate of definition point 2. */
1085     double dpx2;
1086     /*! Y Coordinate of definition point 2. */
1087     double dpy2;
1088     /*! Z Coordinate of definition point 2. */
1089     double dpz2;
1090 
1091     /*! X Coordinate of definition point 3. */
1092     double dpx3;
1093     /*! Y Coordinate of definition point 3. */
1094     double dpy3;
1095     /*! Z Coordinate of definition point 3. */
1096     double dpz3;
1097 };
1098 
1099 
1100 
1101 /**
1102  * Ordinate Dimension Data.
1103  *
1104  * @author Andrew Mustun
1105  */
1106 struct DL_DimOrdinateData {
1107     /**
1108      * Constructor.
1109      * Parameters: see member variables.
1110      */
DL_DimOrdinateDataDL_DimOrdinateData1111     DL_DimOrdinateData(double ddpx1, double ddpy1, double ddpz1,
1112                       double ddpx2, double ddpy2, double ddpz2,
1113                       bool dxtype) {
1114 
1115         dpx1 = ddpx1;
1116         dpy1 = ddpy1;
1117         dpz1 = ddpz1;
1118 
1119         dpx2 = ddpx2;
1120         dpy2 = ddpy2;
1121         dpz2 = ddpz2;
1122 
1123         xtype = dxtype;
1124     }
1125 
1126     /*! X Coordinate of definition point 1. */
1127     double dpx1;
1128     /*! Y Coordinate of definition point 1. */
1129     double dpy1;
1130     /*! Z Coordinate of definition point 1. */
1131     double dpz1;
1132 
1133     /*! X Coordinate of definition point 2. */
1134     double dpx2;
1135     /*! Y Coordinate of definition point 2. */
1136     double dpy2;
1137     /*! Z Coordinate of definition point 2. */
1138     double dpz2;
1139 
1140     /*! True if the dimension indicates the X-value, false for Y-value */
1141     bool xtype;
1142 };
1143 
1144 
1145 
1146 /**
1147  * Leader (arrow).
1148  *
1149  * @author Andrew Mustun
1150  */
1151 struct DL_LeaderData {
1152     /**
1153      * Constructor.
1154      * Parameters: see member variables.
1155      */
DL_LeaderDataDL_LeaderData1156     DL_LeaderData(int lArrowHeadFlag,
1157                   int lLeaderPathType,
1158                   int lLeaderCreationFlag,
1159                   int lHooklineDirectionFlag,
1160                   int lHooklineFlag,
1161                   double lTextAnnotationHeight,
1162                   double lTextAnnotationWidth,
1163                   int lNumber) {
1164 
1165         arrowHeadFlag = lArrowHeadFlag;
1166         leaderPathType = lLeaderPathType;
1167         leaderCreationFlag = lLeaderCreationFlag;
1168         hooklineDirectionFlag = lHooklineDirectionFlag;
1169         hooklineFlag = lHooklineFlag;
1170         textAnnotationHeight = lTextAnnotationHeight;
1171         textAnnotationWidth = lTextAnnotationWidth;
1172         number = lNumber;
1173     }
1174 
1175     /*! Arrow head flag (71). */
1176     int arrowHeadFlag;
1177     /*! Leader path type (72). */
1178     int leaderPathType;
1179     /*! Leader creation flag (73). */
1180     int leaderCreationFlag;
1181     /*! Hookline direction flag (74). */
1182     int hooklineDirectionFlag;
1183     /*! Hookline flag (75) */
1184     int hooklineFlag;
1185     /*! Text annotation height (40). */
1186     double textAnnotationHeight;
1187     /*! Text annotation width (41) */
1188     double textAnnotationWidth;
1189     /*! Number of vertices in leader (76). */
1190     int number;
1191 };
1192 
1193 
1194 
1195 /**
1196  * Leader Vertex Data.
1197  *
1198  * @author Andrew Mustun
1199  */
1200 struct DL_LeaderVertexData {
1201     /**
1202      * Constructor.
1203      * Parameters: see member variables.
1204      */
1205     DL_LeaderVertexData(double px=0.0, double py=0.0, double pz=0.0) {
1206         x = px;
1207         y = py;
1208         z = pz;
1209     }
1210 
1211     /*! X Coordinate of the vertex. */
1212     double x;
1213     /*! Y Coordinate of the vertex. */
1214     double y;
1215     /*! Z Coordinate of the vertex. */
1216     double z;
1217 };
1218 
1219 
1220 
1221 /**
1222  * Hatch data.
1223  */
1224 struct DL_HatchData {
1225     /**
1226      * Default constructor.
1227      */
DL_HatchDataDL_HatchData1228     DL_HatchData() {}
1229 
1230     /**
1231      * Constructor.
1232      * Parameters: see member variables.
1233      */
DL_HatchDataDL_HatchData1234     DL_HatchData(int hNumLoops,
1235                  bool hSolid,
1236                  double hScale,
1237                  double hAngle,
1238                  const string& hPattern) {
1239         numLoops = hNumLoops;
1240         solid = hSolid;
1241         scale = hScale;
1242         angle = hAngle;
1243         pattern = hPattern;
1244     }
1245 
1246     /*! Number of boundary paths (loops). */
1247     int numLoops;
1248     /*! Solid fill flag (true=solid, false=pattern). */
1249     bool solid;
1250     /*! Pattern scale or spacing */
1251     double scale;
1252     /*! Pattern angle */
1253     double angle;
1254     /*! Pattern name. */
1255     string pattern;
1256 };
1257 
1258 
1259 
1260 /**
1261  * Hatch boundary path (loop) data.
1262  */
1263 struct DL_HatchLoopData {
1264     /**
1265      * Default constructor.
1266      */
DL_HatchLoopDataDL_HatchLoopData1267     DL_HatchLoopData() {}
1268     /**
1269      * Constructor.
1270      * Parameters: see member variables.
1271      */
DL_HatchLoopDataDL_HatchLoopData1272     DL_HatchLoopData(int hNumEdges) {
1273         numEdges = hNumEdges;
1274     }
1275 
1276     /*! Number of edges in this loop. */
1277     int numEdges;
1278 };
1279 
1280 
1281 
1282 /**
1283  * Hatch edge data.
1284  */
1285 struct DL_HatchEdgeData {
1286     /**
1287      * Default constructor.
1288      */
DL_HatchEdgeDataDL_HatchEdgeData1289     DL_HatchEdgeData() {
1290         defined = false;
1291     }
1292 
1293     /**
1294      * Constructor for a line edge.
1295      * Parameters: see member variables.
1296      */
DL_HatchEdgeDataDL_HatchEdgeData1297     DL_HatchEdgeData(double lx1, double ly1,
1298                      double lx2, double ly2) {
1299         x1 = lx1;
1300         y1 = ly1;
1301         x2 = lx2;
1302         y2 = ly2;
1303         type = 1;
1304         defined = true;
1305     }
1306 
1307     /**
1308      * Constructor for an arc edge.
1309      * Parameters: see member variables.
1310      */
DL_HatchEdgeDataDL_HatchEdgeData1311     DL_HatchEdgeData(double acx, double acy,
1312                      double aRadius,
1313                      double aAngle1, double aAngle2,
1314                      bool aCcw) {
1315         cx = acx;
1316         cy = acy;
1317         radius = aRadius;
1318         angle1 = aAngle1;
1319         angle2 = aAngle2;
1320         ccw = aCcw;
1321         type = 2;
1322         defined = true;
1323     }
1324 
1325     /**
1326      * Edge type. 1=line, 2=arc.
1327      */
1328     int type;
1329 
1330     /**
1331      * Set to true if this edge is fully defined.
1332      */
1333     bool defined;
1334 
1335     /*! Start point (X). */
1336     double x1;
1337     /*! Start point (Y). */
1338     double y1;
1339     /*! End point (X). */
1340     double x2;
1341     /*! End point (Y). */
1342     double y2;
1343     /*! Center point of arc (X). */
1344     double cx;
1345     /*! Center point of arc (Y). */
1346     double cy;
1347     /*! Arc radius. */
1348     double radius;
1349     /*! Start angle. */
1350     double angle1;
1351     /*! End angle. */
1352     double angle2;
1353     /*! Counterclockwise flag. */
1354     bool ccw;
1355 };
1356 
1357 
1358 
1359 /**
1360  * Image Data.
1361  *
1362  * @author Andrew Mustun
1363  */
1364 struct DL_ImageData {
1365     /**
1366      * Constructor.
1367      * Parameters: see member variables.
1368      */
DL_ImageDataDL_ImageData1369     DL_ImageData(const string& iref,
1370                   double iipx, double iipy, double iipz,
1371 				  double iux, double iuy, double iuz,
1372 				  double ivx, double ivy, double ivz,
1373 				  int iwidth, int iheight,
1374 				  int ibrightness, int icontrast, int ifade) {
1375         ref = iref;
1376         ipx = iipx;
1377         ipy = iipy;
1378         ipz = iipz;
1379 		ux = iux;
1380 		uy = iuy;
1381 		uz = iuz;
1382 		vx = ivx;
1383 		vy = ivy;
1384 		vz = ivz;
1385 		width = iwidth;
1386 		height = iheight;
1387 		brightness = ibrightness;
1388 		contrast = icontrast;
1389 		fade = ifade;
1390     }
1391 
1392     /*! Reference to the image file
1393 	    (unique, used to refer to the image def object). */
1394     string ref;
1395     /*! X Coordinate of insertion point. */
1396     double ipx;
1397     /*! Y Coordinate of insertion point. */
1398     double ipy;
1399     /*! Z Coordinate of insertion point. */
1400     double ipz;
1401 	/*! X Coordinate of u vector along bottom of image. */
1402 	double ux;
1403 	/*! Y Coordinate of u vector along bottom of image. */
1404 	double uy;
1405 	/*! Z Coordinate of u vector along bottom of image. */
1406 	double uz;
1407 	/*! X Coordinate of v vector along left side of image. */
1408 	double vx;
1409 	/*! Y Coordinate of v vector along left side of image. */
1410 	double vy;
1411 	/*! Z Coordinate of v vector along left side of image. */
1412 	double vz;
1413 	/*! Width of image in pixel. */
1414 	int width;
1415 	/*! Height of image in pixel. */
1416 	int height;
1417 	/*! Brightness (0..100, default = 50). */
1418 	int brightness;
1419 	/*! Contrast (0..100, default = 50). */
1420 	int contrast;
1421 	/*! Fade (0..100, default = 0). */
1422 	int fade;
1423 };
1424 
1425 
1426 
1427 /**
1428  * Image Definition Data.
1429  *
1430  * @author Andrew Mustun
1431  */
1432 struct DL_ImageDefData {
1433     /**
1434      * Constructor.
1435      * Parameters: see member variables.
1436      */
DL_ImageDefDataDL_ImageDefData1437     DL_ImageDefData(const string& iref,
1438 				 const string& ifile) {
1439         ref = iref;
1440 		file = ifile;
1441     }
1442 
1443     /*! Reference to the image file
1444 	    (unique, used to refer to the image def object). */
1445     string ref;
1446 
1447 	/*! Image file */
1448 	string file;
1449 };
1450 
1451 #endif
1452 
1453 // EOF
1454 
1455