本文整理汇总了C++中DataManager::GetVolumeNum方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::GetVolumeNum方法的具体用法?C++ DataManager::GetVolumeNum怎么用?C++ DataManager::GetVolumeNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::GetVolumeNum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
//.........这里部分代码省略.........