incorporate drawable and annotations
[mussa.git] / alg / glsequence.hpp
index 62014b4fc7175c5a1abbcb5699912617184faf74..cbb933c6d3836717e4340e97aac5451bb55b8f12 100644 (file)
@@ -13,6 +13,9 @@
 #include <GL/gl.h>
 #endif
 
+class GlSequence;
+typedef boost::shared_ptr<GlSequence> 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<AnnotationColors> 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<Color> &);
-  boost::shared_ptr<Color> 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<AnnotationColors> color_mapper;
-  boost::shared_ptr<Color> drawColor;
   const GLfloat char_pix_per_world_unit;
 
   //! Return the pixel width of the opengl viewport.