本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
}