lrsurface.h

Go to the documentation of this file.
00001 /**
00002  * \file lrsurface.h <gre/lrsurface.h>
00003  * \brief GRE_LAYER_SURFACE definitions
00004  * \if NODOC
00005  * $Id: lrsurface.h_v 1.5 2005/06/17 17:06:29 vdronov Exp $
00006  *
00007  * $Log: lrsurface.h_v $
00008  * Revision 1.5  2005/06/17 17:06:29  vdronov
00009  * added saving of optimization structure
00010  *
00011  * Revision 1.4  2005/06/13 16:14:53  vdronov
00012  * removed sparse and dense raycasting
00013  *
00014  * Revision 1.3  2005/03/31 16:57:06  fileserver!dwilliss
00015  * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define
00016  *
00017  * Revision 1.2  2005/02/28 18:04:40  scowan
00018  * Support layer copy virtual method.
00019  *
00020  * Revision 1.1  2005/01/20 16:57:42  mju
00021  * Initial revision
00022  *
00023  * \endif
00024 **/
00025 
00026 #ifndef  INC_GRE_LRSURFACE_H
00027 #define  INC_GRE_LRSURFACE_H
00028 
00029 #ifndef  INC_GRE_LAYER_H
00030    #include <gre/layer.h>
00031 #endif
00032 
00033 #ifndef  INC_GRE_3DTERRA_H
00034    #include <gre/3dterra.h>
00035 #endif
00036 
00037 //===================================================================================================================
00038 
00039 class GRE_LAYER_SURFACE : public GRE_LAYER {
00040    public:
00041 
00042       enum RENDERING_MODE {
00043          RENDERING_MODE_None = -1,
00044          RENDERING_MODE_VariableTriangulation = 0,
00045          RENDERING_MODE_PiecewiseTIN = 1,
00046          RENDERING_MODE_FlatTriangulation = 2
00047          };
00048 
00049       // GRE_LAYER_SURFACE::DISPPARM
00050       class DISPPARM : public GRE_LAYER::DISPPARM {
00051          public:
00052 
00053             class DLG;
00054 
00055             MIUNICODE filename[FILENAME_MAX];         //!< Filename of the object
00056             RVC::OBJECTNAME m_GeorefName;          //!< Name of georeference object
00057             int fhandle;                           //!< RVC file handle
00058             int ohandle;                           //!< RVC object handle
00059             RVCRASTINFO objinfo;
00060             INT32 WireSample;                //!< Wireframe sampling rate
00061             double RastNullValue;            //!< Raster null cell value as double
00062             DRANGE *TileRange;               //!< Range of values for each raster tile in base tier
00063             RENDERING_MODE m_RenderingMode;
00064             bool m_SaveOptimizationStructure;
00065             double m_ErrorTolerance;
00066 
00067             DISPPARM ();
00068             DISPPARM (
00069                const DISPPARM& rhs
00070                ): GRE_LAYER::DISPPARM(rhs) { Copy(rhs); }
00071             virtual ~DISPPARM (
00072                ) { Free(); }
00073 
00074             DISPPARM& operator= (const DISPPARM& rhs) {
00075                if (this != &rhs) {
00076                   Free();
00077                   Copy(rhs);
00078                   }
00079                return (*this);
00080                }
00081 
00082             int OpenObject (UINT32 filemode = RVCFILE_ReadLock, MDLGPARENT parent = NULL);
00083 
00084          protected:
00085             virtual const SERIALIZER::ITEMDEF* SerialGetItemDef (SERIALIZER& serializer) const;
00086 
00087          private:
00088             #ifndef GENERATING_DOXYGEN_OUTPUT
00089             void CloseObject ();
00090             void Copy (const DISPPARM&);
00091             void Free ();
00092 
00093             virtual ERRVALUE v_SetObjItem (const RVC::OBJITEM& objitem, bool replace);
00094             virtual ERRVALUE v_Validate ();
00095 
00096             friend class GRE_LAYER_SURFACE;
00097             #endif // GENERATING_DOXYGEN_OUTPUT
00098          }; // End of GRE_LAYER_SURFACE::DISPPARM
00099 
00100       //! Register this layer type
00101       static void RegisterType (
00102          );
00103 
00104       //! Construct layer and insert into list
00105       explicit GRE_LAYER_SURFACE (
00106          GRE_GROUP *group,                            //!< Group to contain layer
00107          CREATEFLAGS createflags = CREATEFLAG_None,   //!< Creation flags
00108          GRE::LISTPOS listpos = GRE::LISTPOS_Last,    //!< Position in list
00109          GRE_LAYER *reflayer = 0                      //!< Reference layer for insertion
00110          );
00111 
00112       virtual ~GRE_LAYER_SURFACE ();
00113 
00114       //! Open object(s) for this layer
00115       //! @return TRUE if was opened, FALSE if open already, < 0 if error
00116       virtual int OpenObject (
00117          UINT32 filemode = RVCFILE_ReadLock,    //!< RVC file access mode
00118          MDLGPARENT dlgparent = 0               //!< Parent for dialog
00119          );
00120 
00121       //! Retrieve layer-specific display parameters.
00122       const DISPPARM& GetDispParm (
00123          ) const { return (m_dispparm); }
00124 
00125       //! Get Z coordinates for set of points.
00126       //! This method is used mainly in 3D rendering and measurement to obtain the Z coordinates
00127       //! of one or more points in some other map projection or layer coordinate system.
00128       int GetPointsZ (
00129          const TRANSPARM& PtoS,                 //!< Transformation from point to surface object coordinates
00130          DPOINT3D *points,                      //!< Points to obtain Z values for
00131          INT32 NumPoints,                       //!< Number of points
00132          double dftz                            //!< Default Z value for off-surface points
00133          );
00134 
00135       int GetPointsZ (
00136          const TRANS2D_MAPGEN& PtoS,            //!< Transformation from point to surface object coordinates
00137          DPOINT3D *points,                      //!< Points to obtain Z values for
00138          INT32 NumPoints,                       //!< Number of points
00139          double dftz                            //!< Default Z value for off-surface points
00140          ) { return (GetPointsZ(PtoS.GetTransParm(),points,NumPoints,dftz)); }
00141 
00142       //! Get Z coordinates for set of points.
00143       //! This method is used mainly in 3D rendering and measurement to obtain the Z coordinates
00144       //! of one or more points in some other map projection or layer coordinate system.
00145       ERRVALUE GetPointsZ (
00146          const TRANS2D_MAPGEN& PtoS,            //!< Transformation from point to surface object coordinates
00147          POLYLINE& PolyLine,                    //!< Points to obtain Z values for
00148          double dftz                            //!< Default Z value for off-surface points
00149          );
00150 
00151       //! Set layer-specific display parameters.
00152       //! This is the recommended method for changing how an existing layer is to be
00153       //! rendered.  Validation will be performed on the specified parameters and
00154       //! adjustments made to the layer's copy if necessary.  Use of this method
00155       //! usually results in a ChangeBegin / ChangeEnd message pair, and will also
00156       //! generate a ChangeObject message if the spatial object used in the layer
00157       //! is changed.
00158       ERRVALUE SetDispParm (
00159          const DISPPARM& dispparm               //!< Parameters to set
00160          );
00161 
00162       GRE::TERRAIN* GetTerrain (
00163          ) { return m_Terrain; };
00164 
00165    protected:
00166 
00167       DISPPARM m_dispparm;                      //!< Layer-specific display parameters
00168 
00169    private:
00170       #ifndef GENERATING_DOXYGEN_OUTPUT
00171 
00172       GRE::TERRAIN *m_Terrain;
00173 
00174       int WireReadRaster ();
00175       void CheckTerrain ();
00176 
00177       //! Overrides from GRE_LAYER.
00178       virtual ERRVALUE v_AssignObject (const RVC::OBJITEM& objitem, MDLGPARENT dlgparent);
00179    #if defined(X_NATIVE) || defined(WIN32_MFC)
00180       virtual int v_ControlPanel (MDLGPARENT dlgparent,UINT32 flags = 0);
00181    #endif
00182       virtual GRE_LAYER* v_Copy (GRE_GROUP *group) const;
00183       virtual ERRVALUE v_Draw (GRE_LAYERDC& layerdc);
00184       virtual bool v_GetGeorefName (RVC::OBJECTNAME& name, int component = 0) const;
00185       virtual const RVC::OBJITEM& v_GetObjItem (int component) const;
00186    #if defined(X_NATIVE) || defined(WIN32_MFC)
00187       virtual ERRVALUE v_PromptObject (bool OpenCtrlPanel, MDLGPARENT dlgparent);
00188    #endif
00189       virtual const char* v_SerialGetTagName () const;
00190       virtual void v_SetDftName (bool ReplaceExisting);
00191       virtual int v_UpdateExtents (bool forceupdate);
00192 
00193       GRE_LAYER_SURFACE (const GRE_LAYER_SURFACE&);
00194       GRE_LAYER_SURFACE& operator= (const GRE_LAYER_SURFACE&);
00195 
00196       #endif // GENERATING_DOXYGEN_OUTPUT
00197    };
00198 
00199 
00200 //===================================================================================================================
00201 
00202 #endif   // INC_GRE_LRSURFACE_H

Generated on Wed May 31 15:26:41 2006 for TNTsdk by  doxygen 1.3.8-20040913