LibreOffice Module vcl (master)  1
dxf2mtf.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 #ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IDXF_DXF2MTF_HXX
21 #define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IDXF_DXF2MTF_HXX
22 
23 #include <sal/config.h>
24 
25 #include <string_view>
26 
27 #include "dxfreprd.hxx"
28 #include <vcl/font.hxx>
29 #include <vcl/lineinfo.hxx>
30 #include <vcl/vclptr.hxx>
31 #include <vcl/virdev.hxx>
32 
34 private:
35 
38  bool bStatus;
39 
40  sal_uInt16 OptPointsPerCircle;
41 
42  sal_uInt16 nMinPercent;
43  sal_uInt16 nMaxPercent;
44  sal_uInt16 nLastPercent;
45  sal_uInt16 nMainEntitiesCount;
46 
54  const LineInfo aDefaultLineInfo; // to share between lines to reduce memory
55 
56  static sal_uInt64 CountEntities(const DXFEntities & rEntities);
57 
59 
61 
62  DXFLineInfo LTypeToDXFLineInfo(std::string_view rLineType);
63 
65 
66  bool SetLineAttribute(const DXFBasicEntity & rE);
67 
68  bool SetAreaAttribute(const DXFBasicEntity & rE);
69 
70  bool SetFontAttribute(const DXFBasicEntity & rE, short nAngle,
71  sal_uInt16 nHeight);
72 
73  void DrawLineEntity(const DXFLineEntity & rE, const DXFTransform & rTransform);
74 
75  void DrawPointEntity(const DXFPointEntity & rE, const DXFTransform & rTransform);
76 
77  void DrawCircleEntity(const DXFCircleEntity & rE, const DXFTransform & rTransform);
78 
79  void DrawArcEntity(const DXFArcEntity & rE, const DXFTransform & rTransform);
80 
81  void DrawTraceEntity(const DXFTraceEntity & rE, const DXFTransform & rTransform);
82 
83  void DrawSolidEntity(const DXFSolidEntity & rE, const DXFTransform & rTransform);
84 
85  void DrawTextEntity(const DXFTextEntity & rE, const DXFTransform & rTransform);
86 
87  void DrawInsertEntity(const DXFInsertEntity & rE, const DXFTransform & rTransform);
88 
89  void DrawAttribEntity(const DXFAttribEntity & rE, const DXFTransform & rTransform);
90 
91  void DrawPolyLineEntity(const DXFPolyLineEntity & rE, const DXFTransform & rTransform);
92 
93  void Draw3DFaceEntity(const DXF3DFaceEntity & rE, const DXFTransform & rTransform);
94 
95  void DrawDimensionEntity(const DXFDimensionEntity & rE, const DXFTransform & rTransform);
96 
97  void DrawLWPolyLineEntity( const DXFLWPolyLineEntity & rE, const DXFTransform & rTransform );
98 
99  void DrawHatchEntity( const DXFHatchEntity & rE, const DXFTransform & rTransform );
100 
101  void DrawEntities(const DXFEntities & rEntities,
102  const DXFTransform & rTransform);
103 
104  void DrawLine(const Point& rA, const Point& rB);
105 
106 public:
107 
108  DXF2GDIMetaFile();
110 
111  bool Convert( const DXFRepresentation & rDXF, GDIMetaFile & rMTF, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent);
112 
113 };
114 
115 
116 #endif
117 
118 
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DXFLineInfo LTypeToDXFLineInfo(std::string_view rLineType)
Definition: dxf2mtf.cxx:67
void DrawCircleEntity(const DXFCircleEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:260
bool SetAreaAttribute(const DXFBasicEntity &rE)
Definition: dxf2mtf.cxx:168
void DrawEntities(const DXFEntities &rEntities, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:687
void DrawInsertEntity(const DXFInsertEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:451
Color ConvertColor(sal_uInt8 nColor)
Definition: dxf2mtf.cxx:41
long Long
VclPtr< VirtualDevice > pVirDev
Definition: dxf2mtf.hxx:36
bool Convert(const DXFRepresentation &rDXF, GDIMetaFile &rMTF, sal_uInt16 nMinPercent, sal_uInt16 nMaxPercent)
Definition: dxf2mtf.cxx:782
DXFLineInfo aParentLayerDXFLineInfo
Definition: dxf2mtf.hxx:50
void DrawLWPolyLineEntity(const DXFLWPolyLineEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:554
tools::Long nBlockColor
Definition: dxf2mtf.hxx:47
tools::Long GetEntityColor(const DXFBasicEntity &rE)
Definition: dxf2mtf.cxx:49
Color aActLineColor
Definition: dxf2mtf.hxx:51
bool SetLineAttribute(const DXFBasicEntity &rE)
Definition: dxf2mtf.cxx:146
static sal_uInt64 CountEntities(const DXFEntities &rEntities)
Definition: dxf2mtf.cxx:31
void DrawTextEntity(const DXFTextEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:429
void DrawTraceEntity(const DXFTraceEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:375
sal_uInt16 OptPointsPerCircle
Definition: dxf2mtf.hxx:40
sal_uInt16 nMinPercent
Definition: dxf2mtf.hxx:42
sal_uInt16 nMaxPercent
Definition: dxf2mtf.hxx:43
void DrawLineEntity(const DXFLineEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:219
tools::Long nParentLayerColor
Definition: dxf2mtf.hxx:49
void DrawSolidEntity(const DXFSolidEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:400
void DrawPointEntity(const DXFPointEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:244
void DrawHatchEntity(const DXFHatchEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:574
DXFLineInfo GetEntityDXFLineInfo(const DXFBasicEntity &rE)
Definition: dxf2mtf.cxx:114
sal_uInt16 nLastPercent
Definition: dxf2mtf.hxx:44
Color aActFillColor
Definition: dxf2mtf.hxx:52
const LineInfo aDefaultLineInfo
Definition: dxf2mtf.hxx:54
unsigned char sal_uInt8
void Draw3DFaceEntity(const DXF3DFaceEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:631
const DXFRepresentation * pDXF
Definition: dxf2mtf.hxx:37
sal_uInt16 nMainEntitiesCount
Definition: dxf2mtf.hxx:45
void DrawAttribEntity(const DXFAttribEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:487
void DrawArcEntity(const DXFArcEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:312
bool SetFontAttribute(const DXFBasicEntity &rE, short nAngle, sal_uInt16 nHeight)
Definition: dxf2mtf.cxx:190
DXFLineInfo aBlockDXFLineInfo
Definition: dxf2mtf.hxx:48
void DrawLine(const Point &rA, const Point &rB)
Definition: dxf2mtf.cxx:301
void DrawDimensionEntity(const DXFDimensionEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:653
vcl::Font aActFont
Definition: dxf2mtf.hxx:53
void DrawPolyLineEntity(const DXFPolyLineEntity &rE, const DXFTransform &rTransform)
Definition: dxf2mtf.cxx:512