A toolkit for working with phylogenetic data.
v0.24.0
image.hpp
Go to the documentation of this file.
1
#ifndef GENESIS_UTILS_FORMATS_SVG_IMAGE_H_
2
#define GENESIS_UTILS_FORMATS_SVG_IMAGE_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
34
#include "
genesis/utils/formats/svg/helper.hpp
"
35
#include "
genesis/utils/formats/svg/attributes.hpp
"
36
37
#include <iosfwd>
38
#include <string>
39
40
namespace
genesis
{
41
namespace
utils {
42
43
// =================================================================================================
44
// Svg Image
45
// =================================================================================================
46
47
struct
SvgImage
48
{
49
public
:
50
51
// -------------------------------------------------------------
52
// Typedefs and Enums
53
// -------------------------------------------------------------
54
55
using
self_type
=
SvgImage
;
56
57
// -------------------------------------------------------------
58
// Constructors and Rule of Five
59
// -------------------------------------------------------------
60
61
SvgImage
(
62
std::string
const
&
href
63
);
64
65
SvgImage
(
66
std::string
const
&
href
,
67
SvgPoint
const
&
position
68
);
69
70
SvgImage
(
71
std::string
const
&
href
,
72
SvgPoint
const
&
position
,
73
SvgSize
const
&
size
74
);
75
76
SvgImage
(
77
std::string
const
&
href
,
78
double
x,
double
y,
79
double
w,
double
h
80
);
81
82
~SvgImage
() =
default
;
83
84
SvgImage
(
SvgImage
const
& ) =
default
;
85
SvgImage
(
SvgImage
&& ) =
default
;
86
87
SvgImage
&
operator=
(
SvgImage
const
& ) =
default
;
88
SvgImage
&
operator=
(
SvgImage
&& ) =
default
;
89
90
// -------------------------------------------------------------
91
// Drawing Function
92
// -------------------------------------------------------------
93
94
SvgBox
bounding_box
()
const
;
95
96
void
write
(
97
std::ostream& out,
98
size_t
indent
= 0,
99
SvgDrawingOptions
const
& options =
SvgDrawingOptions
()
100
)
const
;
101
102
// -------------------------------------------------------------
103
// Properties
104
// -------------------------------------------------------------
105
106
std::string
id
;
107
108
std::string
href
;
109
110
SvgPoint
position
;
111
SvgSize
size
;
112
113
SvgTransform
transform
;
114
115
};
116
117
}
// namespace utils
118
}
// namespace genesis
119
120
#endif // include guard
helper.hpp
genesis::utils::SvgDrawingOptions
Definition:
utils/formats/svg/helper.hpp:200
genesis::utils::SvgImage::transform
SvgTransform transform
Definition:
image.hpp:113
genesis::utils::SvgBox
Definition:
utils/formats/svg/helper.hpp:114
genesis::utils::SvgImage::operator=
SvgImage & operator=(SvgImage const &)=default
genesis::utils::SvgTransform
Definition:
attributes.hpp:238
genesis::utils::SvgSize
Definition:
utils/formats/svg/helper.hpp:64
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
Definition:
placement/formats/edge_color.cpp:42
genesis::utils::SvgImage::position
SvgPoint position
Definition:
image.hpp:110
genesis::utils::indent
std::string indent(std::string const &text, std::string const &indentation)
Indent each line of text with indentation and return the result.
Definition:
string.cpp:314
genesis::utils::SvgImage::size
SvgSize size
Definition:
image.hpp:111
genesis::utils::SvgImage::write
void write(std::ostream &out, size_t indent=0, SvgDrawingOptions const &options=SvgDrawingOptions()) const
Definition:
image.cpp:92
genesis::utils::SvgImage::SvgImage
SvgImage(std::string const &href)
Definition:
image.cpp:49
genesis::utils::SvgImage::bounding_box
SvgBox bounding_box() const
Definition:
image.cpp:87
genesis::utils::SvgImage::~SvgImage
~SvgImage()=default
genesis::utils::SvgImage::id
std::string id
Definition:
image.hpp:106
genesis::utils::SvgPoint
Definition:
utils/formats/svg/helper.hpp:49
genesis::utils::SvgImage::href
std::string href
Definition:
image.hpp:108
genesis::utils::SvgImage
Definition:
image.hpp:47
attributes.hpp
lib
genesis
utils
formats
svg
image.hpp
Generated on Sun May 17 2020 12:46:44 for genesis by
1.8.13