diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-06-22 11:24:23 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-22 11:24:23 -0700 |
commit | 1ca92d37ddac87c09df9716e09cd7c37d94f85e7 (patch) | |
tree | 2b57d0351aab76ff267ad5d82b84327535b01797 /indra | |
parent | f143da27bf09b0e7a9b73de80609b2326a7e672e (diff) |
PATH-760: Adding another pathfinding test method to the selection manager.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpermissions.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 46 | ||||
-rw-r--r-- | indra/newview/llselectmgr.h | 4 |
3 files changed, 56 insertions, 9 deletions
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 6076cb01fb..51ab7649a4 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -336,6 +336,12 @@ void LLPanelPermissions::refresh() std::string pfAttrName; if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsNonPathfinding()) + || LLSelectMgr::getInstance()->selectGetNonPathfinding()) + { + pfAttrName = "Pathfinding_Object_Attr_None"; + } + else if ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsPermanent()) || LLSelectMgr::getInstance()->selectGetPermanent()) { @@ -347,15 +353,6 @@ void LLPanelPermissions::refresh() { pfAttrName = "Pathfinding_Object_Attr_Character"; } - else if (((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsNonPermanent()) - || LLSelectMgr::getInstance()->selectGetNonPermanent()) && - ((LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() - && LLSelectMgr::getInstance()->selectGetRootsNonCharacter()) - || LLSelectMgr::getInstance()->selectGetNonCharacter())) - { - pfAttrName = "Pathfinding_Object_Attr_None"; - } else { pfAttrName = "Pathfinding_Object_Attr_MultiSelect"; 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 @@ -2648,6 +2648,52 @@ BOOL LLSelectMgr::selectGetRootsCharacter() } //----------------------------------------------------------------------------- +// 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 //----------------------------------------------------------------------------- BOOL LLSelectMgr::selectGetNonPermanent() diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 488f8f2efb..bf40ab458f 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -573,6 +573,10 @@ public: BOOL selectGetCharacter(); // returns TRUE if is all objects are not permanent + BOOL selectGetRootsNonPathfinding(); + BOOL selectGetNonPathfinding(); + + // returns TRUE if is all objects are not permanent BOOL selectGetRootsNonPermanent(); BOOL selectGetNonPermanent(); |