summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-13 16:21:11 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-13 16:21:11 -0500
commit7a1e7dd69d8c3c5f302c95ee083155fe0863a0be (patch)
treebfd26599f4c25af43c0a8d6c8050d203f4a41c2d /indra/newview/llfloatertools.cpp
parentf0cd44a6a2c4001111e82425cf2bd4fee63fad27 (diff)
parent2aa9f1bcbe0c51f9de24d52a08726dc13038f5b8 (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
-rw-r--r--indra/newview/llfloatertools.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp
index 3c3dfb760e..9854d2594b 100644
--- a/indra/newview/llfloatertools.cpp
+++ b/indra/newview/llfloatertools.cpp
@@ -422,10 +422,17 @@ void LLFloaterTools::refresh()
LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
childSetTextArg("prim_count", "[COUNT]", prim_count_string);
+ // calculate selection rendering cost
+ std::string prim_cost_string;
+ LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost());
+ childSetTextArg("RenderingCost", "[COUNT]", prim_cost_string);
+
+
// disable the object and prim counts if nothing selected
bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty();
childSetEnabled("obj_count", have_selection);
childSetEnabled("prim_count", have_selection);
+ childSetEnabled("RenderingCost", have_selection);
// Refresh child tabs
mPanelPermissions->refresh();
@@ -556,6 +563,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
mBtnEdit ->setToggleState( edit_visible );
mRadioGroupEdit->setVisible( edit_visible );
+ childSetVisible("RenderingCost", edit_visible || focus_visible || move_visible);
if (mCheckSelectIndividual)
{
@@ -964,6 +972,27 @@ void LLFloaterTools::onClickGridOptions()
//floaterp->addDependentFloater(LLFloaterBuildOptions::getInstance(), FALSE);
}
+S32 LLFloaterTools::calcRenderCost()
+{
+ S32 cost = 0;
+ for (LLObjectSelection::iterator selection_iter = LLSelectMgr::getInstance()->getSelection()->begin();
+ selection_iter != LLSelectMgr::getInstance()->getSelection()->end();
+ ++selection_iter)
+ {
+ LLSelectNode *select_node = *selection_iter;
+ if (select_node)
+ {
+ LLVOVolume *viewer_volume = (LLVOVolume*)select_node->getObject();
+ if (viewer_volume)
+ {
+ cost += viewer_volume->getRenderCost();
+ }
+ }
+ }
+
+ return cost;
+}
+
// static
void LLFloaterTools::setEditTool(void* tool_pointer)
{