Store Sequence sequence location in a shared_ptr class
[mussa.git] / alg / glsequence.hpp
index ab96239374e08f3b9a4263f0e0c622112d152a56..01b7e056da8ce8c53286f089cf5fce1c4746374d 100644 (file)
 /*! The idea is this will keep track of the location of where the sequence
  *  is being rendered, and handle displaying annotations on that track
  */
-class GlSequence
+class GlSequence : public Sequence
 {
 public: 
-  GlSequence(boost::shared_ptr<Sequence> s, 
+  GlSequence(const Sequence & s,
              boost::shared_ptr<AnnotationColors> cm);
   GlSequence(const GlSequence & s);
+  GlSequence(const GlSequence *);
   GlSequence &operator=(const GlSequence &s);
 
   //! draw a track 
@@ -30,7 +31,6 @@ public:
    */
   void draw(GLfloat left, GLfloat right) const;
 
-  boost::shared_ptr<Sequence> sequence();
   //! set our starting x (horizontal) coordinate
   void setX(GLfloat);
   //! get our starting x (horizontal) coordinate
@@ -52,23 +52,22 @@ public:
   //! done mostly so all the iterator logic continues to work correctly.
   Sequence::size_type rightbase(GLfloat right) const;
 
-  //! return iterator to the start of the stored sequence
-  Sequence::const_iterator sequence_begin() const;
-  //! return iterator to the end of the stored sequence
-  Sequence::const_iterator sequence_end() const;
   //! provide an iterator to the sequence starting at world coordinate left
-  Sequence::const_iterator sequence_begin(GLfloat left, GLfloat right) const;
+  Sequence::const_iterator region_begin(GLfloat left, GLfloat right) const;
   //! provide an iterator to the sequence ending at world coordinate right
-  Sequence::const_iterator sequence_end(GLfloat left, GLfloat right) const;
+  Sequence::const_iterator region_end(GLfloat left, GLfloat right) const;
 
+  //! 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(Color &);
-  Color color();
+  void setColor(boost::shared_ptr<Color> &);
+  boost::shared_ptr<Color> color();
 
   //! how big is a pixel in world coordinats
   GLfloat get_pixel_width(GLfloat, GLfloat) const;
   //! how big is a pixel in world coordinats (specifying viewport size)
-  GLfloat get_pixel_width(GLfloat, GLfloat, int) const;
+  GLfloat pixelWidth(GLfloat, GLfloat, int) const;
 
   //! are we close enough that it would make sense to view the base pairs?
   bool is_sequence_renderable(GLfloat left, GLfloat right) const;
@@ -86,13 +85,12 @@ public:
   friend bool operator==(const GlSequence &left, const GlSequence &right);
 
 protected:
-  boost::shared_ptr<Sequence> seq;
   GLfloat seq_x;
   GLfloat seq_y;
   GLfloat seq_z;
   GLfloat seq_height;
   boost::shared_ptr<AnnotationColors> color_mapper;
-  Color drawColor;
+  boost::shared_ptr<Color> drawColor;
   const GLfloat char_pix_per_world_unit;
 
   //! Return the pixel width of the opengl viewport.