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


C++ Interpolator::GetLastT方法代码示例

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


在下文中一共展示了Interpolator::GetLastT方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnPlay

void RecorderDlg::OnPlay(wxCommandEvent &event)
{
	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;
	}

	Interpolator *interpolator = vr_frame->GetInterpolator();
	if (!interpolator)
		return;

	wxFileDialog *fopendlg = new wxFileDialog(
		m_frame, "Save Movie Sequence", 
		"", "", "*.tif", wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
	fopendlg->SetExtraControlCreator(CreateExtraCaptureControl);

	int rval = fopendlg->ShowModal();
	if (rval == wxID_OK)
	{
		wxString filename = fopendlg->GetPath();
		int begin_frame = int(interpolator->GetFirstT());
		int end_frame = int(interpolator->GetLastT());
		m_view->SetParamCapture(filename, begin_frame, end_frame, false);

		if (vr_frame->GetSettingDlg() &&
			vr_frame->GetSettingDlg()->GetProjSave())
		{
			wxString new_folder;
			new_folder = filename + "_project";
			CREATE_DIR(new_folder.fn_str());
			wxString prop_file = new_folder + "/" + fopendlg->GetFilename() + "_project.vrp";
			vr_frame->SaveProject(prop_file);
		}
	}

	delete fopendlg;
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:43,代码来源:RecorderDlg.cpp

示例2: OnPreview

void RecorderDlg::OnPreview(wxCommandEvent &event)
{
	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;
	}

	Interpolator *interpolator = vr_frame->GetInterpolator();
	if (!interpolator)
		return;

	wxString filename = "";
	int begin_frame = int(interpolator->GetFirstT());
	int end_frame = int(interpolator->GetLastT());
	m_view->SetParamCapture(filename, begin_frame, end_frame, true);

}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:23,代码来源:RecorderDlg.cpp

示例3: AutoKeyChanComb

void RecorderDlg::AutoKeyChanComb(int comb)
{
	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;

	wxString str = m_duration_text->GetValue();
	double duration;
	str.ToDouble(&duration);

	KeyCode keycode;
	FlKeyBoolean* flkeyB = 0;

	double t = interpolator->GetLastT();
	t = t<0.0?0.0:t;
	if (t>0.0) t += duration;

	int i;
	int numChan = m_view->GetAllVolumeNum();
	vector<bool> chan_mask;
	//initiate mask
	for (i=0; i<numChan; i++)
	{
		if (i < comb)
			chan_mask.push_back(true);
		else
			chan_mask.push_back(false);
	}

	do
	{
		interpolator->Begin(t);

		//for all volumes
		for (i=0; i<m_view->GetAllVolumeNum(); i++)
		{
			VolumeData* vd = m_view->GetAllVolumeData(i);
			keycode.l0 = 1;
			keycode.l0_name = m_view->GetName();
			keycode.l1 = 2;
			keycode.l1_name = vd->GetName();
			//display only
			keycode.l2 = 0;
			keycode.l2_name = "display";
			flkeyB = new FlKeyBoolean(keycode, chan_mask[i]);
			interpolator->AddKey(flkeyB);
		}

		interpolator->End();
		t += duration;
	} while (GetMask(chan_mask));

	m_keylist->Update();
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:68,代码来源:RecorderDlg.cpp

示例4: 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
//.........这里部分代码省略.........
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:101,代码来源:RecorderDlg.cpp


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