merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / filter.vcl / idxf / dxfreprd.hxx
blob7b2632e70604a443832e57c212737f7cb7709af4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dxfreprd.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DXFREPRD_HXX
32 #define _DXFREPRD_HXX
34 #include <dxfblkrd.hxx>
35 #include <dxftblrd.hxx>
38 //----------------------------------------------------------------------------
39 //--------------------Nebensachen---------------------------------------------
40 //----------------------------------------------------------------------------
42 //-------------------Eine 3D-Min/Max-Box--------------------------------------
44 class DXFBoundingBox {
45 public:
46 BOOL bEmpty;
47 double fMinX;
48 double fMinY;
49 double fMinZ;
50 double fMaxX;
51 double fMaxY;
52 double fMaxZ;
54 DXFBoundingBox() { bEmpty=TRUE; }
55 void Union(const DXFVector & rVector);
59 //-------------------Die (konstante) Palette fuer DXF-------------------------
61 class DXFPalette {
63 public:
65 DXFPalette();
66 ~DXFPalette();
68 BYTE GetRed(BYTE nIndex) const;
69 BYTE GetGreen(BYTE nIndex) const;
70 BYTE GetBlue(BYTE nIndex) const;
72 private:
73 BYTE * pRed;
74 BYTE * pGreen;
75 BYTE * pBlue;
76 void SetColor(BYTE nIndex, BYTE nRed, BYTE nGreen, BYTE nBlue);
80 //----------------------------------------------------------------------------
81 //-----------------DXF Datei lesen und repraesentieren------------------------
82 //----------------------------------------------------------------------------
84 class DXFRepresentation {
86 public:
88 DXFPalette aPalette;
89 // Die immer gleiche DXF-Farb-Palette
91 DXFBoundingBox aBoundingBox;
92 // Ist gleich den AutoCAD-Variablen EXTMIN, EXTMAX sofern in DXF-Datei
93 // vorhanden, anderenfalls wird die BoundingBox berechnet (in Read()).
95 DXFTables aTables;
96 // Die Tabellen der DXF-Datei
98 DXFBlocks aBlocks;
99 // Die Bloecke der DXF-Datei
101 DXFEntities aEntities;
102 // Die Entities (aus der Entities-Section) der DXF-Datei
104 rtl_TextEncoding mEnc; // $DWGCODEPAGE
106 double mfGlobalLineTypeScale; // $LTSCALE
108 DXFRepresentation();
109 ~DXFRepresentation();
111 rtl_TextEncoding getTextEncoding() const;
112 void setTextEncoding(rtl_TextEncoding aEnc);
114 double getGlobalLineTypeScale() const;
115 void setGlobalLineTypeScale(double fGlobalLineTypeScale);
117 BOOL Read( SvStream & rIStream, USHORT nMinPercent, USHORT nMaxPercent);
118 // Liesst die komplette DXF-Datei ein.
120 private:
122 void ReadHeader(DXFGroupReader & rDGR);
123 void CalcBoundingBox(const DXFEntities & rEntities,
124 DXFBoundingBox & rBox);
127 //----------------------------------------------------------------------------
128 //-------------------inlines--------------------------------------------------
129 //----------------------------------------------------------------------------
131 inline BYTE DXFPalette::GetRed(BYTE nIndex) const { return pRed[nIndex]; }
132 inline BYTE DXFPalette::GetGreen(BYTE nIndex) const { return pGreen[nIndex]; }
133 inline BYTE DXFPalette::GetBlue(BYTE nIndex) const { return pBlue[nIndex]; }
134 inline rtl_TextEncoding DXFRepresentation::getTextEncoding() const { return mEnc; }
135 inline void DXFRepresentation::setTextEncoding(rtl_TextEncoding aEnc) { mEnc = aEnc; }
136 inline double DXFRepresentation::getGlobalLineTypeScale() const { return mfGlobalLineTypeScale; }
137 inline void DXFRepresentation::setGlobalLineTypeScale(double fGlobalLineTypeScale) { mfGlobalLineTypeScale = fGlobalLineTypeScale; }
139 #endif