Debian Codegraph @

src/graphicmanager.h

raw symbols SCIP
1 /***************************************************************************
2 graphicmanager.h - description
3 -------------------
4 begin : september 21th, 2003
5 copyright : (C) 2003-2007 by Duong Khang NGUYEN
6 email : neoneurone @ gmail com
7
8 $Id: graphicmanager.h 375 2008-10-28 14:47:15Z neoneurone $
9 ***************************************************************************/
10
11 /***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * any later version. *
17 * *
18 ***************************************************************************/
19
20 #ifndef _OPENCITY_GRAPHICMANAGER_H_
21 #define _OPENCITY_GRAPHICMANAGER_H_ 1
22
23 #include "main.h"
24
25 // Graphics Level Of Details
26 #define OC_LOD_HIGH 1
27 #define OC_LOD_MEDIUM 2
28 #define OC_LOD_LOW 3
29
30 class Renderer;
31 class Structure;
32
33 class Model;
34 class Movement;
35 class Agent;
36
37
38 //========================================================================
39 /** It handles the rendering of 3d objects
40 \sa Renderer
41 */
42 class GraphicManager {
43 public:
44 GraphicManager();
45 virtual ~GraphicManager();
46
47
48 //========================================================================
49 /** Get the ObjectId at the specified window's coordinates
50 \return uint == the ObjectId previously displayed
51 */
52 const uint
53 GetSelection(
54 const uint & rcuiWinX,
55 const uint & rcuiWinY ) const;
56
57
58 //========================================================================
59 /** Display a terrain square, there should be no structure on it. This
60 method does take care about the height of the terrain.
61 */
62 void
63 DisplayTerrain(
64 const uint & rcuiW,
65 const uint & rcuiL ) const;
66
67
68 //========================================================================
69 /** Display a the structure thanks to its graphic code.
70 \param pcStructure points to the structure to display. ( != NULL )
71 \param rcuiW,rcuiL the map (W,L) coordinates of the structure
72 */
73 void
74 DisplayStructure(
75 const Structure* pcStructure,
76 const uint & rcuiW,
77 const uint & rcuiL ) const;
78
79
80 //========================================================================
81 /** Display a graphic code at the specified map coordinates
82 \param enumGC must be a valid graphic code
83 \param rcuiW,rcuiL the map (W,L) coordinates of the graphism
84 */
85 void
86 DisplayGC(
87 const OPENCITY_GRAPHIC_CODE & enumGC,
88 const uint & rcuiW,
89 const uint & rcuiL ) const;
90
91
92 void
93 DisplayTerrainHighlight(
94 const uint & rcuiW,
95 const uint & rcuiL,
96 const OPENCITY_TOOL_CODE & enumTool ) const;
97
98
99 void
100 DisplayStructureHighlight(
101 const Structure* pcStructure,
102 const uint & rcuiW,
103 const uint & rcuiL,
104 const OPENCITY_TOOL_CODE & enumTool ) const;
105
106
107 void
108 DisplayTerrainSelection(
109 const uint & rcuiW,
110 const uint & rcuiL,
111 const uint & rcuiID ) const;
112
113
114 void
115 DisplayStructureSelection(
116 const Structure* pcStructure,
117 const uint & rcuiW,
118 const uint & rcuiL,
119 const uint & rcuiID ) const;
120
121
122 //========================================================================
123 /** This is a special function used for movement (vehicle) rendering
124 */
125 void
126 Display(
127 const OC_FLOAT & rcfW,
128 const OC_FLOAT & rcfL,
129 const OC_FLOAT & rcfH,
130 const Movement* const pm ) const;
131
132 //========================================================================
133 /** Set the new models level of details
134 */
135 void SetLOD( const uint lod );
136
137 uint GetListMask() const;
138 void SetListMask( const uint mask );
139
140 void
141 DisplayAgent(float x, float y, const Agent* const pAgent) const;
142
143
144 private:
145 uint _uiDisplayListMask; ///< The current models display list mask
146 Model* _tabpModel [OC_GRAPHIC_CODE_MAX]; ///< A table of Model pointers
147
148 };
149
150 #endif
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192