当前位置: 首页>>代码示例>>C++>>正文


C++ NodeTree::getSimu方法代码示例

本文整理汇总了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();
		}
		
	}
	
		
}
开发者ID:CristinaGajate,项目名称:Apolo,代码行数:32,代码来源:mainWindow.cpp

示例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);
    }
}
开发者ID:CristinaGajate,项目名称:Apolo,代码行数:19,代码来源:mainWindow.cpp

示例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);
			}
		}
	}
}
开发者ID:CristinaGajate,项目名称:Apolo,代码行数:69,代码来源:mainWindow.cpp


注:本文中的NodeTree::getSimu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。