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

Go to the source code of this file.

Data Structures

struct  SUMaterialInput
 SUMaterialInput contains information that is needed to apply a material to a face. The conventional method for applying a material to a face is to use 1 to 4 UV coordinates, which are Cartesian textures coordinates and corresponding vertex indices on the face. The vertices are referenced by index into the top level SUGeometryInputRef's vertex array. The member variable 'material' must be a valid material object, and once the material input is used (e.g. with /ref SUEntitiesFill), the material object must not be released since it will be associated with a parent object. More...
 

Functions

SU_RESULT SUGeometryInputCreate (SUGeometryInputRef *geom_input)
 Creates a geometry input object. More...
 
SU_RESULT SUGeometryInputRelease (SUGeometryInputRef *geom_input)
 Deallocates a geometry input object. More...
 
SU_RESULT SUGeometryInputAddVertex (SUGeometryInputRef geom_input, const struct SUPoint3D *point)
 Adds a vertex to a geometry input object. More...
 
SU_RESULT SUGeometryInputSetVertices (SUGeometryInputRef geom_input, size_t num_vertices, const struct SUPoint3D points[])
 Sets all vertices of a geometry input object. Any existing vertices will be overridden. More...
 
SU_RESULT SULoopInputCreate (SULoopInputRef *loop_input)
 Creates a loop input object. More...
 
SU_RESULT SULoopInputRelease (SULoopInputRef *loop_input)
 Deallocates a loop input object. More...
 
SU_RESULT SULoopInputAddVertexIndex (SULoopInputRef loop_input, size_t vertex_index)
 Adds a vertex index to a loop input object. More...
 
SU_RESULT SULoopInputEdgeSetHidden (SULoopInputRef loop_input, size_t edge_index, bool hidden)
 Sets the hidden flag of an edge in a loop input object. More...
 
SU_RESULT SULoopInputEdgeSetSoft (SULoopInputRef loop_input, size_t edge_index, bool soft)
 Sets the soft flag of an edge in a loop input object. More...
 
SU_RESULT SULoopInputEdgeSetSmooth (SULoopInputRef loop_input, size_t edge_index, bool smooth)
 Sets the smooth flag of an edge in a loop input object. More...
 
SU_RESULT SULoopInputAddCurve (SULoopInputRef loop_input, size_t first_edge_index, size_t last_edge_index)
 Adds a simple curve to a loop input object. More...
 
SU_RESULT SUGeometryInputAddFace (SUGeometryInputRef geom_input, SULoopInputRef *outer_loop, size_t *added_face_index)
 Adds a face to a geometry input object with a given outer loop for the face. More...
 
SU_RESULT SUGeometryInputFaceSetReverse (SUGeometryInputRef geom_input, size_t face_index, bool reverse)
 Sets a flag in the geometry input that, when true, will create a face by reversing the orientations of all of its loops. More...
 
SU_RESULT SUGeometryInputFaceSetLayer (SUGeometryInputRef geom_input, size_t face_index, SULayerRef layer)
 Sets the layer of a face in the geometry input. More...
 
SU_RESULT SUGeometryInputFaceAddInnerLoop (SUGeometryInputRef geom_input, size_t face_index, SULoopInputRef *loop_input)
 Adds an inner loop to a face in the geometry input. More...
 
SU_RESULT SUGeometryInputFaceSetFrontMaterial (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialInput *material_input)
 Sets the front material of a face in the geometry input. More...
 
SU_RESULT SUGeometryInputFaceSetBackMaterial (SUGeometryInputRef geom_input, size_t face_index, const struct SUMaterialInput *material_input)
 Sets the back material of a face in the geometry input. More...
 

Function Documentation

SU_RESULT SUGeometryInputAddFace ( SUGeometryInputRef  geom_input,
SULoopInputRef outer_loop,
size_t *  added_face_index 
)

Adds a face to a geometry input object with a given outer loop for the face.

Parameters
[in]geom_inputThe geometry input object.
[in]outer_loopThe outer loop to be set for the face. If the function succeeds (i.e. returns SU_ERROR_NONE), this loop will be deallocated.
[in]added_face_index(optional) If not NULL, receives the index of the added face.
Returns
SU_RESULT SUGeometryInputAddVertex ( SUGeometryInputRef  geom_input,
const struct SUPoint3D point 
)

Adds a vertex to a geometry input object.

Parameters
[in]geom_inputThe geometry input object.
[in]pointThe location of the vertex to be added.
Returns
SU_RESULT SUGeometryInputCreate ( SUGeometryInputRef geom_input)

Creates a geometry input object.

Parameters
[out]geom_inputThe object created. This object can be passed into SUEntitiesFill to populate an entities object. It should be released subsequently by calling SUGeometryInputRelease.
Returns
SU_RESULT SUGeometryInputFaceAddInnerLoop ( SUGeometryInputRef  geom_input,
size_t  face_index,
SULoopInputRef loop_input 
)

Adds an inner loop to a face in the geometry input.

Parameters
[in]geom_inputThe geometry input object.
[in]face_indexIndex of the face to receive the inner loop.
[in]loop_inputThe inner loop to be added. If the function succeeds (i.e. returns SU_ERROR_NONE), this loop will be deallocated.
Returns
SU_RESULT SUGeometryInputFaceSetBackMaterial ( SUGeometryInputRef  geom_input,
size_t  face_index,
const struct SUMaterialInput material_input 
)

Sets the back material of a face in the geometry input.

Parameters
[in]geom_inputThe geometry input object.
[in]face_indexIndex of the face to receive the material.
[in]material_inputThe material input to set.
Returns
SU_RESULT SUGeometryInputFaceSetFrontMaterial ( SUGeometryInputRef  geom_input,
size_t  face_index,
const struct SUMaterialInput material_input 
)

Sets the front material of a face in the geometry input.

Parameters
[in]geom_inputThe geometry input object.
[in]face_indexIndex of the face to receive the material.
[in]material_inputThe material input to set.
Returns
SU_RESULT SUGeometryInputFaceSetLayer ( SUGeometryInputRef  geom_input,
size_t  face_index,
SULayerRef  layer 
)

Sets the layer of a face in the geometry input.

Parameters
[in]geom_inputThe geometry input object.
[in]face_indexIndex of the face to be reversed.
[in]layerThe layer to be set.
Returns
SU_RESULT SUGeometryInputFaceSetReverse ( SUGeometryInputRef  geom_input,
size_t  face_index,
bool  reverse 
)

Sets a flag in the geometry input that, when true, will create a face by reversing the orientations of all of its loops.

Parameters
[in]geom_inputThe geometry input object.
[in]face_indexIndex of the face to be reversed.
[in]reverseThe given reverse flag.
Returns
SU_RESULT SUGeometryInputRelease ( SUGeometryInputRef geom_input)

Deallocates a geometry input object.

Parameters
[in]geom_inputThe object to deallocate.
Returns
SU_RESULT SUGeometryInputSetVertices ( SUGeometryInputRef  geom_input,
size_t  num_vertices,
const struct SUPoint3D  points[] 
)

Sets all vertices of a geometry input object. Any existing vertices will be overridden.

Parameters
[in]geom_inputThe geometry input object.
[in]num_verticesThe number of vertices in the given point array.
[in]pointsThe points array containing the location of vertices.
Returns
SU_RESULT SULoopInputAddCurve ( SULoopInputRef  loop_input,
size_t  first_edge_index,
size_t  last_edge_index 
)

Adds a simple curve to a loop input object.

Parameters
[in]loop_inputThe loop input object.
[in]first_edge_indexFirst edge index to be associated with the curve.
[in]last_edge_indexLast edge index to be associated with the curve.
Returns
SU_RESULT SULoopInputAddVertexIndex ( SULoopInputRef  loop_input,
size_t  vertex_index 
)

Adds a vertex index to a loop input object.

Parameters
[in]loop_inputThe loop input object.
[in]vertex_indexThe vertex index to add. This references a vertex within the parent geometry input's vertex collection (as a zero- based index).
Returns
SU_RESULT SULoopInputCreate ( SULoopInputRef loop_input)

Creates a loop input object.

Parameters
[out]loop_inputThe object created.
Returns
SU_RESULT SULoopInputEdgeSetHidden ( SULoopInputRef  loop_input,
size_t  edge_index,
bool  hidden 
)

Sets the hidden flag of an edge in a loop input object.

Parameters
[in]loop_inputThe loop input object.
[in]edge_indexThe zero-based index of the edge within the loop.
[in]hiddenThe flag to set.
Returns
SU_RESULT SULoopInputEdgeSetSmooth ( SULoopInputRef  loop_input,
size_t  edge_index,
bool  smooth 
)

Sets the smooth flag of an edge in a loop input object.

Parameters
[in]loop_inputThe loop input object.
[in]edge_indexThe zero-based index of the edge within the loop.
[in]smoothThe flag to set.
Returns
SU_RESULT SULoopInputEdgeSetSoft ( SULoopInputRef  loop_input,
size_t  edge_index,
bool  soft 
)

Sets the soft flag of an edge in a loop input object.

Parameters
[in]loop_inputThe loop input object.
[in]edge_indexThe zero-based index of the edge within the loop.
[in]softThe flag to set.
Returns
SU_RESULT SULoopInputRelease ( SULoopInputRef loop_input)

Deallocates a loop input object.

Parameters
[in]loop_inputThe object to deallocate.
Returns