本文整理汇总了C++中Curve::GetNumberControlPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ Curve::GetNumberControlPoints方法的具体用法?C++ Curve::GetNumberControlPoints怎么用?C++ Curve::GetNumberControlPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curve
的用法示例。
在下文中一共展示了Curve::GetNumberControlPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KeyPress
void CurveEditTool::KeyPress( const KeyboardInput& e )
{
if ( !m_Scene->IsEditable() )
{
return;
}
int32_t keyCode = e.GetKeyCode();
if ( keyCode == KeyCodes::Left || keyCode == KeyCodes::Up || keyCode == KeyCodes::Right || keyCode == KeyCodes::Down )
{
OS_SceneNodeDumbPtr selection = m_Scene->GetSelection().GetItems();
if ( selection.Empty() )
{
return;
}
CurveControlPoint* point = Reflect::SafeCast<CurveControlPoint>( selection.Front() );
if ( !point )
{
return;
}
Curve* curve = Reflect::SafeCast<Curve>( point->GetParent() );
if ( !curve )
{
return;
}
int32_t index = curve->GetIndexForControlPoint( point );
if ( index == -1 )
{
return;
}
uint32_t countControlPoints = curve->GetNumberControlPoints();
if ( keyCode == KeyCodes::Left || keyCode == KeyCodes::Down )
{
index--;
index += countControlPoints;
index %= countControlPoints;
}
else if ( keyCode == KeyCodes::Right || keyCode == KeyCodes::Up )
{
index++;
index %= countControlPoints;
}
point = curve->GetControlPointByIndex( index );
selection.Clear();
selection.Append( point );
m_Scene->GetSelection().SetItems( selection );
}
Base::KeyPress( e );
}