diff options
author | Dave Parks <davep@lindenlab.com> | 2010-05-15 02:45:58 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-05-15 02:45:58 -0500 |
commit | 246dd9c168550bfe4b1b71bba75f5af9456e86dd (patch) | |
tree | b95e0fa776c7a6d8d6cf7fb652a877011cd6f518 /indra/newview/llselectmgr.cpp | |
parent | 8be6ad300a320b8a9debbd3abbf4b5c252db70a9 (diff) |
Highlight for object cost and proper retrieval/display of prim object cost and linkset cost.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e66be1023d..5acbae0c77 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6183,6 +6183,53 @@ S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust) return count; } +F32 LLObjectSelection::getSelectedObjectCost() +{ + cleanupNodes(); + F32 cost = 0.f; + + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + cost += object->getObjectCost(); + } + } + + return cost; +} + +F32 LLObjectSelection::getSelectedLinksetCost() +{ + cleanupNodes(); + F32 cost = 0.f; + + std::set<LLViewerObject*> me_roots; + + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLViewerObject* object = node->getObject(); + + if (object) + { + LLViewerObject* root = static_cast<LLViewerObject*>(object->getRoot()); + if (root) + { + if (me_roots.find(root) == me_roots.end()) + { + me_roots.insert(root); + cost += root->getLinksetCost(); + } + } + } + } + + return cost; +} //----------------------------------------------------------------------------- // getTECount() |