From 4d77d3cca1c932516781222e0c8c14d27f876466 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 28 Feb 2012 19:07:44 -0800 Subject: PATH-199: Cleaning up code related to object flags so that I can better use the flags to managed pathfinding flags such as permanent and character. --- indra/newview/llselectmgr.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 6111255a66..9cfcf3de79 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -4144,12 +4144,6 @@ void LLSelectMgr::selectionUpdatePhantom(BOOL is_phantom) getSelection()->applyToObjects(&func); } -void LLSelectMgr::selectionUpdateCastShadows(BOOL cast_shadows) -{ - LLSelectMgrApplyFlags func( FLAGS_CAST_SHADOWS, cast_shadows); - getSelection()->applyToObjects(&func); -} - //---------------------------------------------------------------------- // Helpful packing functions for sendObjectMessage() //---------------------------------------------------------------------- -- cgit v1.2.3 From 378ae8ce6588ce921b2aa960c08d4293c6b419e5 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 13 Mar 2012 15:33:15 -0700 Subject: PATH-199: Enforcing permanent objects in frozen state to not move. --- indra/newview/llselectmgr.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9cfcf3de79..1ee365ce97 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -276,7 +276,7 @@ void LLSelectMgr::overrideObjectUpdates() virtual bool apply(LLSelectNode* selectNode) { LLViewerObject* object = selectNode->getObject(); - if (object && object->permMove()) + if (object && object->permMove() && !object->isPermanentEnforced()) { if (!selectNode->mLastPositionLocal.isExactlyZero()) { @@ -955,7 +955,7 @@ void LLSelectMgr::highlightObjectOnly(LLViewerObject* objectp) } if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !objectp->permYouOwner()) - || (gSavedSettings.getBOOL("SelectMovableOnly") && !objectp->permMove())) + || (gSavedSettings.getBOOL("SelectMovableOnly") && (!objectp->permMove() || objectp->isPermanentEnforced()))) { // only select my own objects return; @@ -6236,7 +6236,7 @@ BOOL LLSelectMgr::canSelectObject(LLViewerObject* object) } if ((gSavedSettings.getBOOL("SelectOwnedOnly") && !object->permYouOwner()) || - (gSavedSettings.getBOOL("SelectMovableOnly") && !object->permMove())) + (gSavedSettings.getBOOL("SelectMovableOnly") && (!object->permMove() || object->isPermanentEnforced()))) { // only select my own objects return FALSE; @@ -6928,7 +6928,7 @@ LLSelectNode* LLObjectSelection::getFirstMoveableNode(BOOL get_root_first) bool apply(LLSelectNode* node) { LLViewerObject* obj = node->getObject(); - return obj && obj->permMove(); + return obj && obj->permMove() && !obj->isPermanentEnforced(); } } func; LLSelectNode* res = get_root_first ? getFirstRootNode(&func, TRUE) : getFirstNode(&func); @@ -7008,7 +7008,7 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) bool apply(LLSelectNode* node) { LLViewerObject* obj = node->getObject(); - return obj && obj->permMove(); + return obj && obj->permMove() && !obj->isPermanentEnforced(); } } func; return getFirstSelectedObject(&func, get_parent); @@ -7077,7 +7077,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, { obj = (*it)->getObject(); bool enable_pos = false, enable_rot = false; - bool perm_move = obj->permMove(); + bool perm_move = obj->permMove() && !obj->isPermanentEnforced(); bool perm_mod = obj->permModify(); LLVector3d sel_center(getSelectionCenterGlobal()); -- cgit v1.2.3 From 58041846d5b90eb980999d9569fe62621341ac1d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 16 Mar 2012 14:19:30 -0700 Subject: Removing unreachable code from the viewer. Corresponding changes made on the server to remove the message handling. --- indra/newview/llselectmgr.cpp | 44 ------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 1ee365ce97..ae61ead935 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2285,50 +2285,6 @@ void LLSelectMgr::packObjectIDAsParam(LLSelectNode* node, void *) gMessageSystem->addString("Parameter", buf); } -//----------------------------------------------------------------------------- -// Rotation options -//----------------------------------------------------------------------------- -void LLSelectMgr::selectionResetRotation() -{ - struct f : public LLSelectedObjectFunctor - { - virtual bool apply(LLViewerObject* object) - { - LLQuaternion identity(0.f, 0.f, 0.f, 1.f); - object->setRotation(identity); - if (object->mDrawable.notNull()) - { - gPipeline.markMoved(object->mDrawable, TRUE); - } - object->sendRotationUpdate(); - return true; - } - } func; - getSelection()->applyToRootObjects(&func); -} - -void LLSelectMgr::selectionRotateAroundZ(F32 degrees) -{ - LLQuaternion rot( degrees * DEG_TO_RAD, LLVector3(0,0,1) ); - struct f : public LLSelectedObjectFunctor - { - LLQuaternion mRot; - f(const LLQuaternion& rot) : mRot(rot) {} - virtual bool apply(LLViewerObject* object) - { - object->setRotation( object->getRotationEdit() * mRot ); - if (object->mDrawable.notNull()) - { - gPipeline.markMoved(object->mDrawable, TRUE); - } - object->sendRotationUpdate(); - return true; - } - } func(rot); - getSelection()->applyToRootObjects(&func); -} - - //----------------------------------------------------------------------------- // selectionTexScaleAutofit() //----------------------------------------------------------------------------- -- cgit v1.2.3 From 22681ddb90b9fcb5eccb4467bb13704075de67d9 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 21 Mar 2012 18:00:21 -0700 Subject: PATH-199: Disabling more functionality of the build tool floater when permanancy is enforced. --- indra/newview/llselectmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ae61ead935..9b56a5be35 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -638,7 +638,7 @@ bool LLSelectMgr::enableLinkObjects() { virtual bool apply(LLViewerObject* object) { - return object->permModify(); + return object->permModify() && !object->isPermanentEnforced(); } } func; const bool firstonly = true; @@ -654,7 +654,7 @@ bool LLSelectMgr::enableUnlinkObjects() bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && first_editable_object && - !first_editable_object->isAttachment(); + !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced(); return new_value; } -- cgit v1.2.3 From f0dafcfc7ce0c7c310ccb076b42572e0479754e2 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 23 Mar 2012 17:47:40 -0700 Subject: PATH-199: Disabling the Take and Delete right-click context menu options when object is enforced permanent. --- indra/newview/llselectmgr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9b56a5be35..b0aae89a85 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6922,9 +6922,10 @@ LLViewerObject* LLObjectSelection::getFirstDeleteableObject() LLViewerObject* obj = node->getObject(); // you can delete an object if you are the owner // or you have permission to modify it. - if( obj && ( (obj->permModify()) || - (obj->permYouOwner()) || - (!obj->permAnyOwner()) )) // public + if( obj && !obj->isPermanentEnforced() && + ( (obj->permModify()) || + (obj->permYouOwner()) || + (!obj->permAnyOwner()) )) // public { if( !obj->isAttachment() ) { -- cgit v1.2.3 From fcda925072c51de749e6b35b3863f29d8be3eaa6 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 29 Mar 2012 18:07:40 -0700 Subject: PATH-450: BUGFIX Ensuring that permanent objects cannot be linked in frozen mode. Displaying a modal notification if user attempts. --- indra/newview/llselectmgr.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b0aae89a85..44a0b3adc4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -593,6 +593,12 @@ bool LLSelectMgr::linkObjects() return true; } + if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanent()) + { + LLNotificationsUtil::add("CannotLinkPermanent"); + return true; + } + LLUUID owner_id; std::string owner_name; if (!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name)) @@ -2498,6 +2504,54 @@ BOOL LLSelectMgr::selectGetRootsModify() } +//----------------------------------------------------------------------------- +// selectGetPermanent() - return TRUE if current agent can modify all +// selected objects. +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetNonPermanent() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( object->isPermanentEnforced()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsModify() - return TRUE if current agent can modify all +// selected root objects. +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsNonPermanent() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( object->isPermanentEnforced()) + { + return FALSE; + } + } + + return TRUE; +} + + //----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all // selected root objects. -- cgit v1.2.3 From c1a5d6a36b925728d98c37522ed7ae53e3a87155 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 30 Mar 2012 15:42:43 -0700 Subject: PATH-450: Disabling the movement and shape manipulation widgets when editing an item in a linked set. --- indra/newview/llselectmgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 44a0b3adc4..49c568039c 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -644,7 +644,9 @@ bool LLSelectMgr::enableLinkObjects() { virtual bool apply(LLViewerObject* object) { - return object->permModify() && !object->isPermanentEnforced(); + LLViewerObject *root_object = (object == NULL) ? NULL : object->getRootEdit(); + return object->permModify() && !object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced()); } } func; const bool firstonly = true; @@ -657,10 +659,12 @@ bool LLSelectMgr::enableLinkObjects() bool LLSelectMgr::enableUnlinkObjects() { LLViewerObject* first_editable_object = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject(); + LLViewerObject *root_object = (first_editable_object == NULL) ? NULL : first_editable_object->getRootEdit(); bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && first_editable_object && - !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced(); + !first_editable_object->isAttachment() && !first_editable_object->isPermanentEnforced() && + ((root_object == NULL) || !root_object->isPermanentEnforced()); return new_value; } -- cgit v1.2.3 From 029103133ebac7ee13f1af767f41b012d19a84f5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 19 Jun 2012 18:08:39 -0500 Subject: MAINT-794 Factor out a lot of CPU overhead around updating objects. --- indra/newview/llselectmgr.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a55565909f..562ac9fff5 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -390,7 +390,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, // don't include an avatar. LLViewerObject* root = obj; - while(!root->isAvatar() && root->getParent() && !root->isJointChild()) + while(!root->isAvatar() && root->getParent()) { LLViewerObject* parent = (LLViewerObject*)root->getParent(); if (parent->isAvatar()) @@ -674,7 +674,7 @@ void LLSelectMgr::deselectObjectAndFamily(LLViewerObject* object, BOOL send_to_s // don't include an avatar. LLViewerObject* root = object; - while(!root->isAvatar() && root->getParent() && !root->isJointChild()) + while(!root->isAvatar() && root->getParent()) { LLViewerObject* parent = (LLViewerObject*)root->getParent(); if (parent->isAvatar()) @@ -1387,7 +1387,7 @@ void LLSelectMgr::promoteSelectionToRoot() } LLViewerObject* parentp = object; - while(parentp->getParent() && !(parentp->isRootEdit() || parentp->isJointChild())) + while(parentp->getParent() && !(parentp->isRootEdit())) { parentp = (LLViewerObject*)parentp->getParent(); } @@ -4174,8 +4174,7 @@ struct LLSelectMgrApplyFlags : public LLSelectedObjectFunctor virtual bool apply(LLViewerObject* object) { if ( object->permModify() && // preemptive permissions check - object->isRoot() && // don't send for child objects - !object->isJointChild()) + object->isRoot()) // don't send for child objects { object->setFlags( mFlags, mState); } @@ -6036,8 +6035,6 @@ void LLSelectMgr::updateSelectionCenter() // matches the root prim's (affecting the orientation of the manipulators). bbox.addBBoxAgent( (mSelectedObjects->getFirstRootObject(TRUE))->getBoundingBoxAgent() ); - std::vector < LLViewerObject *> jointed_objects; - for (LLObjectSelection::iterator iter = mSelectedObjects->begin(); iter != mSelectedObjects->end(); iter++) { @@ -6055,11 +6052,6 @@ void LLSelectMgr::updateSelectionCenter() } bbox.addBBoxAgent( object->getBoundingBoxAgent() ); - - if (object->isJointChild()) - { - jointed_objects.push_back(object); - } } LLVector3 bbox_center_agent = bbox.getCenterAgent(); @@ -6349,19 +6341,19 @@ void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom) bool LLObjectSelection::is_root::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); + return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit()); } bool LLObjectSelection::is_valid_root::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); + return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit()); } bool LLObjectSelection::is_root_object::operator()(LLSelectNode *node) { LLViewerObject* object = node->getObject(); - return (object != NULL) && (object->isRootEdit() || object->isJointChild()); + return (object != NULL) && (object->isRootEdit()); } LLObjectSelection::LLObjectSelection() : -- cgit v1.2.3 From aea6b0c70ccb1a330c1ee2a0f66c3fa72d2700ca Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 21 Jun 2012 17:29:12 -0700 Subject: PATH-760: Renaming some methods of LLSelectMgr. --- indra/newview/llselectmgr.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 49c568039c..d8e6ed296f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -593,7 +593,7 @@ bool LLSelectMgr::linkObjects() return true; } - if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanent()) + if (!LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced()) { LLNotificationsUtil::add("CannotLinkPermanent"); return true; @@ -2509,10 +2509,10 @@ BOOL LLSelectMgr::selectGetRootsModify() //----------------------------------------------------------------------------- -// selectGetPermanent() - return TRUE if current agent can modify all -// selected objects. +// selectGetNonPermanentEnforced() - return TRUE if all objects are not +// permanent enforced //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetNonPermanent() +BOOL LLSelectMgr::selectGetNonPermanentEnforced() { for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++ ) @@ -2532,10 +2532,10 @@ BOOL LLSelectMgr::selectGetNonPermanent() } //----------------------------------------------------------------------------- -// selectGetRootsModify() - return TRUE if current agent can modify all -// selected root objects. +// selectGetRootsNonPermanentEnforced() - return TRUE if all root objects are +// not permanent enforced //----------------------------------------------------------------------------- -BOOL LLSelectMgr::selectGetRootsNonPermanent() +BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced() { for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++ ) -- cgit v1.2.3 From f143da27bf09b0e7a9b73de80609b2326a7e672e Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 21 Jun 2012 18:03:23 -0700 Subject: PATH-760: Ensuring that the pathfinding attribute field works correctly with multiple objects selected. --- indra/newview/llselectmgr.cpp | 184 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index d8e6ed296f..791342a555 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2555,6 +2555,190 @@ BOOL LLSelectMgr::selectGetRootsNonPermanentEnforced() return TRUE; } +//----------------------------------------------------------------------------- +// selectGetPermanent() - return TRUE if all objects are permanent +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetPermanent() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( !object->flagObjectPermanent()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsPermanent() - return TRUE if all root objects are +// permanent +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsPermanent() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( !object->flagObjectPermanent()) + { + return FALSE; + } + } + + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetCharacter() - return TRUE if all objects are character +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetCharacter() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( !object->flagCharacter()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsCharacter() - return TRUE if all root objects are +// character +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsCharacter() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( !object->flagCharacter()) + { + return FALSE; + } + } + + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetNonPermanent() - return TRUE if all objects are not permanent +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetNonPermanent() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( object->flagObjectPermanent()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsNonPermanent() - return TRUE if all root objects are not +// permanent +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsNonPermanent() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( object->flagObjectPermanent()) + { + return FALSE; + } + } + + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetNonCharacter() - return TRUE if all objects are not character +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetNonCharacter() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( object->flagCharacter()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsNonCharacter() - return TRUE if all root objects are not +// character +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsNonCharacter() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( object->flagCharacter()) + { + return FALSE; + } + } + + return TRUE; +} + //----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all -- cgit v1.2.3 From 1ca92d37ddac87c09df9716e09cd7c37d94f85e7 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 22 Jun 2012 11:24:23 -0700 Subject: PATH-760: Adding another pathfinding test method to the selection manager. --- indra/newview/llselectmgr.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 791342a555..34b889d8b9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2647,6 +2647,52 @@ BOOL LLSelectMgr::selectGetRootsCharacter() return TRUE; } +//----------------------------------------------------------------------------- +// selectGetNonPathfinding() - return TRUE if all objects are not pathfinding +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetNonPathfinding() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( object->flagObjectPermanent() || object->flagCharacter()) + { + return FALSE; + } + } + return TRUE; +} + +//----------------------------------------------------------------------------- +// selectGetRootsNonPathfinding() - return TRUE if all root objects are not +// pathfinding +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetRootsNonPathfinding() +{ + for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); + iter != getSelection()->root_end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !node->mValid ) + { + return FALSE; + } + if( object->flagObjectPermanent() || object->flagCharacter()) + { + return FALSE; + } + } + + return TRUE; +} + //----------------------------------------------------------------------------- // selectGetNonPermanent() - return TRUE if all objects are not permanent //----------------------------------------------------------------------------- -- cgit v1.2.3 From 34d95fdc01690fe65ac89136cbc4782a9a22af95 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 10 Jul 2012 18:29:22 -0700 Subject: PATH-807: BUGFIX Filtering which objects will contain the right-click context-sensitive menu option of "Show in linksets...". --- indra/newview/llselectmgr.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 71ea5d80a9..b9449e806f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2786,6 +2786,36 @@ BOOL LLSelectMgr::selectGetRootsNonCharacter() } +//----------------------------------------------------------------------------- +// selectGetEditableLinksets() - return TRUE if all objects are editable +// pathfinding linksets +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetEditableLinksets() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if (object->flagUsePhysics() || + object->flagTemporaryOnRez() || + object->flagCharacter() || + object->flagAnimSource() || + (!gAgent.isGodlike() && + !gAgent.canManageEstate() && + !object->permYouOwner() && + !object->permMove())) + { + return FALSE; + } + } + return TRUE; +} + //----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all // selected root objects. -- cgit v1.2.3 From 90fdf60d697f5c1e451a41eff0c6856e36cf1b64 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 12 Jul 2012 14:12:58 -0700 Subject: PATH-807: Adding an additional check for if the object is marked as volume-detect. Note that this will require Andrew's corresponding server-side change to take effect. However, the viewer change alone should have no neative effect prior to the server being updated. --- indra/newview/llselectmgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index b9449e806f..a5d9db4a00 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2804,6 +2804,7 @@ BOOL LLSelectMgr::selectGetEditableLinksets() if (object->flagUsePhysics() || object->flagTemporaryOnRez() || object->flagCharacter() || + object->flagVolumeDetect() || object->flagAnimSource() || (!gAgent.isGodlike() && !gAgent.canManageEstate() && -- cgit v1.2.3 From eb00239a0b6b3177acd61a7261251cc2fdd5cb86 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 12 Jul 2012 14:47:47 -0700 Subject: PATH-807: Ensuring that the "Show in linksets..." and "Show in characters..." right-click menu option does not show for objects outside the current region. --- indra/newview/llselectmgr.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index a5d9db4a00..e711a51fe8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2806,6 +2806,7 @@ BOOL LLSelectMgr::selectGetEditableLinksets() object->flagCharacter() || object->flagVolumeDetect() || object->flagAnimSource() || + (object->getRegion() != gAgent.getRegion()) || (!gAgent.isGodlike() && !gAgent.canManageEstate() && !object->permYouOwner() && @@ -2817,6 +2818,30 @@ BOOL LLSelectMgr::selectGetEditableLinksets() return TRUE; } +//----------------------------------------------------------------------------- +// selectGetViewableCharacters() - return TRUE if all objects are characters +// viewable within the pathfinding characters floater +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectGetViewableCharacters() +{ + for (LLObjectSelection::iterator iter = getSelection()->begin(); + iter != getSelection()->end(); iter++ ) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + if( !object || !node->mValid ) + { + return FALSE; + } + if( !object->flagCharacter() || + (object->getRegion() != gAgent.getRegion())) + { + return FALSE; + } + } + return TRUE; +} + //----------------------------------------------------------------------------- // selectGetRootsTransfer() - return TRUE if current agent can transfer all // selected root objects. -- cgit v1.2.3