This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
#include <ofPolyline.h>
Public Types | |
using | VertexType = T |
Public Member Functions | |
Add and Remove Vertices | |
void | clear () |
Removes all the points from the ofPolyline. | |
void | addVertex (const T &p) |
Adds a point using an T at the end of the ofPolyline. | |
void | addVertex (float x, float y, float z=0) |
Adds a point using floats at the end of the ofPolyline. | |
void | addVertices (const std::vector< T > &verts) |
Add multiple points at the end of the ofPolyline using a vector of T objects. | |
void | addVertices (const T *verts, int numverts) |
Adds multiple points at the end of the ofPolyline using a pointer to an array of T objects. | |
void | insertVertex (const T &p, int index) |
void | insertVertex (float x, float y, float z, int index) |
void | removeVertex (int index) |
Remove a vertex at a given index. | |
void | resize (size_t size) |
Resize the number of points in the ofPolyline to the value passed in. | |
Access Vertices | |
size_t | size () const |
The number of points in the ofPolyline. | |
const T & | operator[] (int index) const |
T & | operator[] (int index) |
std::vector< T > & | getVertices () |
Gets a vector of vertices that the line contains. | |
const std::vector< T > & | getVertices () const |
std::vector< T >::iterator | begin () |
std::vector< T >::const_iterator | begin () const |
std::vector< T >::reverse_iterator | rbegin () |
std::vector< T >::const_reverse_iterator | rbegin () const |
std::vector< T >::iterator | end () |
std::vector< T >::const_iterator | end () const |
std::vector< T >::reverse_iterator | rend () |
std::vector< T >::const_reverse_iterator | rend () const |
Lines and Curves | |
void | lineTo (const T &to) |
Add a straight line from the last point added, or from 0,0 if no point is set, to the point indicated by the T passesd in. | |
void | lineTo (float x, float y, float z=0) |
Add a straight line from the last point added, or from 0,0 if no point is set, to the point indicated by the floats x,y,z passesd in. | |
void | arc (const T ¢er, float radiusX, float radiusY, float angleBegin, float angleEnd, bool clockwise, int circleResolution=20) |
Adds an arc around the T center with the width of radiusX and the height of radiusY to the polyline. | |
void | arc (const T ¢er, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
Adds an arc around the T center with the width of radiusX and the height of radiusY . | |
void | arc (float x, float y, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
Adds an arc around the coordinates (x ,y ) with the width of radiusX and the height of radiusY . | |
void | arc (float x, float y, float z, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
Adds an arc around the coordinates (x ,y ,z ) with the width of radiusX and the height of radiusY . | |
void | arcNegative (const T ¢er, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
void | arcNegative (float x, float y, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
void | arcNegative (float x, float y, float z, float radiusX, float radiusY, float angleBegin, float angleEnd, int circleResolution=20) |
void | curveTo (const T &to, int curveResolution=20) |
Adds a curve to an T object passed in. | |
void | curveTo (float x, float y, float z=0, int curveResolution=20) |
Adds a curve to the x,y,z points passed in with the optional resolution. | |
void | bezierTo (const T &cp1, const T &cp2, const T &to, int curveResolution=20) |
Adds a cubic bezier line from the current drawing point with the 2 control points indicated by T cp1 and cp2, that ends at T to. | |
void | bezierTo (float cx1, float cy1, float cx2, float cy2, float x, float y, int curveResolution=20) |
Adds 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, int curveResolution=20) |
Adds 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 (float cx1, float cy1, float cz1, float cx2, float cy2, float cz2, float x, float y, float z, int curveResolution=20) |
Adds 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 T &p1, const T &p2, const T &p3, int curveResolution=20) |
Adds 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 cx2, float cy2, float x, float y, int curveResolution=20) |
Adds a quadratic bezier line in 2D 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. | |
Smoothing and Resampling | |
ofPolyline_ | getSmoothed (int smoothingSize, float smoothingShape=0) const |
Gets a smoothed version of the ofPolyline. | |
ofPolyline_ | getResampledBySpacing (float spacing) const |
Resamples the line based on the spacing passed in. The larger the spacing, the more points will be eliminated. | |
ofPolyline_ | getResampledByCount (int count) const |
Resamples the line based on the count passed in. The lower the count passed in, the more points will be eliminated. | |
void | simplify (float tolerance=0.3f) |
Simplifies the polyline, removing un-necessary vertices. | |
Transform polyline | |
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::vec3 &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 | translate (const glm::vec2 &p) |
void | scale (float x, float y) |
Change the size of the ofPolyline These changes are non-reversible, so for instance scaling by 0,0 zeros out all data. | |
Polyline State | |
void | close () |
Closes the ofPolyline, meaning that all the vertices will be linked and can be "walked". | |
void | setClosed (bool tf) |
Closes the ofPolyline, meaning that all the vertices will be linked and can be "walked". | |
bool | isClosed () const |
bool | hasChanged () |
Returns whether the vertices within the line have changed. | |
void | flagHasChanged () |
Other Functions | |
float | getIndexAtLength (float f) const |
Get (interpolated) index at given length along the path. | |
float | getIndexAtPercent (float f) const |
Get (interpolated) index at given percentage along the path. | |
float | getLengthAtIndex (int index) const |
Get length along path at index. | |
float | getLengthAtIndexInterpolated (float findex) const |
Get length along path at interpolated index (e.g. f=5.75 => 75% along the path between 5th and 6th points) | |
T | getPointAtLength (float f) const |
Get point long the path at a given length (e.g. f=150 => 150 units along the path) | |
T | getPointAtPercent (float f) const |
Get point along the path at a given percentage (e.g. f=0.25 => 25% along the path) | |
T | getPointAtIndexInterpolated (float findex) const |
Get point along the path at interpolated index (e.g. f=5.75 => 75% along the path between 5th and 6th points) | |
OF_DEPRECATED_MSG ("Use Deg/Rad versions.", float getAngleAtIndex(int index) const) | |
Get angle (degrees) of the path at index. | |
OF_DEPRECATED_MSG ("Use Deg/Rad versions.", float getAngleAtIndexInterpolated(float findex) const) | |
Get angle (degrees) at interpolated index (interpolated between neighboring indices) | |
T | getRotationAtIndex (int index) const |
Get rotation vector at index (magnitude is sine of angle) | |
T | getRotationAtIndexInterpolated (float findex) const |
Get rotation vector at interpolated index (interpolated between neighboring indices) (magnitude is sine of angle) | |
float | getDegreesAtIndex (int index) const |
Get angle (degrees) of the path at index. | |
float | getDegreesAtIndexInterpolated (float findex) const |
Get angle (degrees) at interpolated index (interpolated between neighboring indices) | |
float | getRadiansAtIndex (int index) const |
Get angle (degrees) of the path at index. | |
float | getRadiansAtIndexInterpolated (float findex) const |
Get angle (degrees) at interpolated index (interpolated between neighboring indices) | |
T | getTangentAtIndex (int index) const |
Get tangent vector at index. | |
T | getTangentAtIndexInterpolated (float findex) const |
Get tangent vector at interpolated index (interpolated between neighboring indices) | |
T | getNormalAtIndex (int index) const |
Get normal vector at index. | |
T | getNormalAtIndexInterpolated (float findex) const |
Get normal vector at interpolated index (interpolated between neighboring indices) | |
int | getWrappedIndex (int index) const |
Get wrapped index depending on whether poly is closed or not. | |
void | setRightVector (T v=T(0, 0, -1)) |
T | getRightVector () const |
Drawing | |
void | draw () const |
Draw the line using the current renderer. | |
Constructors | |
ofPolyline_ () | |
Creates an ofPolyline. | |
ofPolyline_ (const std::vector< T > &verts) | |
Creates an ofPolyline from a vector of glm::vec2 or T objects. | |
static ofPolyline_ | fromRectangle (const ofRectangle &rect) |
Geometric Functions | |
bool | inside (float x, float y) const |
Tests whether the x,y coordinates are within a closed ofPolyline. | |
bool | inside (const T &p) const |
Tests whether the T is within a closed ofPolyline. | |
ofRectangle | getBoundingBox () const |
Get the bounding box of the polyline , taking into account all the points to determine the extents of the polyline. | |
float | getPerimeter () const |
Gets the size of the perimeter of the polyline, good for determining length of the line, rather than just the bounding box shape. | |
float | getArea () const |
Gets the precise area bounded by the line. | |
T | getCentroid2D () const |
Get the center of the area bounded by the line. | |
T | getClosestPoint (const T &target, unsigned int *nearestIndex=nullptr) const |
Gets the point on the line closest to the target. You can also optionally pass a pointer to/address of an unsigned int to get the index of the closest vertex. | |
static bool | inside (float x, float y, const ofPolyline_ &polyline) |
Tests whether the x,y coordinates are within a closed ofPolyline. | |
static bool | inside (const T &p, const ofPolyline_ &polyline) |
Tests whether the T is within a closed ofPolyline. | |
Member Typedef Documentation
◆ VertexType
using ofPolyline_< T >::VertexType = T |
Constructor & Destructor Documentation
◆ ofPolyline_() [1/2]
ofPolyline_< T >::ofPolyline_ | ( | ) |
Creates an ofPolyline.
◆ ofPolyline_() [2/2]
ofPolyline_< T >::ofPolyline_ | ( | const std::vector< T > & | verts | ) |
Creates an ofPolyline from a vector of glm::vec2 or T objects.
Member Function Documentation
◆ addVertex() [1/2]
void ofPolyline_< T >::addVertex | ( | const T & | p | ) |
Adds a point using an T at the end of the ofPolyline.
◆ addVertex() [2/2]
void ofPolyline_< T >::addVertex | ( | float | x, |
float | y, | ||
float | z = 0 |
||
) |
Adds a point using floats at the end of the ofPolyline.
◆ addVertices() [1/2]
void ofPolyline_< T >::addVertices | ( | const std::vector< T > & | verts | ) |
Add multiple points at the end of the ofPolyline using a vector of T objects.
◆ addVertices() [2/2]
void ofPolyline_< T >::addVertices | ( | const T * | verts, |
int | numverts | ||
) |
Adds multiple points at the end of the ofPolyline using a pointer to an array of T objects.
◆ arc() [1/4]
void ofPolyline_< T >::arc | ( | const T & | center, |
float | radiusX, | ||
float | radiusY, | ||
float | angleBegin, | ||
float | angleEnd, | ||
bool | clockwise, | ||
int | circleResolution = 20 |
||
) |
Adds an arc around the T center
with the width of radiusX
and the height of radiusY
to the polyline.
The angleBegin
and angleEnd
indicate the start and end angles of the arc in degrees measured clockwise from the x-axis.
The clockwise
boolean sets the drawing direction. Passing 'false' to it will draw the arc counter-clockwise.
Optionally, you can specify circleResolution
, which is the number of line segments a circle would be drawn with.
If the arc doesn't start at the same point the last vertex finished a straight line will be created to join both
◆ arc() [2/4]
|
inline |
Adds an arc around the T center
with the width of radiusX
and the height of radiusY
.
The angleBegin
and angleEnd
indicate the start and end angles of the arc in degrees measured clockwise from the x-axis.
Optionally, you can specify circleResolution
, which is the number of line segments a circle would be drawn with. A partial arc will be drawn with the same resolution: if circleResolution == 20, a half- circle will be drawn with 10 segments.
If there are already vertexes in the ofPolyline the arc will extend them; a line will be created from the endmost point on the ofPolyline to the beginning point of the arc.
◆ arc() [3/4]
|
inline |
Adds an arc around the coordinates (x
,y
) with the width of radiusX
and the height of radiusY
.
The angleBegin
and angleEnd
indicate the start and end angles of the arc in degrees measured clockwise from the x-axis.
Optionally, you can specify circleResolution
, which is the number of line segments a circle would be drawn with.
◆ arc() [4/4]
|
inline |
Adds an arc around the coordinates (x
,y
,z
) with the width of radiusX
and the height of radiusY
.
The angleBegin
and angleEnd
indicate the start and end angles of the arc in degrees measured clockwise from the x-axis.
Optionally, you can specify circleResolution
, which is the number of line segments a circle would be drawn with.
◆ arcNegative() [1/3]
|
inline |
◆ arcNegative() [2/3]
|
inline |
◆ arcNegative() [3/3]
|
inline |
◆ begin() [1/2]
std::vector< T >::iterator ofPolyline_< T >::begin | ( | ) |
◆ begin() [2/2]
std::vector< T >::const_iterator ofPolyline_< T >::begin | ( | ) | const |
◆ bezierTo() [1/3]
void ofPolyline_< T >::bezierTo | ( | const T & | cp1, |
const T & | cp2, | ||
const T & | to, | ||
int | curveResolution = 20 |
||
) |
Adds a cubic bezier line from the current drawing point with the 2 control points indicated by T cp1 and cp2, that ends at T to.
The control points are shown in red.
◆ bezierTo() [2/3]
|
inline |
Adds 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() [3/3]
|
inline |
Adds 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.
◆ clear()
void ofPolyline_< T >::clear | ( | ) |
Removes all the points from the ofPolyline.
◆ close()
void ofPolyline_< T >::close | ( | ) |
Closes the ofPolyline, meaning that all the vertices will be linked and can be "walked".
◆ curveTo() [1/2]
void ofPolyline_< T >::curveTo | ( | const T & | to, |
int | curveResolution = 20 |
||
) |
Adds a curve to an T object passed in.
- Note
- You need at least 4 points to be able to use curveTo()
- See also
- Catmull-Rom splines wiki
◆ curveTo() [2/2]
|
inline |
Adds a curve to the x,y,z points passed in with the optional resolution.
◆ draw()
void ofPolyline_< T >::draw | ( | ) | const |
Draw the line using the current renderer.
◆ end() [1/2]
std::vector< T >::iterator ofPolyline_< T >::end | ( | ) |
◆ end() [2/2]
std::vector< T >::const_iterator ofPolyline_< T >::end | ( | ) | const |
◆ flagHasChanged()
void ofPolyline_< T >::flagHasChanged | ( | ) |
◆ fromRectangle()
|
static |
◆ getArea()
float ofPolyline_< T >::getArea | ( | ) | const |
Gets the precise area bounded by the line.
◆ getBoundingBox()
ofRectangle ofPolyline_< T >::getBoundingBox | ( | ) | const |
Get the bounding box of the polyline , taking into account all the points to determine the extents of the polyline.
◆ getCentroid2D()
T ofPolyline_< T >::getCentroid2D | ( | ) | const |
Get the center of the area bounded by the line.
◆ getClosestPoint()
T ofPolyline_< T >::getClosestPoint | ( | const T & | target, |
unsigned int * | nearestIndex = nullptr |
||
) | const |
Gets the point on the line closest to the target. You can also optionally pass a pointer to/address of an unsigned int to get the index of the closest vertex.
◆ getDegreesAtIndex()
float ofPolyline_< T >::getDegreesAtIndex | ( | int | index | ) | const |
Get angle (degrees) of the path at index.
◆ getDegreesAtIndexInterpolated()
float ofPolyline_< T >::getDegreesAtIndexInterpolated | ( | float | findex | ) | const |
Get angle (degrees) at interpolated index (interpolated between neighboring indices)
◆ getIndexAtLength()
float ofPolyline_< T >::getIndexAtLength | ( | float | f | ) | const |
Get (interpolated) index at given length along the path.
Includes info on percentage along segment, e.g. ret=5.75
=> 75% along the path between 5th and 6th points
◆ getIndexAtPercent()
float ofPolyline_< T >::getIndexAtPercent | ( | float | f | ) | const |
Get (interpolated) index at given percentage along the path.
Includes info on percentage along segment, e.g. ret=5.75
=> 75% along the path between 5th and 6th points
◆ getLengthAtIndex()
float ofPolyline_< T >::getLengthAtIndex | ( | int | index | ) | const |
Get length along path at index.
◆ getLengthAtIndexInterpolated()
float ofPolyline_< T >::getLengthAtIndexInterpolated | ( | float | findex | ) | const |
Get length along path at interpolated index (e.g. f=5.75
=> 75% along the path between 5th and 6th points)
◆ getNormalAtIndex()
T ofPolyline_< T >::getNormalAtIndex | ( | int | index | ) | const |
Get normal vector at index.
◆ getNormalAtIndexInterpolated()
T ofPolyline_< T >::getNormalAtIndexInterpolated | ( | float | findex | ) | const |
Get normal vector at interpolated index (interpolated between neighboring indices)
◆ getPerimeter()
float ofPolyline_< T >::getPerimeter | ( | ) | const |
Gets the size of the perimeter of the polyline, good for determining length of the line, rather than just the bounding box shape.
◆ getPointAtIndexInterpolated()
T ofPolyline_< T >::getPointAtIndexInterpolated | ( | float | findex | ) | const |
Get point along the path at interpolated index (e.g. f=5.75
=> 75% along the path between 5th and 6th points)
◆ getPointAtLength()
T ofPolyline_< T >::getPointAtLength | ( | float | f | ) | const |
Get point long the path at a given length (e.g. f=150
=> 150 units along the path)
◆ getPointAtPercent()
T ofPolyline_< T >::getPointAtPercent | ( | float | f | ) | const |
Get point along the path at a given percentage (e.g. f=0.25
=> 25% along the path)
◆ getRadiansAtIndex()
float ofPolyline_< T >::getRadiansAtIndex | ( | int | index | ) | const |
Get angle (degrees) of the path at index.
◆ getRadiansAtIndexInterpolated()
float ofPolyline_< T >::getRadiansAtIndexInterpolated | ( | float | findex | ) | const |
Get angle (degrees) at interpolated index (interpolated between neighboring indices)
◆ getResampledByCount()
ofPolyline_< T > ofPolyline_< T >::getResampledByCount | ( | int | count | ) | const |
Resamples the line based on the count passed in. The lower the count passed in, the more points will be eliminated.
This doesn't add new points to the line.
◆ getResampledBySpacing()
ofPolyline_< T > ofPolyline_< T >::getResampledBySpacing | ( | float | spacing | ) | const |
Resamples the line based on the spacing passed in. The larger the spacing, the more points will be eliminated.
◆ getRightVector()
T ofPolyline_< T >::getRightVector | ( | ) | const |
◆ getRotationAtIndex()
T ofPolyline_< T >::getRotationAtIndex | ( | int | index | ) | const |
Get rotation vector at index (magnitude is sine of angle)
◆ getRotationAtIndexInterpolated()
T ofPolyline_< T >::getRotationAtIndexInterpolated | ( | float | findex | ) | const |
Get rotation vector at interpolated index (interpolated between neighboring indices) (magnitude is sine of angle)
◆ getSmoothed()
ofPolyline_< T > ofPolyline_< T >::getSmoothed | ( | int | smoothingSize, |
float | smoothingShape = 0 |
||
) | const |
Gets a smoothed version of the ofPolyline.
smoothingSize
is the size of the smoothing window. So if smoothingSize
is 2, then 2 points from the left, 1 in the center, and 2 on the right (5 total) will be used for smoothing each point. smoothingShape
describes whether to use a triangular window (0) or box window (1) or something in between (for example, .5).
◆ getTangentAtIndex()
T ofPolyline_< T >::getTangentAtIndex | ( | int | index | ) | const |
Get tangent vector at index.
◆ getTangentAtIndexInterpolated()
T ofPolyline_< T >::getTangentAtIndexInterpolated | ( | float | findex | ) | const |
Get tangent vector at interpolated index (interpolated between neighboring indices)
◆ getVertices() [1/2]
std::vector< T > & ofPolyline_< T >::getVertices | ( | ) |
Gets a vector of vertices that the line contains.
◆ getVertices() [2/2]
const std::vector< T > & ofPolyline_< T >::getVertices | ( | ) | const |
◆ getWrappedIndex()
int ofPolyline_< T >::getWrappedIndex | ( | int | index | ) | const |
Get wrapped index depending on whether poly is closed or not.
◆ hasChanged()
bool ofPolyline_< T >::hasChanged | ( | ) |
Returns whether the vertices within the line have changed.
◆ insertVertex() [1/2]
void ofPolyline_< T >::insertVertex | ( | const T & | p, |
int | index | ||
) |
◆ insertVertex() [2/2]
void ofPolyline_< T >::insertVertex | ( | float | x, |
float | y, | ||
float | z, | ||
int | index | ||
) |
◆ inside() [1/4]
bool ofPolyline_< T >::inside | ( | const T & | p | ) | const |
Tests whether the T is within a closed ofPolyline.
◆ inside() [2/4]
|
static |
Tests whether the T is within a closed ofPolyline.
◆ inside() [3/4]
bool ofPolyline_< T >::inside | ( | float | x, |
float | y | ||
) | const |
Tests whether the x,y coordinates are within a closed ofPolyline.
◆ inside() [4/4]
|
static |
Tests whether the x,y coordinates are within a closed ofPolyline.
◆ isClosed()
bool ofPolyline_< T >::isClosed | ( | ) | const |
◆ lineTo() [1/2]
|
inline |
Add a straight line from the last point added, or from 0,0 if no point is set, to the point indicated by the T passesd in.
◆ lineTo() [2/2]
|
inline |
Add a straight line from the last point added, or from 0,0 if no point is set, to the point indicated by the floats x,y,z passesd in.
◆ OF_DEPRECATED_MSG() [1/4]
ofPolyline_< T >::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
float getAngleAtIndex(int index) const | |||
) |
Get angle (degrees) of the path at index.
◆ OF_DEPRECATED_MSG() [2/4]
ofPolyline_< T >::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
float getAngleAtIndexInterpolated(float findex) const | |||
) |
Get angle (degrees) at interpolated index (interpolated between neighboring indices)
◆ OF_DEPRECATED_MSG() [3/4]
ofPolyline_< T >::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
void | rotatefloat degrees, const glm::vec2 &axis | ||
) |
◆ OF_DEPRECATED_MSG() [4/4]
ofPolyline_< T >::OF_DEPRECATED_MSG | ( | "Use Deg/Rad versions." | , |
void | rotatefloat degrees, const glm::vec3 &axis | ||
) |
◆ operator[]() [1/2]
T & ofPolyline_< T >::operator[] | ( | int | index | ) |
◆ operator[]() [2/2]
const T & ofPolyline_< T >::operator[] | ( | int | index | ) | const |
Allows you to access the points of the ofPolyline just like you would in an array, so to make the points of a line follow the mouse movement, you could do:
◆ quadBezierTo() [1/3]
|
inline |
Adds 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() [2/3]
|
inline |
Adds a quadratic bezier line in 2D 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.
◆ quadBezierTo() [3/3]
void ofPolyline_< T >::quadBezierTo | ( | float | cx1, |
float | cy1, | ||
float | cz1, | ||
float | cx2, | ||
float | cy2, | ||
float | cz2, | ||
float | x, | ||
float | y, | ||
float | z, | ||
int | curveResolution = 20 |
||
) |
Adds 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.
◆ rbegin() [1/2]
std::vector< T >::reverse_iterator ofPolyline_< T >::rbegin | ( | ) |
◆ rbegin() [2/2]
std::vector< T >::const_reverse_iterator ofPolyline_< T >::rbegin | ( | ) | const |
◆ removeVertex()
void ofPolyline_< T >::removeVertex | ( | int | index | ) |
Remove a vertex at a given index.
This function print an error and ignore the input if the index is invalid. When a vertex is removed, the internal caches are cleared.
- Parameters
-
index The index of the vertex to remove.
◆ rend() [1/2]
std::vector< T >::reverse_iterator ofPolyline_< T >::rend | ( | ) |
◆ rend() [2/2]
std::vector< T >::const_reverse_iterator ofPolyline_< T >::rend | ( | ) | const |
◆ resize()
void ofPolyline_< T >::resize | ( | size_t | size | ) |
Resize the number of points in the ofPolyline to the value passed in.
◆ rotateDeg() [1/2]
void ofPolyline_< T >::rotateDeg | ( | float | degrees, |
const glm::vec2 & | axis | ||
) |
◆ rotateDeg() [2/2]
void ofPolyline_< T >::rotateDeg | ( | float | degrees, |
const glm::vec3 & | axis | ||
) |
◆ rotateRad() [1/2]
void ofPolyline_< T >::rotateRad | ( | float | radians, |
const glm::vec2 & | axis | ||
) |
◆ rotateRad() [2/2]
void ofPolyline_< T >::rotateRad | ( | float | radians, |
const glm::vec3 & | axis | ||
) |
◆ scale()
void ofPolyline_< T >::scale | ( | float | x, |
float | y | ||
) |
Change the size of the ofPolyline These changes are non-reversible, so for instance scaling by 0,0 zeros out all data.
◆ setClosed()
void ofPolyline_< T >::setClosed | ( | bool | tf | ) |
Closes the ofPolyline, meaning that all the vertices will be linked and can be "walked".
◆ setRightVector()
void ofPolyline_< T >::setRightVector | ( | T | v = T(0, 0, -1) | ) |
◆ simplify()
void ofPolyline_< T >::simplify | ( | float | tolerance = 0.3f | ) |
Simplifies the polyline, removing un-necessary vertices.
- Parameters
-
tolerance determines how dis-similar points need to be to stay in the line. Higher tolerance means more points removed, lower tolerance means less points removed.
◆ size()
size_t ofPolyline_< T >::size | ( | ) | const |
The number of points in the ofPolyline.
◆ translate() [1/2]
void ofPolyline_< T >::translate | ( | const glm::vec2 & | p | ) |
◆ translate() [2/2]
void ofPolyline_< T >::translate | ( | const glm::vec3 & | p | ) |
The documentation for this class was generated from the following files:
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/graphics/ofGraphicsBaseTypes.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/graphics/ofPolyline.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/graphics/ofPolyline.inl