llfloaterworldmap.h

Go to the documentation of this file.
00001 
00032 /*
00033  * Map of the entire world, with multiple background images,
00034  * avatar tracking, teleportation by double-click, etc.
00035  */
00036 
00037 #ifndef LL_LLFLOATERWORLDMAP_H
00038 #define LL_LLFLOATERWORLDMAP_H
00039 
00040 #include "lldarray.h"
00041 #include "llfloater.h"
00042 #include "llhudtext.h"
00043 #include "llmapimagetype.h"
00044 #include "lltracker.h"
00045 
00046 class LLEventInfo;
00047 class LLFriendObserver;
00048 class LLInventoryModel;
00049 class LLInventoryObserver;
00050 class LLItemInfo;
00051 class LLTabContainer;
00052 class LLWorldMapView;
00053 
00054 class LLFloaterWorldMap : public LLFloater
00055 {
00056 public:
00057         LLFloaterWorldMap();
00058         virtual ~LLFloaterWorldMap();
00059 
00060         static void *createWorldMapView(void* data);
00061         BOOL postBuild();
00062 
00063         /*virtual*/ void onClose(bool app_quitting);
00064 
00065         static void show(void*, BOOL center_on_target );
00066         static void reloadIcons(void*);
00067         static void toggle(void*);
00068         static void hide(void*); 
00069 
00070         /*virtual*/ void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE );
00071         /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask);
00072         /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
00073         /*virtual*/ void setVisible(BOOL visible);
00074         /*virtual*/ void draw();
00075 
00076         // methods for dealing with inventory. The observe() method is
00077         // called during program startup. inventoryUpdated() will be
00078         // called by a helper object when an interesting change has
00079         // occurred.
00080         void observeInventory(LLInventoryModel* inventory);
00081         void inventoryChanged();
00082 
00083         // Calls for dealing with changes in friendship
00084         void observeFriends();
00085         void friendsChanged();
00086 
00087         // tracking methods
00088         void                    trackAvatar( const LLUUID& avatar_id, const LLString& name );
00089         void                    trackLandmark( const LLUUID& landmark_item_id ); 
00090         void                    trackLocation(const LLVector3d& pos);
00091         void                    trackEvent(const LLItemInfo &event_info);
00092         void                    trackGenericItem(const LLItemInfo &item);
00093         void                    trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord);
00094 
00095         static const LLUUID& getHomeID() { return sHomeID; }
00096 
00097         // A z_attenuation of 0.0f collapses the distance into the X-Y plane
00098         F32                     getDistanceToDestination(const LLVector3d& pos_global, F32 z_attenuation = 0.5f) const;
00099 
00100         void                    clearLocationSelection(BOOL clear_ui = FALSE);
00101         void                    clearAvatarSelection(BOOL clear_ui = FALSE);
00102         void                    clearLandmarkSelection(BOOL clear_ui = FALSE);
00103 
00104         // Adjust the maximally zoomed out limit of the zoom slider so you can
00105         // see the whole world, plus a little.
00106         void                    adjustZoomSliderBounds();
00107 
00108         // Catch changes in the sim list
00109         void                    updateSims(bool found_null_sim);
00110 
00111         // teleport to the tracked item, if there is one
00112         void                    teleport();
00113 
00114 protected:
00115         static void             onPanBtn( void* userdata );
00116 
00117         static void             onGoHome(void* data);
00118 
00119         static void             onLandmarkComboPrearrange( LLUICtrl* ctrl, void* data );
00120         static void             onLandmarkComboCommit( LLUICtrl* ctrl, void* data );
00121         
00122         static void             onAvatarComboPrearrange( LLUICtrl* ctrl, void* data );
00123         static void             onAvatarComboCommit( LLUICtrl* ctrl, void* data );
00124 
00125         static void             onCommitBackground(void* data, bool from_click);
00126 
00127         static void             onClearBtn(void*);
00128         static void             onFlyBtn(void*);
00129         static void             onClickTeleportBtn(void*);
00130         static void             onShowTargetBtn(void*);
00131         static void             onShowAgentBtn(void*);
00132         static void             onCopySLURL(void*);
00133 
00134         static void onCheckEvents(LLUICtrl* ctrl, void*);
00135 
00136         void                    centerOnTarget(BOOL animate);
00137         void                    updateLocation();
00138 
00139         // fly to the tracked item, if there is one
00140         void                    fly();
00141 
00142         void                    buildLandmarkIDLists();
00143         static void             onGoToLandmarkDialog(S32 option,void* userdata);
00144         void                    flyToLandmark();
00145         void                    teleportToLandmark();
00146         void                    setLandmarkVisited();
00147 
00148         void                    buildAvatarIDList();
00149         void                    flyToAvatar();
00150         void                    teleportToAvatar();
00151 
00152         static void             updateSearchEnabled( LLUICtrl* ctrl, void* userdata );
00153         static void             onLocationCommit( void* userdata );
00154         static void             onCommitLocation( LLUICtrl* ctrl, void* userdata );
00155         static void             onCommitSearchResult( LLUICtrl* ctrl, void* userdata );
00156 
00157         void                    cacheLandmarkPosition();
00158 
00159 protected:
00160         LLTabContainerCommon*   mTabs;
00161 
00162         // Sets gMapScale, in pixels per region
00163         F32                                             mCurZoomVal;
00164         LLFrameTimer                    mZoomTimer;
00165 
00166         LLDynamicArray<LLUUID>  mLandmarkAssetIDList;
00167         LLDynamicArray<LLUUID>  mLandmarkItemIDList;
00168         BOOL                                    mHasLandmarkPosition;
00169 
00170         static const LLUUID     sHomeID;
00171 
00172         LLInventoryModel* mInventory;
00173         LLInventoryObserver* mInventoryObserver;
00174         LLFriendObserver* mFriendObserver;
00175 
00176         LLString                                mCompletingRegionName;
00177         LLString                                mLastRegionName;
00178         BOOL                                    mWaitingForTracker;
00179         BOOL                                    mExactMatch;
00180 
00181         BOOL                                    mIsClosing;
00182         BOOL                                    mSetToUserPosition;
00183 
00184         LLVector3d                              mTrackedLocation;
00185         LLTracker::ETrackingStatus mTrackedStatus;
00186         LLString                                mTrackedSimName;
00187         LLString                                mTrackedAvatarName;
00188         LLString                                mSLURL;
00189 };
00190 
00191 extern LLFloaterWorldMap* gFloaterWorldMap;
00192 
00193 #endif
00194 

Generated on Thu Jul 1 06:08:37 2010 for Second Life Viewer by  doxygen 1.4.7