A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
color_writer_plugin.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_TREE_FORMATS_COLOR_WRITER_PLUGIN_H_
2 #define GENESIS_TREE_FORMATS_COLOR_WRITER_PLUGIN_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2017 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
36 
37 #include <vector>
38 
39 namespace genesis {
40 namespace tree {
41 
42 // =================================================================================================
43 // Color Writer Plugin Base
44 // =================================================================================================
45 
82 {
83  // -------------------------------------------------------------------------
84  // Base Class
85  // -------------------------------------------------------------------------
86 
87 public:
88 
89  virtual ~ColorWriterPlugin() {}
90 
91  // -------------------------------------------------------------------------
92  // Properties
93  // -------------------------------------------------------------------------
94 
95 public:
96 
107  void edge_colors( std::vector<utils::Color> const& color_vector )
108  {
109  edge_colors_ = color_vector;
110  }
111 
115  std::vector<utils::Color> const& edge_colors() const
116  {
117  return edge_colors_;
118  }
119 
123  void enable_color( bool value )
124  {
125  enable_color_ = value;
126  }
127 
131  bool enable_color() const
132  {
133  return enable_color_;
134  }
135 
147  {
148  ignored_color_ = value;
149  use_ignored_color_ = true;
150  }
151 
156  {
157  return ignored_color_;
158  }
159 
166  void use_ignored_color( bool value )
167  {
168  use_ignored_color_ = value;
169  }
170 
174  bool use_ignored_color() const
175  {
176  return use_ignored_color_;
177  }
178 
179  // -------------------------------------------------------------------------
180  // Data Members
181  // -------------------------------------------------------------------------
182 
183 private:
184 
185  std::vector<utils::Color> edge_colors_;
186  bool enable_color_ = true;
187  utils::Color ignored_color_ = utils::Color(0, 0, 0);
188  bool use_ignored_color_ = false;
189 
190 };
191 
192 } // namespace tree
193 } // namespace genesis
194 
195 #endif // include guard
void edge_colors(std::vector< utils::Color > const &color_vector)
Set the edge colors that shall be written to the output.
bool use_ignored_color() const
Return whether currently an ignored color is used.
bool enable_color() const
Returns whether colors tags are written to the output.
std::vector< utils::Color > const & edge_colors() const
Return the edge colors that are currently set.
void ignored_color(utils::Color value)
Set a color that is used as marker for partially disabling the output of color tags.
Header of Color class.
utils::Color ignored_color() const
Return the currently set ignored color. See the setter for more information.
Base class for creating plugin classes that allow coloring of Tree edges.
void use_ignored_color(bool value)
Set whether to use the ignored_color().
Color operators and functions.
void enable_color(bool value)
Set whether colors tags are written to the output.