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


C++ DataManager::RemoveVolumeDataset方法代码示例

本文整理汇总了C++中DataManager::RemoveVolumeDataset方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::RemoveVolumeDataset方法的具体用法?C++ DataManager::RemoveVolumeDataset怎么用?C++ DataManager::RemoveVolumeDataset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataManager的用法示例。


在下文中一共展示了DataManager::RemoveVolumeDataset方法的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();
   }
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:84,代码来源:ListPanel.cpp

示例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();
   }
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:88,代码来源:ListPanel.cpp


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