本文整理汇总了C++中DataManager::GetMeshIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::GetMeshIndex方法的具体用法?C++ DataManager::GetMeshIndex怎么用?C++ DataManager::GetMeshIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::GetMeshIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteAll
void DataListCtrl::DeleteAll()
{
VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
wxString name = "";
long item = GetNextItem(-1);
while (item != -1 && vr_frame)
{
if (GetItemText(item) == "Volume")
{
name = GetText(item, 1);
DataManager* mgr = vr_frame->GetDataManager();
BaseReader *reader = NULL;
int chan = -1;
if (mgr)
{
VolumeData *vd = mgr->GetVolumeData(name);
reader = vd->GetReader();
chan = vd->GetCurChannel();
}
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
view->RemoveVolumeDataset(reader, chan);
}
//from datamanager
if (mgr)
mgr->RemoveVolumeDataset(reader, chan);
}
else if (GetItemText(item) == "Mesh")
{
name = GetText(item, 1);
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
view->RemoveMeshData(name);
}
//from datamanager
DataManager* mgr = vr_frame->GetDataManager();
if (mgr)
{
int index = mgr->GetMeshIndex(name);
if (index != -1)
mgr->RemoveMeshData(index);
}
}
else if (GetItemText(item) == "Annotations")
{
name = GetText(item, 1);
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
view->RemoveAnnotations(name);
}
//from datamanager
DataManager* mgr = vr_frame->GetDataManager();
if (mgr)
{
int index = mgr->GetAnnotationIndex(name);
if (index != -1)
mgr->RemoveAnnotations(index);
}
}
item = GetNextItem(item);
}
DeleteAllItems();
if (vr_frame)
{
vr_frame->UpdateTree();
vr_frame->RefreshVRenderViews();
}
}
示例2: DeleteSelection
void DataListCtrl::DeleteSelection()
{
VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
wxString name = "";
if (vr_frame && GetSelectedItemCount()>0)
{
long item = GetNextItem(-1,
wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
if (item != -1)
{
if (GetItemText(item) == "Volume")
{
name = GetText(item, 1);
DataManager* mgr = vr_frame->GetDataManager();
BaseReader *reader = NULL;
int chan = -1;
if (mgr)
{
VolumeData *vd = mgr->GetVolumeData(name);
reader = vd->GetReader();
chan = vd->GetCurChannel();
}
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
view->RemoveVolumeDataset(reader, chan);
}
//from datamanager
if (mgr)
mgr->RemoveVolumeDataset(reader, chan);
}
else if (GetItemText(item) == "Mesh")
{
name = GetText(item, 1);
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
{
view->RemoveMeshData(name);
}
}
//from datamanager
DataManager* mgr = vr_frame->GetDataManager();
if (mgr)
{
int index = mgr->GetMeshIndex(name);
if (index != -1)
{
mgr->RemoveMeshData(index);
}
}
}
else if (GetItemText(item) == "Annotations")
{
name = GetText(item, 1);
int i;
//from view
for (i=0; i<(int)vr_frame->GetViewList()->size(); i++)
{
VRenderView* view = (*vr_frame->GetViewList())[i];
if (view)
view->RemoveAnnotations(name);
}
//from datamanager
DataManager* mgr = vr_frame->GetDataManager();
if (mgr)
{
int index = mgr->GetAnnotationIndex(name);
if (index != -1)
mgr->RemoveAnnotations(index);
}
}
}
vr_frame->UpdateList();
vr_frame->UpdateTree(name);
vr_frame->RefreshVRenderViews();
}
}