This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofPath is a way to create a path or multiple paths consisting of points. It allows you to combine multiple paths consisting of points into a single vector data object that can be drawn to the screen, manipulated point by point, or manipulated with it's child subpaths. It is better at representing and manipulating complex shapes than the ofPolyline and more easily represents multiple child lines or shapes as either ofSubPath or ofPolyline instances. By default ofPath uses ofSubPath instances. Closing the path automatically creates a new path: More...
#include <ofPath.h>
Classes | |
struct | Command |
Public Member Functions | |
Create and remove paths and sub paths | |
ofPath () | |
Create a new ofPath instance. | |
void | clear () |
Remove all subpaths from the ofPath instance. | |
void | newSubPath () |
Create a new subpath, either an ofPolyline instance or an ofSubPath instance. All points added after a call to ofSubPath will be done in the newly created subpath. Calling close() automatically calls create newSubPath(), ensuring that the closed path doesn't have new points added to it. | |
void | close () |
Close the current subpath and create a new subpath, either an ofPolyline or ofSubPath by calling newSubPath(), ensuring that the closed path doesn't have new points added to it. | |
Sub paths | |
void | lineTo (const glm::vec3 &p) |
Draw a straight line from the current drawing position to the location indicated by p. | |
void | lineTo (const glm::vec2 &p) |
void | lineTo (float x, float y) |
Draw a straight line from the current drawing position to the location indicated by x,y. | |
void | lineTo (float x, float y, float z) |
Draw a straight line from the current drawing position to the location indicated by x,y,z. | |
void | moveTo (const glm::vec3 &p) |
Move the drawing position to p. This means that a subsequent calls to, for instance, lineTo() or curveTo() will connect the location p to the new location. | |
void | moveTo (const glm::vec2 &p) |
void | moveTo (float x, float y, float z=0) |
Move the drawing position to x,y.z. This means that a subsequent calls to, for instance, lineTo() or curveTo() will connect the location x,y,z to the new location. | |
void | curveTo (const glm::vec3 &p) |
Draws a curve to p from the current drawing position. | |
void | curveTo (const glm::vec2 &p) |
void | curveTo (float x, float y) |
Draws a curve to x,y from the current drawing position. | |
void | curveTo (float x, float y, float z) |
Draws a curve to x,y,z from the current drawing position. | |
void | bezierTo (const glm::vec3 &cp1, const glm::vec3 &cp2, const glm::vec3 &p) |
Create a cubic bezier line from the current drawing point with the 2 control points indicated by glm::vec3 cp1 and cp2 , that ends at glm::vec3 to. | |
void | bezierTo (const glm::vec2 &cp1, const glm::vec2 &cp2, const glm::vec2 &p) |
void | bezierTo (float cx1, float cy1, float cx2, float cy2, float x, float y) |
Create a cubic bezier line from the current drawing point with the 2 control points indicated by the coordinates cx1, cy1 and cx2, cy2, that ends at the coordinates x, y. | |
void | bezierTo (float cx1, float cy1, float cz1, float cx2, float cy2, float cz2, float x, float y, float z) |
Create a cubic bezier line in 3D space from the current drawing point with the 2 control points indicated by the coordinates cx1, cy1, cz1 and cx2, cy2, cz2, that ends at the coordinates x, y, z. | |
void | quadBezierTo (const glm::vec3 &cp1, const glm::vec3 &cp2, const glm::vec3 &p) |
Create a quadratic bezier line in 3D space from the current drawing point with the beginning indicated by the coordinates cx1, cy1, cz1, the control point at cx2, cy2, cz2, and that ends at the coordinates x, y, z. | |
void | quadBezierTo (const glm::vec2 &cp1, const glm::vec2 &cp2, const glm::vec2 &p) |
void | quadBezierTo (float cx1, float cy1, float cx2, float cy2, float x, float y) |
Creates a quadratic bezier line in 2D space from the current drawing point with the beginning indicated by the point p1, the control point at p2, and that ends at the point p3. | |
void | quadBezierTo (float cx1, float cy1, float cz1, float cx2, float cy2, float cz2, float x, float y, float z) |
Creates a quadratic bezier line in 3D space from the current drawing point with the beginning indicated by the coordinates cx1, cy1, the control point at cx2, cy2, and that ends at the coordinates x, y. | |
void | arc (const glm::vec3 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd) |
Create an arc at centre, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd. To draw a circle with a radius of 50 pixels at 100, 100: | |
void | arc (const glm::vec3 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd, bool clockwise) |
void | arc (const glm::vec2 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd) |
void | arc (const glm::vec2 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd, bool clockwise) |
void | arc (float x, float y, float radiusX, float radiusY, float angleBegin, float angleEnd) |
Create an arc at x,y, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd. To draws a shape with a radius of 200 pixels at 300, 300: | |
void | arc (float x, float y, float z, float radiusX, float radiusY, float angleBegin, float angleEnd) |
Create an arc at x,y,z, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd. | |
void | arcNegative (const glm::vec3 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd) |
void | arcNegative (const glm::vec2 ¢re, float radiusX, float radiusY, float angleBegin, float angleEnd) |
void | arcNegative (float x, float y, float radiusX, float radiusY, float angleBegin, float angleEnd) |
void | arcNegative (float x, float y, float z, float radiusX, float radiusY, float angleBegin, float angleEnd) |
void | triangle (float x1, float y1, float x2, float y2, float x3, float y3) |
void | triangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) |
void | triangle (const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3) |
void | triangle (const glm::vec2 &p1, const glm::vec2 &p2, const glm::vec2 &p3) |
void | circle (float x, float y, float radius) |
void | circle (float x, float y, float z, float radius) |
void | circle (const glm::vec3 &p, float radius) |
void | circle (const glm::vec2 &p, float radius) |
void | ellipse (float x, float y, float width, float height) |
void | ellipse (float x, float y, float z, float width, float height) |
void | ellipse (const glm::vec3 &p, float width, float height) |
void | ellipse (const glm::vec2 &p, float width, float height) |
void | rectangle (const ofRectangle &r) |
void | rectangle (const glm::vec3 &p, float w, float h) |
void | rectangle (const glm::vec2 &p, float w, float h) |
void | rectangle (float x, float y, float w, float h) |
void | rectangle (float x, float y, float z, float w, float h) |
void | rectRounded (const ofRectangle &b, float r) |
void | rectRounded (const glm::vec3 &p, float w, float h, float r) |
void | rectRounded (const glm::vec2 &p, float w, float h, float r) |
void | rectRounded (float x, float y, float w, float h, float r) |
void | rectRounded (const glm::vec3 &p, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | rectRounded (const glm::vec2 &p, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | rectRounded (const ofRectangle &b, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
void | rectRounded (float x, float y, float z, float w, float h, float topLeftRadius, float topRightRadius, float bottomRightRadius, float bottomLeftRadius) |
Winding Mode | |
void | setPolyWindingMode (ofPolyWindingMode mode) |
Set the way that the points in the sub paths are connected. | |
ofPolyWindingMode | getWindingMode () const |
Get the poly winding mode currently in use. | |
Drawing Mode | |
void | setFilled (bool hasFill) |
Set whether the path should be drawn as wireframes or filled. | |
void | setStrokeWidth (float width) |
Set the stroke width of the line if the ofPath is to be drawn not in wireframe. | |
void | setColor (const ofColor &color) |
Set the color of the path. This affects both the line if the path is drawn as wireframe and the fill if the path is drawn with fill. All subpaths are affected. | |
void | setHexColor (int hex) |
Set the color of the path. This affects both the line if the path is drawn as wireframe and the fill if the path is drawn with fill. All subpaths are affected. | |
void | setFillColor (const ofColor &color) |
Set the fill color of the path. This has no affect if the path is drawn as wireframe. | |
void | setFillHexColor (int hex) |
Set the fill color of the path. This has no affect if the path is drawn as wireframe. | |
void | setStrokeColor (const ofColor &color) |
Set the stroke color of the path. This has no affect if the path is drawn filled. | |
void | setStrokeHexColor (int hex) |
Set the stroke color of the path. This has no affect if the path is drawn filled. | |
bool | isFilled () const |
Get whether the path is using a fill or not. | |
ofColor | getFillColor () const |
Get the ofColor fill of the ofPath. | |
ofColor | getStrokeColor () const |
Get the stroke color of the ofPath. | |
float | getStrokeWidth () const |
Get the stroke width of the ofPath. | |
bool | hasOutline () const |
void | setCurveResolution (int curveResolution) |
int | getCurveResolution () const |
void | setCircleResolution (int circleResolution) |
int | getCircleResolution () const |
OF_DEPRECATED_MSG ("Use setCircleResolution instead.", void setArcResolution(int res)) | |
OF_DEPRECATED_MSG ("Use getCircleResolution instead.", int getArcResolution() const) | |
void | setUseShapeColor (bool useColor) |
bool | getUseShapeColor () const |
Drawing | |
void | draw () const |
Draws the path at 0,0. Calling draw() also calls tessellate() | |
void | draw (float x, float y) const |
Draws the path at x,y. Calling draw() also calls tessellate() | |
Functions | |
const std::vector< ofPolyline > & | getOutline () const |
Get an ofPolyline representing the outline of the ofPath. | |
void | tessellate () |
const ofMesh & | getTessellation () const |
void | simplify (float tolerance=0.3f) |
void | translate (const glm::vec3 &p) |
void | rotateDeg (float degrees, const glm::vec3 &axis) |
void | rotateRad (float radians, const glm::vec3 &axis) |
OF_DEPRECATED_MSG ("Use Deg/Rad versions.", void rotate(float degrees, const glm::vec3 &axis)) | |
void | translate (const glm::vec2 &p) |
void | rotateDeg (float degrees, const glm::vec2 &axis) |
void | rotateRad (float radians, const glm::vec2 &axis) |
OF_DEPRECATED_MSG ("Use Deg/Rad versions.", void rotate(float degrees, const glm::vec2 &axis)) | |
void | scale (float x, float y) |
Change the size of either the ofPolyline or ofSubPath instances that the ofPath contains. These changes are non-reversible, so for instance scaling by 0,0 zeros out all data. | |
void | append (const ofPath &path) |
Path Commands | |
std::vector< Command > & | getCommands () |
const std::vector< Command > & | getCommands () const |
Path Mode | |
enum | Mode { COMMANDS , POLYLINES } |
void | setMode (Mode mode) |
Mode | getMode () const |
Detailed Description
ofPath is a way to create a path or multiple paths consisting of points. It allows you to combine multiple paths consisting of points into a single vector data object that can be drawn to the screen, manipulated point by point, or manipulated with it's child subpaths. It is better at representing and manipulating complex shapes than the ofPolyline and more easily represents multiple child lines or shapes as either ofSubPath or ofPolyline instances. By default ofPath uses ofSubPath instances. Closing the path automatically creates a new path:
To use ofPolyline instances, simply set the mode to POLYLINES
Member Enumeration Documentation
◆ Mode
enum ofPath::Mode |
Constructor & Destructor Documentation
◆ ofPath()
ofPath::ofPath | ( | ) |
Create a new ofPath instance.
Member Function Documentation
◆ append()
void ofPath::append | ( | const ofPath & | path | ) |
◆ arc() [1/6]
void ofPath::arc | ( | const glm::vec2 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
◆ arc() [2/6]
void ofPath::arc | ( | const glm::vec2 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd, | ||
bool | clockwise | ||
) |
◆ arc() [3/6]
void ofPath::arc | ( | const glm::vec3 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
Create an arc at centre, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd. To draw a circle with a radius of 50 pixels at 100, 100:
- Note
- angleBegin needs to be larger than angleEnd, i.e. 0,180 is ok, while 180,0 is not.
◆ arc() [4/6]
void ofPath::arc | ( | const glm::vec3 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd, | ||
bool | clockwise | ||
) |
◆ arc() [5/6]
void ofPath::arc | ( | float | x, |
float | y, | ||
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
Create an arc at x,y, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd. To draws a shape with a radius of 200 pixels at 300, 300:
- Note
- angleBegin needs to be larger than angleEnd, i.e. 0, 180 is ok, while 180,0 is not.
◆ arc() [6/6]
void ofPath::arc | ( | float | x, |
float | y, | ||
float | z, | ||
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
Create an arc at x,y,z, which has the radiusX, radiusY, and begins at angleBegin and ends at angleEnd.
◆ arcNegative() [1/4]
void ofPath::arcNegative | ( | const glm::vec2 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
◆ arcNegative() [2/4]
void ofPath::arcNegative | ( | const glm::vec3 & | centre, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
◆ arcNegative() [3/4]
void ofPath::arcNegative | ( | float | x, |
float | y, | ||
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
◆ arcNegative() [4/4]
void ofPath::arcNegative | ( | float | x, |
float | y, | ||
float | z, | ||
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd | ||
) |
◆ bezierTo() [1/4]
void ofPath::bezierTo | ( | const glm::vec2 & | cp1, |
const glm::vec2 & | cp2, | ||
const glm::vec2 & | p | ||
) |
◆ bezierTo() [2/4]
void ofPath::bezierTo | ( | const glm::vec3 & | cp1, |
const glm::vec3 & | cp2, | ||
const glm::vec3 & | p | ||
) |
Create a cubic bezier line from the current drawing point with the 2 control points indicated by glm::vec3 cp1
and cp2
, that ends at glm::vec3 to.
The control points are shown in red.
◆ bezierTo() [3/4]
void ofPath::bezierTo | ( | float | cx1, |
float | cy1, | ||
float | cx2, | ||
float | cy2, | ||
float | x, | ||
float | y | ||
) |
Create a cubic bezier line from the current drawing point with the 2 control points indicated by the coordinates cx1, cy1 and cx2, cy2, that ends at the coordinates x, y.
◆ bezierTo() [4/4]
void ofPath::bezierTo | ( | float | cx1, |
float | cy1, | ||
float | cz1, | ||
float | cx2, | ||
float | cy2, | ||
float | cz2, | ||
float | x, | ||
float | y, | ||
float | z | ||
) |
Create a cubic bezier line in 3D space from the current drawing point with the 2 control points indicated by the coordinates cx1, cy1, cz1 and cx2, cy2, cz2, that ends at the coordinates x, y, z.
◆ circle() [1/4]
void ofPath::circle | ( | const glm::vec2 & | p, |
float | radius | ||
) |
◆ circle() [2/4]
void ofPath::circle | ( | const glm::vec3 & | p, |
float | radius | ||
) |
◆ circle() [3/4]
void ofPath::circle | ( | float | x, |
float | y, | ||
float | radius | ||
) |
◆ circle() [4/4]
void ofPath::circle | ( | float | x, |
float | y, | ||
float | z, | ||
float | radius | ||
) |
◆ clear()
void ofPath::clear | ( | ) |
Remove all subpaths from the ofPath instance.
◆ close()
void ofPath::close | ( | ) |
Close the current subpath and create a new subpath, either an ofPolyline or ofSubPath by calling newSubPath(), ensuring that the closed path doesn't have new points added to it.
◆ curveTo() [1/4]
void ofPath::curveTo | ( | const glm::vec2 & | p | ) |
◆ curveTo() [2/4]
void ofPath::curveTo | ( | const glm::vec3 & | p | ) |
Draws a curve to p from the current drawing position.
◆ curveTo() [3/4]
void ofPath::curveTo | ( | float | x, |
float | y | ||
) |
Draws a curve to x,y from the current drawing position.
◆ curveTo() [4/4]
void ofPath::curveTo | ( | float | x, |
float | y, | ||
float | z | ||
) |
Draws a curve to x,y,z from the current drawing position.
◆ draw() [1/2]
void ofPath::draw | ( | ) | const |
Draws the path at 0,0. Calling draw() also calls tessellate()
◆ draw() [2/2]
void ofPath::draw | ( | float | x, |
float | y | ||
) | const |
Draws the path at x,y. Calling draw() also calls tessellate()
◆ ellipse() [1/4]
void ofPath::ellipse | ( | const glm::vec2 & | p, |
float | width, | ||
float | height | ||
) |
◆ ellipse() [2/4]
void ofPath::ellipse | ( | const glm::vec3 & | p, |
float | width, | ||
float | height | ||
) |
◆ ellipse() [3/4]
void ofPath::ellipse | ( | float | x, |
float | y, | ||
float | width, | ||
float | height | ||
) |
◆ ellipse() [4/4]
void ofPath::ellipse | ( | float | x, |
float | y, | ||
float | z, | ||
float | width, | ||
float | height | ||
) |
◆ getCircleResolution()
int ofPath::getCircleResolution | ( | ) | const |
◆ getCommands() [1/2]
vector< ofPath::Command > & ofPath::getCommands | ( | ) |
◆ getCommands() [2/2]
const vector< ofPath::Command > & ofPath::getCommands | ( | ) | const |
◆ getCurveResolution()
int ofPath::getCurveResolution | ( | ) | const |
◆ getFillColor()
◆ getMode()
ofPath::Mode ofPath::getMode | ( | ) | const |
◆ getOutline()
const vector< ofPolyline > & ofPath::getOutline | ( | ) | const |
Get an ofPolyline representing the outline of the ofPath.
◆ getStrokeColor()
◆ getStrokeWidth()
float ofPath::getStrokeWidth | ( | ) | const |
Get the stroke width of the ofPath.
The default value is `0
◆ getTessellation()
const ofMesh & ofPath::getTessellation | ( | ) | const |
◆ getUseShapeColor()
bool ofPath::getUseShapeColor | ( | ) | const |
◆ getWindingMode()
ofPolyWindingMode ofPath::getWindingMode | ( | ) | const |
Get the poly winding mode currently in use.
◆ hasOutline()
|
inline |
◆ isFilled()
bool ofPath::isFilled | ( | ) | const |
Get whether the path is using a fill or not.
The default value is true
◆ lineTo() [1/4]
void ofPath::lineTo | ( | const glm::vec2 & | p | ) |
◆ lineTo() [2/4]
void ofPath::lineTo | ( | const glm::vec3 & | p | ) |
Draw a straight line from the current drawing position to the location indicated by p.
◆ lineTo() [3/4]
void ofPath::lineTo | ( | float | x, |
float | y | ||
) |
Draw a straight line from the current drawing position to the location indicated by x,y.
◆ lineTo() [4/4]
void ofPath::lineTo | ( | float | x, |
float | y, | ||
float | z | ||
) |
Draw a straight line from the current drawing position to the location indicated by x,y,z.
◆ moveTo() [1/3]
void ofPath::moveTo | ( | const glm::vec2 & | p | ) |
◆ moveTo() [2/3]
void ofPath::moveTo | ( | const glm::vec3 & | p | ) |
◆ moveTo() [3/3]
void ofPath::moveTo | ( | float | x, |
float | y, | ||
float | z = 0 |
||
) |
◆ newSubPath()
void ofPath::newSubPath | ( | ) |
Create a new subpath, either an ofPolyline instance or an ofSubPath instance. All points added after a call to ofSubPath will be done in the newly created subpath. Calling close() automatically calls create newSubPath(), ensuring that the closed path doesn't have new points added to it.
◆ OF_DEPRECATED_MSG() [1/4]
ofPath::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
void | rotatefloat degrees, const glm::vec2 &axis | ||
) |
◆ OF_DEPRECATED_MSG() [2/4]
ofPath::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
void | rotatefloat degrees, const glm::vec3 &axis | ||
) |
◆ OF_DEPRECATED_MSG() [3/4]
ofPath::OF_DEPRECATED_MSG | ( | "Use getCircleResolution instead." | , |
int getArcResolution() const | |||
) |
◆ OF_DEPRECATED_MSG() [4/4]
ofPath::OF_DEPRECATED_MSG | ( | "Use setCircleResolution instead." | , |
void | setArcResolutionint res | ||
) |
◆ quadBezierTo() [1/4]
void ofPath::quadBezierTo | ( | const glm::vec2 & | cp1, |
const glm::vec2 & | cp2, | ||
const glm::vec2 & | p | ||
) |
◆ quadBezierTo() [2/4]
void ofPath::quadBezierTo | ( | const glm::vec3 & | cp1, |
const glm::vec3 & | cp2, | ||
const glm::vec3 & | p | ||
) |
Create a quadratic bezier line in 3D space from the current drawing point with the beginning indicated by the coordinates cx1, cy1, cz1, the control point at cx2, cy2, cz2, and that ends at the coordinates x, y, z.
◆ quadBezierTo() [3/4]
void ofPath::quadBezierTo | ( | float | cx1, |
float | cy1, | ||
float | cx2, | ||
float | cy2, | ||
float | x, | ||
float | y | ||
) |
Creates a quadratic bezier line in 2D space from the current drawing point with the beginning indicated by the point p1, the control point at p2, and that ends at the point p3.
◆ quadBezierTo() [4/4]
void ofPath::quadBezierTo | ( | float | cx1, |
float | cy1, | ||
float | cz1, | ||
float | cx2, | ||
float | cy2, | ||
float | cz2, | ||
float | x, | ||
float | y, | ||
float | z | ||
) |
Creates a quadratic bezier line in 3D space from the current drawing point with the beginning indicated by the coordinates cx1, cy1, the control point at cx2, cy2, and that ends at the coordinates x, y.
◆ rectangle() [1/5]
void ofPath::rectangle | ( | const glm::vec2 & | p, |
float | w, | ||
float | h | ||
) |
◆ rectangle() [2/5]
void ofPath::rectangle | ( | const glm::vec3 & | p, |
float | w, | ||
float | h | ||
) |
◆ rectangle() [3/5]
void ofPath::rectangle | ( | const ofRectangle & | r | ) |
◆ rectangle() [4/5]
void ofPath::rectangle | ( | float | x, |
float | y, | ||
float | w, | ||
float | h | ||
) |
◆ rectangle() [5/5]
void ofPath::rectangle | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h | ||
) |
◆ rectRounded() [1/8]
void ofPath::rectRounded | ( | const glm::vec2 & | p, |
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ rectRounded() [2/8]
void ofPath::rectRounded | ( | const glm::vec2 & | p, |
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ rectRounded() [3/8]
void ofPath::rectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ rectRounded() [4/8]
void ofPath::rectRounded | ( | const glm::vec3 & | p, |
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ rectRounded() [5/8]
void ofPath::rectRounded | ( | const ofRectangle & | b, |
float | r | ||
) |
◆ rectRounded() [6/8]
void ofPath::rectRounded | ( | const ofRectangle & | b, |
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ rectRounded() [7/8]
void ofPath::rectRounded | ( | float | x, |
float | y, | ||
float | w, | ||
float | h, | ||
float | r | ||
) |
◆ rectRounded() [8/8]
void ofPath::rectRounded | ( | float | x, |
float | y, | ||
float | z, | ||
float | w, | ||
float | h, | ||
float | topLeftRadius, | ||
float | topRightRadius, | ||
float | bottomRightRadius, | ||
float | bottomLeftRadius | ||
) |
◆ rotateDeg() [1/2]
void ofPath::rotateDeg | ( | float | degrees, |
const glm::vec2 & | axis | ||
) |
◆ rotateDeg() [2/2]
void ofPath::rotateDeg | ( | float | degrees, |
const glm::vec3 & | axis | ||
) |
◆ rotateRad() [1/2]
void ofPath::rotateRad | ( | float | radians, |
const glm::vec2 & | axis | ||
) |
◆ rotateRad() [2/2]
void ofPath::rotateRad | ( | float | radians, |
const glm::vec3 & | axis | ||
) |
◆ scale()
void ofPath::scale | ( | float | x, |
float | y | ||
) |
Change the size of either the ofPolyline or ofSubPath instances that the ofPath contains. These changes are non-reversible, so for instance scaling by 0,0 zeros out all data.
◆ setCircleResolution()
void ofPath::setCircleResolution | ( | int | circleResolution | ) |
◆ setColor()
void ofPath::setColor | ( | const ofColor & | color | ) |
Set the color of the path. This affects both the line if the path is drawn as wireframe and the fill if the path is drawn with fill. All subpaths are affected.
◆ setCurveResolution()
void ofPath::setCurveResolution | ( | int | curveResolution | ) |
◆ setFillColor()
void ofPath::setFillColor | ( | const ofColor & | color | ) |
Set the fill color of the path. This has no affect if the path is drawn as wireframe.
◆ setFilled()
void ofPath::setFilled | ( | bool | hasFill | ) |
Set whether the path should be drawn as wireframes or filled.
◆ setFillHexColor()
void ofPath::setFillHexColor | ( | int | hex | ) |
Set the fill color of the path. This has no affect if the path is drawn as wireframe.
◆ setHexColor()
void ofPath::setHexColor | ( | int | hex | ) |
Set the color of the path. This affects both the line if the path is drawn as wireframe and the fill if the path is drawn with fill. All subpaths are affected.
◆ setMode()
void ofPath::setMode | ( | Mode | mode | ) |
◆ setPolyWindingMode()
void ofPath::setPolyWindingMode | ( | ofPolyWindingMode | mode | ) |
Set the way that the points in the sub paths are connected.
OpenGL can only render convex polygons which means that any shape that isn't convex, i.e. that has points which are concave, going inwards, need to be tessellated into triangles so that OpenGL can render them. If you're using filled shapes with your ofPath this is done automatically for you.
The possible options you can pass in are:
OF_POLY_WINDING_ODD OF_POLY_WINDING_NONZERO OF_POLY_WINDING_POSITIVE OF_POLY_WINDING_NEGATIVE OF_POLY_WINDING_ABS_GEQ_TWO
◆ setStrokeColor()
void ofPath::setStrokeColor | ( | const ofColor & | color | ) |
Set the stroke color of the path. This has no affect if the path is drawn filled.
◆ setStrokeHexColor()
void ofPath::setStrokeHexColor | ( | int | hex | ) |
Set the stroke color of the path. This has no affect if the path is drawn filled.
◆ setStrokeWidth()
void ofPath::setStrokeWidth | ( | float | width | ) |
Set the stroke width of the line if the ofPath is to be drawn not in wireframe.
◆ setUseShapeColor()
void ofPath::setUseShapeColor | ( | bool | useColor | ) |
◆ simplify()
void ofPath::simplify | ( | float | tolerance = 0.3f | ) |
◆ tessellate()
void ofPath::tessellate | ( | ) |
◆ translate() [1/2]
void ofPath::translate | ( | const glm::vec2 & | p | ) |
◆ translate() [2/2]
void ofPath::translate | ( | const glm::vec3 & | p | ) |
◆ triangle() [1/4]
void ofPath::triangle | ( | const glm::vec2 & | p1, |
const glm::vec2 & | p2, | ||
const glm::vec2 & | p3 | ||
) |
◆ triangle() [2/4]
void ofPath::triangle | ( | const glm::vec3 & | p1, |
const glm::vec3 & | p2, | ||
const glm::vec3 & | p3 | ||
) |
◆ triangle() [3/4]
void ofPath::triangle | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
◆ triangle() [4/4]
void ofPath::triangle | ( | float | x1, |
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2, | ||
float | x3, | ||
float | y3, | ||
float | z3 | ||
) |
The documentation for this class was generated from the following files:
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/graphics/ofPath.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/graphics/ofPath.cpp