4 #include <boost/shared_ptr.hpp>
8 // Nooo!!!! I'm repeating myself.
9 // Should all the'se ref typedefs go somewhere else?
10 // *sigh* mutters about recursive #includes
12 typedef boost::shared_ptr<SeqSpan> SeqSpanRef;
15 typedef boost::shared_ptr<Drawable> DrawableRef;
18 * \brief Store the information needed to draw a sequence on some canvas
22 // render our SeqSpanRef in the region between left/right
23 typedef void (*draw_func_ptr)(SeqSpanRef, float left, float right);
26 draw_x(0), draw_y(0), draw_z(0), draw_height(0), draw_color(new Color), draw_func(0) {}
27 Drawable(float x, float y, float z, float h, ColorRef c, draw_func_ptr draw=0) :
28 draw_x(x), draw_y(y), draw_z(z), draw_height(h), draw_color(c), draw_func(draw) {}
29 Drawable(const DrawableRef d) :
30 draw_x(d->draw_x), draw_y(d->draw_y), draw_z(d->draw_z),
31 draw_height(d->draw_height),
32 draw_color(new Color(d->draw_color)),
33 draw_func(d->draw_func)
36 //! set our starting x (horizontal) coordinate
37 void setX(float x) { draw_x = x; }
38 //! get our starting x (horizontal) coordinate
39 float x() const { return draw_x; }
40 //! set our current y (vertical) position
41 void setY(float y) { draw_y = y; }
42 //! get our current y (vertical) position
43 float y() const { return draw_y; }
44 //! set our current z (depth) position
45 void setZ(float z) { draw_z = z; }
46 //! get our current z (depth) position
47 float z() const { return draw_z; }
49 //! set how tall our rectangle should be
50 void setHeight(float h) { draw_height = h; }
51 //! how thick (high) the track we're drawing is
52 float height() const { return draw_height; }
54 //! set our default draw color
55 void setColor(ColorRef c) { draw_color = c; }
56 //! return our draw color
57 ColorRef color() { return draw_color; }
59 void setDrawFunction(draw_func_ptr d) { draw_func = d; }
60 draw_func_ptr drawFunction() const { return draw_func; }
68 draw_func_ptr draw_func;
70 #endif /*DRAWABLE_HPP_*/