4 #include <boost/shared_ptr.hpp>
9 typedef boost::shared_ptr<Drawable> DrawableRef;
12 * \brief Store the information needed to draw a sequence on some canvas
17 draw_x(0), draw_y(0), draw_z(0), draw_height(0), draw_color(new Color) {}
18 Drawable(float x, float y, float z, float h, ColorRef c) :
19 draw_x(x), draw_y(y), draw_z(z), draw_height(h), draw_color(c) {}
20 Drawable(const DrawableRef d) :
21 draw_x(d->draw_x), draw_y(d->draw_y), draw_z(d->draw_z),
22 draw_height(d->draw_height),
23 draw_color(new Color(d->draw_color))
26 //! set our starting x (horizontal) coordinate
27 void setX(float x) { draw_x = x; }
28 //! get our starting x (horizontal) coordinate
29 float x() const { return draw_x; }
30 //! set our current y (vertical) position
31 void setY(float y) { draw_y = y; }
32 //! get our current y (vertical) position
33 float y() const { return draw_y; }
34 //! set our current z (depth) position
35 void setZ(float z) { draw_z = z; }
36 //! get our current z (depth) position
37 float z() const { return draw_z; }
39 //! set how tall our rectangle should be
40 float setHeight(float h) { draw_height = h; }
41 //! how thick (high) the track we're drawing is
42 float height() const { return draw_height; }
44 //! set our default draw color
45 void setColor(ColorRef c) { draw_color = c; }
46 //! return our draw color
47 ColorRef color() { return draw_color; }
56 #endif /*DRAWABLE_HPP_*/