1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _DXFTBLRD_HXX
25 #define _DXFTBLRD_HXX
26 
27 #include <dxfgrprd.hxx>
28 #include <dxfvec.hxx>
29 
30 
31 //----------------------------------------------------------------------------
32 //------------------ Linien-Typ ----------------------------------------------
33 //----------------------------------------------------------------------------
34 
35 #define DXF_MAX_DASH_COUNT 32
36 
37 class DXFLType {
38 
39 public:
40 
41 	DXFLType * pSucc;
42 
43 	char sName[DXF_MAX_STRING_LEN+1];        //  2
44 	long nFlags;                             // 70
45 	char sDescription[DXF_MAX_STRING_LEN+1]; //  3
46 	long nDashCount;                         // 73
47 	double fPatternLength;                   // 40
48 	double fDash[DXF_MAX_DASH_COUNT];        // 49,49,...
49 
50 	DXFLType();
51 	void Read(DXFGroupReader & rDGR);
52 };
53 
54 
55 //----------------------------------------------------------------------------
56 //------------------ Layer ---------------------------------------------------
57 //----------------------------------------------------------------------------
58 
59 class DXFLayer {
60 
61 public:
62 
63 	DXFLayer * pSucc;
64 
65 	char sName[DXF_MAX_STRING_LEN+1];     //  2
66 	long nFlags;                          // 70
67 	long nColor;                          // 62
68 	char sLineType[DXF_MAX_STRING_LEN+1]; //  6
69 
70 	DXFLayer();
71 	void Read(DXFGroupReader & rDGR);
72 };
73 
74 
75 //----------------------------------------------------------------------------
76 //------------------ Style ---------------------------------------------------
77 //----------------------------------------------------------------------------
78 
79 class DXFStyle {
80 
81 public:
82 
83 	DXFStyle * pSucc;
84 
85 	char sName[DXF_MAX_STRING_LEN+1];         //  2
86 	long nFlags;                              // 70
87 	double fHeight;                           // 40
88 	double fWidthFak;                         // 41
89 	double fOblAngle;                         // 50
90 	long nTextGenFlags;                       // 71
91 	double fLastHeightUsed;                   // 42
92 	char sPrimFontFile[DXF_MAX_STRING_LEN+1]; //  3
93 	char sBigFontFile[DXF_MAX_STRING_LEN+1];  //  4
94 
95 	DXFStyle();
96 	void Read(DXFGroupReader & rDGR);
97 };
98 
99 
100 //----------------------------------------------------------------------------
101 //------------------ VPort ---------------------------------------------------
102 //----------------------------------------------------------------------------
103 
104 class DXFVPort {
105 
106 public:
107 
108 	DXFVPort * pSucc;
109 
110 	char sName[DXF_MAX_STRING_LEN+1]; //  2
111 	long nFlags;                      // 70
112 	double fMinX;                     // 10
113 	double fMinY;                     // 20
114 	double fMaxX;                     // 11
115 	double fMaxY;                     // 21
116 	double fCenterX;                  // 12
117 	double fCenterY;                  // 22
118 	double fSnapBaseX;                // 13
119 	double fSnapBaseY;                // 23
120 	double fSnapSapcingX;             // 14
121 	double fSnapSpacingY;             // 24
122 	double fGridX;                    // 15
123 	double fGridY;                    // 25
124 	DXFVector aDirection;             // 16,26,36
125 	DXFVector aTarget;                // 17,27,37
126 	double fHeight;                   // 40
127 	double fAspectRatio;              // 41
128 	double fLensLength;               // 42
129 	double fFrontClipPlane;           // 43
130 	double fBackClipPlane;            // 44
131 	double fTwistAngle;               // 51
132 	long nStatus;                     // 68
133 	long nID;                         // 69
134 	long nMode;                       // 71
135 	long nCircleZoomPercent;          // 72
136 	long nFastZoom;                   // 73
137 	long nUCSICON;                    // 74
138 	long nSnap;                       // 75
139 	long nGrid;                       // 76
140 	long nSnapStyle;                  // 77
141 	long nSnapIsopair;                // 78
142 
143 	DXFVPort();
144 	void Read(DXFGroupReader & rDGR);
145 };
146 
147 
148 //----------------------------------------------------------------------------
149 //------------------ Tabellen ------------------------------------------------
150 //----------------------------------------------------------------------------
151 
152 class DXFTables {
153 
154 public:
155 
156 	DXFLType * pLTypes; // Liste der Linientypen
157 	DXFLayer * pLayers; // Liste der Layers
158 	DXFStyle * pStyles; // Liste der Styles
159 	DXFVPort * pVPorts; // Liste der Viewports
160 
161 	DXFTables();
162 	~DXFTables();
163 
164 	void Read(DXFGroupReader & rDGR);
165 		// Liest die Tabellen ein bis zu einem ENDSEC oder EOF
166 		// (unbekannte Dinge/Tabellen werden uebersprungen)
167 
168 	void Clear();
169 
170 	// Suche nach Tabelleneintraegen:
171 	DXFLType * SearchLType(const char * pName) const;
172 	DXFLayer * SearchLayer(const char * pName) const;
173 	DXFVPort * SearchVPort(const char * pName) const;
174 
175 };
176 
177 #endif
178 
179 
180