SketchUp SDK
|
#include <slapi/color.h>
#include <slapi/slapi.h>
#include <slapi/unicodestring.h>
#include <slapi/model/defs.h>
Go to the source code of this file.
Enumerations | |
enum | SUMaterialType { SUMaterialType_Colored = 0, SUMaterialType_Textured, SUMaterialType_ColorizedTexture } |
Indicates material type. More... | |
Functions | |
SU_EXPORT SUEntityRef | SUMaterialToEntity (SUMaterialRef material) |
Converts from an SUMaterialRef to an SUEntityRef. This is essentially an upcast operation. More... | |
SU_EXPORT SUMaterialRef | SUMaterialFromEntity (SUEntityRef entity) |
Converts from an SUEntityRef to an SUMaterialRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUMaterialRef. More... | |
SU_RESULT | SUMaterialCreate (SUMaterialRef *material) |
Creates a material. More... | |
SU_RESULT | SUMaterialRelease (SUMaterialRef *material) |
Releases a material and its resources. More... | |
SU_RESULT | SUMaterialSetName (SUMaterialRef material, const char *name) |
Sets the name of a material object. More... | |
SU_RESULT | SUMaterialGetName (SUMaterialRef material, SUStringRef *name) |
Retrieves the name of a material object. More... | |
SU_RESULT | SUMaterialSetColor (SUMaterialRef material, const SUColor *color) |
Sets the color of a material object. More... | |
SU_RESULT | SUMaterialGetColor (SUMaterialRef material, SUColor *color) |
Retrieves the color value of a material object. More... | |
SU_RESULT | SUMaterialSetTexture (SUMaterialRef material, SUTextureRef texture) |
Sets the texture of a material object. More... | |
SU_RESULT | SUMaterialGetTexture (SUMaterialRef material, SUTextureRef *texture) |
Retrieves the texture of a material object. More... | |
SU_RESULT | SUMaterialGetOpacity (SUMaterialRef material, double *alpha) |
Retrieves the alpha value (0.0 - 1.0) of a material object. More... | |
SU_RESULT | SUMaterialSetOpacity (SUMaterialRef material, double alpha) |
Sets the alpha value of a material object. More... | |
SU_RESULT | SUMaterialGetUseOpacity (SUMaterialRef material, bool *use_opacity) |
Retrieves the flag indicating whether alpha values are used from a material object. More... | |
SU_RESULT | SUMaterialSetUseOpacity (SUMaterialRef material, bool use_opacity) |
Sets the flag indicating whether alpha values are used on a material object. More... | |
SU_RESULT | SUMaterialSetType (SUMaterialRef material, enum SUMaterialType type) |
Sets the type of a material object. More... | |
SU_RESULT | SUMaterialGetType (SUMaterialRef material, enum SUMaterialType *type) |
Retrieves the type of a material object. More... | |
enum SUMaterialType |
SU_RESULT SUMaterialCreate | ( | SUMaterialRef * | material | ) |
Creates a material.
If the material is not associated with any face, it must be deallocated with SUMaterialRelease.
[out] | material | The material created. |
SU_EXPORT SUMaterialRef SUMaterialFromEntity | ( | SUEntityRef | entity | ) |
Converts from an SUEntityRef to an SUMaterialRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUMaterialRef.
[in] | entity | The given entity reference. |
SU_RESULT SUMaterialGetColor | ( | SUMaterialRef | material, |
SUColor * | color | ||
) |
Retrieves the color value of a material object.
[in] | material | The material object. |
[out] | color | The color value retrieved. |
SU_RESULT SUMaterialGetName | ( | SUMaterialRef | material, |
SUStringRef * | name | ||
) |
Retrieves the name of a material object.
[in] | material | The material object. |
[out] | name | The name retrieved. |
SU_RESULT SUMaterialGetOpacity | ( | SUMaterialRef | material, |
double * | alpha | ||
) |
Retrieves the alpha value (0.0 - 1.0) of a material object.
[in] | material | The material object. |
[out] | alpha | The alpha value retrieved. |
SU_RESULT SUMaterialGetTexture | ( | SUMaterialRef | material, |
SUTextureRef * | texture | ||
) |
Retrieves the texture of a material object.
[in] | material | The material object. |
[out] | texture | The texture object retrieved. |
SU_RESULT SUMaterialGetType | ( | SUMaterialRef | material, |
enum SUMaterialType * | type | ||
) |
Retrieves the type of a material object.
[in] | material | The material object. |
[out] | type | The type retrieved. |
SU_RESULT SUMaterialGetUseOpacity | ( | SUMaterialRef | material, |
bool * | use_opacity | ||
) |
Retrieves the flag indicating whether alpha values are used from a material object.
[in] | material | The material object. |
[out] | use_opacity | The flag retrieved. |
SU_RESULT SUMaterialRelease | ( | SUMaterialRef * | material | ) |
Releases a material and its resources.
The material must not be associated with a parent object such as a face.
[in] | material | The material to be released. |
SU_RESULT SUMaterialSetColor | ( | SUMaterialRef | material, |
const SUColor * | color | ||
) |
Sets the color of a material object.
[in] | material | The material object. |
[in] | color | The color value to set the material color. |
SU_RESULT SUMaterialSetName | ( | SUMaterialRef | material, |
const char * | name | ||
) |
Sets the name of a material object.
[in] | material | The material object. |
[in] | name | The name to set the material name. Assumed to be UTF-8 encoded. |
SU_RESULT SUMaterialSetOpacity | ( | SUMaterialRef | material, |
double | alpha | ||
) |
Sets the alpha value of a material object.
[in] | material | The material object. |
[in] | alpha | The alpha value to set. Must be within range [0.0, 1.0]. |
SU_RESULT SUMaterialSetTexture | ( | SUMaterialRef | material, |
SUTextureRef | texture | ||
) |
Sets the texture of a material object.
[in] | material | The material object. |
[in] | texture | The texture object to set the material texture. |
SU_RESULT SUMaterialSetType | ( | SUMaterialRef | material, |
enum SUMaterialType | type | ||
) |
Sets the type of a material object.
[in] | material | The material object. |
[in] | type | The type to set. |
SU_RESULT SUMaterialSetUseOpacity | ( | SUMaterialRef | material, |
bool | use_opacity | ||
) |
Sets the flag indicating whether alpha values are used on a material object.
[in] | material | The material object. |
[in] | use_opacity | The flag boolean value to set. |
SU_EXPORT SUEntityRef SUMaterialToEntity | ( | SUMaterialRef | material | ) |
Converts from an SUMaterialRef to an SUEntityRef. This is essentially an upcast operation.
[in] | material | The given material reference. |