本文整理汇总了C++中NodeTree::getSimu方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeTree::getSimu方法的具体用法?C++ NodeTree::getSimu怎么用?C++ NodeTree::getSimu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeTree
的用法示例。
在下文中一共展示了NodeTree::getSimu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowSelection
void MainWindow::ShowSelection(wxCommandEvent& event)
{
int id=event.GetId();
bool d_box=toolbar->GetToolState(id);
NodeTree *itemData = tree->GetSelection().IsOk() ? (NodeTree *) tree->GetItemData(tree->GetSelection())
:NULL;
if(d_box)
{
tree->SetShowSelection(true);
if(!tree->GetSelection().IsOk()) return;
if(itemData->menus.menu_solid && tree->GetSelection()!=tree->GetRootItem())
{
itemData->pointer.solidentity->setDrawBox(true);
itemData->getSimu()->getChild()->Refresh();
}
}
else
{
tree->SetShowSelection(false);
if(!tree->GetSelection().IsOk()) return;
if(itemData->menus.menu_solid && tree->GetSelection()!=tree->GetRootItem())
{
itemData->pointer.solidentity->setDrawBox(false);
itemData->getSimu()->getChild()->Refresh();
}
}
}
示例2: OnNameItemTree
void MainWindow::OnNameItemTree(wxCommandEvent& WXUNUSED(event))
{
wxTreeItemId itemId = tree->GetSelection();
NodeTree *itemData = itemId .IsOk() ? (NodeTree *)tree->GetItemData(itemId ):NULL;
static wxString s_text;
s_text = wxGetTextFromUser(wxT("New name:"), wxT("Change Name Item Tree"),s_text, this);
char text[100];
strcpy(text,(const char*)s_text.mb_str(wxConvUTF8));
if(!s_text.empty() && itemData->menus.menu_world)
{
tree->SetItemText(itemId, s_text);
itemData->getSimu()->setName(s_text.ToStdString());
}
else if ( !s_text.empty() && itemData->pointer.positionableentity)
{
itemData->pointer.positionableentity->setName(text);
tree->SetItemText(itemId, s_text);
}
}
示例3: OnLinkTo
void MainWindow::OnLinkTo(wxCommandEvent& event)
{
if(listWorlds.size()>0)
{
int id=event.GetId();
wxTreeItemId itemId = tree->GetSelection();
NodeTree *itemData = itemId.IsOk() ? (NodeTree *) tree->GetItemData(itemId):NULL;
if(itemData->pointer.positionableentity)
{
simuWorld=itemData->getSimu();
if (id==ID_LINKTO)
{
state=1;
wxSetCursor(wxCURSOR_POINT_LEFT);
simuWorld->SetEntityToLink(itemData->pointer.positionableentity);
wxLogStatus(wxT("Select Item(Link to)"));
id=NULL;
}
if (id==ID_UNLINK)
{
if (showLinks==true) tree->EraseMarks(itemData);
itemData->pointer.positionableentity->LinkTo(NULL); //Deslinkar
if(GetTreeStructureState()==true)
{
simuWorld->InitializeItemsVectors();
tree->UpdateTree(simuWorld);
tree->showTreeStructure(true);
}
wxLogStatus(wxT("Unlink done"));
state=0;
}
}
if (id==ID_SHOWLINKS)
{
showLinks=treeToolbar->GetToolState(id);
if(showLinks)
{
tree->setShowLinks(true);
treeToolbar->EnableTool(ID_TREESTRUCTURE,false);
}
else
{
tree->setShowLinks(false);
treeToolbar->EnableTool(ID_TREESTRUCTURE,true);
}
}
if (id==ID_TREESTRUCTURE)
{
treeStruc=treeToolbar->GetToolState(id);
if(treeStruc)
{
tree->showTreeStructure(true);
treeToolbar->EnableTool(ID_SHOWLINKS,false);
}
else
{
tree->showTreeStructure(false);
treeToolbar->EnableTool(ID_SHOWLINKS,true);
}
}
}
}