sf-svg
Public Member Functions | Public Attributes | List of all members
nsvg::Path Class Reference

C++-styled cstyle::PathStruct wrapper. More...

#include <Path.hpp>

Public Member Functions

 Path (const cstyle::PathStruct *ptr)
 Constructor. More...
 
Pathoperator++ ()
 Get points sets. More...
 
 operator bool () const
 Cast nsvg::Path → bool. More...
 

Public Attributes

const cstyle::PathStructinternal
 

Detailed Description

C++-styled cstyle::PathStruct wrapper.

Constructor & Destructor Documentation

◆ Path()

nsvg::Path::Path ( const cstyle::PathStruct ptr)

Constructor.

Parameters
[in]ptr– const pointer to PathStruct

It's the only constructor of nsvg::Path class, which wraps given cstyle::PathStruct into object orientated interface.

Member Function Documentation

◆ operator bool()

nsvg::Path::operator bool ( ) const

Cast nsvg::Path → bool.

Implicitly cast *this to bool, equivalent to nsvg::Path::good() method.

◆ operator++()

Path & nsvg::Path::operator++ ( )

Get points sets.

Returns
Set of points required to create Bezier curve (begin, end, 2 handles)

Sample code:

for(const auto& points: path.getPointsSets()){
std::cout << "begin: [" << points.begin.x << ", " << points.begin.y << "]" << std::endl
std::cout << "end: [" << points.end.x << ", " << points.end.y << "]" << std::endl
std::cout << "handle 1: [" << points.control1.x << ", " << points.control1.y << "]" << std::endl
std::cout << "handle 2: [" << points.control2.x << ", " << points.control2.y << "]" << std::endl
}
std::vector<CubicPointSet> getPointsSets() const;
\brief Get next path
\return Instance of shape wrapping this->internal->path.
Path getNextPath() const;
\brief Is ok?
\return True if instance wraps proper pointer (not nullptr), False otherwise.
bool good() const;
\brief Switches itself to next path
\return Reference to *this
Equivalent to:
\code{.cpp}
samplePath = samplePath.getNextPath();

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