本文整理汇总了C++中LLSimInfo::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::getName方法的具体用法?C++ LLSimInfo::getName怎么用?C++ LLSimInfo::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSimInfo
的用法示例。
在下文中一共展示了LLSimInfo::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateSims
void LLFloaterWorldMap::updateSims(bool found_null_sim)
{
if (mCompletingRegionName == "")
{
return;
}
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
S32 name_length = mCompletingRegionName.length();
LLSD match;
S32 num_results = 0;
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = it->second;
std::string sim_name_lower = info->getName();
LLStringUtil::toLower(sim_name_lower);
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
if (sim_name_lower == mCompletingRegionName)
{
match = info->getName();
}
LLSD value;
value["id"] = info->getName();
value["columns"][0]["column"] = "sim_name";
value["columns"][0]["value"] = info->getName();
list->addElement(value);
num_results++;
}
}
if (found_null_sim)
{
mCompletingRegionName = "";
}
// if match found, highlight it and go
if (!match.isUndefined())
{
list->selectByValue(match);
childSetFocus("search_results");
onCommitSearchResult();
}
// if we found nothing, say "none"
if (num_results == 0)
{
list->setCommentText(LLTrans::getString("worldmap_results_none_found"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}
示例2: dump
void LLWorldMap::dump()
{
for (sim_info_map_t::iterator it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it)
{
U64 handle = (*it).first;
LLSimInfo* info = (*it).second;
U32 x_pos, y_pos;
from_region_handle(handle, &x_pos, &y_pos);
llinfos << x_pos << "," << y_pos
<< " " << info->getName()
<< " " << (S32)info->getAccess()
<< " " << std::hex << info->getRegionFlags() << std::dec
<< " " << info->getWaterHeight()
//<< " " << info->mTelehubName
//<< " " << info->mTelehubPosition
<< llendl;
if (info->mCurrentImage)
{
llinfos << "image discard " << (S32)info->mCurrentImage->getDiscardLevel()
<< " fullwidth " << info->mCurrentImage->getWidth(0)
<< " fullheight " << info->mCurrentImage->getHeight(0)
<< " maxvirt " << info->mCurrentImage->getMaxVirtualSize()
<< " maxdisc " << (S32)info->mCurrentImage->getMaxDiscardLevel()
<< llendl;
}
}
}
示例3: updateSims
void LLFloaterWorldMap::updateSims(bool found_null_sim)
{
if (mCompletingRegionName == "")
{
return;
}
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
LLSD selected_value = list->getSelectedValue();
S32 name_length = mCompletingRegionName.length();
BOOL match_found = FALSE;
S32 num_results = 0;
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = (*it).second;
std::string sim_name = info->getName();
std::string sim_name_lower = sim_name;
LLStringUtil::toLower(sim_name_lower);
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
if (LLWorldMap::getInstance()->mIsTrackingCommit)
{
if (sim_name_lower == mCompletingRegionName)
{
selected_value = sim_name;
match_found = TRUE;
}
}
LLSD value;
value["id"] = sim_name;
value["columns"][0]["column"] = "sim_name";
value["columns"][0]["value"] = sim_name;
list->addElement(value);
num_results++;
}
}
list->selectByValue(selected_value);
if (found_null_sim)
{
mCompletingRegionName = "";
}
if (match_found)
{
mExactMatch = TRUE;
childSetFocus("search_results");
onCommitSearchResult(NULL, this);
}
else if (!mExactMatch && num_results > 0)
{
list->selectFirstItem(); // select first item by default
childSetFocus("search_results");
onCommitSearchResult(NULL, this);
}
else
{
list->addCommentText(std::string("None found."));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}
示例4: updateSims
void LLFloaterWorldMap::updateSims(bool found_null_sim)
{
if (mCompletingRegionName == "")
{
return;
}
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results");
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
S32 name_length = mCompletingRegionName.length();
LLSD match;
S32 num_results = 0;
std::vector<std::pair <U64, LLSimInfo*> > sim_info_vec(LLWorldMap::getInstance()->getRegionMap().begin(), LLWorldMap::getInstance()->getRegionMap().end());
std::sort(sim_info_vec.begin(), sim_info_vec.end(), SortRegionNames());
for (std::vector<std::pair <U64, LLSimInfo*> >::const_iterator it = sim_info_vec.begin(); it != sim_info_vec.end(); ++it)
{
LLSimInfo* info = it->second;
std::string sim_name_lower = info->getName();
LLStringUtil::toLower(sim_name_lower);
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
if (sim_name_lower == mCompletingRegionName)
{
match = info->getName();
}
LLSD value;
value["id"] = info->getName();
value["columns"][0]["column"] = "sim_name";
value["columns"][0]["value"] = info->getName();
list->addElement(value);
num_results++;
}
}
if (found_null_sim)
{
mCompletingRegionName = "";
}
if (num_results > 0)
{
// Ansariel: Let's sort the list to make it more user-friendly
list->sortByColumn("sim_name", TRUE);
// if match found, highlight it and go
if (!match.isUndefined())
{
list->selectByValue(match);
}
// else select first found item
else
{
list->selectFirstItem();
}
getChild<LLUICtrl>("search_results")->setFocus(TRUE);
onCommitSearchResult();
}
else
{
// if we found nothing, say "none"
list->setCommentText(LLTrans::getString("worldmap_results_none_found"));
list->operateOnAll(LLCtrlListInterface::OP_DESELECT);
}
}