53 #define ACG_KNOTVECTORT_C 55 #include "KnotvectorT.hh" 59 template <
typename Scalar >
62 : ref_count_selections_(0), knotvectorType_(UNIFORM_INTERPOL),num_control_points_(0),spline_degree_(0)
68 template <
typename Scalar >
71 : selections_(_knotvec.selections_),
72 ref_count_selections_( _knotvec.ref_count_selections_),
73 knots_(_knotvec.knots_),
74 knotvectorType_(_knotvec.knotvectorType_),
75 num_control_points_(_knotvec.num_control_points_),
76 spline_degree_(_knotvec.spline_degree_)
83 template<
typename Scalar >
91 template <
typename Scalar >
96 knotvectorType_ = _type;
98 if ( (spline_degree_ != 0) && (num_control_points_ != 0))
99 createKnots(spline_degree_, num_control_points_);
104 template <
typename Scalar >
107 createKnots(
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);
120 template <
typename Scalar >
125 knots_.push_back(_knot);
128 if( selections_available())
129 selections_.push_back(
false);
134 template <
typename Scalar >
137 insertKnot(
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);
149 template<
typename Scalar >
154 assert(_index < knots_.size());
155 knots_.erase(knots_.begin()+_index);
157 if( selections_available())
158 selections_.erase(selections_.begin()+_index);
163 template<
typename Scalar >
171 if( selections_available())
172 selections_.resize(knots_.size(),
false);
179 template<
typename Scalar >
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);
211 template<
typename Scalar >
219 int k = _dim + _splineDeg + 1;
221 for (
int i = 0; i < k; ++i )
225 if( selections_available())
226 selections_.resize(knots_.size(),
false);
238 template<
typename Scalar >
239 template <
class PropT>
247 _prop.resize(size());
255 template<
typename Scalar >
256 template <
class PropT>
Namespace providing different geometric functions concerning angles.
KnotvectorT()
Constructor.