From 58f299fb8ab409545b5ea386eb60965486e3d380 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 27 Jan 2012 18:03:04 -0800 Subject: PATH-187: Moving the filtered pathfinding linksets class into its own file. --- indra/newview/CMakeLists.txt | 6 +- indra/newview/llfilteredpathfindinglinksets.cpp | 313 +++++++++++++++++++++ indra/newview/llfilteredpathfindinglinksets.h | 111 ++++++++ indra/newview/llfloaterpathfindinglinksets.cpp | 306 +-------------------- indra/newview/llfloaterpathfindinglinksets.h | 120 ++------- indra/newview/llpathfindinglinkset.cpp | 344 ++++++++++++++++++++++++ indra/newview/llpathfindinglinkset.h | 108 ++++++++ indra/newview/llpathfindinglinksets.cpp | 344 ------------------------ indra/newview/llpathfindinglinksets.h | 108 -------- 9 files changed, 918 insertions(+), 842 deletions(-) create mode 100644 indra/newview/llfilteredpathfindinglinksets.cpp create mode 100644 indra/newview/llfilteredpathfindinglinksets.h create mode 100644 indra/newview/llpathfindinglinkset.cpp create mode 100644 indra/newview/llpathfindinglinkset.h delete mode 100644 indra/newview/llpathfindinglinksets.cpp delete mode 100644 indra/newview/llpathfindinglinksets.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 194c7d35bb..2e4c537942 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -162,6 +162,7 @@ set(viewer_SOURCE_FILES llfavoritesbar.cpp llfeaturemanager.cpp llfilepicker.cpp + llfilteredpathfindinglinksets.cpp llfilteredwearablelist.cpp llfirstuse.cpp llflexibleobject.cpp @@ -415,7 +416,7 @@ set(viewer_SOURCE_FILES llparcelselection.cpp llparticipantlist.cpp llpatchvertexarray.cpp - llpathfindinglinksets.cpp + llpathfindinglinkset.cpp llphysicsmotion.cpp llphysicsshapebuilderutil.cpp llplacesinventorybridge.cpp @@ -722,6 +723,7 @@ set(viewer_HEADER_FILES llfavoritesbar.h llfeaturemanager.h llfilepicker.h + llfilteredpathfindinglinksets.h llfilteredwearablelist.h llfirstuse.h llflexibleobject.h @@ -964,7 +966,7 @@ set(viewer_HEADER_FILES llparcelselection.h llparticipantlist.h llpatchvertexarray.h - llpathfindinglinksets.h + llpathfindinglinkset.h llphysicsmotion.h llphysicsshapebuilderutil.h llplacesinventorybridge.h diff --git a/indra/newview/llfilteredpathfindinglinksets.cpp b/indra/newview/llfilteredpathfindinglinksets.cpp new file mode 100644 index 0000000000..c956a5752b --- /dev/null +++ b/indra/newview/llfilteredpathfindinglinksets.cpp @@ -0,0 +1,313 @@ +/** + * @file llfilteredpathfindinglinksets.h + * @author William Todd Stinson + * @brief Class to implement the filtering of a set of pathfinding linksets + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include +#include + +#include "llsd.h" +#include "lluuid.h" +#include "llpathfindinglinkset.h" +#include "llfilteredpathfindinglinksets.h" + +//--------------------------------------------------------------------------- +// FilterString +//--------------------------------------------------------------------------- + +FilterString::FilterString() + : mFilter(), + mUpperFilter() +{ +} + +FilterString::FilterString(const std::string& pFilter) + : mFilter(pFilter), + mUpperFilter() +{ + LLStringUtil::trim(mFilter); + mUpperFilter = mFilter; + if (!mUpperFilter.empty()) + { + LLStringUtil::toUpper(mUpperFilter); + } +} + +FilterString::~FilterString() +{ +} + +const std::string& FilterString::get() const +{ + return mFilter; +} + +bool FilterString::set(const std::string& pFilter) +{ + std::string newFilter(pFilter); + LLStringUtil::trim(newFilter); + bool didFilterChange = (mFilter.compare(newFilter) != 0); + if (didFilterChange) + { + mFilter = newFilter; + mUpperFilter = newFilter; + LLStringUtil::toUpper(mUpperFilter); + } + + return didFilterChange; +} + +void FilterString::clear() +{ + mFilter.clear(); + mUpperFilter.clear(); +} + +bool FilterString::isActive() const +{ + return !mFilter.empty(); +} + +bool FilterString::doesMatch(const std::string& pTestString) const +{ + bool doesMatch = true; + + if (isActive()) + { + std::string upperTestString(pTestString); + LLStringUtil::toUpper(upperTestString); + doesMatch = (upperTestString.find(mUpperFilter) != std::string::npos); + } + + return doesMatch; +} + +//--------------------------------------------------------------------------- +// LLFilteredPathfindingLinksets +//--------------------------------------------------------------------------- + +LLFilteredPathfindingLinksets::LLFilteredPathfindingLinksets() + : mAllLinksets(), + mFilteredLinksets(), + mIsFiltersDirty(false), + mNameFilter(), + mDescriptionFilter(), + mIsWalkableFilter(true), + mIsObstacleFilter(true), + mIsIgnoredFilter(true) +{ +} + +LLFilteredPathfindingLinksets::LLFilteredPathfindingLinksets(const LLSD& pNavMeshData) + : mAllLinksets(), + mFilteredLinksets(), + mIsFiltersDirty(false), + mNameFilter(), + mDescriptionFilter(), + mIsWalkableFilter(true), + mIsObstacleFilter(true), + mIsIgnoredFilter(true) +{ + setPathfindingLinksets(pNavMeshData); +} + +LLFilteredPathfindingLinksets::LLFilteredPathfindingLinksets(const LLFilteredPathfindingLinksets& pOther) + : mAllLinksets(pOther.mAllLinksets), + mFilteredLinksets(pOther.mFilteredLinksets), + mIsFiltersDirty(pOther.mIsFiltersDirty), + mNameFilter(pOther.mNameFilter), + mDescriptionFilter(pOther.mDescriptionFilter), + mIsWalkableFilter(pOther.mIsWalkableFilter), + mIsObstacleFilter(pOther.mIsObstacleFilter), + mIsIgnoredFilter(pOther.mIsIgnoredFilter) +{ +} + +LLFilteredPathfindingLinksets::~LLFilteredPathfindingLinksets() +{ + clearPathfindingLinksets(); +} + +void LLFilteredPathfindingLinksets::setPathfindingLinksets(const LLSD& pNavMeshData) +{ + clearPathfindingLinksets(); + + for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap(); + navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter) + { + const std::string& uuid(navMeshDataIter->first); + const LLSD& linksetData = navMeshDataIter->second; + LLPathfindingLinkset linkset(uuid, linksetData); + + mAllLinksets.insert(std::pair(uuid, linkset)); + } + + mIsFiltersDirty = true; +} + +void LLFilteredPathfindingLinksets::updatePathfindingLinksets(const LLSD& pNavMeshData) +{ + for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap(); + navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter) + { + const std::string& uuid(navMeshDataIter->first); + const LLSD& linksetData = navMeshDataIter->second; + LLPathfindingLinkset linkset(uuid, linksetData); + + PathfindingLinksetMap::iterator linksetIter = mAllLinksets.find(uuid); + if (linksetIter == mAllLinksets.end()) + { + mAllLinksets.insert(std::pair(uuid, linkset)); + } + else + { + linksetIter->second = linkset; + } + } + + mIsFiltersDirty = true; +} + +void LLFilteredPathfindingLinksets::clearPathfindingLinksets() +{ + mAllLinksets.clear(); + mFilteredLinksets.clear(); + mIsFiltersDirty = false; +} + +const LLFilteredPathfindingLinksets::PathfindingLinksetMap& LLFilteredPathfindingLinksets::getAllLinksets() const +{ + return mAllLinksets; +} + +const LLFilteredPathfindingLinksets::PathfindingLinksetMap& LLFilteredPathfindingLinksets::getFilteredLinksets() +{ + if (!isFiltersActive()) + { + return mAllLinksets; + } + else + { + applyFilters(); + return mFilteredLinksets; + } +} + +BOOL LLFilteredPathfindingLinksets::isFiltersActive() const +{ + return (mNameFilter.isActive() || mDescriptionFilter.isActive() || !mIsWalkableFilter || !mIsObstacleFilter || !mIsIgnoredFilter); +} + +void LLFilteredPathfindingLinksets::setNameFilter(const std::string& pNameFilter) +{ + mIsFiltersDirty = (mNameFilter.set(pNameFilter) || mIsFiltersDirty); +} + +const std::string& LLFilteredPathfindingLinksets::getNameFilter() const +{ + return mNameFilter.get(); +} + +void LLFilteredPathfindingLinksets::setDescriptionFilter(const std::string& pDescriptionFilter) +{ + mIsFiltersDirty = (mDescriptionFilter.set(pDescriptionFilter) || mIsFiltersDirty); +} + +const std::string& LLFilteredPathfindingLinksets::getDescriptionFilter() const +{ + return mDescriptionFilter.get(); +} + +void LLFilteredPathfindingLinksets::setWalkableFilter(BOOL pWalkableFilter) +{ + mIsFiltersDirty = (mIsFiltersDirty || (mIsWalkableFilter == pWalkableFilter)); + mIsWalkableFilter = pWalkableFilter; +} + +BOOL LLFilteredPathfindingLinksets::isWalkableFilter() const +{ + return mIsWalkableFilter; +} + +void LLFilteredPathfindingLinksets::setObstacleFilter(BOOL pObstacleFilter) +{ + mIsFiltersDirty = (mIsFiltersDirty || (mIsObstacleFilter == pObstacleFilter)); + mIsObstacleFilter = pObstacleFilter; +} + +BOOL LLFilteredPathfindingLinksets::isObstacleFilter() const +{ + return mIsObstacleFilter; +} + +void LLFilteredPathfindingLinksets::setIgnoredFilter(BOOL pIgnoredFilter) +{ + mIsFiltersDirty = (mIsFiltersDirty || (mIsIgnoredFilter == pIgnoredFilter)); + mIsIgnoredFilter = pIgnoredFilter; +} + +BOOL LLFilteredPathfindingLinksets::isIgnoredFilter() const +{ + return mIsIgnoredFilter; +} + +void LLFilteredPathfindingLinksets::clearFilters() +{ + mNameFilter.clear(); + mDescriptionFilter.clear(); + mIsWalkableFilter = true; + mIsObstacleFilter = true; + mIsIgnoredFilter = true; + mIsFiltersDirty = false; +} + +void LLFilteredPathfindingLinksets::applyFilters() +{ + mFilteredLinksets.clear(); + + for (PathfindingLinksetMap::const_iterator linksetIter = mAllLinksets.begin(); + linksetIter != mAllLinksets.end(); ++linksetIter) + { + const std::string& uuid(linksetIter->first); + const LLPathfindingLinkset& linkset(linksetIter->second); + if (doesMatchFilters(linkset)) + { + mFilteredLinksets.insert(std::pair(uuid, linkset)); + } + } + + mIsFiltersDirty = false; +} + +BOOL LLFilteredPathfindingLinksets::doesMatchFilters(const LLPathfindingLinkset& pLinkset) const +{ + return (((mIsWalkableFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kWalkable)) || + (mIsObstacleFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kObstacle)) || + (mIsIgnoredFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kIgnored))) && + (!mNameFilter.isActive() || mNameFilter.doesMatch(pLinkset.getName())) && + (!mDescriptionFilter.isActive() || mDescriptionFilter.doesMatch(pLinkset.getDescription()))); +} diff --git a/indra/newview/llfilteredpathfindinglinksets.h b/indra/newview/llfilteredpathfindinglinksets.h new file mode 100644 index 0000000000..afd2b2b01d --- /dev/null +++ b/indra/newview/llfilteredpathfindinglinksets.h @@ -0,0 +1,111 @@ +/** + * @file llfilteredpathfindinglinksets.h + * @author William Todd Stinson + * @brief Class to implement the filtering of a set of pathfinding linksets + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_FILTEREDPATHFINDINGLINKSETS_H +#define LL_FILTEREDPATHFINDINGLINKSETS_H + +#include +#include + +class LLSD; +class LLPathfindingLinkset; + +class FilterString +{ +public: + FilterString(); + FilterString(const std::string& pFilter); + virtual ~FilterString(); + + const std::string& get() const; + bool set(const std::string& pFilter); + void clear(); + + bool isActive() const; + bool doesMatch(const std::string& pTestString) const; + +protected: + +private: + std::string mFilter; + std::string mUpperFilter; +}; + +class LLFilteredPathfindingLinksets +{ +public: + typedef std::map PathfindingLinksetMap; + + LLFilteredPathfindingLinksets(); + LLFilteredPathfindingLinksets(const LLSD& pNavMeshData); + LLFilteredPathfindingLinksets(const LLFilteredPathfindingLinksets& pOther); + virtual ~LLFilteredPathfindingLinksets(); + + void setPathfindingLinksets(const LLSD& pNavMeshData); + void updatePathfindingLinksets(const LLSD& pNavMeshData); + void clearPathfindingLinksets(); + + const PathfindingLinksetMap& getAllLinksets() const; + const PathfindingLinksetMap& getFilteredLinksets(); + + BOOL isFiltersActive() const; + + void setNameFilter(const std::string& pNameFilter); + const std::string& getNameFilter() const; + + void setDescriptionFilter(const std::string& pDescriptionFilter); + const std::string& getDescriptionFilter() const; + + void setWalkableFilter(BOOL pWalkableFilter); + BOOL isWalkableFilter() const; + + void setObstacleFilter(BOOL pObstacleFilter); + BOOL isObstacleFilter() const; + + void setIgnoredFilter(BOOL pIgnoredFilter); + BOOL isIgnoredFilter() const; + + void clearFilters(); + +protected: + +private: + PathfindingLinksetMap mAllLinksets; + PathfindingLinksetMap mFilteredLinksets; + + bool mIsFiltersDirty; + FilterString mNameFilter; + FilterString mDescriptionFilter; + BOOL mIsWalkableFilter; + BOOL mIsObstacleFilter; + BOOL mIsIgnoredFilter; + + void applyFilters(); + BOOL doesMatchFilters(const LLPathfindingLinkset& pLinkset) const; +}; + +#endif // LL_FILTEREDPATHFINDINGLINKSETS_H diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 433e3c9866..e2846d36f3 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -45,7 +45,8 @@ #include "llviewerregion.h" #include "llhttpclient.h" #include "lluuid.h" -#include "llpathfindinglinksets.h" +#include "llpathfindinglinkset.h" +#include "llfilteredpathfindinglinksets.h" #define XUI_PATH_STATE_WALKABLE 1 #define XUI_PATH_STATE_OBSTACLE 2 @@ -91,289 +92,6 @@ private: LLFloaterPathfindingLinksets *mLinksetsFloater; }; -//--------------------------------------------------------------------------- -// FilterString -//--------------------------------------------------------------------------- - -FilterString::FilterString() - : mFilter(), - mUpperFilter() -{ -} - -FilterString::FilterString(const std::string& pFilter) - : mFilter(pFilter), - mUpperFilter() -{ - LLStringUtil::trim(mFilter); - mUpperFilter = mFilter; - if (!mUpperFilter.empty()) - { - LLStringUtil::toUpper(mUpperFilter); - } -} - -FilterString::FilterString(const FilterString& pOther) - : mFilter(pOther.mFilter), - mUpperFilter(pOther.mUpperFilter) -{ -} - -FilterString::~FilterString() -{ -} - -const std::string& FilterString::get() const -{ - return mFilter; -} - -bool FilterString::set(const std::string& pFilter) -{ - std::string newFilter(pFilter); - LLStringUtil::trim(newFilter); - bool didFilterChange = (mFilter.compare(newFilter) != 0); - if (didFilterChange) - { - mFilter = newFilter; - mUpperFilter = newFilter; - LLStringUtil::toUpper(mUpperFilter); - } - - return didFilterChange; -} - -void FilterString::clear() -{ - mFilter.clear(); - mUpperFilter.clear(); -} - -bool FilterString::isActive() const -{ - return !mFilter.empty(); -} - -bool FilterString::doesMatch(const std::string& pTestString) const -{ - bool doesMatch = true; - - if (isActive()) - { - std::string upperTestString(pTestString); - LLStringUtil::toUpper(upperTestString); - doesMatch = (upperTestString.find(mUpperFilter) != std::string::npos); - } - - return doesMatch; -} - -//--------------------------------------------------------------------------- -// PathfindingLinksets -//--------------------------------------------------------------------------- - -PathfindingLinksets::PathfindingLinksets() - : mAllLinksets(), - mFilteredLinksets(), - mIsFiltersDirty(false), - mNameFilter(), - mDescriptionFilter(), - mIsWalkableFilter(true), - mIsObstacleFilter(true), - mIsIgnoredFilter(true) -{ -} - -PathfindingLinksets::PathfindingLinksets(const LLSD& pNavMeshData) - : mAllLinksets(), - mFilteredLinksets(), - mIsFiltersDirty(false), - mNameFilter(), - mDescriptionFilter(), - mIsWalkableFilter(true), - mIsObstacleFilter(true), - mIsIgnoredFilter(true) -{ - setNavMeshData(pNavMeshData); -} - -PathfindingLinksets::PathfindingLinksets(const PathfindingLinksets& pOther) - : mAllLinksets(pOther.mAllLinksets), - mFilteredLinksets(pOther.mFilteredLinksets), - mIsFiltersDirty(pOther.mIsFiltersDirty), - mNameFilter(pOther.mNameFilter), - mDescriptionFilter(pOther.mDescriptionFilter), - mIsWalkableFilter(pOther.mIsWalkableFilter), - mIsObstacleFilter(pOther.mIsObstacleFilter), - mIsIgnoredFilter(pOther.mIsIgnoredFilter) -{ -} - -PathfindingLinksets::~PathfindingLinksets() -{ - clearLinksets(); -} - -void PathfindingLinksets::setNavMeshData(const LLSD& pNavMeshData) -{ - clearLinksets(); - - for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap(); - navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter) - { - const std::string& uuid(navMeshDataIter->first); - const LLSD& linksetData = navMeshDataIter->second; - LLPathfindingLinkset linkset(uuid, linksetData); - - mAllLinksets.insert(std::pair(uuid, linkset)); - } - - mIsFiltersDirty = true; -} - -void PathfindingLinksets::updateNavMeshData(const LLSD& pNavMeshData) -{ - for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap(); - navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter) - { - const std::string& uuid(navMeshDataIter->first); - const LLSD& linksetData = navMeshDataIter->second; - LLPathfindingLinkset linkset(uuid, linksetData); - - PathfindingLinksetMap::iterator linksetIter = mAllLinksets.find(uuid); - if (linksetIter == mAllLinksets.end()) - { - mAllLinksets.insert(std::pair(uuid, linkset)); - } - else - { - linksetIter->second = linkset; - } - } - - mIsFiltersDirty = true; -} - -void PathfindingLinksets::clearLinksets() -{ - mAllLinksets.clear(); - mFilteredLinksets.clear(); - mIsFiltersDirty = false; -} - -const PathfindingLinksets::PathfindingLinksetMap& PathfindingLinksets::getAllLinksets() const -{ - return mAllLinksets; -} - -const PathfindingLinksets::PathfindingLinksetMap& PathfindingLinksets::getFilteredLinksets() -{ - if (!isFiltersActive()) - { - return mAllLinksets; - } - else - { - applyFilters(); - return mFilteredLinksets; - } -} - -BOOL PathfindingLinksets::isFiltersActive() const -{ - return (mNameFilter.isActive() || mDescriptionFilter.isActive() || !mIsWalkableFilter || !mIsObstacleFilter || !mIsIgnoredFilter); -} - -void PathfindingLinksets::setNameFilter(const std::string& pNameFilter) -{ - mIsFiltersDirty = (mNameFilter.set(pNameFilter) || mIsFiltersDirty); -} - -const std::string& PathfindingLinksets::getNameFilter() const -{ - return mNameFilter.get(); -} - -void PathfindingLinksets::setDescriptionFilter(const std::string& pDescriptionFilter) -{ - mIsFiltersDirty = (mDescriptionFilter.set(pDescriptionFilter) || mIsFiltersDirty); -} - -const std::string& PathfindingLinksets::getDescriptionFilter() const -{ - return mDescriptionFilter.get(); -} - -void PathfindingLinksets::setWalkableFilter(BOOL pWalkableFilter) -{ - mIsFiltersDirty = (mIsFiltersDirty || (mIsWalkableFilter == pWalkableFilter)); - mIsWalkableFilter = pWalkableFilter; -} - -BOOL PathfindingLinksets::isWalkableFilter() const -{ - return mIsWalkableFilter; -} - -void PathfindingLinksets::setObstacleFilter(BOOL pObstacleFilter) -{ - mIsFiltersDirty = (mIsFiltersDirty || (mIsObstacleFilter == pObstacleFilter)); - mIsObstacleFilter = pObstacleFilter; -} - -BOOL PathfindingLinksets::isObstacleFilter() const -{ - return mIsObstacleFilter; -} - -void PathfindingLinksets::setIgnoredFilter(BOOL pIgnoredFilter) -{ - mIsFiltersDirty = (mIsFiltersDirty || (mIsIgnoredFilter == pIgnoredFilter)); - mIsIgnoredFilter = pIgnoredFilter; -} - -BOOL PathfindingLinksets::isIgnoredFilter() const -{ - return mIsIgnoredFilter; -} - -void PathfindingLinksets::clearFilters() -{ - mNameFilter.clear(); - mDescriptionFilter.clear(); - mIsWalkableFilter = true; - mIsObstacleFilter = true; - mIsIgnoredFilter = true; - mIsFiltersDirty = false; -} - -void PathfindingLinksets::applyFilters() -{ - mFilteredLinksets.clear(); - - for (PathfindingLinksetMap::const_iterator linksetIter = mAllLinksets.begin(); - linksetIter != mAllLinksets.end(); ++linksetIter) - { - const std::string& uuid(linksetIter->first); - const LLPathfindingLinkset& linkset(linksetIter->second); - if (doesMatchFilters(linkset)) - { - mFilteredLinksets.insert(std::pair(uuid, linkset)); - } - } - - mIsFiltersDirty = false; -} - -BOOL PathfindingLinksets::doesMatchFilters(const LLPathfindingLinkset& pLinkset) const -{ - return (((mIsWalkableFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kWalkable)) || - (mIsObstacleFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kObstacle)) || - (mIsIgnoredFilter && (pLinkset.getPathState() == LLPathfindingLinkset::kIgnored))) && - (!mNameFilter.isActive() || mNameFilter.doesMatch(pLinkset.getName())) && - (!mDescriptionFilter.isActive() || mDescriptionFilter.doesMatch(pLinkset.getDescription()))); -} - //--------------------------------------------------------------------------- // LLFloaterPathfindingLinksets //--------------------------------------------------------------------------- @@ -557,7 +275,7 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataGetRequest() else { setMessagingState(kMessagingFetchStarting); - mPathfindingLinksets.clearLinksets(); + mPathfindingLinksets.clearPathfindingLinksets(); updateLinksetsList(); std::string navMeshDataURL = getCapabilityURL(); @@ -593,7 +311,7 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostDa void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData) { setMessagingState(kMessagingFetchReceived); - mPathfindingLinksets.setNavMeshData(pNavMeshData); + mPathfindingLinksets.setPathfindingLinksets(pNavMeshData); updateLinksetsList(); setMessagingState(kMessagingComplete); } @@ -601,7 +319,7 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMes void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string& pURL, const std::string& pErrorReason) { setMessagingState(kMessagingFetchError); - mPathfindingLinksets.clearLinksets(); + mPathfindingLinksets.clearPathfindingLinksets(); updateLinksetsList(); llwarns << "Error fetching object navmesh properties from URL '" << pURL << "' because " << pErrorReason << llendl; } @@ -609,7 +327,7 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string& void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData) { setMessagingState(kMessagingModifyReceived); - mPathfindingLinksets.updateNavMeshData(pModifiedData); + mPathfindingLinksets.updatePathfindingLinksets(pModifiedData); updateLinksetsList(); setMessagingState(kMessagingComplete); } @@ -729,9 +447,9 @@ void LLFloaterPathfindingLinksets::updateLinksetsList() updateLinksetsStatusMessage(); const LLVector3& avatarPosition = gAgent.getPositionAgent(); - const PathfindingLinksets::PathfindingLinksetMap& linksetMap = mPathfindingLinksets.getFilteredLinksets(); + const LLFilteredPathfindingLinksets::PathfindingLinksetMap& linksetMap = mPathfindingLinksets.getFilteredLinksets(); - for (PathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetMap.begin(); + for (LLFilteredPathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetMap.begin(); linksetIter != linksetMap.end(); ++linksetIter) { const LLPathfindingLinkset& linkset(linksetIter->second); @@ -905,8 +623,8 @@ void LLFloaterPathfindingLinksets::updateEditFields() { LLScrollListItem *firstItem = selectedItems.front(); - const PathfindingLinksets::PathfindingLinksetMap &linksetsMap = mPathfindingLinksets.getAllLinksets(); - PathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetsMap.find(firstItem->getUUID().asString()); + const LLFilteredPathfindingLinksets::PathfindingLinksetMap &linksetsMap = mPathfindingLinksets.getAllLinksets(); + LLFilteredPathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetsMap.find(firstItem->getUUID().asString()); const LLPathfindingLinkset &linkset(linksetIter->second); setPathState(linkset.getPathState()); @@ -936,7 +654,7 @@ void LLFloaterPathfindingLinksets::applyEditFields() S32 dValue = static_cast(atoi(dString.c_str())); BOOL isPhantom = mEditPhantom->getValue(); - const PathfindingLinksets::PathfindingLinksetMap &linksetsMap = mPathfindingLinksets.getAllLinksets(); + const LLFilteredPathfindingLinksets::PathfindingLinksetMap &linksetsMap = mPathfindingLinksets.getAllLinksets(); LLSD editData; for (std::vector::const_iterator itemIter = selectedItems.begin(); @@ -945,7 +663,7 @@ void LLFloaterPathfindingLinksets::applyEditFields() const LLScrollListItem *listItem = *itemIter; LLUUID uuid = listItem->getUUID(); - const PathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetsMap.find(uuid.asString()); + const LLFilteredPathfindingLinksets::PathfindingLinksetMap::const_iterator linksetIter = linksetsMap.find(uuid.asString()); const LLPathfindingLinkset &linkset = linksetIter->second; LLSD itemData = linkset.getAlteredFields(pathState, aValue, bValue, cValue, dValue, isPhantom); diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 739e52ccef..bb37987160 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -32,7 +32,8 @@ #include "v3math.h" #include "llfloater.h" #include "lluuid.h" -#include "llpathfindinglinksets.h" +#include "llpathfindinglinkset.h" +#include "llfilteredpathfindinglinksets.h" class LLTextBase; class LLScrollListCtrl; @@ -41,75 +42,6 @@ class LLCheckBoxCtrl; class LLRadioGroup; class LLButton; -class FilterString -{ -public: - FilterString(); - FilterString(const std::string& pFilter); - FilterString(const FilterString& pOther); - virtual ~FilterString(); - - const std::string& get() const; - bool set(const std::string& pFilter); - void clear(); - - bool isActive() const; - bool doesMatch(const std::string& pTestString) const; - -protected: - -private: - std::string mFilter; - std::string mUpperFilter; -}; - -class PathfindingLinksets -{ -public: - typedef std::map PathfindingLinksetMap; - - PathfindingLinksets(); - PathfindingLinksets(const LLSD& pNavMeshData); - PathfindingLinksets(const PathfindingLinksets& pOther); - virtual ~PathfindingLinksets(); - - void setNavMeshData(const LLSD& pNavMeshData); - void updateNavMeshData(const LLSD& pNavMeshData); - void clearLinksets(); - - const PathfindingLinksetMap& getAllLinksets() const; - const PathfindingLinksetMap& getFilteredLinksets(); - - BOOL isFiltersActive() const; - void setNameFilter(const std::string& pNameFilter); - const std::string& getNameFilter() const; - void setDescriptionFilter(const std::string& pDescriptionFilter); - const std::string& getDescriptionFilter() const; - void setWalkableFilter(BOOL pWalkableFilter); - BOOL isWalkableFilter() const; - void setObstacleFilter(BOOL pObstacleFilter); - BOOL isObstacleFilter() const; - void setIgnoredFilter(BOOL pIgnoredFilter); - BOOL isIgnoredFilter() const; - void clearFilters(); - -protected: - -private: - PathfindingLinksetMap mAllLinksets; - PathfindingLinksetMap mFilteredLinksets; - - bool mIsFiltersDirty; - FilterString mNameFilter; - FilterString mDescriptionFilter; - BOOL mIsWalkableFilter; - BOOL mIsObstacleFilter; - BOOL mIsIgnoredFilter; - - void applyFilters(); - BOOL doesMatchFilters(const LLPathfindingLinkset& pLinkset) const; -}; - class LLFloaterPathfindingLinksets : public LLFloater { @@ -144,30 +76,30 @@ public: protected: private: - PathfindingLinksets mPathfindingLinksets; - EMessagingState mMessagingState; - LLScrollListCtrl *mLinksetsScrollList; - LLTextBase *mLinksetsStatus; - LLLineEditor *mFilterByName; - LLLineEditor *mFilterByDescription; - LLCheckBoxCtrl *mFilterByWalkable; - LLCheckBoxCtrl *mFilterByObstacle; - LLCheckBoxCtrl *mFilterByIgnored; - LLRadioGroup *mEditPathState; - LLUICtrl *mEditPathStateWalkable; - LLUICtrl *mEditPathStateObstacle; - LLUICtrl *mEditPathStateIgnored; - LLTextBase *mLabelWalkabilityCoefficients; - LLTextBase *mLabelEditA; - LLTextBase *mLabelEditB; - LLTextBase *mLabelEditC; - LLTextBase *mLabelEditD; - LLLineEditor *mEditA; - LLLineEditor *mEditB; - LLLineEditor *mEditC; - LLLineEditor *mEditD; - LLCheckBoxCtrl *mEditPhantom; - LLButton *mApplyEdits; + LLFilteredPathfindingLinksets mPathfindingLinksets; + EMessagingState mMessagingState; + LLScrollListCtrl *mLinksetsScrollList; + LLTextBase *mLinksetsStatus; + LLLineEditor *mFilterByName; + LLLineEditor *mFilterByDescription; + LLCheckBoxCtrl *mFilterByWalkable; + LLCheckBoxCtrl *mFilterByObstacle; + LLCheckBoxCtrl *mFilterByIgnored; + LLRadioGroup *mEditPathState; + LLUICtrl *mEditPathStateWalkable; + LLUICtrl *mEditPathStateObstacle; + LLUICtrl *mEditPathStateIgnored; + LLTextBase *mLabelWalkabilityCoefficients; + LLTextBase *mLabelEditA; + LLTextBase *mLabelEditB; + LLTextBase *mLabelEditC; + LLTextBase *mLabelEditD; + LLLineEditor *mEditA; + LLLineEditor *mEditB; + LLLineEditor *mEditC; + LLLineEditor *mEditD; + LLCheckBoxCtrl *mEditPhantom; + LLButton *mApplyEdits; // Does its own instance management, so clients not allowed // to allocate or destroy. diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp new file mode 100644 index 0000000000..bfe851d8ee --- /dev/null +++ b/indra/newview/llpathfindinglinkset.cpp @@ -0,0 +1,344 @@ +/** + * @file llpathfindinglinksets.cpp + * @author William Todd Stinson + * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llpathfindinglinkset.h" +#include "llsd.h" +#include "v3math.h" +#include "lluuid.h" + +//--------------------------------------------------------------------------- +// LLPathfindingLinkset +//--------------------------------------------------------------------------- + +const S32 LLPathfindingLinkset::MIN_WALKABILITY_VALUE(0); +const S32 LLPathfindingLinkset::MAX_WALKABILITY_VALUE(100); + +LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& pNavMeshItem) + : mUUID(pUUID), + mName(), + mDescription(), + mLandImpact(0U), + mLocation(), + mPathState(kIgnored), + mIsPhantom(false), +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mIsWalkabilityCoefficientsF32(false), +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE), + mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE) +{ + llassert(pNavMeshItem.has("name")); + llassert(pNavMeshItem.get("name").isString()); + mName = pNavMeshItem.get("name").asString(); + + llassert(pNavMeshItem.has("description")); + llassert(pNavMeshItem.get("description").isString()); + mDescription = pNavMeshItem.get("description").asString(); + + llassert(pNavMeshItem.has("landimpact")); + llassert(pNavMeshItem.get("landimpact").isInteger()); + llassert(pNavMeshItem.get("landimpact").asInteger() >= 0); + mLandImpact = pNavMeshItem.get("landimpact").asInteger(); + + llassert(pNavMeshItem.has("permanent")); + llassert(pNavMeshItem.get("permanent").isBoolean()); + bool isPermanent = pNavMeshItem.get("permanent").asBoolean(); + + llassert(pNavMeshItem.has("walkable")); + llassert(pNavMeshItem.get("walkable").isBoolean()); + bool isWalkable = pNavMeshItem.get("walkable").asBoolean(); + + mPathState = getPathState(isPermanent, isWalkable); + + llassert(pNavMeshItem.has("phantom")); + llassert(pNavMeshItem.get("phantom").isBoolean()); + mIsPhantom = pNavMeshItem.get("phantom").asBoolean(); + + llassert(pNavMeshItem.has("A")); +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mIsWalkabilityCoefficientsF32 = pNavMeshItem.get("A").isReal(); + if (mIsWalkabilityCoefficientsF32) + { + // Old server-side storage was real + mWalkabilityCoefficientA = llround(pNavMeshItem.get("A").asReal() * 100.0f); + + llassert(pNavMeshItem.has("B")); + llassert(pNavMeshItem.get("B").isReal()); + mWalkabilityCoefficientB = llround(pNavMeshItem.get("B").asReal() * 100.0f); + + llassert(pNavMeshItem.has("C")); + llassert(pNavMeshItem.get("C").isReal()); + mWalkabilityCoefficientC = llround(pNavMeshItem.get("C").asReal() * 100.0f); + + llassert(pNavMeshItem.has("D")); + llassert(pNavMeshItem.get("D").isReal()); + mWalkabilityCoefficientD = llround(pNavMeshItem.get("D").asReal() * 100.0f); + } + else + { + // New server-side storage will be integer + llassert(pNavMeshItem.get("A").isInteger()); + mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); + llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("B")); + llassert(pNavMeshItem.get("B").isInteger()); + mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); + llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("C")); + llassert(pNavMeshItem.get("C").isInteger()); + mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); + llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("D")); + llassert(pNavMeshItem.get("D").isInteger()); + mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); + llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); + } +#else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + llassert(pNavMeshItem.get("A").isInteger()); + mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); + llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("B")); + llassert(pNavMeshItem.get("B").isInteger()); + mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); + llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("C")); + llassert(pNavMeshItem.get("C").isInteger()); + mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); + llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); + + llassert(pNavMeshItem.has("D")); + llassert(pNavMeshItem.get("D").isInteger()); + mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); + llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); + llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + + llassert(pNavMeshItem.has("position")); + llassert(pNavMeshItem.get("position").isArray()); + mLocation.setValue(pNavMeshItem.get("position")); +} + +LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) + : mUUID(pOther.mUUID), + mName(pOther.mName), + mDescription(pOther.mDescription), + mLandImpact(pOther.mLandImpact), + mLocation(pOther.mLocation), + mPathState(pOther.mPathState), + mIsPhantom(pOther.mIsPhantom), +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mIsWalkabilityCoefficientsF32(pOther.mIsWalkabilityCoefficientsF32), +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA), + mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB), + mWalkabilityCoefficientC(pOther.mWalkabilityCoefficientC), + mWalkabilityCoefficientD(pOther.mWalkabilityCoefficientD) +{ +} + +LLPathfindingLinkset::~LLPathfindingLinkset() +{ +} + +LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkset& pOther) +{ + mUUID = pOther.mUUID; + mName = pOther.mName; + mDescription = pOther.mDescription; + mLandImpact = pOther.mLandImpact; + mLocation = pOther.mLocation; + mPathState = pOther.mPathState; + mIsPhantom = pOther.mIsPhantom; +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mIsWalkabilityCoefficientsF32 = pOther.mIsWalkabilityCoefficientsF32; +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA; + mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB; + mWalkabilityCoefficientC = pOther.mWalkabilityCoefficientC; + mWalkabilityCoefficientD = pOther.mWalkabilityCoefficientD; + + return *this; +} + + +LLPathfindingLinkset::EPathState LLPathfindingLinkset::getPathState(bool pIsPermanent, bool pIsWalkable) +{ + return (pIsPermanent ? (pIsWalkable ? kWalkable : kObstacle) : kIgnored); +} + +BOOL LLPathfindingLinkset::isPermanent(EPathState pPathState) +{ + BOOL retVal; + + switch (pPathState) + { + case kWalkable : + case kObstacle : + retVal = true; + break; + case kIgnored : + retVal = false; + break; + default : + retVal = false; + llassert(0); + break; + } + + return retVal; +} + +BOOL LLPathfindingLinkset::isWalkable(EPathState pPathState) +{ + BOOL retVal; + + switch (pPathState) + { + case kWalkable : + retVal = true; + break; + case kObstacle : + case kIgnored : + retVal = false; + break; + default : + retVal = false; + llassert(0); + break; + } + + return retVal; +} + +void LLPathfindingLinkset::setWalkabilityCoefficientA(S32 pA) +{ + mWalkabilityCoefficientA = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); +} + +void LLPathfindingLinkset::setWalkabilityCoefficientB(S32 pB) +{ + mWalkabilityCoefficientB = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); +} + +void LLPathfindingLinkset::setWalkabilityCoefficientC(S32 pC) +{ + mWalkabilityCoefficientC = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); +} + +void LLPathfindingLinkset::setWalkabilityCoefficientD(S32 pD) +{ + mWalkabilityCoefficientD = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); +} + +LLSD LLPathfindingLinkset::getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const +{ + LLSD itemData; + + if (mPathState != pPathState) + { + itemData["permanent"] = static_cast(LLPathfindingLinkset::isPermanent(pPathState)); + itemData["walkable"] = static_cast(LLPathfindingLinkset::isWalkable(pPathState)); + } +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + if (mIsWalkabilityCoefficientsF32) + { + if (mWalkabilityCoefficientA != pA) + { + itemData["A"] = llclamp(static_cast(pA) / 100.0f, 0.0f, 1.0f); + } + if (mWalkabilityCoefficientB != pB) + { + itemData["B"] = llclamp(static_cast(pB) / 100.0f, 0.0f, 1.0f); + } + if (mWalkabilityCoefficientC != pC) + { + itemData["C"] = llclamp(static_cast(pC) / 100.0f, 0.0f, 1.0f); + } + if (mWalkabilityCoefficientD != pD) + { + itemData["D"] = llclamp(static_cast(pD) / 100.0f, 0.0f, 1.0f); + } + } + else + { + if (mWalkabilityCoefficientA != pA) + { + itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientB != pB) + { + itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientC != pC) + { + itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientD != pD) + { + itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + } +#else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + if (mWalkabilityCoefficientA != pA) + { + itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientB != pB) + { + itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientC != pC) + { + itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } + if (mWalkabilityCoefficientD != pD) + { + itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); + } +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + if (mIsPhantom != pIsPhantom) + { + itemData["phantom"] = static_cast(pIsPhantom); + } + + return itemData; +} diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h new file mode 100644 index 0000000000..c6165907d0 --- /dev/null +++ b/indra/newview/llpathfindinglinkset.h @@ -0,0 +1,108 @@ +/** + * @file llpathfindinglinkset.h + * @author William Todd Stinson + * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. + * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLPATHFINDINGLINKSET_H +#define LL_LLPATHFINDINGLINKSET_H + +#include "v3math.h" +#include "lluuid.h" + +// This is a reminder to remove the code regarding the changing of the data type for the +// walkability coefficients from F32 to S32 representing the percentage from 0-100. +#define XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + +class LLSD; + +class LLPathfindingLinkset +{ +public: + typedef enum + { + kWalkable, + kObstacle, + kIgnored + } EPathState; + + LLPathfindingLinkset(const std::string &pUUID, const LLSD &pNavMeshItem); + LLPathfindingLinkset(const LLPathfindingLinkset& pOther); + virtual ~LLPathfindingLinkset(); + + LLPathfindingLinkset& operator = (const LLPathfindingLinkset& 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 U32 getLandImpact() const {return mLandImpact;}; + inline const LLVector3& getLocation() const {return mLocation;}; + + inline EPathState getPathState() const {return mPathState;}; + inline void setPathState(EPathState pPathState) {mPathState = pPathState;}; + + static EPathState getPathState(bool pIsPermanent, bool pIsWalkable); + static BOOL isPermanent(EPathState pPathState); + static BOOL isWalkable(EPathState pPathState); + + inline BOOL isPhantom() const {return mIsPhantom;}; + inline void setPhantom(BOOL pIsPhantom) {mIsPhantom = pIsPhantom;}; + + inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; + void setWalkabilityCoefficientA(S32 pA); + + inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; + void setWalkabilityCoefficientB(S32 pB); + + inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; + void setWalkabilityCoefficientC(S32 pC); + + inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;}; + void setWalkabilityCoefficientD(S32 pD); + + LLSD getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const; + +protected: + +private: + static const S32 MIN_WALKABILITY_VALUE; + static const S32 MAX_WALKABILITY_VALUE; + + LLUUID mUUID; + std::string mName; + std::string mDescription; + U32 mLandImpact; + LLVector3 mLocation; + EPathState mPathState; + BOOL mIsPhantom; +#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + BOOL mIsWalkabilityCoefficientsF32; +#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE + S32 mWalkabilityCoefficientA; + S32 mWalkabilityCoefficientB; + S32 mWalkabilityCoefficientC; + S32 mWalkabilityCoefficientD; +}; + +#endif // LL_LLPATHFINDINGLINKSET_H diff --git a/indra/newview/llpathfindinglinksets.cpp b/indra/newview/llpathfindinglinksets.cpp deleted file mode 100644 index 57623e0e43..0000000000 --- a/indra/newview/llpathfindinglinksets.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/** - * @file llpathfindinglinksets.cpp - * @author William Todd Stinson - * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llpathfindinglinksets.h" -#include "llsd.h" -#include "v3math.h" -#include "lluuid.h" - -//--------------------------------------------------------------------------- -// LLPathfindingLinkset -//--------------------------------------------------------------------------- - -const S32 LLPathfindingLinkset::MIN_WALKABILITY_VALUE(0); -const S32 LLPathfindingLinkset::MAX_WALKABILITY_VALUE(100); - -LLPathfindingLinkset::LLPathfindingLinkset(const std::string &pUUID, const LLSD& pNavMeshItem) - : mUUID(pUUID), - mName(), - mDescription(), - mLandImpact(0U), - mLocation(), - mPathState(kIgnored), - mIsPhantom(false), -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mIsWalkabilityCoefficientsF32(false), -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mWalkabilityCoefficientA(MIN_WALKABILITY_VALUE), - mWalkabilityCoefficientB(MIN_WALKABILITY_VALUE), - mWalkabilityCoefficientC(MIN_WALKABILITY_VALUE), - mWalkabilityCoefficientD(MIN_WALKABILITY_VALUE) -{ - llassert(pNavMeshItem.has("name")); - llassert(pNavMeshItem.get("name").isString()); - mName = pNavMeshItem.get("name").asString(); - - llassert(pNavMeshItem.has("description")); - llassert(pNavMeshItem.get("description").isString()); - mDescription = pNavMeshItem.get("description").asString(); - - llassert(pNavMeshItem.has("landimpact")); - llassert(pNavMeshItem.get("landimpact").isInteger()); - llassert(pNavMeshItem.get("landimpact").asInteger() >= 0); - mLandImpact = pNavMeshItem.get("landimpact").asInteger(); - - llassert(pNavMeshItem.has("permanent")); - llassert(pNavMeshItem.get("permanent").isBoolean()); - bool isPermanent = pNavMeshItem.get("permanent").asBoolean(); - - llassert(pNavMeshItem.has("walkable")); - llassert(pNavMeshItem.get("walkable").isBoolean()); - bool isWalkable = pNavMeshItem.get("walkable").asBoolean(); - - mPathState = getPathState(isPermanent, isWalkable); - - llassert(pNavMeshItem.has("phantom")); - llassert(pNavMeshItem.get("phantom").isBoolean()); - mIsPhantom = pNavMeshItem.get("phantom").asBoolean(); - - llassert(pNavMeshItem.has("A")); -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mIsWalkabilityCoefficientsF32 = pNavMeshItem.get("A").isReal(); - if (mIsWalkabilityCoefficientsF32) - { - // Old server-side storage was real - mWalkabilityCoefficientA = llround(pNavMeshItem.get("A").asReal() * 100.0f); - - llassert(pNavMeshItem.has("B")); - llassert(pNavMeshItem.get("B").isReal()); - mWalkabilityCoefficientB = llround(pNavMeshItem.get("B").asReal() * 100.0f); - - llassert(pNavMeshItem.has("C")); - llassert(pNavMeshItem.get("C").isReal()); - mWalkabilityCoefficientC = llround(pNavMeshItem.get("C").asReal() * 100.0f); - - llassert(pNavMeshItem.has("D")); - llassert(pNavMeshItem.get("D").isReal()); - mWalkabilityCoefficientD = llround(pNavMeshItem.get("D").asReal() * 100.0f); - } - else - { - // New server-side storage will be integer - llassert(pNavMeshItem.get("A").isInteger()); - mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); - llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("B")); - llassert(pNavMeshItem.get("B").isInteger()); - mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); - llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("C")); - llassert(pNavMeshItem.get("C").isInteger()); - mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); - llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("D")); - llassert(pNavMeshItem.get("D").isInteger()); - mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); - llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); - } -#else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - llassert(pNavMeshItem.get("A").isInteger()); - mWalkabilityCoefficientA = pNavMeshItem.get("A").asInteger(); - llassert(mWalkabilityCoefficientA >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientA <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("B")); - llassert(pNavMeshItem.get("B").isInteger()); - mWalkabilityCoefficientB = pNavMeshItem.get("B").asInteger(); - llassert(mWalkabilityCoefficientB >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientB <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("C")); - llassert(pNavMeshItem.get("C").isInteger()); - mWalkabilityCoefficientC = pNavMeshItem.get("C").asInteger(); - llassert(mWalkabilityCoefficientC >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientC <= MAX_WALKABILITY_VALUE); - - llassert(pNavMeshItem.has("D")); - llassert(pNavMeshItem.get("D").isInteger()); - mWalkabilityCoefficientD = pNavMeshItem.get("D").asInteger(); - llassert(mWalkabilityCoefficientD >= MIN_WALKABILITY_VALUE); - llassert(mWalkabilityCoefficientD <= MAX_WALKABILITY_VALUE); -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - - llassert(pNavMeshItem.has("position")); - llassert(pNavMeshItem.get("position").isArray()); - mLocation.setValue(pNavMeshItem.get("position")); -} - -LLPathfindingLinkset::LLPathfindingLinkset(const LLPathfindingLinkset& pOther) - : mUUID(pOther.mUUID), - mName(pOther.mName), - mDescription(pOther.mDescription), - mLandImpact(pOther.mLandImpact), - mLocation(pOther.mLocation), - mPathState(pOther.mPathState), - mIsPhantom(pOther.mIsPhantom), -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mIsWalkabilityCoefficientsF32(pOther.mIsWalkabilityCoefficientsF32), -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mWalkabilityCoefficientA(pOther.mWalkabilityCoefficientA), - mWalkabilityCoefficientB(pOther.mWalkabilityCoefficientB), - mWalkabilityCoefficientC(pOther.mWalkabilityCoefficientC), - mWalkabilityCoefficientD(pOther.mWalkabilityCoefficientD) -{ -} - -LLPathfindingLinkset::~LLPathfindingLinkset() -{ -} - -LLPathfindingLinkset& LLPathfindingLinkset::operator =(const LLPathfindingLinkset& pOther) -{ - mUUID = pOther.mUUID; - mName = pOther.mName; - mDescription = pOther.mDescription; - mLandImpact = pOther.mLandImpact; - mLocation = pOther.mLocation; - mPathState = pOther.mPathState; - mIsPhantom = pOther.mIsPhantom; -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mIsWalkabilityCoefficientsF32 = pOther.mIsWalkabilityCoefficientsF32; -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - mWalkabilityCoefficientA = pOther.mWalkabilityCoefficientA; - mWalkabilityCoefficientB = pOther.mWalkabilityCoefficientB; - mWalkabilityCoefficientC = pOther.mWalkabilityCoefficientC; - mWalkabilityCoefficientD = pOther.mWalkabilityCoefficientD; - - return *this; -} - - -LLPathfindingLinkset::EPathState LLPathfindingLinkset::getPathState(bool pIsPermanent, bool pIsWalkable) -{ - return (pIsPermanent ? (pIsWalkable ? kWalkable : kObstacle) : kIgnored); -} - -BOOL LLPathfindingLinkset::isPermanent(EPathState pPathState) -{ - BOOL retVal; - - switch (pPathState) - { - case kWalkable : - case kObstacle : - retVal = true; - break; - case kIgnored : - retVal = false; - break; - default : - retVal = false; - llassert(0); - break; - } - - return retVal; -} - -BOOL LLPathfindingLinkset::isWalkable(EPathState pPathState) -{ - BOOL retVal; - - switch (pPathState) - { - case kWalkable : - retVal = true; - break; - case kObstacle : - case kIgnored : - retVal = false; - break; - default : - retVal = false; - llassert(0); - break; - } - - return retVal; -} - -void LLPathfindingLinkset::setWalkabilityCoefficientA(S32 pA) -{ - mWalkabilityCoefficientA = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); -} - -void LLPathfindingLinkset::setWalkabilityCoefficientB(S32 pB) -{ - mWalkabilityCoefficientB = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); -} - -void LLPathfindingLinkset::setWalkabilityCoefficientC(S32 pC) -{ - mWalkabilityCoefficientC = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); -} - -void LLPathfindingLinkset::setWalkabilityCoefficientD(S32 pD) -{ - mWalkabilityCoefficientD = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); -} - -LLSD LLPathfindingLinkset::getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const -{ - LLSD itemData; - - if (mPathState != pPathState) - { - itemData["permanent"] = static_cast(LLPathfindingLinkset::isPermanent(pPathState)); - itemData["walkable"] = static_cast(LLPathfindingLinkset::isWalkable(pPathState)); - } -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - if (mIsWalkabilityCoefficientsF32) - { - if (mWalkabilityCoefficientA != pA) - { - itemData["A"] = llclamp(static_cast(pA) / 100.0f, 0.0f, 1.0f); - } - if (mWalkabilityCoefficientB != pB) - { - itemData["B"] = llclamp(static_cast(pB) / 100.0f, 0.0f, 1.0f); - } - if (mWalkabilityCoefficientC != pC) - { - itemData["C"] = llclamp(static_cast(pC) / 100.0f, 0.0f, 1.0f); - } - if (mWalkabilityCoefficientD != pD) - { - itemData["D"] = llclamp(static_cast(pD) / 100.0f, 0.0f, 1.0f); - } - } - else - { - if (mWalkabilityCoefficientA != pA) - { - itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientB != pB) - { - itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientC != pC) - { - itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientD != pD) - { - itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - } -#else // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - if (mWalkabilityCoefficientA != pA) - { - itemData["A"] = llclamp(pA, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientB != pB) - { - itemData["B"] = llclamp(pB, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientC != pC) - { - itemData["C"] = llclamp(pC, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } - if (mWalkabilityCoefficientD != pD) - { - itemData["D"] = llclamp(pD, MIN_WALKABILITY_VALUE, MAX_WALKABILITY_VALUE); - } -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - if (mIsPhantom != pIsPhantom) - { - itemData["phantom"] = static_cast(pIsPhantom); - } - - return itemData; -} diff --git a/indra/newview/llpathfindinglinksets.h b/indra/newview/llpathfindinglinksets.h deleted file mode 100644 index e632be5257..0000000000 --- a/indra/newview/llpathfindinglinksets.h +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @file llpathfindinglinksets.h - * @author William Todd Stinson - * @brief Definition of a pathfinding linkset that contains various properties required for havok pathfinding. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLPATHFINDINGLINKSETS_H -#define LL_LLPATHFINDINGLINKSETS_H - -#include "v3math.h" -#include "lluuid.h" - -// This is a reminder to remove the code regarding the changing of the data type for the -// walkability coefficients from F32 to S32 representing the percentage from 0-100. -#define XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - -class LLSD; - -class LLPathfindingLinkset -{ -public: - typedef enum - { - kWalkable, - kObstacle, - kIgnored - } EPathState; - - LLPathfindingLinkset(const std::string &pUUID, const LLSD &pNavMeshItem); - LLPathfindingLinkset(const LLPathfindingLinkset& pOther); - virtual ~LLPathfindingLinkset(); - - LLPathfindingLinkset& operator = (const LLPathfindingLinkset& 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 U32 getLandImpact() const {return mLandImpact;}; - inline const LLVector3& getLocation() const {return mLocation;}; - - inline EPathState getPathState() const {return mPathState;}; - inline void setPathState(EPathState pPathState) {mPathState = pPathState;}; - - static EPathState getPathState(bool pIsPermanent, bool pIsWalkable); - static BOOL isPermanent(EPathState pPathState); - static BOOL isWalkable(EPathState pPathState); - - inline BOOL isPhantom() const {return mIsPhantom;}; - inline void setPhantom(BOOL pIsPhantom) {mIsPhantom = pIsPhantom;}; - - inline S32 getWalkabilityCoefficientA() const {return mWalkabilityCoefficientA;}; - void setWalkabilityCoefficientA(S32 pA); - - inline S32 getWalkabilityCoefficientB() const {return mWalkabilityCoefficientB;}; - void setWalkabilityCoefficientB(S32 pB); - - inline S32 getWalkabilityCoefficientC() const {return mWalkabilityCoefficientC;}; - void setWalkabilityCoefficientC(S32 pC); - - inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;}; - void setWalkabilityCoefficientD(S32 pD); - - LLSD getAlteredFields(EPathState pPathState, S32 pA, S32 pB, S32 pC, S32 pD, BOOL pIsPhantom) const; - -protected: - -private: - static const S32 MIN_WALKABILITY_VALUE; - static const S32 MAX_WALKABILITY_VALUE; - - LLUUID mUUID; - std::string mName; - std::string mDescription; - U32 mLandImpact; - LLVector3 mLocation; - EPathState mPathState; - BOOL mIsPhantom; -#ifdef XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - BOOL mIsWalkabilityCoefficientsF32; -#endif // XXX_STINSON_WALKABILITY_COEFFICIENTS_TYPE_CHANGE - S32 mWalkabilityCoefficientA; - S32 mWalkabilityCoefficientB; - S32 mWalkabilityCoefficientC; - S32 mWalkabilityCoefficientD; -}; - -#endif // LL_LLFLOATERPATHFINDINGLINKSETS_H -- cgit v1.2.3