diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-05-22 19:04:52 +0200 |
commit | 1b67dd855c41f5a0cda7ec2a68d98071986ca703 (patch) | |
tree | ab243607f74f78200787bba5b9b88f07ef1b966f /indra/newview/llworldmapview.h | |
parent | 6d6eabca44d08d5b97bfe3e941d2b9687c2246ea (diff) | |
parent | e1623bb276f83a43ce7a197e388720c05bdefe61 (diff) |
Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
# autobuild.xml
# indra/cmake/CMakeLists.txt
# indra/cmake/GoogleMock.cmake
# indra/llaudio/llaudioengine_fmodstudio.cpp
# indra/llaudio/llaudioengine_fmodstudio.h
# indra/llaudio/lllistener_fmodstudio.cpp
# indra/llaudio/lllistener_fmodstudio.h
# indra/llaudio/llstreamingaudio_fmodstudio.cpp
# indra/llaudio/llstreamingaudio_fmodstudio.h
# indra/llcharacter/llmultigesture.cpp
# indra/llcharacter/llmultigesture.h
# indra/llimage/llimage.cpp
# indra/llimage/llimagepng.cpp
# indra/llimage/llimageworker.cpp
# indra/llimage/tests/llimageworker_test.cpp
# indra/llmessage/tests/llmockhttpclient.h
# indra/llprimitive/llgltfmaterial.h
# indra/llrender/llfontfreetype.cpp
# indra/llui/llcombobox.cpp
# indra/llui/llfolderview.cpp
# indra/llui/llfolderviewmodel.h
# indra/llui/lllineeditor.cpp
# indra/llui/lllineeditor.h
# indra/llui/lltextbase.cpp
# indra/llui/lltextbase.h
# indra/llui/lltexteditor.cpp
# indra/llui/lltextvalidate.cpp
# indra/llui/lltextvalidate.h
# indra/llui/lluictrl.h
# indra/llui/llview.cpp
# indra/llwindow/llwindowmacosx.cpp
# indra/newview/app_settings/settings.xml
# indra/newview/llappearancemgr.cpp
# indra/newview/llappearancemgr.h
# indra/newview/llavatarpropertiesprocessor.cpp
# indra/newview/llavatarpropertiesprocessor.h
# indra/newview/llbreadcrumbview.cpp
# indra/newview/llbreadcrumbview.h
# indra/newview/llbreastmotion.cpp
# indra/newview/llbreastmotion.h
# indra/newview/llconversationmodel.h
# indra/newview/lldensityctrl.cpp
# indra/newview/lldensityctrl.h
# indra/newview/llface.inl
# indra/newview/llfloatereditsky.cpp
# indra/newview/llfloatereditwater.cpp
# indra/newview/llfloateremojipicker.h
# indra/newview/llfloaterimsessiontab.cpp
# indra/newview/llfloaterprofiletexture.cpp
# indra/newview/llfloaterprofiletexture.h
# indra/newview/llgesturemgr.cpp
# indra/newview/llgesturemgr.h
# indra/newview/llimpanel.cpp
# indra/newview/llimpanel.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llinventorybridge.h
# indra/newview/llinventoryclipboard.cpp
# indra/newview/llinventoryclipboard.h
# indra/newview/llinventoryfunctions.cpp
# indra/newview/llinventoryfunctions.h
# indra/newview/llinventorygallery.cpp
# indra/newview/lllistbrowser.cpp
# indra/newview/lllistbrowser.h
# indra/newview/llpanelobjectinventory.cpp
# indra/newview/llpanelprofile.cpp
# indra/newview/llpanelprofile.h
# indra/newview/llpreviewgesture.cpp
# indra/newview/llsavedsettingsglue.cpp
# indra/newview/llsavedsettingsglue.h
# indra/newview/lltooldraganddrop.cpp
# indra/newview/llurllineeditorctrl.cpp
# indra/newview/llvectorperfoptions.cpp
# indra/newview/llvectorperfoptions.h
# indra/newview/llviewerparceloverlay.cpp
# indra/newview/llviewertexlayer.cpp
# indra/newview/llviewertexturelist.cpp
# indra/newview/macmain.h
# indra/test/test.cpp
Diffstat (limited to 'indra/newview/llworldmapview.h')
-rw-r--r-- | indra/newview/llworldmapview.h | 440 |
1 files changed, 220 insertions, 220 deletions
diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 14458ec5a3..7206e135c4 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -1,220 +1,220 @@ -/** - * @file llworldmapview.h - * @brief LLWorldMapView class header file - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// View of the global map of the world - -// The data (model) for the global map (a singleton, unique to the application instance) is -// in LLWorldMap and is typically accessed using LLWorldMap::getInstance() - -#ifndef LL_LLWORLDMAPVIEW_H -#define LL_LLWORLDMAPVIEW_H - -#include "llpanel.h" -#include "llworldmap.h" -#include "v4color.h" - -const S32 DEFAULT_TRACKING_ARROW_SIZE = 16; - -class LLUUID; -class LLVector3d; -class LLVector3; -class LLTextBox; - - -class LLWorldMapView : public LLPanel -{ -public: - static void initClass(); - static void cleanupClass(); - - LLWorldMapView(); - virtual ~LLWorldMapView(); - - virtual bool postBuild(); - - virtual void reshape(S32 width, S32 height, bool called_from_parent = true ); - virtual void setVisible(bool visible); - - virtual bool handleMouseDown(S32 x, S32 y, MASK mask); - virtual bool handleMouseUp(S32 x, S32 y, MASK mask); - virtual bool handleDoubleClick( S32 x, S32 y, MASK mask ); - virtual bool handleHover( S32 x, S32 y, MASK mask ); - virtual bool handleToolTip( S32 x, S32 y, MASK mask); - - bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track); - void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); - - // Scale, aka zoom, is shared across all instances! (i.e. Terrain and Objects maps are always registered) - // Zoom is used for UI and will interpolate the map scale over multiple frames. - void zoom(F32 zoom); - void zoomWithPivot(F32 zoom, S32 x, S32 y); - F32 getZoom(); - // Scale is a linear scaling factor of in-world coordinates - F32 getScale(); - // setScaleSetting/getScaleSetting are for the default map setting on login - static void setScaleSetting(F32 scaleSetting); - static F32 getScaleSetting(); - // Pan is in pixels relative to the center of the map. - void translatePan( S32 delta_x, S32 delta_y ); - void setPan( S32 x, S32 y, bool snap = true ); - void setPanWithInterpTime(S32 x, S32 y, bool snap, F32 interp_time); - // Return true if the current scale level is above the threshold for accessing region info - bool showRegionInfo(); - - LLVector3 globalPosToView(const LLVector3d& global_pos); - LLVector3d viewPosToGlobal(S32 x,S32 y); - - virtual void draw(); - void drawGenericItems(const LLSimInfo::item_info_list_t& items, LLUIImagePtr image); - void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image); - void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white); - void drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color); - void drawAgents(); - void drawItems(); - void drawFrustum(); - void drawMipmap(S32 width, S32 height); - bool drawMipmapLevel(S32 width, S32 height, S32 level, bool load = true); - - static void cleanupTextures(); - - // Draw the tracking indicator, doing the right thing if it's outside - // the view area. - void drawTracking( const LLVector3d& pos_global, const LLColor4& color, bool draw_arrow = true, - const std::string& label = std::string(), const std::string& tooltip = std::string(), - S32 vert_offset = 0); - static void drawTrackingArrow(const LLRect& view_rect, S32 x, S32 y, - const LLColor4& color, - S32 arrow_size = DEFAULT_TRACKING_ARROW_SIZE); - static void drawTrackingDot(F32 x_pixels, - F32 y_pixels, - const LLColor4& color, - F32 relative_z = 0.f, - F32 dot_radius = 5.f); - - static void drawTrackingCircle( const LLRect& rect, S32 x, S32 y, - const LLColor4& color, - S32 min_thickness, - S32 overlap ); - static void drawAvatar( F32 x_pixels, - F32 y_pixels, - const LLColor4& color, - F32 relative_z = 0.f, - F32 dot_radius = 3.f, - bool reached_max_z = false); - static void drawIconName(F32 x_pixels, - F32 y_pixels, - const LLColor4& color, - const std::string& first_line, - const std::string& second_line); - - // Prevents accidental double clicks - static void clearLastClick() { sHandledLastClick = false; } - - // if the view changes, download additional sim info as needed - void updateVisibleBlocks(); - -protected: - void setDirectionPos( LLTextBox* text_box, F32 rotation ); - void updateDirections(); - -public: - LLColor4 mBackgroundColor; - - static LLUIImagePtr sAvatarSmallImage; - static LLUIImagePtr sAvatarYouImage; - static LLUIImagePtr sAvatarYouLargeImage; - static LLUIImagePtr sAvatarLevelImage; - static LLUIImagePtr sAvatarAboveImage; - static LLUIImagePtr sAvatarBelowImage; - static LLUIImagePtr sAvatarUnknownImage; - - static LLUIImagePtr sTelehubImage; - static LLUIImagePtr sInfohubImage; - static LLUIImagePtr sHomeImage; - static LLUIImagePtr sEventImage; - static LLUIImagePtr sEventMatureImage; - static LLUIImagePtr sEventAdultImage; - static LLUIImagePtr sTrackCircleImage; - static LLUIImagePtr sTrackArrowImage; - static LLUIImagePtr sClassifiedsImage; - static LLUIImagePtr sForSaleImage; - static LLUIImagePtr sForSaleAdultImage; - - bool mItemPicked; - - F32 mPanX; // in pixels - F32 mPanY; // in pixels - F32 mTargetPanX; // in pixels - F32 mTargetPanY; // in pixels - static S32 sTrackingArrowX; - static S32 sTrackingArrowY; - static bool sVisibleTilesLoaded; - - // Are we mid-pan from a user drag? - bool mPanning; - S32 mMouseDownPanX; // value at start of drag - S32 mMouseDownPanY; // value at start of drag - S32 mMouseDownX; - S32 mMouseDownY; - - LLTextBox* mTextBoxEast; - LLTextBox* mTextBoxNorth; - LLTextBox* mTextBoxWest; - LLTextBox* mTextBoxSouth; - - LLTextBox* mTextBoxSouthEast; - LLTextBox* mTextBoxNorthEast; - LLTextBox* mTextBoxNorthWest; - LLTextBox* mTextBoxSouthWest; - LLTextBox* mTextBoxScrollHint; - - static bool sHandledLastClick; - S32 mSelectIDStart; - - // Keep the list of regions that are displayed on screen. Avoids iterating through the whole region map after draw(). - typedef std::vector<U64> handle_list_t; - handle_list_t mVisibleRegions; // set every frame - - static std::map<std::string,std::string> sStringsMap; - -private: - void drawTileOutline(S32 level, F32 top, F32 left, F32 bottom, F32 right); - - void setScale(F32 scale, bool snap = true); - - static F32 scaleFromZoom(F32 zoom); - static F32 zoomFromScale(F32 scale); - - F32 mMapScale; - F32 mTargetMapScale; - static F32 sMapScaleSetting; - static LLVector2 sZoomPivot; - static LLFrameTimer sZoomTimer; - - F32 mMapIterpTime; -}; - -#endif +/**
+ * @file llworldmapview.h
+ * @brief LLWorldMapView class header file
+ *
+ * $LicenseInfo:firstyear=2001&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+// View of the global map of the world
+
+// The data (model) for the global map (a singleton, unique to the application instance) is
+// in LLWorldMap and is typically accessed using LLWorldMap::getInstance()
+
+#ifndef LL_LLWORLDMAPVIEW_H
+#define LL_LLWORLDMAPVIEW_H
+
+#include "llpanel.h"
+#include "llworldmap.h"
+#include "v4color.h"
+
+const S32 DEFAULT_TRACKING_ARROW_SIZE = 16;
+
+class LLUUID;
+class LLVector3d;
+class LLVector3;
+class LLTextBox;
+
+
+class LLWorldMapView : public LLPanel
+{
+public:
+ static void initClass();
+ static void cleanupClass();
+
+ LLWorldMapView();
+ virtual ~LLWorldMapView();
+
+ virtual bool postBuild();
+
+ virtual void reshape(S32 width, S32 height, bool called_from_parent = true );
+ virtual void setVisible(bool visible);
+
+ virtual bool handleMouseDown(S32 x, S32 y, MASK mask);
+ virtual bool handleMouseUp(S32 x, S32 y, MASK mask);
+ virtual bool handleDoubleClick( S32 x, S32 y, MASK mask );
+ virtual bool handleHover( S32 x, S32 y, MASK mask );
+ virtual bool handleToolTip( S32 x, S32 y, MASK mask);
+
+ bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track);
+ void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id);
+
+ // Scale, aka zoom, is shared across all instances! (i.e. Terrain and Objects maps are always registered)
+ // Zoom is used for UI and will interpolate the map scale over multiple frames.
+ void zoom(F32 zoom);
+ void zoomWithPivot(F32 zoom, S32 x, S32 y);
+ F32 getZoom();
+ // Scale is a linear scaling factor of in-world coordinates
+ F32 getScale();
+ // setScaleSetting/getScaleSetting are for the default map setting on login
+ static void setScaleSetting(F32 scaleSetting);
+ static F32 getScaleSetting();
+ // Pan is in pixels relative to the center of the map.
+ void translatePan( S32 delta_x, S32 delta_y );
+ void setPan( S32 x, S32 y, bool snap = true );
+ void setPanWithInterpTime(S32 x, S32 y, bool snap, F32 interp_time);
+ // Return true if the current scale level is above the threshold for accessing region info
+ bool showRegionInfo();
+
+ LLVector3 globalPosToView(const LLVector3d& global_pos);
+ LLVector3d viewPosToGlobal(S32 x,S32 y);
+
+ virtual void draw();
+ void drawGenericItems(const LLSimInfo::item_info_list_t& items, LLUIImagePtr image);
+ void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image);
+ void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white);
+ void drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color);
+ void drawAgents();
+ void drawItems();
+ void drawFrustum();
+ void drawMipmap(S32 width, S32 height);
+ bool drawMipmapLevel(S32 width, S32 height, S32 level, bool load = true);
+
+ static void cleanupTextures();
+
+ // Draw the tracking indicator, doing the right thing if it's outside
+ // the view area.
+ void drawTracking( const LLVector3d& pos_global, const LLColor4& color, bool draw_arrow = true,
+ const std::string& label = std::string(), const std::string& tooltip = std::string(),
+ S32 vert_offset = 0);
+ static void drawTrackingArrow(const LLRect& view_rect, S32 x, S32 y,
+ const LLColor4& color,
+ S32 arrow_size = DEFAULT_TRACKING_ARROW_SIZE);
+ static void drawTrackingDot(F32 x_pixels,
+ F32 y_pixels,
+ const LLColor4& color,
+ F32 relative_z = 0.f,
+ F32 dot_radius = 5.f);
+
+ static void drawTrackingCircle( const LLRect& rect, S32 x, S32 y,
+ const LLColor4& color,
+ S32 min_thickness,
+ S32 overlap );
+ static void drawAvatar( F32 x_pixels,
+ F32 y_pixels,
+ const LLColor4& color,
+ F32 relative_z = 0.f,
+ F32 dot_radius = 3.f,
+ bool reached_max_z = false);
+ static void drawIconName(F32 x_pixels,
+ F32 y_pixels,
+ const LLColor4& color,
+ const std::string& first_line,
+ const std::string& second_line);
+
+ // Prevents accidental double clicks
+ static void clearLastClick() { sHandledLastClick = false; }
+
+ // if the view changes, download additional sim info as needed
+ void updateVisibleBlocks();
+
+protected:
+ void setDirectionPos( LLTextBox* text_box, F32 rotation );
+ void updateDirections();
+
+public:
+ LLColor4 mBackgroundColor;
+
+ static LLUIImagePtr sAvatarSmallImage;
+ static LLUIImagePtr sAvatarYouImage;
+ static LLUIImagePtr sAvatarYouLargeImage;
+ static LLUIImagePtr sAvatarLevelImage;
+ static LLUIImagePtr sAvatarAboveImage;
+ static LLUIImagePtr sAvatarBelowImage;
+ static LLUIImagePtr sAvatarUnknownImage;
+
+ static LLUIImagePtr sTelehubImage;
+ static LLUIImagePtr sInfohubImage;
+ static LLUIImagePtr sHomeImage;
+ static LLUIImagePtr sEventImage;
+ static LLUIImagePtr sEventMatureImage;
+ static LLUIImagePtr sEventAdultImage;
+ static LLUIImagePtr sTrackCircleImage;
+ static LLUIImagePtr sTrackArrowImage;
+ static LLUIImagePtr sClassifiedsImage;
+ static LLUIImagePtr sForSaleImage;
+ static LLUIImagePtr sForSaleAdultImage;
+
+ bool mItemPicked;
+
+ F32 mPanX; // in pixels
+ F32 mPanY; // in pixels
+ F32 mTargetPanX; // in pixels
+ F32 mTargetPanY; // in pixels
+ static S32 sTrackingArrowX;
+ static S32 sTrackingArrowY;
+ static bool sVisibleTilesLoaded;
+
+ // Are we mid-pan from a user drag?
+ bool mPanning;
+ S32 mMouseDownPanX; // value at start of drag
+ S32 mMouseDownPanY; // value at start of drag
+ S32 mMouseDownX;
+ S32 mMouseDownY;
+
+ LLTextBox* mTextBoxEast;
+ LLTextBox* mTextBoxNorth;
+ LLTextBox* mTextBoxWest;
+ LLTextBox* mTextBoxSouth;
+
+ LLTextBox* mTextBoxSouthEast;
+ LLTextBox* mTextBoxNorthEast;
+ LLTextBox* mTextBoxNorthWest;
+ LLTextBox* mTextBoxSouthWest;
+ LLTextBox* mTextBoxScrollHint;
+
+ static bool sHandledLastClick;
+ S32 mSelectIDStart;
+
+ // Keep the list of regions that are displayed on screen. Avoids iterating through the whole region map after draw().
+ typedef std::vector<U64> handle_list_t;
+ handle_list_t mVisibleRegions; // set every frame
+
+ static std::map<std::string,std::string> sStringsMap;
+
+private:
+ void drawTileOutline(S32 level, F32 top, F32 left, F32 bottom, F32 right);
+
+ void setScale(F32 scale, bool snap = true);
+
+ static F32 scaleFromZoom(F32 zoom);
+ static F32 zoomFromScale(F32 scale);
+
+ F32 mMapScale;
+ F32 mTargetMapScale;
+ static F32 sMapScaleSetting;
+ static LLVector2 sZoomPivot;
+ static LLFrameTimer sZoomTimer;
+
+ F32 mMapIterpTime;
+};
+
+#endif
|