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/llworldmap.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/llworldmap.h')
-rw-r--r-- | linden/indra/newview/llworldmap.h | 211 |
1 files changed, 211 insertions, 0 deletions
diff --git a/linden/indra/newview/llworldmap.h b/linden/indra/newview/llworldmap.h new file mode 100644 index 0000000..9678b37 --- /dev/null +++ b/linden/indra/newview/llworldmap.h | |||
@@ -0,0 +1,211 @@ | |||
1 | /** | ||
2 | * @file llworldmap.h | ||
3 | * @brief Underlying data storage for the map of the entire world. | ||
4 | * | ||
5 | * Copyright (c) 2003-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 | #ifndef LL_LLWORLDMAP_H | ||
29 | #define LL_LLWORLDMAP_H | ||
30 | |||
31 | #include <map> | ||
32 | #include <string> | ||
33 | #include <vector> | ||
34 | |||
35 | #include "v3math.h" | ||
36 | #include "v3dmath.h" | ||
37 | #include "llframetimer.h" | ||
38 | #include "llmapimagetype.h" | ||
39 | #include "lluuid.h" | ||
40 | #include "llmemory.h" | ||
41 | #include "llviewerimage.h" | ||
42 | #include "lleventinfo.h" | ||
43 | #include "v3color.h" | ||
44 | |||
45 | class LLMessageSystem; | ||
46 | |||
47 | |||
48 | class LLItemInfo | ||
49 | { | ||
50 | public: | ||
51 | LLItemInfo(F32 global_x, F32 global_y, const std::string& name, LLUUID id, S32 extra = 0, S32 extra2 = 0); | ||
52 | |||
53 | std::string mName; | ||
54 | std::string mToolTip; | ||
55 | LLVector3d mPosGlobal; | ||
56 | LLUUID mID; | ||
57 | BOOL mSelected; | ||
58 | S32 mExtra; | ||
59 | S32 mExtra2; | ||
60 | U64 mRegionHandle; | ||
61 | }; | ||
62 | |||
63 | #define MAP_SIM_IMAGE_TYPES 3 | ||
64 | // 0 - Prim | ||
65 | // 1 - Terrain Only | ||
66 | // 2 - Overlay: Land For Sale | ||
67 | |||
68 | class LLSimInfo | ||
69 | { | ||
70 | public: | ||
71 | LLSimInfo(); | ||
72 | |||
73 | LLVector3d getGlobalPos(LLVector3 local_pos) const; | ||
74 | |||
75 | public: | ||
76 | U64 mHandle; | ||
77 | std::string mName; | ||
78 | |||
79 | F64 mAgentsUpdateTime; | ||
80 | BOOL mShowAgentLocations; // are agents visible? | ||
81 | |||
82 | U8 mAccess; | ||
83 | U32 mRegionFlags; | ||
84 | F32 mWaterHeight; | ||
85 | |||
86 | F32 mAlpha; | ||
87 | |||
88 | // Image ID for the current overlay mode. | ||
89 | LLUUID mMapImageID[MAP_SIM_IMAGE_TYPES]; | ||
90 | |||
91 | // Hold a reference to the currently displayed image. | ||
92 | LLPointer<LLViewerImage> mCurrentImage; | ||
93 | LLPointer<LLViewerImage> mOverlayImage; | ||
94 | }; | ||
95 | |||
96 | #define MAP_BLOCK_RES 256 | ||
97 | |||
98 | struct LLWorldMapLayer | ||
99 | { | ||
100 | BOOL LayerDefined; | ||
101 | LLPointer<LLViewerImage> LayerImage; | ||
102 | LLUUID LayerImageID; | ||
103 | LLRect LayerExtents; | ||
104 | |||
105 | LLWorldMapLayer() : LayerDefined(FALSE) { } | ||
106 | }; | ||
107 | |||
108 | |||
109 | class LLWorldMap | ||
110 | { | ||
111 | public: | ||
112 | LLWorldMap(); | ||
113 | ~LLWorldMap(); | ||
114 | |||
115 | // clears the list | ||
116 | void reset(); | ||
117 | |||
118 | // clear the visible items | ||
119 | void eraseItems(); | ||
120 | |||
121 | // Removes references to cached images | ||
122 | void clearImageRefs(); | ||
123 | |||
124 | // Clears the flags indicating that we've received sim infos | ||
125 | // Causes a re-request of the sim info without erasing extisting info | ||
126 | void clearSimFlags(); | ||
127 | |||
128 | // Returns simulator information, or NULL if out of range | ||
129 | LLSimInfo* simInfoFromHandle(const U64 handle); | ||
130 | |||
131 | // Returns simulator information, or NULL if out of range | ||
132 | LLSimInfo* simInfoFromPosGlobal(const LLVector3d& pos_global); | ||
133 | |||
134 | // Returns simulator information for named sim, or NULL if non-existent | ||
135 | LLSimInfo* simInfoFromName(const LLString& sim_name); | ||
136 | |||
137 | // Returns simulator name | ||
138 | LLString simNameFromPosGlobal(const LLVector3d& pos_global); | ||
139 | |||
140 | // Sets the current layer | ||
141 | void setCurrentLayer(S32 layer, bool request_layer = false); | ||
142 | |||
143 | void sendMapLayerRequest(); | ||
144 | void sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent = false); | ||
145 | void sendNamedRegionRequest(std::string region_name); | ||
146 | void sendItemRequest(U32 type, U64 handle = 0); | ||
147 | |||
148 | static void processMapLayerReply(LLMessageSystem*, void**); | ||
149 | static void processMapBlockReply(LLMessageSystem*, void**); | ||
150 | static void processMapItemReply(LLMessageSystem*, void**); | ||
151 | |||
152 | void dump(); | ||
153 | |||
154 | // Extend the bounding box of the list of simulators. Returns true | ||
155 | // if the extents changed. | ||
156 | BOOL extendAABB(U32 x_min, U32 y_min, U32 x_max, U32 y_max); | ||
157 | |||
158 | // build coverage maps for telehub region visualization | ||
159 | void updateTelehubCoverage(); | ||
160 | BOOL coveredByTelehub(LLSimInfo* infop); | ||
161 | |||
162 | // Bounds of the world, in meters | ||
163 | U32 getWorldWidth() const; | ||
164 | U32 getWorldHeight() const; | ||
165 | public: | ||
166 | // Map from region-handle to simulator info | ||
167 | typedef std::map<U64, LLSimInfo*> sim_info_map_t; | ||
168 | sim_info_map_t mSimInfoMap; | ||
169 | |||
170 | BOOL mIsTrackingUnknownLocation, mInvalidLocation, mIsTrackingDoubleClick, mIsTrackingCommit; | ||
171 | LLVector3d mUnknownLocation; | ||
172 | |||
173 | bool mRequestLandForSale; | ||
174 | |||
175 | typedef std::vector<LLItemInfo> item_info_list_t; | ||
176 | item_info_list_t mTelehubs; | ||
177 | item_info_list_t mInfohubs; | ||
178 | item_info_list_t mPGEvents; | ||
179 | item_info_list_t mMatureEvents; | ||
180 | item_info_list_t mPopular; | ||
181 | item_info_list_t mLandForSale; | ||
182 | item_info_list_t mClassifieds; | ||
183 | |||
184 | std::map<U64,S32> mNumAgents; | ||
185 | |||
186 | typedef std::map<U64, item_info_list_t> agent_list_map_t; | ||
187 | agent_list_map_t mAgentLocationsMap; | ||
188 | |||
189 | std::vector<LLWorldMapLayer> mMapLayers[MAP_SIM_IMAGE_TYPES]; | ||
190 | BOOL mMapLoaded[MAP_SIM_IMAGE_TYPES]; | ||
191 | BOOL * mMapBlockLoaded[MAP_SIM_IMAGE_TYPES]; | ||
192 | S32 mCurrentMap; | ||
193 | |||
194 | // AABB of the list of simulators | ||
195 | U32 mMinX; | ||
196 | U32 mMaxX; | ||
197 | U32 mMinY; | ||
198 | U32 mMaxY; | ||
199 | |||
200 | U8* mNeighborMap; | ||
201 | U8* mTelehubCoverageMap; | ||
202 | S32 mNeighborMapWidth; | ||
203 | S32 mNeighborMapHeight; | ||
204 | |||
205 | private: | ||
206 | LLTimer mRequestTimer; | ||
207 | }; | ||
208 | |||
209 | extern LLWorldMap* gWorldMap; | ||
210 | |||
211 | #endif | ||