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


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

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


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

示例1: OnInsKey

void RecorderDlg::OnInsKey(wxCommandEvent &event)
{
	wxString str;
	VRenderFrame* vr_frame = (VRenderFrame*)m_frame;
	if (!vr_frame)
		return;
	Interpolator* interpolator = vr_frame->GetInterpolator();
	if (!interpolator)
		return;
	long item = m_keylist->GetNextItem(-1,
		wxLIST_NEXT_ALL,
		wxLIST_STATE_SELECTED);
	int index = -1;
	if (item != -1)
	{
		str = m_keylist->GetItemText(item);
		long id;
		str.ToLong(&id);
		index = interpolator->GetKeyIndex(id);
	}
	str = m_duration_text->GetValue();
	double duration;
	str.ToDouble(&duration);
	int interpolation = m_interpolation_cmb->GetSelection();
	InsertKey(index, duration, interpolation);

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

示例2: OnDescritionText

void KeyListCtrl::OnDescritionText(wxCommandEvent& event)
{
	if (m_editing_item == -1)
		return;

	wxString str = GetItemText(m_editing_item);
	long id;
	str.ToLong(&id);

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

	int index = interpolator->GetKeyIndex(int(id));
	FlKeyGroup* keygroup = interpolator->GetKeyGroup(index);
	if (keygroup)
	{
		str = m_description_text->GetValue();
		keygroup->desc = str.ToStdString();
		SetText(m_editing_item, 4, str);
	}
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:25,代码来源:RecorderDlg.cpp

示例3: OnInterpoCmb

void KeyListCtrl::OnInterpoCmb(wxCommandEvent& event)
{
	if (m_editing_item == -1)
		return;

	wxString str = GetItemText(m_editing_item);
	long id;
	str.ToLong(&id);

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

	int index = interpolator->GetKeyIndex(int(id));
	FlKeyGroup* keygroup = interpolator->GetKeyGroup(index);
	if (keygroup)
	{
		int sel = m_interpolation_cmb->GetSelection();
		keygroup->type = sel;
		str = sel==0?"Linear":"Smooth";
		SetText(m_editing_item, 3, str);
	}
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:26,代码来源:RecorderDlg.cpp

示例4: OnDurationText

void KeyListCtrl::OnDurationText(wxCommandEvent& event)
{
	if (m_editing_item == -1)
		return;

	wxString str = GetItemText(m_editing_item);
	long id;
	str.ToLong(&id);

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

	int index = interpolator->GetKeyIndex(int(id));
	str = m_duration_text->GetValue();
	double duration;
	if (str.ToDouble(&duration))
	{
		interpolator->ChangeDuration(index, duration);
		SetText(m_editing_item, 2, str);
	}
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:25,代码来源:RecorderDlg.cpp

示例5: OnAct

void KeyListCtrl::OnAct(wxListEvent &event)
{
	long item = GetNextItem(-1,
		wxLIST_NEXT_ALL,
		wxLIST_STATE_SELECTED);
	if (item == -1)
		return;
	wxString str = GetItemText(item);
	long id;
	str.ToLong(&id);

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

	int index = interpolator->GetKeyIndex(int(id));
	double time = interpolator->GetKeyTime(index);
	VRenderView* view = vr_frame->GetRecorderDlg()->GetView();
	if (!view)
		view = vr_frame->GetView(0);
	if (view)
	{
		view->m_glview->SetParams(time);
		view->RefreshGL();
	}
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:29,代码来源:RecorderDlg.cpp

示例6: OnFrameText

void KeyListCtrl::OnFrameText(wxCommandEvent& event)
{
	if (m_editing_item == -1)
		return;

	wxString str = GetItemText(m_editing_item);
	long id;
	str.ToLong(&id);

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

	int index = interpolator->GetKeyIndex(int(id));
	str = m_frame_text->GetValue();
	double time;
	if (str.ToDouble(&time))
	{
		interpolator->ChangeTime(index, time);
	}
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:24,代码来源:RecorderDlg.cpp


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