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

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

#include <Shape.hpp>

Public Member Functions

 Shape (const cstyle::ShapeStruct *ptr)
 Constructor. More...
 
std::string getId () const
 Get ID. More...
 
cstyle::Paint getFill () const
 Get fill paint. More...
 
cstyle::Paint getStroke () const
 Get stroke. More...
 
float getOpacity () const
 Get opacity. More...
 
float getStrokeWidth () const
 Get stroke width. More...
 
float getStrokeDashOffset () const
 Get stroke dash offset. More...
 
const float * getStrokeDashArray () const
 Get stroke dash array. More...
 
size_t getStrokeDashCount () const
 Get stroke dash count. More...
 
LineJoin getStrokeLineJoin () const
 Get stroke line join. More...
 
LineCap getStrokeLineCap () const
 Get stroke line cap. More...
 
Flags getFlags () const
 get Flags More...
 
const float * getBounds () const
 Get bounds. More...
 
PathVector getPaths () const
 Get paths. More...
 
Shape getNextShape () const
 Get next shape. More...
 
bool good () const
 Is ok? More...
 
Shapeoperator++ ()
 Switches itself to next shape. More...
 
 operator bool () const
 Cast nsvg::Shape → bool. More...
 

Detailed Description

C++-styled cstyle::ShapeStruct wrapper.

Constructor & Destructor Documentation

◆ Shape()

nsvg::Shape::Shape ( const cstyle::ShapeStruct ptr)

Constructor.

Parameters
[in]ptr– const pointer to ShapeStruct

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

Member Function Documentation

◆ getBounds()

const float * nsvg::Shape::getBounds ( ) const

Get bounds.

Returns
Const float pointer to bounds array

◆ getFill()

cstyle::Paint nsvg::Shape::getFill ( ) const

Get fill paint.

Returns
cstyle::Paint structure

◆ getFlags()

Flags nsvg::Shape::getFlags ( ) const

get Flags

Returns
Flags enum

◆ getId()

std::string nsvg::Shape::getId ( ) const

Get ID.

Returns
Shape's ID

◆ getNextShape()

Shape nsvg::Shape::getNextShape ( ) const

Get next shape.

Returns
Instance of shape wrapping this->internal->next.

◆ getOpacity()

float nsvg::Shape::getOpacity ( ) const

Get opacity.

Returns
Floating-point opacity

◆ getPaths()

PathVector nsvg::Shape::getPaths ( ) const

Get paths.

Returns
PathVector containing all the paths

◆ getStroke()

cstyle::Paint nsvg::Shape::getStroke ( ) const

Get stroke.

Returns
Stroke

◆ getStrokeDashArray()

const float * nsvg::Shape::getStrokeDashArray ( ) const

Get stroke dash array.

Returns
Const float pointer to stroke dash array

◆ getStrokeDashCount()

size_t nsvg::Shape::getStrokeDashCount ( ) const

Get stroke dash count.

Returns
Unsigned stroke dash count

◆ getStrokeDashOffset()

float nsvg::Shape::getStrokeDashOffset ( ) const

Get stroke dash offset.

Returns
Stroke dash offset

◆ getStrokeLineCap()

LineCap nsvg::Shape::getStrokeLineCap ( ) const

Get stroke line cap.

Returns
LineCap enum

◆ getStrokeLineJoin()

LineJoin nsvg::Shape::getStrokeLineJoin ( ) const

Get stroke line join.

Returns
LineJoin enum

◆ getStrokeWidth()

float nsvg::Shape::getStrokeWidth ( ) const

Get stroke width.

Returns
Stroke width

◆ good()

bool nsvg::Shape::good ( ) const

Is ok?

Returns
True if instance wraps proper pointer (not nullptr), False otherwise.

◆ operator bool()

nsvg::Shape::operator bool ( ) const

Cast nsvg::Shape → bool.

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

◆ operator++()

Shape & nsvg::Shape::operator++ ( )

Switches itself to next shape.

Returns
Reference to *this

Equivalent to:

sampleShape = sampleShape.getNextShape();

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