|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_FORMATS_SVG_OBJECT_H_
2 #define GENESIS_UTILS_FORMATS_SVG_OBJECT_H_
60 template<
typename T >
68 : pimpl_( other.pimpl_->clone() )
88 std::string
const&
id()
const
95 return pimpl_->bounding_box_();
103 pimpl_->write_( out,
indent, options );
114 virtual ~Concept() {}
116 virtual std::string
const& id_()
const = 0;
117 virtual SvgBox bounding_box_()
const = 0;
122 SvgDrawingOptions
const& options = SvgDrawingOptions()
125 virtual std::unique_ptr< Concept > clone()
const = 0;
128 template<
typename T >
129 struct Model : Concept
131 Model( T
const& value )
135 std::string
const& id_()
const override
140 SvgBox bounding_box_()
const override
142 return object_.bounding_box();
148 SvgDrawingOptions
const& options = SvgDrawingOptions()
150 object_.write( out,
indent, options );
153 std::unique_ptr< Concept > clone()
const override
157 return genesis::utils::make_unique< Model<T> >( object_ );
163 std::unique_ptr< Concept > pimpl_;
170 #endif // include guard
void swap(Sample &lhs, Sample &rhs)
SvgObject(SvgObject const &other)
std::string indent(std::string const &text, std::string const &indentation)
Indent each line of text with indentation and return the result.
SvgObject(T const &object)
void write(std::ostream &out, size_t indent=0, SvgDrawingOptions const &options=SvgDrawingOptions()) const
std::string const & id() const
Provides some valuable additions to STD.
SvgBox bounding_box() const
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
SvgObject & operator=(SvgObject other)
std::unique_ptr< T > make_unique(Args &&... args)
Returns a std::unique_ptr for a given type.