99 void setType(KnotvectorType _type);
101 void createKnots(
unsigned int _splineDeg,
unsigned int _dim);
103 inline std::vector< Scalar >& getKnotvector() {
return knots_;}
104 inline const std::vector< Scalar >& getKnotvector()
const {
return knots_; }
106 inline unsigned int size()
const {
return knots_.size();}
108 inline Scalar getKnot(
unsigned int _index)
const {
109 assert(_index < knots_.size());
110 return knots_.at(_index);
113 void setKnotvector(
const std::vector< Scalar >& _knots);
115 void resize(
unsigned int _size) {knots_.resize(_size);}
117 void insertKnot(
unsigned int _index,
const Scalar _knot);
119 void addKnot(Scalar _knot);
121 inline void setKnot(
unsigned int _index, Scalar _knot) {
122 assert(_index < knots_.size());
123 knots_.at(_index) = _knot;
126 void deleteKnot(
unsigned int _index);
134 assert (_index < knots_.size());
135 return knots_[_index];
142 inline const Scalar &
operator()(
unsigned int _index)
const {
143 assert (_index < knots_.size());
144 return knots_[_index];
147 void clear() {knots_.clear();};
154 void request_selections() { request_prop( ref_count_selections_, selections_);}
157 void release_selections() { release_prop( ref_count_selections_, selections_);}
160 bool selections_available()
const {
return bool(ref_count_selections_);}
163 unsigned char& selection(
unsigned int _i) {
164 assert(_i < selections_.size());
165 assert(selections_available());
166 return selections_[_i];
168 const unsigned char& selection(
unsigned int _i)
const {
169 assert(_i < selections_.size());
170 assert(selections_available());
171 return selections_[_i];
175 void select(
unsigned int _pIdx) { selection(_pIdx) = 1; };
176 void deselect(
unsigned int _pIdx) { selection(_pIdx) = 0; };
178 bool selected(
unsigned int _pIdx)
const {
return (selection(_pIdx) == 1); };
183 template <
class PropT>
184 void request_prop(
unsigned int& _ref_count, PropT& _prop);
186 template <
class PropT>
187 void release_prop(
unsigned int& _ref_count, PropT& _prop);
192 std::vector<unsigned char> selections_;
195 unsigned int ref_count_selections_;
199 std::vector<Scalar> knots_;
201 KnotvectorType knotvectorType_;
203 void createUniformInterpolatingKnots(
unsigned int _splineDeg,
unsigned int _dim);
205 void createUniformKnots(
unsigned int _splineDeg,
unsigned int _dim);
207 unsigned int num_control_points_;
208 unsigned int spline_degree_;