本文整理汇总了C++中LLSimInfo::isName方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSimInfo::isName方法的具体用法?C++ LLSimInfo::isName怎么用?C++ LLSimInfo::isName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSimInfo
的用法示例。
在下文中一共展示了LLSimInfo::isName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onCommitSearchResult
void LLFloaterWorldMap::onCommitSearchResult()
{
LLCtrlListInterface *list = childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = it->second;
if (info->isName(sim_name))
{
LLVector3d pos_global = info->getGlobalOrigin();
const F64 SIM_COORD_DEFAULT = 128.0;
LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f);
// Did this value come from a trackURL() request?
if (!mCompletingRegionPos.isExactlyZero())
{
pos_local = mCompletingRegionPos;
mCompletingRegionPos.clear();
}
pos_global.mdV[VX] += (F64)pos_local.mV[VX];
pos_global.mdV[VY] += (F64)pos_local.mV[VY];
pos_global.mdV[VZ] = (F64)pos_local.mV[VZ];
childSetValue("location", sim_name);
trackLocation(pos_global);
setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn();
}
示例2: onCommitSearchResult
// static
void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata)
{
LLFloaterWorldMap* self = (LLFloaterWorldMap*) userdata;
LLCtrlListInterface *list = self->childGetListInterface("search_results");
if (!list) return;
LLSD selected_value = list->getSelectedValue();
std::string sim_name = selected_value.asString();
if (sim_name.empty())
{
return;
}
LLStringUtil::toLower(sim_name);
std::map<U64, LLSimInfo*>::const_iterator it;
for (it = LLWorldMap::getInstance()->getRegionMap().begin(); it != LLWorldMap::getInstance()->getRegionMap().end(); ++it)
{
LLSimInfo* info = it->second;
if (info->isName(sim_name))
{
LLVector3d pos_global = info->getGlobalOrigin();
F64 local_x = self->childGetValue("spin x");
F64 local_y = self->childGetValue("spin y");
F64 local_z = self->childGetValue("spin z");
pos_global.mdV[VX] += local_x;
pos_global.mdV[VY] += local_y;
pos_global.mdV[VZ] = local_z;
self->childSetValue("location", sim_name);
self->trackLocation(pos_global);
self->setDefaultBtn("Teleport");
break;
}
}
onShowTargetBtn(self);
}
示例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_lower = info->getName();
LLStringUtil::toLower(sim_name_lower);
if (sim_name_lower.substr(0, name_length) == mCompletingRegionName)
{
if (LLWorldMap::getInstance()->isTrackingCommit())
{
if (info->isName(mCompletingRegionName))
{
selected_value = info->getName();
match_found = TRUE;
}
}
LLSD value;
value["id"] = info->getName();
value["columns"][0]["column"] = "sim_name";
value["columns"][0]["value"] = info->getName();
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);
}
}