A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
circular_tree.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_TREE_DRAWING_CIRCULAR_TREE_H_
2 #define GENESIS_TREE_DRAWING_CIRCULAR_TREE_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 
35 
36 namespace genesis {
37 namespace tree {
38 
39 // =================================================================================================
40 // Typedefs
41 // =================================================================================================
42 
47 
53 
59 
64 
65 // =================================================================================================
66 // Circular Tree Node Data
67 // =================================================================================================
68 
73 {
74  // -------------------------------------------------------------------
75  // Constructor and Rule of Five
76  // -------------------------------------------------------------------
77 
78 public:
79 
80  virtual ~CircularNodeData() = default;
81 
82  // Move ctor and assignment.
83  CircularNodeData( CircularNodeData&& ) = delete;
85 
86 protected:
87 
88  CircularNodeData() = default;
89 
90  // Copy ctor and assignment.
91  CircularNodeData( CircularNodeData const& ) = default;
92  CircularNodeData& operator= ( CircularNodeData const& ) = default;
93 
94 public:
95 
96  static std::unique_ptr< CircularNodeData > create()
97  {
98  return std::unique_ptr< CircularNodeData >( new CircularNodeData() );
99  }
100 
101  virtual std::unique_ptr< BaseNodeData > recreate() const override
102  {
103  return std::unique_ptr< CircularNodeData >( new CircularNodeData() );
104  }
105 
106  virtual std::unique_ptr< BaseNodeData > clone() const override
107  {
108  return std::unique_ptr< CircularNodeData >( new CircularNodeData( *this ));
109  }
110 
111  // -----------------------------------------------------
112  // Data Members
113  // -----------------------------------------------------
114 
115 public:
116 
117  double r = -1.0;
118  double a = -1.0;
119 
120  int parent_index = -1;
121 
122  double children_min_a = -1.0;
123  double children_max_a = -1.0;
124 
125 };
126 
127 // =================================================================================================
128 // Circular Tree Edge Data
129 // =================================================================================================
130 
135 {
136  // -------------------------------------------------------------------
137  // Constructor and Rule of Five
138  // -------------------------------------------------------------------
139 
140 public:
141 
142  virtual ~CircularEdgeData() = default;
143 
144  // Move ctor and assignment.
145  CircularEdgeData( CircularEdgeData&& ) = delete;
147 
148 protected:
149 
150  CircularEdgeData() = default;
151 
152  // Copy ctor and assignment.
153  CircularEdgeData( CircularEdgeData const& ) = default;
154  CircularEdgeData& operator= ( CircularEdgeData const& ) = default;
155 
156 public:
157 
158  static std::unique_ptr< CircularEdgeData > create()
159  {
160  return std::unique_ptr< CircularEdgeData >( new CircularEdgeData() );
161  }
162 
163  virtual std::unique_ptr< BaseEdgeData > recreate() const override
164  {
165  return std::unique_ptr< CircularEdgeData >( new CircularEdgeData() );
166  }
167 
168  virtual std::unique_ptr< BaseEdgeData > clone() const override
169  {
170  return std::unique_ptr< CircularEdgeData >( new CircularEdgeData( *this ));
171  }
172 
173  // -----------------------------------------------------
174  // Data Members
175  // -----------------------------------------------------
176 
177 };
178 
179 } // namespace tree
180 } // namespace genesis
181 
182 #endif // include guard
virtual std::unique_ptr< BaseNodeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
static std::unique_ptr< CircularEdgeData > create()
virtual ~CircularEdgeData()=default
static std::unique_ptr< CircularNodeData > create()
virtual std::unique_ptr< BaseEdgeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
Data class for CircularTreeNodes.
Data class for LayoutTreeEdges.
Class for representing phylogenetic trees.
Definition: tree/tree.hpp:95
virtual ~CircularNodeData()=default
virtual std::unique_ptr< BaseEdgeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
virtual std::unique_ptr< BaseNodeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
CircularNodeData & operator=(CircularNodeData &&)=delete
CircularEdgeData & operator=(CircularEdgeData &&)=delete
Data class for CircularTreeEdges.
Data class for LayoutTreeNodes.
Definition: layout_tree.hpp:80