1 /****************************************************************************
2 ** $Id: dl_entities.h 2398 2005-06-06 18:12:14Z andrew $
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
6 ** This file is part of the dxflib project.
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.
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.
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.
20 ** See http://www.ribbonsoft.com for further details.
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
25 **********************************************************************/
37 * @author Andrew Mustun
42 * Parameters: see member variables.
44 DL_LayerData(const string& lName,
52 /** Layer flags. (1 = frozen, 2 = frozen by default, 4 = locked) */
61 * @author Andrew Mustun
66 * Parameters: see member variables.
68 DL_BlockData(const string& bName,
70 double bbpx, double bbpy, double bbpz) {
80 /** Block flags. (not used currently) */
82 /** X Coordinate of base point. */
84 /** Y Coordinate of base point. */
86 /** Z Coordinate of base point. */
95 * @author Andrew Mustun
97 struct DL_LineTypeData {
100 * Parameters: see member variables.
102 DL_LineTypeData(const string& lName,
108 /** Line type name. */
110 /** Line type flags. */
119 * @author Andrew Mustun
121 struct DL_PointData {
124 * Parameters: see member variables.
126 DL_PointData(double px=0.0, double py=0.0, double pz=0.0) {
132 /*! X Coordinate of the point. */
134 /*! Y Coordinate of the point. */
136 /*! Z Coordinate of the point. */
145 * @author Andrew Mustun
150 * Parameters: see member variables.
152 DL_LineData(double lx1, double ly1, double lz1,
153 double lx2, double ly2, double lz2) {
163 /*! X Start coordinate of the point. */
165 /*! Y Start coordinate of the point. */
167 /*! Z Start coordinate of the point. */
170 /*! X End coordinate of the point. */
172 /*! Y End coordinate of the point. */
174 /*! Z End coordinate of the point. */
183 * @author Andrew Mustun
188 * Parameters: see member variables.
190 DL_ArcData(double acx, double acy, double acz,
192 double aAngle1, double aAngle2) {
202 /*! X Coordinate of center point. */
204 /*! Y Coordinate of center point. */
206 /*! Z Coordinate of center point. */
209 /*! Radius of arc. */
211 /*! Startangle of arc in degrees. */
213 /*! Endangle of arc in degrees. */
222 * @author Andrew Mustun
224 struct DL_CircleData {
227 * Parameters: see member variables.
229 DL_CircleData(double acx, double acy, double acz,
238 /*! X Coordinate of center point. */
240 /*! Y Coordinate of center point. */
242 /*! Z Coordinate of center point. */
245 /*! Radius of arc. */
254 * @author Andrew Mustun
256 struct DL_PolylineData {
259 * Parameters: see member variables.
261 DL_PolylineData(int pNumber, int pMVerteces, int pNVerteces, int pFlags) {
268 /*! Number of vertices in this polyline. */
271 /*! Number of vertices in m direction if polyline is a polygon mesh. */
274 /*! Number of vertices in n direction if polyline is a polygon mesh. */
286 * @author Andrew Mustun
288 struct DL_VertexData {
291 * Parameters: see member variables.
293 DL_VertexData(double px=0.0, double py=0.0, double pz=0.0,
301 /*! X Coordinate of the vertex. */
303 /*! Y Coordinate of the vertex. */
305 /*! Z Coordinate of the vertex. */
308 * (The tangent of 1/4 of the arc angle or 0 for lines) */
318 struct DL_TraceData {
330 typedef DL_TraceData DL_SolidData;
336 * @author Andrew Mustun
338 struct DL_SplineData {
341 * Parameters: see member variables.
343 DL_SplineData(int pDegree, int pNKnots, int pNControl, int pFlags) {
346 nControl = pNControl;
350 /*! Degree of the spline curve. */
353 /*! Number of knots. */
356 /*! Number of control points. */
357 unsigned int nControl;
368 * @author Andrew Mustun
374 * Parameters: see member variables.
376 DL_KnotData(double pk) {
387 * Spline control point data.
389 * @author Andrew Mustun
391 struct DL_ControlPointData {
394 * Parameters: see member variables.
396 DL_ControlPointData(double px, double py, double pz) {
402 /*! X coordinate of the control point. */
404 /*! Y coordinate of the control point. */
406 /*! Z coordinate of the control point. */
414 * @author Andrew Mustun
416 struct DL_EllipseData {
419 * Parameters: see member variables.
421 DL_EllipseData(double ecx, double ecy, double ecz,
422 double emx, double emy, double emz,
424 double eAngle1, double eAngle2) {
437 /*! X Coordinate of center point. */
439 /*! Y Coordinate of center point. */
441 /*! Z Coordinate of center point. */
444 /*! X coordinate of the endpoint of the major axis. */
446 /*! Y coordinate of the endpoint of the major axis. */
448 /*! Z coordinate of the endpoint of the major axis. */
451 /*! Ratio of minor axis to major axis.. */
453 /*! Startangle of ellipse in rad. */
455 /*! Endangle of ellipse in rad. */
464 * @author Andrew Mustun
466 struct DL_InsertData {
469 * Parameters: see member variables.
471 DL_InsertData(const string& iName,
472 double iipx, double iipy, double iipz,
473 double isx, double isy, double isz,
475 int iCols, int iRows,
476 double iColSp, double iRowSp) {
491 /*! Name of the referred block. */
493 /*! X Coordinate of insertion point. */
495 /*! Y Coordinate of insertion point. */
497 /*! Z Coordinate of insertion point. */
499 /*! X Scale factor. */
501 /*! Y Scale factor. */
503 /*! Z Scale factor. */
505 /*! Rotation angle in rad. */
507 /*! Number of colums if we insert an array of the block or 1. */
509 /*! Number of rows if we insert an array of the block or 1. */
511 /*! Values for the spacing between cols. */
513 /*! Values for the spacing between rows. */
522 * @author Andrew Mustun
524 struct DL_MTextData {
527 * Parameters: see member variables.
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,
536 const string& tStyle,
544 attachmentPoint = tAttachmentPoint;
545 drawingDirection = tDrawingDirection;
546 lineSpacingStyle = tLineSpacingStyle;
547 lineSpacingFactor = tLineSpacingFactor;
553 /*! X Coordinate of insertion point. */
555 /*! Y Coordinate of insertion point. */
557 /*! Z Coordinate of insertion point. */
561 /*! Width of the text box. */
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
574 * 1 = left to right, 3 = top to bottom, 5 = by style
576 int drawingDirection;
578 * Line spacing style.
580 * 1 = at least, 2 = exact
582 int lineSpacingStyle;
584 * Line spacing factor. 0.25 .. 4.0
586 double lineSpacingFactor;
591 /*! Rotation angle. */
600 * @author Andrew Mustun
605 * Parameters: see member variables.
607 DL_TextData(double tipx, double tipy, double tipz,
608 double tapx, double tapy, double tapz,
609 double tHeight, double tXScaleFactor,
610 int tTextGenerationFlags,
614 const string& tStyle,
625 xScaleFactor = tXScaleFactor;
626 textGenerationFlags = tTextGenerationFlags;
627 hJustification = tHJustification;
628 vJustification = tVJustification;
634 /*! X Coordinate of insertion point. */
636 /*! Y Coordinate of insertion point. */
638 /*! Z Coordinate of insertion point. */
641 /*! X Coordinate of alignment point. */
643 /*! Y Coordinate of alignment point. */
645 /*! Z Coordinate of alignment point. */
650 /*! Relative X scale factor. */
652 /*! 0 = default, 2 = Backwards, 4 = Upside down */
653 int textGenerationFlags;
655 * Horizontal justification.
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.
663 * Vertical justification.
665 * 0 = Baseline (default), 1 = Bottom, 2 = Middle, 3= Top
672 /*! Rotation angle of dimension text away from default orientation. */
679 * Generic Dimension Data.
681 * @author Andrew Mustun
683 struct DL_DimensionData {
686 * Parameters: see member variables.
688 DL_DimensionData(double ddpx, double ddpy, double ddpz,
689 double dmpx, double dmpy, double dmpz,
691 int dAttachmentPoint,
692 int dLineSpacingStyle,
693 double dLineSpacingFactor,
695 const string& dStyle,
708 attachmentPoint = dAttachmentPoint;
709 lineSpacingStyle = dLineSpacingStyle;
710 lineSpacingFactor = dLineSpacingFactor;
716 /*! X Coordinate of definition point. */
718 /*! Y Coordinate of definition point. */
720 /*! Z Coordinate of definition point. */
722 /*! X Coordinate of middle point of the text. */
724 /*! Y Coordinate of middle point of the text. */
726 /*! Z Coordinate of middle point of the text. */
731 * 0 Rotated, horizontal, or vertical
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
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
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,
757 * Line spacing style.
759 * 1 = at least, 2 = exact
761 int lineSpacingStyle;
763 * Line spacing factor. 0.25 .. 4.0
765 double lineSpacingFactor;
769 * Text string entered explicitly by user or null
770 * or "<>" for the actual measurement or " " (one blank space).
771 * for supressing the text.
774 /*! Dimension style (font name). */
777 * Rotation angle of dimension text away from
778 * default orientation.
786 * Aligned Dimension Data.
788 * @author Andrew Mustun
790 struct DL_DimAlignedData {
793 * Parameters: see member variables.
795 DL_DimAlignedData(double depx1, double depy1, double depz1,
796 double depx2, double depy2, double depz2) {
807 /*! X Coordinate of Extension point 1. */
809 /*! Y Coordinate of Extension point 1. */
811 /*! Z Coordinate of Extension point 1. */
814 /*! X Coordinate of Extension point 2. */
816 /*! Y Coordinate of Extension point 2. */
818 /*! Z Coordinate of Extension point 2. */
825 * Linear Dimension Data.
827 * @author Andrew Mustun
829 struct DL_DimLinearData {
832 * Parameters: see member variables.
834 DL_DimLinearData(double ddpx1, double ddpy1, double ddpz1,
835 double ddpx2, double ddpy2, double ddpz2,
836 double dAngle, double dOblique) {
850 /*! X Coordinate of Extension point 1. */
852 /*! Y Coordinate of Extension point 1. */
854 /*! Z Coordinate of Extension point 1. */
857 /*! X Coordinate of Extension point 2. */
859 /*! Y Coordinate of Extension point 2. */
861 /*! Z Coordinate of Extension point 2. */
864 /*! Rotation angle (angle of dimension line) in degrees. */
866 /*! Oblique angle in degrees. */
873 * Radial Dimension Data.
875 * @author Andrew Mustun
877 struct DL_DimRadialData {
880 * Parameters: see member variables.
882 DL_DimRadialData(double ddpx, double ddpy, double ddpz, double dleader) {
890 /*! X Coordinate of definition point. */
892 /*! Y Coordinate of definition point. */
894 /*! Z Coordinate of definition point. */
904 * Diametric Dimension Data.
906 * @author Andrew Mustun
908 struct DL_DimDiametricData {
911 * Parameters: see member variables.
913 DL_DimDiametricData(double ddpx, double ddpy, double ddpz, double dleader) {
921 /*! X Coordinate of definition point. */
923 /*! Y Coordinate of definition point. */
925 /*! Z Coordinate of definition point. */
935 * Angular Dimension Data.
937 * @author Andrew Mustun
939 struct DL_DimAngularData {
942 * Parameters: see member variables.
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) {
966 /*! X Coordinate of definition point 1. */
968 /*! Y Coordinate of definition point 1. */
970 /*! Z Coordinate of definition point 1. */
973 /*! X Coordinate of definition point 2. */
975 /*! Y Coordinate of definition point 2. */
977 /*! Z Coordinate of definition point 2. */
980 /*! X Coordinate of definition point 3. */
982 /*! Y Coordinate of definition point 3. */
984 /*! Z Coordinate of definition point 3. */
987 /*! X Coordinate of definition point 4. */
989 /*! Y Coordinate of definition point 4. */
991 /*! Z Coordinate of definition point 4. */
997 * Angular Dimension Data (3 points version).
999 * @author Andrew Mustun
1001 struct DL_DimAngular3PData {
1004 * Parameters: see member variables.
1006 DL_DimAngular3PData(double ddpx1, double ddpy1, double ddpz1,
1007 double ddpx2, double ddpy2, double ddpz2,
1008 double ddpx3, double ddpy3, double ddpz3) {
1023 /*! X Coordinate of definition point 1. */
1025 /*! Y Coordinate of definition point 1. */
1027 /*! Z Coordinate of definition point 1. */
1030 /*! X Coordinate of definition point 2. */
1032 /*! Y Coordinate of definition point 2. */
1034 /*! Z Coordinate of definition point 2. */
1037 /*! X Coordinate of definition point 3. */
1039 /*! Y Coordinate of definition point 3. */
1041 /*! Z Coordinate of definition point 3. */
1050 * @author Andrew Mustun
1052 struct DL_LeaderData {
1055 * Parameters: see member variables.
1057 DL_LeaderData(int lArrowHeadFlag,
1058 int lLeaderPathType,
1059 int lLeaderCreationFlag,
1060 int lHooklineDirectionFlag,
1062 double lTextAnnotationHeight,
1063 double lTextAnnotationWidth,
1066 arrowHeadFlag = lArrowHeadFlag;
1067 leaderPathType = lLeaderPathType;
1068 leaderCreationFlag = lLeaderCreationFlag;
1069 hooklineDirectionFlag = lHooklineDirectionFlag;
1070 hooklineFlag = lHooklineFlag;
1071 textAnnotationHeight = lTextAnnotationHeight;
1072 textAnnotationWidth = lTextAnnotationWidth;
1076 /*! Arrow head flag (71). */
1078 /*! Leader path type (72). */
1080 /*! Leader creation flag (73). */
1081 int leaderCreationFlag;
1082 /*! Hookline direction flag (74). */
1083 int hooklineDirectionFlag;
1084 /*! Hookline flag (75) */
1086 /*! Text annotation height (40). */
1087 double textAnnotationHeight;
1088 /*! Text annotation width (41) */
1089 double textAnnotationWidth;
1090 /*! Number of vertices in leader (76). */
1097 * Leader Vertex Data.
1099 * @author Andrew Mustun
1101 struct DL_LeaderVertexData {
1104 * Parameters: see member variables.
1106 DL_LeaderVertexData(double px=0.0, double py=0.0, double pz=0.0) {
1112 /*! X Coordinate of the vertex. */
1114 /*! Y Coordinate of the vertex. */
1116 /*! Z Coordinate of the vertex. */
1125 struct DL_HatchData {
1127 * Default constructor.
1133 * Parameters: see member variables.
1135 DL_HatchData(int hNumLoops,
1139 const string& hPattern) {
1140 numLoops = hNumLoops;
1147 /*! Number of boundary paths (loops). */
1149 /*! Solid fill flag (true=solid, false=pattern). */
1151 /*! Pattern scale or spacing */
1153 /*! Pattern angle */
1155 /*! Pattern name. */
1162 * Hatch boundary path (loop) data.
1164 struct DL_HatchLoopData {
1166 * Default constructor.
1168 DL_HatchLoopData() {}
1171 * Parameters: see member variables.
1173 DL_HatchLoopData(int hNumEdges) {
1174 numEdges = hNumEdges;
1177 /*! Number of edges in this loop. */
1186 struct DL_HatchEdgeData {
1188 * Default constructor.
1190 DL_HatchEdgeData() {
1195 * Constructor for a line edge.
1196 * Parameters: see member variables.
1198 DL_HatchEdgeData(double lx1, double ly1,
1199 double lx2, double ly2) {
1209 * Constructor for an arc edge.
1210 * Parameters: see member variables.
1212 DL_HatchEdgeData(double acx, double acy,
1214 double aAngle1, double aAngle2,
1227 * Edge type. 1=line, 2=arc.
1232 * Set to true if this edge is fully defined.
1236 /*! Start point (X). */
1238 /*! Start point (Y). */
1240 /*! End point (X). */
1242 /*! End point (Y). */
1244 /*! Center point of arc (X). */
1246 /*! Center point of arc (Y). */
1254 /*! Counterclockwise flag. */
1263 * @author Andrew Mustun
1265 struct DL_ImageData {
1268 * Parameters: see member variables.
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) {
1288 brightness = ibrightness;
1289 contrast = icontrast;
1293 /*! Reference to the image file
1294 (unique, used to refer to the image def object). */
1296 /*! X Coordinate of insertion point. */
1298 /*! Y Coordinate of insertion point. */
1300 /*! Z Coordinate of insertion point. */
1302 /*! X Coordinate of u vector along bottom of image. */
1304 /*! Y Coordinate of u vector along bottom of image. */
1306 /*! Z Coordinate of u vector along bottom of image. */
1308 /*! X Coordinate of v vector along left side of image. */
1310 /*! Y Coordinate of v vector along left side of image. */
1312 /*! Z Coordinate of v vector along left side of image. */
1314 /*! Width of image in pixel. */
1316 /*! Height of image in pixel. */
1318 /*! Brightness (0..100, default = 50). */
1320 /*! Contrast (0..100, default = 50). */
1322 /*! Fade (0..100, default = 0). */
1329 * Image Definition Data.
1331 * @author Andrew Mustun
1333 struct DL_ImageDefData {
1336 * Parameters: see member variables.
1338 DL_ImageDefData(const string& iref,
1339 const string& ifile) {
1344 /*! Reference to the image file
1345 (unique, used to refer to the image def object). */