homog2d library
Public Member Functions | Public Attributes | List of all members
h2d::svg::svgp::SvgValuesBuffer Struct Reference

This will hold the values read from the SVG Path parsing code, before they are converted to points. More...

#include <homog2d.hpp>

Collaboration diagram for h2d::svg::svgp::SvgValuesBuffer:
Collaboration graph
[legend]

Public Member Functions

void addValue (std::string elem)
 
size_t size () const
 
void storeValues (std::vector< Point2d > &out, SvgPathCommand mode)
 

Public Attributes

Point2d _previousPt
 
std::vector< double > _values
 

Detailed Description

This will hold the values read from the SVG Path parsing code, before they are converted to points.

See also
SvgPathCommand

Member Function Documentation

◆ addValue()

void h2d::svg::svgp::SvgValuesBuffer::addValue ( std::string  elem)
inline
12781  {
12782  _values.push_back( std::stod(elem) );
12783  }
std::vector< double > _values
Definition: homog2d.hpp:12758
Here is the caller graph for this function:

◆ size()

size_t h2d::svg::svgp::SvgValuesBuffer::size ( ) const
inline
12762  {
12763  return _values.size();
12764  }
std::vector< double > _values
Definition: homog2d.hpp:12758
Here is the caller graph for this function:

◆ storeValues()

void h2d::svg::svgp::SvgValuesBuffer::storeValues ( std::vector< Point2d > &  out,
SvgPathCommand  mode 
)
inline
12767  {
12768  if( _values.size() != (size_t)mode._nbValues )
12770  "SVG path command: inconsistency with stored values, expected "
12771  << (size_t)mode._nbValues << ", got "
12772  << _values.size()
12773  );
12774  auto pt = generateNewPoint( mode, _previousPt, _values );
12775  HOMOG2D_LOG( "new point added: " << pt );
12776  out.push_back( pt );
12777  _previousPt = pt;
12778  _values.clear();
12779  }
Point2d_< double > generateNewPoint(SvgPathCommand mode, Point2d_< double > prevPt, const std::vector< double > &val)
Generate new point from current mode and previous point, handles absolute/relative coordinates...
Definition: homog2d.hpp:12634
#define HOMOG2D_LOG(a)
Definition: homog2d.hpp:115
std::vector< double > _values
Definition: homog2d.hpp:12758
#define HOMOG2D_THROW_ERROR_1(msg)
Error throw wrapper macro.
Definition: homog2d.hpp:181
Point2d _previousPt
Definition: homog2d.hpp:12759
Point2d pt
Definition: homog2d_test.cpp:4034
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _previousPt

Point2d h2d::svg::svgp::SvgValuesBuffer::_previousPt

◆ _values

std::vector<double> h2d::svg::svgp::SvgValuesBuffer::_values

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