A toolkit for working with phylogenetic data.
v0.24.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 (Tree const &orig_tree, LayoutType const drawing_type=LayoutType::kCladogram, bool ladderize=true)
 
 LayoutBase (LayoutBase const &)=default
 
 LayoutBase (LayoutBase &&)=default
 
virtual ~LayoutBase ()=default
 
void align_labels (bool value)
 Align the taxon labels/node names/texts to each other. More...
 
bool align_labels () 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...
 
double extra_spacer () const
 
void inner_node_spreading (LayoutSpreading value)
 
LayoutSpreading inner_node_spreading () const
 
LayoutBaseoperator= (LayoutBase const &)=default
 
LayoutBaseoperator= (LayoutBase &&)=default
 
void set_edge_distance_strokes (utils::SvgStroke const &stroke)
 
void set_edge_distance_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_edge_shapes (utils::SvgGroup const &shape)
 
void set_edge_shapes (std::vector< utils::SvgGroup > const &shapes)
 
void set_edge_spreading_strokes (utils::SvgStroke const &stroke)
 
void set_edge_spreading_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_edge_strokes (utils::SvgStroke const &stroke)
 
void set_edge_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_label_spacer_strokes (utils::SvgStroke const &stroke, LayoutSpreading spreading=LayoutSpreading::kLeafNodesOnly)
 
void set_label_spacer_strokes (std::vector< utils::SvgStroke > const &strokes)
 
void set_node_shapes (utils::SvgGroup const &shape)
 
void set_node_shapes (std::vector< utils::SvgGroup > const &shapes)
 
void text_template (utils::SvgText const &tt)
 
utils::SvgTexttext_template ()
 
utils::SvgText const & text_template () const
 
utils::SvgDocument to_svg_document () const
 
void tree (Tree const &orig_tree, bool ladderize=true)
 
Tree const & tree () const
 
void type (LayoutType const drawing_type)
 
LayoutType type () const
 

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]

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.

◆ align_labels() [2/2]

bool align_labels ( ) const

Definition at line 523 of file layout_base.cpp.

◆ extra_spacer() [1/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.

◆ extra_spacer() [2/2]

double extra_spacer ( ) const

Definition at line 533 of file layout_base.cpp.

◆ inner_node_spreading() [1/2]

void inner_node_spreading ( LayoutSpreading  value)

Definition at line 505 of file layout_base.cpp.

◆ inner_node_spreading() [2/2]

LayoutSpreading inner_node_spreading ( ) const

Definition at line 513 of file layout_base.cpp.

◆ operator=() [1/2]

LayoutBase& operator= ( LayoutBase const &  )
default

◆ operator=() [2/2]

LayoutBase& operator= ( LayoutBase &&  )
default

◆ set_edge_distance_strokes() [1/2]

void set_edge_distance_strokes ( utils::SvgStroke const &  stroke)

Definition at line 115 of file layout_base.cpp.

◆ set_edge_distance_strokes() [2/2]

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

Definition at line 122 of file layout_base.cpp.

◆ set_edge_shapes() [1/2]

void set_edge_shapes ( utils::SvgGroup const &  shape)

Definition at line 203 of file layout_base.cpp.

◆ set_edge_shapes() [2/2]

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

Definition at line 210 of file layout_base.cpp.

◆ set_edge_spreading_strokes() [1/2]

void set_edge_spreading_strokes ( utils::SvgStroke const &  stroke)

Definition at line 91 of file layout_base.cpp.

◆ set_edge_spreading_strokes() [2/2]

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

Definition at line 98 of file layout_base.cpp.

◆ set_edge_strokes() [1/2]

void set_edge_strokes ( utils::SvgStroke const &  stroke)

Definition at line 79 of file layout_base.cpp.

◆ set_edge_strokes() [2/2]

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

Definition at line 85 of file layout_base.cpp.

◆ set_label_spacer_strokes() [1/2]

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

Definition at line 139 of file layout_base.cpp.

◆ set_label_spacer_strokes() [2/2]

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

Definition at line 154 of file layout_base.cpp.

◆ set_node_shapes() [1/2]

void set_node_shapes ( utils::SvgGroup const &  shape)

Definition at line 227 of file layout_base.cpp.

◆ set_node_shapes() [2/2]

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

Definition at line 234 of file layout_base.cpp.

◆ text_template() [1/3]

void text_template ( utils::SvgText const &  tt)

Definition at line 538 of file layout_base.cpp.

◆ text_template() [2/3]

utils::SvgText & text_template ( )

Definition at line 543 of file layout_base.cpp.

◆ text_template() [3/3]

utils::SvgText const & text_template ( ) const

Definition at line 548 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]

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

Definition at line 53 of file layout_base.cpp.

◆ tree() [2/3]

Tree const & tree ( ) const

Definition at line 70 of file layout_base.cpp.

◆ tree() [3/3]

Tree & tree ( )
protected

Definition at line 65 of file layout_base.cpp.

◆ type() [1/2]

void type ( LayoutType const  drawing_type)

Definition at line 492 of file layout_base.cpp.

◆ type() [2/2]

LayoutType type ( ) const

Definition at line 500 of file layout_base.cpp.


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