SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
edge.h File Reference
#include <SketchUpAPI/color.h>
#include <SketchUpAPI/common.h>
#include <SketchUpAPI/geometry.h>
#include <SketchUpAPI/unicodestring.h>
#include <SketchUpAPI/transformation.h>
#include <SketchUpAPI/model/defs.h>

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SUEdgeToEntity (SUEdgeRef edge)
 Converts from an SUEdgeRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUEdgeRef SUEdgeFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUEdgeRef. This is essentially a downcast operation so the given entity must be convertible to an SUEdgeRef. More...
 
SU_EXPORT SUDrawingElementRef SUEdgeToDrawingElement (SUEdgeRef edge)
 Converts from an SUEdgeRef to an SUDrawingElementRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUEdgeRef SUEdgeFromDrawingElement (SUDrawingElementRef drawing_elem)
 Converts from an SUDrawingElementRef to an SUEdgeRef. This is essentially a downcast operation so the given element must be convertible to an SUEdgeRef. More...
 
SU_RESULT SUEdgeCreate (SUEdgeRef *edge, const struct SUPoint3D *start, const struct SUPoint3D *end)
 Creates a new edge object. More...
 
SU_RESULT SUEdgeRelease (SUEdgeRef *edge)
 Releases an edge object. More...
 
SU_RESULT SUEdgeGetCurve (SUEdgeRef edge, SUCurveRef *curve)
 Retrieves the associated curve object of an edge object. More...
 
SU_RESULT SUEdgeGetStartVertex (SUEdgeRef edge, SUVertexRef *vertex)
 Retrieves the starting vertex of an edge object. More...
 
SU_RESULT SUEdgeGetEndVertex (SUEdgeRef edge, SUVertexRef *vertex)
 Retrieves the end vertex of an edge object. More...
 
SU_RESULT SUEdgeSetSoft (SUEdgeRef edge, bool soft_flag)
 Sets the soft flag of an edge object. More...
 
SU_RESULT SUEdgeGetSoft (SUEdgeRef edge, bool *soft_flag)
 Retrieves the soft flag of an edge object. More...
 
SU_RESULT SUEdgeSetSmooth (SUEdgeRef edge, bool smooth_flag)
 Sets the smooth flag of an edge object. More...
 
SU_RESULT SUEdgeGetSmooth (SUEdgeRef edge, bool *smooth_flag)
 Retrieves the smooth flag of an edge object. More...
 
SU_RESULT SUEdgeGetNumFaces (SUEdgeRef edge, size_t *count)
 Retrieves the number of faces that the edge is associated with. More...
 
SU_RESULT SUEdgeGetFaces (SUEdgeRef edge, size_t len, SUFaceRef faces[], size_t *count)
 Retrieves the face objects associated with an edge object. More...
 
SU_RESULT SUEdgeGetColor (SUEdgeRef edge, SUColor *color)
 Retrieves the color of an edge object. More...
 
SU_RESULT SUEdgeGetLengthWithTransform (SUEdgeRef edge, const struct SUTransformation *transform, double *length)
 Computes the length of the edge with the provided transformation applied. More...
 
SU_RESULT SUEdgeSetColor (SUEdgeRef edge, const SUColor *color)
 Sets the color of an edge object. More...
 

Function Documentation

SU_RESULT SUEdgeCreate ( SUEdgeRef edge,
const struct SUPoint3D start,
const struct SUPoint3D end 
)

Creates a new edge object.

The edge object must be subsequently deallocated with SUEdgeRelease unless the edge object is associated with a parent object.

Parameters
[out]edgeThe edge object.
[in]startThe start position of the edge object.
[in]endThe end position of the edge object.
Returns
SU_EXPORT SUEdgeRef SUEdgeFromDrawingElement ( SUDrawingElementRef  drawing_elem)

Converts from an SUDrawingElementRef to an SUEdgeRef. This is essentially a downcast operation so the given element must be convertible to an SUEdgeRef.

Parameters
[in]drawing_elemThe given element reference.
Returns
  • The converted SUEdgeRef if the downcast operation succeeds
  • If not, the returned reference will be invalid.
SU_EXPORT SUEdgeRef SUEdgeFromEntity ( SUEntityRef  entity)

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

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUEdgeRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_RESULT SUEdgeGetColor ( SUEdgeRef  edge,
SUColor color 
)

Retrieves the color of an edge object.

Parameters
[in]edgeThe edge object.
[out]colorThe color retrieved.
Returns
SU_RESULT SUEdgeGetCurve ( SUEdgeRef  edge,
SUCurveRef curve 
)

Retrieves the associated curve object of an edge object.

Parameters
[in]edgeThe edge object.
[out]curveThe curve object retrieved.
Returns
SU_RESULT SUEdgeGetEndVertex ( SUEdgeRef  edge,
SUVertexRef vertex 
)

Retrieves the end vertex of an edge object.

Parameters
[in]edgeThe edge object.
[out]vertexThe vertex object retrieved.
Returns
SU_RESULT SUEdgeGetFaces ( SUEdgeRef  edge,
size_t  len,
SUFaceRef  faces[],
size_t *  count 
)

Retrieves the face objects associated with an edge object.

Parameters
[in]edgeThe edge object.
[in]lenThe number of faces to retrieve.
[out]facesThe faces retrieved.
[out]countThe number of face objects retrieved.
Returns
SU_RESULT SUEdgeGetLengthWithTransform ( SUEdgeRef  edge,
const struct SUTransformation transform,
double *  length 
)

Computes the length of the edge with the provided transformation applied.

Since
Parameters
[in]edgeThe edge object.
[in]transformA transformation to be appllied to the edge.
[out]lengthThe length retrieved.
Returns
SU_RESULT SUEdgeGetNumFaces ( SUEdgeRef  edge,
size_t *  count 
)

Retrieves the number of faces that the edge is associated with.

Parameters
[in]edgeThe edge object.
[out]countThe number of faces.
Returns
SU_RESULT SUEdgeGetSmooth ( SUEdgeRef  edge,
bool *  smooth_flag 
)

Retrieves the smooth flag of an edge object.

Parameters
[in]edgeThe edge object.
[out]smooth_flagThe smooth flag retrieved.
Returns
SU_RESULT SUEdgeGetSoft ( SUEdgeRef  edge,
bool *  soft_flag 
)

Retrieves the soft flag of an edge object.

Parameters
[in]edgeThe edge object.
[out]soft_flagThe soft flag retrieved.
Returns
SU_RESULT SUEdgeGetStartVertex ( SUEdgeRef  edge,
SUVertexRef vertex 
)

Retrieves the starting vertex of an edge object.

Parameters
[in]edgeThe edge object.
[out]vertexThe vertex object retrieved.
Returns
SU_RESULT SUEdgeRelease ( SUEdgeRef edge)

Releases an edge object.

The edge object must have been created with SUEdgeCreate and not subsequently associated with a parent object (e.g. SUEntitiesAddEdges).

Parameters
[in]edgeThe edge object.
Returns
SU_RESULT SUEdgeSetColor ( SUEdgeRef  edge,
const SUColor color 
)

Sets the color of an edge object.

Parameters
[in]edgeThe edge object.
[in]colorThe color object to set.
Returns
SU_RESULT SUEdgeSetSmooth ( SUEdgeRef  edge,
bool  smooth_flag 
)

Sets the smooth flag of an edge object.

Parameters
[in]edgeThe edge object.
[in]smooth_flagThe smooth flag to set.
Returns
SU_RESULT SUEdgeSetSoft ( SUEdgeRef  edge,
bool  soft_flag 
)

Sets the soft flag of an edge object.

Parameters
[in]edgeThe edge object.
[in]soft_flagThe soft flag to set.
Returns
SU_EXPORT SUDrawingElementRef SUEdgeToDrawingElement ( SUEdgeRef  edge)

Converts from an SUEdgeRef to an SUDrawingElementRef. This is essentially an upcast operation.

Parameters
[in]edgeThe given edge reference.
Returns
  • The converted SUEntityRef if edge is a valid edge
  • If not, the returned reference will be invalid
SU_EXPORT SUEntityRef SUEdgeToEntity ( SUEdgeRef  edge)

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

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