Commit c36cb703 authored by Mike Kremer's avatar Mike Kremer
Browse files

Implemented selection wrapper functions for B-spline curves and knot vectors....

Implemented selection wrapper functions for B-spline curves and knot vectors. Added some debug stuff that prevents accessing non-existant values when selecting control points or knots that would cause crashes.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11144 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 923b72a2
......@@ -240,11 +240,36 @@ public :
// property access ( no range or availability check! )
unsigned char& controlpoint_selection(unsigned int _i) {return cpselections_[_i];}
const unsigned char& controlpoint_selection(unsigned int _i) const {return cpselections_[_i];}
unsigned char& edge_selection(unsigned int _i) {return eselections_[_i];}
const unsigned char& edge_selection(unsigned int _i) const {return eselections_[_i];}
unsigned char& controlpoint_selection(unsigned int _i){
assert(_i < n_control_points());
assert(controlpoint_selections_available());
return cpselections_[_i];
}
const unsigned char& controlpoint_selection(unsigned int _i) const {
assert(_i < n_control_points());
assert(controlpoint_selections_available());
return cpselections_[_i];
}
unsigned char& edge_selection(unsigned int _i) {
assert(edge_selections_available());
return eselections_[_i];
}
const unsigned char& edge_selection(unsigned int _i) const {
assert(edge_selections_available());
return eselections_[_i];
}
// Wrapper for selection functions
void select_controlpoint(unsigned int _pIdx) { controlpoint_selection(_pIdx) = 1; };
void deselect_controlpoint(unsigned int _pIdx) { controlpoint_selection(_pIdx) = 0; };
bool controlpoint_selected(unsigned int _pIdx) const { return (controlpoint_selection(_pIdx) == 1); };
void select_edge(unsigned int _pIdx) { edge_selection(_pIdx) = 1; };
void deselect_edge(unsigned int _pIdx) { edge_selection(_pIdx) = 0; };
bool edge_selected(unsigned int _pIdx) const { return (edge_selection(_pIdx) == 1); };
private:
......
......@@ -155,8 +155,22 @@ public : // selection handling
bool selections_available() const {return bool(ref_count_selections_);}
// property access ( no range or availability check! )
unsigned char& selection(unsigned int _i) {return selections_[_i];}
const unsigned char& selection(unsigned int _i) const {return selections_[_i];}
unsigned char& selection(unsigned int _i) {
assert(_i < selections_.size());
assert(selections_available());
return selections_[_i];
}
const unsigned char& selection(unsigned int _i) const {
assert(_i < selections_.size());
assert(selections_available());
return selections_[_i];
}
// Wrapper for selection functions
void select(unsigned int _pIdx) { selection(_pIdx) = 1; };
void deselect(unsigned int _pIdx) { selection(_pIdx) = 0; };
bool selected(unsigned int _pIdx) const { return (selection(_pIdx) == 1); };
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment