SketchUp SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Enumerations | Functions
curve.h File Reference
#include <slapi/slapi.h>
#include <slapi/model/defs.h>

Go to the source code of this file.

Enumerations

enum  SUCurveType { SUCurveType_Simple = 0, SUCurveType_Arc }
 Defines curve types that can be represented by SUCurveRef. More...
 

Functions

SU_EXPORT SUEntityRef SUCurveToEntity (SUCurveRef curve)
 Converts from an SUCurveRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUCurveRef SUCurveFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUCurveRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUCurveRef. More...
 
SU_RESULT SUCurveCreateWithEdges (SUCurveRef *curve, const SUEdgeRef edges[], size_t len)
 Creates a curve object with the given array of edges that is not connected to any face object. The array of N edges is sorted such that for each edge in the range [0, N] the start position of each edge is the same as the end position of the previous edge in the array. Each element of the array of edges is subsequently associated with the created curve object and must not be deallocated via SUEdgeRelease. More...
 
SU_RESULT SUCurveRelease (SUCurveRef *curve)
 Releases a curve object and its associated edge objects. More...
 
SU_RESULT SUCurveGetType (SUCurveRef curve, enum SUCurveType *type)
 Retrieves the curve type of a curve object. More...
 
SU_RESULT SUCurveGetNumEdges (SUCurveRef curve, size_t *count)
 Retrieves the number of edges that belong to a curve object. More...
 
SU_RESULT SUCurveGetEdges (SUCurveRef curve, size_t len, SUEdgeRef edges[], size_t *count)
 Retrieves the edges of a curve object. More...
 

Enumeration Type Documentation

Defines curve types that can be represented by SUCurveRef.

Enumerator
SUCurveType_Simple 
SUCurveType_Arc 

Function Documentation

SU_RESULT SUCurveCreateWithEdges ( SUCurveRef curve,
const SUEdgeRef  edges[],
size_t  len 
)

Creates a curve object with the given array of edges that is not connected to any face object. The array of N edges is sorted such that for each edge in the range [0, N] the start position of each edge is the same as the end position of the previous edge in the array. Each element of the array of edges is subsequently associated with the created curve object and must not be deallocated via SUEdgeRelease.

Parameters
curveThe curve object created.
edgesThe array of edge objects.
lenThe number of edge objects in the array.
Returns
SU_EXPORT SUCurveRef SUCurveFromEntity ( SUEntityRef  entity)

Converts from an SUEntityRef to an SUCurveRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUCurveRef.

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUCurveRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_RESULT SUCurveGetEdges ( SUCurveRef  curve,
size_t  len,
SUEdgeRef  edges[],
size_t *  count 
)

Retrieves the edges of a curve object.

Parameters
[in]curveThe curve object.
[in]lenThe number of edges to retrieve.
[out]edgesThe edges retrieved.
[out]countThe number of edges retrieved.
Returns
SU_RESULT SUCurveGetNumEdges ( SUCurveRef  curve,
size_t *  count 
)

Retrieves the number of edges that belong to a curve object.

Parameters
[in]curveThe curve object.
[out]countThe number of edges.
Returns
SU_RESULT SUCurveGetType ( SUCurveRef  curve,
enum SUCurveType type 
)

Retrieves the curve type of a curve object.

Parameters
[in]curveThe curve object.
[out]typeThe curve type retrieved.
Returns
SU_RESULT SUCurveRelease ( SUCurveRef curve)

Releases a curve object and its associated edge objects.

Parameters
curveThe curve object.
Returns
SU_EXPORT SUEntityRef SUCurveToEntity ( SUCurveRef  curve)

Converts from an SUCurveRef to an SUEntityRef. This is essentially an upcast operation.

Parameters
[in]curveThe given curve reference.
Returns
  • The converted SUEntityRef if curve is a valid object
  • If not, the returned reference will be invalid