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 typedef void (*draw_func_ptr)(SeqSpanRef, void *);
25 draw_x(0), draw_y(0), draw_z(0), draw_height(0), draw_color(new Color), draw_func(0) {}
26 Drawable(float x, float y, float z, float h, ColorRef c, draw_func_ptr draw=0) :
27 draw_x(x), draw_y(y), draw_z(z), draw_height(h), draw_color(c), draw_func(draw) {}
28 Drawable(const DrawableRef d) :
29 draw_x(d->draw_x), draw_y(d->draw_y), draw_z(d->draw_z),
30 draw_height(d->draw_height),
31 draw_color(new Color(d->draw_color)),
32 draw_func(d->draw_func)
35 //! set our starting x (horizontal) coordinate
36 void setX(float x) { draw_x = x; }
37 //! get our starting x (horizontal) coordinate
38 float x() const { return draw_x; }
39 //! set our current y (vertical) position
40 void setY(float y) { draw_y = y; }
41 //! get our current y (vertical) position
42 float y() const { return draw_y; }
43 //! set our current z (depth) position
44 void setZ(float z) { draw_z = z; }
45 //! get our current z (depth) position
46 float z() const { return draw_z; }
48 //! set how tall our rectangle should be
49 float setHeight(float h) { draw_height = h; }
50 //! how thick (high) the track we're drawing is
51 float height() const { return draw_height; }
53 //! set our default draw color
54 void setColor(ColorRef c) { draw_color = c; }
55 //! return our draw color
56 ColorRef color() { return draw_color; }
58 void setDrawFunction(draw_func_ptr d) { draw_func = d; }
59 draw_func_ptr drawFunction() const { return draw_func; }
67 draw_func_ptr draw_func;
70 #endif /*DRAWABLE_HPP_*/