LibreOffice Module vcl (master) 1
dxfentrd.cxx
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#include <sal/config.h>
21
22#include <o3tl/safeint.hxx>
23
24#include "dxfentrd.hxx"
25
26//--------------------------DXFBasicEntity--------------------------------------
27
29 : m_sLayer("0")
30 , m_sLineType("BYLAYER")
31{
32 eType=eThisType;
33 pSucc=nullptr;
34 fThickness=0;
35 nColor=256;
36 nSpace=0;
37 aExtrusion.fx=0.0;
38 aExtrusion.fy=0.0;
39 aExtrusion.fz=1.0;
40}
41
43{
44 while (rDGR.Read()!=0) EvaluateGroup(rDGR);
45}
46
48{
49 switch (rDGR.GetG())
50 {
51 case 8: m_sLayer = rDGR.GetS(); break;
52 case 6: m_sLineType = rDGR.GetS(); break;
53 case 39: fThickness=rDGR.GetF(); break;
54 case 62: nColor=rDGR.GetI(); break;
55 case 67: nSpace=rDGR.GetI(); break;
56 case 210: aExtrusion.fx=rDGR.GetF(); break;
57 case 220: aExtrusion.fy=rDGR.GetF(); break;
58 case 230: aExtrusion.fz=rDGR.GetF(); break;
59 }
60}
61
63{
64}
65
66//--------------------------DXFLineEntity---------------------------------------
67
69{
70}
71
73{
74 switch (rDGR.GetG()) {
75 case 10: aP0.fx=rDGR.GetF(); break;
76 case 20: aP0.fy=rDGR.GetF(); break;
77 case 30: aP0.fz=rDGR.GetF(); break;
78 case 11: aP1.fx=rDGR.GetF(); break;
79 case 21: aP1.fy=rDGR.GetF(); break;
80 case 31: aP1.fz=rDGR.GetF(); break;
81 default: DXFBasicEntity::EvaluateGroup(rDGR);
82 }
83}
84
85//--------------------------DXFPointEntity--------------------------------------
86
88{
89}
90
92{
93 switch (rDGR.GetG()) {
94 case 10: aP0.fx=rDGR.GetF(); break;
95 case 20: aP0.fy=rDGR.GetF(); break;
96 case 30: aP0.fz=rDGR.GetF(); break;
97 default: DXFBasicEntity::EvaluateGroup(rDGR);
98 }
99}
100
101//--------------------------DXFCircleEntity-------------------------------------
102
104{
105 fRadius=1.0;
106}
107
109{
110 switch (rDGR.GetG()) {
111 case 10: aP0.fx=rDGR.GetF(); break;
112 case 20: aP0.fy=rDGR.GetF(); break;
113 case 30: aP0.fz=rDGR.GetF(); break;
114 case 40: fRadius=rDGR.GetF(); break;
115 default: DXFBasicEntity::EvaluateGroup(rDGR);
116 }
117}
118
119//--------------------------DXFArcEntity----------------------------------------
120
122{
123 fRadius=1.0;
124 fStart=0;
125 fEnd=360.0;
126}
127
129{
130 switch (rDGR.GetG()) {
131 case 10: aP0.fx=rDGR.GetF(); break;
132 case 20: aP0.fy=rDGR.GetF(); break;
133 case 30: aP0.fz=rDGR.GetF(); break;
134 case 40: fRadius=rDGR.GetF(); break;
135 case 50: fStart=rDGR.GetF(); break;
136 case 51: fEnd=rDGR.GetF(); break;
137 default: DXFBasicEntity::EvaluateGroup(rDGR);
138 }
139}
140
141//--------------------------DXFTraceEntity--------------------------------------
142
144{
145}
146
148{
149 switch (rDGR.GetG()) {
150 case 10: aP0.fx=rDGR.GetF(); break;
151 case 20: aP0.fy=rDGR.GetF(); break;
152 case 30: aP0.fz=rDGR.GetF(); break;
153 case 11: aP1.fx=rDGR.GetF(); break;
154 case 21: aP1.fy=rDGR.GetF(); break;
155 case 31: aP1.fz=rDGR.GetF(); break;
156 case 12: aP2.fx=rDGR.GetF(); break;
157 case 22: aP2.fy=rDGR.GetF(); break;
158 case 32: aP2.fz=rDGR.GetF(); break;
159 case 13: aP3.fx=rDGR.GetF(); break;
160 case 23: aP3.fy=rDGR.GetF(); break;
161 case 33: aP3.fz=rDGR.GetF(); break;
162 default: DXFBasicEntity::EvaluateGroup(rDGR);
163 }
164}
165
166//--------------------------DXFSolidEntity--------------------------------------
167
169{
170}
171
173{
174 switch (rDGR.GetG()) {
175 case 10: aP0.fx=rDGR.GetF(); break;
176 case 20: aP0.fy=rDGR.GetF(); break;
177 case 30: aP0.fz=rDGR.GetF(); break;
178 case 11: aP1.fx=rDGR.GetF(); break;
179 case 21: aP1.fy=rDGR.GetF(); break;
180 case 31: aP1.fz=rDGR.GetF(); break;
181 case 12: aP2.fx=rDGR.GetF(); break;
182 case 22: aP2.fy=rDGR.GetF(); break;
183 case 32: aP2.fz=rDGR.GetF(); break;
184 case 13: aP3.fx=rDGR.GetF(); break;
185 case 23: aP3.fy=rDGR.GetF(); break;
186 case 33: aP3.fz=rDGR.GetF(); break;
187 default: DXFBasicEntity::EvaluateGroup(rDGR);
188 }
189}
190
191//--------------------------DXFTextEntity---------------------------------------
192
195 , m_sStyle("STANDARD")
196{
197 fHeight=1.0;
198 fRotAngle=0.0;
199 fXScale=1.0;
200 fOblAngle=0.0;
201 nGenFlags=0;
202 nHorzJust=0;
203 nVertJust=0;
204}
205
207{
208 switch (rDGR.GetG()) {
209 case 10: aP0.fx=rDGR.GetF(); break;
210 case 20: aP0.fy=rDGR.GetF(); break;
211 case 30: aP0.fz=rDGR.GetF(); break;
212 case 40: fHeight=rDGR.GetF(); break;
213 case 1: m_sText = rDGR.GetS(); break;
214 case 50: fRotAngle=rDGR.GetF(); break;
215 case 41: fXScale=rDGR.GetF(); break;
216 case 42: fOblAngle=rDGR.GetF(); break;
217 case 7: m_sStyle = rDGR.GetS(); break;
218 case 71: nGenFlags=rDGR.GetI(); break;
219 case 72: nHorzJust=rDGR.GetI(); break;
220 case 73: nVertJust=rDGR.GetI(); break;
221 case 11: aAlign.fx=rDGR.GetF(); break;
222 case 21: aAlign.fy=rDGR.GetF(); break;
223 case 31: aAlign.fz=rDGR.GetF(); break;
224 default: DXFBasicEntity::EvaluateGroup(rDGR);
225 }
226}
227
228//--------------------------DXFShapeEntity--------------------------------------
229
231{
232 fSize=1.0;
233 fRotAngle=0;
234 fXScale=1.0;
235 fOblAngle=0;
236}
237
239{
240 switch (rDGR.GetG()) {
241 case 10: aP0.fx=rDGR.GetF(); break;
242 case 20: aP0.fy=rDGR.GetF(); break;
243 case 30: aP0.fz=rDGR.GetF(); break;
244 case 40: fSize=rDGR.GetF(); break;
245 case 2: m_sName = rDGR.GetS(); break;
246 case 50: fRotAngle=rDGR.GetF(); break;
247 case 41: fXScale=rDGR.GetF(); break;
248 case 51: fOblAngle=rDGR.GetF(); break;
249 default: DXFBasicEntity::EvaluateGroup(rDGR);
250 }
251}
252
253//--------------------------DXFInsertEntity-------------------------------------
254
256{
257 nAttrFlag=0;
258 fXScale=1.0;
259 fYScale=1.0;
260 fZScale=1.0;
261 fRotAngle=0.0;
262 nColCount=1;
263 nRowCount=1;
264 fColSpace=0.0;
265 fRowSpace=0.0;
266}
267
269{
270 switch (rDGR.GetG()) {
271 case 66: nAttrFlag=rDGR.GetI(); break;
272 case 2: m_sName = rDGR.GetS(); break;
273 case 10: aP0.fx=rDGR.GetF(); break;
274 case 20: aP0.fy=rDGR.GetF(); break;
275 case 30: aP0.fz=rDGR.GetF(); break;
276 case 41: fXScale=rDGR.GetF(); break;
277 case 42: fYScale=rDGR.GetF(); break;
278 case 43: fZScale=rDGR.GetF(); break;
279 case 50: fRotAngle=rDGR.GetF(); break;
280 case 70: nColCount=rDGR.GetI(); break;
281 case 71: nRowCount=rDGR.GetI(); break;
282 case 44: fColSpace=rDGR.GetF(); break;
283 case 45: fRowSpace=rDGR.GetF(); break;
284 default: DXFBasicEntity::EvaluateGroup(rDGR);
285 }
286}
287
288//--------------------------DXFAttDefEntity-------------------------------------
289
292 , m_sStyle("STANDARD")
293{
294 fHeight=1.0;
295 nAttrFlags=0;
296 nFieldLen=0;
297 fRotAngle=0.0;
298 fXScale=1.0;
299 fOblAngle=0.0;
300 nGenFlags=0;
301 nHorzJust=0;
302 nVertJust=0;
303}
304
306{
307 switch (rDGR.GetG()) {
308 case 10: aP0.fx=rDGR.GetF(); break;
309 case 20: aP0.fy=rDGR.GetF(); break;
310 case 30: aP0.fz=rDGR.GetF(); break;
311 case 40: fHeight=rDGR.GetF(); break;
312 case 1: m_sDefVal = rDGR.GetS(); break;
313 case 3: m_sPrompt = rDGR.GetS(); break;
314 case 2: m_sTagStr = rDGR.GetS(); break;
315 case 70: nAttrFlags=rDGR.GetI(); break;
316 case 73: nFieldLen=rDGR.GetI(); break;
317 case 50: fRotAngle=rDGR.GetF(); break;
318 case 41: fXScale=rDGR.GetF(); break;
319 case 51: fOblAngle=rDGR.GetF(); break;
320 case 7: m_sStyle = rDGR.GetS(); break;
321 case 71: nGenFlags=rDGR.GetI(); break;
322 case 72: nHorzJust=rDGR.GetI(); break;
323 case 74: nVertJust=rDGR.GetI(); break;
324 case 11: aAlign.fx=rDGR.GetF(); break;
325 case 21: aAlign.fy=rDGR.GetF(); break;
326 case 31: aAlign.fz=rDGR.GetF(); break;
327 default: DXFBasicEntity::EvaluateGroup(rDGR);
328 }
329}
330
331//--------------------------DXFAttribEntity-------------------------------------
332
335 , m_sStyle("STANDARD")
336{
337 fHeight=1.0;
338 nAttrFlags=0;
339 nFieldLen=0;
340 fRotAngle=0.0;
341 fXScale=1.0;
342 fOblAngle=0.0;
343 nGenFlags=0;
344 nHorzJust=0;
345 nVertJust=0;
346}
347
349{
350 switch (rDGR.GetG()) {
351 case 10: aP0.fx=rDGR.GetF(); break;
352 case 20: aP0.fy=rDGR.GetF(); break;
353 case 30: aP0.fz=rDGR.GetF(); break;
354 case 40: fHeight=rDGR.GetF(); break;
355 case 1: m_sText = rDGR.GetS(); break;
356 case 2: m_sTagStr = rDGR.GetS(); break;
357 case 70: nAttrFlags=rDGR.GetI(); break;
358 case 73: nFieldLen=rDGR.GetI(); break;
359 case 50: fRotAngle=rDGR.GetF(); break;
360 case 41: fXScale=rDGR.GetF(); break;
361 case 51: fOblAngle=rDGR.GetF(); break;
362 case 7: m_sStyle = rDGR.GetS(); break;
363 case 71: nGenFlags=rDGR.GetI(); break;
364 case 72: nHorzJust=rDGR.GetI(); break;
365 case 74: nVertJust=rDGR.GetI(); break;
366 case 11: aAlign.fx=rDGR.GetF(); break;
367 case 21: aAlign.fy=rDGR.GetF(); break;
368 case 31: aAlign.fz=rDGR.GetF(); break;
369 default: DXFBasicEntity::EvaluateGroup(rDGR);
370 }
371}
372
373//--------------------------DXFPolyLine-----------------------------------------
374
376{
377 nFlags=0;
378 fSWidth=0.0;
379 fEWidth=0.0;
380 nMeshMCount=0;
381 nMeshNCount=0;
382 nMDensity=0;
383 nNDensity=0;
384 nCSSType=0;
385}
386
388{
389 switch (rDGR.GetG()) {
390 case 70: nFlags=rDGR.GetI(); break;
391 case 40: fSWidth=rDGR.GetF(); break;
392 case 41: fEWidth=rDGR.GetF(); break;
393 case 71: nMeshMCount=rDGR.GetI(); break;
394 case 72: nMeshNCount=rDGR.GetI(); break;
395 case 73: nMDensity=rDGR.GetI(); break;
396 case 74: nNDensity=rDGR.GetI(); break;
397 case 75: nCSSType=rDGR.GetI(); break;
398 default: DXFBasicEntity::EvaluateGroup(rDGR);
399 }
400}
401
402//--------------------------DXFLWPolyLine---------------------------------------
403
406 nIndex( 0 ),
407 nCount( 0 ),
408 nFlags( 0 ),
409 fConstantWidth( 0.0 ),
410 fStartWidth( 0.0 ),
411 fEndWidth( 0.0 )
412{
413}
414
416{
417 switch ( rDGR.GetG() )
418 {
419 case 90 :
420 {
421 nCount = rDGR.GetI();
422 // limit alloc to max reasonable size based on remaining data in stream
423 if (nCount > 0 && o3tl::make_unsigned(nCount) <= rDGR.remainingSize())
424 aP.reserve(nCount);
425 else
426 nCount = 0;
427 }
428 break;
429 case 70: nFlags = rDGR.GetI(); break;
430 case 43: fConstantWidth = rDGR.GetF(); break;
431 case 40: fStartWidth = rDGR.GetF(); break;
432 case 41: fEndWidth = rDGR.GetF(); break;
433 case 10:
434 {
435 if (nIndex < nCount)
436 {
437 aP.resize(nIndex+1);
438 aP[nIndex].fx = rDGR.GetF();
439 }
440 }
441 break;
442 case 20:
443 {
444 if (nIndex < nCount)
445 {
446 aP.resize(nIndex+1);
447 aP[nIndex].fy = rDGR.GetF();
448 ++nIndex;
449 }
450 }
451 break;
452 default: DXFBasicEntity::EvaluateGroup(rDGR);
453 }
454}
455
456//--------------------------DXFHatchEntity-------------------------------------
457
459 DXFEdgeType( 1 )
460{
461
462}
463
465{
466 bool bExecutingGroupCode = true;
467 switch ( rDGR.GetG() )
468 {
469 case 10 : aStartPoint.fx = rDGR.GetF(); break;
470 case 20 : aStartPoint.fy = rDGR.GetF(); break;
471 case 11 : aEndPoint.fx = rDGR.GetF(); break;
472 case 21 : aEndPoint.fy = rDGR.GetF(); break;
473 default : bExecutingGroupCode = false; break;
474 }
475 return bExecutingGroupCode;
476}
477
479 DXFEdgeType( 2 ),
480 fRadius( 0.0 ),
481 fStartAngle( 0.0 ),
482 fEndAngle( 0.0 ),
483 nIsCounterClockwiseFlag( 0 )
484{
485}
486
488{
489 bool bExecutingGroupCode = true;
490 switch ( rDGR.GetG() )
491 {
492 case 10 : aCenter.fx = rDGR.GetF(); break;
493 case 20 : aCenter.fy = rDGR.GetF(); break;
494 case 40 : fRadius = rDGR.GetF(); break;
495 case 50 : fStartAngle = rDGR.GetF(); break;
496 case 51 : fEndAngle = rDGR.GetF(); break;
497 case 73 : nIsCounterClockwiseFlag = rDGR.GetI(); break;
498 default : bExecutingGroupCode = false; break;
499 }
500 return bExecutingGroupCode;
501}
502
504 DXFEdgeType( 3 ),
505 fLength( 0.0 ),
506 fStartAngle( 0.0 ),
507 fEndAngle( 0.0 ),
508 nIsCounterClockwiseFlag( 0 )
509{
510}
511
513{
514 bool bExecutingGroupCode = true;
515 switch( rDGR.GetG() )
516 {
517 case 10 : aCenter.fx = rDGR.GetF(); break;
518 case 20 : aCenter.fy = rDGR.GetF(); break;
519 case 11 : aEndPoint.fx = rDGR.GetF(); break;
520 case 21 : aEndPoint.fy = rDGR.GetF(); break;
521 case 40 : fLength = rDGR.GetF(); break;
522 case 50 : fStartAngle = rDGR.GetF(); break;
523 case 51 : fEndAngle = rDGR.GetF(); break;
524 case 73 : nIsCounterClockwiseFlag = rDGR.GetI(); break;
525 default : bExecutingGroupCode = false; break;
526 }
527 return bExecutingGroupCode;
528}
529
531 DXFEdgeType( 4 ),
532 nDegree( 0 ),
533 nRational( 0 ),
534 nPeriodic( 0 ),
535 nKnotCount( 0 ),
536 nControlCount( 0 )
537{
538}
539
541{
542 bool bExecutingGroupCode = true;
543 switch ( rDGR.GetG() )
544 {
545 case 94 : nDegree = rDGR.GetI(); break;
546 case 73 : nRational = rDGR.GetI(); break;
547 case 74 : nPeriodic = rDGR.GetI(); break;
548 case 95 : nKnotCount = rDGR.GetI(); break;
549 case 96 : nControlCount = rDGR.GetI(); break;
550 default : bExecutingGroupCode = false; break;
551 }
552 return bExecutingGroupCode;
553}
554
556 nPointCount( 0 ),
557 nFlags( 0 ),
558 nHasBulgeFlag( 0 ),
559 nIsClosedFlag( 0 ),
560 fBulge( 0.0 ),
561 nSourceBoundaryObjects( 0 ),
562 nEdgeCount( 0 ),
563 bIsPolyLine( true ),
564 nPointIndex( 0 )
565{
566}
567
569{
570 bool bExecutingGroupCode = true;
571 if ( bIsPolyLine )
572 {
573 switch( rDGR.GetG() )
574 {
575 case 92 :
576 {
577 nFlags = rDGR.GetI();
578 if ( ( nFlags & 2 ) == 0 )
579 bIsPolyLine = false;
580 }
581 break;
582 case 93 :
583 {
584 nPointCount = rDGR.GetI();
585 // limit alloc to max reasonable size based on remaining data in stream
587 aP.reserve(nPointCount);
588 else
589 nPointCount = 0;
590 }
591 break;
592 case 72 : nHasBulgeFlag = rDGR.GetI(); break;
593 case 73 : nIsClosedFlag = rDGR.GetI(); break;
594 case 97 : nSourceBoundaryObjects = rDGR.GetI(); break;
595 case 42 : fBulge = rDGR.GetF(); break;
596 case 10:
597 {
599 {
600 aP.resize(nPointIndex+1);
601 aP[nPointIndex].fx = rDGR.GetF();
602 }
603 }
604 break;
605 case 20:
606 {
608 {
609 aP.resize(nPointIndex+1);
610 aP[nPointIndex].fy = rDGR.GetF();
611 ++nPointIndex;
612 }
613 }
614 break;
615
616 default : bExecutingGroupCode = false; break;
617 }
618 }
619 else
620 {
621 if ( rDGR.GetG() == 93 )
622 nEdgeCount = rDGR.GetI();
623 else if ( rDGR.GetG() == 72 )
624 {
625 sal_Int32 nEdgeType = rDGR.GetI();
626 switch( nEdgeType )
627 {
628 case 1 : aEdges.emplace_back( new DXFEdgeTypeLine() ); break;
629 case 2 : aEdges.emplace_back( new DXFEdgeTypeCircularArc() ); break;
630 case 3 : aEdges.emplace_back( new DXFEdgeTypeEllipticalArc() ); break;
631 case 4 : aEdges.emplace_back( new DXFEdgeTypeSpline() ); break;
632 }
633 }
634 else if ( !aEdges.empty() )
635 aEdges.back()->EvaluateGroup( rDGR );
636 else
637 bExecutingGroupCode = false;
638 }
639 return bExecutingGroupCode;
640}
641
644 bIsInBoundaryPathContext( false ),
645 nCurrentBoundaryPathIndex( -1 ),
646 nFlags( 0 ),
647 nAssociativityFlag( 0 ),
648 nMaxBoundaryPathCount( 0 ),
649 nHatchStyle( 0 ),
650 nHatchPatternType( 0 ),
651 fHatchPatternAngle( 0.0 ),
652 fHatchPatternScale( 1.0 ),
653 nHatchDoubleFlag( 0 ),
654 nHatchPatternDefinitionLines( 0 ),
655 fPixelSize( 1.0 ),
656 nNumberOfSeedPoints( 0 )
657{
658}
659
661{
662 switch ( rDGR.GetG() )
663 {
664// case 10 : aElevationPoint.fx = rDGR.GetF(); break;
665// case 20 : aElevationPoint.fy = rDGR.GetF(); break;
666// case 30 : aElevationPoint.fz = rDGR.GetF(); break;
667 case 70 : nFlags = rDGR.GetI(); break;
668 case 71 : nAssociativityFlag = rDGR.GetI(); break;
669 case 91 :
670 {
673 // limit alloc to max reasonable size based on remaining data in stream
676 else
678 }
679 break;
680 case 75 :
681 {
682 nHatchStyle = rDGR.GetI();
684 }
685 break;
686 case 76 : nHatchPatternType = rDGR.GetI(); break;
687 case 52 : fHatchPatternAngle = rDGR.GetF(); break;
688 case 41 : fHatchPatternScale = rDGR.GetF(); break;
689 case 77 : nHatchDoubleFlag = rDGR.GetI(); break;
690 case 78 : nHatchPatternDefinitionLines = rDGR.GetI(); break;
691 case 47 : fPixelSize = rDGR.GetF(); break;
692 case 98 : nNumberOfSeedPoints = rDGR.GetI(); break;
693
694 case 92:
696 [[fallthrough]];
697 default:
698 {
699 bool bExecutingGroupCode = false;
701 {
703 {
705 bExecutingGroupCode = aBoundaryPathData.back().EvaluateGroup(rDGR);
706 }
707 }
708 if ( !bExecutingGroupCode )
710 }
711 break;
712 }
713}
714
715//--------------------------DXFVertexEntity-------------------------------------
716
718{
719 fSWidth=-1.0;
720 fEWidth=-1.0;
721 fBulge=0.0;
722 nFlags=0;
723 fCFTDir=0.0;
724
725}
726
728{
729 switch (rDGR.GetG()) {
730 case 10: aP0.fx=rDGR.GetF(); break;
731 case 20: aP0.fy=rDGR.GetF(); break;
732 case 30: aP0.fz=rDGR.GetF(); break;
733 case 40: fSWidth=rDGR.GetF(); break;
734 case 41: fEWidth=rDGR.GetF(); break;
735 case 42: fBulge=rDGR.GetF(); break;
736 case 70: nFlags=rDGR.GetI(); break;
737 case 50: fCFTDir=rDGR.GetF(); break;
738 default: DXFBasicEntity::EvaluateGroup(rDGR);
739 }
740}
741
742//--------------------------DXFSeqEndEntity-------------------------------------
743
745{
746}
747
748//--------------------------DXF3DFace-------------------------------------------
749
751{
752 nIEFlags=0;
753}
754
756{
757 switch (rDGR.GetG()) {
758 case 10: aP0.fx=rDGR.GetF(); break;
759 case 20: aP0.fy=rDGR.GetF(); break;
760 case 30: aP0.fz=rDGR.GetF(); break;
761 case 11: aP1.fx=rDGR.GetF(); break;
762 case 21: aP1.fy=rDGR.GetF(); break;
763 case 31: aP1.fz=rDGR.GetF(); break;
764 case 12: aP2.fx=rDGR.GetF(); break;
765 case 22: aP2.fy=rDGR.GetF(); break;
766 case 32: aP2.fz=rDGR.GetF(); break;
767 case 13: aP3.fx=rDGR.GetF(); break;
768 case 23: aP3.fy=rDGR.GetF(); break;
769 case 33: aP3.fz=rDGR.GetF(); break;
770 case 70: nIEFlags=rDGR.GetI(); break;
771 default: DXFBasicEntity::EvaluateGroup(rDGR);
772 }
773}
774
775
776//--------------------------DXFDimensionEntity----------------------------------
777
779{
780}
781
783{
784 switch (rDGR.GetG()) {
785 case 2: m_sPseudoBlock = rDGR.GetS(); break;
786 default: DXFBasicEntity::EvaluateGroup(rDGR);
787 }
788}
789
790//---------------------------- DXFEntities --------------------------------------
791
793{
794 DXFBasicEntity * pE, * * ppSucc;
795
796 ppSucc=&pFirst;
797 while (*ppSucc!=nullptr) ppSucc=&((*ppSucc)->pSucc);
798
799 while (rDGR.GetG()!=0) rDGR.Read();
800
801 while (rDGR.GetS()!="ENDBLK" &&
802 rDGR.GetS()!="ENDSEC" &&
803 rDGR.GetS()!="EOF" )
804 {
805
806 if (rDGR.GetS() == "LINE" ) pE=new DXFLineEntity;
807 else if (rDGR.GetS() == "POINT" ) pE=new DXFPointEntity;
808 else if (rDGR.GetS() == "CIRCLE" ) pE=new DXFCircleEntity;
809 else if (rDGR.GetS() == "ARC" ) pE=new DXFArcEntity;
810 else if (rDGR.GetS() == "TRACE" ) pE=new DXFTraceEntity;
811 else if (rDGR.GetS() == "SOLID" ) pE=new DXFSolidEntity;
812 else if (rDGR.GetS() == "TEXT" ) pE=new DXFTextEntity;
813 else if (rDGR.GetS() == "SHAPE" ) pE=new DXFShapeEntity;
814 else if (rDGR.GetS() == "INSERT" ) pE=new DXFInsertEntity;
815 else if (rDGR.GetS() == "ATTDEF" ) pE=new DXFAttDefEntity;
816 else if (rDGR.GetS() == "ATTRIB" ) pE=new DXFAttribEntity;
817 else if (rDGR.GetS() == "POLYLINE" ) pE=new DXFPolyLineEntity;
818 else if (rDGR.GetS() == "LWPOLYLINE") pE=new DXFLWPolyLineEntity;
819 else if (rDGR.GetS() == "VERTEX" ) pE=new DXFVertexEntity;
820 else if (rDGR.GetS() == "SEQEND" ) pE=new DXFSeqEndEntity;
821 else if (rDGR.GetS() == "3DFACE" ) pE=new DXF3DFaceEntity;
822 else if (rDGR.GetS() == "DIMENSION" ) pE=new DXFDimensionEntity;
823 else if (rDGR.GetS() == "HATCH" ) pE=new DXFHatchEntity;
824 else
825 {
826 do {
827 rDGR.Read();
828 } while (rDGR.GetG()!=0);
829 continue;
830 }
831 *ppSucc=pE;
832 ppSucc=&(pE->pSucc);
833 pE->Read(rDGR);
834 }
835}
836
838{
839 DXFBasicEntity * ptmp;
840
841 while (pFirst!=nullptr) {
842 ptmp=pFirst;
843 pFirst=ptmp->pSucc;
844 delete ptmp;
845 }
846}
847
848/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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:143
double fRadius
Definition: dxfentrd.hxx:142
double fEnd
Definition: dxfentrd.hxx:144
DXFVector aP0
Definition: dxfentrd.hxx:141
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:128
double fRotAngle
Definition: dxfentrd.hxx:258
DXFVector aAlign
Definition: dxfentrd.hxx:265
double fOblAngle
Definition: dxfentrd.hxx:260
OString m_sStyle
Definition: dxfentrd.hxx:261
tools::Long nAttrFlags
Definition: dxfentrd.hxx:256
tools::Long nFieldLen
Definition: dxfentrd.hxx:257
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:305
OString m_sPrompt
Definition: dxfentrd.hxx:254
OString m_sDefVal
Definition: dxfentrd.hxx:253
OString m_sTagStr
Definition: dxfentrd.hxx:255
tools::Long nGenFlags
Definition: dxfentrd.hxx:262
tools::Long nHorzJust
Definition: dxfentrd.hxx:263
DXFVector aP0
Definition: dxfentrd.hxx:251
tools::Long nVertJust
Definition: dxfentrd.hxx:264
OString m_sText
Definition: dxfentrd.hxx:282
tools::Long nHorzJust
Definition: dxfentrd.hxx:291
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:348
tools::Long nGenFlags
Definition: dxfentrd.hxx:290
tools::Long nVertJust
Definition: dxfentrd.hxx:292
DXFVector aAlign
Definition: dxfentrd.hxx:293
OString m_sTagStr
Definition: dxfentrd.hxx:283
double fOblAngle
Definition: dxfentrd.hxx:288
tools::Long nAttrFlags
Definition: dxfentrd.hxx:284
DXFVector aP0
Definition: dxfentrd.hxx:280
double fRotAngle
Definition: dxfentrd.hxx:286
OString m_sStyle
Definition: dxfentrd.hxx:289
tools::Long nFieldLen
Definition: dxfentrd.hxx:285
tools::Long nSpace
Definition: dxfentrd.hxx:69
DXFBasicEntity * pSucc
Definition: dxfentrd.hxx:57
DXFBasicEntity(DXFEntityType eThisType)
Definition: dxfentrd.cxx:28
OString m_sLineType
Definition: dxfentrd.hxx:66
DXFVector aExtrusion
Definition: dxfentrd.hxx:70
OString m_sLayer
Definition: dxfentrd.hxx:65
virtual ~DXFBasicEntity()
Definition: dxfentrd.cxx:62
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:42
double fThickness
Definition: dxfentrd.hxx:67
DXFEntityType eType
Definition: dxfentrd.hxx:60
tools::Long nColor
Definition: dxfentrd.hxx:68
virtual void EvaluateGroup(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:47
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:108
DXFVector aP0
Definition: dxfentrd.hxx:127
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:782
OString m_sPseudoBlock
Definition: dxfentrd.hxx:497
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:792
void Clear()
Definition: dxfentrd.cxx:837
DXFBasicEntity * pFirst
Definition: dxfentrd.hxx:523
const OString & GetS() const
Definition: dxfgrprd.hxx:107
tools::Long GetI() const
Definition: dxfgrprd.hxx:97
double GetF() const
Definition: dxfgrprd.hxx:102
sal_uInt16 GetG() const
Definition: dxfgrprd.hxx:92
sal_uInt16 Read()
Definition: dxfgrprd.cxx:118
sal_uInt64 remainingSize() const
Definition: dxfgrprd.cxx:208
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:230
tools::Long nRowCount
Definition: dxfentrd.hxx:238
OString m_sName
Definition: dxfentrd.hxx:231
double fRotAngle
Definition: dxfentrd.hxx:236
tools::Long nColCount
Definition: dxfentrd.hxx:237
double fRowSpace
Definition: dxfentrd.hxx:240
double fColSpace
Definition: dxfentrd.hxx:239
DXFVector aP0
Definition: dxfentrd.hxx:232
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:334
DXFVector aP1
Definition: dxfentrd.hxx:101
DXFVector aP0
Definition: dxfentrd.hxx:100
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:72
DXFVector aP0
Definition: dxfentrd.hxx:114
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:91
tools::Long nNDensity
Definition: dxfentrd.hxx:312
tools::Long nMDensity
Definition: dxfentrd.hxx:311
tools::Long nFlags
Definition: dxfentrd.hxx:306
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:387
tools::Long nMeshMCount
Definition: dxfentrd.hxx:309
tools::Long nCSSType
Definition: dxfentrd.hxx:313
tools::Long nMeshNCount
Definition: dxfentrd.hxx:310
DXFVector aP0
Definition: dxfentrd.hxx:210
OString m_sName
Definition: dxfentrd.hxx:212
double fRotAngle
Definition: dxfentrd.hxx:213
double fXScale
Definition: dxfentrd.hxx:214
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:238
double fOblAngle
Definition: dxfentrd.hxx:215
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:172
DXFVector aP3
Definition: dxfentrd.hxx:176
DXFVector aP0
Definition: dxfentrd.hxx:173
DXFVector aP2
Definition: dxfentrd.hxx:175
DXFVector aP1
Definition: dxfentrd.hxx:174
tools::Long nGenFlags
Definition: dxfentrd.hxx:196
DXFVector aP0
Definition: dxfentrd.hxx:189
double fXScale
Definition: dxfentrd.hxx:193
tools::Long nVertJust
Definition: dxfentrd.hxx:198
double fHeight
Definition: dxfentrd.hxx:190
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:206
OString m_sStyle
Definition: dxfentrd.hxx:195
tools::Long nHorzJust
Definition: dxfentrd.hxx:197
double fOblAngle
Definition: dxfentrd.hxx:194
DXFVector aAlign
Definition: dxfentrd.hxx:199
double fRotAngle
Definition: dxfentrd.hxx:192
OString m_sText
Definition: dxfentrd.hxx:191
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:147
DXFVector aP0
Definition: dxfentrd.hxx:157
DXFVector aP1
Definition: dxfentrd.hxx:158
DXFVector aP2
Definition: dxfentrd.hxx:159
DXFVector aP3
Definition: dxfentrd.hxx:160
double fx
Definition: dxfvec.hxx:55
double fz
Definition: dxfvec.hxx:55
double fy
Definition: dxfvec.hxx:55
DXFVector aP0
Definition: dxfentrd.hxx:455
tools::Long nFlags
Definition: dxfentrd.hxx:459
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:727
int nCount
FormulaCommand pE
DXFEntityType
Definition: dxfentrd.hxx:30
@ DXF_SEQEND
Definition: dxfentrd.hxx:44
@ DXF_CIRCLE
Definition: dxfentrd.hxx:33
@ DXF_POINT
Definition: dxfentrd.hxx:32
@ DXF_TEXT
Definition: dxfentrd.hxx:37
@ DXF_SOLID
Definition: dxfentrd.hxx:36
@ DXF_ARC
Definition: dxfentrd.hxx:34
@ DXF_INSERT
Definition: dxfentrd.hxx:39
@ DXF_POLYLINE
Definition: dxfentrd.hxx:42
@ DXF_DIMENSION
Definition: dxfentrd.hxx:46
@ DXF_VERTEX
Definition: dxfentrd.hxx:43
@ DXF_3DFACE
Definition: dxfentrd.hxx:45
@ DXF_ATTRIB
Definition: dxfentrd.hxx:41
@ DXF_TRACE
Definition: dxfentrd.hxx:35
@ DXF_HATCH
Definition: dxfentrd.hxx:48
@ DXF_LWPOLYLINE
Definition: dxfentrd.hxx:47
@ DXF_SHAPE
Definition: dxfentrd.hxx:38
@ DXF_LINE
Definition: dxfentrd.hxx:31
@ DXF_ATTDEF
Definition: dxfentrd.hxx:40
sal_Int32 nIndex
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
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
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:487
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:370
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:382
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:512
DXFVector aStartPoint
Definition: dxfentrd.hxx:358
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:464
DXFVector aEndPoint
Definition: dxfentrd.hxx:359
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