52 #ifndef BSPLINECURVET_HH
53 #define BSPLINECURVET_HH
60 #include <ACG/Math/VectorT.hh>
62 #include <ObjectTypes/Knotvector/KnotvectorT.hh>
80 template <
class Po
intT>
87 typedef typename Point::value_type Scalar;
99 std::vector< Scalar >&
get_knots() {
return knotvector_.getKnotvector();};
102 void set_knots(std::vector< Scalar > _knots);
166 unsigned int n_knots() {
return knotvector_.size(); };
186 void autocompute_knotvector(
bool _auto) {autocompute_knotvector_ = _auto;};
188 void fixNumberOfControlPoints(
bool _fix) {fix_number_control_points_ = _fix;};
233 void request_controlpoint_selections() { request_prop( ref_count_cpselections_, cpselections_);}
234 void request_edge_selections() { request_prop( ref_count_eselections_, eselections_);}
237 void release_controlpoint_selections() { release_prop( ref_count_cpselections_, cpselections_);}
238 void release_edge_selections() { release_prop( ref_count_eselections_, eselections_);}
241 bool controlpoint_selections_available()
const {
return bool(ref_count_cpselections_);}
242 bool edge_selections_available()
const {
return bool(ref_count_eselections_);}
246 unsigned char& controlpoint_selection(
unsigned int _i){
248 assert(controlpoint_selections_available());
249 return cpselections_[_i];
251 const unsigned char& controlpoint_selection(
unsigned int _i)
const {
253 assert(controlpoint_selections_available());
254 return cpselections_[_i];
257 unsigned char& edge_selection(
unsigned int _i) {
258 assert(edge_selections_available());
259 return eselections_[_i];
261 const unsigned char& edge_selection(
unsigned int _i)
const {
262 assert(edge_selections_available());
263 return eselections_[_i];
267 void select_controlpoint(
unsigned int _pIdx) { controlpoint_selection(_pIdx) = 1; };
268 void deselect_controlpoint(
unsigned int _pIdx) { controlpoint_selection(_pIdx) = 0; };
270 bool controlpoint_selected(
unsigned int _pIdx)
const {
return (controlpoint_selection(_pIdx) == 1); };
272 void select_edge(
unsigned int _pIdx) { edge_selection(_pIdx) = 1; };
273 void deselect_edge(
unsigned int _pIdx) { edge_selection(_pIdx) = 0; };
275 bool edge_selected(
unsigned int _pIdx)
const {
return (edge_selection(_pIdx) == 1); };
279 template <
class PropT>
280 void request_prop(
unsigned int& _ref_count, PropT& _prop);
282 template <
class PropT>
283 void release_prop(
unsigned int& _ref_count, PropT& _prop);
288 std::vector<Point> control_polygon_;
292 unsigned int degree_;
294 bool autocompute_knotvector_;
296 bool fix_number_control_points_;
303 std::vector<unsigned char> cpselections_;
306 std::vector<unsigned char> eselections_;
309 unsigned int ref_count_cpselections_;
310 unsigned int ref_count_eselections_;
318 #if defined(INCLUDE_TEMPLATES) && !defined(BSPLINECURVE_BSPLINECURVET_C)
319 #define BSPLINECURVE_BSPLINECURVET_TEMPLATES
320 #include "BSplineCurveT.cc"
323 #endif // ACG_BSPLINECURVET_HH defined