#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "iup.h"
#include "cd.h"
#include "cdiup.h"
#include "prj.h"
#include "prm.h"
#include "prmio.h"
#include "dsp.h"
#include "zbf.h"
Include dependency graph for prj.c:
Go to the source code of this file.
Project manager module. | |
See definitions of public data types and public functions in hearder file "prj.h". See specification of primitive database in hearder file "prm.h". See specification of primitive Input/Output functions in hearder file "prmio.h". See specification of primitive display functions in hearder file "dsp.h". See specification of visualization manipulation functions in file "vgl.h". Project specification: see class notes of course CIV-2801 "Fundamentos de Computacao Grafica Aplicada", period 2005.2. Revisions:
| |
#define | MAX(a, b) (((a) > (b)) ? (a) : (b)) |
void | prjResetLocalParams (void) |
This function resets the values of the local variables in this module. | |
void | prjBuildDisplayList (void) |
This function builds a display list of the current model. | |
Prm * | prjPckPrm (double x, double y) |
This function returns a pointer to a primitive that contains the given 2D point location. | |
int | prjDspZbufferCanvas (Ihandle *cv) |
This is a callback redisplay function of canvas for displaying zbuffer snap shot image. | |
void | prjInit (void) |
This function does everything is necessary to initialize the modeling and visualization part of this program. | |
void | prjQuit (void) |
This function does everything is necessary to close the modeling and visualization part of this program. | |
void | prjResize (int width, int height) |
This function initializes the display module as a result of of a canvas resize event. | |
void | prjRedisplay (void) |
This function clears the main canvas and redisplays the model described in the current database. | |
void | prjInfo (void) |
This function pops up a message dialog box with information about this program. | |
void | prjHelp (void) |
This function calls a display function to display a help list of the possible program actions and their associated keys. | |
int | prjOpenModel (FILE *fd) |
This function resets the current database, opens a new model data file, and creates the primitive data structure. | |
void | prjZbufferSnapShot (void) |
This function opens a dialog containing only one canvas and creates a snap shot image of the current model. | |
int | prjRaster2WorldXY (int x, int y, double *xw, double *yw) |
Given a mouse location point in raster canvas coordinates, this function returns the corresponding point in the XY plane in world coordinates. | |
int | prjSelectPrm (double x, double y) |
void | prjSetHeightFac (double fac) |
This function sets the height of the currently selected primitive according to the given factor and the maximum allowable height (which is equal to the maximum size in the XY plane). | |
double | prjGetHeightFac (void) |
This function returns the value of the primitive height factor. | |
void | prjResetView (void) |
This function resets the projection of the visualization. | |
void | prjFit (void) |
This function adjusts (fits) the current model on the screen. | |
void | prjPersp (void) |
This function sets the current projection type to perspective (conic projection). | |
void | prjOrtho (void) |
This function sets the current projection type to orthographic. | |
void | prjProjX (void) |
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane X = const. | |
void | prjProjY (void) |
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane Y = const. | |
void | prjProjZ (void) |
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane Y = const. | |
void | prjManipMode (void) |
This function sets the mouse interaction mode to model manipulation (screen based visualization control). | |
void | prjNavigMode (void) |
This function sets the mouse interaction mode to navigation (walk-through visualization control). | |
void | prjZoomMode (void) |
This function sets the mouse interaction mode to zoom control. | |
char * | trab_info |
String for project information text. | |
double | max_height = 50.0 |
Current primitive height limits. | |
Prm * | sel_prm = NULL |
Holds a pointer to the current selected primitive. | |
int | list_updated = 0 |
Flag for display list status. | |
Ihandle * | Ozbufferdialog = NULL |
IUP handle of canvas for displaying zbuffer snap shot image. | |
cdCanvas * | Gzbuffercanvas = NULL |
CD handle of canvas for displaying zbuffer snap shot image. | |
Defines | |
#define | _PRJ_C |
|
|
|
Definition at line 71 of file prj.c. Referenced by prjOpenModel(), and zbfMountEdges(). |
|
This function builds a display list of the current model.
Definition at line 136 of file prj.c. References dspModel(), list_updated, and prmFirst(). Referenced by prjRedisplay(), prjSelectPrm(), and prjSetHeightFac(). |
|
This is a callback redisplay function of canvas for displaying zbuffer snap shot image.
Definition at line 172 of file prj.c. References dspZbfModel(), and Gzbuffercanvas. Referenced by prjZbufferSnapShot(). |
|
This function adjusts (fits) the current model on the screen. That is, it keeps the current camera position and orientation parameters and resets the scaling such that the entire model fits on the screen. Definition at line 436 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function returns the value of the primitive height factor. This factor is a ratio between the height of the currently selected primitive and the maximum allowable height (which is equal to the maximum size in the XY plane).
Definition at line 414 of file prj.c. References max_height, prmFirst(), and prmGetHeight(). Referenced by drvMouseBt(). |
|
This function calls a display function to display a help list of the possible program actions and their associated keys.
Definition at line 236 of file prj.c. References dspHelp(). Referenced by drvRedisplay(). |
|
This function pops up a message dialog box with information about this program.
Definition at line 229 of file prj.c. References trab_info. Referenced by drvKeyCrtl(). |
|
This function does everything is necessary to initialize the modeling and visualization part of this program. Currently it is doing nothing. Definition at line 187 of file prj.c. Referenced by main(). |
|
This function sets the mouse interaction mode to model manipulation (screen based visualization control).
Definition at line 499 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function sets the mouse interaction mode to navigation (walk-through visualization control).
Definition at line 506 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function resets the current database, opens a new model data file, and creates the primitive data structure. The new model is displayed on the main canvas.
Definition at line 243 of file prj.c. References MAX, max_height, prjPersp(), prjResetLocalParams(), prmDeleteList(), prmGetGlobalBox(), prmioInterpret(), and vglcanvas. Referenced by drvKeyCrtl(). |
|
This function sets the current projection type to orthographic.
Definition at line 457 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function returns a pointer to a primitive that contains the given 2D point location. If no primitive contains the given point, a null pointer is returned. Definition at line 153 of file prj.c. References prmFirst(), prmNext(), and prmPickArea(). Referenced by prjSelectPrm(). |
|
This function sets the current projection type to perspective (conic projection).
Definition at line 444 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(), and prjOpenModel(). |
|
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane X = const.
Definition at line 466 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane Y = const.
Definition at line 477 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function sets the current projection type to orthographic (cylinder projection) and specifies the camera paramaters such that the projection plane is parallel to plane Y = const.
Definition at line 488 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function does everything is necessary to close the modeling and visualization part of this program.
Definition at line 193 of file prj.c. References Gzbuffercanvas, Ozbufferdialog, and prmDeleteList(). Referenced by drvKeyCrtl(). |
|
Given a mouse location point in raster canvas coordinates, this function returns the corresponding point in the XY plane in world coordinates. The point is found by the intersection of the pick ray with the plane z=0. A pick ray is a line between a point on the front (near) plane and a point on the back (far) plane. These two points correspond to the given point location in raster coordinates. If the ray is parallel to the z=0 plane, a false (0) status is returned.
Definition at line 336 of file prj.c. References dspGetPickRay(). Referenced by drvMouseBt(). |
|
This function clears the main canvas and redisplays the model described in the current database.
Definition at line 213 of file prj.c. References list_updated, Odatascreen, and prjBuildDisplayList(). Referenced by drvRedisplay(). |
|
This function resets the values of the local variables in this module.
Definition at line 125 of file prj.c. References list_updated, and max_height. Referenced by prjOpenModel(). |
|
This function resets the projection of the visualization. That is, it resets the camera parameters. Definition at line 428 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
This function initializes the display module as a result of of a canvas resize event.
Definition at line 206 of file prj.c. References dspInit(). Referenced by drvResize(). |
|
Definition at line 362 of file prj.c. References prjBuildDisplayList(), prjPckPrm(), prmSelect(), and prmUnselectAll(). Referenced by drvMouseBt(). |
|
This function sets the height of the currently selected primitive according to the given factor and the maximum allowable height (which is equal to the maximum size in the XY plane). Nothing will happen if no primitive is selected.
Definition at line 388 of file prj.c. References max_height, prjBuildDisplayList(), prmFirst(), prmSetHeight(), and vglcanvas. Referenced by drvSetHeightFac(). |
|
This function opens a dialog containing only one canvas and creates a snap shot image of the current model. The image is created using the z-buffer algorithm and the CD (Canvas Draw) 2D graphics system. The current visualization parameters for camera and view volume specification are adopted. Definition at line 284 of file prj.c. References Gzbuffercanvas, Ozbufferdialog, prjDspZbufferCanvas(), prmFirst(), and zbfInit(). Referenced by drvKeyCrtl(). |
|
This function sets the mouse interaction mode to zoom control. A single zoom rectangle is defined, returning the the previous interation mode. Definition at line 513 of file prj.c. References vglcanvas. Referenced by drvKeyCrtl(). |
|
CD handle of canvas for displaying zbuffer snap shot image.
Definition at line 112 of file prj.c. Referenced by prjDspZbufferCanvas(), prjQuit(), and prjZbufferSnapShot(). |
|
Flag for display list status.
Definition at line 104 of file prj.c. Referenced by prjBuildDisplayList(), prjRedisplay(), and prjResetLocalParams(). |
|
Current primitive height limits.
Definition at line 95 of file prj.c. Referenced by prjGetHeightFac(), prjOpenModel(), prjResetLocalParams(), and prjSetHeightFac(). |
|
IUP handle of canvas for displaying zbuffer snap shot image.
Definition at line 108 of file prj.c. Referenced by prjQuit(), and prjZbufferSnapShot(). |
|
Holds a pointer to the current selected primitive. A null value means that no primitive is selected. |
|
Initial value: { "\n" "\n" " CIV-2801 -- 2005.2 \n" "\n" " Fundamentos de Computacao Grafica Aplicada \n" "\n" " Departamento de Engenharia Civil \n" " PUC-Rio \n" "\n" " Trabalho No.: 3 \n" " Aluno: \n" " Data: \n" "\n" }
Definition at line 76 of file prj.c. Referenced by prjInfo(). |