A library for working with phylogenetic and population genetic data.
v0.32.0
SvgGroup Struct Reference

#include <genesis/utils/formats/svg/group.hpp>

Detailed Description

Definition at line 50 of file group.hpp.

Public Member Functions

 SvgGroup ()=default
 
 SvgGroup (SvgGroup &&)=default
 
 SvgGroup (SvgGroup const &)=default
 
 ~SvgGroup ()=default
 
self_typeadd (SvgObject &&object)
 
self_typeadd (SvgObject const &object)
 Add an SvgObject to the document. More...
 
SvgBox bounding_box () const
 
void clear ()
 
bool empty () const
 
 operator bool () const
 
self_typeoperator<< (SvgObject &&object)
 
self_typeoperator<< (SvgObject const &object)
 Shortcut operator for add(), which allows an even more fluent interface. More...
 
SvgGroupoperator= (SvgGroup &&)=default
 
SvgGroupoperator= (SvgGroup const &)=default
 
self_typereverse ()
 Reverse the order to the stored SvgObjects. More...
 
self_typeset_hyperlink (std::string const &value)
 Simple tweak to allow making parts of an image clickable. More...
 
self_typeset_hyperlink (std::unordered_map< std::string, std::string > const &values)
 Tweak to allow making parts of an image cickable. More...
 
void write (std::ostream &out, size_t indent=0, SvgDrawingOptions const &options=SvgDrawingOptions()) const
 

Public Types

using self_type = SvgGroup
 

Public Attributes

std::vector< SvgObjectcontent_
 
std::unordered_map< std::string, std::string > hyperlink_
 
std::string id
 
SvgTransform transform
 

Constructor & Destructor Documentation

◆ SvgGroup() [1/3]

SvgGroup ( )
default

◆ ~SvgGroup()

~SvgGroup ( )
default

◆ SvgGroup() [2/3]

SvgGroup ( SvgGroup const &  )
default

◆ SvgGroup() [3/3]

SvgGroup ( SvgGroup &&  )
default

Member Function Documentation

◆ add() [1/2]

SvgGroup & add ( SvgObject &&  object)

Definition at line 113 of file group.cpp.

◆ add() [2/2]

SvgGroup & add ( SvgObject const &  object)

Add an SvgObject to the document.

Returns the SvgDocument in order to allow for a fluent interface.

Definition at line 107 of file group.cpp.

◆ bounding_box()

SvgBox bounding_box ( ) const

Definition at line 50 of file group.cpp.

◆ clear()

void clear ( )
inline

Definition at line 145 of file group.hpp.

◆ empty()

bool empty ( ) const
inline

Definition at line 135 of file group.hpp.

◆ operator bool()

operator bool ( ) const
inline

Definition at line 140 of file group.hpp.

◆ operator<<() [1/2]

SvgGroup & operator<< ( SvgObject &&  object)

Definition at line 130 of file group.cpp.

◆ operator<<() [2/2]

SvgGroup & operator<< ( SvgObject const &  object)

Shortcut operator for add(), which allows an even more fluent interface.

Definition at line 125 of file group.cpp.

◆ operator=() [1/2]

SvgGroup& operator= ( SvgGroup &&  )
default

◆ operator=() [2/2]

SvgGroup& operator= ( SvgGroup const &  )
default

◆ reverse()

SvgGroup & reverse ( )

Reverse the order to the stored SvgObjects.

Definition at line 119 of file group.cpp.

◆ set_hyperlink() [1/2]

self_type& set_hyperlink ( std::string const &  value)
inline

Simple tweak to allow making parts of an image clickable.

This will simply add an <a> tag around the group, making everything in it clickable and hyperlink to the given URL. We currently do not have any per-object hyperlinks, and hence instead everything with a hyperlink has to go in a group.

Definition at line 105 of file group.hpp.

◆ set_hyperlink() [2/2]

self_type& set_hyperlink ( std::unordered_map< std::string, std::string > const &  values)
inline

Tweak to allow making parts of an image cickable.

This is the same as the simply string version of this function, but additionally allows to set extra attributes to be used within the <a> tag. Note that the key href needs to be present in the map, in order to actually have a hyerlink to be cickable.

Definition at line 118 of file group.hpp.

◆ write()

void write ( std::ostream &  out,
size_t  indent = 0,
SvgDrawingOptions const &  options = SvgDrawingOptions() 
) const

Definition at line 66 of file group.cpp.

Member Typedef Documentation

◆ self_type

Definition at line 58 of file group.hpp.

Member Data Documentation

◆ content_

std::vector< SvgObject > content_

Definition at line 158 of file group.hpp.

◆ hyperlink_

std::unordered_map<std::string, std::string> hyperlink_

Definition at line 160 of file group.hpp.

◆ id

std::string id

Definition at line 157 of file group.hpp.

◆ transform

SvgTransform transform

Definition at line 159 of file group.hpp.


The documentation for this struct was generated from the following files: