From 3c2be426e5e905076d00b9492c0e66c8b31caf19 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 30 May 2012 18:47:12 -0700 Subject: First pass at refactoring the pathfinding linksets and pathfinding characters classes to reduce code duplication, as both functionalities were heavily duplicated. --- indra/newview/llpathfindingobject.h | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 indra/newview/llpathfindingobject.h (limited to 'indra/newview/llpathfindingobject.h') diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h new file mode 100644 index 0000000000..9dc114b40f --- /dev/null +++ b/indra/newview/llpathfindingobject.h @@ -0,0 +1,73 @@ +/** +* @file llpathfindingobject.h +* @brief Header file for llpathfindingobject +* @author Stinson@lindenlab.com +* +* $LicenseInfo:firstyear=2012&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2012, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLPATHFINDINGOBJECT_H +#define LL_LLPATHFINDINGOBJECT_H + +#include "v3math.h" +#include "llavatarname.h" +#include "lluuid.h" + +#include + +#include + +class LLPathfindingObject; +class LLSD; + +typedef boost::shared_ptr LLPathfindingObjectPtr; + +class LLPathfindingObject +{ +public: + LLPathfindingObject(); + LLPathfindingObject(const std::string &pUUID, const LLSD &pObjectData); + LLPathfindingObject(const LLPathfindingObject& pOther); + virtual ~LLPathfindingObject(); + + LLPathfindingObject& operator =(const LLPathfindingObject& pOther); + + inline const LLUUID& getUUID() const {return mUUID;}; + inline const std::string& getName() const {return mName;}; + inline const std::string& getDescription() const {return mDescription;}; + inline BOOL hasOwnerName() const {return mOwnerUUID.notNull();}; + std::string getOwnerName() const; + inline const LLVector3& getLocation() const {return mLocation;}; + +protected: + +private: + void parseObjectData(const LLSD &pObjectData); + + LLUUID mUUID; + std::string mName; + std::string mDescription; + LLUUID mOwnerUUID; + LLAvatarName mOwnerName; + LLVector3 mLocation; +}; + +#endif // LL_LLPATHFINDINGOBJECT_H -- cgit v1.3 From 3352a1eac15f752535b636866eeb966ec3900c62 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 30 May 2012 19:39:08 -0700 Subject: Cleaning up some unreferenced headers and classes definitions from previous refactoring. --- indra/newview/llfloaterpathfindingcharacters.cpp | 5 ++-- indra/newview/llfloaterpathfindingcharacters.h | 8 +------ indra/newview/llfloaterpathfindinglinksets.cpp | 11 ++------- indra/newview/llfloaterpathfindinglinksets.h | 1 + indra/newview/llfloaterpathfindingobjects.cpp | 5 +--- indra/newview/llfloaterpathfindingobjects.h | 1 + indra/newview/llpathfindingcharacterlist.cpp | 2 +- indra/newview/llpathfindingcharacterlist.h | 1 - indra/newview/llpathfindinglinkset.cpp | 2 ++ indra/newview/llpathfindinglinkset.h | 30 +++++++++++++----------- indra/newview/llpathfindinglinksetlist.cpp | 5 +++- indra/newview/llpathfindinglinksetlist.h | 1 - indra/newview/llpathfindingmanager.cpp | 4 +--- indra/newview/llpathfindingmanager.h | 2 -- indra/newview/llpathfindingobject.h | 4 ++-- indra/newview/llpathfindingobjectlist.cpp | 2 ++ 16 files changed, 37 insertions(+), 47 deletions(-) (limited to 'indra/newview/llpathfindingobject.h') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 6599bac6a6..59f54c12bf 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -33,9 +33,10 @@ #include "llfloaterpathfindingobjects.h" #include "llpathfindingcharacter.h" #include "llpathfindingcharacterlist.h" +#include "llpathfindingmanager.h" +#include "llpathfindingobjectlist.h" #include "llsd.h" -#include "lluuid.h" -#include "llviewerregion.h" +#include "lluicolortable.h" //--------------------------------------------------------------------------- // LLFloaterPathfindingCharacters diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index c4277b9d25..38fb4d48d7 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -29,17 +29,11 @@ #define LL_LLFLOATERPATHFINDINGCHARACTERS_H #include "llfloaterpathfindingobjects.h" -#include "llpathfindingcharacter.h" -#include "llpathfindingmanager.h" #include "llpathfindingobjectlist.h" #include "v4color.h" -class LLButton; -class LLCheckBoxCtrl; -class LLRadioGroup; -class LLScrollListCtrl; +class LLPathfindingCharacter; class LLSD; -class LLTextBase; class LLFloaterPathfindingCharacters : public LLFloaterPathfindingObjects { diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 7fe22f65cf..36f54ffae1 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -33,27 +33,20 @@ #include "llagent.h" #include "llbutton.h" -#include "llcheckboxctrl.h" #include "llcombobox.h" -#include "llfloater.h" #include "llfloaterreg.h" #include "lllineeditor.h" #include "llnotificationsutil.h" #include "llpathfindinglinkset.h" #include "llpathfindinglinksetlist.h" #include "llpathfindingmanager.h" -#include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llsd.h" -#include "llselectmgr.h" #include "lltextbase.h" #include "lltextvalidate.h" -#include "lluuid.h" -#include "llviewermenu.h" -#include "llviewerobject.h" -#include "llviewerobjectlist.h" -#include "llviewerregion.h" +#include "lluicolortable.h" #include "v3math.h" +#include "v4color.h" #define XUI_LINKSET_USE_NONE 0 #define XUI_LINKSET_USE_WALKABLE 1 diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index bad803f420..d989e0ea4d 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -41,6 +41,7 @@ class LLScrollListItem; class LLSD; class LLTextBase; class LLUICtrl; +class LLVector3; class LLFloaterPathfindingLinksets : public LLFloaterPathfindingObjects { diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 3b3de3f417..e8d80c09d8 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -34,14 +34,10 @@ #include #include -#include "v4color.h" - #include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llcombobox.h" #include "llenvmanager.h" -#include "lllineeditor.h" #include "llfloater.h" #include "llpathfindingmanager.h" #include "llresmgr.h" @@ -57,6 +53,7 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" +#include "v4color.h" #define DEFAULT_BEACON_WIDTH 6 diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 7fa7f89f51..34eb129864 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -39,6 +39,7 @@ class LLButton; class LLCheckBoxCtrl; class LLScrollListCtrl; +class LLScrollListItem; class LLSD; class LLTextBase; diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 53b21f436d..9b0ed14e35 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -29,10 +29,10 @@ #include "llpathfindingcharacterlist.h" -#include "llsd.h" #include "llpathfindingcharacter.h" #include "llpathfindingobject.h" #include "llpathfindingobjectlist.h" +#include "llsd.h" //--------------------------------------------------------------------------- // LLPathfindingCharacterList diff --git a/indra/newview/llpathfindingcharacterlist.h b/indra/newview/llpathfindingcharacterlist.h index a80db08c87..734cfcafa1 100644 --- a/indra/newview/llpathfindingcharacterlist.h +++ b/indra/newview/llpathfindingcharacterlist.h @@ -28,7 +28,6 @@ #ifndef LL_LLPATHFINDINGCHARACTERLIST_H #define LL_LLPATHFINDINGCHARACTERLIST_H -#include "llpathfindingcharacter.h" #include "llpathfindingobjectlist.h" class LLSD; diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index dca5b6c93d..5b321b4408 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -29,6 +29,8 @@ #include "llpathfindinglinkset.h" +#include + #include "llpathfindingobject.h" #include "llsd.h" diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h index cda71dffb3..a598452ea5 100644 --- a/indra/newview/llpathfindinglinkset.h +++ b/indra/newview/llpathfindinglinkset.h @@ -28,6 +28,8 @@ #ifndef LL_LLPATHFINDINGLINKSET_H #define LL_LLPATHFINDINGLINKSET_H +#include + #include "llpathfindingobject.h" #define DEPRECATED_NAVMESH_PERMANENT_WALKABLE_FLAGS @@ -56,23 +58,23 @@ public: LLPathfindingLinkset& operator = (const LLPathfindingLinkset& pOther); - inline bool isTerrain() const {return mIsTerrain;}; - inline U32 getLandImpact() const {return mLandImpact;}; - BOOL isModifiable() const {return mIsModifiable;}; - BOOL isPhantom() const; - BOOL canBeVolume() const {return mCanBeVolume;}; - static ELinksetUse getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse); + inline bool isTerrain() const {return mIsTerrain;}; + inline U32 getLandImpact() const {return mLandImpact;}; + BOOL isModifiable() const {return mIsModifiable;}; + BOOL isPhantom() const; + BOOL canBeVolume() const {return mCanBeVolume;}; + static ELinksetUse getLinksetUseWithToggledPhantom(ELinksetUse pLinksetUse); - inline ELinksetUse getLinksetUse() const {return mLinksetUse;}; + inline ELinksetUse getLinksetUse() const {return mLinksetUse;}; - inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; - inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; - inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; - inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;}; + inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; + inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; + inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; + inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;}; - bool isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const; - bool isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const; - LLSD encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const; + bool isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const; + bool isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const; + LLSD encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const; static const S32 MIN_WALKABILITY_VALUE; static const S32 MAX_WALKABILITY_VALUE; diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index 0ba6ef07f3..5323635438 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -29,10 +29,13 @@ #include "llpathfindinglinksetlist.h" -#include "llsd.h" +#include +#include + #include "llpathfindinglinkset.h" #include "llpathfindingobject.h" #include "llpathfindingobjectlist.h" +#include "llsd.h" //--------------------------------------------------------------------------- // LLPathfindingLinksetList diff --git a/indra/newview/llpathfindinglinksetlist.h b/indra/newview/llpathfindinglinksetlist.h index 7bd6986094..50a8e069d0 100644 --- a/indra/newview/llpathfindinglinksetlist.h +++ b/indra/newview/llpathfindinglinksetlist.h @@ -32,7 +32,6 @@ #include "llpathfindingobjectlist.h" class LLSD; -class LLVector3; class LLPathfindingLinksetList : public LLPathfindingObjectList { diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index b8b9dff51c..e282a3e2f4 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -30,7 +30,7 @@ #include "llpathfindingmanager.h" #include -#include +#include #include #include @@ -39,14 +39,12 @@ #include "llhttpclient.h" #include "llhttpnode.h" #include "llnotificationsutil.h" -#include "llpathfindingcharacter.h" #include "llpathfindingcharacterlist.h" #include "llpathfindinglinkset.h" #include "llpathfindinglinksetlist.h" #include "llpathfindingnavmesh.h" #include "llpathfindingnavmeshstatus.h" #include "llpathfindingobject.h" -#include "llpathfindinglinksetlist.h" #include "llsingleton.h" #include "llsd.h" #include "lltrans.h" diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 172670cdf8..3c9af91e7b 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -40,7 +40,6 @@ #include "llsingleton.h" #include "lluuid.h" -class LLFloater; class LLViewerRegion; class LLPathfindingNavMeshStatus; @@ -143,4 +142,3 @@ private: }; #endif // LL_LLPATHFINDINGMANAGER_H - diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 9dc114b40f..880a3a6864 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGOBJECT_H #define LL_LLPATHFINDINGOBJECT_H -#include "v3math.h" #include "llavatarname.h" #include "lluuid.h" +#include "v3math.h" #include @@ -60,7 +60,7 @@ public: protected: private: - void parseObjectData(const LLSD &pObjectData); + void parseObjectData(const LLSD &pObjectData); LLUUID mUUID; std::string mName; diff --git a/indra/newview/llpathfindingobjectlist.cpp b/indra/newview/llpathfindingobjectlist.cpp index cad3a0a00f..68a7e736e6 100644 --- a/indra/newview/llpathfindingobjectlist.cpp +++ b/indra/newview/llpathfindingobjectlist.cpp @@ -32,6 +32,8 @@ #include #include +#include "llpathfindingobject.h" + //--------------------------------------------------------------------------- // LLPathfindingObjectList //--------------------------------------------------------------------------- -- cgit v1.3 From ea23285f8b728bf52c8490610c610f4abd2d6957 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 4 Jun 2012 14:36:43 -0700 Subject: Ensuring that the scroll list is rebuilt after any missing avatar names are loaded into cache. --- indra/newview/llfloaterpathfindingcharacters.cpp | 11 ++++-- indra/newview/llfloaterpathfindingcharacters.h | 2 +- indra/newview/llfloaterpathfindinglinksets.cpp | 16 +++++++-- indra/newview/llfloaterpathfindinglinksets.h | 2 +- indra/newview/llfloaterpathfindingobjects.cpp | 25 +++++++++++++- indra/newview/llfloaterpathfindingobjects.h | 39 +++++++++++++--------- indra/newview/llpathfindingobject.cpp | 28 +++++++++++++--- indra/newview/llpathfindingobject.h | 7 +++- .../xui/en/floater_pathfinding_characters.xml | 2 ++ .../xui/en/floater_pathfinding_linksets.xml | 1 + 10 files changed, 105 insertions(+), 28 deletions(-) (limited to 'indra/newview/llpathfindingobject.h') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 0dbc2a303a..121cb85a6d 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -93,7 +93,7 @@ void LLFloaterPathfindingCharacters::requestGetObjects() LLPathfindingManager::getInstance()->requestGetCharacters(getNewRequestId(), boost::bind(&LLFloaterPathfindingCharacters::handleNewObjectList, this, _1, _2, _3)); } -LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const +LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(pObjectListPtr != NULL); llassert(!pObjectListPtr->isEmpty()); @@ -105,6 +105,11 @@ LLSD LLFloaterPathfindingCharacters::convertObjectsIntoScrollListData(const LLPa const LLPathfindingCharacter *characterPtr = dynamic_cast(objectIter->second.get()); LLSD element = buildCharacterScrollListData(characterPtr); scrollListData.append(element); + + if (characterPtr->hasOwner() && !characterPtr->hasOwnerName()) + { + rebuildScrollListAfterAvatarNameLoads(characterPtr->getUUID()); + } } return scrollListData; @@ -139,7 +144,9 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi columns[1]["font"] = "SANSSERIF"; columns[2]["column"] = "owner"; - columns[2]["value"] = pCharacterPtr->getOwnerName(); + columns[2]["value"] = (pCharacterPtr->hasOwner() ? + (pCharacterPtr->hasOwnerName() ? pCharacterPtr->getOwnerName() : getString("character_owner_loading")) : + getString("character_owner_unknown")); columns[2]["font"] = "SANSSERIF"; S32 cpuTime = llround(pCharacterPtr->getCPUTime()); diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 397191943a..ced72dadee 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -51,7 +51,7 @@ protected: virtual void requestGetObjects(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const; + virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); virtual S32 getNameColumnIndex() const; virtual const LLColor4 &getBeaconColor() const; diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index d53f4db5c2..bb1bcd0cb8 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -213,7 +213,7 @@ void LLFloaterPathfindingLinksets::requestGetObjects() LLPathfindingManager::getInstance()->requestGetLinksets(getNewRequestId(), boost::bind(&LLFloaterPathfindingLinksets::handleNewObjectList, this, _1, _2, _3)); } -LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const +LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(pObjectListPtr != NULL); llassert(!pObjectListPtr->isEmpty()); @@ -245,6 +245,11 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath { LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition); scrollListData.append(element); + + if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName()) + { + rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID()); + } } } } @@ -255,6 +260,11 @@ LLSD LLFloaterPathfindingLinksets::convertObjectsIntoScrollListData(const LLPath const LLPathfindingLinkset *linksetPtr = dynamic_cast(objectIter->second.get()); LLSD element = buildLinksetScrollListData(linksetPtr, avatarPosition); scrollListData.append(element); + + if (linksetPtr->hasOwner() && !linksetPtr->hasOwnerName()) + { + rebuildScrollListAfterAvatarNameLoads(linksetPtr->getUUID()); + } } } @@ -409,7 +419,9 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindin columns[1]["font"] = "SANSSERIF"; columns[2]["column"] = "owner"; - columns[2]["value"] = (pLinksetPtr->hasOwnerName() ? pLinksetPtr->getOwnerName() : getString("linkset_owner_unknown")); + columns[2]["value"] = (pLinksetPtr->hasOwner() ? + (pLinksetPtr->hasOwnerName() ? pLinksetPtr->getOwnerName() : getString("linkset_owner_loading")) : + getString("linkset_owner_unknown")); columns[2]["font"] = "SANSSERIF"; columns[3]["column"] = "land_impact"; diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 87719e28f0..4b19f09cda 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -62,7 +62,7 @@ protected: virtual void requestGetObjects(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const; + virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); virtual void updateControls(); diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 8aaeb299f1..7ac0d05bac 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -35,6 +35,8 @@ #include #include "llagent.h" +#include "llavatarname.h" +#include "llavatarnamecache.h" #include "llbutton.h" #include "llcheckboxctrl.h" #include "llenvmanager.h" @@ -162,6 +164,7 @@ LLFloaterPathfindingObjects::LLFloaterPathfindingObjects(const LLSD &pSeed) mReturnButton(NULL), mDeleteButton(NULL), mTeleportButton(NULL), + mLoadingAvatarNames(), mDefaultBeaconColor(), mDefaultBeaconTextColor(), mErrorTextColor(), @@ -346,13 +349,23 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() updateControls(); } -LLSD LLFloaterPathfindingObjects::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const +LLSD LLFloaterPathfindingObjects::convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) { llassert(0); LLSD nullObjs = LLSD::emptyArray(); return nullObjs; } +void LLFloaterPathfindingObjects::rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId) +{ + std::set::const_iterator iter = mLoadingAvatarNames.find(pAvatarId); + if (iter == mLoadingAvatarNames.end()) + { + mLoadingAvatarNames.insert(pAvatarId); + LLAvatarNameCache::get(pAvatarId, boost::bind(&LLFloaterPathfindingObjects::handleAvatarNameLoads, this, _1, _2)); + } +} + void LLFloaterPathfindingObjects::updateControls() { updateMessagingStatus(); @@ -542,6 +555,16 @@ void LLFloaterPathfindingObjects::onGodLevelChange(U8 pGodLevel) requestGetObjects(); } +void LLFloaterPathfindingObjects::handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName) +{ + llassert(mLoadingAvatarNames.find(pAvatarId) != mLoadingAvatarNames.end()); + mLoadingAvatarNames.erase(pAvatarId); + if (mLoadingAvatarNames.empty()) + { + rebuildObjectsScrollList(); + } +} + void LLFloaterPathfindingObjects::updateMessagingStatus() { std::string statusText(""); diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 7e7f1b9449..604d026f29 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -27,6 +27,7 @@ #ifndef LL_LLFLOATERPATHFINDINGOBJECTS_H #define LL_LLFLOATERPATHFINDINGOBJECTS_H +#include #include #include "llagent.h" @@ -37,6 +38,7 @@ #include "llselectmgr.h" #include "v4color.h" +class LLAvatarName; class LLButton; class LLCheckBoxCtrl; class LLScrollListCtrl; @@ -77,7 +79,9 @@ protected: void handleUpdateObjectList(LLPathfindingManager::request_id_t pRequestId, LLPathfindingManager::ERequestStatus pRequestStatus, LLPathfindingObjectListPtr pObjectList); void rebuildObjectsScrollList(); - virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr) const; + virtual LLSD convertObjectsIntoScrollListData(const LLPathfindingObjectListPtr pObjectListPtr); + + void rebuildScrollListAfterAvatarNameLoads(const LLUUID &pAvatarId); virtual void updateControls(); @@ -102,24 +106,26 @@ protected: private: LLFloaterPathfindingObjects(const LLFloaterPathfindingObjects &pOther); - void setMessagingState(EMessagingState pMessagingState); + void setMessagingState(EMessagingState pMessagingState); - void onRefreshObjectsClicked(); - void onSelectAllObjectsClicked(); - void onSelectNoneObjectsClicked(); - void onTakeClicked(); - void onTakeCopyClicked(); - void onReturnClicked(); - void onDeleteClicked(); - void onTeleportClicked(); + void onRefreshObjectsClicked(); + void onSelectAllObjectsClicked(); + void onSelectNoneObjectsClicked(); + void onTakeClicked(); + void onTakeCopyClicked(); + void onReturnClicked(); + void onDeleteClicked(); + void onTeleportClicked(); - void onScrollListSelectionChanged(); + void onScrollListSelectionChanged(); void onInWorldSelectionListChanged(); - void onRegionBoundaryCrossed(); + void onRegionBoundaryCrossed(); void onGodLevelChange(U8 pGodLevel); - void updateMessagingStatus(); - void updateStateOnListActionControls(); + void handleAvatarNameLoads(const LLUUID &pAvatarId, const LLAvatarName &pAvatarName); + + void updateMessagingStatus(); + void updateStateOnListActionControls(); void updateOnScrollListChange(); LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const; @@ -131,13 +137,15 @@ protected: LLButton *mSelectAllButton; LLButton *mSelectNoneButton; LLCheckBoxCtrl *mShowBeaconCheckBox; - + LLButton *mTakeButton; LLButton *mTakeCopyButton; LLButton *mReturnButton; LLButton *mDeleteButton; LLButton *mTeleportButton; + std::set mLoadingAvatarNames; + LLColor4 mDefaultBeaconColor; LLColor4 mDefaultBeaconTextColor; LLColor4 mErrorTextColor; @@ -153,7 +161,6 @@ protected: boost::signals2::connection mSelectionUpdateSlot; boost::signals2::connection mRegionBoundaryCrossingSlot; LLAgent::god_level_change_slot_t mGodLevelChangeSlot; - }; #endif // LL_LLFLOATERPATHFINDINGOBJECTS_H diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index cde3777414..65fcedf2f5 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -52,6 +52,7 @@ LLPathfindingObject::LLPathfindingObject() mName(), mDescription(), mOwnerUUID(), + mHasOwnerName(false), mOwnerName(), mLocation() { @@ -62,6 +63,7 @@ LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &p mName(), mDescription(), mOwnerUUID(), + mHasOwnerName(false), mOwnerName(), mLocation() { @@ -73,9 +75,11 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther) mName(pOther.mName), mDescription(pOther.mDescription), mOwnerUUID(pOther.mOwnerUUID), - mOwnerName(pOther.mOwnerName), + mHasOwnerName(false), + mOwnerName(), mLocation(pOther.mLocation) { + fetchOwnerName(); } LLPathfindingObject::~LLPathfindingObject() @@ -88,7 +92,7 @@ LLPathfindingObject &LLPathfindingObject::operator =(const LLPathfindingObject& mName = pOther.mName; mDescription = pOther.mDescription; mOwnerUUID = pOther.mOwnerUUID; - mOwnerName = pOther.mOwnerName; + fetchOwnerName(); mLocation = pOther.mLocation; return *this; @@ -98,7 +102,7 @@ std::string LLPathfindingObject::getOwnerName() const { std::string ownerName; - if (hasOwnerName()) + if (hasOwner()) { ownerName = mOwnerName.getCompleteName(); } @@ -126,7 +130,7 @@ void LLPathfindingObject::parseObjectData(const LLSD &pObjectData) { llassert(pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).isUUID()); mOwnerUUID = pObjectData.get(PATHFINDING_OBJECT_OWNER_FIELD).asUUID(); - LLAvatarNameCache::get(mOwnerUUID, &mOwnerName); + fetchOwnerName(); } #endif // SERVER_SIDE_OWNER_ROLLOUT_COMPLETE @@ -134,3 +138,19 @@ void LLPathfindingObject::parseObjectData(const LLSD &pObjectData) llassert(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD).isArray()); mLocation.setValue(pObjectData.get(PATHFINDING_OBJECT_POSITION_FIELD)); } + +void LLPathfindingObject::fetchOwnerName() +{ + mHasOwnerName = false; + if (hasOwner()) + { + LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2)); + } +} + +void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName) +{ + llassert(mOwnerUUID == pOwnerUUID); + mOwnerName = pAvatarName; + mHasOwnerName = true; +} diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 880a3a6864..924ea3f298 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -53,7 +53,8 @@ public: inline const LLUUID& getUUID() const {return mUUID;}; inline const std::string& getName() const {return mName;}; inline const std::string& getDescription() const {return mDescription;}; - inline BOOL hasOwnerName() const {return mOwnerUUID.notNull();}; + inline BOOL hasOwner() const {return mOwnerUUID.notNull();}; + inline bool hasOwnerName() const {return mHasOwnerName;}; std::string getOwnerName() const; inline const LLVector3& getLocation() const {return mLocation;}; @@ -62,10 +63,14 @@ protected: private: void parseObjectData(const LLSD &pObjectData); + void fetchOwnerName(); + void handleAvatarNameFetch(const LLUUID &pOwnerUUID, const LLAvatarName &pAvatarName); + LLUUID mUUID; std::string mName; std::string mDescription; LLUUID mOwnerUUID; + bool mHasOwnerName; LLAvatarName mOwnerName; LLVector3 mLocation; }; diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml index fac6ee05bb..054b2674f2 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml @@ -23,6 +23,8 @@ [NUM_SELECTED] characters selected out of [NUM_TOTAL]. This region is not enabled for pathfinding. [CPU_TIME] µs + [Loading] + Unknown -- -- -- + [Loading] Unknown Walkable Static obstacle -- cgit v1.3 From 685a672b74550ca0dbf8a816257c84c9c44fd34d Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Thu, 28 Jun 2012 15:37:55 -0700 Subject: Cleaning up new files in preparation for merge into viewer-release. --- indra/newview/llfloaterpathfindingcharacters.cpp | 4 ++ indra/newview/llfloaterpathfindingcharacters.h | 6 ++- indra/newview/llfloaterpathfindingconsole.cpp | 51 ++++++++++++---------- indra/newview/llfloaterpathfindingconsole.h | 23 +++++----- indra/newview/llfloaterpathfindinglinksets.cpp | 4 ++ indra/newview/llfloaterpathfindinglinksets.h | 49 +++++++++++---------- indra/newview/llfloaterpathfindingobjects.cpp | 2 - indra/newview/llfloaterpathfindingobjects.h | 1 + indra/newview/llpanelpathfindingrebakenavmesh.cpp | 5 +-- indra/newview/llpanelpathfindingrebakenavmesh.h | 3 -- indra/newview/llpathfindingcharacter.cpp | 2 + indra/newview/llpathfindingcharacter.h | 4 +- indra/newview/llpathfindingmanager.cpp | 47 ++++++++++++-------- indra/newview/llpathfindingmanager.h | 10 ++--- indra/newview/llpathfindingnavmesh.cpp | 6 ++- indra/newview/llpathfindingnavmesh.h | 5 +-- indra/newview/llpathfindingnavmeshstatus.cpp | 2 +- indra/newview/llpathfindingnavmeshstatus.h | 4 +- indra/newview/llpathfindingnavmeshzone.cpp | 25 ++++++----- indra/newview/llpathfindingnavmeshzone.h | 13 +++--- indra/newview/llpathfindingobject.cpp | 2 +- indra/newview/llpathfindingobject.h | 8 ++-- indra/newview/llpathfindingobjectlist.h | 1 - indra/newview/llpathfindingpathtool.cpp | 10 ++--- indra/newview/llpathfindingpathtool.h | 8 ++-- .../xui/en/floater_pathfinding_characters.xml | 16 +++---- .../skins/default/xui/en/panel_navmesh_rebake.xml | 1 - 27 files changed, 167 insertions(+), 145 deletions(-) (limited to 'indra/newview/llpathfindingobject.h') diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index c20e78ade1..739e56a7c3 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -40,11 +40,15 @@ #include "llpathfindingobject.h" #include "llpathfindingobjectlist.h" #include "llpathinglib.h" +#include "llquaternion.h" #include "llsd.h" #include "lluicolortable.h" +#include "lluuid.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "pipeline.h" +#include "v3math.h" +#include "v4color.h" LLHandle LLFloaterPathfindingCharacters::sInstanceHandle; diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h index 94cc39a06a..ef389ad428 100644 --- a/indra/newview/llfloaterpathfindingcharacters.h +++ b/indra/newview/llfloaterpathfindingcharacters.h @@ -30,10 +30,14 @@ #include "llfloaterpathfindingobjects.h" #include "llhandle.h" #include "llpathfindingobjectlist.h" +#include "lluuid.h" #include "v4color.h" +class LLCheckBoxCtrl; class LLPathfindingCharacter; +class LLQuaternion; class LLSD; +class LLVector3; class LLFloaterPathfindingCharacters : public LLFloaterPathfindingObjects { @@ -43,7 +47,7 @@ public: BOOL isShowPhysicsCapsule() const; void setShowPhysicsCapsule(BOOL pIsShowPhysicsCapsule); - BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot ) const; + BOOL isPhysicsCapsuleEnabled(LLUUID& id, LLVector3& pos, LLQuaternion& rot) const; static void openCharactersWithSelectedObjects(); static LLHandle getInstanceHandle(); diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 0bd5dc0263..2fe60a8d8f 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -30,30 +30,31 @@ #include "llfloaterpathfindingconsole.h" -#include "llfloaterpathfindinglinksets.h" -#include "llfloaterpathfindingcharacters.h" +#include + +#include -#include "llsd.h" -#include "llhandle.h" -#include "llcontrol.h" -#include "llpanel.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llsliderctrl.h" -#include "lllineeditor.h" -#include "lltextbase.h" -#include "lltabcontainer.h" #include "llcombobox.h" +#include "llcontrol.h" +#include "llenvmanager.h" +#include "llfloaterpathfindingcharacters.h" +#include "llfloaterpathfindinglinksets.h" #include "llfloaterreg.h" +#include "llhandle.h" +#include "llpanel.h" #include "llpathfindingnavmeshzone.h" -#include "llpathfindingmanager.h" -#include "llenvmanager.h" #include "llpathfindingpathtool.h" +#include "llpathinglib.h" +#include "llsliderctrl.h" +#include "llsd.h" +#include "lltabcontainer.h" +#include "lltextbase.h" #include "lltoolmgr.h" #include "lltoolfocus.h" -#include "pipeline.h" -#include "llpathinglib.h" #include "llviewerparcelmgr.h" +#include "pipeline.h" #define XUI_RENDER_HEATMAP_NONE 0 #define XUI_RENDER_HEATMAP_A 1 @@ -89,8 +90,6 @@ LLHandle LLFloaterPathfindingConsole::sInstanceHandle; -extern LLPipeline gPipeline; - //--------------------------------------------------------------------------- // LLFloaterPathfindingConsole //--------------------------------------------------------------------------- @@ -213,7 +212,7 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) { if (!mNavMeshZoneSlot.connected()) { - mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::onNavMeshZoneCB, this, _1)); + mNavMeshZoneSlot = mNavMeshZone.registerNavMeshZoneListener(boost::bind(&LLFloaterPathfindingConsole::handleNavMeshZoneStatus, this, _1)); } mIsNavMeshUpdating = false; @@ -500,9 +499,10 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mSavedSettingNavMeshFaceSlot(), mSavedSettingTestPathValidEndSlot(), mSavedSettingTestPathInvalidEndSlot(), - mSavedSettingWaterSlot(), mSavedSettingTestPathSlot(), - mConsoleState(kConsoleStateUnknown) + mSavedSettingWaterSlot(), + mConsoleState(kConsoleStateUnknown), + mRenderableRestoreList() { mSelfHandle.bind(this); } @@ -541,7 +541,10 @@ void LLFloaterPathfindingConsole::onShowNavMeshSet() void LLFloaterPathfindingConsole::onShowWalkabilitySet() { - LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType()); + if (LLPathingLib::getInstance() != NULL) + { + LLPathingLib::getInstance()->setNavMeshMaterialType(getRenderHeatmapType()); + } } void LLFloaterPathfindingConsole::onCharacterWidthSet() @@ -559,7 +562,7 @@ void LLFloaterPathfindingConsole::onClearPathClicked() clearPath(); } -void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus) +void LLFloaterPathfindingConsole::handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus) { switch (pNavMeshZoneRequestStatus) { @@ -641,6 +644,7 @@ void LLFloaterPathfindingConsole::setDefaultInputs() { mViewTestTabContainer->selectTab(XUI_VIEW_TAB_INDEX); setRenderWorld(TRUE); + setRenderWorldMovablesOnly(FALSE); setRenderNavMesh(FALSE); setRenderWalkables(FALSE); setRenderMaterialVolumes(FALSE); @@ -648,7 +652,6 @@ void LLFloaterPathfindingConsole::setDefaultInputs() setRenderExclusionVolumes(FALSE); setRenderWaterPlane(FALSE); setRenderXRay(FALSE); - setRenderWorldMovablesOnly(FALSE); } void LLFloaterPathfindingConsole::setConsoleState(EConsoleState pConsoleState) @@ -1205,6 +1208,10 @@ void LLFloaterPathfindingConsole::deregisterSavedSettingsListeners() { mSavedSettingTestPathSlot.disconnect(); } + if (mSavedSettingWaterSlot.connected()) + { + mSavedSettingWaterSlot.disconnect(); + } } void LLFloaterPathfindingConsole::handleRetrieveNeighborChange(LLControlVariable *pControl, const LLSD &pNewValue) diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index 97300520d6..4b2f7672e4 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -27,26 +27,27 @@ #ifndef LL_LLFLOATERPATHFINDINGCONSOLE_H #define LL_LLFLOATERPATHFINDINGCONSOLE_H +#include + +#include + #include "llfloater.h" #include "llhandle.h" -#include "llpathinglib.h" #include "llpathfindingnavmeshzone.h" #include "llpathfindingpathtool.h" +#include "llpathinglib.h" #include "v4color.h" -#include - -class LLSD; +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLControlVariable; class LLPanel; +class LLSD; class LLSliderCtrl; -class LLLineEditor; -class LLTextBase; -class LLCheckBoxCtrl; class LLTabContainer; -class LLComboBox; -class LLButton; +class LLTextBase; class LLToolset; -class LLControlVariable; class LLFloaterPathfindingConsole : public LLFloater @@ -122,7 +123,7 @@ private: void onCharacterTypeSwitch(); void onClearPathClicked(); - void onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); + void handleNavMeshZoneStatus(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); void onRegionBoundaryCross(); void onPathEvent(); diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index ae83bcfaee..15490ff87e 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -30,11 +30,14 @@ #include "llfloaterpathfindinglinksets.h" +#include + #include #include "llagent.h" #include "llbutton.h" #include "llcombobox.h" +#include "llfloaterpathfindingobjects.h" #include "llfloaterreg.h" #include "lllineeditor.h" #include "llnotificationsutil.h" @@ -46,6 +49,7 @@ #include "lltextbase.h" #include "lltextvalidate.h" #include "lluicolortable.h" +#include "lluictrl.h" #include "v3math.h" #include "v4color.h" diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 2db41ce479..b3e7acfbfe 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -27,9 +27,10 @@ #ifndef LL_LLFLOATERPATHFINDINGLINKSETS_H #define LL_LLFLOATERPATHFINDINGLINKSETS_H +#include + #include "llfloaterpathfindingobjects.h" #include "llpathfindinglinkset.h" -#include "llpathfindingmanager.h" #include "llpathfindingobjectlist.h" #include "v4color.h" @@ -102,29 +103,29 @@ private: LLPathfindingLinkset::ELinksetUse convertToLinksetUse(LLSD pXuiValue) const; LLSD convertToXuiValue(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; - LLLineEditor *mFilterByName; - LLLineEditor *mFilterByDescription; - LLComboBox *mFilterByLinksetUse; - LLComboBox *mEditLinksetUse; - LLScrollListItem *mEditLinksetUseUnset; - LLScrollListItem *mEditLinksetUseWalkable; - LLScrollListItem *mEditLinksetUseStaticObstacle; - LLScrollListItem *mEditLinksetUseDynamicObstacle; - LLScrollListItem *mEditLinksetUseMaterialVolume; - LLScrollListItem *mEditLinksetUseExclusionVolume; - LLScrollListItem *mEditLinksetUseDynamicPhantom; - LLTextBase *mLabelWalkabilityCoefficients; - LLTextBase *mLabelEditA; - LLLineEditor *mEditA; - LLTextBase *mLabelEditB; - LLLineEditor *mEditB; - LLTextBase *mLabelEditC; - LLLineEditor *mEditC; - LLTextBase *mLabelEditD; - LLLineEditor *mEditD; - LLButton *mApplyEditsButton; - - LLColor4 mBeaconColor; + LLLineEditor *mFilterByName; + LLLineEditor *mFilterByDescription; + LLComboBox *mFilterByLinksetUse; + LLComboBox *mEditLinksetUse; + LLScrollListItem *mEditLinksetUseUnset; + LLScrollListItem *mEditLinksetUseWalkable; + LLScrollListItem *mEditLinksetUseStaticObstacle; + LLScrollListItem *mEditLinksetUseDynamicObstacle; + LLScrollListItem *mEditLinksetUseMaterialVolume; + LLScrollListItem *mEditLinksetUseExclusionVolume; + LLScrollListItem *mEditLinksetUseDynamicPhantom; + LLTextBase *mLabelWalkabilityCoefficients; + LLTextBase *mLabelEditA; + LLLineEditor *mEditA; + LLTextBase *mLabelEditB; + LLLineEditor *mEditB; + LLTextBase *mLabelEditC; + LLLineEditor *mEditC; + LLTextBase *mLabelEditD; + LLLineEditor *mEditD; + LLButton *mApplyEditsButton; + + LLColor4 mBeaconColor; }; #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index da664038cf..847997836b 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -57,7 +57,6 @@ #include "llviewerobject.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "pipeline.h" #include "v3dmath.h" #include "v3math.h" #include "v4color.h" @@ -835,4 +834,3 @@ LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollLis return objectPtr; } - diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 42db7bba65..e8d446b598 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -28,6 +28,7 @@ #define LL_LLFLOATERPATHFINDINGOBJECTS_H #include + #include #include "llagent.h" diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.cpp b/indra/newview/llpanelpathfindingrebakenavmesh.cpp index f423b5891f..2c8c46c7bc 100644 --- a/indra/newview/llpanelpathfindingrebakenavmesh.cpp +++ b/indra/newview/llpanelpathfindingrebakenavmesh.cpp @@ -36,7 +36,6 @@ #include "llagent.h" #include "llbutton.h" #include "llenvmanager.h" -#include "llhandle.h" #include "llhints.h" #include "llnotificationsutil.h" #include "llpanel.h" @@ -45,9 +44,7 @@ #include "llpathfindingnavmeshstatus.h" #include "lltoolbar.h" #include "lltoolbarview.h" -#include "lltoolmgr.h" #include "lltooltip.h" -#include "llview.h" #include "llviewercontrol.h" #include "llviewerregion.h" @@ -218,6 +215,7 @@ void LLPanelPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNav void LLPanelPathfindingRebakeNavmesh::handleRegionBoundaryCrossed() { createNavMeshStatusListenerForCurrentRegion(); + mCanRebakeRegion = FALSE; LLPathfindingManager::getInstance()->requestGetAgentState(); } @@ -227,7 +225,6 @@ void LLPanelPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegio { mNavMeshSlot.disconnect(); } - mCanRebakeRegion = FALSE; LLViewerRegion *currentRegion = gAgent.getRegion(); if (currentRegion != NULL) diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.h b/indra/newview/llpanelpathfindingrebakenavmesh.h index a77cddbc50..5fe581ec2f 100644 --- a/indra/newview/llpanelpathfindingrebakenavmesh.h +++ b/indra/newview/llpanelpathfindingrebakenavmesh.h @@ -27,17 +27,14 @@ #ifndef LL_LLPANELPATHFINDINGREBAKENAVMESH_H #define LL_LLPANELPATHFINDINGREBAKENAVMESH_H -#include #include -#include "llhandle.h" #include "llpanel.h" #include "llpathfindingmanager.h" #include "llpathfindingnavmesh.h" class LLButton; class LLPathfindingNavMeshStatus; -class LLView; class LLPanelPathfindingRebakeNavmesh : public LLPanel { diff --git a/indra/newview/llpathfindingcharacter.cpp b/indra/newview/llpathfindingcharacter.cpp index 9dd9fa503b..00f2ebc4bb 100644 --- a/indra/newview/llpathfindingcharacter.cpp +++ b/indra/newview/llpathfindingcharacter.cpp @@ -30,6 +30,8 @@ #include "llpathfindingcharacter.h" +#include + #include "llpathfindingobject.h" #include "llsd.h" diff --git a/indra/newview/llpathfindingcharacter.h b/indra/newview/llpathfindingcharacter.h index 6317f5224a..7cf9f401b0 100644 --- a/indra/newview/llpathfindingcharacter.h +++ b/indra/newview/llpathfindingcharacter.h @@ -27,6 +27,8 @@ #ifndef LL_LLPATHFINDINGCHARACTER_H #define LL_LLPATHFINDINGCHARACTER_H +#include + #include "llpathfindingobject.h" class LLSD; @@ -48,8 +50,6 @@ public: protected: -public: - private: void parseCharacterData(const LLSD &pCharacterData); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 90199a9cae..2dd01e931e 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -33,7 +33,9 @@ #include #include +#include #include +#include #include #include "llagent.h" @@ -53,7 +55,6 @@ #include "lluuid.h" #include "llviewerregion.h" #include "llweb.h" -#include "llenvmanager.h" #define CAP_SERVICE_RETRIEVE_NAVMESH "RetrieveNavMeshSrc" @@ -366,12 +367,6 @@ void LLPathfindingManager::requestGetNavMeshForRegion(LLViewerRegion *pRegion, b } } -LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) -{ - return mAgentStateSignal.connect(pAgentStateCallback); -} - - void LLPathfindingManager::requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const { LLPathfindingObjectListPtr emptyLinksetListPtr; @@ -495,6 +490,11 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ } } +LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateListener(agent_state_callback_t pAgentStateCallback) +{ + return mAgentStateSignal.connect(pAgentStateCallback); +} + void LLPathfindingManager::requestGetAgentState() { LLViewerRegion *currentRegion = getCurrentRegion(); @@ -525,14 +525,24 @@ void LLPathfindingManager::requestGetAgentState() void LLPathfindingManager::requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback) { - std::string navMeshStatusURL = getNavMeshStatusURLForCurrentRegion(); - llassert(!navMeshStatusURL.empty()) - if (!navMeshStatusURL.empty()) + LLViewerRegion *currentRegion = getCurrentRegion(); + + if (currentRegion == NULL) + { + pRebakeNavMeshCallback(false); + } + else if (!isPathfindingEnabledForRegion(currentRegion)) { - LLSD mPostData; - mPostData["command"] = "rebuild"; + pRebakeNavMeshCallback(false); + } + else + { + std::string navMeshStatusURL = getNavMeshStatusURLForCurrentRegion(); + llassert(!navMeshStatusURL.empty()); + LLSD postData; + postData["command"] = "rebuild"; LLHTTPClient::ResponderPtr responder = new NavMeshRebakeResponder(navMeshStatusURL, pRebakeNavMeshCallback); - LLHTTPClient::post(navMeshStatusURL, mPostData, responder); + LLHTTPClient::post(navMeshStatusURL, postData, responder); } } @@ -673,11 +683,6 @@ LLPathfindingNavMeshPtr LLPathfindingManager::getNavMeshForRegion(LLViewerRegion return getNavMeshForRegion(regionUUID); } -std::string LLPathfindingManager::getAgentStateURLForRegion(LLViewerRegion *pRegion) const -{ - return getCapabilityURLForRegion(pRegion, CAP_SERVICE_AGENT_STATE); -} - std::string LLPathfindingManager::getNavMeshStatusURLForCurrentRegion() const { return getNavMeshStatusURLForRegion(getCurrentRegion()); @@ -708,6 +713,11 @@ std::string LLPathfindingManager::getCharactersURLForCurrentRegion() const return getCapabilityURLForCurrentRegion(CAP_SERVICE_CHARACTERS); } +std::string LLPathfindingManager::getAgentStateURLForRegion(LLViewerRegion *pRegion) const +{ + return getCapabilityURLForRegion(pRegion, CAP_SERVICE_AGENT_STATE); +} + std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const { return getCapabilityURLForRegion(getCurrentRegion(), pCapabilityName); @@ -1037,4 +1047,3 @@ void CharactersResponder::error(U32 pStatus, const std::string &pReason) LLPathfindingObjectListPtr characterListPtr = LLPathfindingObjectListPtr(new LLPathfindingCharacterList()); mCharactersCallback(mRequestId, LLPathfindingManager::kRequestError, characterListPtr); } - diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 65589fe3a0..c61ff244fc 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -37,12 +37,10 @@ #include "llpathfindingobjectlist.h" #include "llpathfindingnavmesh.h" #include "llsingleton.h" -#include "lluuid.h" -#include "llpanel.h" -#include "llmoveview.h" -class LLViewerRegion; class LLPathfindingNavMeshStatus; +class LLUUID; +class LLViewerRegion; class LLPathfindingManager : public LLSingleton { @@ -51,8 +49,6 @@ class LLPathfindingManager : public LLSingleton friend class LLAgentStateChangeNode; friend class AgentStateResponder; public: - typedef std::map NavMeshMap; - typedef enum { kRequestStarted, kRequestCompleted, @@ -96,6 +92,8 @@ public: protected: private: + typedef std::map NavMeshMap; + void sendRequestGetNavMeshForRegion(LLPathfindingNavMeshPtr navMeshPtr, LLViewerRegion *pRegion, const LLPathfindingNavMeshStatus &pNavMeshStatus); void handleDeferredGetAgentStateForRegion(const LLUUID &pRegionUUID); diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index 1a49560712..e01dd3a152 100644 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -30,12 +30,13 @@ #include "llpathfindingnavmesh.h" +#include + #include "llpathfindingnavmeshstatus.h" +#include "llsd.h" #include "llsdserialize.h" #include "lluuid.h" -#include - #define NAVMESH_VERSION_FIELD "navmesh_version" #define NAVMESH_DATA_FIELD "navmesh_data" @@ -119,6 +120,7 @@ void LLPathfindingNavMesh::handleNavMeshStart(const LLPathfindingNavMeshStatus & void LLPathfindingNavMesh::handleNavMeshResult(const LLSD &pContent, U32 pNavMeshVersion) { + llassert(pContent.has(NAVMESH_VERSION_FIELD)); if (pContent.has(NAVMESH_VERSION_FIELD)) { llassert(pContent.get(NAVMESH_VERSION_FIELD).isInteger()); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 17618d8724..7a844f54ce 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -27,8 +27,6 @@ #ifndef LL_LLPATHFINDINGNAVMESH_H #define LL_LLPATHFINDINGNAVMESH_H -#include "llsd.h" - #include #include @@ -36,9 +34,10 @@ #include #include "llpathfindingnavmeshstatus.h" +#include "llsd.h" -class LLUUID; class LLPathfindingNavMesh; +class LLUUID; typedef boost::shared_ptr LLPathfindingNavMeshPtr; diff --git a/indra/newview/llpathfindingnavmeshstatus.cpp b/indra/newview/llpathfindingnavmeshstatus.cpp index 4bb0bc5a18..2eaa6075ca 100644 --- a/indra/newview/llpathfindingnavmeshstatus.cpp +++ b/indra/newview/llpathfindingnavmeshstatus.cpp @@ -33,8 +33,8 @@ #include #include "llsd.h" -#include "lluuid.h" #include "llstring.h" +#include "lluuid.h" #define REGION_FIELD "region_id" #define STATUS_FIELD "status" diff --git a/indra/newview/llpathfindingnavmeshstatus.h b/indra/newview/llpathfindingnavmeshstatus.h index 3834aa2ab8..74533fa484 100644 --- a/indra/newview/llpathfindingnavmeshstatus.h +++ b/indra/newview/llpathfindingnavmeshstatus.h @@ -27,10 +27,10 @@ #ifndef LL_LLPATHFINDINGNAVMESHSTATUS_H #define LL_LLPATHFINDINGNAVMESHSTATUS_H -#include "lluuid.h" - #include +#include "lluuid.h" + class LLSD; class LLPathfindingNavMeshStatus diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 0298eedfef..e190dbba65 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -30,20 +30,22 @@ #include "llpathfindingnavmeshzone.h" -#include "llsd.h" -#include "lluuid.h" -#include "llagent.h" -#include "llviewerregion.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingmanager.h" -#include "llviewercontrol.h" - -#include "llpathinglib.h" - -#include #include #include +#include +#include +#include + +#include "llagent.h" +#include "llpathfindingmanager.h" +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llpathinglib.h" +#include "llsd.h" +#include "lluuid.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" #define CENTER_REGION 99 @@ -104,7 +106,6 @@ void LLPathfindingNavMeshZone::disable() void LLPathfindingNavMeshZone::refresh() { - llassert(LLPathingLib::getInstance() != NULL); if (LLPathingLib::getInstance() != NULL) { LLPathingLib::getInstance()->cleanupResidual(); diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 0229de50ec..baa1cc5979 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -27,19 +27,18 @@ #ifndef LL_LLPATHFINDINGNAVMESHZONE_H #define LL_LLPATHFINDINGNAVMESHZONE_H -#include "llsd.h" -#include "lluuid.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" -#include "llviewerregion.h" - #include #include #include #include -class LLPathfindingNavMeshStatus; +#include "llpathfindingnavmesh.h" +#include "llpathfindingnavmeshstatus.h" +#include "llsd.h" +#include "lluuid.h" + +class LLViewerRegion; class LLPathfindingNavMeshZone { diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp index 65fcedf2f5..f5c0f7874d 100644 --- a/indra/newview/llpathfindingobject.cpp +++ b/indra/newview/llpathfindingobject.cpp @@ -32,11 +32,11 @@ #include -#include "v3math.h" #include "llavatarname.h" #include "llavatarnamecache.h" #include "llsd.h" #include "lluuid.h" +#include "v3math.h" #define PATHFINDING_OBJECT_NAME_FIELD "name" #define PATHFINDING_OBJECT_DESCRIPTION_FIELD "description" diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 924ea3f298..4b2d546bb1 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -27,14 +27,14 @@ #ifndef LL_LLPATHFINDINGOBJECT_H #define LL_LLPATHFINDINGOBJECT_H -#include "llavatarname.h" -#include "lluuid.h" -#include "v3math.h" - #include #include +#include "llavatarname.h" +#include "lluuid.h" +#include "v3math.h" + class LLPathfindingObject; class LLSD; diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 94c53f3aba..3ad8e8b096 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -34,7 +34,6 @@ #include "llpathfindingobject.h" -class LLSD; class LLPathfindingObjectList; typedef boost::shared_ptr LLPathfindingObjectListPtr; diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index ac4a2fffb9..006755e20b 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -30,17 +30,17 @@ #include "llpathfindingpathtool.h" +#include +#include + #include "llagent.h" +#include "llpathfindingmanager.h" +#include "llpathinglib.h" #include "llsingleton.h" #include "lltool.h" #include "llviewercamera.h" #include "llviewerregion.h" #include "llviewerwindow.h" -#include "llpathfindingmanager.h" -#include "llpathinglib.h" - -#include -#include #define PATH_TOOL_NAME "PathfindingPathTool" diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index e0db87d1ed..97284265f1 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -27,13 +27,13 @@ #ifndef LL_LLPATHFINDINGPATHTOOL_H #define LL_LLPATHFINDINGPATHTOOL_H -#include "llsingleton.h" -#include "lltool.h" -#include "llpathinglib.h" - #include #include +#include "llpathinglib.h" +#include "llsingleton.h" +#include "lltool.h" + class LLPathfindingPathTool : public LLTool, public LLSingleton { public: diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml index c1f1f60c1b..4331e1f340 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml @@ -150,14 +150,14 @@ left_pad="0" width="150" /> + height="19" + follows="left|bottom" + label="Show physics capsule" + layout="topleft" + name="show_physics_capsule" + top_pad="-19" + left_pad="0" + width="150" />