本文整理汇总了C++中DString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ DString::empty方法的具体用法?C++ DString::empty怎么用?C++ DString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DString
的用法示例。
在下文中一共展示了DString::empty方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnChangeMaterial
void ObjFileEditDialog::OnChangeMaterial(wxCommandEvent &e)
{
if(NULL == m_pEntityListMaterialComboBox
|| NULL == m_pMaterialListMaterialComboBox)
return;
DString entmatname = m_pEntityListMaterialComboBox->GetStringSelection().c_str();
DString matmatname = m_pMaterialListMaterialComboBox->GetStringSelection().c_str();
if(entmatname.empty() && matmatname.empty())
return;
DString matname;
if(entmatname.empty())
{
matname = matmatname;
}
else
{
matname = entmatname;
}
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
std::vector<Ogre::String> matvec = Ogre::StringUtil::split(matname,".");
pModel->ChangeMat(matvec[0],matvec[0]);
}
示例2: OnChangeLocator
void ObjFileEditDialog::OnChangeLocator(wxCommandEvent &e)
{
if(NULL == m_pLocatorNameComboBox
|| NULL == GetDataManipulatr())
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
DString locatorname = m_pLocatorNameComboBox->GetStringSelection().c_str();
if(locatorname.empty())
locatorname = m_pLocatorNameComboBox->GetValue().c_str();
if(locatorname.empty())
return;
std::vector<Ogre::String> locatorvec = Ogre::StringUtil::split(locatorname,"\\");
if(locatorvec.size() < 2)
return;
const DString bone = locatorvec[0];
const DString locator = locatorvec[1];
pModel->UpdateLocatorPosAndOriData(locator);
}
示例3: parseAddress
sockaddr_in DSocket::parseAddress( const DString& addr, uint16 port )
{
sockaddr_in ret;
std::memset(&ret, 0, sizeof(ret));
if (addr.empty())
{
ret.sin_addr.s_addr = htonl(INADDR_ANY);
}
else
{
ret.sin_addr.s_addr = inet_addr(addr.c_str());
}
if (INADDR_NONE == ret.sin_addr.s_addr)
{
hostent* pHostEnt = gethostbyname(addr.c_str());
if (pHostEnt != NULL)
{
std::memcpy(&ret.sin_addr.s_addr,
pHostEnt->h_addr_list[0], pHostEnt->h_length);
}
else
{
DUEL_EXCEPT_BRIEF(DException::ET_InvalidParameters,
"Invalid address: " + addr,
"Duel::DSocket::parseAddress");
}
}
ret.sin_family = AF_INET;
ret.sin_port = htons(port);
return ret;
}
示例4: OnSelObjTemplate
void ObjFileEditDialog::OnSelObjTemplate(wxCommandEvent &e)
{
if(NULL == GetDataManipulatr())
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
{
wxMessageBox("请选择需要创建obj文件的模型!");
return;
}
if(!pModel->m_IsCanSelectTemplate)
{
wxMessageBox("该模型已有对应的obj文件,如要生成obj文件,请使用mesh文件创建!");
return;
}
DString templatename = m_pObjFileTable->GetStringSelection().c_str();
if(templatename.empty())
templatename = m_pObjFileTable->GetValue().c_str();
pModel->m_IsAvatarTemplate = false;
pModel->UpdateObjTemplateData(templatename);
}
示例5: OnChangeAttributeHints
void ObjFileEditDialog::OnChangeAttributeHints(wxCommandEvent &e)
{
if(NULL == m_pAttributeHintsComboBox
|| NULL == m_pAttributeNameComboBox
|| NULL == GetDataManipulatr())
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
DString Attributename = m_pAttributeNameComboBox->GetStringSelection().c_str();
if(Attributename.empty())
Attributename = m_pAttributeNameComboBox->GetValue().c_str();
DString AttributeHints = m_pAttributeHintsComboBox->GetStringSelection().c_str();
bool bResult = pModel->ChangeHints(Attributename,AttributeHints);
if(bResult)
{
wxMessageBox(wxString::Format("成功修改属性<%s>提示为<%s>!",Attributename.c_str(),AttributeHints.c_str()));
}
else
{
wxMessageBox(wxString::Format("操作失败!没有找到属性<%s>!",Attributename.c_str()));
}
}
示例6: OnChangeEffect
void ObjFileEditDialog::OnChangeEffect(wxCommandEvent &e)
{
if(NULL == m_pEffectNameComboBox)
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
DString locatorname = m_pLocatorNameComboBox->GetStringSelection().c_str();
if(locatorname.empty())
locatorname = m_pLocatorNameComboBox->GetValue().c_str();
if(locatorname.empty())
return;
std::vector<Ogre::String> locatorvec = Ogre::StringUtil::split(locatorname,"\\");
if(locatorvec.size() < 2)
return;
const DString bone = locatorvec[0];
const DString locator = locatorvec[1];
DString effectname = m_pEffectNameComboBox->GetStringSelection().c_str();
if(effectname.empty())
return;
std::vector<Ogre::String> effectvec = Ogre::StringUtil::split(effectname,".");
const DString effect = effectvec[0];
bool nResult = pModel->ChangeEffect(effect,locator,bone);
if(!nResult)
{
wxMessageBox(wxString::Format("不存在特效对应的挂点<%s>,请检查美术资源!",locator.c_str()));
}
}
示例7: OnAddSkeleton
void ObjFileEditDialog::OnAddSkeleton(wxCommandEvent &e)
{
if(NULL == m_pSkeletonAdd
|| NULL == m_pSkeletonTable
|| NULL == m_pSkeletonName
|| NULL == GetDataManipulatr())
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
DString skeletonname = m_pSkeletonTable->GetStringSelection().c_str();
if(skeletonname.empty())
skeletonname = m_pSkeletonTable->GetValue().c_str();
if(skeletonname.empty())
{
wxMessageBox("请选择要添加的骨骼!");
return;
}
pModel->m_AniSkelist.push_back(skeletonname);
DStringList Anilist;
pModel->m_AniSkelistLink.insert(Fairy::CGod::AniSkelistLink::value_type(skeletonname,Anilist));
wxMessageBox(wxString::Format("添加骨骼<%s>成功!",skeletonname.c_str()));
m_pSkeletonName->Clear();
for(int i=0;i<(int)pModel->m_AniSkelist.size();i++)
{
m_pSkeletonName->AppendString(pModel->m_AniSkelist[i].c_str());
}
}
示例8: OnDelSkeleton
void ObjFileEditDialog::OnDelSkeleton(wxCommandEvent &e)
{
if(NULL == m_pSkeletonAdd
|| NULL == m_pSkeletonName
|| NULL == GetDataManipulatr())
return;
Fairy::CGod* pModel = GetDataManipulatr()->FindModel(GetDataManipulatr()->m_CurModelName);
if(NULL == pModel)
return;
DString skeletonname = m_pSkeletonName->GetStringSelection().c_str();
if(skeletonname.empty())
{
wxMessageBox("请选择要删除的骨骼!");
return;
}
int nSize = pModel->m_AniSkelist.size();
DStringList::iterator it;
for(int i=0;i<nSize;i++)
{
it = pModel->m_AniSkelist.begin()+i;
if(skeletonname.compare(pModel->m_AniSkelist[i]) == 0)
{
pModel->m_AniSkelist.erase(it);
break;
}
}
Fairy::CGod::AniSkelistLink::iterator itlink = pModel->m_AniSkelistLink.find(skeletonname);
if(itlink != pModel->m_AniSkelistLink.end())
{
pModel->m_AniSkelistLink.erase(skeletonname);
}
wxMessageBox(wxString::Format("删除骨骼<%s>成功!",skeletonname.c_str()));
m_pSkeletonName->Clear();
for(int i=0;i<(int)pModel->m_AniSkelist.size();i++)
{
m_pSkeletonName->AppendString(pModel->m_AniSkelist[i].c_str());
}
}
示例9: make_pair
pair<Layout::Node*,bool> View::getNode(DString id,bool create) {
if(id.empty())
id = randomName('n');
Layout::Node *n = nodes[id];
if(n)
return make_pair(n,false);
if(!create)
return make_pair<Layout::Node*>(0,false);
NodeAttrs *NA = new NodeAttrs();
n = layout.create_node(*NA);
delete NA;
gd<Name>(n) = id;
nodes[id] = n;
return make_pair(n,true);
}
示例10: if
pair<Layout::Edge*,bool> View::getEdge(DString id,Layout::Node *t,Layout::Node *h,bool create) {
Layout::Edge *e=0;
if(id.empty())
id = randomName('e');
else if((e = edges[id]))
return make_pair(e,false);
if(!(t && h))
return make_pair<Layout::Edge*>(0,false);
e = layout.find_edge(t,h);
if(e)
return make_pair(e,false);
if(!create)
return make_pair<Layout::Edge*>(0,false);
e = layout.create_edge(t,h).first;
gd<Name>(e) = id;
edges[id] = e;
return make_pair(e,true);
}