00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef INC_GRE_3DDTTER_H
00025 #define INC_GRE_3DDTTER_H
00026
00027 #ifndef INC_GRE_3DTERRA_H
00028 #include <gre/3dterra.h>
00029 #endif
00030
00031 #ifndef INC_GRE_3DSCENE_H
00032 #include <gre/3dscene.h>
00033 #endif
00034
00035 #ifndef INC_MI32_ASURFACE_H
00036 #include <mi32/asurface.h>
00037 #endif
00038
00039 #ifndef INC_MI32_SIMPLEAR_H
00040 #include <mi32/simplear.h>
00041 #endif
00042
00043 #ifndef INC_RVC_OBJECT_H
00044 #include <rvc/object.h>
00045 #endif
00046
00047 #ifndef INC_RVC_GEOREFER_H
00048 #include <rvc/georefer.h>
00049 #endif
00050
00051 namespace GRE {
00052
00053
00054 class DENSETRIANGULATION : public TERRAIN {
00055 public:
00056
00057 DENSETRIANGULATION (
00058 );
00059
00060 ~DENSETRIANGULATION (
00061 );
00062
00063 private:
00064 #ifndef GENERATING_DOXYGEN_OUTPUT
00065
00066 ABSTRACT_SURFACE *m_Surface;
00067 DRECT3D m_Extents;
00068 MAPPROJPARM m_MapProjParm;
00069 TRANS2D_MAPGEN m_Transformation;
00070
00071 RVC::RASTER m_Raster;
00072
00073 INT32 m_XBlocks;
00074 INT32 m_YBlocks;
00075 INT32 m_BlockSize;
00076 BITSET m_BlockBits;
00077 DOUBLE_ARRAY<DRECT3D> m_Blocks;
00078
00079 DOUBLE_ARRAY<double> m_Buffer;
00080
00081 TRIANGULATION m_Triangulation;
00082 SCENE3D *m_Scene;
00083
00084 double m_ZMin;
00085 double m_ZMax;
00086 bool m_HasNullValue;
00087 double m_NullValue;
00088 UINT8 m_BytesPerCell;
00089
00090 DENSETRIANGULATION& operator= (
00091 const DENSETRIANGULATION& rhs
00092 );
00093
00094 static void GetCorners (
00095 const DRECT3D& rect,
00096 DPOINT3D points[8]
00097 );
00098
00099 TERRAIN* v_CreateInstance (
00100 ) { return new DENSETRIANGULATION(); };
00101
00102 ERRVALUE v_Build (
00103 const GRE_LAYER *layer
00104 );
00105
00106 bool v_IsObjectTypeSupported (
00107 const RVC::OBJTYPE objtype
00108 ) const { return (objtype == RVC::OBJTYPE_Raster); };
00109
00110 void v_Free (
00111 );
00112
00113 ERRVALUE Create (
00114 const GRE_LAYER *layer
00115 );
00116
00117 void Delete (
00118 );
00119
00120 ERRVALUE v_GetDefaultScene (
00121 SCENE3D& scene
00122 ) const;
00123
00124 ERRVALUE v_SetScene (
00125 const SCENE3D& scene,
00126 const SIMPLE_ARRAY<TEXTURE*> &textures
00127 );
00128
00129 ERRVALUE v_DrawScene (
00130 CONTROLLER &controller,
00131 DRAWINGCONTEXT3D& drawing,
00132 TEXTURE* texture,
00133 TEXTUREFILTER* texturefilter
00134 );
00135
00136 float v_GetElevation (
00137 const float x,
00138 const float y
00139 ) const;
00140
00141 float v_GetAngleToNorth (
00142 const float x,
00143 const float y
00144 ) const;
00145
00146 const ABSTRACT_SURFACE* v_GetAbstractSurface (
00147 ) { return m_Surface; }
00148
00149 void v_SetMapProjParm (
00150 const MAPPROJPARM& mapprojparm
00151 );
00152
00153 const MAPPROJPARM v_GetMapProjParm (
00154 ) const { return m_MapProjParm; };
00155
00156 const DRECT3D& v_GetExtents (
00157 ) { return m_Extents; };
00158
00159 bool v_HasNull (
00160 ) const { return m_HasNullValue; };
00161
00162 bool v_IsNull (
00163 const float x,
00164 const float y
00165 ) const;
00166
00167 ERRVALUE CreateBlocks (
00168 const TRANS2D_MAPGEN& transformation
00169 );
00170
00171 void DeleteBlocks (
00172 );
00173 ERRVALUE SetSceneForBlocks (
00174 const SCENE3D& scene,
00175 const SIMPLE_ARRAY<TEXTURE*> &textures
00176 );
00177
00178 ERRVALUE DrawSceneForBlocks (
00179 CONTROLLER &controller,
00180 DRAWINGCONTEXT3D& drawing,
00181 TEXTURE* texture,
00182 TEXTUREFILTER* texturefilter
00183 );
00184
00185 void TransformBlocks (
00186 const TRANS2D_MAPGEN& transformation
00187 );
00188
00189 #endif
00190 };
00191
00192 };
00193
00194 #endif
00195