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