diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llselectmgr.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llselectmgr.cpp')
-rw-r--r-- | linden/indra/newview/llselectmgr.cpp | 178 |
1 files changed, 115 insertions, 63 deletions
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index bb0ccde..45a4ff5 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp | |||
@@ -39,9 +39,9 @@ | |||
39 | #include "lldbstrings.h" | 39 | #include "lldbstrings.h" |
40 | #include "lleconomy.h" | 40 | #include "lleconomy.h" |
41 | #include "llgl.h" | 41 | #include "llgl.h" |
42 | #include "llglimmediate.h" | ||
42 | #include "llpermissions.h" | 43 | #include "llpermissions.h" |
43 | #include "llpermissionsflags.h" | 44 | #include "llpermissionsflags.h" |
44 | #include "llptrskiplist.h" | ||
45 | #include "llundo.h" | 45 | #include "llundo.h" |
46 | #include "lluuid.h" | 46 | #include "lluuid.h" |
47 | #include "llvolume.h" | 47 | #include "llvolume.h" |
@@ -126,8 +126,8 @@ LLColor4 LLSelectMgr::sContextSilhouetteColor; | |||
126 | 126 | ||
127 | static LLObjectSelection *get_null_object_selection(); | 127 | static LLObjectSelection *get_null_object_selection(); |
128 | template<> | 128 | template<> |
129 | const LLHandle<LLObjectSelection>::NullFunc | 129 | const LLSafeHandle<LLObjectSelection>::NullFunc |
130 | LLHandle<LLObjectSelection>::sNullFunc = get_null_object_selection; | 130 | LLSafeHandle<LLObjectSelection>::sNullFunc = get_null_object_selection; |
131 | 131 | ||
132 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 132 | //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
133 | // struct LLDeRezInfo | 133 | // struct LLDeRezInfo |
@@ -612,6 +612,10 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s | |||
612 | msg->addU32Fast(_PREHASH_ObjectLocalID, (objects[i])->getLocalID()); | 612 | msg->addU32Fast(_PREHASH_ObjectLocalID, (objects[i])->getLocalID()); |
613 | select_count++; | 613 | select_count++; |
614 | 614 | ||
615 | // Zap the angular velocity, as the sim will set it to zero | ||
616 | objects[i]->setAngularVelocity( 0,0,0 ); | ||
617 | objects[i]->setVelocity( 0,0,0 ); | ||
618 | |||
615 | if(msg->isSendFull(NULL) || select_count >= MAX_OBJECTS_PER_PACKET) | 619 | if(msg->isSendFull(NULL) || select_count >= MAX_OBJECTS_PER_PACKET) |
616 | { | 620 | { |
617 | msg->sendReliable(regionp->getHost() ); | 621 | msg->sendReliable(regionp->getHost() ); |
@@ -635,6 +639,10 @@ void LLSelectMgr::deselectObjectOnly(LLViewerObject* object, BOOL send_to_sim) | |||
635 | if (!object) return; | 639 | if (!object) return; |
636 | if (!object->isSelected() ) return; | 640 | if (!object->isSelected() ) return; |
637 | 641 | ||
642 | // Zap the angular velocity, as the sim will set it to zero | ||
643 | object->setAngularVelocity( 0,0,0 ); | ||
644 | object->setVelocity( 0,0,0 ); | ||
645 | |||
638 | if (send_to_sim) | 646 | if (send_to_sim) |
639 | { | 647 | { |
640 | LLViewerRegion* region = object->getRegion(); | 648 | LLViewerRegion* region = object->getRegion(); |
@@ -1722,6 +1730,37 @@ void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string& | |||
1722 | getSelection()->applyToObjects(&sendfunc); | 1730 | getSelection()->applyToObjects(&sendfunc); |
1723 | } | 1731 | } |
1724 | 1732 | ||
1733 | void LLSelectMgr::selectionSetGlow(F32 glow) | ||
1734 | { | ||
1735 | struct f1 : public LLSelectedTEFunctor | ||
1736 | { | ||
1737 | F32 mGlow; | ||
1738 | f1(F32 glow) : mGlow(glow) {}; | ||
1739 | bool apply(LLViewerObject* object, S32 face) | ||
1740 | { | ||
1741 | if (object->permModify()) | ||
1742 | { | ||
1743 | // update viewer side color in anticipation of update from simulator | ||
1744 | object->setTEGlow(face, mGlow); | ||
1745 | } | ||
1746 | return true; | ||
1747 | } | ||
1748 | } func1(glow); | ||
1749 | mSelectedObjects->applyToTEs( &func1 ); | ||
1750 | |||
1751 | struct f2 : public LLSelectedObjectFunctor | ||
1752 | { | ||
1753 | virtual bool apply(LLViewerObject* object) | ||
1754 | { | ||
1755 | if (object->permModify()) | ||
1756 | { | ||
1757 | object->sendTEUpdate(); | ||
1758 | } | ||
1759 | return true; | ||
1760 | } | ||
1761 | } func2; | ||
1762 | mSelectedObjects->applyToObjects( &func2 ); | ||
1763 | } | ||
1725 | 1764 | ||
1726 | 1765 | ||
1727 | //----------------------------------------------------------------------------- | 1766 | //----------------------------------------------------------------------------- |
@@ -1744,6 +1783,26 @@ LLPermissions* LLSelectMgr::findObjectPermissions(const LLViewerObject* object) | |||
1744 | 1783 | ||
1745 | 1784 | ||
1746 | //----------------------------------------------------------------------------- | 1785 | //----------------------------------------------------------------------------- |
1786 | // selectionGetGlow() | ||
1787 | //----------------------------------------------------------------------------- | ||
1788 | BOOL LLSelectMgr::selectionGetGlow(F32 *glow) | ||
1789 | { | ||
1790 | BOOL identical; | ||
1791 | F32 lglow = 0.f; | ||
1792 | struct f1 : public LLSelectedTEGetFunctor<F32> | ||
1793 | { | ||
1794 | F32 get(LLViewerObject* object, S32 face) | ||
1795 | { | ||
1796 | return object->getTE(face)->getGlow(); | ||
1797 | } | ||
1798 | } func; | ||
1799 | identical = mSelectedObjects->getSelectedTEValue( &func, lglow ); | ||
1800 | |||
1801 | *glow = lglow; | ||
1802 | return identical; | ||
1803 | } | ||
1804 | |||
1805 | //----------------------------------------------------------------------------- | ||
1747 | // selectionSetMaterial() | 1806 | // selectionSetMaterial() |
1748 | //----------------------------------------------------------------------------- | 1807 | //----------------------------------------------------------------------------- |
1749 | void LLSelectMgr::selectionSetMaterial(U8 material) | 1808 | void LLSelectMgr::selectionSetMaterial(U8 material) |
@@ -2264,12 +2323,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, LLString& name) | |||
2264 | 2323 | ||
2265 | if (identical) | 2324 | if (identical) |
2266 | { | 2325 | { |
2267 | char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 2326 | gCacheName->getFullName(first_id, name); |
2268 | char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | ||
2269 | gCacheName->getName(first_id, firstname, lastname); | ||
2270 | name.assign( firstname ); | ||
2271 | name.append( " " ); | ||
2272 | name.append( lastname ); | ||
2273 | } | 2327 | } |
2274 | else | 2328 | else |
2275 | { | 2329 | { |
@@ -2332,12 +2386,7 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, LLString& name) | |||
2332 | } | 2386 | } |
2333 | else if(!public_owner) | 2387 | else if(!public_owner) |
2334 | { | 2388 | { |
2335 | char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 2389 | gCacheName->getFullName(first_id, name); |
2336 | char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | ||
2337 | gCacheName->getName(first_id, firstname, lastname); | ||
2338 | name.assign( firstname ); | ||
2339 | name.append( " " ); | ||
2340 | name.append( lastname ); | ||
2341 | } | 2390 | } |
2342 | else | 2391 | else |
2343 | { | 2392 | { |
@@ -2397,12 +2446,7 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, LLString& name) | |||
2397 | BOOL public_owner = (first_id.isNull()); | 2446 | BOOL public_owner = (first_id.isNull()); |
2398 | if(!public_owner) | 2447 | if(!public_owner) |
2399 | { | 2448 | { |
2400 | char firstname[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 2449 | gCacheName->getFullName(first_id, name); |
2401 | char lastname[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | ||
2402 | gCacheName->getName(first_id, firstname, lastname); | ||
2403 | name.assign( firstname ); | ||
2404 | name.append( " " ); | ||
2405 | name.append( lastname ); | ||
2406 | } | 2450 | } |
2407 | else | 2451 | else |
2408 | { | 2452 | { |
@@ -3276,6 +3320,15 @@ void LLSelectMgr::deselectAll() | |||
3276 | return; | 3320 | return; |
3277 | } | 3321 | } |
3278 | 3322 | ||
3323 | // Zap the angular velocity, as the sim will set it to zero | ||
3324 | for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); | ||
3325 | iter != mSelectedObjects->end(); iter++ ) | ||
3326 | { | ||
3327 | LLViewerObject *objectp = (*iter)->getObject(); | ||
3328 | objectp->setAngularVelocity( 0,0,0 ); | ||
3329 | objectp->setVelocity( 0,0,0 ); | ||
3330 | } | ||
3331 | |||
3279 | sendListToRegions( | 3332 | sendListToRegions( |
3280 | "ObjectDeselect", | 3333 | "ObjectDeselect", |
3281 | packAgentAndSessionID, | 3334 | packAgentAndSessionID, |
@@ -3429,7 +3482,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point) | |||
3429 | BOOL build_mode = gToolMgr->inEdit(); | 3482 | BOOL build_mode = gToolMgr->inEdit(); |
3430 | // Special case: Attach to default location for this object. | 3483 | // Special case: Attach to default location for this object. |
3431 | if (0 == attachment_point || | 3484 | if (0 == attachment_point || |
3432 | gAgent.getAvatarObject()->mAttachmentPoints.getIfThere(attachment_point)) | 3485 | get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) |
3433 | { | 3486 | { |
3434 | sendListToRegions( | 3487 | sendListToRegions( |
3435 | "ObjectAttach", | 3488 | "ObjectAttach", |
@@ -4342,12 +4395,8 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use | |||
4342 | LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type); | 4395 | LLFloaterReporter *reporterp = LLFloaterReporter::getReporter(report_type); |
4343 | if (reporterp) | 4396 | if (reporterp) |
4344 | { | 4397 | { |
4345 | char first_name[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 4398 | std::string fullname; |
4346 | char last_name[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */ | 4399 | gCacheName->getFullName(owner_id, fullname); |
4347 | gCacheName->getName(owner_id, first_name, last_name); | ||
4348 | LLString fullname(first_name); | ||
4349 | fullname.append(" "); | ||
4350 | fullname.append(last_name); | ||
4351 | reporterp->setPickedObjectProperties(name, fullname, owner_id); | 4400 | reporterp->setPickedObjectProperties(name, fullname, owner_id); |
4352 | } | 4401 | } |
4353 | } | 4402 | } |
@@ -5163,7 +5212,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5163 | 5212 | ||
5164 | if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) | 5213 | if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) |
5165 | { | 5214 | { |
5166 | glBlendFunc(GL_SRC_COLOR, GL_ONE); | 5215 | gGL.flush(); |
5216 | gGL.blendFunc(GL_SRC_COLOR, GL_ONE); | ||
5167 | LLGLEnable fog(GL_FOG); | 5217 | LLGLEnable fog(GL_FOG); |
5168 | glFogi(GL_FOG_MODE, GL_LINEAR); | 5218 | glFogi(GL_FOG_MODE, GL_LINEAR); |
5169 | float d = (gCamera->getPointOfInterest()-gCamera->getOrigin()).magVec(); | 5219 | float d = (gCamera->getPointOfInterest()-gCamera->getOrigin()).magVec(); |
@@ -5174,7 +5224,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5174 | 5224 | ||
5175 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); | 5225 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); |
5176 | glAlphaFunc(GL_GREATER, 0.01f); | 5226 | glAlphaFunc(GL_GREATER, 0.01f); |
5177 | glBegin(GL_LINES); | 5227 | gGL.begin(GL_LINES); |
5178 | { | 5228 | { |
5179 | S32 i = 0; | 5229 | S32 i = 0; |
5180 | for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) | 5230 | for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) |
@@ -5183,18 +5233,19 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5183 | { | 5233 | { |
5184 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; | 5234 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; |
5185 | 5235 | ||
5186 | glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); | 5236 | gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); |
5187 | glTexCoord2f( u_coord, v_coord ); | 5237 | gGL.texCoord2f( u_coord, v_coord ); |
5188 | glVertex3fv( mSilhouetteVertices[i].mV ); | 5238 | gGL.vertex3fv( mSilhouetteVertices[i].mV ); |
5189 | } | 5239 | } |
5190 | } | 5240 | } |
5191 | } | 5241 | } |
5192 | glEnd(); | 5242 | gGL.end(); |
5193 | u_coord = fmod(animationTime * LLSelectMgr::sHighlightUAnim, 1.f); | 5243 | u_coord = fmod(animationTime * LLSelectMgr::sHighlightUAnim, 1.f); |
5194 | } | 5244 | } |
5195 | 5245 | ||
5196 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 5246 | gGL.flush(); |
5197 | glBegin(GL_TRIANGLES); | 5247 | gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
5248 | gGL.begin(GL_TRIANGLES); | ||
5198 | { | 5249 | { |
5199 | S32 i = 0; | 5250 | S32 i = 0; |
5200 | for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) | 5251 | for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) |
@@ -5210,15 +5261,15 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5210 | LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; | 5261 | LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; |
5211 | vert += mSilhouetteVertices[i]; | 5262 | vert += mSilhouetteVertices[i]; |
5212 | 5263 | ||
5213 | glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); | 5264 | gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); |
5214 | glTexCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); | 5265 | gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); |
5215 | glVertex3fv( vert.mV ); | 5266 | gGL.vertex3fv( vert.mV ); |
5216 | 5267 | ||
5217 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; | 5268 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; |
5218 | 5269 | ||
5219 | glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); | 5270 | gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); |
5220 | glTexCoord2f( u_coord, v_coord ); | 5271 | gGL.texCoord2f( u_coord, v_coord ); |
5221 | glVertex3fv( mSilhouetteVertices[i].mV ); | 5272 | gGL.vertex3fv( mSilhouetteVertices[i].mV ); |
5222 | 5273 | ||
5223 | v = mSilhouetteVertices[i]; | 5274 | v = mSilhouetteVertices[i]; |
5224 | t = LLVector2(u_coord, v_coord); | 5275 | t = LLVector2(u_coord, v_coord); |
@@ -5227,24 +5278,24 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) | |||
5227 | LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; | 5278 | LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; |
5228 | vert += mSilhouetteVertices[i]; | 5279 | vert += mSilhouetteVertices[i]; |
5229 | 5280 | ||
5230 | glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); | 5281 | gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); |
5231 | glTexCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); | 5282 | gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); |
5232 | glVertex3fv( vert.mV ); | 5283 | gGL.vertex3fv( vert.mV ); |
5233 | glVertex3fv( vert.mV ); | 5284 | gGL.vertex3fv( vert.mV ); |
5234 | 5285 | ||
5235 | glTexCoord2fv(t.mV); | 5286 | gGL.texCoord2fv(t.mV); |
5236 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; | 5287 | u_coord += u_divisor * LLSelectMgr::sHighlightUScale; |
5237 | glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); | 5288 | gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); |
5238 | glVertex3fv(v.mV); | 5289 | gGL.vertex3fv(v.mV); |
5239 | glTexCoord2f( u_coord, v_coord ); | 5290 | gGL.texCoord2f( u_coord, v_coord ); |
5240 | glVertex3fv( mSilhouetteVertices[i].mV ); | 5291 | gGL.vertex3fv( mSilhouetteVertices[i].mV ); |
5241 | 5292 | ||
5242 | } | 5293 | } |
5243 | } | 5294 | } |
5244 | } | 5295 | } |
5245 | } | 5296 | } |
5246 | glEnd(); | 5297 | gGL.end(); |
5247 | 5298 | gGL.flush(); | |
5248 | } | 5299 | } |
5249 | glPopMatrix(); | 5300 | glPopMatrix(); |
5250 | } | 5301 | } |
@@ -5470,9 +5521,9 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const | |||
5470 | //----------------------------------------------------------------------------- | 5521 | //----------------------------------------------------------------------------- |
5471 | // canUndo() | 5522 | // canUndo() |
5472 | //----------------------------------------------------------------------------- | 5523 | //----------------------------------------------------------------------------- |
5473 | BOOL LLSelectMgr::canUndo() | 5524 | BOOL LLSelectMgr::canUndo() const |
5474 | { | 5525 | { |
5475 | return mSelectedObjects->getFirstEditableObject() != NULL; | 5526 | return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG |
5476 | } | 5527 | } |
5477 | 5528 | ||
5478 | //----------------------------------------------------------------------------- | 5529 | //----------------------------------------------------------------------------- |
@@ -5488,9 +5539,9 @@ void LLSelectMgr::undo() | |||
5488 | //----------------------------------------------------------------------------- | 5539 | //----------------------------------------------------------------------------- |
5489 | // canRedo() | 5540 | // canRedo() |
5490 | //----------------------------------------------------------------------------- | 5541 | //----------------------------------------------------------------------------- |
5491 | BOOL LLSelectMgr::canRedo() | 5542 | BOOL LLSelectMgr::canRedo() const |
5492 | { | 5543 | { |
5493 | return mSelectedObjects->getFirstEditableObject() != NULL; | 5544 | return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG |
5494 | } | 5545 | } |
5495 | 5546 | ||
5496 | //----------------------------------------------------------------------------- | 5547 | //----------------------------------------------------------------------------- |
@@ -5506,10 +5557,10 @@ void LLSelectMgr::redo() | |||
5506 | //----------------------------------------------------------------------------- | 5557 | //----------------------------------------------------------------------------- |
5507 | // canDoDelete() | 5558 | // canDoDelete() |
5508 | //----------------------------------------------------------------------------- | 5559 | //----------------------------------------------------------------------------- |
5509 | BOOL LLSelectMgr::canDoDelete() | 5560 | BOOL LLSelectMgr::canDoDelete() const |
5510 | { | 5561 | { |
5511 | // Note: Can only delete root objects (see getFirstDeleteableObject() for more info) | 5562 | // Note: Can only delete root objects (see getFirstDeleteableObject() for more info) |
5512 | return mSelectedObjects->getFirstDeleteableObject() != NULL; | 5563 | return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstDeleteableObject() != NULL; // HACK: casting away constness - MG |
5513 | } | 5564 | } |
5514 | 5565 | ||
5515 | //----------------------------------------------------------------------------- | 5566 | //----------------------------------------------------------------------------- |
@@ -5523,7 +5574,7 @@ void LLSelectMgr::doDelete() | |||
5523 | //----------------------------------------------------------------------------- | 5574 | //----------------------------------------------------------------------------- |
5524 | // canDeselect() | 5575 | // canDeselect() |
5525 | //----------------------------------------------------------------------------- | 5576 | //----------------------------------------------------------------------------- |
5526 | BOOL LLSelectMgr::canDeselect() | 5577 | BOOL LLSelectMgr::canDeselect() const |
5527 | { | 5578 | { |
5528 | return !mSelectedObjects->isEmpty(); | 5579 | return !mSelectedObjects->isEmpty(); |
5529 | } | 5580 | } |
@@ -5538,9 +5589,9 @@ void LLSelectMgr::deselect() | |||
5538 | //----------------------------------------------------------------------------- | 5589 | //----------------------------------------------------------------------------- |
5539 | // canDuplicate() | 5590 | // canDuplicate() |
5540 | //----------------------------------------------------------------------------- | 5591 | //----------------------------------------------------------------------------- |
5541 | BOOL LLSelectMgr::canDuplicate() | 5592 | BOOL LLSelectMgr::canDuplicate() const |
5542 | { | 5593 | { |
5543 | return mSelectedObjects->getFirstCopyableObject() != NULL; | 5594 | return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstCopyableObject() != NULL; // HACK: casting away constness - MG |
5544 | } | 5595 | } |
5545 | //----------------------------------------------------------------------------- | 5596 | //----------------------------------------------------------------------------- |
5546 | // duplicate() | 5597 | // duplicate() |
@@ -5738,7 +5789,7 @@ LLSelectNode* LLObjectSelection::findNode(LLViewerObject* objectp) | |||
5738 | //----------------------------------------------------------------------------- | 5789 | //----------------------------------------------------------------------------- |
5739 | // isEmpty() | 5790 | // isEmpty() |
5740 | //----------------------------------------------------------------------------- | 5791 | //----------------------------------------------------------------------------- |
5741 | BOOL LLObjectSelection::isEmpty() | 5792 | BOOL LLObjectSelection::isEmpty() const |
5742 | { | 5793 | { |
5743 | return (mList.size() == 0); | 5794 | return (mList.size() == 0); |
5744 | } | 5795 | } |
@@ -6129,3 +6180,4 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) | |||
6129 | return getFirstSelectedObject(&func, get_parent); | 6180 | return getFirstSelectedObject(&func, get_parent); |
6130 | } | 6181 | } |
6131 | 6182 | ||
6183 | |||