diff options
Diffstat (limited to 'linden/indra/newview/llviewerparcelmgr.h')
-rw-r--r-- | linden/indra/newview/llviewerparcelmgr.h | 147 |
1 files changed, 92 insertions, 55 deletions
diff --git a/linden/indra/newview/llviewerparcelmgr.h b/linden/indra/newview/llviewerparcelmgr.h index 781ba15..c970611 100644 --- a/linden/indra/newview/llviewerparcelmgr.h +++ b/linden/indra/newview/llviewerparcelmgr.h | |||
@@ -68,15 +68,56 @@ public: | |||
68 | virtual void changed() = 0; | 68 | virtual void changed() = 0; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | class LLParcelSelection : public LLRefCount | ||
72 | { | ||
73 | friend class LLViewerParcelMgr; | ||
74 | |||
75 | public: | ||
76 | LLParcelSelection(LLParcel* parcel); | ||
77 | LLParcelSelection(); | ||
78 | |||
79 | ~LLParcelSelection(); | ||
80 | |||
81 | // this can return NULL at any time, as parcel selection | ||
82 | // might have been invalidated. | ||
83 | LLParcel* getParcel() { return mParcel; } | ||
84 | |||
85 | // Return the number of grid units that are owned by you within | ||
86 | // the selection (computed by server). | ||
87 | S32 getSelfCount() const { return mSelectedSelfCount; } | ||
88 | |||
89 | // Returns area that will actually be claimed in meters squared. | ||
90 | S32 getClaimableArea() const; | ||
91 | bool hasOthersSelected() const; | ||
92 | |||
93 | // Does the selection have multiple land owners in it? | ||
94 | BOOL getMultipleOwners() const; | ||
95 | |||
96 | // Is the entire parcel selected, or just a part? | ||
97 | BOOL getWholeParcelSelected() const; | ||
98 | |||
99 | protected: | ||
100 | void setParcel(LLParcel* parcel) { mParcel = parcel; } | ||
101 | |||
102 | protected: | ||
103 | |||
104 | LLParcel* mParcel; | ||
105 | BOOL mSelectedMultipleOwners; | ||
106 | BOOL mWholeParcelSelected; | ||
107 | S32 mSelectedSelfCount; | ||
108 | S32 mSelectedOtherCount; | ||
109 | S32 mSelectedPublicCount; | ||
110 | }; | ||
111 | |||
112 | typedef LLHandle<LLParcelSelection> LLParcelSelectionHandle; | ||
113 | |||
71 | class LLViewerParcelMgr | 114 | class LLViewerParcelMgr |
72 | { | 115 | { |
116 | |||
73 | public: | 117 | public: |
74 | LLViewerParcelMgr(); | 118 | LLViewerParcelMgr(); |
75 | ~LLViewerParcelMgr(); | 119 | ~LLViewerParcelMgr(); |
76 | 120 | ||
77 | void destroyGL(); | ||
78 | void restoreGL(); | ||
79 | |||
80 | BOOL selectionEmpty() const; | 121 | BOOL selectionEmpty() const; |
81 | F32 getSelectionWidth() const { return F32(mEastNorth.mdV[VX] - mWestSouth.mdV[VX]); } | 122 | F32 getSelectionWidth() const { return F32(mEastNorth.mdV[VX] - mWestSouth.mdV[VX]); } |
82 | F32 getSelectionHeight() const { return F32(mEastNorth.mdV[VY] - mWestSouth.mdV[VY]); } | 123 | F32 getSelectionHeight() const { return F32(mEastNorth.mdV[VY] - mWestSouth.mdV[VY]); } |
@@ -87,16 +128,6 @@ public: | |||
87 | 128 | ||
88 | void getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean); | 129 | void getPrimInfo(S32 &sw_max, S32 &sw_total, S32 &max, S32 &total, S32 &owner, S32 &group, S32 &other, S32& selected, F32 &parcel_object_bonus, S32 &other_clean); |
89 | 130 | ||
90 | // Does the selection have multiple land owners in it? | ||
91 | BOOL getMultipleOwners() const; | ||
92 | |||
93 | // Is the entire parcel selected, or just a part? | ||
94 | BOOL getWholeParcelSelected() const; | ||
95 | |||
96 | // Returns area that will actually be claimed in meters squared. | ||
97 | S32 getClaimableArea() const; | ||
98 | bool hasOthersSelected() const; | ||
99 | |||
100 | // Returns selected area | 131 | // Returns selected area |
101 | S32 getSelectedArea() const; | 132 | S32 getSelectedArea() const; |
102 | 133 | ||
@@ -115,18 +146,19 @@ public: | |||
115 | void selectCollisionParcel(); | 146 | void selectCollisionParcel(); |
116 | 147 | ||
117 | // Select the parcel at a specific point | 148 | // Select the parcel at a specific point |
118 | void selectParcelAt(const LLVector3d& pos_global); | 149 | LLHandle<LLParcelSelection> selectParcelAt(const LLVector3d& pos_global); |
119 | 150 | ||
120 | // Take the current rectangle select, and select the parcel contained | 151 | // Take the current rectangle select, and select the parcel contained |
121 | // within it. | 152 | // within it. |
122 | void selectParcelInRectangle(); | 153 | LLParcelSelectionHandle selectParcelInRectangle(); |
123 | 154 | ||
124 | // Select a piece of land | 155 | // Select a piece of land |
125 | void selectLand(const LLVector3d &corner1, const LLVector3d &corner2, | 156 | LLParcelSelectionHandle selectLand(const LLVector3d &corner1, const LLVector3d &corner2, |
126 | BOOL snap_to_parcel); | 157 | BOOL snap_to_parcel); |
127 | 158 | ||
128 | // Clear the selection, and stop drawing the highlight. | 159 | // Clear the selection, and stop drawing the highlight. |
129 | void deselectLand(); | 160 | void deselectLand(); |
161 | void deselectUnused(); | ||
130 | 162 | ||
131 | void addObserver(LLParcelObserver* observer); | 163 | void addObserver(LLParcelObserver* observer); |
132 | void removeObserver(LLParcelObserver* observer); | 164 | void removeObserver(LLParcelObserver* observer); |
@@ -141,15 +173,23 @@ public: | |||
141 | 173 | ||
142 | BOOL canHearSound(const LLVector3d &pos_global) const; | 174 | BOOL canHearSound(const LLVector3d &pos_global) const; |
143 | 175 | ||
144 | LLParcel *getSelectedParcel() const; | 176 | // Returns a reference counted pointer to current parcel selection. |
177 | // Selection does not change to reflect new selections made by user | ||
178 | // Use this when implementing a task UI that refers to a specific | ||
179 | // selection. | ||
180 | LLParcelSelectionHandle getParcelSelection() const; | ||
181 | |||
182 | // Returns a reference counted pointer to current parcel selection. | ||
183 | // Pointer tracks whatever the user has currently selected. | ||
184 | // Use this when implementing an inspector UI. | ||
185 | // http://en.wikipedia.org/wiki/Inspector_window | ||
186 | LLParcelSelectionHandle getFloatingParcelSelection() const; | ||
187 | |||
188 | //LLParcel *getParcelSelection() const; | ||
145 | LLParcel *getAgentParcel() const; | 189 | LLParcel *getAgentParcel() const; |
146 | 190 | ||
147 | BOOL inAgentParcel(const LLVector3d &pos_global) const; | 191 | BOOL inAgentParcel(const LLVector3d &pos_global) const; |
148 | 192 | ||
149 | // Return the number of grid units that are owned by you within | ||
150 | // the selection (computed by server). | ||
151 | S32 getSelfCount() const { return mSelectedSelfCount; } | ||
152 | |||
153 | // Returns a pointer only when it has valid data. | 193 | // Returns a pointer only when it has valid data. |
154 | LLParcel* getHoverParcel() const; | 194 | LLParcel* getHoverParcel() const; |
155 | 195 | ||
@@ -191,7 +231,7 @@ public: | |||
191 | // containing the southwest corner of the selection. | 231 | // containing the southwest corner of the selection. |
192 | // If want_reply_to_update, simulator will send back a ParcelProperties | 232 | // If want_reply_to_update, simulator will send back a ParcelProperties |
193 | // message. | 233 | // message. |
194 | void sendParcelPropertiesUpdate(LLParcel* parcel, BOOL want_reply_to_update); | 234 | void sendParcelPropertiesUpdate(LLParcel* parcel); |
195 | 235 | ||
196 | // Takes an Access List flag, like AL_ACCESS or AL_BAN | 236 | // Takes an Access List flag, like AL_ACCESS or AL_BAN |
197 | void sendParcelAccessListUpdate(U32 which); | 237 | void sendParcelAccessListUpdate(U32 which); |
@@ -284,26 +324,23 @@ protected: | |||
284 | //void finishClaim(BOOL user_to_user_sale, U32 join); | 324 | //void finishClaim(BOOL user_to_user_sale, U32 join); |
285 | 325 | ||
286 | private: | 326 | private: |
287 | BOOL mSelected; | 327 | BOOL mSelected; |
288 | BOOL mSelectedMultipleOwners; | ||
289 | BOOL mWholeParcelSelected; | ||
290 | S32 mSelectedSelfCount; | ||
291 | S32 mSelectedOtherCount; | ||
292 | S32 mSelectedPublicCount; | ||
293 | 328 | ||
294 | LLParcel *mParcel; // selected parcel info | 329 | LLParcel* mCurrentParcel; // selected parcel info |
295 | S32 mRequestResult; // result of last parcel request | 330 | LLParcelSelectionHandle mCurrentParcelSelection; |
296 | LLVector3d mWestSouth; | 331 | LLParcelSelectionHandle mFloatingParcelSelection; |
297 | LLVector3d mEastNorth; | 332 | S32 mRequestResult; // result of last parcel request |
298 | F32 mSelectedDwell; | 333 | LLVector3d mWestSouth; |
334 | LLVector3d mEastNorth; | ||
335 | F32 mSelectedDwell; | ||
299 | 336 | ||
300 | LLParcel *mAgentParcel; // info for parcel agent is in | 337 | LLParcel *mAgentParcel; // info for parcel agent is in |
301 | S32 mAgentParcelSequenceID; // incrementing counter to suppress out of order updates | 338 | S32 mAgentParcelSequenceID; // incrementing counter to suppress out of order updates |
302 | 339 | ||
303 | LLParcel* mHoverParcel; | 340 | LLParcel* mHoverParcel; |
304 | S32 mHoverRequestResult; | 341 | S32 mHoverRequestResult; |
305 | LLVector3d mHoverWestSouth; | 342 | LLVector3d mHoverWestSouth; |
306 | LLVector3d mHoverEastNorth; | 343 | LLVector3d mHoverEastNorth; |
307 | 344 | ||
308 | LLDynamicArray<LLParcelObserver*> mObservers; | 345 | LLDynamicArray<LLParcelObserver*> mObservers; |
309 | 346 | ||
@@ -312,30 +349,30 @@ private: | |||
312 | // we can represent edges of the grid. | 349 | // we can represent edges of the grid. |
313 | // WEST_MASK = draw west edge | 350 | // WEST_MASK = draw west edge |
314 | // SOUTH_MASK = draw south edge | 351 | // SOUTH_MASK = draw south edge |
315 | S32 mParcelsPerEdge; | 352 | S32 mParcelsPerEdge; |
316 | U8* mHighlightSegments; | 353 | U8* mHighlightSegments; |
317 | U8* mAgentParcelOverlay; | 354 | U8* mAgentParcelOverlay; |
318 | 355 | ||
319 | // Raw data buffer for unpacking parcel overlay chunks | 356 | // Raw data buffer for unpacking parcel overlay chunks |
320 | // Size = parcels_per_edge * parcels_per_edge / parcel_overlay_chunks | 357 | // Size = parcels_per_edge * parcels_per_edge / parcel_overlay_chunks |
321 | static U8* sPackedOverlay; | 358 | static U8* sPackedOverlay; |
322 | 359 | ||
323 | // Watch for pending collisions with a parcel you can't access. | 360 | // Watch for pending collisions with a parcel you can't access. |
324 | // If it's coming, draw the parcel's boundaries. | 361 | // If it's coming, draw the parcel's boundaries. |
325 | LLParcel* mCollisionParcel; | 362 | LLParcel* mCollisionParcel; |
326 | U8* mCollisionSegments; | 363 | U8* mCollisionSegments; |
327 | BOOL mRenderCollision; | 364 | BOOL mRenderCollision; |
328 | BOOL mRenderSelection; | 365 | BOOL mRenderSelection; |
329 | S32 mCollisionBanned; | 366 | S32 mCollisionBanned; |
330 | LLFrameTimer mCollisionTimer; | 367 | LLFrameTimer mCollisionTimer; |
331 | LLUUID mBlockedImageID; | 368 | LLUUID mBlockedImageID; |
332 | LLUUID mPassImageID; | 369 | LLUUID mPassImageID; |
333 | LLPointer<LLViewerImage> mBlockedImage; | 370 | LLPointer<LLViewerImage> mBlockedImage; |
334 | LLPointer<LLViewerImage> mPassImage; | 371 | LLPointer<LLViewerImage> mPassImage; |
335 | 372 | ||
336 | // Media | 373 | // Media |
337 | S32 mMediaParcelId; | 374 | S32 mMediaParcelId; |
338 | U64 mMediaRegionId; | 375 | U64 mMediaRegionId; |
339 | }; | 376 | }; |
340 | 377 | ||
341 | extern LLViewerParcelMgr *gParcelMgr; | 378 | extern LLViewerParcelMgr *gParcelMgr; |