00001
00155 #ifndef INC_GRE_UIFORMVIEW_H
00156 #define INC_GRE_UIFORMVIEW_H
00157
00158 #ifndef INC_GRE_BASE_H
00159 #include <gre/base.h>
00160 #endif
00161
00162 #ifndef INC_MGUI_FORM_H
00163 #include <mgui/form.h>
00164 #endif
00165
00166 #ifndef INC_MI32_LATLONFM_H
00167 #include <mi32/latlonfm.h>
00168 #endif
00169
00170
00171 #ifndef GENERATING_DOXYGEN_OUTPUT
00172
00173 namespace MGUI {
00174 class CTRL_STATUSBAR;
00175 class CTRL_MAGNIFIER;
00176 class DLG_CUSTOMIZE;
00177 class MENU;
00178 class SHELL;
00179 }
00180 namespace SPATREF {
00181 class COORDREFSYS;
00182 }
00183 namespace GRE {
00184 namespace UI {
00185 class VIEW_CANVAS;
00186 }
00187 }
00188 namespace SML {
00189 union ARG;
00190 class CONTEXT;
00191 class FLAG;
00192 }
00193 namespace UOM {
00194 class UNIT;
00195 }
00196 #endif
00197
00198
00199 namespace GRE {
00200 namespace UI {
00201
00202
00203
00204 class FORM_VIEW : public MGUI::FORM_COMPOSITE {
00205 public:
00206
00208 enum CREATEFLAGS {
00209 CREATEFLAG_None = 0x00000000,
00210
00211 CREATEFLAG_3D = 0x00000001,
00212 CREATEFLAG_NoCallCreateCB = 0x00000002,
00213 CREATEFLAG_NoRenderSeparate = 0x00000004,
00214 CREATEFLAG_DisableDraw = 0x00000010,
00215 CREATEFLAG_IsLocator = 0x00000020,
00216 CREATEFLAG_AllowGPS = 0x00000040,
00217
00218 CREATEFLAG_NoDftViewButtons = 0x00000100,
00219 CREATEFLAG_NoDftAddButtons = 0x00000200,
00220 CREATEFLAG_NoDftMarkButtons = 0x00000400,
00221 CREATEFLAG_NoDftTools = 0x00000800,
00222 CREATEFLAG_NoDft3dButtons = 0x00001000,
00223 CREATEFLAG_NoToolScripts = 0x00002000,
00224 CREATEFLAG_NoDftButtons = 0x00004000,
00225 CREATEFLAG_NoSidebar = 0x00008000,
00226 CREATEFLAG_NoLegend = 0x00010000,
00227 CREATEFLAG_NoLocator = 0x00020000,
00228 CREATEFLAG_NoStatusBar = 0x00040000,
00229 CREATEFLAG_NoToolBar = 0x00080000,
00230 CREATEFLAG_No3dToolBar = 0x00100000,
00231 CREATEFLAG_NoMagnifier = 0x00200000,
00232 CREATEFLAG_AddLayerMgrButton = 0x00400000,
00233 CREATEFLAG_NoPlaces = 0x00800000,
00234 CREATEFLAG_NoScalebarGadget = 0x01000000,
00235 CREATEFLAG_NoZoomPane = 0x02000000,
00236 CREATEFLAG_NoReadSettingsIni = 0x04000000,
00237
00238 CREATEFLAG_AllowGeoLock = 0x10000000
00239 };
00240
00242 enum VIEWBTNS {
00243 VIEWBTN_Refresh = 0x00000001,
00244 VIEWBTN_Stop = 0x00000002,
00245 VIEWBTN_Full = 0x00000004,
00246 VIEWBTN_Previous = 0x00000008,
00247 VIEWBTN_ZoomIn = 0x00000020,
00248 VIEWBTN_ZoomOut = 0x00000040,
00249 VIEWBTN_ZoomToGroup = 0x00000080,
00250 VIEWBTN_ZoomToLayer = 0x00000100,
00251 VIEWBTN_ZoomToMaxDetail = 0x00000200,
00252 VIEWBTN_Zoom1X = 0x00000800,
00253 VIEWBTN_Zoom2X = 0x00001000,
00254 VIEWBTN_Zoom3X = 0x00002000,
00255 VIEWBTN_Locator = 0x00004000,
00256 VIEWBTN_Snapshot = 0x00008000,
00257 VIEWBTN_GeoLock = 0x00010000,
00258 VIEWBTN_SyncGeoViewer = 0x00020000,
00259 VIEWBTN_Stereo = 0x00040000,
00260 VIEWBTN_PrintSnapshot = 0x00080000,
00261 VIEWBTN_Default = VIEWBTN_Refresh | VIEWBTN_Stop | VIEWBTN_Full | VIEWBTN_Previous | VIEWBTN_ZoomIn | VIEWBTN_ZoomOut | VIEWBTN_ZoomToLayer | VIEWBTN_ZoomToGroup | VIEWBTN_ZoomToMaxDetail | VIEWBTN_Snapshot | VIEWBTN_GeoLock | VIEWBTN_SyncGeoViewer | VIEWBTN_Stereo
00262 };
00263
00264 enum COORDSOURCE {
00265 COORDSOURCE_None,
00266 COORDSOURCE_Pointer,
00267 COORDSOURCE_ViewCenter,
00268 COORDSOURCE_Entered,
00269 COORDSOURCE_GPS,
00270 COORDSOURCE_COUNT
00271 };
00272
00273 enum STATUSDISPLAY {
00274 STATUSDISPLAY_Default = 0x00,
00275 STATUSDISPLAY_UseLatLonIfNoSetCRS = 0x01,
00276 STATUSDISPLAY_HasZ = 0x02,
00277 };
00278
00280 enum SUBMENUS {
00281 SUBMENU_View = 0x01,
00282 SUBMENU_Tools = 0x02,
00283 SUBMENU_GPS = 0x04,
00284 SUBMENU_Options = 0x08,
00285 SUBMENU_Macros = 0x10,
00286 SUBMENU_HotKeys = 0x20,
00287 SUBMENUS_All = 0xFF
00288 };
00289
00290 class SETTINGS;
00291
00292 typedef fastdelegate::FastDelegate<void(UI::VIEW_CANVAS*)> DELEGATE_ADDTOOLS;
00293
00295 explicit FORM_VIEW (
00296 GRE::VIEWABLE *viewable
00297 );
00298
00300 virtual ~FORM_VIEW ();
00301
00303 void ClearMessage ();
00304
00306 void ClearPreviousViewList ();
00307
00309 ERRVALUE Create (
00310 MGUI::LAYOUT_PANE_BASE& PaneParent,
00311 INT32 CanvasWidth,
00312 INT32 CanvasHeight,
00313 const char *IniFieldBase = 0,
00314 CREATEFLAGS CreateFlags = CREATEFLAG_None,
00315 MGUI::LAYOUT_SIZEALIGN sizealign = MGUI::LAYOUT_SIZEALIGN_Expand,
00316 const SETTINGS *pSettings = 0
00317 );
00318
00321 void Create3dToolBar (
00322 MGUI::LAYOUT_PANE& PaneParent
00323 );
00324
00327 void CreatePaneToolBar (
00328 MGUI::LAYOUT_PANE& PaneParent
00329 );
00330
00333 void CreateStatusBar (
00334 MGUI::LAYOUT_PANE& PaneParent,
00335 const SETTINGS *pSettings = 0
00336 );
00337
00339 void DisableDraw (
00340 );
00341
00343 void DlgCustomizeAddMenuItems (
00344 MGUI::DLG_CUSTOMIZE& dlg
00345 );
00346
00348 void DlgCustomizeAddToolBarItems (
00349 MGUI::DLG_CUSTOMIZE& dlg
00350 );
00351
00354 int DlgEditColors (
00355 );
00356
00358 void DlgEditCustomization (
00359 );
00360
00362 ERRVALUE Draw (
00363 );
00364
00366 ERRVALUE DrawIfAutoUpdate (
00367 );
00368
00371 int DrawIfNeeded (
00372 );
00373
00375 void EnableDraw (
00376 );
00377
00379 MGUI::CTRL_MAGNIFIER* GetCanvasMagnifier (
00380 ) const;
00381
00383 MGUI::LAYOUT_PANE& GetPaneToolBar (
00384 );
00385
00387 bool GetRedrawOnAnyChange (
00388 ) const;
00389
00393 const SETTINGS& GetSettingsToSave (
00394 );
00395
00397 MGUI::CTRL_STATUSBAR& GetStatusBar (
00398 );
00399
00401 UI::VIEW_CANVAS* GetViewCanvas (
00402 ) const;
00403
00405 UI::VIEW_CANVAS* GetViewLocator (
00406 ) const;
00407
00409 GRE::VIEWABLE* GetViewable (
00410 ) const;
00411
00413 void LegendEnableRedraw (
00414 bool enable
00415 );
00416
00418 bool LegendIsVisible (
00419 bool CheckSidebar = true
00420 ) const;
00421
00423 void LegendRedraw (
00424 );
00425
00427 void LegendSetVisible (
00428 bool visible
00429 );
00430
00433 INT16 PlacesGetHeight (
00434 ) const;
00435
00437 bool PlacesIsVisible (
00438 bool CheckSidebar = true
00439 ) const;
00440
00442 void PlacesSetHeight (
00443 INT16 height
00444 );
00445
00448 void PlacesSetVisible (
00449 bool visible
00450 );
00451
00454 INT16 LocatorGetHeight (
00455 ) const;
00456
00458 bool LocatorIsVisible (
00459 bool CheckSidebar = true
00460 ) const;
00461
00463 void LocatorSetHeight (
00464 INT16 height
00465 );
00466
00469 void LocatorSetVisible (
00470 bool visible
00471 );
00472
00475 INT16 MagnifierGetHeight (
00476 ) const;
00477
00479 INT16 MagnifierGetZoom (
00480 ) const;
00481
00483 bool MagnifierIsVisible (
00484 bool CheckSidebar = true
00485 ) const;
00486
00488 void MagnifierSetHeight (
00489 INT16 height
00490 );
00491
00493 void MagnifierSetZoom (
00494 INT16 zoom
00495 );
00496
00499 void MagnifierSetVisible (
00500 bool visible
00501 );
00502
00504 void MenuAddItemsHotKeys (
00505 MGUI::MENU& submenu
00506 );
00507
00509 void MenuAddItemsView (
00510 MGUI::MENU& submenu
00511 );
00512
00514 void MenuAddSubMenuGPS (
00515 MGUI::MENU& menu
00516 );
00517
00519 void MenuAddSubMenuHotKeys (
00520 MGUI::MENU& menu
00521 );
00522
00524 void MenuAddSubMenuMacros (
00525 MGUI::MENU& menu
00526 );
00527
00529 void MenuAddSubMenuOptions (
00530 MGUI::MENU& menu
00531 );
00532
00534 void MenuAddSubMenuTools (
00535 MGUI::MENU& menu
00536 );
00537
00539 void MenuAddSubMenuView (
00540 MGUI::MENU& menu
00541 );
00542
00544 void MenuBarAddSubMenus (
00545 MGUI::MENU& MenuBar,
00546 SUBMENUS submenus
00547 );
00548
00550 void MenuBarCreate (
00551 MGUI::SHELL& shell,
00552 SUBMENUS submenus = SUBMENUS_All,
00553 bool AddSeparator = true
00554 );
00555
00559 MGUI::MENU& MenuGetOptions ();
00560
00562 ERRVALUE SaveSnapshotQuick (
00563 ) const;
00564
00566 ERRVALUE SaveSnapshotToRaster (
00567 ) const;
00568
00570 void SetDelegateAddTools (
00571 DELEGATE_ADDTOOLS DelegateAddTools
00572 );
00573
00575 void SetDrawWireframe3D (
00576 bool DrawWireframe3D
00577 );
00578
00580 void SetLayerListPos (
00581 GRE::LISTPOS ListPos
00582 );
00583
00585 void SetPreviousView ();
00586
00588 void SetRedrawOnAnyChange (
00589 bool RedrawOnAnyChange,
00590 bool redraw = true
00591 );
00592
00595 void SetViewBtnsToCreate (
00596 VIEWBTNS viewbtns
00597 );
00598
00601 INT16 SidebarGetWidth (
00602 ) const;
00603
00605 bool SidebarIsVisible (
00606 ) const;
00607
00609 void SidebarSetVisible (
00610 bool visible
00611 );
00612
00614 void SidebarSetWidth (
00615 INT16 width
00616 );
00617
00619 void StatusClearCoord (
00620 COORDSOURCE CoordSource = COORDSOURCE_None
00621 );
00622
00624 void StatusDisplayCoord (
00625 COORDSOURCE CoordSource,
00626 const DPOINT3D& point,
00627 const SPATREF::COORDREFSYS& PointCRS,
00628 const DPOINT3D *pPtConfidence,
00629 STATUSDISPLAY StatusDisplay,
00630 const UOM::UNIT *pUnitZ = 0
00631 );
00632
00633 COORDSOURCE StatusGetCoordSource () const;
00634
00636 bool StatusIsPosVisible (
00637 int idx = -1
00638 ) const;
00639
00641 void StatusSetCoordRefSys (
00642 unsigned idx,
00643 const SPATREF::COORDREFSYS& CoordRefSys
00644 );
00645
00647 void StatusSetCoordSource (
00648 COORDSOURCE CoordSource
00649 );
00650
00652 void StatusSetLatLonFormat (
00653 unsigned idx,
00654 DMSTYPE LatLonFormat
00655 );
00656
00658 void StatusSetPosVisible (
00659 unsigned idx,
00660 bool visible
00661 );
00662
00664 void StatusSetVisible (
00665 bool visible
00666 );
00667
00669 bool StereoIsViewIndicatorVisible () const;
00670
00672 void StereoSetViewIndicatorVisible (
00673 bool visible
00674 );
00675
00677 void ToolBarAdd3dButtons ();
00678
00680 void ToolBarAddAddButtons ();
00681
00683 void ToolBarAddMacroScriptButtons ();
00684
00686 void ToolBarAddMarkButtons ();
00687
00689 void ToolBarAddToolButtons ();
00690
00692 void ToolBarAddViewButtons (
00693 VIEWBTNS buttons = VIEWBTN_Default
00694 );
00695
00697 void UpdateMessage (
00698 const MISTRING& string
00699 ) const;
00700
00703 INT16 ZoomGetHeight (
00704 ) const;
00705
00707 bool ZoomIsVisible (
00708 bool CheckSidebar = true
00709 ) const;
00710
00712 void ZoomSetHeight (
00713 INT16 height
00714 );
00715
00718 void ZoomSetVisible (
00719 bool visible
00720 );
00721
00722 #ifndef GENERATING_DOXYGEN_OUTPUT
00723
00724 static FORM_VIEW* SML_CreateForm (
00725 int numargs,
00726 SML::ARG *args,
00727 SML::CONTEXT *context,
00728 CREATEFLAGS createflags = CREATEFLAG_None
00729 );
00730
00731 static SML::FLAG* SML_GetCreateFlags ();
00732
00733 #endif
00734
00735 private:
00736 #ifndef GENERATING_DOXYGEN_OUTPUT
00737 class PRIV;
00738 PRIV *m_pPriv;
00739
00740
00741 FORM_VIEW (const FORM_VIEW&);
00742 FORM_VIEW& operator= (const FORM_VIEW&);
00743 #endif
00744 };
00745
00746 #ifndef GENERATING_DOXYGEN_OUTPUT
00747 DEFINE_ENUM_OP_BITWISE(FORM_VIEW::CREATEFLAGS)
00748 DEFINE_ENUM_OP_BITWISE(FORM_VIEW::VIEWBTNS)
00749 DEFINE_ENUM_OP_BITWISE(FORM_VIEW::STATUSDISPLAY)
00750 DEFINE_ENUM_OP_BITWISE(FORM_VIEW::SUBMENUS)
00751 #endif
00752
00753
00754
00755 }
00756 }
00757
00758 #endif // INC_GRE_UIFORMVIEW_H