X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=blobdiff_plain;f=alg%2Fglsequence.hpp;h=cbb933c6d3836717e4340e97aac5451bb55b8f12;hp=62014b4fc7175c5a1abbcb5699912617184faf74;hb=f3e6762bedaf3775619a36f4103c8cf35d2ca887;hpb=a5fdb434dd0e6d18fe98e9ee57cb5169ce4c5842 diff --git a/alg/glsequence.hpp b/alg/glsequence.hpp index 62014b4..cbb933c 100644 --- a/alg/glsequence.hpp +++ b/alg/glsequence.hpp @@ -13,6 +13,9 @@ #include #endif +class GlSequence; +typedef boost::shared_ptr GlSequenceRef; + //! Manage rendering a mussa sequence track /*! The idea is this will keep track of the location of where the sequence * is being rendered, and handle displaying annotations on that track @@ -24,25 +27,41 @@ public: boost::shared_ptr cm); GlSequence(const GlSequence & s); GlSequence(const GlSequence *); + //! Make a new GlSequence, using a copy of SeqSpan + GlSequence(const GlSequenceRef); + GlSequence &operator=(const GlSequence &s); + static DrawableRef default_drawable(); + static DrawableRef copy_drawable(DrawableRef s); + + //! set our starting x (horizontal) coordinate + void setX(float x); + //! get our starting x (horizontal) coordinate + float x() const; + //! set our current y (vertical) position + void setY(float y); + //! get our current y (vertical) position + float y() const; + //! get our current z (depth) position + float z() const; + //! how thick (high) the track we're drawing is + float height() const; + + //! set our default draw color + void setColor(ColorRef &c ); + //! return our draw color + const ColorRef color() const; + //! return our draw color + ColorRef color(); + //! draw a track /*! left and right are the edges of the current viewport */ void draw(GLfloat left, GLfloat right) const; - //! set our starting x (horizontal) coordinate - void setX(GLfloat); - //! get our starting x (horizontal) coordinate - GLfloat x() const; //! get our right (horizontal) coordinate (size-x) - GLfloat right() const; - //! set our current y (vertical) position - void setY(GLfloat); - //! get our current y (vertical) position - GLfloat y() const; - //! how thick (high) the track we're drawing is - GLfloat height() const; + float right() const; //! how long is our sequence track? (computed from the sequence) GLfloat size() const; @@ -60,10 +79,6 @@ public: //! return a subsequence as a GlSequence (instead of a Sequence subsequence) GlSequence subseq(size_type start, size_type count) const; - //! set track color - void setColor(boost::shared_ptr &); - boost::shared_ptr color(); - //! how big is a pixel in world coordinats GLfloat pixelWidth(GLfloat, GLfloat) const; //! how big is a pixel in world coordinats (specifying viewport size) @@ -85,12 +100,7 @@ public: friend bool operator==(const GlSequence &left, const GlSequence &right); protected: - GLfloat seq_x; - GLfloat seq_y; - GLfloat seq_z; - GLfloat seq_height; boost::shared_ptr color_mapper; - boost::shared_ptr drawColor; const GLfloat char_pix_per_world_unit; //! Return the pixel width of the opengl viewport.