Пример #1
0
void veValueCurved::processControlPoints()
{
    if (_cpList.empty() || _iType != InterpolationType::IT_SPLINE)
        return;
    
    std::sort(_cpList.begin(), _cpList.end(), ControlPointSorter());
    _range = (*getLastValidIterator()).x() - (*getFirstValidIterator()).x();
    
    if (_iType == InterpolationType::IT_SPLINE)
    {
        // Add all sorted control points to the spline
        veValueCurved::ControlPointList::iterator it;
        _spline.clear();
        for (it = _cpList.begin(); it != _cpList.end(); ++it)
            _spline.addPoint(veVec3((*it).x(), (*it).y(), 0.0f));
    }
}
	//-----------------------------------------------------------------------
	void DynamicAttributeCurved::processControlPoints(void)
	{
		if (mControlPoints.empty())
			return;

		std::sort(mControlPoints.begin(), mControlPoints.end(), ControlPointSorter());
		mRange = (*_getLastValidIterator()).x - (*_getFirstValidIterator()).x;

		if (mInterpolationType == IT_SPLINE)
		{
			// Add all sorted control points to the spline
			DynamicAttributeCurved::ControlPointList::iterator it;
			mSpline.clear();
			for (it = mControlPoints.begin(); it != mControlPoints.end(); ++it)
				mSpline.addPoint(Vector3((*it).x, (*it).y, 0));
		}
	}