dg2d.path

This module provides a 2D geometric path type. A Path is a 2D shape defined by a sequence of line or curve segments. It can be open or closed, and can have multiple sub paths.

Build a path...

Path!float path;
path.moveTo(0,0);
path.lineTo(10,10);
path.quadTo(20,20,30,30);
path.close();

Commands can be chained...

path.moveTo(0,0).lineTo(10,10).quadTo(20,20,30,30).close();

You can use chained PathIterator adaptor functions...

DrawPath(path.offset(100,100).retro);

To modify path you use assignment, so for example to scale a path you assign a scaled version of it to itself, the assign methods will check for self assignment and do it in place if possible.

path = path.retro.offset(10,10);

Members

Enums

PathCmd
enum PathCmd

Defines the commands used to build a path.

Functions

advance
int advance(PathCmd cmd)

Number of points to advance for a given command

linked
int linked(PathCmd cmd)

Is the command linked, IE does it use the end poin of the previous command as its first point.

Structs

Path
struct Path

A 2D geometric path type.

Meta

License

Boost Software License, Version 1.0

Authors

Chris Jones