3D-ICE 3.0.0
|
Go to the source code of this file.
Data Structures | |
struct | Material_t |
Structure used to store data about the materials that compose the 2D/3D stack. More... | |
Typedefs | |
typedef struct Material_t | Material_t |
Functions | |
void | material_init (Material_t *material) |
void | material_copy (Material_t *dst, Material_t *src) |
void | material_destroy (Material_t *material) |
Material_t * | material_calloc (void) |
Material_t * | material_clone (Material_t *material) |
void | material_free (Material_t *material) |
bool | material_same_id (Material_t *material, Material_t *other) |
void | material_print (Material_t *material, FILE *stream, String_t prefix) |
typedef struct Material_t Material_t |
Definition of the type Material_t
Definition at line 93 of file material.h.
Material_t * material_calloc | ( | void | ) |
Allocates memory for a structure of type Material_t
The content of the new structure is set to default values calling material_init
NULL
if the memory allocation fails Definition at line 76 of file material.c.
Material_t * material_clone | ( | Material_t * | material | ) |
Allocates memory for a new copy of the structure material
material | the address of the structure to clone |
NULL
if the memory allocation fails NULL
if the parameter material is NULL
Definition at line 89 of file material.c.
void material_copy | ( | Material_t * | dst, |
Material_t * | src | ||
) |
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 55 of file material.c.
void material_destroy | ( | Material_t * | material | ) |
Destroys the content of the fields of the structure material
The function releases any dynamic memory used by the structure and resets its state calling material_init .
material | the address of the structure to destroy |
Definition at line 67 of file material.c.
void material_free | ( | Material_t * | material | ) |
Frees the memory space pointed by material
The function destroys the structure material and then frees its memory. The pointer material must have been returned by a previous call to material_calloc or material_clone .
If material is NULL
, no operation is performed.
material | the pointer to free |
Definition at line 106 of file material.c.
void material_init | ( | Material_t * | material | ) |
Inits the fields of the material structure with default values
material | the address of the structure to initalize |
Definition at line 45 of file material.c.
void material_print | ( | Material_t * | material, |
FILE * | stream, | ||
String_t | prefix | ||
) |
Prints the material declaration as it looks in the stack file
material | the address of the structure to print |
stream | the output stream (must be already open) |
prefix | a string to be printed as prefix at the beginning of each line |
Definition at line 126 of file material.c.
bool material_same_id | ( | Material_t * | material, |
Material_t * | other | ||
) |
Tests if two materials have the same Id
material | the first material |
other | the second material |
TRUE
if material and other have the same Id FALSE
otherwise Definition at line 119 of file material.c.