00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef INC_GRE_3DTEXTUR_H
00035 #define INC_GRE_3DTEXTUR_H
00036
00037 #ifndef INC_GRE_3DUTILS
00038 #include <gre/3dutils.h>
00039 #endif
00040
00041 #ifndef INC_GRE_3DSCENE
00042 #include <gre/3dscene.h>
00043 #endif
00044
00045 #ifndef INC_MI32_MGD2
00046 #include <mi32/mgd2.h>
00047 #endif
00048
00049 #ifndef GENERATING_DOXYGEN_OUTPUT
00050 class GRE_LAYER;
00051 #endif // GENERATING_DOXYGEN_OUTPUT
00052
00053 namespace GRE {
00054
00055 #ifndef GENERATING_DOXYGEN_OUTPUT
00056 class TEXTUREFILTER;
00057 #endif // GENERATING_DOXYGEN_OUTPUT
00058
00059
00060 class TEXTURE {
00061 public:
00062
00063 enum MODEL {
00064 MODEL_Default = 0,
00065 MODEL_SimpleRaster = 0,
00066 MODEL_Count = 1
00067 };
00068
00069
00070
00071
00072 static const char* GetName (
00073 MODEL model
00074 );
00075
00076
00077
00078
00079 static const char* GetDescription (
00080 MODEL model
00081 );
00082
00083
00084
00085
00086 static TEXTURE* GetInstance (
00087 MODEL model
00088 );
00089
00090 virtual ~TEXTURE (
00091 );
00092
00093
00094
00095
00096 const char* GetName (
00097 ) const;
00098
00099
00100
00101
00102 const char* GetDescription (
00103 ) const;
00104
00105
00106
00107
00108 const MODEL GetModel (
00109 ) const {return m_Model; };
00110
00111
00112
00113
00114 TEXTURE* CreateInstance (
00115 ) { return v_CreateInstance(); };
00116
00117
00118
00119
00120 ERRVALUE Build (
00121 const GRE_LAYER* layer
00122 ) { return v_Build(layer); };
00123
00124
00125 void Free (
00126 ) { v_Free(); return; };
00127
00128
00129
00130
00131 bool IsBuilt (
00132 );
00133
00134
00135 void Begin (
00136 const SCENE3D& scene
00137 ) { v_Begin(scene); return; };
00138
00139
00140 void End (
00141 ) { v_End(); return; };
00142
00143
00144
00145
00146 const DRECT2D& GetExtents (
00147 ) { return v_GetExtents(); };
00148
00149
00150 void SetMapProjParm (
00151 const MAPPROJPARM& mapprojparm
00152 ) { v_SetMapProjParm(mapprojparm); return; };
00153
00154
00155
00156
00157 const MAPPROJPARM GetMapProjParm (
00158 ) { return v_GetMapProjParm(); };
00159
00160
00161
00162
00163 bool GetColor (
00164 const INT32 line,
00165 const INT32 column,
00166 const UINT8 depth,
00167 COLOR& color
00168 ) { return v_GetColor(line, column, depth, color); };
00169
00170
00171
00172
00173 bool GetColor (
00174 const DPOINT2D& point,
00175 const UINT8 depth,
00176 COLOR& color
00177 ) { return v_GetColor(point, depth, color); };
00178
00179
00180
00181
00182 UINT8 CheckDepth (
00183 const UINT8 depth
00184 ) { return v_CheckDepth(depth); };
00185
00186
00187
00188
00189 const TRANS2D_MAPGEN& GetTransformationInternalToModel (
00190 ) { return v_GetTransformationInternalToModel(); };
00191
00192 protected:
00193
00194
00195 static void Register (
00196 TEXTURE* texture
00197 );
00198
00199 TEXTURE (
00200 const char* name,
00201 const char* desc,
00202 const MODEL model
00203 );
00204
00205
00206 void SetBuilt (
00207 const bool built
00208 );
00209
00210 private:
00211 #ifndef GENERATING_DOXYGEN_OUTPUT
00212
00213 const char* m_Name;
00214 const char* m_Description;
00215 const MODEL m_Model;
00216
00217 bool m_Built;
00218
00219 static TEXTURE* s_TextureModels[MODEL_Count];
00220
00221 TEXTURE (
00222 );
00223
00224 TEXTURE (
00225 const TEXTURE &rhs
00226 );
00227
00228 TEXTURE& operator= (
00229 const TEXTURE& rhs
00230 );
00231
00232 #endif // GENERATING_DOXYGEN_OUTPUT
00233
00234 virtual TEXTURE* v_CreateInstance (
00235 ) = 0;
00236
00237 virtual ERRVALUE v_Build (
00238 const GRE_LAYER *layer
00239 ) = 0;
00240
00241 virtual void v_Free (
00242 ) = 0;
00243
00244 virtual void v_Begin (
00245 const SCENE3D& scene
00246 ) = 0;
00247
00248 virtual void v_End (
00249 ) = 0;
00250
00251 virtual const DRECT2D& v_GetExtents (
00252 ) = 0;
00253
00254 virtual void v_SetMapProjParm (
00255 const MAPPROJPARM& mapprojparm
00256 ) = 0;
00257
00258 virtual const MAPPROJPARM v_GetMapProjParm (
00259 ) = 0;
00260
00261 virtual bool v_GetColor (
00262 const INT32 line,
00263 const INT32 column,
00264 const UINT8 depth,
00265 COLOR& color
00266 ) = 0;
00267
00268 virtual bool v_GetColor (
00269 const DPOINT2D& point,
00270 const UINT8 depth,
00271 COLOR& color
00272 ) = 0;
00273
00274 virtual UINT8 v_CheckDepth (
00275 const UINT8 depth
00276 ) = 0;
00277
00278 virtual const TRANS2D_MAPGEN& v_GetTransformationInternalToModel (
00279 ) = 0;
00280
00281 };
00282
00283 }
00284
00285 #endif
00286
00287
00288