view.h

Go to the documentation of this file.
00001 /**
00002  * \file view.h <gre/view.h>
00003  * \brief GRE VIEW classes
00004  *
00005  * \if NODOC
00006  * $Id: view.h_v 1.32 2004/11/29 17:29:06 mju Exp $
00007  *
00008  * $Log: view.h_v $
00009  * Revision 1.32  2004/11/29 17:29:06  mju
00010  * Add detach method and check for null viewable before deref in inlines.
00011  *
00012  * Revision 1.31  2004/09/09 23:11:14  ldyas
00013  * saves antialiasing
00014  *
00015  * Revision 1.30  2004/07/23 18:32:59  mju
00016  * Return error from updateExtents.
00017  *
00018  * Revision 1.29  2004/07/21 21:56:22  mju
00019  * Add layerview.
00020  *
00021  * Revision 1.28  2004/07/12 19:56:34  vdronov
00022  * added stereo optical and monitor separations
00023  *
00024  * Revision 1.27  2004/07/09 17:37:29  mju
00025  * Remove deprecated methods for trans to/from map coords.
00026  *
00027  * Revision 1.26  2004/07/08 13:31:05  mju
00028  * Update mfc view for spatref.
00029  *
00030  * Revision 1.25  2004/06/28 17:54:48  mju
00031  * Convert to spatref system.
00032  *
00033  * Revision 1.24  2004/04/15 15:48:43  mju
00034  * Add gre_ToolAddZoomSimple.
00035  *
00036  * Revision 1.23  2004/04/14 21:47:57  mju
00037  * Add GetMenuItemHotKeys.
00038  *
00039  * Revision 1.22  2004/03/05 20:27:06  mju
00040  * Allow getDrawingDevice/ContextMemory for non-X.
00041  *
00042  * Revision 1.21  2004/03/05 17:02:04  mju
00043  * Move sdisp/sgc/pdisp/pgc/mdisp/mgc to private section and add methods to access.
00044  *
00045  * Revision 1.20  2004/03/05 15:14:02  mju
00046  * Use virtual dtor if have virtual fn.
00047  *
00048  * Revision 1.19  2004/02/24 14:50:18  mju
00049  * Change updatemessage to use mistring.
00050  * Deprecate getname version returning unicode*.
00051  *
00052  * Revision 1.18  2004/02/13 15:32:16  dwilliss
00053  * deprecated old mgd
00054  *
00055  * Revision 1.17  2004/02/06 16:02:05  mju
00056  * Use GRE_FIND_FLAGS.
00057  *
00058  * Revision 1.16  2004/02/05 22:08:34  mju
00059  * Integrate datatip support.
00060  *
00061  * Revision 1.15  2004/02/02 20:57:39  scowan
00062  * Deprecated update message method that takes group and key.
00063  *
00064  * Revision 1.14  2003/12/22 20:20:26  mju
00065  * Add pDlgViewZoom.
00066  *
00067  * Revision 1.13  2003/11/20 13:27:02  mju
00068  * Add m_LastLayerDrawSingle.
00069  *
00070  * Revision 1.12  2003/10/31 18:26:54  mju
00071  * Remove updateColorsMem24.
00072  *
00073  * Revision 1.11  2003/10/28 23:59:11  ldyas
00074  * adding thin line hinting controls.
00075  * ,
00076  *
00077  * Revision 1.10  2003/10/24 21:44:16  ldyas
00078  * antialiasing now optional
00079  *
00080  * Revision 1.9  2003/10/06 20:47:11  mju
00081  * Add v_OnDraw... overridables.
00082  *
00083  * Revision 1.8  2003/09/25 21:22:24  dwilliss
00084  * Don't capitalize enum any more. Genitor needed it, doxygen doesn't like it
00085  *
00086  * Revision 1.7  2003/09/16 15:06:15  mju
00087  * Add updateextents method.
00088  *
00089  * Revision 1.6  2003/09/15 13:48:59  fileserver!dwilliss
00090  * Doxygen
00091  *
00092  * Revision 1.5  2003/07/30 15:47:39  mju
00093  * Ignore private sections.
00094  *
00095  * Revision 1.4  2003/07/29 15:34:51  mju
00096  * Add UpdateScriptUI.
00097  *
00098  * Revision 1.3  2003/06/30 20:09:03  mju
00099  * Add more methods to deal with macroscripts.
00100  *
00101  * Revision 1.2  2003/06/25 14:35:19  scowan
00102  * Added lat lon include file.
00103  *
00104  * Revision 1.1  2003/06/24 16:24:54  mju
00105  * Initial revision
00106  *
00107  * \endif
00108 **/
00109 
00110 #ifndef  INC_GRE_VIEW_H
00111 #define  INC_GRE_VIEW_H
00112 
00113 #if !defined(INC_MI32_STDAFX_H) && defined(WIN32_MFC)
00114    #include <mi32/stdafx.h>
00115 #endif
00116 
00117 #if !defined(_OXTOOLTIPCTRL_H__) && defined(WIN32_MFC)
00118    #include <mgui/oxttctrl.h>
00119 #endif
00120 
00121 #if !defined(INC_MI32_GRTOOL_H) && defined(WIN32_MFC)
00122    #include <mi32/grtool.h>
00123 #endif
00124 
00125 #ifndef  INC_GRE_OBJECTBASE_H
00126    #include <gre/viewable.h>
00127 #endif
00128 
00129 #ifndef  INC_GRE_VIEWSCRIPT_H
00130    #include <gre/viewscript.h>
00131 #endif
00132 
00133 #ifndef  INC_GRE_GEOLOCK_H
00134    #include <gre/geolock.h>
00135 #endif
00136 
00137 #if !defined(INC_MI32_XDEFNS_H) && defined(X_NATIVE)
00138    #include <mi32/xdefns.h>
00139 #endif
00140 
00141 #ifndef  INC_MI32_SERIALIZ_H
00142    #include <mi32/serializ.h>
00143 #endif
00144 
00145 #ifndef INC_MI32_TRANS2DC_H
00146    #include <mi32/trans2dc.h>
00147 #endif
00148 
00149 #ifndef INC_MI32_UNITCONV_H
00150    #include <mi32/unitconv.h>
00151 #endif
00152 
00153 #ifndef INC_MI32_MXSTEREO_H
00154    #include <mi32/mxstereo.h>
00155 #endif
00156 
00157 #ifndef INC_MI32_GRTREE_H
00158    #include <mi32/grtree.h>
00159 #endif
00160 
00161 #ifndef INC_MI32_LATLONFM_H
00162    #include <mi32/latlonfm.h>
00163 #endif
00164 
00165 #include <map>
00166 
00167 
00168 #ifndef GENERATING_DOXYGEN_OUTPUT
00169 
00170 namespace RVC {
00171    class ELEMENT;
00172    }
00173 
00174 namespace GRE {
00175    class DLG_VIEWZOOM;
00176    }
00177 
00178 namespace MGD {
00179    class DEVICE;
00180    class DEVICE_MEM24;
00181    class DEVICE_X;
00182    class CONTEXT;
00183    }
00184 
00185 namespace MGUI {
00186    class CTRL_TOOLTIP;
00187    }
00188 
00189 union SMLARG;
00190 
00191 #endif
00192 
00193 
00194 enum GRE_PROJACCUR {
00195    GRE_PROJACCUR_Affine =  1,       //!< Always use affine transformation to approximate
00196    GRE_PROJACCUR_Exact =   2,       //!< Perform exact projection transformation (slowest for all object types)
00197    GRE_PROJACCUR_Auto =    3,       //!< Do automatic determination between affine and exact
00198    };
00199 
00200 enum VIEWFLAGS {
00201    VIEWFLAG_None =                  0,
00202    VIEWFLAG_Locator =               0x00000001, //!< Locator view
00203    VIEWFLAG_3D =                    0x00000002, //!< View is 3D
00204    VIEWFLAG_ForceOneToOne =         0x00000004, //!< Force zoom so first raster shown at 1 cell/pixel
00205    VIEWFLAG_ScaleOneToOne =         0x00000008, //!< Set zoom so first raster shown at 1 cell/pixel
00206    VIEWFLAG_AllowDiffZoom =         0x00000010, //!< Allow different X/Y zooming
00207    VIEWFLAG_Hardcopy =              0x00000020, //!< Hardcopy view
00208    VIEWFLAG_DisableHotKeys =        0x00000040, //!< Disable hot keys for view window
00209    VIEWFLAG_NoDrawLayers =          0x00000080, //!< Don't draw any layers in view
00210    VIEWFLAG_NoDestroyShell =        0x00000100, //!< Don't destroy Shell containing view when view destroyed
00211    VIEWFLAG_DidAttach =             0x00000200, //!< Widget attachment done when view was created
00212    VIEWFLAG_DialogModal =           0x00000400, //!< View dialog is modal
00213    VIEWFLAG_AllowGeoLock =          0x00000800, //!< Allow GeoLocking
00214    VIEWFLAG_NoCloseOption =         0x00001000, //!< Don't include View/Close menu option
00215    VIEWFLAG_DestroyOnClose =        0x00002000, //!< Destroy view when user selects View/Close
00216    VIEWFLAG_NoSetPixmapBG =         0x00004000, //!< Don't set backgroundPixmap for DrawingArea
00217    VIEWFLAG_NoSetPrevViewPos =      0x00008000, //!< Don't set "previous view position" when draw
00218    VIEWFLAG_DisableDataTips =       0x00010000, //!< Disable datatips for this view
00219    VIEWFLAG_AutoPanGPS =            0x00040000, //!< Auto-pan view to GPS if available
00220    VIEWFLAG_NoBlankScreen =         0x00080000, //!< Don't blank screen while drawing view
00221    VIEWFLAG_NoEditColorHighlight =  0x00100000, //!< Don't allow editing of selected/active colors
00222    VIEWFLAG_NoFillBackground =      0x00200000, //!< Don't fill background before rendering, used for raster
00223    VIEWFLAG_NoShowTrackingCursor =  0x00800000, //!< Don't display "tracking" cursor in this view
00224    VIEWFLAG_NoLegendView =          0x01000000, //!< Don't create LegendView
00225    VIEWFLAG_AlwaysTestCancel =      0x02000000, //!< Test for cancel from status even if not drawing
00226    VIEWFLAG_NoDrawOtherViews =      0x04000000, //!< Don't draw other views when this view is drawn
00227    VIEWFLAG_NoShowInLocator =       0x08000000, //!< Don't show this view in locator tool
00228 
00229    VIEWFLAG_SaveMask =              (VIEWFLAG_AllowDiffZoom)
00230    };
00231 DEFINE_ENUM_OP_BITWISE(VIEWFLAGS);
00232 
00233 #define  GRE_MaxPrevViews  10             //!< Maximum number of "previous views" to retain
00234 
00235 //! Flags for VIEW::GetIconItemView() and VIEW::AddDftViewIcons()
00236 #define  MDISPICONVIEW_ViewFull        0x00000001
00237 #define  MDISPICONVIEW_ViewPrevious    0x00000002
00238 #define  MDISPICONVIEW_ViewPrevZoom    0x00000004
00239 #define  MDISPICONVIEW_ViewZoomIn      0x00000008
00240 #define  MDISPICONVIEW_ViewZoomOut     0x00000010
00241 #define  MDISPICONVIEW_ViewZoom1X      0x00000020
00242 #define  MDISPICONVIEW_ViewZoomToGroup 0x00000040
00243 #define  MDISPICONVIEW_ViewZoomToLayer 0x00000080
00244 #define  MDISPICONVIEW_ViewLocator     0x00000100
00245 #define  MDISPICONVIEW_ViewSnapshot    0x00000200
00246 #define  MDISPICONVIEW_ViewZoom2X      0x00000400
00247 #define  MDISPICONVIEW_ViewZoom3X      0x00000800
00248 #define  MDISPICONVIEW_ViewGeoLock     0x00001000
00249 #define  MDISPICONVIEW_ViewZoomToLoc   0x00002000
00250 #define  MDISPICONVIEW_ViewDefault     0x000030FF
00251 
00252 //===================================================================================================================
00253 
00254 //! Base class for tools attached to view.
00255 class GRE_TOOL {
00256    public:
00257 
00258       //! Standard constructor.
00259       GRE_TOOL (
00260          GRE_VIEW *view,                        //!< View to associate tool with
00261    #ifdef WIN32_NATIVE
00262          const char *toolname                   //!< Tool name string, cannot be NULL
00263    #else
00264          const char *toolname,                  //!< Tool name string, cannot be NULL
00265          const char *iconname,                  //!< Tool icon name
00266          const char *icongroup=NULL,            //!< Tool icon group
00267          const char *helpcode=NULL              //!< Help code for context-sensitive help
00268    #endif
00269          );
00270 
00271       //! Constructor with interface component IDs.
00272       GRE_TOOL (
00273          GRE_VIEW *view,                        //!< View to associate tool with
00274          ICID icidmenu,                         //!< Interface component ID for menu customization
00275          ICID icidicon,                         //!< Interface component ID for ToolBar customization
00276    #ifdef WIN32_NATIVE
00277          const char *toolname                   //!< Tool name string, cannot be NULL
00278    #else
00279          const char *toolname,                  //!< Tool name string, cannot be NULL
00280          const char *iconname,                  //!< Tool icon name
00281          const char *icongroup=NULL,            //!< Tool icon group
00282          const char *helpcode=NULL              //!< Help code for context-sensitive help
00283    #endif
00284          );
00285 
00286       virtual ~GRE_TOOL ();
00287 
00288       //! Activate this tool.
00289       void Activate (
00290          );
00291 
00292       //! Deactivate this tool.
00293       void Deactivate (
00294          );
00295 
00296    #ifdef X_NATIVE
00297       //! Get "help code" associated with tool.
00298       const char* GetHelpCode (
00299          ) const { return (m_HelpCode); }
00300 
00301       //! Get "icon group" for tool.
00302       const char* GetIconGroup (
00303          ) const { return (m_IconGroup); }
00304 
00305       //! Get "icon name" for tool.
00306       const char* GetIconName (
00307          ) const { return (m_IconName); }
00308    #endif
00309 
00310       //! Get tool name.
00311       const char* GetName (
00312          ) const { return (m_ToolName); }
00313 
00314       //! Get view this tool is attached to.
00315       GRE_VIEW* GetView (
00316          ) const { return (m_view); }
00317 
00318    #ifdef X_NATIVE
00319       //! Get widget for item on view's "Tool" menu.
00320       Widget GetMenuWidget (
00321          ) const { return (m_MenuWidget); }
00322 
00323       //! Get widget for button on view's toolbar.
00324       Widget GetToolbarWidget (
00325          ) const { return (m_ToolbarWidget); }
00326    #endif
00327 
00328       //! Determine if tool is currently disabled.
00329       bool IsDisabled (
00330          ) const { return (m_IsDisabled); }
00331 
00332       //! Determine if tool is implemented via script.
00333       //! This should only be overridden by the script tool.
00334       virtual bool IsScript (
00335          ) const;
00336 
00337    #ifdef X_NATIVE
00338       //! Setup BUTTONITEM for use in toolbar.
00339       void SetupButtonItem (
00340          BUTTONITEM& item
00341          );
00342 
00343       //! Setup MENUITEM to use on menu to activate tool.
00344       void SetupMenuItem (
00345          MENUITEM& item
00346          );
00347 
00348       //! Set sensitivity of tool menu item and button.
00349       void SetSensitive (
00350          bool sensitive = true
00351          );
00352    #endif
00353 
00354       //! Suspend tool (during screen update).
00355       //! @return true if suspended, false if was already suspended
00356       bool Suspend (
00357          );
00358 
00359       //! Resume tool (after screen update)
00360       void Resume (
00361          );
00362 
00363    protected:
00364 
00365       GRE_VIEW* m_view;                      //!< View tool is contained in
00366 
00367       void SetName (
00368          const MISTRING& name
00369          ) { m_ToolNameStr = name; }
00370 
00371    private:
00372       #ifndef GENERATING_DOXYGEN_OUTPUT
00373 
00374       enum TOOLSTATE {
00375          STATE_NotInitialized = 0,
00376          STATE_Inactive,
00377          STATE_Active,
00378          STATE_NoLayers,
00379          STATE_Suspended
00380          };
00381 
00382       char *m_ToolName;
00383    #ifdef X_NATIVE
00384       char *m_IconName;
00385       char *m_IconGroup;
00386       char *m_HelpCode;
00387    #endif
00388       TOOLSTATE m_state;
00389       bool m_IsDisabled;
00390       ICID m_icidmenu;                       //!< ID for tool menu item
00391       ICID m_icidicon;                       //!< ID for tool icon on ToolBar
00392    #ifdef X_NATIVE
00393       Widget m_MenuWidget;
00394       Widget m_ToolbarWidget;
00395    #endif
00396       MISTRING m_ToolNameStr;
00397 
00398       #endif // GENERATING_DOXYGEN_OUTPUT
00399 
00400       // Overridables
00401 
00402       virtual bool DoActivate () = 0;
00403       virtual void DoDeactivate () = 0;
00404       virtual bool DoInitialize ();
00405       virtual void DoSuspend ();
00406       virtual void DoResume ();
00407    };
00408 
00409 #ifndef GENERATING_DOXYGEN_OUTPUT
00410 //! Implement old-style tools.
00411 class _MDISPTOOL : public GRE_TOOL {
00412    public:
00413 
00414       void *privptr;
00415       GRE_VIEW *view;
00416 
00417       _MDISPTOOL (
00418          GRE_VIEW *view,
00419          const char *toolname,
00420          const char *iconname,
00421          const char *icongroup,
00422          const char *helpcode,
00423          int (*Init)(_MDISPTOOL*),
00424          int (*Stop)(_MDISPTOOL*),
00425          int (*Activate)(_MDISPTOOL*),
00426          int (*Deactivate)(_MDISPTOOL*),
00427          int (*Suspend)(_MDISPTOOL*),
00428          int (*Resume)(_MDISPTOOL*)
00429          );
00430 
00431       _MDISPTOOL (
00432          GRE_VIEW *view,
00433          const char *toolname,
00434          const char *iconname,
00435          const char *icongroup,
00436          const char *helpcode,
00437          ICID icidmenu,
00438          ICID icidicon,
00439          int (*Init)(_MDISPTOOL*),
00440          int (*Stop)(_MDISPTOOL*),
00441          int (*Activate)(_MDISPTOOL*),
00442          int (*Deactivate)(_MDISPTOOL*),
00443          int (*Suspend)(_MDISPTOOL*),
00444          int (*Resume)(_MDISPTOOL*)
00445          );
00446 
00447       virtual ~_MDISPTOOL ();
00448 
00449    private:
00450 
00451       virtual bool DoActivate ();
00452       virtual void DoDeactivate ();
00453       virtual bool DoInitialize ();
00454       virtual void DoSuspend ();
00455       virtual void DoResume ();
00456 
00457       int (*OldInit)(_MDISPTOOL*);
00458       int (*OldStop)(_MDISPTOOL*);
00459       int (*OldActivate)(_MDISPTOOL*);
00460       int (*OldDeactivate)(_MDISPTOOL*);
00461       int (*OldSuspend)(_MDISPTOOL*);
00462       int (*OldResume)(_MDISPTOOL*);
00463    };
00464 typedef _MDISPTOOL *MDISPTOOL;
00465 #endif // GENERATING_DOXYGEN_OUTPUT
00466 
00467 //===================================================================================================================
00468 
00469 class GRE_VIEW : public GRE_OBJECT {
00470 
00471    private:
00472       #ifndef GENERATING_DOXYGEN_OUTPUT
00473       class STATUSINFO;
00474       #endif // GENERATING_DOXYGEN_OUTPUT
00475 
00476    public:
00477 
00478       enum COORDSOURCE {
00479          COORDSOURCE_None,
00480          COORDSOURCE_Mouse,
00481          COORDSOURCE_ViewCenter,
00482          COORDSOURCE_Entered,
00483          COORDSOURCE_GPS,
00484          COORDSOURCE_COUNT
00485          };
00486 
00487       enum DATATIPSELECTION {
00488          DATATIPSELECTION_FromView =      0, //!< Use selection set by view
00489          DATATIPSELECTION_None =          1, //!< No DataTips
00490          DATATIPSELECTION_ActiveLayer =   2, //!< Select for active layer only
00491          DATATIPSELECTION_AllLayers =     3, //!< Select for all layers
00492          DATATIPSELECTION_AllVisible =    4  //!< Select for all 'visible' layers
00493          };
00494 
00495       // GRE_VIEW::GLOBALOPTIONS --------------------------------------------------------------------------
00496       //! Options which apply to all views in current process
00497       class GLOBALOPTIONS {
00498          public:
00499 
00500             class FORM;                         //!< Global options form, defined in <gre/uivwglob.h>
00501 
00502             GLOBALOPTIONS (                     //! Constructor
00503                );
00504 
00505             ~GLOBALOPTIONS () {}                //! Destructor
00506             
00507          #ifdef X_NATIVE
00508             Widget CreateEditForm (
00509                Widget parent,
00510                const Arg *arglist,
00511                int argcount
00512                );
00513          #endif
00514 
00515             bool GetAutoOpen3dViewCtrl () const { return (m_AutoOpen3dViewCtrl); }
00516             int GetAutoRedrawDelay () const { return (m_AutoRedrawDelay); }
00517             bool GetDefaultGeoLocked () const { return (m_DefaultGeoLocked); }
00518             bool GetDrawLayerOnUnhide () const { return (m_DrawLayerOnUnhide); }
00519             bool GetRedrawOnAnyChange () const { return (m_RedrawOnAnyChange); }
00520             bool GetUseAntialiasing() const {return (m_UseAntialiasing); }
00521             bool GetThinLineWidthHinting() const {return (m_ThinLineWidthHinting); }
00522             UINT16 GetRefreshInterval () const { return (m_RefreshInterval); }
00523             bool GetTrackCursor () const { return (m_TrackCursor); }
00524             const COLOR& GetTrackCursorColor () const { return (m_TrackCursorColor); }
00525             bool GetUpdateAfterDrawLayer () const { return (m_UpdateAfterDrawLayer); }
00526             bool GetZoomPanWaitForRMB () const { return (m_ZoomPanWaitForRMB); }
00527 
00528             void IniRead (                      //! Read settings from Ini file
00529                const char *inigroup = 0
00530                );
00531 
00532             void IniWrite (                     //! Write settings to Ini file
00533                const char *inigroup = 0
00534                ) const;
00535 
00536             void SetAutoOpen3dViewCtrl (bool AutoOpen3dViewCtrl) { m_AutoOpen3dViewCtrl = AutoOpen3dViewCtrl; }
00537             void SetAutoRedrawDelay (int AutoRedrawDelay) { m_AutoRedrawDelay = AutoRedrawDelay; }
00538             void SetUseAntialiasing (bool Antialias) { m_UseAntialiasing = Antialias; }
00539             void SetThinLineWidthHinting (bool hint) { m_ThinLineWidthHinting = hint; }
00540             void SetDefaultGeoLocked (bool DefaultGeoLocked) { m_DefaultGeoLocked = DefaultGeoLocked; }
00541             void SetDrawLayerOnUnhide (bool DrawLayerOnUnhide) { m_DrawLayerOnUnhide = DrawLayerOnUnhide; }
00542             void SetRedrawOnAnyChange (bool RedrawOnAnyChange) { m_RedrawOnAnyChange = RedrawOnAnyChange; }
00543             void SetRefreshInterval (UINT16 RefreshInterval) { m_RefreshInterval = RefreshInterval; }
00544             void SetTrackCursor (bool TrackCursor) { m_TrackCursor = TrackCursor; }
00545             void SetTrackCursorColor (const COLOR& TrackCursorColor) { m_TrackCursorColor = TrackCursorColor; }
00546             void SetUpdateAfterDrawLayer (bool UpdateAfterDrawLayer) { m_UpdateAfterDrawLayer = UpdateAfterDrawLayer; }
00547             void SetZoomPanWaitForRMB (bool ZoomPanWaitForRMB) { m_ZoomPanWaitForRMB = ZoomPanWaitForRMB; }
00548 
00549          private:
00550             #ifndef GENERATING_DOXYGEN_OUTPUT
00551             bool m_RedrawOnAnyChange;              //!< Redraw view when any change made to object in view
00552             bool m_DrawLayerOnUnhide;              //!< Redraw single layer when unhidden
00553             bool m_UseAntialiasing;                //!< Render lines as antialiased
00554             bool m_ThinLineWidthHinting;           //!< Show thin lines as transparent
00555             bool m_UpdateAfterDrawLayer;           //!< Update display after each layer is drawn
00556             bool m_EnableTransparency;             //!< Always enable transparency effects
00557             bool m_TrackCursor;                    //!< Track cursor between views
00558             bool m_ZoomPanWaitForRMB;              //!< Wait for right mouse button (or <Enter>) to activate zoom/pan tool
00559             bool m_AutoOpen3dViewCtrl;             //!< Automatically open viewpoint controls for 3D view
00560             bool m_DefaultGeoLocked;               //!< Default views to be geolocked
00561             UINT16 m_RefreshInterval;              //!< Refresh interval for updates while layer is being drawn
00562             COLOR m_TrackCursorColor;              //!< Color of "tracking" cursor
00563             int m_AutoRedrawDelay;                 //!< Delay for auto-redraw after change (milliseconds)
00564 
00565             friend class GRE_VIEW;
00566             #endif // GENERATING_DOXYGEN_OUTPUT
00567          }; // End of GRE_VIEW::GLOBALOPTIONS.
00568 
00569       class SAVESETTINGS : public SERIALIZABLE {
00570          public:
00571 
00572             SAVESETTINGS ();
00573             virtual ~SAVESETTINGS ();
00574 
00575             void IniRead (INIHANDLE handle, const char *inigroup);
00576             void IniWrite (INIHANDLE handle, const char *inigroup);
00577 
00578          private:
00579             #ifndef GENERATING_DOXYGEN_OUTPUT
00580 
00581             struct STATUSPOS {
00582                bool m_Show;
00583                UINT8 m_UnitCode;
00584                SPATREF::COORDREFSYS m_CoordRefSys;
00585                DEGTOSTRFLAGS m_LatLonFormat;
00586                static const SERIALIZER::ITEMDEF* SerialGetItemDef ();
00587                STATUSPOS ();
00588                };
00589 
00590             STATUSPOS m_StatusPos1;
00591             STATUSPOS m_StatusPos2;
00592 
00593             static const SERIALIZER::ITEMDEF* SerialGetItemDef ();
00594 
00595             //! Overrides from SERIALIZABLE.
00596             virtual ERRVALUE SerialRead (SERIALIZER& serializer);
00597             virtual ERRVALUE SerialWrite (SERIALIZER& serializer, const char *tagname = 0) const;
00598 
00599             friend class GRE_VIEW;
00600             friend class STATUSINFO;
00601             friend struct STATUSPOS;
00602             #endif // GENERATING_DOXYGEN_OUTPUT
00603          };
00604 
00605       // GRE_VIEW::VIEWPOSN -------------------------------------------------------------------------------
00606       //! Position of "view" relative to "display"
00607       class VIEWPOSN {
00608          public:
00609             MAT3X3 ViewToDisp, DispToView;         //!< Transformations between View and "Display"
00610             DPOINT2D centerpoint;                  //!< Point in "view coordinates" at center of view
00611             DPOINT2D zoom;                         //!< Zoom factor, full view = 1.0
00612             DPOINT2D usedzoom;                     //!< Actual zoom factor used after adjustments
00613             double MapScale;                       //!< Map scale for current view
00614          
00615             VIEWPOSN ();
00616          };
00617 
00618       MGD::DEVICE* gdisp;                    //!< Generic display handle for drawing
00619       MGD::CONTEXT *ggc;                     //!< Generic graphic context for drawing
00620 
00621       //! Edit global settings via dialog.
00622       //! @return true if settings changed, false if not.
00623       static bool EditGlobalSettings (
00624          MDLGPARENT dlgparent                   //!< Parent for dialog
00625          );
00626 
00627       //! Determine if layers should be drawn when unhidden
00628       static bool GetDrawLayerOnUnhide (
00629          ) { return (s_GlobalOptions.m_DrawLayerOnUnhide); }
00630 
00631       //! Retrieve first view of all views open
00632       static GRE_VIEW* GetFirst (
00633          ) { return (s_FirstView); }
00634 
00635       //! Return auto-redraw time delay.
00636       static int GetGlobalAutoRedrawDelay (
00637          ) { return (s_GlobalOptions.m_AutoRedrawDelay); };
00638 
00639       //! Get global options which apply to all views
00640       static const GLOBALOPTIONS& GetGlobalOptions (
00641          ) { InitStatic(); return (s_GlobalOptions); }
00642       
00643       //! Determine if should redraw views on any change
00644       static bool GetRedrawOnAnyChange (
00645          ) { return (s_GlobalOptions.m_RedrawOnAnyChange); }
00646 
00647       //! Get stereo viewing mode (for all views)
00648       static UINT8 GetStereoMode (
00649          ) { return (s_StereoParm.StereoMode); }
00650 
00651       //! Get stereo optical separation (for all views) in mm
00652       static double GetStereoOpticalSeparation (
00653          ) { return (s_StereoParm.OpticalSeparation); }
00654 
00655       //! Get stereo monitor separation (for all views) in mm
00656       static double GetStereoMonitorSeparation (
00657          ) { return (s_StereoParm.MonitorSeparation); }
00658 
00659       //! Determine if views should be updated to screen after each layer is rendered
00660       static bool GetUpdateAfterDrawLayer (
00661          ) { return (s_GlobalOptions.m_UpdateAfterDrawLayer); }
00662 
00663    
00664       //! Determine if should wait for right mouse-button before zoom/pan
00665       static bool GetZoomPanWaitForRMB (
00666          ) { return (s_GlobalOptions.m_ZoomPanWaitForRMB); }
00667 
00668       //! Determine if transparency is enabled
00669       static void SetEnableTransparency (
00670          bool EnableTransparency
00671          ) { s_GlobalOptions.m_EnableTransparency = EnableTransparency; }
00672 
00673       //! Set global auto-redraw delay.
00674       static void SetGlobalAutoRedrawDelay (
00675          int AutoRedrawDelay                    //!< Auto-redraw delay in milliseconds
00676          ) { s_GlobalOptions.m_AutoRedrawDelay = AutoRedrawDelay; }
00677 
00678       //! Set global options applying to all views.
00679       static void SetGlobalOptions (
00680          const GLOBALOPTIONS& options           //!< Options to set
00681          );
00682 
00683       //! Set global option for whether zoom/pan tools wait for right mouse button.
00684       static void SetGlobalZoomPanWaitForRMB (
00685          bool ZoomPanWaitForRMB
00686          ) { s_GlobalOptions.m_ZoomPanWaitForRMB = ZoomPanWaitForRMB; }
00687 
00688       //! Set option to redraw views on any change.
00689       static void SetRedrawOnAnyChange (
00690          bool RedrawOnAnyChange
00691          ) { s_GlobalOptions.m_RedrawOnAnyChange = RedrawOnAnyChange; }
00692 
00693       //! Set option for tracking cursor between views
00694       static void SetTrackCursor (
00695          bool TrackCursor
00696          ) { s_GlobalOptions.m_TrackCursor = TrackCursor; }
00697 
00698       //! Set option to update views after each layer is rendered
00699       static void SetUpdateAfterDrawLayer (
00700          bool UpdateAfterDrawLayer
00701          ) { s_GlobalOptions.m_UpdateAfterDrawLayer = UpdateAfterDrawLayer; }
00702 
00703       //! Method to install SML class, called by internal SML function.
00704       static void SMLClassInstall (
00705          SMLCONTEXT *context                    //!< SML context
00706          );
00707 
00708       //! Default constructor.
00709       //! Performs initialization only, must use one of the Create methods to actually
00710       //! create a usable GRE_VIEW.
00711       GRE_VIEW ();
00712 
00713       //! Destructor.
00714       virtual ~GRE_VIEW ();
00715 
00716    #ifdef X_NATIVE
00717       //! Add default "view" icons (previous, zoom in, zoom out, zoom 1X, etc).
00718       void AddDftViewIcons (
00719          UINT32 flags = 0                       //!< MDISPICONVIEW_... flags for desired icons
00720          );
00721 
00722       //! Add default "drawing" icons (redraw, skip, stop).
00723       void AddDrawIcons (
00724          UINT32 flags = 0                       //!< MDISPCREATE_ViewNoRedrawButton, MDISPCREATE_ViewNoSkipButton, MDISPCREATE_ViewNoCancelButton
00725          );
00726 
00727       //! Add icon buttons to icon row.
00728       Widget AddIconRowItems (
00729          const BUTTONITEM *items,               //!< Items to add
00730          const char *icongroup = 0,             //!< Icon group
00731          void *cbdata = 0,                      //!< Button item callback data if NULL in item
00732          void *userdata = 0                     //!< Button item userdata if NULL in item
00733          );
00734 
00735       //! Add icon pushbuttons to toolbar for MacroScripts.
00736       void AddMacroScriptIcons (
00737          );
00738 
00739       //! Add menu items for MacroScripts
00740       void AddMacroScriptMenuItems (
00741          );
00742 
00743       //! Add additional items to "Options" menu (must be added before menubar created)
00744       ERRVALUE AddMenuItemsOptions (
00745          const MENUITEM *newitems               //!< Array of items to add, terminated by null item
00746          );
00747 
00748       //! Add icon togglebuttons to toolbar for all defined tools.
00749       void AddToolIcons (
00750          bool addscripts = true                 //!< Add ToolScripts and MacroScripts to toolbar
00751          );
00752 
00753    #endif
00754 
00755       //! Attach LAYERVIEW instance.
00756       void AttachLayerView (
00757          GRE::LAYERVIEW *layerview
00758          );
00759 
00760       //! Cancel drawing of this view, usually done within callback.
00761       void CancelDrawing (
00762          int err = EUserCancel                  //!< Error value to set.
00763          ) { m_CancelDraw = err; }
00764 
00765       //! Clear view's message line.
00766       void ClearMessage (
00767          ) const;
00768 
00769       //! Clear previous view list.
00770       void ClearPreviousViewList (
00771          ) { m_PrevViewIndex = 0; return; }
00772 
00773       //! Determine if view contains specified layer.
00774       bool ContainsLayer (
00775          const GRE_LAYER *layer                 //!< Layer to check
00776          ) const;
00777 
00778       //! Convert between "screen units" using specified layer for scale.
00779       //! @return converted value.
00780       double ConvertScreenUnits (
00781          GRE_LAYER *layer,                      //!< Layer to use for scale
00782          double value,                          //!< Value to convert
00783          int iunits,                            //!< Input units (SCREENUNIT_...)
00784          int ounits                             //!< Output units (SCREENUNIT_...)
00785          );
00786 
00787       //! Default constructor.
00788       ERRVALUE Create (
00789          GRE_VIEWABLE *viewable,
00790          int iwidth,
00791          int iheight,
00792          UINT32 flags
00793          );
00794 
00795    #ifdef X_NATIVE
00796       //! Create menubar with specified set of items.
00797       //! @return RowColumn widget for menubar.
00798       Widget CreateMenuBar (
00799          Widget form,                           //!< Form to contain menubar
00800          MENUBARITEM *menubar,                  //!< Menu bar items
00801          UINT32 flags = 0                       //!< None presently defined
00802          );
00803    #endif
00804 
00805    #ifdef X_NATIVE
00806       //! Create menubar with default set of items.
00807       //! @return RowColumn widget for menubar.
00808       Widget CreateMenuBar (
00809          Widget form,                           //!< Form to contain menubar
00810          UINT32 flags = 0                       //!< None presently defined
00811          );
00812    #endif
00813 
00814    #ifdef X_NATIVE
00815       ERRVALUE CreateX (
00816          GRE_VIEWABLE *viewable,
00817          Widget pwidget,
00818          Arg *arglist,
00819          int argcount,
00820          int iwidth,
00821          int iheight,
00822          const char *sizefield,              //!< Field from .ini for retrieving window size
00823          UINT32 flags,
00824          const SAVESETTINGS *pSettings = 0
00825          );
00826    #endif
00827 
00828       //! Get DataTip selection mode.
00829       DATATIPSELECTION DataTipGetSelection (
00830          ) const { return (m_DataTipSelection); }
00831 
00832       //! Get DataTip string from specified point.
00833       ERRVALUE DataTipGetString (
00834          const DPOINT2D& point,                 //!< Point to obtain DataTip for
00835          MISTRING& string,                      //!< String to fill in, will be cleared first
00836          GRE_FIND_FLAGS findflags,              //!< GRE_FIND_ViewCoords or GRE_FIND_DisplayCoords
00837          int maxlines = 0,                      //!< Approximate maximum number of lines, 0 for no maximum
00838          DATATIPSELECTION selection = DATATIPSELECTION_FromView
00839          );
00840 
00841       //! Set DataTip selection mode.
00842       //! Does not affect currently visible DataTip if any.
00843       void DataTipSetSelection (
00844          DATATIPSELECTION selection             //!< Selection mode to set
00845          ) { m_DataTipSelection = selection; }
00846 
00847       //! Destroy LAYERVIEW instance for specified layer and this view.
00848       void DestroyLayerView (
00849          GRE_LAYER *layer
00850          );
00851 
00852       //! Detach view from viewable.
00853       //! Intended for use in viewable destructor only, other use may cause crash.
00854       void Detach (
00855          ) { m_viewable = 0; }
00856 
00857       //! Detach LAYERVIEW instance.
00858       void DetachLayerView (
00859          GRE::LAYERVIEW *layerview
00860          );
00861 
00862       //! Disable standard hotkeys for this view.
00863       void DisableHotKeys (
00864          ) { m_viewflags |= VIEWFLAG_DisableHotKeys; }
00865 
00866       //! Disable redraw for this view.
00867       void DisableRedraw (
00868          ) { ++m_DisableRedraw; }
00869 
00870       //! Draw the view.
00871       ERRVALUE Draw (
00872          );
00873 
00874       //! Draw view without refreshing other views.
00875       //! @return TRUE if color map changed, FALSE if not, < 0 if error.
00876       int DrawDirect (
00877          UINT32 drawflags = 0                   //!< MDISPDRAW_...
00878          );
00879 
00880       //! Draw specified group in view.
00881       ERRVALUE DrawGroup (
00882          GRE_GROUP *group,                      //!< Group, must be contained in view
00883          UINT32 drawflags                       //!< MDISPDRAW_...
00884          );
00885 
00886       //! Draw view if changed since last redraw.
00887       //! @return TRUE if did redraw, FALSE if not, < 0 if error.
00888       int DrawIfNeeded (
00889          );
00890 
00891       //! Draw view if auto-update is on.
00892       ERRVALUE DrawIfAutoUpdate (
00893          ) { if (s_GlobalOptions.m_RedrawOnAnyChange) return (Draw()); return (0); }
00894 
00895       //! Draw specified layer in view.
00896       ERRVALUE DrawLayer (
00897          GRE_LAYER *layer,                      //!< Layer to draw
00898          UINT32 drawflags = 0                   //!< Drawing flags, MDISPDRAW_...
00899          );
00900 
00901       //! Draw single element from specified layer.
00902       ERRVALUE DrawLayerElement (
00903          GRE_LAYER *layer,                      //!< Layer
00904          ELEMTYPE ElemType,                     //!< Element type
00905          INT32 ElemNum,                         //!< Element number
00906          UINT32 drawflags                       //!< Drawing flags, MDISPDRAW_...
00907          );
00908 
00909       //! Draw set of elements for specified layer.
00910       ERRVALUE DrawLayerElements (
00911          GRE_LAYER *layer,                      //!< Layer
00912          ELEMTYPE ElemType,                     //!< Element type
00913          const UINT8 *ElemSet,                  //!< Bit set of elements to draw, must be large enough for all elements of type
00914          UINT32 drawflags                       //!< Drawing flags, MDISPDRAW_...
00915          );
00916 
00917       //! Draw the margin lines.
00918       //! This function does nothing if not in hardcopy mode.
00919       void DrawMargins (
00920          MGD::CONTEXT* gc = 0    //!< context to draw with (default == back buffer)
00921          );
00922 
00923       //! Draw the page rectangle and margin lines
00924       //! This function does nothing if not in hardcopy mode.
00925       void DrawPage (
00926          MGD::CONTEXT* gc = 0    //!< context to draw with (default == back buffer)
00927          );
00928 
00929       //! Edit background, highlight, active colors for view.
00930       //! @return TRUE if colors changed, FALSE if not, < 0 if error.
00931       int EditColors (
00932          );
00933 
00934       //! Edit interface customization settings for views of this type.
00935       void EditCustomization (
00936          );
00937 
00938       //! Enable standard hotkeys for this view.
00939       void EnableHotKeys (
00940          ) { m_viewflags -= VIEWFLAG_DisableHotKeys; }
00941 
00942       //! Enable redraw of this view.
00943       void EnableRedraw (
00944          ) { if (m_DisableRedraw > 0) --m_DisableRedraw; }
00945 
00946       //! Find closest element to specified point in view.
00947       //! @return Element number, -1 if none found, < -1 if error.
00948       INT32 FindClosestLayerElement (
00949          GRE_LAYER *layer,                      //!< Layer to search
00950          int component,                         //!< Layer component index (not the element type)
00951          const DPOINT2D& point,                 //!< Point to search around
00952          double *distret,                       //!< Distance passed/returned, NULL if don't need
00953          GRE_FIND_FLAGS findflags               //!< GRE_FIND... flags
00954          );
00955 
00956       //! Find closest group to specified point in view.
00957       //! @return pointer to group or NULL if none found.
00958       GRE_GROUP* FindPointGroup (
00959          const DPOINT2D& point,                 //!< Point to search
00960          GRE_FIND_FLAGS findflags,              //!< Flags for searching
00961          const SPATREF::COORDREFSYS *pPointCRS = NULL    //!< CoordRefSys for point if GRE_FIND_MapCoords specified
00962          ) const;
00963 
00964       //! Return "active element" color.
00965       const COLOR& GetActiveColor (
00966          ) const { return (m_ActiveColor); }
00967 
00968       //! Return current active tool for view
00969       GRE_TOOL* GetActiveTool (
00970          ) const { return (m_ActiveTool); }
00971 
00972       bool GetAutoRedrawSolid (
00973          ) const { return (m_AutoRedrawSolid); }
00974 
00975       //! Get current background color for view.
00976       const COLOR& GetBackgroundColor (
00977          ) const { return (m_BackgroundColor); }
00978 
00979    #ifdef WIN32_NATIVE
00980       //! Get "color reference" for background color.
00981       COLOR32 GetBackgroundColorRef (
00982          ) const { return (static_cast<COLOR32>(GetBackgroundColor().GetColorRef())); }
00983    #endif
00984 
00985       //! Return name of background color for use in INI file.
00986       const char* GetBackgroundColorIniName (
00987          ) const;
00988 
00989       //! Get portion of canvas extents actually used based on zoom factor.
00990       void GetCanvasExtentsUsed (
00991          LRECT2D& extents,                      //!< Extents in 'canvas' coordinates returned
00992          bool UseNext = false                   //!< Use 'next' position instead of 'last' position
00993          ) const;
00994 
00995       //! Get clipping region for group in view.
00996       //! @return false if not in visible area, true if visible.
00997       bool GetClipRegion (
00998          GRE_GROUP *group,                      //!< Group, NULL for overall clipping region
00999          MGD::CONTEXT* ggc,                           //!< Graphic context, NULL to use view's
01000          REGION2D& ClipRegion                   //!< Clipping region returned
01001          );
01002 
01003    #ifdef X_NATIVE
01004       //! Get DrawingArea widget for view
01005       Widget GetDrawingArea (
01006          ) const { return (m_da); }
01007 
01008       //! Get "form" containing DrawingArea and LegendView.
01009       Widget GetDrawingAreaForm (
01010          ) const { return (m_lvswform); }
01011    #endif
01012 
01013       //! Get height (Y extent) of drawable area.
01014       //! @return Height in pixels.
01015       UINT32 GetDrawingAreaHeight (
01016          ) const { return (m_height); }
01017 
01018       //! Get width (X extent) of drawable area.
01019       //! @return Width in pixels.
01020       UINT32 GetDrawingAreaWidth (
01021          ) const { return (m_width); }
01022 
01023       //! Get MGD::CONTEXT for drawing to 'memory'.
01024       MGD::CONTEXT* GetDrawingContextMemory (
01025          ) const { return (m_mgc); }
01026 
01027    #ifdef X_NATIVE
01028       //! Get MGD::CONTEXT for drawing to 'pixmap' (X only).
01029       MGD::CONTEXT* GetDrawingContextPixmap (
01030          ) const { return (m_pgc); }
01031    #endif
01032 
01033    #ifdef X_NATIVE
01034       //! Get MGD::CONTEXT for drawing to 'screen' (X only).
01035       MGD::CONTEXT* GetDrawingContextScreen (
01036          ) const { return (m_sgc); }
01037    #endif
01038 
01039       //! Get MGD::DEVICE for drawing to 'memory'.
01040       MGD::DEVICE_MEM24* GetDrawingDeviceMemory (
01041          ) const { return (m_mdisp); }
01042 
01043    #ifdef X_NATIVE
01044       //! Get MGD::DEVICE_X for drawing to 'pixmap' (X only).
01045       MGD::DEVICE_X* GetDrawingDevicePixmap (
01046          ) const { return (m_pdisp); }
01047    #endif
01048 
01049    #ifdef X_NATIVE
01050       //! Get MGD::DEVICE_X for drawing to 'screen' (X only).
01051       MGD::DEVICE_X* GetDrawingDeviceScreen (
01052          ) const { return (m_sdisp); }
01053    #endif
01054 
01055    #ifdef X_NATIVE
01056       //! Get X Pixmap.
01057       //! @return 0 if none exists
01058       Pixmap GetDrawingPixmap (
01059          ) const { return (m_pixmap); }
01060    #endif
01061 
01062       //! Determine if only drawing wireframes for 3D layers.
01063       bool GetDrawWireframe3D (
01064          ) const { return (m_DrawWireframe); }
01065 
01066       //! Get full extents of viewable object including margins.
01067       const DRECT2D& GetFullExtents (
01068          ) const { return (m_FullExtents); }
01069 
01070    #ifdef X_NATIVE
01071       //! Get main "form" widget for this view.
01072       Widget GetForm (
01073          ) const { return (m_form); }
01074    #endif
01075 
01076       //! Get geo-lock settings for view.
01077       const GRE_GEOLOCKSETTINGS& GetGeoLock (
01078          ) const { return (m_GeoLock); }
01079 
01080       //! Return "highlight" color.
01081       const COLOR& GetHighlightColor (
01082          ) const { return (m_HighlightColor); }
01083 
01084    #ifdef X_NATIVE
01085       //! Get BUTTONITEM array for "Add" icons on toolbar.
01086       //! @return Cast of array to BUTTONITEM* for convenience.
01087       const BUTTONITEM* GetIconItemAdd (
01088          SIMPLE_ARRAY<BUTTONITEM>& items        //!< Array to contain items
01089          ) const;
01090 
01091       //! Get BUTTONITEM array for "Draw" icons on toolbar.
01092       //! @return Cast of array to BUTTONITEM* for convenience.
01093       const BUTTONITEM* GetIconItemDraw (
01094          SIMPLE_ARRAY<BUTTONITEM>& items,       //!< Array to contain items
01095          UINT32 flags = 0                       //!< MDISPCREATE_ViewNoRedrawButton, MDISPCREATE_ViewNoSkipButton, MDISPCREATE_ViewNoCancelButton
01096          ) const;
01097 
01098       //! Get BUTTONITEM array for "Tool" icons on toolbar.
01099       //! This does not include items for custom script tools.
01100       //! @return Cast of array to BUTTONITEM* for convenience.
01101       const BUTTONITEM* GetIconItemTool (
01102          SIMPLE_ARRAY<BUTTONITEM>& items        //!< Array to contain items
01103          ) const;
01104 
01105       //! Get BUTTONITEM array for "View" icons on toolbar.
01106       //! @return Cast of array to BUTTONITEM* for convenience.
01107       const BUTTONITEM* GetIconItemView (
01108          SIMPLE_ARRAY<BUTTONITEM>& items,       //!< Array to contain items
01109          UINT32 flags = MDISPICONVIEW_ViewDefault  //!< MDISPICONVIEW_...
01110          ) const;
01111 
01112       //! Get "view" toolbar icon.
01113       //! @return Icon widget or NULL if does not exist.
01114       Widget GetIconView (
01115          UINT32 flag                            //!< MDISPICONVIEW_...
01116          ) const;
01117    #endif
01118 
01119       const VIEWPOSN& GetLastPosn (
01120          ) const { return (m_LastPosn); }
01121    
01122       //! Get LAYERVIEW, constructing if does not exist.
01123       GRE::LAYERVIEW* GetLayerView (
01124          GRE_LAYER *layer
01125          );
01126 
01127    #ifdef X_NATIVE
01128       //! Get current panning margin.
01129       //! @return Margin in meters.
01130       double GetMargin (
01131          ) const { return (m_MarginMeters); }
01132 
01133       //! Get "HotKeys" menu items.
01134       //! @return Internal array
01135       const MENUITEM* GetMenuItemHotKeys (
01136          );
01137 
01138       //! Get "LegendView" menu items.
01139       //! @return Internal array
01140       const MENUITEM* GetMenuItemLegendView (
01141          );
01142 
01143       //! Get GPS menu items.
01144       //! @return Internal array
01145       const MENUITEM* GetMenuItemGPS (
01146          );
01147 
01148       //! Get "Options" menu items.
01149       //! @return Cast of array to MENUITEM* for convenience.
01150       const MENUITEM* GetMenuItemOptions (
01151          SIMPLE_ARRAY<MENUITEM>& items          //!< Array of items returned
01152          );
01153 
01154       //! Get MENUITEM array for "Tool" menu.
01155       //! @return Cast of array to MENUITEM* for convenience.
01156       const MENUITEM* GetMenuItemTool (
01157          SIMPLE_ARRAY<MENUITEM>& items          //!< Array of items returned
01158          ) const;
01159 
01160       //! Get "View" menu items.
01161       //! @return Cast of array to MENUITEM* for convenience.
01162       const MENUITEM* GetMenuItemView (
01163          SIMPLE_ARRAY<MENUITEM>& items          //!< Array of items returned
01164          );
01165 
01166       //! Get Widget for item on view's menubar.
01167       //! @return Widget or NULL if no matching item.
01168       Widget GetMenuWidget (
01169          const char* menupath                   //!< Path to menu item (eg. "/view/redraw")
01170          ) const { return (MxMenuItemWidget(m_menubar,menupath)); }
01171    #endif
01172 
01173       //! Get name of this view.
01174       void GetName (
01175          MISTRING& name                         //!< Name returned
01176          ) const;
01177 
01178    #ifndef NO_DEPRECATED
01179       //! Get name of this view.
01180       //! Name returned, free when done with
01181       DEPRECATED UNICODE* GetName (
01182          ) const;
01183    #endif
01184 
01185       bool GetNeedsRedraw (
01186          ) const { return (m_NeedsRedraw); }
01187 
01188       //! Get next view of same object as this view.
01189       //! @return next view or 0 if no more views.
01190       GRE_VIEW* GetNext (
01191          ) const;
01192 
01193       GRE_VIEW* GetNextOfAll (
01194          ) const { return (m_nextview); }
01195 
01196       const VIEWPOSN& GetNextPosn (
01197          ) const { return (m_NextPosn); }
01198 
01199       //! Get object this view is of.
01200       GRE_VIEWABLE* GetObject (
01201          ) const { return (m_viewable); }
01202 
01203       //! Get type of object being viewed.
01204       GRE_OBJTYPE GetObjectType (
01205          ) const { return ((m_viewable == 0) ? GRE_OBJTYPE_None : m_viewable->GetType()); }
01206 
01207    #ifdef X_NATIVE
01208       //! Get "overlay plane" graphic context.
01209       MGD::CONTEXT *GetOverlayGC (
01210          ) const { return (m_ogc); }
01211    #endif
01212 
01213    #ifdef X_NATIVE
01214       //! Get "overlay plane" X Pixmap.
01215       //! @return 0 if none exists
01216       Pixmap GetOverlayPixmap (
01217          ) const { return (m_opixmap); }
01218    #endif
01219 
01220       //! Get padding value in pixels for scrolling off edge of object extent.
01221       INT16 GetPadPixels (
01222          ) const { return (m_PadPixels); }
01223 
01224       //! Get current projection accuracy.
01225       GRE_PROJACCUR GetProjAccur (
01226          ) const { return (m_ProjAccur); }
01227 
01228       //! Get current scale at which view is rendered.
01229       ERRVALUE GetScale (
01230          double *xscale,                        //!< X scale returned
01231          double *yscale                         //!< Y scale returned
01232          );
01233 
01234       //! Get current scale at which view is rendered.
01235       double GetScale (
01236          ) { return (m_LastPosn.MapScale); }
01237 
01238       //! Get "size" of viewable object in "ground" meters.
01239       ERRVALUE GetSizeMeters (
01240          DPOINT2D& size                         //!< Size in meters returned
01241          ) const { return ((m_viewable != 0) ? m_viewable->GetSizeMeters(size) : 0); }
01242 
01243       MSTATUSCONTEXT GetStatusContext (
01244          ) const { return (m_StatusContext); }
01245 
01246       MSTATUSHANDLE GetStatusHandle (
01247          ) const { return (m_StatusHandle); }
01248 
01249       //! Get whether to use transparency to hint at sub pi