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 }
571 
573 {
574  bool bExecutingGroupCode = true;
575  if ( bIsPolyLine )
576  {
577  switch( rDGR.GetG() )
578  {
579  case 92 :
580  {
581  nFlags = rDGR.GetI();
582  if ( ( nFlags & 2 ) == 0 )
583  bIsPolyLine = false;
584  }
585  break;
586  case 93 :
587  {
588  nPointCount = rDGR.GetI();
589  // limit alloc to max reasonable size based on remaining data in stream
591  aP.reserve(nPointCount);
592  else
593  nPointCount = 0;
594  }
595  break;
596  case 72 : nHasBulgeFlag = rDGR.GetI(); break;
597  case 73 : nIsClosedFlag = rDGR.GetI(); break;
598  case 97 : nSourceBoundaryObjects = rDGR.GetI(); break;
599  case 42 : fBulge = rDGR.GetF(); break;
600  case 10:
601  {
602  if (nPointIndex < nPointCount)
603  {
604  aP.resize(nPointIndex+1);
605  aP[nPointIndex].fx = rDGR.GetF();
606  }
607  }
608  break;
609  case 20:
610  {
611  if (nPointIndex < nPointCount)
612  {
613  aP.resize(nPointIndex+1);
614  aP[nPointIndex].fy = rDGR.GetF();
615  ++nPointIndex;
616  }
617  }
618  break;
619 
620  default : bExecutingGroupCode = false; break;
621  }
622  }
623  else
624  {
625  if ( rDGR.GetG() == 93 )
626  nEdgeCount = rDGR.GetI();
627  else if ( rDGR.GetG() == 72 )
628  {
629  sal_Int32 nEdgeType = rDGR.GetI();
630  switch( nEdgeType )
631  {
632  case 1 : aEdges.emplace_back( new DXFEdgeTypeLine() ); break;
633  case 2 : aEdges.emplace_back( new DXFEdgeTypeCircularArc() ); break;
634  case 3 : aEdges.emplace_back( new DXFEdgeTypeEllipticalArc() ); break;
635  case 4 : aEdges.emplace_back( new DXFEdgeTypeSpline() ); break;
636  }
637  }
638  else if ( !aEdges.empty() )
639  aEdges.back()->EvaluateGroup( rDGR );
640  else
641  bExecutingGroupCode = false;
642  }
643  return bExecutingGroupCode;
644 }
645 
648  bIsInBoundaryPathContext( false ),
649  nCurrentBoundaryPathIndex( -1 ),
650  nFlags( 0 ),
651  nAssociativityFlag( 0 ),
652  nBoundaryPathCount( 0 ),
653  nHatchStyle( 0 ),
654  nHatchPatternType( 0 ),
655  fHatchPatternAngle( 0.0 ),
656  fHatchPatternScale( 1.0 ),
657  nHatchDoubleFlag( 0 ),
658  nHatchPatternDefinitionLines( 0 ),
659  fPixelSize( 1.0 ),
660  nNumberOfSeedPoints( 0 )
661 {
662 }
663 
665 {
666  switch ( rDGR.GetG() )
667  {
668 // case 10 : aElevationPoint.fx = rDGR.GetF(); break;
669 // case 20 : aElevationPoint.fy = rDGR.GetF(); break;
670 // case 30 : aElevationPoint.fz = rDGR.GetF(); break;
671  case 70 : nFlags = rDGR.GetI(); break;
672  case 71 : nAssociativityFlag = rDGR.GetI(); break;
673  case 91 :
674  {
676  nBoundaryPathCount = rDGR.GetI();
677  // limit alloc to max reasonable size based on remaining data in stream
680  else
681  nBoundaryPathCount = 0;
682  }
683  break;
684  case 75 :
685  {
686  nHatchStyle = rDGR.GetI();
687  bIsInBoundaryPathContext = false;
688  }
689  break;
690  case 76 : nHatchPatternType = rDGR.GetI(); break;
691  case 52 : fHatchPatternAngle = rDGR.GetF(); break;
692  case 41 : fHatchPatternScale = rDGR.GetF(); break;
693  case 77 : nHatchDoubleFlag = rDGR.GetI(); break;
694  case 78 : nHatchPatternDefinitionLines = rDGR.GetI(); break;
695  case 47 : fPixelSize = rDGR.GetF(); break;
696  case 98 : nNumberOfSeedPoints = rDGR.GetI(); break;
697 
698  case 92:
700  [[fallthrough]];
701  default:
702  {
703  bool bExecutingGroupCode = false;
705  {
706  if ( ( nCurrentBoundaryPathIndex >= 0 ) &&
708  bExecutingGroupCode = pBoundaryPathData[ nCurrentBoundaryPathIndex ].EvaluateGroup( rDGR );
709  }
710  if ( !bExecutingGroupCode )
712  }
713  break;
714  }
715 }
716 
717 //--------------------------DXFVertexEntity-------------------------------------
718 
720 {
721  fSWidth=-1.0;
722  fEWidth=-1.0;
723  fBulge=0.0;
724  nFlags=0;
725  fCFTDir=0.0;
726 
727 }
728 
730 {
731  switch (rDGR.GetG()) {
732  case 10: aP0.fx=rDGR.GetF(); break;
733  case 20: aP0.fy=rDGR.GetF(); break;
734  case 30: aP0.fz=rDGR.GetF(); break;
735  case 40: fSWidth=rDGR.GetF(); break;
736  case 41: fEWidth=rDGR.GetF(); break;
737  case 42: fBulge=rDGR.GetF(); break;
738  case 70: nFlags=rDGR.GetI(); break;
739  case 50: fCFTDir=rDGR.GetF(); break;
740  default: DXFBasicEntity::EvaluateGroup(rDGR);
741  }
742 }
743 
744 //--------------------------DXFSeqEndEntity-------------------------------------
745 
747 {
748 }
749 
750 //--------------------------DXF3DFace-------------------------------------------
751 
753 {
754  nIEFlags=0;
755 }
756 
758 {
759  switch (rDGR.GetG()) {
760  case 10: aP0.fx=rDGR.GetF(); break;
761  case 20: aP0.fy=rDGR.GetF(); break;
762  case 30: aP0.fz=rDGR.GetF(); break;
763  case 11: aP1.fx=rDGR.GetF(); break;
764  case 21: aP1.fy=rDGR.GetF(); break;
765  case 31: aP1.fz=rDGR.GetF(); break;
766  case 12: aP2.fx=rDGR.GetF(); break;
767  case 22: aP2.fy=rDGR.GetF(); break;
768  case 32: aP2.fz=rDGR.GetF(); break;
769  case 13: aP3.fx=rDGR.GetF(); break;
770  case 23: aP3.fy=rDGR.GetF(); break;
771  case 33: aP3.fz=rDGR.GetF(); break;
772  case 70: nIEFlags=rDGR.GetI(); break;
773  default: DXFBasicEntity::EvaluateGroup(rDGR);
774  }
775 }
776 
777 
778 //--------------------------DXFDimensionEntity----------------------------------
779 
781 {
782 }
783 
785 {
786  switch (rDGR.GetG()) {
787  case 2: m_sPseudoBlock = rDGR.GetS(); break;
788  default: DXFBasicEntity::EvaluateGroup(rDGR);
789  }
790 }
791 
792 //---------------------------- DXFEntities --------------------------------------
793 
795 {
796  DXFBasicEntity * pE, * * ppSucc;
797 
798  ppSucc=&pFirst;
799  while (*ppSucc!=nullptr) ppSucc=&((*ppSucc)->pSucc);
800 
801  while (rDGR.GetG()!=0) rDGR.Read();
802 
803  while (rDGR.GetS()!="ENDBLK" &&
804  rDGR.GetS()!="ENDSEC" &&
805  rDGR.GetS()!="EOF" )
806  {
807 
808  if (rDGR.GetS() == "LINE" ) pE=new DXFLineEntity;
809  else if (rDGR.GetS() == "POINT" ) pE=new DXFPointEntity;
810  else if (rDGR.GetS() == "CIRCLE" ) pE=new DXFCircleEntity;
811  else if (rDGR.GetS() == "ARC" ) pE=new DXFArcEntity;
812  else if (rDGR.GetS() == "TRACE" ) pE=new DXFTraceEntity;
813  else if (rDGR.GetS() == "SOLID" ) pE=new DXFSolidEntity;
814  else if (rDGR.GetS() == "TEXT" ) pE=new DXFTextEntity;
815  else if (rDGR.GetS() == "SHAPE" ) pE=new DXFShapeEntity;
816  else if (rDGR.GetS() == "INSERT" ) pE=new DXFInsertEntity;
817  else if (rDGR.GetS() == "ATTDEF" ) pE=new DXFAttDefEntity;
818  else if (rDGR.GetS() == "ATTRIB" ) pE=new DXFAttribEntity;
819  else if (rDGR.GetS() == "POLYLINE" ) pE=new DXFPolyLineEntity;
820  else if (rDGR.GetS() == "LWPOLYLINE") pE=new DXFLWPolyLineEntity;
821  else if (rDGR.GetS() == "VERTEX" ) pE=new DXFVertexEntity;
822  else if (rDGR.GetS() == "SEQEND" ) pE=new DXFSeqEndEntity;
823  else if (rDGR.GetS() == "3DFACE" ) pE=new DXF3DFaceEntity;
824  else if (rDGR.GetS() == "DIMENSION" ) pE=new DXFDimensionEntity;
825  else if (rDGR.GetS() == "HATCH" ) pE=new DXFHatchEntity;
826  else
827  {
828  do {
829  rDGR.Read();
830  } while (rDGR.GetG()!=0);
831  continue;
832  }
833  *ppSucc=pE;
834  ppSucc=&(pE->pSucc);
835  pE->Read(rDGR);
836  }
837 }
838 
840 {
841  DXFBasicEntity * ptmp;
842 
843  while (pFirst!=nullptr) {
844  ptmp=pFirst;
845  pFirst=ptmp->pSucc;
846  delete ptmp;
847  }
848 }
849 
850 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DXFVector aAlign
Definition: dxfentrd.hxx:293
DXFEntityType eType
Definition: dxfentrd.hxx:60
OString m_sStyle
Definition: dxfentrd.hxx:261
DXFVector aP0
Definition: dxfentrd.hxx:114
double fx
Definition: dxfvec.hxx:55
double GetF() const
Definition: dxfgrprd.hxx:102
double fRowSpace
Definition: dxfentrd.hxx:240
OString m_sStyle
Definition: dxfentrd.hxx:289
sal_Int32 nIndex
DXFVector aP3
Definition: dxfentrd.hxx:176
DXFVector aP0
Definition: dxfentrd.hxx:481
DXFVector aExtrusion
Definition: dxfentrd.hxx:70
sal_Int32 nSourceBoundaryObjects
Definition: dxfentrd.hxx:409
FormulaCommand pE
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:128
tools::Long GetI() const
Definition: dxfgrprd.hxx:97
tools::Long nNDensity
Definition: dxfentrd.hxx:312
bool EvaluateGroup(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:572
double fThickness
Definition: dxfentrd.hxx:67
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:42
double fEnd
Definition: dxfentrd.hxx:144
DXFVector aP0
Definition: dxfentrd.hxx:141
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:72
double fHatchPatternScale
Definition: dxfentrd.hxx:437
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:91
double fRotAngle
Definition: dxfentrd.hxx:213
double fHeight
Definition: dxfentrd.hxx:190
tools::Long nAttrFlags
Definition: dxfentrd.hxx:256
tools::Long nIEFlags
Definition: dxfentrd.hxx:485
DXFVector aP1
Definition: dxfentrd.hxx:101
sal_Int32 nPointCount
Definition: dxfentrd.hxx:403
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:147
OString m_sDefVal
Definition: dxfentrd.hxx:253
sal_Int32 nHatchStyle
Definition: dxfentrd.hxx:434
std::vector< DXFVector > aP
Definition: dxfentrd.hxx:415
sal_Int32 nNumberOfSeedPoints
Definition: dxfentrd.hxx:441
tools::Long nMDensity
Definition: dxfentrd.hxx:311
OString m_sText
Definition: dxfentrd.hxx:282
tools::Long nVertJust
Definition: dxfentrd.hxx:198
tools::Long nVertJust
Definition: dxfentrd.hxx:292
double fStart
Definition: dxfentrd.hxx:143
DXFVector aP0
Definition: dxfentrd.hxx:157
tools::Long nFieldLen
Definition: dxfentrd.hxx:257
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:512
DXFVector aP1
Definition: dxfentrd.hxx:482
double fOblAngle
Definition: dxfentrd.hxx:260
double fRotAngle
Definition: dxfentrd.hxx:192
DXFVector aP0
Definition: dxfentrd.hxx:100
sal_Int32 nHatchPatternType
Definition: dxfentrd.hxx:435
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:729
double fz
Definition: dxfvec.hxx:55
tools::Long nFlags
Definition: dxfentrd.hxx:460
std::vector< DXFVector > aP
Definition: dxfentrd.hxx:334
tools::Long nFlags
Definition: dxfentrd.hxx:306
DXFEntityType
Definition: dxfentrd.hxx:30
int nCount
OString m_sName
Definition: dxfentrd.hxx:231
sal_Int32 nHatchDoubleFlag
Definition: dxfentrd.hxx:438
DXFVector aP3
Definition: dxfentrd.hxx:484
DXFVector aEndPoint
Definition: dxfentrd.hxx:359
OString m_sLayer
Definition: dxfentrd.hxx:65
double fPixelSize
Definition: dxfentrd.hxx:440
sal_uInt16 Read()
Definition: dxfgrprd.cxx:117
OString m_sStyle
Definition: dxfentrd.hxx:195
sal_Int32 nControlCount
Definition: dxfentrd.hxx:394
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:268
double fXScale
Definition: dxfentrd.hxx:214
OString m_sText
Definition: dxfentrd.hxx:191
virtual void EvaluateGroup(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:47
tools::Long nMeshMCount
Definition: dxfentrd.hxx:309
sal_Int32 nEdgeCount
Definition: dxfentrd.hxx:410
tools::Long nColCount
Definition: dxfentrd.hxx:237
double fColSpace
Definition: dxfentrd.hxx:239
tools::Long nAttrFlag
Definition: dxfentrd.hxx:230
std::vector< std::unique_ptr< DXFEdgeType > > aEdges
Definition: dxfentrd.hxx:416
DXFVector aP0
Definition: dxfentrd.hxx:189
bool bIsInBoundaryPathContext
Definition: dxfentrd.hxx:426
sal_Int32 nPointIndex
Definition: dxfentrd.hxx:413
sal_Int32 nIsClosedFlag
Definition: dxfentrd.hxx:407
sal_Int32 nHatchPatternDefinitionLines
Definition: dxfentrd.hxx:439
OString m_sLineType
Definition: dxfentrd.hxx:66
tools::Long nRowCount
Definition: dxfentrd.hxx:238
DXFVector aP0
Definition: dxfentrd.hxx:232
DXFVector aP2
Definition: dxfentrd.hxx:175
DXFVector aP2
Definition: dxfentrd.hxx:159
double fRotAngle
Definition: dxfentrd.hxx:286
double fy
Definition: dxfvec.hxx:55
DXFVector aP2
Definition: dxfentrd.hxx:483
double fOblAngle
Definition: dxfentrd.hxx:215
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
tools::Long nFieldLen
Definition: dxfentrd.hxx:285
sal_Int32 nRational
Definition: dxfentrd.hxx:391
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:664
std::unique_ptr< DXFBoundaryPathData[]> pBoundaryPathData
Definition: dxfentrd.hxx:443
OString m_sPrompt
Definition: dxfentrd.hxx:254
sal_Int32 nDegree
Definition: dxfentrd.hxx:390
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:206
DXFVector aP0
Definition: dxfentrd.hxx:456
DXFVector aP0
Definition: dxfentrd.hxx:210
OString m_sTagStr
Definition: dxfentrd.hxx:283
tools::Long nHorzJust
Definition: dxfentrd.hxx:263
double fXScale
Definition: dxfentrd.hxx:193
sal_Int32 nKnotCount
Definition: dxfentrd.hxx:393
double fHatchPatternAngle
Definition: dxfentrd.hxx:436
DXFVector aAlign
Definition: dxfentrd.hxx:199
OString m_sTagStr
Definition: dxfentrd.hxx:255
DXFVector aAlign
Definition: dxfentrd.hxx:265
tools::Long nGenFlags
Definition: dxfentrd.hxx:196
double fOblAngle
Definition: dxfentrd.hxx:288
sal_Int32 nHasBulgeFlag
Definition: dxfentrd.hxx:406
double fRotAngle
Definition: dxfentrd.hxx:236
DXFBasicEntity(DXFEntityType eThisType)
Definition: dxfentrd.cxx:28
double fRotAngle
Definition: dxfentrd.hxx:258
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:382
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:387
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:784
sal_uInt16 GetG() const
Definition: dxfgrprd.hxx:92
tools::Long nCSSType
Definition: dxfentrd.hxx:313
sal_Int32 nBoundaryPathCount
Definition: dxfentrd.hxx:433
void Read(DXFGroupReader &rDGR)
Definition: dxfentrd.cxx:794
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:487
DXFBasicEntity * pSucc
Definition: dxfentrd.hxx:57
tools::Long nSpace
Definition: dxfentrd.hxx:69
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:757
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:108
DXFVector aP0
Definition: dxfentrd.hxx:173
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:464
const OString & GetS() const
Definition: dxfgrprd.hxx:107
DXFVector aP3
Definition: dxfentrd.hxx:160
tools::Long nHorzJust
Definition: dxfentrd.hxx:291
OString m_sName
Definition: dxfentrd.hxx:212
sal_Int32 nPeriodic
Definition: dxfentrd.hxx:392
DXFVector aP0
Definition: dxfentrd.hxx:251
DXFVector aStartPoint
Definition: dxfentrd.hxx:358
tools::Long nHorzJust
Definition: dxfentrd.hxx:197
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:348
DXFVector aP0
Definition: dxfentrd.hxx:127
DXFVector aP1
Definition: dxfentrd.hxx:174
tools::Long nGenFlags
Definition: dxfentrd.hxx:290
tools::Long nVertJust
Definition: dxfentrd.hxx:264
sal_uInt64 remainingSize() const
Definition: dxfgrprd.cxx:207
double fOblAngle
Definition: dxfentrd.hxx:194
virtual bool EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:540
void Clear()
Definition: dxfentrd.cxx:839
sal_Int32 nAssociativityFlag
Definition: dxfentrd.hxx:432
DXFBasicEntity * pFirst
Definition: dxfentrd.hxx:524
sal_Int32 nIsCounterClockwiseFlag
Definition: dxfentrd.hxx:370
virtual ~DXFBasicEntity()
Definition: dxfentrd.cxx:62
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:415
double fRadius
Definition: dxfentrd.hxx:142
DXFVector aP0
Definition: dxfentrd.hxx:280
OString m_sPseudoBlock
Definition: dxfentrd.hxx:498
tools::Long nAttrFlags
Definition: dxfentrd.hxx:284
tools::Long nColor
Definition: dxfentrd.hxx:68
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:172
sal_Int32 nCurrentBoundaryPathIndex
Definition: dxfentrd.hxx:427
sal_Int32 nFlags
Definition: dxfentrd.hxx:431
DXFVector aP1
Definition: dxfentrd.hxx:158
tools::Long nGenFlags
Definition: dxfentrd.hxx:262
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:305
tools::Long nMeshNCount
Definition: dxfentrd.hxx:310
virtual void EvaluateGroup(DXFGroupReader &rDGR) override
Definition: dxfentrd.cxx:238