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