Go to the source code of this file.
|
CLEAP_RESULT | cleap_init () |
|
CLEAP_RESULT | cleap_init_no_render () |
|
CLEAP_RESULT | cleap_end () |
|
cleap_mesh * | cleap_load_mesh (const char *filename) |
|
CLEAP_RESULT | cleap_sync_mesh (cleap_mesh *m) |
|
CLEAP_RESULT | cleap_clear_mesh (cleap_mesh *m) |
|
CLEAP_RESULT | cleap_save_mesh (cleap_mesh *m, const char *filename) |
|
CLEAP_RESULT | cleap_save_mesh_no_sync (cleap_mesh *m, const char *filename) |
|
CLEAP_RESULT | cleap_paint_mesh (cleap_mesh *m, float r, float g, float b, float a) |
|
int | cleap_get_vertex_count (cleap_mesh *m) |
|
int | cleap_get_edge_count (cleap_mesh *m) |
|
int | cleap_get_face_count (cleap_mesh *m) |
|
void | cleap_print_mesh (cleap_mesh *m) |
|
float | cleap_get_bsphere_x (cleap_mesh *m) |
|
float | cleap_get_bsphere_y (cleap_mesh *m) |
|
float | cleap_get_bsphere_z (cleap_mesh *m) |
|
float | cleap_get_bsphere_r (cleap_mesh *m) |
|
int | cleap_mesh_is_wireframe (cleap_mesh *m) |
|
int | cleap_mesh_is_solid (cleap_mesh *m) |
|
void | cleap_mesh_set_wireframe (cleap_mesh *m, int w) |
|
void | cleap_mesh_set_solid (cleap_mesh *m, int s) |
|
CLEAP_RESULT | cleap_render_mesh (cleap_mesh *m) |
|
CLEAP_RESULT | cleap_delaunay_transformation (cleap_mesh *m, int mode) |
|
int | cleap_delaunay_transformation_interactive (cleap_mesh *m, int mode) |
|
macro status for for failure.
macro value for boolean false
.
macro status for for success.
macro value for boolean true
.
cleap mesh. It is the library's main structure. This structure hides all internals to the user and the library provides functions for all operations. An application should use pointers to this struct in order to handle one or multiple meshes simultaneusly and correctly.
cleap status result for many functionalities. values can be CLEAP_SUCCESS
, CLEAP_FAILURE
.
Deletes and frees all host and device memory used for passed mesh.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
CLEAP_SUCCESS
if all was freed succesfully, otherwise CLEAP_FAILURE
.
Transforms the mesh into a Delaunay one, via the iterative MDT method.
- Parameters
-
m | a pointer of type cleap_mesh. |
mode | dimensional mode; CLEAP_MODE_2D or CLEAP_MODE_3D . |
- Returns
CLEAP_SUCCESS
if succesful, otherwise CLEAP_FAILURE
.
int cleap_delaunay_transformation_interactive |
( |
cleap_mesh * |
m, |
|
|
int |
mode |
|
) |
| |
Performs one iteration of the MDT method. Educational purposes.
- Parameters
-
m | a pointer of type cleap_mesh. |
mode | dimensional mode; CLEAP_MODE_2D or CLEAP_MODE_3D . |
- Returns
CLEAP_SUCCESS
if succesful, otherwise CLEAP_FAILURE
.
Ends cleap => destroys OpenGL context too.
- Returns
CLEAP_SUCCESS
If finalization was succesful.
Gets the radius of the mesh's bounding sphere.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
float >= 0
.
Gets the x coordinate of the center of the mesh's bounding sphere.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
float
.
Gets the y coordinate of the center of the mesh's bounding sphere.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
float
.
Gets the z coordinate of the center of the mesh's bounding sphere.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
float
.
Gets the number of edges the mesh has.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
int >= 0
.
Gets the number of faces the mesh has.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
int >= 0
.
Gets the number of vertices the mesh has.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
int >= 0
.
Initializes cleap. By default chosses the highest GFlop GPU.
- Returns
CLEAP_SUCCESS
if initialization was succesful.
Initializes cleap, creates a dummy OpenGL context and initializes glew. This mode is for applications that only process and dont render anything.
- Returns
CLEAP_SUCCESS
If initialization was succesful.
cleap_mesh* cleap_load_mesh |
( |
const char * |
filename | ) |
|
Loads an OFF mesh from he given filename and creates a cleap_mesh instance from it.
- Parameters
-
filename | the full or relative path to the file. For example: "/home/me/meshes/sphere.off". |
- Returns
cleap_mesh*
with it's status = CLEAP_SUCCESS inside, otherwise it will have status = CLEAP_FAILURE or just be null.
Informs if the mesh is on solid mode or not.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
1
if the mesh is on solid mode, otherwise 0
.
Informs if the mesh is on wireframe mode or not.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
1
if the mesh is on wireframe mode, otherwise 0
.
void cleap_mesh_set_solid |
( |
cleap_mesh * |
m, |
|
|
int |
s |
|
) |
| |
Sets the mesh's solid mode to enabled or disabled.
- Parameters
-
m | a pointer of type cleap_mesh. |
s | the solid mode, 1 or 0 . |
void cleap_mesh_set_wireframe |
( |
cleap_mesh * |
m, |
|
|
int |
w |
|
) |
| |
Sets the mesh's wireframe mode to enabled or disabled.
- Parameters
-
m | a pointer of type cleap_mesh. |
w | the wireframe mode, 1 or 0 . |
Paints the mesh with the desired r, g, b, a
- Parameters
-
m | a pointer of type cleap_mesh. |
r | the red color value. |
g | the green color value. |
b | the blue color value. |
a | the alpha transparency value. [solid, transparent] <=> [1.0f, 0.0f]. |
- Returns
CLEAP_SUCCESS
if mesh was painted succesfully, otherwise CLEAP_FAILURE
.
Prints the mesh vertex, edge and face data.
- Parameters
-
m | a pointer of type cleap_mesh. |
Render the given mesh with OpenGL buffers.
- Parameters
-
m | a pointer of type cleap_mesh. 0 . |
- Returns
CLEAP_SUCCESS
if succesful, otherwise CLEAP_FAILURE
.
Saves the mesh into the desired path. The mesh is automatically synced before saving.
- Parameters
-
m | a pointer of type cleap_mesh. |
filename | the desired name of the file. |
- Returns
CLEAP_SUCCESS
if mesh was saved succesfully, otherwise CLEAP_FAILURE
.
Saves the mesh into the desired path, without any synchronization.
- Parameters
-
m | a pointer of type cleap_mesh. |
filename | the desired name of the file. |
- Returns
CLEAP_SUCCESS
if mesh was saved succesfully, otherwise CLEAP_FAILURE
.
Synchronizes mesh's host and device data assuming that device has the latest changes.
- Parameters
-
m | a pointer of type cleap_mesh. |
- Returns
CLEAP_SUCCESS
if synchronization was succesful, otherwise it returns CLEAP_FAILURE
.