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

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

Inherits CommonNodeData.

Detailed Description

Data class for LayoutTreeNodes.

It is derived from tree::CommonNodeData, so that it already contains a name field.

Definition at line 80 of file layout_tree.hpp.

Public Member Functions

 LayoutNodeData (LayoutNodeData &&)=delete
 
virtual ~LayoutNodeData () override=default
 
virtual std::unique_ptr< BaseNodeDataclone () const override
 Polymorphically copy an instance of this class. Use instead of copy constructor. More...
 
LayoutNodeDataoperator= (LayoutNodeData &&)=delete
 
virtual std::unique_ptr< BaseNodeDatarecreate () const override
 Polymorphically create a default-constructed instance of this class with the same derived type as it was called on. More...
 
- Public Member Functions inherited from CommonNodeData
 CommonNodeData (CommonNodeData &&)=delete
 
virtual ~CommonNodeData () override=default
 
CommonNodeDataoperator= (CommonNodeData &&)=delete
 
- Public Member Functions inherited from BaseNodeData
 BaseNodeData (BaseNodeData &&)=delete
 Deleted move constructor. More...
 
virtual ~BaseNodeData ()=default
 Virtual destructor. Needed for polymorphism. More...
 
BaseNodeDataoperator= (BaseNodeData &&)=delete
 Deleted move assignment. More...
 

Static Public Member Functions

static std::unique_ptr< LayoutNodeDatacreate ()
 
- Static Public Member Functions inherited from CommonNodeData
static std::unique_ptr< CommonNodeDatacreate ()
 
- Static Public Member Functions inherited from BaseNodeData
static std::unique_ptr< BaseNodeDatacreate ()
 Create a new instance of this class. Use instead of default constructor. More...
 

Public Attributes

double distance = -1.0
 Distance of the node to the root. More...
 
long parent_index = -1
 
utils::SvgGroup shape
 
utils::SvgStroke spacer_stroke = utils::SvgStroke( utils::SvgStroke::Type::kNone )
 
double spreading = -1.0
 Position of the node along the second axis. More...
 
- Public Attributes inherited from CommonNodeData
std::string name
 Name of the node. More...
 

Protected Member Functions

 LayoutNodeData ()=default
 
 LayoutNodeData (LayoutNodeData const &)=default
 
LayoutNodeDataoperator= (LayoutNodeData const &)=default
 
- Protected Member Functions inherited from CommonNodeData
 CommonNodeData ()=default
 
 CommonNodeData (CommonNodeData const &)=default
 
CommonNodeDataoperator= (CommonNodeData const &)=default
 
- Protected Member Functions inherited from BaseNodeData
 BaseNodeData ()=default
 Protected default constructor. Called from the create() function. More...
 
 BaseNodeData (BaseNodeData const &)=default
 Protected copy constructor. Called from the clone() function. More...
 
BaseNodeDataoperator= (BaseNodeData const &)=default
 Protected copy assignment. Not used right now. More...
 

Constructor & Destructor Documentation

◆ ~LayoutNodeData()

virtual ~LayoutNodeData ( )
overridevirtualdefault

◆ LayoutNodeData() [1/3]

LayoutNodeData ( LayoutNodeData &&  )
delete

◆ LayoutNodeData() [2/3]

LayoutNodeData ( )
protecteddefault

◆ LayoutNodeData() [3/3]

LayoutNodeData ( LayoutNodeData const &  )
protecteddefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< BaseNodeData > clone ( ) const
inlineoverridevirtual

Polymorphically copy an instance of this class. Use instead of copy constructor.

Reimplemented from CommonNodeData.

Definition at line 114 of file layout_tree.hpp.

◆ create()

static std::unique_ptr< LayoutNodeData > create ( )
inlinestatic

Definition at line 104 of file layout_tree.hpp.

◆ operator=() [1/2]

LayoutNodeData& operator= ( LayoutNodeData &&  )
delete

◆ operator=() [2/2]

LayoutNodeData& operator= ( LayoutNodeData const &  )
protecteddefault

◆ recreate()

virtual std::unique_ptr< BaseNodeData > recreate ( ) const
inlineoverridevirtual

Polymorphically create a default-constructed instance of this class with the same derived type as it was called on.

Reimplemented from CommonNodeData.

Definition at line 109 of file layout_tree.hpp.

Member Data Documentation

◆ distance

double distance = -1.0

Distance of the node to the root.

For rectangular trees, this is the x coordinate, while for circular trees, this is the radius. This is normalized so that the node furthest away from the root has a distance of 1.

Definition at line 132 of file layout_tree.hpp.

◆ parent_index

long parent_index = -1

Definition at line 146 of file layout_tree.hpp.

◆ shape

Definition at line 148 of file layout_tree.hpp.

◆ spacer_stroke

Definition at line 149 of file layout_tree.hpp.

◆ spreading

double spreading = -1.0

Position of the node along the second axis.

As phylogenies usually only need to display branch length, the second dimension is only necessary so that the lines of the branches are actually distinguishable from each other. This value is used for that purpose. That is, for rectangular trees, this is the y coordiante, while for circular trees, this is the angle. It is normalized so that the largest spreading (for the last node of the tree) is 1.

Definition at line 144 of file layout_tree.hpp.


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