#include "color.hpp"
+// Nooo!!!! I'm repeating myself.
+// Should all the'se ref typedefs go somewhere else?
+// *sigh* mutters about recursive #includes
+class SeqSpan;
+typedef boost::shared_ptr<SeqSpan> SeqSpanRef;
+
class Drawable;
typedef boost::shared_ptr<Drawable> DrawableRef;
*/
class Drawable {
public:
+ // render our SeqSpanRef in the region between left/right
+ typedef void (*draw_func_ptr)(SeqSpanRef, float left, float right);
+
Drawable() :
- draw_x(0), draw_y(0), draw_z(0), draw_height(0), draw_color(new Color) {}
- Drawable(float x, float y, float z, float h, ColorRef c) :
- draw_x(x), draw_y(y), draw_z(z), draw_height(h), draw_color(c) {}
+ draw_x(0), draw_y(0), draw_z(0), draw_height(0), draw_color(new Color), draw_func(0) {}
+ Drawable(float x, float y, float z, float h, ColorRef c, draw_func_ptr draw=0) :
+ draw_x(x), draw_y(y), draw_z(z), draw_height(h), draw_color(c), draw_func(draw) {}
Drawable(const DrawableRef d) :
draw_x(d->draw_x), draw_y(d->draw_y), draw_z(d->draw_z),
draw_height(d->draw_height),
- draw_color(new Color(d->draw_color))
+ draw_color(new Color(d->draw_color)),
+ draw_func(d->draw_func)
{}
//! set our starting x (horizontal) coordinate
float z() const { return draw_z; }
//! set how tall our rectangle should be
- float setHeight(float h) { draw_height = h; }
+ void setHeight(float h) { draw_height = h; }
//! how thick (high) the track we're drawing is
float height() const { return draw_height; }
void setColor(ColorRef c) { draw_color = c; }
//! return our draw color
ColorRef color() { return draw_color; }
+
+ void setDrawFunction(draw_func_ptr d) { draw_func = d; }
+ draw_func_ptr drawFunction() const { return draw_func; }
protected:
float draw_x;
float draw_z;
float draw_height;
ColorRef draw_color;
+ draw_func_ptr draw_func;
};
#endif /*DRAWABLE_HPP_*/