gre/3dtextur.h

Go to the documentation of this file.
00001 /*** 
00002  * \file gre/3dtextur.h
00003  * \brief Base class for texturing algorithm
00004  *
00005  * \if NODOC
00006  * $Id: 3dtextur.h_v 1.12 2003/10/02 16:18:21 linux32build!build Exp $
00007  *
00008  * $Log: 3dtextur.h_v $
00009  * Revision 1.12  2003/10/02 16:18:21  linux32build!build
00010  * Doxygen
00011  *
00012  * Revision 1.11  2003/09/15 13:48:59  fileserver!dwilliss
00013  * Doxygen
00014  *
00015  * Revision 1.10  2003/08/15 17:03:05  vdronov
00016  * nc
00017  *
00018  * Revision 1.9  2003/08/15 16:55:14  vdronov
00019  * add docs
00020  *
00021  * Revision 1.8  2003/07/30 14:27:36  mju
00022  * Check inclusion guards.
00023  * Ignore private section.
00024  * Make pure virtual methods private.
00025  *
00026  * Revision 1.2  2003/03/24 20:39:15  vdronov
00027  * added forward GRE_LAYER
00028  *
00029  * Revision 1.1  2003/03/10 15:08:04  vdronov
00030  * Initial revision
00031  * \endif
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 //! Base class for 3D texture models.
00060 class TEXTURE {
00061    public:
00062 
00063       enum MODEL {
00064          MODEL_Default = 0,
00065          MODEL_SimpleRaster = 0,
00066          MODEL_Count = 1
00067          };
00068 
00069       //! GetName returns a name of the given model enum
00070       //!
00071       //! @return char pointer of the name
00072       static const char* GetName (
00073          MODEL model
00074          );
00075 
00076       //! GetDescription returns a description of the given model enum
00077       //!
00078       //! @return char pointer of the description
00079       static const char* GetDescription (
00080          MODEL model
00081          );
00082 
00083       //! GetInstance returns a new instance of the given model enum
00084       //!
00085       //! @return pointer to new model
00086       static TEXTURE* GetInstance (
00087          MODEL model
00088          );
00089 
00090       virtual ~TEXTURE (                        //! Destructor
00091          );
00092 
00093       //! GetName returns a name of the model
00094       //!
00095       //! @return char pointer of the name
00096       const char* GetName (
00097          ) const;
00098 
00099       //! GetDescription returns a description of the model
00100       //!
00101       //! @return char pointer of the description
00102       const char* GetDescription (
00103          ) const;
00104 
00105       //! GetModel returns an enum of the model
00106       //!
00107       //! @return enum of the model
00108       const MODEL GetModel (
00109          ) const {return m_Model; };
00110 
00111       //! Create new instance of texture model
00112       //!
00113       //! @return instance of texture model
00114       TEXTURE* CreateInstance (
00115          ) { return v_CreateInstance(); };
00116 
00117       //!   Build internal structures for texture construction for given drape layer 
00118       //!
00119       //! @return 0 if built or < 0 if an error
00120       ERRVALUE Build (
00121          const GRE_LAYER* layer
00122          ) { return v_Build(layer); };
00123 
00124       //!   Free internal structures for texture construction 
00125       void Free (
00126          ) { v_Free(); return; };
00127 
00128       //!   Is internal structures for texture construction built? 
00129       //!
00130       //! @return true if built or false if an error
00131       bool IsBuilt (
00132          );
00133 
00134       //! Begining of texture retriving for given scene
00135       void Begin (
00136          const SCENE3D& scene
00137          ) { v_Begin(scene); return; };
00138 
00139       //! Rnding of texture retriving
00140       void End (
00141          ) { v_End(); return; };
00142 
00143       //! Get extents in map projection coordinates
00144       //!
00145       //! @return extents
00146       const DRECT2D& GetExtents (
00147          ) { return v_GetExtents(); };
00148 
00149       //! Set model map projection be used for output data
00150       void SetMapProjParm (
00151          const MAPPROJPARM& mapprojparm
00152          ) { v_SetMapProjParm(mapprojparm); return; };
00153 
00154       //! Get map projection be used for output data 
00155       //!
00156       //! @return MAPPROJPARM
00157       const MAPPROJPARM GetMapProjParm (
00158          ) { return v_GetMapProjParm(); };
00159 
00160       //! Get color for given cell and depth
00161       //!
00162       //! @return true if color was retrived
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       //! Get color for given point in specifyed map projection and depth
00171       //!
00172       //! @return true if color was retrived
00173       bool GetColor (
00174          const DPOINT2D& point,
00175          const UINT8 depth,
00176          COLOR& color 
00177          ) { return v_GetColor(point, depth, color); };
00178 
00179       //! Check if for given depth pyramid tier exist
00180       //!
00181       //! @return the nearest lower depth
00182       UINT8 CheckDepth (
00183          const UINT8 depth
00184          ) { return v_CheckDepth(depth); };
00185 
00186       //! Get transformation from object coordinates ot specifyed map projection
00187       //!
00188       //! @return TRANS2D_MAPGEN&
00189       const TRANS2D_MAPGEN& GetTransformationInternalToModel (
00190          ) { return v_GetTransformationInternalToModel(); };
00191 
00192    protected:
00193 
00194       //! Register this model (Called by constructor)
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       //!   Set built state? 
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;                             //!<  Is an object built?
00218 
00219       static TEXTURE* s_TextureModels[MODEL_Count];
00220 
00221       TEXTURE (   
00222          );
00223 
00224       TEXTURE (                                 //! Copy constructor (not implemented)
00225          const TEXTURE &rhs
00226          );
00227 
00228       TEXTURE& operator= (                      //! Assignment operator (not implemented)
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 }     // End of GRE namespace
00284 
00285 #endif
00286 
00287 
00288 

Generated on Thu Aug 12 06:18:24 2004 for TNTsdk by doxygen 1.3.4-20031026