SVG for C++
Classes | Typedefs | Functions
SVG Namespace Reference

Main namespace for SVG for C++. More...

Classes

class  AttributeMap
 Base class for anything that has attributes (e.g. SVG elements, CSS stylesheets) More...
 
class  Circle
 
class  Element
 Abstract base class for all SVG elements. More...
 
class  Group
 
class  Line
 
class  Path
 
class  Polygon
 
struct  QuadCoord
 
class  Rect
 
class  Shape
 Base class for any SVG elements that have a width and height. More...
 
class  SVG
 
class  Text
 

Typedefs

using SelectorProperties = std::map< std::string, AttributeMap >
 
using SVGAttrib = std::map< std::string, std::string >
 
using Point = std::pair< double, double >
 
using Margins = QuadCoord
 

Functions

std::string to_string (const double &value)
 
std::string to_string (const Point &point)
 
std::string to_string (const std::map< std::string, AttributeMap > &css, const size_t indent_level=0)
 
std::vector< Point > bounding_polygon (const std::vector< Shape *> &shapes)
 
SVG frame_animate (std::vector< SVG > &frames, const double fps)
 
SVG merge (SVG &left, SVG &right, const Margins &margins=DEFAULT_MARGINS)
 
std::vector< Point > bounding_polygon (std::vector< Shape *> &shapes)
 

Detailed Description

Main namespace for SVG for C++.

Function Documentation

◆ frame_animate()

SVG SVG::frame_animate ( std::vector< SVG > &  frames,
const double  fps 
)
inline

Given a vector of SVGs, create a frame-by-frame animation of them

Parameters
[in]Avector of frames (SVGs)
[out]fpsNumbers of frames per second

Given a vector of SVGs, create a frame-by-frame animation of them

Parameters
[in]Avector of frames (SVGs)
[out]fpsNumbers of frames per second

◆ merge()

SVG SVG::SVG::merge ( SVG left,
SVG right,
const Margins margins = DEFAULT_MARGINS 
)
inline

Merge two SVG documents together horizontally with a uniform margin

Merge two SVG documents together horizontally with a uniform margin

◆ to_string() [1/3]

std::string SVG::to_string ( const double &  value)
inline

Trim off all but one decimal place when converting a double to string

Trim off all but one decimal place when converting a double to string

◆ to_string() [2/3]

std::string SVG::SVG::to_string ( const Point &  point)
inline

Return a string representation of a point as "x,y"

Return a string representation of a point as "x,y"

◆ to_string() [3/3]

std::string SVG::SVG::to_string ( const std::map< std::string, AttributeMap > &  css,
const size_t  indent_level = 0 
)
inline

Print out a CSS attribute block

Print out a CSS attribute block