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

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SUVertexToEntity (SUVertexRef vertex)
 Converts from an SUVertexRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SUVertexRef SUVertexFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SUVertexRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUVertexRef. More...
 
SU_RESULT SUVertexGetPosition (SUVertexRef vertex, struct SUPoint3D *position)
 Retrieves the position of a vertex object. More...
 
SU_RESULT SUVertexSetPosition (SUVertexRef vertex, const struct SUPoint3D *position)
 Sets the position of a vertex object. More...
 
SU_RESULT SUVertexGetNumEdges (SUVertexRef vertex, size_t *count)
 Retrieves the number of edges that the vertex is associated with. More...
 
SU_RESULT SUVertexGetEdges (SUVertexRef vertex, size_t len, SUEdgeRef edges[], size_t *count)
 Retrieves the edge objects associated with a vertex object. More...
 
SU_RESULT SUVertexGetNumFaces (SUVertexRef vertex, size_t *count)
 Retrieves the number of faces that the vertex is associated with. More...
 
SU_RESULT SUVertexGetFaces (SUVertexRef vertex, size_t len, SUFaceRef faces[], size_t *count)
 Retrieves the face objects associated with a vertex object. More...
 
SU_RESULT SUVertexGetNumLoops (SUVertexRef vertex, size_t *count)
 Retrieves the number of loops that the vertex is associated with. More...
 
SU_RESULT SUVertexGetLoops (SUVertexRef vertex, size_t len, SULoopRef loops[], size_t *count)
 Retrieves the loop objects associated with a vertex object. More...
 

Function Documentation

SU_EXPORT SUVertexRef SUVertexFromEntity ( SUEntityRef  entity)

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

Parameters
[in]entityThe entity object.
Returns
  • The converted SUVertexRef if the downcast operation succeeds
  • If the downcast operation fails, the returned reference will be invalid
SU_RESULT SUVertexGetEdges ( SUVertexRef  vertex,
size_t  len,
SUEdgeRef  edges[],
size_t *  count 
)

Retrieves the edge objects associated with a vertex object.

Parameters
[in]vertexThe vertex object.
[in]lenThe number of edges to retrieve.
[out]edgesThe edges retrieved.
[out]countThe number of edges retrieved.
Returns
SU_RESULT SUVertexGetFaces ( SUVertexRef  vertex,
size_t  len,
SUFaceRef  faces[],
size_t *  count 
)

Retrieves the face objects associated with a vertex object.

Parameters
[in]vertexThe vertex object.
[in]lenThe number of faces to retrieve.
[out]facesThe faces retrieved.
[out]countThe number of faces retrieved.
Returns
SU_RESULT SUVertexGetLoops ( SUVertexRef  vertex,
size_t  len,
SULoopRef  loops[],
size_t *  count 
)

Retrieves the loop objects associated with a vertex object.

Parameters
[in]vertexThe vertex object.
[in]lenThe number of loops to retrieve.
[out]loopsThe loops retrieved.
[out]countThe number of loops retrieved.
Returns
SU_RESULT SUVertexGetNumEdges ( SUVertexRef  vertex,
size_t *  count 
)

Retrieves the number of edges that the vertex is associated with.

Parameters
[in]vertexThe vertex object.
[out]countThe number of edges.
Returns
SU_RESULT SUVertexGetNumFaces ( SUVertexRef  vertex,
size_t *  count 
)

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

Parameters
[in]vertexThe vertex object.
[out]countThe number of faces.
Returns
SU_RESULT SUVertexGetNumLoops ( SUVertexRef  vertex,
size_t *  count 
)

Retrieves the number of loops that the vertex is associated with.

Parameters
[in]vertexThe vertex object.
[out]countThe number of loops.
Returns
SU_RESULT SUVertexGetPosition ( SUVertexRef  vertex,
struct SUPoint3D position 
)

Retrieves the position of a vertex object.

Parameters
[in]vertexThe vertex object.
[out]positionThe vertex position.
Returns
SU_RESULT SUVertexSetPosition ( SUVertexRef  vertex,
const struct SUPoint3D position 
)

Sets the position of a vertex object.

Parameters
[in]vertexThe vertex object.
[in]positionThe value used to set the vertex position.
Returns
SU_EXPORT SUEntityRef SUVertexToEntity ( SUVertexRef  vertex)

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

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