SVG for C++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SVG::Line Class Reference

Inherits SVG::Shape.

Public Member Functions

 Line (double x1, double x2, double y1, double y2)
 
 Line (Point x, Point y)
 
virtual double x () override
 
virtual double y () override
 
double x1 ()
 
double x2 ()
 
double y1 ()
 
double y2 ()
 
double width () override
 
double height () override
 
double length ()
 
double slope ()
 
double angle ()
 
std::pair< double, double > along (double percent)
 
- Public Member Functions inherited from SVG::Shape
 operator Point ()
 
virtual std::vector< Point > points ()
 
 Element ()=default
 
 Element (const Element &other)=delete
 
 Element (Element &&other)=default
 
 Element (const char *id)
 
- Public Member Functions inherited from SVG::Element
 Element (const Element &other)=delete
 
 Element (Element &&other)=default
 
Elementoperator= (const Element &)=delete
 
Elementoperator= (Element &&other)=default
 
 Element (const char *id)
 
 operator std::string ()
 
template<typename T , typename... Args>
T * add_child (Args &&... args)
 
template<typename T >
Elementoperator<< (T &&node)
 
template<typename T >
std::vector< T * > get_children ()
 
template<typename T >
std::vector< T * > get_immediate_children ()
 
Elementget_element_by_id (const std::string &id)
 
std::vector< Element * > get_elements_by_class (const std::string &clsname)
 
void autoscale (const Margins &margins=DEFAULT_MARGINS)
 
void autoscale (const double margin)
 
ChildMap get_children ()
 
template<>
Element::ChildList get_immediate_children ()
 
 AttributeMap ()=default
 
 AttributeMap (SVGAttrib _attr)
 
- Public Member Functions inherited from SVG::AttributeMap
 AttributeMap (SVGAttrib _attr)
 
template<typename T >
AttributeMapset_attr (const std::string key, T value)
 
AttributeMapset_attrs (std::initializer_list< std::pair< std::string, std::string > > values)
 
AttrSetter set_attr (const std::string key)
 
ClassList class_list ()
 
ClassList class_list () const
 
template<>
AttributeMapset_attr (const std::string key, const double value)
 
template<>
AttributeMapset_attr (const std::string key, const char *value)
 
template<>
AttributeMapset_attr (const std::string key, const std::string value)
 

Protected Member Functions

Element::BoundingBox get_bbox () override
 
std::string tag () override
 
- Protected Member Functions inherited from SVG::Element
std::vector< Element * > get_children_helper ()
 
void get_bbox (Element::BoundingBox &)
 
virtual std::string svg_to_string (const size_t indent_level)
 
double find_numeric (const std::string &key)
 

Additional Inherited Members

- Public Types inherited from SVG::Element
using ChildList = std::vector< Element * >
 
using ChildMap = std::map< std::string, ChildList >
 
- Public Attributes inherited from SVG::AttributeMap
SVGAttrib attr
 
- Protected Attributes inherited from SVG::Element
std::vector< std::unique_ptr< Element > > children
 

Member Function Documentation

◆ along()

std::pair< double, double > SVG::Line::along ( double  percent)
inline

Return the coordinates required to place an element along this line

◆ get_bbox()

Element::BoundingBox SVG::Line::get_bbox ( )
inlineoverrideprotectedvirtual

Reimplemented from SVG::Element.

◆ height()

double SVG::Line::height ( )
inlineoverridevirtual

Reimplemented from SVG::Shape.

◆ tag()

std::string SVG::Line::tag ( )
inlineoverrideprotectedvirtual

SVG string corresponding to this element

Implements SVG::Element.

◆ width()

double SVG::Line::width ( )
inlineoverridevirtual

Reimplemented from SVG::Shape.

◆ x()

virtual double SVG::Line::x ( )
inlineoverridevirtual

Reimplemented from SVG::Shape.

◆ y()

virtual double SVG::Line::y ( )
inlineoverridevirtual

Reimplemented from SVG::Shape.


The documentation for this class was generated from the following file: