VSTGUI 4.10
Graphical User Interface Framework not only for VST plugins
Loading...
Searching...
No Matches
CGraphicsPath Class Reference

Graphics Path Object. More...

#include <cgraphicspath.h>

+ Inheritance diagram for CGraphicsPath:

Public Member Functions

Creating gradients
CGradientcreateGradient (double color1Start, double color2Start, const CColor &color1, const CColor &color2)
 creates a new gradient object, you must release it with forget() when you're done with it
 
Adding Elements
void addArc (const CRect &rect, double startAngle, double endAngle, bool clockwise)
 add an arc to the path.
 
void addEllipse (const CRect &rect)
 add an ellipse to the path.
 
void addRect (const CRect &rect)
 add a rectangle to the path.
 
void addPath (const CGraphicsPath &path, CGraphicsTransform *transformation=nullptr)
 add another path to the path.
 
void addLine (const CPoint &to)
 add a line to the path.
 
void addBezierCurve (const CPoint &control1, const CPoint &control2, const CPoint &end)
 add a bezier curve to the path.
 
void beginSubpath (const CPoint &start)
 begin a new subpath.
 
void closeSubpath ()
 close a subpath.
 
void beginSubpath (CCoord x, CCoord y)
 
void addLine (CCoord x, CCoord y)
 
void addBezierCurve (CCoord cp1x, CCoord cp1y, CCoord cp2x, CCoord cp2y, CCoord x, CCoord y)
 
Helpers
void addRoundRect (const CRect &size, CCoord radius)
 
Hit Testing
bool hitTest (const CPoint &p, bool evenOddFilled=false, CGraphicsTransform *transform=nullptr)
 
- Public Member Functions inherited from ReferenceCounted< std::atomic< int32_t > >
 ReferenceCounted ()=default
 
virtual ~ReferenceCounted () noexcept=default
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
 ReferenceCounted ()=default
 
 ReferenceCounted (const ReferenceCounted &)
 
virtual ~ReferenceCounted () noexcept=default
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 
void forget () override
 decrease refcount and delete object if refcount == 0
 
void remember () override
 increase refcount
 
virtual int32_t getNbReference () const
 get refcount
 

States

using ElementList = std::vector<Element>
 
ElementList elements
 
PlatformGraphicsPathFactoryPtr factory
 
PlatformGraphicsPathPtr path
 
CPoint getCurrentPosition ()
 
CRect getBoundingBox ()
 
 CGraphicsPath (const PlatformGraphicsPathFactoryPtr &factory, PlatformGraphicsPathPtr &&path)
 
 ~CGraphicsPath () noexcept override
 
const PlatformGraphicsPathPtrgetPlatformPath (PlatformGraphicsPathFillMode fillMode)
 
void makePlatformGraphicsPath (PlatformGraphicsPathFillMode fillMode)
 
bool ensurePlatformGraphicsPathValid (PlatformGraphicsPathFillMode fillMode)
 
void dirty ()
 

Detailed Description

Graphics Path Object.

Member Typedef Documentation

◆ ElementList

using ElementList = std::vector<Element>
protected

Constructor & Destructor Documentation

◆ CGraphicsPath()

◆ ~CGraphicsPath()

~CGraphicsPath ( )
overridenoexcept

Member Function Documentation

◆ addArc()

void addArc ( const CRect & rect,
double startAngle,
double endAngle,
bool clockwise )

add an arc to the path.

Begins a new subpath if no elements were added before.

◆ addBezierCurve() [1/2]

void addBezierCurve ( CCoord cp1x,
CCoord cp1y,
CCoord cp2x,
CCoord cp2y,
CCoord x,
CCoord y )
inline

◆ addBezierCurve() [2/2]

void addBezierCurve ( const CPoint & control1,
const CPoint & control2,
const CPoint & end )

add a bezier curve to the path.

A subpath must begin before

◆ addEllipse()

void addEllipse ( const CRect & rect)

add an ellipse to the path.

Begins a new subpath if no elements were added before.

◆ addLine() [1/2]

void addLine ( CCoord x,
CCoord y )
inline

◆ addLine() [2/2]

void addLine ( const CPoint & to)

add a line to the path.

A subpath must begin before

◆ addPath()

void addPath ( const CGraphicsPath & path,
CGraphicsTransform * transformation = nullptr )

add another path to the path.

Begins a new subpath if no elements were added before.

◆ addRect()

void addRect ( const CRect & rect)

add a rectangle to the path.

Begins a new subpath if no elements were added before.

◆ addRoundRect()

void addRoundRect ( const CRect & size,
CCoord radius )

◆ beginSubpath() [1/2]

void beginSubpath ( CCoord x,
CCoord y )
inline

◆ beginSubpath() [2/2]

void beginSubpath ( const CPoint & start)

begin a new subpath.

◆ closeSubpath()

void closeSubpath ( )

close a subpath.

A straight line will be added from the current point to the start point.

◆ createGradient()

CGradient * createGradient ( double color1Start,
double color2Start,
const CColor & color1,
const CColor & color2 )

creates a new gradient object, you must release it with forget() when you're done with it

Parameters
color1Startvalue between zero and one which defines the normalized start offset for color1
color2Startvalue between zero and one which defines the normalized start offset for color2
color1the first color of the gradient
color2the second color of the gradient
Returns
a new gradient object

◆ dirty()

void dirty ( )
protected

◆ ensurePlatformGraphicsPathValid()

bool ensurePlatformGraphicsPathValid ( PlatformGraphicsPathFillMode fillMode)
protected

◆ getBoundingBox()

CRect getBoundingBox ( )

◆ getCurrentPosition()

CPoint getCurrentPosition ( )

◆ getPlatformPath()

const PlatformGraphicsPathPtr & getPlatformPath ( PlatformGraphicsPathFillMode fillMode)

◆ hitTest()

bool hitTest ( const CPoint & p,
bool evenOddFilled = false,
CGraphicsTransform * transform = nullptr )

◆ makePlatformGraphicsPath()

void makePlatformGraphicsPath ( PlatformGraphicsPathFillMode fillMode)
protected

Member Data Documentation

◆ elements

ElementList elements
protected

◆ factory

PlatformGraphicsPathFactoryPtr factory
protected

◆ path

PlatformGraphicsPathPtr path
protected

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