本文整理汇总了C++中DataManager::GetVolumeData方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::GetVolumeData方法的具体用法?C++ DataManager::GetVolumeData怎么用?C++ DataManager::GetVolumeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::GetVolumeData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EndEdit
void DataListCtrl::EndEdit(bool update)
{
if (!m_rename_text->IsShown())
return;
if (update)
{
wxString new_name = m_rename_text->GetValue();
long item = GetNextItem(-1,
wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
DataManager* mgr = vr_frame?vr_frame->GetDataManager():0;
if (item != -1 && mgr)
{
wxString name = GetText(item, 1);
if (new_name != name)
{
wxString new_name2 = new_name;
for (int i=1; mgr->CheckNames(new_name2); i++)
new_name2 = new_name+wxString::Format("_%d", i);
if (GetItemText(item) == "Volume")
{
VolumeData* vd = mgr->GetVolumeData(name);
if (vd)
vd->SetName(new_name2);
}
else if (GetItemText(item) == "Mesh")
{
MeshData* md = mgr->GetMeshData(name);
if (md)
md->SetName(new_name2);
}
else if (GetItemText(item) == "Annotations")
{
Annotations* ann = mgr->GetAnnotations(name);
if (ann)
ann->SetName(new_name2);
}
//update ui
SetText(item, 1, new_name2);
vr_frame->UpdateTree();
}
}
}
m_rename_text->Hide();
}
示例2: LoadVolumes
void ColocalizationDlg::LoadVolumes()
{
VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
if (!vr_frame) return;
DataManager* mgr = vr_frame->GetDataManager();
if (!mgr) return;
m_vol_a = mgr->GetVolumeData(m_calc_a_text->GetValue());
m_vol_b = mgr->GetVolumeData(m_calc_b_text->GetValue());
}
示例3: InsertKey
void RecorderDlg::InsertKey(int index, double duration, int interpolation)
{
VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
if (!vr_frame)
return;
if (!m_view)
{
if (vr_frame && vr_frame->GetView(0))
m_view = vr_frame->GetView(0);
else
return;
}
DataManager* mgr = vr_frame->GetDataManager();
if (!mgr)
return;
Interpolator *interpolator = vr_frame->GetInterpolator();
if (!interpolator)
return;
KeyCode keycode;
FlKeyDouble* flkey = 0;
FlKeyQuaternion* flkeyQ = 0;
FlKeyBoolean* flkeyB = 0;
FlKeyInt* flkeyI = 0;
double t = interpolator->GetLastT();
t = t<0.0?0.0:t+duration;
interpolator->Begin(t);
//for all volumes
for (int i=0; i<mgr->GetVolumeNum() ; i++)
{
VolumeData* vd = mgr->GetVolumeData(i);
keycode.l0 = 1;
keycode.l0_name = m_view->GetName();
keycode.l1 = 2;
keycode.l1_name = vd->GetName();
//display
keycode.l2 = 0;
keycode.l2_name = "display";
flkeyB = new FlKeyBoolean(keycode, vd->GetDisp());
interpolator->AddKey(flkeyB);
//clipping planes
vector<Plane*> * planes = vd->GetVR()->get_planes();
if (!planes)
continue;
if (planes->size() != 6)
continue;
Plane* plane = 0;
double abcd[4];
//x1
plane = (*planes)[0];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "x1_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
//x2
plane = (*planes)[1];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "x2_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
//y1
plane = (*planes)[2];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "y1_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
//y2
plane = (*planes)[3];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "y2_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
//z1
plane = (*planes)[4];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "z1_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
//z2
plane = (*planes)[5];
plane->get_copy(abcd);
keycode.l2 = 0;
keycode.l2_name = "z2_val";
flkey = new FlKeyDouble(keycode, abs(abcd[3]));
interpolator->AddKey(flkey);
}
//for the view
keycode.l0 = 1;
keycode.l0_name = m_view->GetName();
keycode.l1 = 1;
keycode.l1_name = m_view->GetName();
//rotation
//.........这里部分代码省略.........
示例4: 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();
}
}
示例5: 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();
}
}