98 if ( (spline_degree_ != 0) && (num_control_points_ != 0))
99 createKnots(spline_degree_, num_control_points_);
104template <
typename Scalar >
107createKnots(
unsigned int _splineDeg,
unsigned int _dim)
109 num_control_points_ = _dim;
110 spline_degree_ = _splineDeg;
112 if (knotvectorType_ == UNIFORM)
113 createUniformKnots(_splineDeg, _dim);
114 else if (knotvectorType_ == UNIFORM_INTERPOL)
115 createUniformInterpolatingKnots(_splineDeg, _dim);
120template <
typename Scalar >
125 knots_.push_back(_knot);
128 if( selections_available())
129 selections_.push_back(
false);
134template <
typename Scalar >
137insertKnot(
unsigned int _index,
const Scalar _knot)
139 assert(_index < knots_.size());
140 knots_.insert(knots_.begin()+_index, _knot);
143 if( selections_available())
144 selections_.insert(selections_.begin()+_index,
false);
149template<
typename Scalar >
152deleteKnot(
unsigned int _index)
154 assert(_index < knots_.size());
155 knots_.erase(knots_.begin()+_index);
157 if( selections_available())
158 selections_.erase(selections_.begin()+_index);
163template<
typename Scalar >
166setKnotvector(
const std::vector< Scalar >& _knots)
171 if( selections_available())
172 selections_.resize(knots_.size(),
false);
179template<
typename Scalar >
182createUniformInterpolatingKnots(
unsigned int _splineDeg,
unsigned int _dim)
188 for (
unsigned int i = 0; i < _splineDeg; i++)
191 for (
int i = 0; i < (int)_dim - (
int)_splineDeg + 1; i++) {
196 for (
unsigned int i = 0; i < _splineDeg; i++)
197 knots_.push_back(last);
200 if( selections_available())
201 selections_.resize(knots_.size(),
false);
211template<
typename Scalar >
214createUniformKnots(
unsigned int _splineDeg,
unsigned int _dim)
219 int k = _dim + _splineDeg + 1;
221 for (
int i = 0; i < k; ++i )
225 if( selections_available())
226 selections_.resize(knots_.size(),
false);
238template<
typename Scalar >
239template <
class PropT>
242request_prop(
unsigned int& _ref_count, PropT& _prop)
247 _prop.resize(size());
255template<
typename Scalar >
256template <
class PropT>
259release_prop(
unsigned int& _ref_count, PropT& _prop)