A library for working with phylogenetic and population genetic data.
v0.27.0
LayoutBase Class Referenceabstract

#include <genesis/tree/drawing/layout_base.hpp>

Inherited by CircularLayout, and RectangularLayout.

Detailed Description

Definition at line 91 of file layout_base.hpp.

Public Member Functions

 LayoutBase ()=default
 
 LayoutBase (LayoutBase &&)=default
 
 LayoutBase (LayoutBase const &)=default
 
 LayoutBase (Tree const &orig_tree, LayoutType const drawing_type=LayoutType::kCladogram, bool ladderize=true)
 
virtual ~LayoutBase ()=default
 
bool align_labels () const
 
void align_labels (bool value)
 Align the taxon labels/node names/texts to each other. More...
 
double extra_spacer () const
 
void extra_spacer (double value)
 Set some extra space betwen the tree nodes and their labels when align_labels() is set to true. More...
 
LayoutSpreading inner_node_spreading () const
 
void inner_node_spreading (LayoutSpreading value)
 
LayoutBaseoperator= (LayoutBase &&)=default
 
LayoutBaseoperator= (LayoutBase const &)=default
 
void set_edge_distance_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_edge_distance_strokes (utils::SvgStroke const &stroke)
 
void set_edge_shapes (std::vector< utils::SvgGroup > const &shapes)
 
void set_edge_shapes (utils::SvgGroup const &shape)
 
void set_edge_spreading_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_edge_spreading_strokes (utils::SvgStroke const &stroke)
 
void set_edge_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_edge_strokes (utils::SvgStroke const &stroke)
 
void set_label_spacer_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_label_spacer_strokes (utils::SvgStroke const &stroke, LayoutSpreading spreading=LayoutSpreading::kLeafNodesOnly)
 
void set_node_shapes (std::vector< utils::SvgGroup > const &shapes)
 
void set_node_shapes (utils::SvgGroup const &shape)
 
utils::SvgTexttext_template ()
 
utils::SvgText const & text_template () const
 
void text_template (utils::SvgText const &tt)
 
utils::SvgDocument to_svg_document () const
 
Tree const & tree () const
 
void tree (Tree const &orig_tree, bool ladderize=true)
 
LayoutType type () const
 
void type (LayoutType const drawing_type)
 

Protected Member Functions

virtual utils::SvgDocument to_svg_document_ () const =0
 
Treetree ()
 

Constructor & Destructor Documentation

◆ LayoutBase() [1/4]

LayoutBase ( )
default

◆ LayoutBase() [2/4]

LayoutBase ( Tree const &  orig_tree,
LayoutType const  drawing_type = LayoutType::kCladogram,
bool  ladderize = true 
)
inline

Definition at line 101 of file layout_base.hpp.

◆ ~LayoutBase()

virtual ~LayoutBase ( )
virtualdefault

◆ LayoutBase() [3/4]

LayoutBase ( LayoutBase const &  )
default

◆ LayoutBase() [4/4]

LayoutBase ( LayoutBase &&  )
default

Member Function Documentation

◆ align_labels() [1/2]

bool align_labels ( ) const

Definition at line 523 of file layout_base.cpp.

◆ align_labels() [2/2]

void align_labels ( bool  value)

Align the taxon labels/node names/texts to each other.

If set to true, the taxon names are aligned with each other. This is particularly interesting in phylograms, where they otherwise are placed close to their nodes. In cladograms, the tip nodes are aligned to each other anyway, so there is not much of a difference there.

In order to still be able to see which label belongs to which node, a label spacer line is drawn for each node, using LayoutNodeData::spacer_stroke. These strokes can be set with set_label_spacer_strokes().

Note also the extra_spacer() setting, which modifies how much longer the spacer line is than the exact alignment. This setting is useful to create some extra space between the tree and the aligned labels.

Definition at line 518 of file layout_base.cpp.

◆ extra_spacer() [1/2]

double extra_spacer ( ) const

Definition at line 533 of file layout_base.cpp.

◆ extra_spacer() [2/2]

void extra_spacer ( double  value)

Set some extra space betwen the tree nodes and their labels when align_labels() is set to true.

Definition at line 528 of file layout_base.cpp.

◆ inner_node_spreading() [1/2]

LayoutSpreading inner_node_spreading ( ) const

Definition at line 513 of file layout_base.cpp.

◆ inner_node_spreading() [2/2]

void inner_node_spreading ( LayoutSpreading  value)

Definition at line 505 of file layout_base.cpp.

◆ operator=() [1/2]

LayoutBase& operator= ( LayoutBase &&  )
default

◆ operator=() [2/2]

LayoutBase& operator= ( LayoutBase const &  )
default

◆ set_edge_distance_strokes() [1/2]

void set_edge_distance_strokes ( std::vector< utils::SvgStroke > const &  strokes)

Definition at line 122 of file layout_base.cpp.

◆ set_edge_distance_strokes() [2/2]

void set_edge_distance_strokes ( utils::SvgStroke const &  stroke)

Definition at line 115 of file layout_base.cpp.

◆ set_edge_shapes() [1/2]

void set_edge_shapes ( std::vector< utils::SvgGroup > const &  shapes)

Definition at line 210 of file layout_base.cpp.

◆ set_edge_shapes() [2/2]

void set_edge_shapes ( utils::SvgGroup const &  shape)

Definition at line 203 of file layout_base.cpp.

◆ set_edge_spreading_strokes() [1/2]

void set_edge_spreading_strokes ( std::vector< utils::SvgStroke > const &  strokes)

Definition at line 98 of file layout_base.cpp.

◆ set_edge_spreading_strokes() [2/2]

void set_edge_spreading_strokes ( utils::SvgStroke const &  stroke)

Definition at line 91 of file layout_base.cpp.

◆ set_edge_strokes() [1/2]

void set_edge_strokes ( std::vector< utils::SvgStroke > const &  strokes)

Definition at line 85 of file layout_base.cpp.

◆ set_edge_strokes() [2/2]

void set_edge_strokes ( utils::SvgStroke const &  stroke)

Definition at line 79 of file layout_base.cpp.

◆ set_label_spacer_strokes() [1/2]

void set_label_spacer_strokes ( std::vector< utils::SvgStroke > const &  strokes)

Definition at line 154 of file layout_base.cpp.

◆ set_label_spacer_strokes() [2/2]

void set_label_spacer_strokes ( utils::SvgStroke const &  stroke,
LayoutSpreading  spreading = LayoutSpreading::kLeafNodesOnly 
)

Definition at line 139 of file layout_base.cpp.

◆ set_node_shapes() [1/2]

void set_node_shapes ( std::vector< utils::SvgGroup > const &  shapes)

Definition at line 234 of file layout_base.cpp.

◆ set_node_shapes() [2/2]

void set_node_shapes ( utils::SvgGroup const &  shape)

Definition at line 227 of file layout_base.cpp.

◆ text_template() [1/3]

utils::SvgText const & text_template ( )

Definition at line 543 of file layout_base.cpp.

◆ text_template() [2/3]

utils::SvgText const& text_template ( ) const

◆ text_template() [3/3]

void text_template ( utils::SvgText const &  tt)

Definition at line 538 of file layout_base.cpp.

◆ to_svg_document()

utils::SvgDocument to_svg_document ( ) const
inline

Definition at line 158 of file layout_base.hpp.

◆ to_svg_document_()

virtual utils::SvgDocument to_svg_document_ ( ) const
protectedpure virtual

◆ tree() [1/3]

Tree& tree ( )
protected

◆ tree() [2/3]

Tree const & tree ( ) const

Definition at line 65 of file layout_base.cpp.

◆ tree() [3/3]

void tree ( Tree const &  orig_tree,
bool  ladderize = true 
)

Definition at line 53 of file layout_base.cpp.

◆ type() [1/2]

LayoutType type ( ) const

Definition at line 500 of file layout_base.cpp.

◆ type() [2/2]

void type ( LayoutType const  drawing_type)

Definition at line 492 of file layout_base.cpp.


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