Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

scheduler.c File Reference

#include <math.h>

Include dependency graph for scheduler.c:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Functions

void newpath ()
 Initialize a new path search.

void print_path (int q)
 Print a path.

void addpathnode (int x, int z, int level)
 Add a node in the path.

int moveCell (int x, int z, int level, int *map)
 Evalue if is possible to make a move into a cell.

void put (int x, int z, int level, float value)
 Put a value of a cell into a map.

float get (int x, int z, int level)
 Get a value from a cell into a map.

void pathfinding (int x, int z, int level, int *map, int dir, float prec)
 Recursive function to find a path on a distance map.

void print_distance_map (int *map)
 Print on screen a distance map.

void createDistanceMap (int x, int z, int level, int *map, int count)
 Create a map containing information about distance from a cell.

int getPosWU (int nWU)
 Return position in rendering process of a WU.

float getZCell (int x, int z)
 Trasform Z coordinate of cell on map to VRML world.

float getXCell (int x, int z)
 Trasform X coordinate of cell on map to VRML world.

int getZWorld (float x, float z)
 Trasform Z coordinate in VRML to left top corner z coordinate on map.

int getXWorld (float x, float z)
 Trasform X coordinate in VRML to left top corner z coordinate on map.

float readWU (int nWU, int x, int z, int level)
 Read a cell of a WU from map.

void writeWU (int nWU, int x, int z, int level, float value)
 Write a cell of a WU on map.

int getnWUX ()
 Elaborate # of WU.

int getnWUZ ()
 Elaborate # of WU.

void print_map (int l)
 Print a level map.

void createMaps (int ncell)
 Create a map with dim=ncell*ncell.

void initWUList ()
 Initialize Scheduler.

void addHotSpot (float x, float y, float z, char **url, char *description, int url_length, char *id)
 Add hotspot information in hotspot list.

void checkLevel ()
 Verify level consistency.

void checkHotSpot ()
 Verify hotspot consistency.

void addLevel (int id, float min, float max)
 Add a new level.

float hashColor (float h)
 Hashing function.

float dehashColor (float c)
 Hashing function.

bool availablePosition (int x, int z, int level)
 Check if a position on map is available for avatar.

void addWU (float x, float y, float z, float w, float h, float d, int lev)
 Add a Working Unit.

float getMultiple (float a)
 Return a multiple of WUSIZE > a.

float getmax (float a, float b)
 Return max between a and b.

void genListWU (float wx, float wy, float wz, float ww, float wh, float wd, bool clipping, int lev)
 Generate WU list for a level.

int driveout (char *outName)
 Produces output files.


Variables

bool preprocess
 Preprocessing flag.

char * iniFileName
 The path to ini file name.

char * outFileName
 Where to save tridimensional digraph file.

char * sourceFileName
 What have to be processed.

char * vrmlFileName
 Where to save a vrml representation of the tridimensional digraph.

bool FULLRENDERING = false
 FULLRENDERING set the type of rendering used by Display function.

int SLICES = 30
 SLICES Rendering option for geometric primitive.

int STACKS = 30
 STACKS Rendering option for geometric primitive.

bool WIREFRAME = false
 WIREFRAME If set to true set the rendering style to wireframe.

bool ELABORATE = false
 Need for default setting.

bool CLIPPING = true
 CLIPPING If its set to true indicate that DRIVE create and display all WU, while if its false make a rendering of the entire VRML world.

bool START = false
 START Indicate if display processing is started.

int WINX = 500
 Window Width.

int WINY = 500
 Window Height.

float WALL_DIM = 0.05
 Default size for flat face.

int CELLX
 Cell Width.

int CELLY
 Cell Height.

int MATERIAL_POLICY = 0
 Indicate the current type of policy for quad handler.

float MATERIAL_PERC = 0.1
 Percentage of quad surface to consider not empty a quad.

float NOTBLACK = 0.1
 Set a constant value for Material Policy.

int cellx
 # cell x

int celly
 # cell y

int rescount = 0
 Resize variable state keeper.

GLubyte valid = 0
 Check resize function.

int tempstate = 0
 Current state.

long d_count = 0
GLfloat * currentface
 Temp variable for IFS gestion.

int nvertex = 0
 # of vertex of current face

GLfloat PX
 Left Ortho Coordinate.

GLfloat PY
 Bottom Ortho Coordinate.

GLfloat PZ
 Far Ortho Coordinate.

GLfloat QX
 Right Ortho Coordinate.

GLfloat QY
 Top Ortho Coordinate.

GLfloat QZ
 Near Ortho Coordinate.

GLfloat EYEX
 X Coordinate of the eye.

GLfloat EYEY
 Y Coordinate of the eye.

GLfloat EYEZ
 Z Coordinate of the eye.

GLfloat CENTERX
 X Coordinate of the direction of the view (in this case center of the view is used).

GLfloat CENTERY
 Y Coordinate of the direction of the view (in this case center of the view is used).

GLfloat CENTERZ
 Z Coordinate of the direction of the view (in this case center of the view is used).

GLfloat UPX
 Up information.

GLfloat UPY
 Up information.

GLfloat UPZ
 Up information.

int winWidth = 0
 Window Dimension.

int winHeigth = 0
 Window Dimension.

int vdisplay = 0
 State variable for display function.

int idl = 0
 Object idl counter.

int wuidl = 0
 Working unit idl counter.

GLfloat * rect
 Rect for storing data from frame buffer.

object_uworld
 VRML world object rappresentation.

int nobject_u = 0
 Number of VRML world object.

float maxx
float maxy
float maxz
 Dimensions of current working unit.

float minx
float miny
float minz
 Dimensions of current working unit.

GLfloat currentDiffuse [3]
 Variable that store current diffuse color.

GLdouble equationminx [4] = {1.0,0.0,0.0,0.1}
 Equation of clipping planes.

GLdouble equationmaxx [4] = {-1.0,0.0,0.0,0.0}
 Equation of clipping planes.

GLdouble equationminz [4] = {0.0,0.0,1.0,0.1}
 Equation of clipping planes.

GLdouble equationmaxz [4] = {0.0,0.0,-1.0,0.0}
 Equation of clipping planes.

bool initialized = false
 Initialization flag.

float avatarheigth = 2.0
 Avatar heigth dimension.

bool THEREISMAP = false
 Map generation flag.

int extAvatar = 1
 Avatar extra cell dimension.

float avatarMaxWalk = 0.5
 Max height that avatar can pass throught.

float WUHEIGHT = 10.0
 Height of Working unit.

float WUSIZE = 5.0
 WU Edge size.

float ** maps
 Maps of VRML world.

int nx
 # of cell of level map in x

int nz
 # of cell of level map in z

int nwucellx
 # of cell of working unit in x.

int nwucellz
 # of cell of working unit in z.

int nwux
 # of wu in x

int nwuz
 # of wu in z

float dimx
 dim cell in x

float dimz
 dim cell in z

float minimox
 temp variable (min x in VRML world)

float minimoz
 temp variable (min z in VRML world)

float massimox
 temp variable (max x in VRML world)

float massimoz
 temp variable (max z in VRML world)

pathnode ** paths
 avatar paths.

int * lengthpath
 length of paths.

int npercorsi
 # of path founded.

bool found = false
 flag for pathfinding.

hotspothotspotlist
 hotspot information.

int nhotspot
 n hotspot.

levelWULevel
 Working unit level information.

int nlevel
 n of level in world.

wuwuList
 Working unit information.

int nwu
 number of working unit.

int pos = 0
 temp variable for nwux and nwuz computation.

bool VERBOSE
 If we have to write verbosely.


Function Documentation

void addHotSpot float  x,
float  y,
float  z,
char **  url,
char *  description,
int  url_length,
char *  id
 

Add hotspot information in hotspot list.

Parameters:
x x coordinate in VRML world.
y y coordinate in VRML world.
z z coordinate in VRML world.
url url information.
description description information.
url_length url length information.
id The id of the Hotspot

void addLevel int  id,
float  min,
float  max
 

Add a new level.

Parameters:
id id of the level.
min minimun y value.
max maximun y value.

void addpathnode int  x,
int  z,
int  level
 

Add a node in the path.

Parameters:
x x coordinate on the map.
z z coordinate on the map.
level level of the node.

void addWU float  x,
float  y,
float  z,
float  w,
float  h,
float  d,
int  lev
 

Add a Working Unit.

Parameters:
x x left top corner of WU in VRML world.
y y left top corner of WU in VRML world.
z z left top corner of WU in VRML world.
w width of WU.
h heigth of WU.
d depth of WU.
lev level of WU.

bool availablePosition int  x,
int  z,
int  level
 

Check if a position on map is available for avatar.

Parameters:
x x coordinate on map.
z z coordinate on map.
level level of cell.
Returns:
true if available, false if it isn't.

Here is the call graph for this function:

void checkHotSpot  ) 
 

Verify hotspot consistency.

Here is the call graph for this function:

void checkLevel  ) 
 

Verify level consistency.

void createDistanceMap int  x,
int  z,
int  level,
int *  map,
int  count
 

Create a map containing information about distance from a cell.

Parameters:
x x coordinate of principal cell
z z coordinate of principal cell
level level of principal cell
map map created from mapper.
count current distance.

void createMaps int  ncell  ) 
 

Create a map with dim=ncell*ncell.

Parameters:
ncell map's edge size.

Here is the call graph for this function:

float dehashColor float  c  ) 
 

Hashing function.

Parameters:
c float color value that is rappresentative of heigth.
Returns:
height value in VRML world.

int driveout char *  outName  ) 
 

Produces output files.

If outname is NULL, the function prints to the stdout the results. If the global variable vrmlFileName and outName are specified, a vrml file with the graph will be generated.

Parameters:
outName the name of the output xml file.
Returns:
0 if no errors occurred

Here is the call graph for this function:

void genListWU float  wx,
float  wy,
float  wz,
float  ww,
float  wh,
float  wd,
bool  clipping,
int  lev
 

Generate WU list for a level.

Parameters:
wx x coordinate of left top corner.
wy y coordinate of left top corner.
wz z coordinate of left top corner.
ww width of level.
wh heigth of level.
wd depth of level.
clipping indicate if analize process is enabled.
lev level of WU.

Here is the call graph for this function:

float get int  x,
int  z,
int  level
 

Get a value from a cell into a map.

Parameters:
x x coordinate of cell
z z coordinate
level level cell information
Returns:
value of x,z cell

float getmax float  a,
float  b
 

Return max between a and b.

Parameters:
a 
b 
Returns:
max between a and b.

float getMultiple float  a  ) 
 

Return a multiple of WUSIZE > a.

Parameters:
a check value
Returns:
a multiple of WUSIZE.

int getnWUX  ) 
 

Elaborate # of WU.

Returns:
# of WU along x.

int getnWUZ  ) 
 

Elaborate # of WU.

Returns:
# of WU along Z.

int getPosWU int  nWU  ) 
 

Return position in rendering process of a WU.

Parameters:
nWU position in WU list of WU searched.

float getXCell int  x,
int  z
 

Trasform X coordinate of cell on map to VRML world.

Parameters:
x x
z z
Returns:
x value in VRML world

int getXWorld float  x,
float  z
 

Trasform X coordinate in VRML to left top corner z coordinate on map.

Parameters:
x x
z z
Returns:
x coordinate on map

float getZCell int  x,
int  z
 

Trasform Z coordinate of cell on map to VRML world.

Parameters:
x x
z z
Returns:
z value in VRML world

int getZWorld float  x,
float  z
 

Trasform Z coordinate in VRML to left top corner z coordinate on map.

Parameters:
x x
z z
Returns:
z coordinate on map

float hashColor float  h  ) 
 

Hashing function.

Parameters:
h a height value in VRML world.
Returns:
a float color value that is rappresentative of heigth.

void initWUList  ) 
 

Initialize Scheduler.

int moveCell int  x,
int  z,
int  level,
int *  map
 

Evalue if is possible to make a move into a cell.

Parameters:
x x coordinate of cell on map.
z z coordinate of cell on map.
level level of cell.
map Cell's map.
Returns:
-2 if isn't possible otherwise return map value of the cell.

void newpath  ) 
 

Initialize a new path search.

void pathfinding int  x,
int  z,
int  level,
int *  map,
int  dir,
float  prec
 

Recursive function to find a path on a distance map.

Parameters:
x x coordinate of start position on map.
z z coordinate of start position on map.
level level of cell.
map distance map.
dir last direction.
prec precedent map cell value

Here is the call graph for this function:

void print_distance_map int *  map  ) 
 

Print on screen a distance map.

Parameters:
map to print.

void print_map int  l  ) 
 

Print a level map.

Parameters:
l # of level

void print_path int  q  ) 
 

Print a path.

Parameters:
q position of the path in Paths array.

void put int  x,
int  z,
int  level,
float  value
 

Put a value of a cell into a map.

Parameters:
x x coordinate of cell
z z coordinate
level level cell information
value value to insert

float readWU int  nWU,
int  x,
int  z,
int  level
 

Read a cell of a WU from map.

Parameters:
nWU position of WU in WU list.
x cell coordinate on WU map coordinate system.
z cell coordinate on WU map coordinate system.
level level of cell.
Returns:
cell value.

Here is the call graph for this function:

void writeWU int  nWU,
int  x,
int  z,
int  level,
float  value
 

Write a cell of a WU on map.

Parameters:
nWU position of WU in WU list.
x cell coordinate on WU map coordinate system.
z cell coordinate on WU map coordinate system.
level level of cell.
value value to insert.

Here is the call graph for this function:


Variable Documentation

float avatarheigth = 2.0
 

Avatar heigth dimension.

float avatarMaxWalk = 0.5
 

Max height that avatar can pass throught.

int cellx
 

# cell x

int CELLX
 

Cell Width.

int celly
 

# cell y

int CELLY
 

Cell Height.

GLfloat CENTERX
 

X Coordinate of the direction of the view (in this case center of the view is used).

GLfloat CENTERY
 

Y Coordinate of the direction of the view (in this case center of the view is used).

GLfloat CENTERZ
 

Z Coordinate of the direction of the view (in this case center of the view is used).

bool CLIPPING = true
 

CLIPPING If its set to true indicate that DRIVE create and display all WU, while if its false make a rendering of the entire VRML world.

GLfloat currentDiffuse[3]
 

Variable that store current diffuse color.

GLfloat* currentface
 

Temp variable for IFS gestion.

long d_count = 0
 

float dimx
 

dim cell in x

float dimz
 

dim cell in z

bool ELABORATE = false
 

Need for default setting.

GLdouble equationmaxx[4] = {-1.0,0.0,0.0,0.0}
 

Equation of clipping planes.

GLdouble equationmaxz[4] = {0.0,0.0,-1.0,0.0}
 

Equation of clipping planes.

GLdouble equationminx[4] = {1.0,0.0,0.0,0.1}
 

Equation of clipping planes.

GLdouble equationminz[4] = {0.0,0.0,1.0,0.1}
 

Equation of clipping planes.

int extAvatar = 1
 

Avatar extra cell dimension.

GLfloat EYEX
 

X Coordinate of the eye.

GLfloat EYEY
 

Y Coordinate of the eye.

GLfloat EYEZ
 

Z Coordinate of the eye.

bool found = false
 

flag for pathfinding.

bool FULLRENDERING = false
 

FULLRENDERING set the type of rendering used by Display function.

True indicate that all geometry are supported (Box,Sphere,Cylinder,Cone,IFS) and rendered. False indicate that all geometry are substituted by their bounding box rappresentation.

hotspot* hotspotlist
 

hotspot information.

int idl = 0
 

Object idl counter.

char* iniFileName
 

The path to ini file name.

bool initialized = false
 

Initialization flag.

int* lengthpath
 

length of paths.

float** maps
 

Maps of VRML world.

float massimox
 

temp variable (max x in VRML world)

float massimoz
 

temp variable (max z in VRML world)

float MATERIAL_PERC = 0.1
 

Percentage of quad surface to consider not empty a quad.

int MATERIAL_POLICY = 0
 

Indicate the current type of policy for quad handler.

float maxx
 

float maxy
 

float maxz
 

Dimensions of current working unit.

float minimox
 

temp variable (min x in VRML world)

float minimoz
 

temp variable (min z in VRML world)

float minx
 

float miny
 

float minz
 

Dimensions of current working unit.

int nhotspot
 

n hotspot.

int nlevel
 

n of level in world.

int nobject_u = 0
 

Number of VRML world object.

float NOTBLACK = 0.1
 

Set a constant value for Material Policy.

int npercorsi
 

# of path founded.

int nvertex = 0
 

# of vertex of current face

int nwu
 

number of working unit.

int nwucellx
 

# of cell of working unit in x.

int nwucellz
 

# of cell of working unit in z.

int nwux
 

# of wu in x

int nwuz
 

# of wu in z

int nx
 

# of cell of level map in x

int nz
 

# of cell of level map in z

char* outFileName
 

Where to save tridimensional digraph file.

pathnode** paths
 

avatar paths.

int pos = 0
 

temp variable for nwux and nwuz computation.

bool preprocess
 

Preprocessing flag.

A flag telling if we have to produce a preprocess file called mem_print.wrl

GLfloat PX
 

Left Ortho Coordinate.

GLfloat PY
 

Bottom Ortho Coordinate.

GLfloat PZ
 

Far Ortho Coordinate.

GLfloat QX
 

Right Ortho Coordinate.

GLfloat QY
 

Top Ortho Coordinate.

GLfloat QZ
 

Near Ortho Coordinate.

GLfloat* rect
 

Rect for storing data from frame buffer.

int rescount = 0
 

Resize variable state keeper.

int SLICES = 30
 

SLICES Rendering option for geometric primitive.

For more information see GLUT Specification.

char* sourceFileName
 

What have to be processed.

int STACKS = 30
 

STACKS Rendering option for geometric primitive.

For more information see GLUT Specification.

bool START = false
 

START Indicate if display processing is started.

int tempstate = 0
 

Current state.

bool THEREISMAP = false
 

Map generation flag.

GLfloat UPX
 

Up information.

GLfloat UPY
 

Up information.

GLfloat UPZ
 

Up information.

GLubyte valid = 0
 

Check resize function.

int vdisplay = 0
 

State variable for display function.

bool VERBOSE
 

If we have to write verbosely.

char* vrmlFileName
 

Where to save a vrml representation of the tridimensional digraph.

float WALL_DIM = 0.05
 

Default size for flat face.

int winHeigth = 0
 

Window Dimension.

int winWidth = 0
 

Window Dimension.

int WINX = 500
 

Window Width.

int WINY = 500
 

Window Height.

bool WIREFRAME = false
 

WIREFRAME If set to true set the rendering style to wireframe.

object_u* world
 

VRML world object rappresentation.

float WUHEIGHT = 10.0
 

Height of Working unit.

In single level is world's height.

int wuidl = 0
 

Working unit idl counter.

level* WULevel
 

Working unit level information.

wu* wuList
 

Working unit information.

float WUSIZE = 5.0
 

WU Edge size.


SourceForge.net Logo

Generated on Mon Jun 14 17:25:56 2004 for D.R.I.V.E. by doxygen 1.3.7