LibreOffice Module vcl (master) 1
dxfentrd.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include "dxfgrprd.hxx"
23#include "dxfvec.hxx"
24#include <tools/long.hxx>
25
26#include <memory>
27#include <vector>
28
48};
49
50// base class of an entity
51
53
54public:
55
57 // pointer to next entity (in the list of DXFEntities.pFirst)
58
60 // entity kind (line or circle or what)
61
62 // properties that all entities have, each
63 // commented with group codes:
64 OString m_sLayer; // 8
65 OString m_sLineType; // 6
66 double fThickness; // 39
69 DXFVector aExtrusion; // 210,220,230
70
71protected:
72
74 // always initialize the constructors of entities with default values
75
76public:
77
78 virtual ~DXFBasicEntity();
79 void Read(DXFGroupReader & rDGR);
80 // Reads a parameter till the next 0-group
81
82protected:
83
84 virtual void EvaluateGroup(DXFGroupReader & rDGR);
85 // This method will be called by Read() for every parameter (respectively
86 // for every group).
87 // As far as the group code of the entity is known, the corresponding
88 // parameter is fetched.
89
90};
91
92
93// the different kinds of entities
94
96
97public:
98
99 DXFVector aP0; // 10,20,30
100 DXFVector aP1; // 11,21,31
101
103
104protected:
105
106 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
107};
108
110
111public:
112
113 DXFVector aP0; // 10,20,30
114
116
117protected:
118
119 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
120};
121
123
124public:
125
126 DXFVector aP0; // 10,20,30
127 double fRadius; // 40
128
130
131protected:
132
133 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
134};
135
137
138public:
139
140 DXFVector aP0; // 10,20,30
141 double fRadius; // 40
142 double fStart; // 50
143 double fEnd; // 51
144
145 DXFArcEntity();
146
147protected:
148
149 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
150};
151
153
154public:
155
156 DXFVector aP0; // 10,20,30
157 DXFVector aP1; // 11,21,31
158 DXFVector aP2; // 12,22,32
159 DXFVector aP3; // 13,23,33
160
162
163protected:
164
165 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
166};
167
169
170public:
171
172 DXFVector aP0; // 10,20,30
173 DXFVector aP1; // 11,21,31
174 DXFVector aP2; // 12,22,32
175 DXFVector aP3; // 13,23,33
176
178
179protected:
180
181 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
182};
183
185
186public:
187
188 DXFVector aP0; // 10,20,30
189 double fHeight; // 40
190 OString m_sText; // 1
191 double fRotAngle; // 50
192 double fXScale; // 41
193 double fOblAngle; // 42
194 OString m_sStyle; // 7
198 DXFVector aAlign; // 11,21,31
199
201
202protected:
203
204 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
205};
206
208
209 DXFVector aP0; // 10,20,30
210 double fSize; // 40
211 OString m_sName; // 2
212 double fRotAngle; // 50
213 double fXScale; // 41
214 double fOblAngle; // 51
215
216public:
217
219
220protected:
221
222 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
223};
224
226
227public:
228
230 OString m_sName; // 2
231 DXFVector aP0; // 10,20,30
232 double fXScale; // 41
233 double fYScale; // 42
234 double fZScale; // 43
235 double fRotAngle; // 50
238 double fColSpace; // 44
239 double fRowSpace; // 45
240
242
243protected:
244
245 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
246};
247
249
250 DXFVector aP0; // 10,20,30
251 double fHeight; // 40
252 OString m_sDefVal; // 1
253 OString m_sPrompt; // 3
254 OString m_sTagStr; // 2
257 double fRotAngle; // 50
258 double fXScale; // 41
259 double fOblAngle; // 51
260 OString m_sStyle; // 7
264 DXFVector aAlign; // 11,21,31
265
266public:
267
269
270protected:
271
272 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
273};
274
276
277public:
278
279 DXFVector aP0; // 10,20,30
280 double fHeight; // 40
281 OString m_sText; // 1
282 OString m_sTagStr; // 2
285 double fRotAngle; // 50
286 double fXScale; // 41
287 double fOblAngle; // 51
288 OString m_sStyle; // 7
292 DXFVector aAlign; // 11,21,31
293
295
296protected:
297
298 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
299};
300
302
303public:
304
306 double fSWidth; // 40
307 double fEWidth; // 41
313
315
316protected:
317
318 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
319};
320
322{
323 sal_Int32 nIndex;
324 sal_Int32 nCount; // 90
325
326 public:
327
328 sal_Int32 nFlags; // 70 1 = closed, 128 = plinegen
329 double fConstantWidth; // 43 (optional - default: 0, not used if fStartWidth and/or fEndWidth is used)
330 double fStartWidth; // 40
331 double fEndWidth; // 41
332
333 std::vector<DXFVector> aP;
334
336
337 protected:
338
339 virtual void EvaluateGroup( DXFGroupReader & rDGR ) override;
340
341};
342
344{
345 sal_Int32 nEdgeType;
346
347 virtual ~DXFEdgeType(){};
348 virtual bool EvaluateGroup( DXFGroupReader & /*rDGR*/ ){ return true; };
349
350 protected:
351
353};
354
356{
360 virtual bool EvaluateGroup( DXFGroupReader & rDGR ) override;
361};
362
364{
366 double fRadius; // 40
367 double fStartAngle; // 50
368 double fEndAngle; // 51
369 sal_Int32 nIsCounterClockwiseFlag; // 73
370public:
372 virtual bool EvaluateGroup( DXFGroupReader & rDGR ) override;
373};
374
376{
379 double fLength; // 40
380 double fStartAngle; // 50
381 double fEndAngle; // 51
382 sal_Int32 nIsCounterClockwiseFlag; // 73
383public:
385 virtual bool EvaluateGroup( DXFGroupReader & rDGR ) override;
386};
387
389{
390 sal_Int32 nDegree; // 94
391 sal_Int32 nRational; // 73
392 sal_Int32 nPeriodic; // 74
393 sal_Int32 nKnotCount; // 75
394 sal_Int32 nControlCount; // 76
395public:
397 virtual bool EvaluateGroup( DXFGroupReader & rDGR ) override;
398};
399
401{
402private:
403 sal_Int32 nPointCount; // 93
404public:
405 sal_Int32 nFlags; // 92
406 sal_Int32 nHasBulgeFlag; // 72
407 sal_Int32 nIsClosedFlag; // 73
408 double fBulge; // 42
409 sal_Int32 nSourceBoundaryObjects; // 97
410 sal_Int32 nEdgeCount; // 93
411
413 sal_Int32 nPointIndex;
414
415 std::vector<DXFVector> aP;
416 std::vector<std::unique_ptr<DXFEdgeType>> aEdges;
417
419
420 bool EvaluateGroup( DXFGroupReader & rDGR );
421};
422
424{
427
428 public:
429
430 sal_Int32 nFlags; // 70 (solid fill = 1, pattern fill = 0)
431 sal_Int32 nAssociativityFlag; // 71 (associative = 1, non-associative = 0)
432 sal_Int32 nMaxBoundaryPathCount; // 91
433 sal_Int32 nHatchStyle; // 75 (odd parity = 0, outmost area = 1, entire area = 2 )
434 sal_Int32 nHatchPatternType; // 76 (user defined = 0, predefined = 1, custom = 2)
435 double fHatchPatternAngle; // 52 (pattern fill only)
436 double fHatchPatternScale; // 41 (pattern fill only:scale or spacing)
437 sal_Int32 nHatchDoubleFlag; // 77 (pattern fill only:double = 1, not double = 0)
439 double fPixelSize; // 47
440 sal_Int32 nNumberOfSeedPoints; // 98
441
442 std::vector<DXFBoundaryPathData> aBoundaryPathData;
443
445
446 protected:
447
448 virtual void EvaluateGroup( DXFGroupReader & rDGR ) override;
449};
450
452
453public:
454
455 DXFVector aP0; // 10,20,30
456 double fSWidth; // 40 (if <0.0, then one has DXFPolyLine::fSWidth)
457 double fEWidth; // 41 (if <0.0, then one has DXFPolyLine::fEWidth)
458 double fBulge; // 42
460 double fCFTDir; // 50
461
463
464protected:
465
466 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
467};
468
470
471public:
472
474};
475
477
478public:
479
480 DXFVector aP0; // 10,20,30
481 DXFVector aP1; // 11,21,31
482 DXFVector aP2; // 12,22,32
483 DXFVector aP3; // 13,23,33
485
487
488protected:
489
490 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
491};
492
494
495public:
496
497 OString m_sPseudoBlock; // 2
498
500
501protected:
502
503 virtual void EvaluateGroup(DXFGroupReader & rDGR) override;
504};
505
506
507// read and represent the set of entities
509
510public:
511
513 : pFirst(nullptr)
514 , mbBeingDrawn(false)
515 {
516 }
517
519 {
520 Clear();
521 }
522
523 DXFBasicEntity * pFirst; // list of entities, READ ONLY!
524 mutable bool mbBeingDrawn; // guard for loop in entity parsing
525
526 void Read(DXFGroupReader & rDGR);
527 // read entities by rGDR of a DXF file until a
528 // ENDBLK, ENDSEC or EOF (of group 0).
529 // (all unknown thing will be skipped)
530
531 void Clear();
532 // deletes all entities
533};
534
535/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
EdgeType
tools::Long nIEFlags
Definition: dxfentrd.hxx:484
DXFVector aP3
Definition: dxfentrd.hxx:483
DXFVector aP0
Definition: dxfentrd.hxx:480
DXFVector aP1
Definition: dxfentrd.hxx:481
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:755
DXFVector aP2
Definition: dxfentrd.hxx:482
double fStart
Definition: dxfentrd.hxx:142
double fRadius
Definition: dxfentrd.hxx:141
double fEnd
Definition: dxfentrd.hxx:143
DXFVector aP0
Definition: dxfentrd.hxx:140
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:128
double fRotAngle
Definition: dxfentrd.hxx:257
DXFVector aAlign
Definition: dxfentrd.hxx:264
double fOblAngle
Definition: dxfentrd.hxx:259
OString m_sStyle
Definition: dxfentrd.hxx:260
tools::Long nAttrFlags
Definition: dxfentrd.hxx:255
tools::Long nFieldLen
Definition: dxfentrd.hxx:256
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:305
OString m_sPrompt
Definition: dxfentrd.hxx:253
OString m_sDefVal
Definition: dxfentrd.hxx:252
OString m_sTagStr
Definition: dxfentrd.hxx:254
tools::Long nGenFlags
Definition: dxfentrd.hxx:261
tools::Long nHorzJust
Definition: dxfentrd.hxx:262
DXFVector aP0
Definition: dxfentrd.hxx:250
tools::Long nVertJust
Definition: dxfentrd.hxx:263
OString m_sText
Definition: dxfentrd.hxx:281
tools::Long nHorzJust
Definition: dxfentrd.hxx:290
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:348
tools::Long nGenFlags
Definition: dxfentrd.hxx:289
tools::Long nVertJust
Definition: dxfentrd.hxx:291
DXFVector aAlign
Definition: dxfentrd.hxx:292
OString m_sTagStr
Definition: dxfentrd.hxx:282
double fOblAngle
Definition: dxfentrd.hxx:287
tools::Long nAttrFlags
Definition: dxfentrd.hxx:283
DXFVector aP0
Definition: dxfentrd.hxx:279
double fRotAngle
Definition: dxfentrd.hxx:285
OString m_sStyle
Definition: dxfentrd.hxx:288
tools::Long nFieldLen
Definition: dxfentrd.hxx:284
tools::Long nSpace
Definition: dxfentrd.hxx:68
DXFBasicEntity * pSucc
Definition: dxfentrd.hxx:56
DXFBasicEntity(DXFEntityType eThisType)
Definition: dxfentrd.cxx:28
OString m_sLineType
Definition: dxfentrd.hxx:65
DXFVector aExtrusion
Definition: dxfentrd.hxx:69
OString m_sLayer
Definition: dxfentrd.hxx:64
virtual ~DXFBasicEntity()
Definition: dxfentrd.cxx:62
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:42
double fThickness
Definition: dxfentrd.hxx:66
DXFEntityType eType
Definition: dxfentrd.hxx:59
tools::Long nColor
Definition: dxfentrd.hxx:67
virtual void EvaluateGroup(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:47
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:108
DXFVector aP0
Definition: dxfentrd.hxx:126
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:782
OString m_sPseudoBlock
Definition: dxfentrd.hxx:497
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:487
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:369
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:382
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:512
sal_Int32 nRational
Definition: dxfentrd.hxx:391
sal_Int32 nPeriodic
Definition: dxfentrd.hxx:392
sal_Int32 nDegree
Definition: dxfentrd.hxx:390
sal_Int32 nControlCount
Definition: dxfentrd.hxx:394
sal_Int32 nKnotCount
Definition: dxfentrd.hxx:393
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:540
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:792
void Clear()
Definition: dxfentrd.cxx:837
bool mbBeingDrawn
Definition: dxfentrd.hxx:524
DXFBasicEntity * pFirst
Definition: dxfentrd.hxx:523
sal_Int32 nHatchStyle
Definition: dxfentrd.hxx:433
sal_Int32 nCurrentBoundaryPathIndex
Definition: dxfentrd.hxx:426
double fHatchPatternScale
Definition: dxfentrd.hxx:436
sal_Int32 nMaxBoundaryPathCount
Definition: dxfentrd.hxx:432
sal_Int32 nNumberOfSeedPoints
Definition: dxfentrd.hxx:440
sal_Int32 nFlags
Definition: dxfentrd.hxx:430
double fPixelSize
Definition: dxfentrd.hxx:439
sal_Int32 nHatchDoubleFlag
Definition: dxfentrd.hxx:437
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:660
bool bIsInBoundaryPathContext
Definition: dxfentrd.hxx:425
double fHatchPatternAngle
Definition: dxfentrd.hxx:435
sal_Int32 nAssociativityFlag
Definition: dxfentrd.hxx:431
std::vector< DXFBoundaryPathData > aBoundaryPathData
Definition: dxfentrd.hxx:442
sal_Int32 nHatchPatternDefinitionLines
Definition: dxfentrd.hxx:438
sal_Int32 nHatchPatternType
Definition: dxfentrd.hxx:434
tools::Long nAttrFlag
Definition: dxfentrd.hxx:229
tools::Long nRowCount
Definition: dxfentrd.hxx:237
OString m_sName
Definition: dxfentrd.hxx:230
double fRotAngle
Definition: dxfentrd.hxx:235
tools::Long nColCount
Definition: dxfentrd.hxx:236
double fRowSpace
Definition: dxfentrd.hxx:239
double fColSpace
Definition: dxfentrd.hxx:238
DXFVector aP0
Definition: dxfentrd.hxx:231
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:268
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:415
std::vector< DXFVector > aP
Definition: dxfentrd.hxx:333
DXFVector aP1
Definition: dxfentrd.hxx:100
DXFVector aP0
Definition: dxfentrd.hxx:99
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:72
DXFVector aP0
Definition: dxfentrd.hxx:113
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:91
tools::Long nNDensity
Definition: dxfentrd.hxx:311
tools::Long nMDensity
Definition: dxfentrd.hxx:310
tools::Long nFlags
Definition: dxfentrd.hxx:305
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:387
tools::Long nMeshMCount
Definition: dxfentrd.hxx:308
tools::Long nCSSType
Definition: dxfentrd.hxx:312
tools::Long nMeshNCount
Definition: dxfentrd.hxx:309
DXFVector aP0
Definition: dxfentrd.hxx:209
OString m_sName
Definition: dxfentrd.hxx:211
double fRotAngle
Definition: dxfentrd.hxx:212
double fXScale
Definition: dxfentrd.hxx:213
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:238
double fOblAngle
Definition: dxfentrd.hxx:214
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:172
DXFVector aP3
Definition: dxfentrd.hxx:175
DXFVector aP0
Definition: dxfentrd.hxx:172
DXFVector aP2
Definition: dxfentrd.hxx:174
DXFVector aP1
Definition: dxfentrd.hxx:173
tools::Long nGenFlags
Definition: dxfentrd.hxx:195
DXFVector aP0
Definition: dxfentrd.hxx:188
double fXScale
Definition: dxfentrd.hxx:192
tools::Long nVertJust
Definition: dxfentrd.hxx:197
double fHeight
Definition: dxfentrd.hxx:189
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:206
OString m_sStyle
Definition: dxfentrd.hxx:194
tools::Long nHorzJust
Definition: dxfentrd.hxx:196
double fOblAngle
Definition: dxfentrd.hxx:193
DXFVector aAlign
Definition: dxfentrd.hxx:198
double fRotAngle
Definition: dxfentrd.hxx:191
OString m_sText
Definition: dxfentrd.hxx:190
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:147
DXFVector aP0
Definition: dxfentrd.hxx:156
DXFVector aP1
Definition: dxfentrd.hxx:157
DXFVector aP2
Definition: dxfentrd.hxx:158
DXFVector aP3
Definition: dxfentrd.hxx:159
DXFVector aP0
Definition: dxfentrd.hxx:455
tools::Long nFlags
Definition: dxfentrd.hxx:459
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:727
DXFEntityType
Definition: dxfentrd.hxx:29
@ DXF_SEQEND
Definition: dxfentrd.hxx:43
@ DXF_CIRCLE
Definition: dxfentrd.hxx:32
@ DXF_POINT
Definition: dxfentrd.hxx:31
@ DXF_TEXT
Definition: dxfentrd.hxx:36
@ DXF_SOLID
Definition: dxfentrd.hxx:35
@ DXF_ARC
Definition: dxfentrd.hxx:33
@ DXF_INSERT
Definition: dxfentrd.hxx:38
@ DXF_POLYLINE
Definition: dxfentrd.hxx:41
@ DXF_DIMENSION
Definition: dxfentrd.hxx:45
@ DXF_VERTEX
Definition: dxfentrd.hxx:42
@ DXF_3DFACE
Definition: dxfentrd.hxx:44
@ DXF_ATTRIB
Definition: dxfentrd.hxx:40
@ DXF_TRACE
Definition: dxfentrd.hxx:34
@ DXF_HATCH
Definition: dxfentrd.hxx:47
@ DXF_LWPOLYLINE
Definition: dxfentrd.hxx:46
@ DXF_SHAPE
Definition: dxfentrd.hxx:37
@ DXF_LINE
Definition: dxfentrd.hxx:30
@ DXF_ATTDEF
Definition: dxfentrd.hxx:39
long Long
std::vector< DXFVector > aP
Definition: dxfentrd.hxx:415
sal_Int32 nEdgeCount
Definition: dxfentrd.hxx:410
sal_Int32 nSourceBoundaryObjects
Definition: dxfentrd.hxx:409
sal_Int32 nPointCount
Definition: dxfentrd.hxx:403
sal_Int32 nHasBulgeFlag
Definition: dxfentrd.hxx:406
sal_Int32 nIsClosedFlag
Definition: dxfentrd.hxx:407
sal_Int32 nPointIndex
Definition: dxfentrd.hxx:413
std::vector< std::unique_ptr< DXFEdgeType > > aEdges
Definition: dxfentrd.hxx:416
bool EvaluateGroup(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:568
DXFVector aStartPoint
Definition: dxfentrd.hxx:357
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:464
DXFVector aEndPoint
Definition: dxfentrd.hxx:358
DXFEdgeType(sal_Int32 EdgeType)
Definition: dxfentrd.hxx:352
virtual bool EvaluateGroup(DXFGroupReader &)
Definition: dxfentrd.hxx:348
sal_Int32 nEdgeType
Definition: dxfentrd.hxx:345
virtual ~DXFEdgeType()
Definition: dxfentrd.hxx:347