~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/plugins/dxf2shp_converter/dxflib/src/dl_entities.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

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