A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
layout_tree.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_TREE_DRAWING_LAYOUT_TREE_H_
2 #define GENESIS_TREE_DRAWING_LAYOUT_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 #include "genesis/tree/tree.hpp"
37 
38 #include <string>
39 #include <vector>
40 
41 namespace genesis {
42 namespace tree {
43 
44 // =================================================================================================
45 // Typedefs
46 // =================================================================================================
47 
52 
58 
64 
69 
70 // =================================================================================================
71 // Layout Tree Node Data
72 // =================================================================================================
73 
81 {
82  // -------------------------------------------------------------------
83  // Constructor and Rule of Five
84  // -------------------------------------------------------------------
85 
86 public:
87 
88  virtual ~LayoutNodeData() = default;
89 
90  // Move ctor and assignment.
91  LayoutNodeData( LayoutNodeData&& ) = delete;
93 
94 protected:
95 
96  LayoutNodeData() = default;
97 
98  // Copy ctor and assignment.
99  LayoutNodeData( LayoutNodeData const& ) = default;
100  LayoutNodeData& operator= ( LayoutNodeData const& ) = default;
101 
102 public:
103 
104  static std::unique_ptr< LayoutNodeData > create()
105  {
106  return std::unique_ptr< LayoutNodeData >( new LayoutNodeData() );
107  }
108 
109  virtual std::unique_ptr< BaseNodeData > recreate() const override
110  {
111  return std::unique_ptr< LayoutNodeData >( new LayoutNodeData() );
112  }
113 
114  virtual std::unique_ptr< BaseNodeData > clone() const override
115  {
116  return std::unique_ptr< LayoutNodeData >( new LayoutNodeData( *this ));
117  }
118 
119  // -----------------------------------------------------
120  // Data Members
121  // -----------------------------------------------------
122 
123 public:
124 
126 
127 };
128 
129 // =================================================================================================
130 // Layout Tree Edge Data
131 // =================================================================================================
132 
140 {
141  // -------------------------------------------------------------------
142  // Constructor and Rule of Five
143  // -------------------------------------------------------------------
144 
145 public:
146 
147  virtual ~LayoutEdgeData() = default;
148 
149  // Move ctor and assignment.
150  LayoutEdgeData( LayoutEdgeData&& ) = delete;
152 
153 protected:
154 
155  LayoutEdgeData() = default;
156 
157  // Copy ctor and assignment.
158  LayoutEdgeData( LayoutEdgeData const& ) = default;
159  LayoutEdgeData& operator= ( LayoutEdgeData const& ) = default;
160 
161 public:
162 
163  static std::unique_ptr< LayoutEdgeData > create()
164  {
165  return std::unique_ptr< LayoutEdgeData >( new LayoutEdgeData() );
166  }
167 
168  virtual std::unique_ptr< BaseEdgeData > recreate() const override
169  {
170  return std::unique_ptr< LayoutEdgeData >( new LayoutEdgeData() );
171  }
172 
173  virtual std::unique_ptr< BaseEdgeData > clone() const override
174  {
175  return std::unique_ptr< LayoutEdgeData >( new LayoutEdgeData( *this ));
176  }
177 
178  // -----------------------------------------------------
179  // Data Members
180  // -----------------------------------------------------
181 
182 public:
183 
185 };
186 
187 } // namespace tree
188 } // namespace genesis
189 
190 #endif // include guard
virtual std::unique_ptr< BaseNodeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
LayoutNodeData & operator=(LayoutNodeData &&)=delete
static std::unique_ptr< LayoutNodeData > create()
static std::unique_ptr< LayoutEdgeData > create()
Default class containing the commonly needed data for tree nodes.
virtual std::unique_ptr< BaseNodeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
Default class containing the commonly needed data for tree edges.
Data class for LayoutTreeEdges.
virtual ~LayoutNodeData()=default
Class for representing phylogenetic trees.
Definition: tree/tree.hpp:95
LayoutEdgeData & operator=(LayoutEdgeData &&)=delete
Data class for LayoutTreeNodes.
Definition: layout_tree.hpp:80
Header of Tree class.
virtual std::unique_ptr< BaseEdgeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
virtual ~LayoutEdgeData()=default
virtual std::unique_ptr< BaseEdgeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.