Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

prj.h File Reference

#include <stdio.h>
#include "iup.h"
#include "cd.h"
#include "cdiup.h"
#include "vgl/vglc/vglc.h"
#include "vgl/vglc/vglciup.h"
#include "vgl/vglc/vglcglut.h"

Include dependency graph for prj.h:

Include dependency graph

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

Included by dependency graph

Go to the source code of this file.

Project manager module

Date:
08-Nov-2005
Author:
Luiz F. Martha
Version:
1.0
This header file contains declarations of global variables and public function specification and prototypes of the current project. This module manages the 3D visualization of extruted polygonal primitives of a model.

Project specification: see class notes of course CIV-2801 "Fundamentos de Computacao Grafica Aplicada", period 2005.2.

Revisions:

  • Report modifications here (including name and date).


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.

void * Odatascreen
 IUP handle to data canvas.

VglCanvas * vglcanvas
 VGL handle to data canvas.


Function Documentation

void prjFit void   
 

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().

double prjGetHeightFac void   
 

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).

Returns:
The selected primitive height factor. If no primitive is selected, a null value is returned.

Definition at line 414 of file prj.c.

References max_height, prmFirst(), and prmGetHeight().

Referenced by drvMouseBt().

void prjHelp void   
 

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().

void prjInfo void   
 

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().

void prjInit void   
 

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().

void prjManipMode void   
 

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().

void prjNavigMode void   
 

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().

int prjOpenModel FILE *    fd
 

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.

Parameters:
fd  - input file descritor (in)
Returns:
If there is an error while reading the input file, the function returns a false (0) status. Otherwise, it returns a true (1) status.

Definition at line 243 of file prj.c.

References MAX, max_height, prjPersp(), prjResetLocalParams(), prmDeleteList(), prmGetGlobalBox(), prmioInterpret(), and vglcanvas.

Referenced by drvKeyCrtl().

void prjOrtho void   
 

This function sets the current projection type to orthographic.

Definition at line 457 of file prj.c.

References vglcanvas.

Referenced by drvKeyCrtl().

void prjPersp void   
 

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().

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.

Definition at line 466 of file prj.c.

References vglcanvas.

Referenced by drvKeyCrtl().

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.

Definition at line 477 of file prj.c.

References vglcanvas.

Referenced by drvKeyCrtl().

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.

Definition at line 488 of file prj.c.

References vglcanvas.

Referenced by drvKeyCrtl().

void prjQuit void   
 

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().

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.

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.

Parameters:
fd  - input file descritor (in)
x  - x coord. of raster point on canvas (in)
y  - y coord. of raster point on canvas (in)
xw  - x coord. of point location in XY plane (out)
yw  - y coord. of point location in XY plane (out)
Returns:
If the intersection point is not between the two pick ray end points, a false (0) status is returned. Otherwise, a true (1) status is returned.

Definition at line 336 of file prj.c.

References dspGetPickRay().

Referenced by drvMouseBt().

void prjRedisplay void   
 

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().

void prjResetView void   
 

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().

void prjResize int    width,
int    height
 

This function initializes the display module as a result of of a canvas resize event.

Parameters:
width  - new canvas width in pixels (not used) (in)
height  - new canvas height in pixels (not used) (in)

Definition at line 206 of file prj.c.

References dspInit().

Referenced by drvResize().

int prjSelectPrm double    x,
double    y
 

Definition at line 362 of file prj.c.

References prjBuildDisplayList(), prjPckPrm(), prmSelect(), and prmUnselectAll().

Referenced by drvMouseBt().

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).

Nothing will happen if no primitive is selected.

Parameters:
fac  - height factor (between 0 and 1) (in)

Definition at line 388 of file prj.c.

References max_height, prjBuildDisplayList(), prmFirst(), prmSetHeight(), and vglcanvas.

Referenced by drvSetHeightFac().

void prjZbufferSnapShot void   
 

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().

void prjZoomMode void   
 

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().


Variable Documentation

void* Odatascreen
 

IUP handle to data canvas.

Definition at line 278 of file prj.h.

Referenced by drvResize(), dspInit(), main(), and prjRedisplay().

VglCanvas* vglcanvas
 

VGL handle to data canvas.

Definition at line 280 of file prj.h.

Referenced by drvKeyCrtl(), main(), prjFit(), prjManipMode(), prjNavigMode(), prjOpenModel(), prjOrtho(), prjPersp(), prjProjX(), prjProjY(), prjProjZ(), prjResetView(), prjSetHeightFac(), and prjZoomMode().


Generated on Tue Nov 8 10:58:05 2005 for Trab3 by doxygen1.2.18