environment.h
Go to the documentation of this file.
1 #ifndef ENVIRONMENTH
2 #define ENVIRONMENTH
3 
4 #include "vector.h"
5 #include "cuiksystem.h"
6 #include "polyhedron.h"
7 #include "link.h"
8 #include "plot3d.h"
9 
10 /****************************************************************************/
11 
12 
22 /****************************************************************************/
29 #define INIT_NUM_OBSTACLES 10
30 /****************************************************************************/
31 
39 typedef struct {
40  double maxCoord;
43 } Tenvironment;
44 
53 
65 void AddShape2Environment(char *name,Tpolyhedron *o,Tenvironment *e);
66 
76 unsigned int GetEnvironmentNObstacles(Tenvironment *e);
77 
91 unsigned int GetObstacleID(char *name,Tenvironment *e);
92 
104 char *GetObstacleName(unsigned int i,Tenvironment *e);
105 
106 
118 Tpolyhedron *GetObstacleShape(unsigned int i,Tenvironment *e);
119 
120 
132 unsigned int GetObstacleShapeStatus(unsigned int i,Tenvironment *e);
133 
134 
144 void GetObstacleColor(unsigned int i,Tcolor *c,Tenvironment *e);
145 
161 
172 void PrintEnvironment(FILE *f,char *path,Tenvironment *e);
173 
183 
184 
193 
194 #endif
Tpolyhedron * GetObstacleShape(unsigned int i, Tenvironment *e)
Gets the convex polyhedron of an obstacle given its identifier.
Definition: environment.c:82
Definition of the Tplot3d type and the associated functions.
A color.
Definition: color.h:23
void DeleteEnvironment(Tenvironment *e)
Destructor.
Definition: environment.c:166
A polyhedron.
Definition: polyhedron.h:124
A 3D plot.
Definition: plot3d.h:54
unsigned int GetEnvironmentNObstacles(Tenvironment *e)
Gets the number of obstacles in the environment.
Definition: environment.c:40
double GetEnvironmentMaxCoordinate(Tenvironment *e)
Returns the sum of the maximum coordinate value for all the convex polyhedrons in the environment...
Definition: environment.c:115
unsigned int GetObstacleID(char *name, Tenvironment *e)
Gets the idetifier of an obstacles given its name.
Definition: environment.c:45
A collection of obstacles (convex polyhedrons) with their names.
Definition: environment.h:39
void PlotEnvironment(Tplot3d *pt, Tenvironment *e)
Displays the obstacles in the environment in a 3D geometry.
Definition: environment.c:143
Definition of the TCuikSystem type and the associated functions.
unsigned int GetObstacleShapeStatus(unsigned int i, Tenvironment *e)
Gets the status (NORMAL, HIDDEN, DECOR) of an obstacle given its identifier.
Definition: environment.c:93
A generic vector.
Definition: vector.h:227
Definition of the Tpolyhedron type and the associated functions.
void GetObstacleColor(unsigned int i, Tcolor *c, Tenvironment *e)
Gets the color of an obstacle given its identifier.
Definition: environment.c:104
Definition of the Tvector type and the associated functions.
void InitEnvironment(Tenvironment *e)
Constructor.
Definition: environment.c:13
void PrintEnvironment(FILE *f, char *path, Tenvironment *e)
Stores the environment information into a file.
Definition: environment.c:120
Tvector names
Definition: environment.h:41
double maxCoord
Definition: environment.h:40
Tvector obstacles
Definition: environment.h:42
void AddShape2Environment(char *name, Tpolyhedron *o, Tenvironment *e)
Adds an obstacle (i.e., a convex polyhedron) to the environment.
Definition: environment.c:20
char * GetObstacleName(unsigned int i, Tenvironment *e)
Gets the name of an obstacle given its identifier.
Definition: environment.c:71