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
00035
00036 #ifndef INC_GRE_3DSTTER_H
00037 #define INC_GRE_3DSTTER_H
00038
00039 #ifndef INC_GRE_3DTERRA_H
00040 #include <gre/3dterra.h>
00041 #endif
00042
00043 #ifndef INC_GRE_3DSCENE_H
00044 #include <gre/3dscene.h>
00045 #endif
00046
00047 #ifndef INC_MI32_ASURFACE_H
00048 #include <mi32/asurface.h>
00049 #endif
00050
00051 #ifndef INC_MI32_SIMPLEAR_H
00052 #include <mi32/simplear.h>
00053 #endif
00054
00055 #ifndef INC_RVC_GEOREFER_H
00056 #include <rvc/georefer.h>
00057 #endif
00058
00059 namespace GRE {
00060
00061
00062 class SPARSETRIANGULATION : public TERRAIN {
00063 public:
00064
00065 SPARSETRIANGULATION (
00066 );
00067
00068 ~SPARSETRIANGULATION (
00069 );
00070
00071 private:
00072 #ifndef GENERATING_DOXYGEN_OUTPUT
00073
00074 ABSTRACT_SURFACE *m_Surface;
00075 DRECT3D m_Extents;
00076 SPATREF::COORDREFSYS m_CoordRefSys;
00077 TRANS2D_MAPGEN m_Transformation;
00078
00079 RVC::RASTER m_Raster;
00080
00081 TRIANGULATION m_Triangulation;
00082 BITSET m_TrianglesBits;
00083 SCENE3D *m_Scene;
00084
00085 double m_ZMin;
00086 double m_ZMax;
00087 bool m_HasNullValue;
00088 double m_NullValue;
00089 UINT8 m_BytesPerCell;
00090
00091 SPARSETRIANGULATION& operator= (
00092 const SPARSETRIANGULATION& rhs
00093 );
00094
00095 TERRAIN* v_CreateInstance (
00096 ) { return new SPARSETRIANGULATION(); };
00097
00098 ERRVALUE v_Build (
00099 const GRE_LAYER *layer
00100 );
00101
00102 bool v_IsObjectTypeSupported (
00103 const RVC::OBJTYPE objtype
00104 ) const { return (objtype == RVC::OBJTYPE_Raster); };
00105
00106 void v_Free (
00107 );
00108
00109 ERRVALUE Create (
00110 const GRE_LAYER *layer
00111 );
00112
00113 void Delete (
00114 );
00115
00116 ERRVALUE v_GetDefaultScene (
00117 SCENE3D& scene
00118 ) const;
00119
00120 ERRVALUE v_SetScene (
00121 const SCENE3D& scene,
00122 const SIMPLE_ARRAY<TEXTURE*> &textures
00123 );
00124
00125 ERRVALUE v_DrawScene (
00126 CONTROLLER &controller,
00127 DRAWINGCONTEXT3D& drawing,
00128 TEXTURE* texture,
00129 TEXTUREFILTER* texturefilter
00130 );
00131
00132 float v_GetElevation (
00133 const float x,
00134 const float y
00135 ) const;
00136
00137 ERRVALUE v_ComputeProfile (
00138 const POLYLINE& polyline,
00139 POLYLINE& profile,
00140 SIMPLE_ARRAY<INT32>& index
00141 );
00142
00143 float v_GetAngleToNorth (
00144 const float x,
00145 const float y
00146 ) const;
00147
00148 const ABSTRACT_SURFACE* v_GetAbstractSurface (
00149 ) { return m_Surface; }
00150
00151 void v_SetCoordRefSys (
00152 const SPATREF::COORDREFSYS& CoordRefSys
00153 );
00154
00155 const SPATREF::COORDREFSYS v_GetCoordRefSys (
00156 ) const { return m_CoordRefSys; };
00157
00158 const DRECT3D& v_GetExtents (
00159 ) { return m_Extents; };
00160
00161 void v_CreateBoundary (
00162 REGION2D& boundary
00163 );
00164
00165 bool v_HasNull (
00166 ) const { return m_HasNullValue; };
00167
00168 bool v_IsNull (
00169 const float x,
00170 const float y
00171 ) const;
00172
00173 ERRVALUE CreateRegularTIN (
00174 const TRANS2D_MAPGEN& transformation
00175 );
00176
00177 void DeleteRegularTIN (
00178 );
00179 ERRVALUE SetSceneForRegularTIN (
00180 const SCENE3D& scene,
00181 const SIMPLE_ARRAY<TEXTURE*> &textures
00182 );
00183
00184 ERRVALUE DrawSceneForRegularTIN (
00185 CONTROLLER &controller,
00186 DRAWINGCONTEXT3D& drawing,
00187 TEXTURE* texture,
00188 TEXTUREFILTER* texturefilter
00189 );
00190
00191 void TransformRegularTIN (
00192 const TRANS2D_MAPGEN& transformation
00193 );
00194
00195 #endif
00196 };
00197
00198 };
00199
00200 #endif
00201