remove annot class in favor of SeqSpan
[mussa.git] / alg / annotation_colors.hpp
1 #ifndef ANNOTATION_COLOR_H
2 #define ANNOTATION_COLOR_H
3
4 #include <map>
5 #include <string>
6
7 #include <boost/shared_ptr.hpp>
8
9 #include "color.hpp"
10 #include "sequence.hpp"
11
12 struct DefaultColorMap;
13 struct DefaultColorMap
14 {
15   typedef std::map<std::string, DefaultColorMap> color_map_type;
16   typedef color_map_type::iterator iterator;
17   typedef color_map_type::const_iterator const_iterator;
18   DefaultColorMap();
19   //! initialize color map with a default color
20   DefaultColorMap(const Color &);
21   DefaultColorMap(const color_map_type&);
22   DefaultColorMap(const DefaultColorMap&);
23
24   Color defaultColor;
25   //! color map
26   color_map_type cm;
27 };
28
29 class AnnotationColors;
30 typedef boost::shared_ptr<AnnotationColors> AnnotationColorsRef;
31
32 class AnnotationColors
33 {
34 public:
35   AnnotationColors();
36   AnnotationColors(const AnnotationColors &);
37
38   // clear all the contents of our mappers
39   void clear();
40   //! set default color
41   void setColor(Color &);
42   //! retreive default color
43   Color color();
44
45   //! add default color for a particular type
46   void appendTypeColor(const std::string &, const Color &);
47   //! get default color for a type
48   Color typeColor(const std::string &);
49   //! remove a type (and all of its instances)
50   void erase(const std::string &);
51
52   //! add default color for a particular type
53   void appendInstanceColor(const std::string &type, 
54                            const std::string &instance, 
55                            const Color &);
56   //! get color for a particular type
57   Color instanceColor(const std::string &type, 
58                       const std::string &instance);
59   //! remove an instance of particular type
60   void erase(const std::string &type, const std::string& instance);
61
62   //! lookup an annotation color
63   Color lookup(const std::string &, const std::string &) const;
64 private:
65   // nested maps, with default?
66   DefaultColorMap root_map;
67 };
68 #endif