LayOut C API
|
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>
Go to the source code of this file.
Enumerations | |
enum | LOPathPointType { LOPathPointType_MoveTo = 0, LOPathPointType_LineTo, LOPathPointType_BezierTo, LOPathPointType_ArcCenter, LOPathPointType_BezierControl, LOPathPointType_Close, LONumPathPointTypes } |
Defines how a point is to be interpreted in a path entity. More... | |
enum | LOPathWindingType { LOPathWindingType_None = 0, LOPathWindingType_Clockwise, LOPathWindingType_CounterClockwise, LONumPathWindingTypes } |
Defines the winding direction of the path. More... | |
Functions | |
LO_RESULT | LOPathCreate (LOPathRef *path, const LOPoint2D *start_point, const LOPoint2D *end_point) |
Creates a new path object with a straight line between start_point and end_point. More... | |
LO_RESULT | LOPathCreateBezier (LOPathRef *path, const LOPoint2D *start_point, const LOPoint2D *control_point_1, const LOPoint2D *control_point_2, const LOPoint2D *end_point) |
Creates a new path object with a Bezier curve between start_point and end_point. More... | |
LO_RESULT | LOPathCreateFromRectangle (LOPathRef *path, LORectangleRef rectangle) |
Creates a new path object representing the same shape as a rectangle object. More... | |
LO_RESULT | LOPathCreateFromEllipse (LOPathRef *path, LOEllipseRef ellipse) |
Creates a new path object representing the same shape as an ellipse object. More... | |
LO_RESULT | LOPathCreateArc (LOPathRef *path, const LOPoint2D *center_point, double radius, double start_angle, double end_angle) |
Creates a new path object representing an arc. More... | |
LO_RESULT | LOPathAddReference (LOPathRef path) |
Adds a reference to a path object. More... | |
LO_RESULT | LOPathRelease (LOPathRef *path) |
Releases a path object. The object will be invalidated if releasing the last reference. More... | |
LO_EXPORT LOPathRef | LOPathFromEntity (LOEntityRef entity) |
Converts from a LOEntityRef to a LOPathRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOPathRef. More... | |
LO_EXPORT LOEntityRef | LOPathToEntity (LOPathRef path) |
Converts from a LOPathRef to a LOEntityRef. This is essentially an upcast operation. More... | |
LO_RESULT | LOPathGetNumberOfPoints (LOPathRef path, size_t *size) |
Gets the number of points in the path. More... | |
LO_RESULT | LOPathGetPoints (LOPathRef path, size_t points_size, LOPoint2D points[], size_t *number_of_points_copied) |
Gets the points in the path. More... | |
LO_RESULT | LOPathGetPointAtIndex (LOPathRef path, size_t point_index, LOPoint2D *point) |
Gets the point in the path at the given index. More... | |
LO_RESULT | LOPathGetPointTypes (LOPathRef path, size_t pointtypes_size, LOPathPointType pointtypes[], size_t *number_of_pointtypes_copied) |
Gets the type of each point in the path. More... | |
LO_RESULT | LOPathGetPointTypeAtIndex (LOPathRef path, size_t point_index, LOPathPointType *pointtype) |
Gets the type of the specified point in the path. More... | |
LO_RESULT | LOPathGetStartPoint (LOPathRef path, LOPoint2D *point) |
Gets the start point for the path. More... | |
LO_RESULT | LOPathGetEndPoint (LOPathRef path, LOPoint2D *point) |
Gets the end point for the path. More... | |
LO_RESULT | LOPathCreateFromStartArrow (LOPathRef *arrow_path, LOPathRef path) |
Creates a new path object in the shape of the start arrow of the given path. More... | |
LO_RESULT | LOPathCreateFromEndArrow (LOPathRef *arrow_path, LOPathRef path) |
Creates a new path object in the shape of the end arrow of the given path. More... | |
LO_RESULT | LOPathGetClosed (LOPathRef path, bool *is_closed) |
Gets whether or not the path is a closed loop. More... | |
LO_RESULT | LOPathGetParametricLength (LOPathRef path, double *parametric_length) |
Gets the length of the path. More... | |
LO_RESULT | LOPathGetPointAtParameter (LOPathRef path, double parametric_value, LOPoint2D *point) |
Gets the point at the given distance along the path. More... | |
LO_RESULT | LOPathGetTangentAtParameter (LOPathRef path, double parametric_value, LOVector2D *tangent) |
Gets the tangent at the given distance along the path. More... | |
LO_RESULT | LOPathGetCircle (LOPathRef path, bool *is_circle, LOPoint2D *center, double *radius) |
Gets whether or not the path represents a circle, and if so, gets the geometric representation of the circle. More... | |
LO_RESULT | LOPathGetArc (LOPathRef path, bool *is_arc, LOPoint2D *center, double *radius, double *start_angle, double *end_angle) |
Gets whether or not the path represents an arc, and if so, gets the geometric representation of the arc. More... | |
LO_RESULT | LOPathAppendLineTo (LOPathRef path, const LOPoint2D *point) |
Adds a point to the end of the path. More... | |
LO_RESULT | LOPathAppendBezierTo (LOPathRef path, const LOPoint2D *control_point_1, const LOPoint2D *control_point_2, const LOPoint2D *point) |
Adds a Bezier point to the end of the path. More... | |
LO_RESULT | LOPathAppendPathTo (LOPathRef path, LOPathRef other_path) |
Appends two paths. This will duplicate other_path and append it to the path. Note that path may be reversed as a result of this operation. More... | |
LO_RESULT | LOPathClose (LOPathRef path) |
Finishes the path loop if the path is not closed. More... | |
LO_RESULT | LOPathGetWindingType (LOPathRef path, LOPathWindingType *winding) |
Returns the winding type of the path. More... | |
enum LOPathPointType |
Defines how a point is to be interpreted in a path entity.
enum LOPathWindingType |
Adds a reference to a path object.
[in] | path | The path object. |
LO_RESULT LOPathAppendBezierTo | ( | LOPathRef | path, |
const LOPoint2D * | control_point_1, | ||
const LOPoint2D * | control_point_2, | ||
const LOPoint2D * | point | ||
) |
Adds a Bezier point to the end of the path.
[in] | path | The path object. |
[in] | control_point_1 | The first control point. |
[in] | control_point_2 | The second control point. |
[in] | point | The point to append. |
Adds a point to the end of the path.
[in] | path | The path object. |
[in] | point | The point to append. |
Appends two paths. This will duplicate other_path and append it to the path. Note that path may be reversed as a result of this operation.
[in] | path | The path object. |
[in] | other_path | The path to append to path. |
Finishes the path loop if the path is not closed.
[in] | path | The path object. |
LO_RESULT LOPathCreate | ( | LOPathRef * | path, |
const LOPoint2D * | start_point, | ||
const LOPoint2D * | end_point | ||
) |
Creates a new path object with a straight line between start_point and end_point.
[out] | path | The path object. |
[in] | start_point | The starting point of the path. |
[in] | end_point | The ending point of the path. |
LO_RESULT LOPathCreateArc | ( | LOPathRef * | path, |
const LOPoint2D * | center_point, | ||
double | radius, | ||
double | start_angle, | ||
double | end_angle | ||
) |
Creates a new path object representing an arc.
[out] | path | The path object. |
[in] | center_point | The center point of the arc. |
[in] | radius | The radius of the arc. |
[in] | start_angle | The start angle of the arc. |
[in] | end_angle | The end angle of the arc. |
LO_RESULT LOPathCreateBezier | ( | LOPathRef * | path, |
const LOPoint2D * | start_point, | ||
const LOPoint2D * | control_point_1, | ||
const LOPoint2D * | control_point_2, | ||
const LOPoint2D * | end_point | ||
) |
Creates a new path object with a Bezier curve between start_point and end_point.
[out] | path | The path object. |
[in] | start_point | The starting point of the path. |
[in] | control_point_1 | The first control point. |
[in] | control_point_2 | The second control point. |
[in] | end_point | The ending point of the path. |
LO_RESULT LOPathCreateFromEllipse | ( | LOPathRef * | path, |
LOEllipseRef | ellipse | ||
) |
Creates a new path object representing the same shape as an ellipse object.
[out] | path | The path object. |
[in] | ellipse | The ellipse object. |
Creates a new path object in the shape of the end arrow of the given path.
[out] | arrow_path | The end arrow as a path. |
[in] | path | The path object. |
LO_RESULT LOPathCreateFromRectangle | ( | LOPathRef * | path, |
LORectangleRef | rectangle | ||
) |
Creates a new path object representing the same shape as a rectangle object.
[out] | path | The path object. |
[in] | rectangle | The rectangle object. |
Creates a new path object in the shape of the start arrow of the given path.
[out] | arrow_path | The start arrow as a path. |
[in] | path | The path object. |
LO_EXPORT LOPathRef LOPathFromEntity | ( | LOEntityRef | entity | ) |
Converts from a LOEntityRef to a LOPathRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOPathRef.
[in] | entity | The entity object. |
LO_RESULT LOPathGetArc | ( | LOPathRef | path, |
bool * | is_arc, | ||
LOPoint2D * | center, | ||
double * | radius, | ||
double * | start_angle, | ||
double * | end_angle | ||
) |
Gets whether or not the path represents an arc, and if so, gets the geometric representation of the arc.
[in] | path | The path object. |
[out] | is_arc | Whether or not the path is an arc. |
[out] | center | Center point of the arc. Will only be set if is_arc returns true. |
[out] | radius | Radius of the arc. Will only be set if is_arc returns true. |
[out] | start_angle | Start angle of the arc. Will only be set if is_arc returns true. |
[out] | end_angle | End angle of the arc. Will only be set if is_arc returns true. |
Gets whether or not the path represents a circle, and if so, gets the geometric representation of the circle.
[in] | path | The path object. |
[out] | is_circle | Whether or not the path is a circle. |
[out] | center | Center point of the circle. Will only be set if is_circle returns true. |
[out] | radius | Radius of the circle. Will only be set if is_circle returns true. |
Gets whether or not the path is a closed loop.
[in] | path | The path object. |
[out] | is_closed | Whether the path is closed or not. |
Gets the end point for the path.
[in] | path | The path object. |
[out] | point | The end point. |
Gets the number of points in the path.
[in] | path | The path object. |
[out] | size | The number of points in the path. |
Gets the length of the path.
[in] | path | The path object. |
[out] | parametric_length | The length of the path. |
Gets the point in the path at the given index.
[in] | path | The path object. |
[in] | point_index | The index of the point to get. |
[out] | point | The point at the given index. |
Gets the point at the given distance along the path.
[in] | path | The path object. |
[in] | parametric_value | The distance along the path to get the point. |
[out] | point | The point at the given distance along the path. |
LO_RESULT LOPathGetPoints | ( | LOPathRef | path, |
size_t | points_size, | ||
LOPoint2D | points[], | ||
size_t * | number_of_points_copied | ||
) |
Gets the points in the path.
[in] | path | The path object. |
[in] | points_size | The maximum number of points to copy. |
[out] | points | The array that the points will be copied to. |
[out] | number_of_points_copied | The number of points actually copied. |
LO_RESULT LOPathGetPointTypeAtIndex | ( | LOPathRef | path, |
size_t | point_index, | ||
LOPathPointType * | pointtype | ||
) |
Gets the type of the specified point in the path.
[in] | path | The path object. |
[in] | point_index | The index of the point to get type information of. |
[out] | pointtype | The point type. |
LO_RESULT LOPathGetPointTypes | ( | LOPathRef | path, |
size_t | pointtypes_size, | ||
LOPathPointType | pointtypes[], | ||
size_t * | number_of_pointtypes_copied | ||
) |
Gets the type of each point in the path.
[in] | path | The path object. |
[in] | pointtypes_size | The maximum number of point types to copy. |
[out] | pointtypes | The array that the point types will be copied to. |
[out] | number_of_pointtypes_copied | The number of point types actually copied. |
Gets the start point for the path.
[in] | path | The path object. |
[out] | point | The start point. |
LO_RESULT LOPathGetTangentAtParameter | ( | LOPathRef | path, |
double | parametric_value, | ||
LOVector2D * | tangent | ||
) |
Gets the tangent at the given distance along the path.
[in] | path | The path object. |
[in] | parametric_value | The distance along the path to get the tangent. |
[out] | tangent | The tangent at the given distane along the path. |
LO_RESULT LOPathGetWindingType | ( | LOPathRef | path, |
LOPathWindingType * | winding | ||
) |
Returns the winding type of the path.
[in] | path | The path object. |
[out] | winding | The winding type of the path. |
Releases a path object. The object will be invalidated if releasing the last reference.
[in] | path | The path object. |
LO_EXPORT LOEntityRef LOPathToEntity | ( | LOPathRef | path | ) |
Converts from a LOPathRef to a LOEntityRef. This is essentially an upcast operation.
[in] | path | The path object. |