WhatsThis update
[mussa.git] / alg / glsequence.hpp
index c20e1945b11414d0090e829c60d0abc2b87624ec..ab96239374e08f3b9a4263f0e0c622112d152a56 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _GL_SEQUENCE_H_
 #define _GL_SEQUENCE_H_
 
+#include <boost/shared_ptr.hpp>
+
 #include "alg/annotation_colors.hpp"
 #include "alg/sequence.hpp"
 #include "alg/color.hpp"
@@ -18,7 +20,8 @@
 class GlSequence
 {
 public: 
-  GlSequence(const Sequence & s, AnnotationColors &cm);
+  GlSequence(boost::shared_ptr<Sequence> s, 
+             boost::shared_ptr<AnnotationColors> cm);
   GlSequence(const GlSequence & s);
   GlSequence &operator=(const GlSequence &s);
 
@@ -27,12 +30,12 @@ public:
    */
   void draw(GLfloat left, GLfloat right) const;
 
-  const Sequence& sequence() const;
+  boost::shared_ptr<Sequence> sequence();
   //! set our starting x (horizontal) coordinate
   void setX(GLfloat);
   //! get our starting x (horizontal) coordinate
   GLfloat x() const;
-  //! get our right (horizontal) coordinate (length-x)
+  //! get our right (horizontal) coordinate (size-x)
   GLfloat right() const;
   //! set our current y (vertical) position
   void setY(GLfloat);
@@ -41,7 +44,7 @@ public:
   //! how thick (high) the track we're drawing is
   GLfloat height() const;
   //! how long is our sequence track? (computed from the sequence)
-  GLfloat length() const;
+  GLfloat size() const;
  
   //! return the left (lowest) base index that is fully visible
   Sequence::size_type leftbase(GLfloat left) const;
@@ -83,12 +86,12 @@ public:
   friend bool operator==(const GlSequence &left, const GlSequence &right);
 
 protected:
-  const Sequence& seq;
+  boost::shared_ptr<Sequence> seq;
   GLfloat seq_x;
   GLfloat seq_y;
   GLfloat seq_z;
   GLfloat seq_height;
-  AnnotationColors& color_mapper;
+  boost::shared_ptr<AnnotationColors> color_mapper;
   Color drawColor;
   const GLfloat char_pix_per_world_unit;