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

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

Detailed Description

Definition at line 458 of file shapes.hpp.

Public Member Functions

 SvgPath (std::vector< std::string > const &elements, SvgStroke const &stroke=SvgStroke(), SvgFill const &fill=SvgFill())
 
 SvgPath (SvgPath &&)=default
 
 SvgPath (SvgPath const &)=default
 
 SvgPath (SvgStroke const &stroke=SvgStroke(), SvgFill const &fill=SvgFill())
 
 ~SvgPath ()=default
 
self_typeadd (std::string elem)
 
SvgBox bounding_box () const
 Compute the bounding box of the path. More...
 
self_typeoperator<< (std::string elem)
 
SvgPathoperator= (SvgPath &&)=default
 
SvgPathoperator= (SvgPath const &)=default
 
void write (std::ostream &out, size_t indent=0, SvgDrawingOptions const &options=SvgDrawingOptions()) const
 

Public Types

using self_type = SvgPath
 

Public Attributes

std::vector< std::string > elements
 
SvgFill fill
 
std::string id
 
SvgStroke stroke
 
SvgTransform transform
 

Constructor & Destructor Documentation

◆ SvgPath() [1/4]

SvgPath ( SvgStroke const &  stroke = SvgStroke(),
SvgFill const &  fill = SvgFill() 
)

Definition at line 459 of file shapes.cpp.

◆ SvgPath() [2/4]

SvgPath ( std::vector< std::string > const &  elements,
SvgStroke const &  stroke = SvgStroke(),
SvgFill const &  fill = SvgFill() 
)

Definition at line 467 of file shapes.cpp.

◆ ~SvgPath()

~SvgPath ( )
default

◆ SvgPath() [3/4]

SvgPath ( SvgPath const &  )
default

◆ SvgPath() [4/4]

SvgPath ( SvgPath &&  )
default

Member Function Documentation

◆ add()

SvgPath & add ( std::string  elem)

Definition at line 481 of file shapes.cpp.

◆ bounding_box()

SvgBox bounding_box ( ) const

Compute the bounding box of the path.

Note that we have not implemented a full svg renderer here. Hence, we only use the immediate coordinates as given in the path commands, but ignore any parts that might go outside of that, such as Bezier curves. Still, this bounding box should give a good enough outline for many purposes, e.g., to scale a group or set the document margins roughly around the path.

Definition at line 492 of file shapes.cpp.

◆ operator<<()

SvgPath & operator<< ( std::string  elem)

Definition at line 487 of file shapes.cpp.

◆ operator=() [1/2]

SvgPath& operator= ( SvgPath &&  )
default

◆ operator=() [2/2]

SvgPath& operator= ( SvgPath const &  )
default

◆ write()

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

Definition at line 691 of file shapes.cpp.

Member Typedef Documentation

◆ self_type

using self_type = SvgPath

Definition at line 466 of file shapes.hpp.

Member Data Documentation

◆ elements

std::vector< std::string > elements

Definition at line 521 of file shapes.hpp.

◆ fill

SvgFill fill

Definition at line 524 of file shapes.hpp.

◆ id

std::string id

Definition at line 519 of file shapes.hpp.

◆ stroke

SvgStroke stroke

Definition at line 523 of file shapes.hpp.

◆ transform

SvgTransform transform

Definition at line 526 of file shapes.hpp.


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