Added prim cost equivalency to UI for importer and tools floater.

meow-7.2.2
Dave Parks 2009-12-22 17:48:52 -06:00
parent 5562dc36a1
commit a0802dd339
3 changed files with 26 additions and 3 deletions

View File

@ -423,7 +423,7 @@ void LLFloaterTools::refresh()
LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
childSetTextArg("obj_count", "[COUNT]", obj_count_string);
std::string prim_count_string;
LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount(TRUE));
childSetTextArg("prim_count", "[COUNT]", prim_count_string);
// calculate selection rendering cost

View File

@ -68,6 +68,7 @@
#include "llhudmanager.h"
#include "llinventorymodel.h"
#include "llmenugl.h"
#include "llmeshrepository.h"
#include "llmutelist.h"
#include "llsidepaneltaskinfo.h"
#include "llslurl.h"
@ -6124,10 +6125,32 @@ BOOL LLObjectSelection::isEmpty() const
//-----------------------------------------------------------------------------
// getObjectCount() - returns number of non null objects
//-----------------------------------------------------------------------------
S32 LLObjectSelection::getObjectCount()
S32 LLObjectSelection::getObjectCount(BOOL mesh_adjust)
{
cleanupNodes();
S32 count = mList.size();
if (mesh_adjust)
{
for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter)
{
LLSelectNode* node = *iter;
LLViewerObject* object = node->getObject();
if (object && object->getVolume())
{
LLVOVolume* vobj = (LLVOVolume*) object;
if (vobj->isMesh())
{
LLUUID mesh_id = vobj->getVolume()->getParams().getSculptID();
U32 cost = gMeshRepo.getResourceCost(mesh_id);
count += cost-1;
}
}
}
}
return count;
}

View File

@ -291,7 +291,7 @@ public:
LLSelectNode* findNode(LLViewerObject* objectp);
// count members
S32 getObjectCount();
S32 getObjectCount(BOOL mesh_adjust = FALSE);
S32 getTECount();
S32 getRootObjectCount();