diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llworldmapview.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/llworldmapview.h')
-rw-r--r-- | linden/indra/newview/llworldmapview.h | 192 |
1 files changed, 192 insertions, 0 deletions
diff --git a/linden/indra/newview/llworldmapview.h b/linden/indra/newview/llworldmapview.h new file mode 100644 index 0000000..5c18aab --- /dev/null +++ b/linden/indra/newview/llworldmapview.h | |||
@@ -0,0 +1,192 @@ | |||
1 | /** | ||
2 | * @file llworldmapview.h | ||
3 | * @brief LLWorldMapView class header file | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | // Global map of the world. | ||
29 | |||
30 | #ifndef LL_LLWORLDMAPVIEW_H | ||
31 | #define LL_LLWORLDMAPVIEW_H | ||
32 | |||
33 | #include "llpanel.h" | ||
34 | #include "v3math.h" | ||
35 | #include "v3dmath.h" | ||
36 | #include "v4color.h" | ||
37 | #include "llviewerimage.h" | ||
38 | #include "llmapimagetype.h" | ||
39 | #include "llworldmap.h" | ||
40 | |||
41 | class LLItemInfo; | ||
42 | |||
43 | const S32 DEFAULT_TRACKING_ARROW_SIZE = 16; | ||
44 | |||
45 | class LLColor4; | ||
46 | class LLColor4U; | ||
47 | class LLCoordGL; | ||
48 | class LLViewerImage; | ||
49 | class LLTextBox; | ||
50 | |||
51 | #define SIM_NULL_MAP_SCALE 2 // width in pixels, where we start drawing "null" sims | ||
52 | #define SIM_MAP_AGENT_SCALE 20 // width in pixels, where we start drawing agents | ||
53 | #define SIM_MAP_SCALE 90 // width in pixels, where we start drawing sim tiles | ||
54 | |||
55 | #define AGENTS_UPDATE_TIME 60.0 // in seconds | ||
56 | #define AGENT_COUNTS_UPDATE_TIME 60.0 // in seconds | ||
57 | |||
58 | class LLWorldMapView : public LLPanel | ||
59 | { | ||
60 | public: | ||
61 | static void initClass(); | ||
62 | static void cleanupClass(); | ||
63 | |||
64 | LLWorldMapView(const std::string& name, const LLRect& rect ); | ||
65 | virtual ~LLWorldMapView(); | ||
66 | |||
67 | virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); | ||
68 | |||
69 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); | ||
70 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); | ||
71 | virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); | ||
72 | virtual BOOL handleHover( S32 x, S32 y, MASK mask ); | ||
73 | /*virtual*/ BOOL handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen ); | ||
74 | |||
75 | bool checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track); | ||
76 | void handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); | ||
77 | |||
78 | // Scale and pan are shared across all instances. | ||
79 | static void setScale( F32 scale ); | ||
80 | static void translatePan( S32 delta_x, S32 delta_y ); | ||
81 | static void setPan( S32 x, S32 y, BOOL snap = TRUE ); | ||
82 | |||
83 | LLVector3 globalPosToView(const LLVector3d& global_pos); | ||
84 | LLVector3d viewPosToGlobal(S32 x,S32 y); | ||
85 | |||
86 | virtual void draw(); | ||
87 | void drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image); | ||
88 | void drawGenericItem(const LLItemInfo& item, LLPointer<LLViewerImage> image); | ||
89 | void drawAgents(); | ||
90 | void drawEvents(); | ||
91 | void drawDots(); | ||
92 | void drawFrustum(); | ||
93 | |||
94 | static void cleanupTextures(); | ||
95 | |||
96 | // Draw the tracking indicator, doing the right thing if it's outside | ||
97 | // the view area. | ||
98 | void drawTracking( const LLVector3d& pos_global, | ||
99 | const LLColor4& color, | ||
100 | BOOL draw_arrow = TRUE, LLString label = "", LLString tooltip = "", S32 vert_offset = 0); | ||
101 | static void drawTrackingArrow(const LLRect& view_rect, S32 x, S32 y, | ||
102 | const LLColor4& color, | ||
103 | S32 arrow_size = DEFAULT_TRACKING_ARROW_SIZE); | ||
104 | static void drawTrackingDot(F32 x_pixels, | ||
105 | F32 y_pixels, | ||
106 | const LLColor4& color, | ||
107 | F32 relative_z = 0.f, | ||
108 | F32 dot_radius = 3.f); | ||
109 | |||
110 | static void drawTrackingCircle( const LLRect& rect, S32 x, S32 y, | ||
111 | const LLColor4& color, | ||
112 | S32 min_thickness, | ||
113 | S32 overlap ); | ||
114 | static void drawAvatar( F32 x_pixels, | ||
115 | F32 y_pixels, | ||
116 | const LLColor4& color, | ||
117 | F32 relative_z = 0.f, | ||
118 | F32 dot_radius = 3.f); | ||
119 | static void drawIconName(F32 x_pixels, | ||
120 | F32 y_pixels, | ||
121 | const LLColor4& color, | ||
122 | const std::string& first_line, | ||
123 | const std::string& second_line); | ||
124 | |||
125 | // Prevents accidental double clicks | ||
126 | static void clearLastClick() { sHandledLastClick = FALSE; } | ||
127 | |||
128 | // if the view changes, download additional sim info as needed | ||
129 | void updateBlock(S32 block_x, S32 block_y); | ||
130 | void updateVisibleBlocks(); | ||
131 | |||
132 | protected: | ||
133 | void setDirectionPos( LLTextBox* text_box, F32 rotation ); | ||
134 | void updateDirections(); | ||
135 | |||
136 | public: | ||
137 | LLColor4 mBackgroundColor; | ||
138 | |||
139 | static LLPointer<LLViewerImage> sAvatarYouSmallImage; | ||
140 | static LLPointer<LLViewerImage> sAvatarSmallImage; | ||
141 | static LLPointer<LLViewerImage> sAvatarLargeImage; | ||
142 | static LLPointer<LLViewerImage> sTelehubImage; | ||
143 | static LLPointer<LLViewerImage> sInfohubImage; | ||
144 | static LLPointer<LLViewerImage> sHomeImage; | ||
145 | static LLPointer<LLViewerImage> sEventImage; | ||
146 | static LLPointer<LLViewerImage> sEventMatureImage; | ||
147 | static LLPointer<LLViewerImage> sTrackCircleImage; | ||
148 | static LLPointer<LLViewerImage> sTrackArrowImage; | ||
149 | static LLPointer<LLViewerImage> sClassifiedsImage; | ||
150 | static LLPointer<LLViewerImage> sPopularImage; | ||
151 | static LLPointer<LLViewerImage> sForSaleImage; | ||
152 | |||
153 | static F32 sThresholdA; | ||
154 | static F32 sThresholdB; | ||
155 | static F32 sPixelsPerMeter; // world meters to map pixels | ||
156 | |||
157 | BOOL mItemPicked; | ||
158 | |||
159 | static F32 sPanX; // in pixels | ||
160 | static F32 sPanY; // in pixels | ||
161 | static F32 sTargetPanX; // in pixels | ||
162 | static F32 sTargetPanY; // in pixels | ||
163 | static S32 sTrackingArrowX; | ||
164 | static S32 sTrackingArrowY; | ||
165 | |||
166 | // Are we mid-pan from a user drag? | ||
167 | BOOL mPanning; | ||
168 | S32 mMouseDownPanX; // value at start of drag | ||
169 | S32 mMouseDownPanY; // value at start of drag | ||
170 | S32 mMouseDownX; | ||
171 | S32 mMouseDownY; | ||
172 | |||
173 | LLTextBox* mTextBoxEast; | ||
174 | LLTextBox* mTextBoxNorth; | ||
175 | LLTextBox* mTextBoxWest; | ||
176 | LLTextBox* mTextBoxSouth; | ||
177 | |||
178 | LLTextBox* mTextBoxSouthEast; | ||
179 | LLTextBox* mTextBoxNorthEast; | ||
180 | LLTextBox* mTextBoxNorthWest; | ||
181 | LLTextBox* mTextBoxSouthWest; | ||
182 | LLTextBox* mTextBoxScrollHint; | ||
183 | |||
184 | static BOOL sHandledLastClick; | ||
185 | S32 mSelectIDStart; | ||
186 | F64 mAgentCountsUpdateTime; | ||
187 | |||
188 | typedef std::vector<U64> handle_list_t; | ||
189 | handle_list_t mVisibleRegions; // set every frame | ||
190 | }; | ||
191 | |||
192 | #endif | ||