88 typedef typename Point::value_type Scalar;
103 std::vector< Scalar >&
get_knots() {
return knotvector_.getKnotvector();};
106 void set_knots(std::vector< Scalar > _knots);
170 unsigned int n_knots()
const {
return knotvector_.size(); };
173 unsigned int degree()
const {
return degree_;};
190 void autocompute_knotvector(
bool _auto) {autocompute_knotvector_ = _auto;};
192 void fixNumberOfControlPoints(
bool _fix) {fix_number_control_points_ = _fix;};
228 Scalar
lower()
const;
231 Scalar
upper()
const;
235 void request_controlpoint_selections() { request_prop( ref_count_cpselections_, cpselections_);}
236 void request_edge_selections() { request_prop( ref_count_eselections_, eselections_);}
239 void release_controlpoint_selections() { release_prop( ref_count_cpselections_, cpselections_);}
240 void release_edge_selections() { release_prop( ref_count_eselections_, eselections_);}
243 bool controlpoint_selections_available()
const {
return bool(ref_count_cpselections_);}
244 bool edge_selections_available()
const {
return bool(ref_count_eselections_);}
248 unsigned char& controlpoint_selection(
unsigned int _i){
250 assert(controlpoint_selections_available());
251 return cpselections_[_i];
253 const unsigned char& controlpoint_selection(
unsigned int _i)
const {
255 assert(controlpoint_selections_available());
256 return cpselections_[_i];
259 unsigned char& edge_selection(
unsigned int _i) {
260 assert(edge_selections_available());
261 return eselections_[_i];
263 const unsigned char& edge_selection(
unsigned int _i)
const {
264 assert(edge_selections_available());
265 return eselections_[_i];
269 void select_controlpoint(
unsigned int _pIdx) { controlpoint_selection(_pIdx) = 1; };
270 void deselect_controlpoint(
unsigned int _pIdx) { controlpoint_selection(_pIdx) = 0; };
272 bool controlpoint_selected(
unsigned int _pIdx)
const {
return (controlpoint_selection(_pIdx) == 1); };
274 void select_edge(
unsigned int _pIdx) { edge_selection(_pIdx) = 1; };
275 void deselect_edge(
unsigned int _pIdx) { edge_selection(_pIdx) = 0; };
277 bool edge_selected(
unsigned int _pIdx)
const {
return (edge_selection(_pIdx) == 1); };
281 template <
class PropT>
282 void request_prop(
unsigned int& _ref_count, PropT& _prop);
284 template <
class PropT>
285 void release_prop(
unsigned int& _ref_count, PropT& _prop);
290 std::vector<Point> control_polygon_;
294 unsigned int degree_;
296 bool autocompute_knotvector_;
298 bool fix_number_control_points_;
305 std::vector<unsigned char> cpselections_;
308 std::vector<unsigned char> eselections_;
311 unsigned int ref_count_cpselections_;
312 unsigned int ref_count_eselections_;