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