A library for working with phylogenetic and population genetic data.
v0.27.0
NewickColorWriterPlugin Class Reference

#include <genesis/tree/formats/newick/color_writer_plugin.hpp>

Inherits ColorWriterPlugin.

Detailed Description

Plugin class for Newick output that allows coloring of edges.

The effect of this class on the Newick output is that (if enabled) a color tag comment will be added to each Newick element like this: [&!color=#c0ffee].

For more information, see ColorWriterPlugin class.

Definition at line 58 of file newick/color_writer_plugin.hpp.

Public Member Functions

 NewickColorWriterPlugin ()=default
 
 NewickColorWriterPlugin (NewickColorWriterPlugin &&)=default
 
 NewickColorWriterPlugin (NewickColorWriterPlugin const &)=default
 
virtual ~NewickColorWriterPlugin ()=default
 
std::string color_tag_prefix () const
 Get the currently set prefix string. See the setter for more information. More...
 
void color_tag_prefix (std::string const &prefix)
 Set the prefix string that is used within the Newick comment before the actual color value. More...
 
std::string color_tag_suffix () const
 Get the currently set suffix string. See the setter for more information. More...
 
void color_tag_suffix (std::string const &suffix)
 Set the suffix string that is used within the Newick comment after the actual color value. More...
 
void edge_to_element (TreeEdge const &edge, NewickBrokerElement &element) const
 
NewickColorWriterPluginoperator= (NewickColorWriterPlugin &&)=default
 
NewickColorWriterPluginoperator= (NewickColorWriterPlugin const &)=default
 
void prepare_writing (Tree const &tree, NewickBroker &broker) const
 
void register_with (NewickWriter &writer) const
 
- Public Member Functions inherited from ColorWriterPlugin
virtual ~ColorWriterPlugin ()=default
 
std::vector< utils::Color > const & edge_colors () const
 Return the edge colors that are currently set. More...
 
void edge_colors (std::vector< utils::Color > const &color_vector)
 Set the edge colors that shall be written to the output. More...
 
bool enable_color () const
 Returns whether colors tags are written to the output. More...
 
void enable_color (bool value)
 Set whether colors tags are written to the output. More...
 
utils::Color ignored_color () const
 Return the currently set ignored color. See the setter for more information. More...
 
void ignored_color (utils::Color value)
 Set a color that is used as marker for partially disabling the output of color tags. More...
 
bool use_ignored_color () const
 Return whether currently an ignored color is used. More...
 
void use_ignored_color (bool value)
 Set whether to use the ignored_color(). More...
 

Constructor & Destructor Documentation

◆ NewickColorWriterPlugin() [1/3]

◆ ~NewickColorWriterPlugin()

virtual ~NewickColorWriterPlugin ( )
virtualdefault

◆ NewickColorWriterPlugin() [2/3]

◆ NewickColorWriterPlugin() [3/3]

Member Function Documentation

◆ color_tag_prefix() [1/2]

std::string color_tag_prefix ( ) const
inline

Get the currently set prefix string. See the setter for more information.

Definition at line 94 of file newick/color_writer_plugin.hpp.

◆ color_tag_prefix() [2/2]

void color_tag_prefix ( std::string const &  prefix)
inline

Set the prefix string that is used within the Newick comment before the actual color value.

By default, this string is set to &!color=, which is for example used by FigTree to mark color in trees. This will result in a Newick comment like [&!color=#c0ffee].

Definition at line 86 of file newick/color_writer_plugin.hpp.

◆ color_tag_suffix() [1/2]

std::string color_tag_suffix ( ) const
inline

Get the currently set suffix string. See the setter for more information.

Definition at line 113 of file newick/color_writer_plugin.hpp.

◆ color_tag_suffix() [2/2]

void color_tag_suffix ( std::string const &  suffix)
inline

Set the suffix string that is used within the Newick comment after the actual color value.

By default, this string is empty. See the setter color_tag_prefix() for more information.

Definition at line 105 of file newick/color_writer_plugin.hpp.

◆ edge_to_element()

void edge_to_element ( TreeEdge const &  edge,
NewickBrokerElement element 
) const
inline

Definition at line 141 of file newick/color_writer_plugin.hpp.

◆ operator=() [1/2]

NewickColorWriterPlugin& operator= ( NewickColorWriterPlugin &&  )
default

◆ operator=() [2/2]

NewickColorWriterPlugin& operator= ( NewickColorWriterPlugin const &  )
default

◆ prepare_writing()

void prepare_writing ( Tree const &  tree,
NewickBroker broker 
) const
inline

Definition at line 122 of file newick/color_writer_plugin.hpp.

◆ register_with()

void register_with ( NewickWriter writer) const
inline

Definition at line 154 of file newick/color_writer_plugin.hpp.


The documentation for this class was generated from the following file: