Página Principal | Lista Alfabética | Lista de Componentes | Lista de Arquivos | Componentes Membros | Arquivos Membros

Referência do Arquivo prj.c

#include <stdio.h>
#include "iup.h"
#include "cd.h"
#include "cdiup.h"
#include "cdclipbd.h"
#include "cdprint.h"
#include "wd.h"
#include "prj.h"
#include "crs.h"
#include "nfr.h"
#include "dsp.h"

Gráfico de dependência de inclusões para prj.c:

Include dependency graph

Vá para o código-fonte deste arquivo.

Project manager module.

Data:
03-Oct-2004
Autor:
Luiz F. Martha
Versão:
1.0
This file contains project functions to visualize and manipulate polygonal primitives of a model.

See specification of model manipulation module in hearder file "crs.h".

See specification of model Input functions in hearder file "nfr.h".

See specification of primitive display functions in hearder file "dsp.h".

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

Revisions:

  • Report modifications here (including name and date).


#define SOLUTION_TOL   0.01
 Defines the iterative solution tolerance value.

#define FIT_FACTOR   0.10
 Defines the factor for adjusting (fitting) image of the entire model on the canvas.

#define ZOOM_FACTOR   0.20
 Defines the factor for zooming in and out image of model on canvas.

#define PAN_FACTOR   0.05
 Defines the factor with respect of window size for translating (pan) image of model on canvas.

#define PICK_FACTOR   0.01
 Defines the factor with respect to minimum window size of tolerance for picking nodes.

void prjResetWindow (void)
 This function resets the limiting values of the visualization window.

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.

int prjChkEmptyModel (void)
 This function verifies whether there is no active model in memory.

void prjResize (int width, int height)
 This function sets the main canvas viewport according to given canvas sizes.

void prjRedisplay (void)
 This function clears the main canvas and redisplays the current active model.

void prjInfo (void)
 This function pops up a message dialog box with information about this program.

void prjHelp (void)
 This function displays a help list of the possible program actions and their associated keys.

void prjNew (void)
 This function resets the current database so that the user can start a new model.

int prjOpenModel (FILE *fd)
 This function resets the current database, opens a new model data file, and creates the model data structure.

void prjSaveResults (FILE *fd)
 This function writes the results of the current model in memory in a file.

void prjProcessInit (void)
 This function reinitializes the iterative solution process of the current ative model.

int prjProcessGoThru (void)
 This function goes through the entire iterative solution process of the current ative model.

int prjProcessStep (void)
 This function processes the equilibrium of a node that has the maximum unbalanced moment in absolute value.

int prjProcessNode (double x, double y)
 This function processes the equilibrium of a node that is close to the given point (x,y).

void prjLoadDisplay (int on_off)
 This function sets the flag for displaying member loads.

void prjPrint (void)
 This function sends the current image on the screen to the active printer.

void prjClipboard (void)
 This function copies the current image on the screen to the clipboard (transfering area).

void prjFit (void)
 This function adjusts the world coordinate limits of the visualization window to fit the entire model.

void prjZoomIn (void)
 This function adjusts the world coordinate limits of the visualization window based on a zoom factor.

void prjZoomOut (void)
 This function adjusts the world coordinate limits of the visualization window based on a zoom factor.

void prjPanLeft (void)
 This function moves to the right the world coordinate limits of the visualization window based on a pan factor.

void prjPanRight (void)
 This function moves to the left the world coordinate limits of the visualization window based on a pan factor.

void prjPanDown (void)
 This function moves upwards the world coordinate limits of the visualization window based on a pan factor.

void prjPanUp (void)
 This function moves downwards the world coordinate limits of the visualization window based on a pan factor.

char * trab_info
 String for project information text.

double win_xmin = 0.0
 Current visualization window left limit.

double win_xmax = 50.0
 Current visualization window right limit.

double win_ymin = 0.0
 Current visualization window bottom limit.

double win_ymax = 50.0
 Current visualization window top limit.

void * crs_model = NULL
 Pointer to model data.


Definições e Macros

#define _PRJ_C


Deinições e macros

#define _PRJ_C
 

Definição na linha 7 do arquivo prj.c.

#define FIT_FACTOR   0.10
 

Defines the factor for adjusting (fitting) image of the entire model on the canvas.

Definição na linha 65 do arquivo prj.c.

Referenciado por prjFit(), prjHelp() e prjOpenModel().

#define PAN_FACTOR   0.05
 

Defines the factor with respect of window size for translating (pan) image of model on canvas.

Definição na linha 72 do arquivo prj.c.

Referenciado por prjPanDown(), prjPanLeft(), prjPanRight() e prjPanUp().

#define PICK_FACTOR   0.01
 

Defines the factor with respect to minimum window size of tolerance for picking nodes.

Definição na linha 76 do arquivo prj.c.

Referenciado por prjProcessNode().

#define SOLUTION_TOL   0.01
 

Defines the iterative solution tolerance value.

Definição na linha 61 do arquivo prj.c.

Referenciado por prjOpenModel() e prjProcessInit().

#define ZOOM_FACTOR   0.20
 

Defines the factor for zooming in and out image of model on canvas.

Definição na linha 68 do arquivo prj.c.

Referenciado por prjZoomIn() e prjZoomOut().


Funções

int prjChkEmptyModel void   ) 
 

This function verifies whether there is no active model in memory.

Retorna:
A true (1) status if there is no model active in memory or a false (0) status otherwise.

Definição na linha 188 do arquivo prj.c.

Referências crsGetNumMembers().

Referenciado por drvMouseBt() e drvRedisplay().

void prjClipboard void   ) 
 

This function copies the current image on the screen to the clipboard (transfering area).

Only works in Windows environment.

Definição na linha 579 do arquivo prj.c.

Referências crsGetNumMembers(), dspModel() e Gdatascreen.

Referenciado por drvKeyCrtl().

void prjFit void   ) 
 

This function adjusts the world coordinate limits of the visualization window to fit the entire model.

It gets the bounding box of the current model and increases the window sizes based on a fit factor, maintaining its current center.

Definição na linha 601 do arquivo prj.c.

Referências CRS_SUCCESS, crsGetGlobalBox(), dspWindow(), FIT_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjHelp void   ) 
 

This function displays a help list of the possible program actions and their associated keys.

Definição na linha 244 do arquivo prj.c.

Referências dspWindow(), FIT_FACTOR, win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl() e drvRedisplay().

void prjInfo void   ) 
 

This function pops up a message dialog box with information about this program.

Definição na linha 234 do arquivo prj.c.

Referências trab_info.

Referenciado por drvKeyCrtl().

void prjInit void   ) 
 

This function does everything is necessary to initialize the modeling and visualization part of this program.

Definição na linha 145 do arquivo prj.c.

Referências dspInit(), dspWindow(), Gdatascreen, Odatascreen, win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por main().

void prjLoadDisplay int  on_off  ) 
 

This function sets the flag for displaying member loads.

If the given on_off parameter is true (1), the member loads are displayed. If this parameter is false (0), no load is displayed.

Parâmetros:
on_off - flag for displaying member loads (in)

Definição na linha 554 do arquivo prj.c.

Referências dspLoadDisplay() e prjRedisplay().

Referenciado por drvKeyCrtl().

void prjNew void   ) 
 

This function resets the current database so that the user can start a new model.

Definição na linha 317 do arquivo prj.c.

Referências crs_model, crsFreeModel(), dspWindow(), prjRedisplay(), prjResetWindow(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

int prjOpenModel FILE *  fd  ) 
 

This function resets the current database, opens a new model data file, and creates the model data structure.

It also initializes the iterative solution. The new model is displayed on the main canvas.

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

Definição na linha 343 do arquivo prj.c.

Referências crs_model, CRS_SUCCESS, crsActivateModel(), crsCompleteModel(), crsFreeModel(), crsGetGlobalBox(), crsResetSolution(), dspWindow(), FIT_FACTOR, nfrCrsMembers(), nfrCrsModel(), nfrCrsNodes(), prjRedisplay(), prjResetWindow(), SOLUTION_TOL, win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjPanDown void   ) 
 

This function moves upwards the world coordinate limits of the visualization window based on a pan factor.

The result is that the displayed model will appear shifted downwards in the canvas viewport.

Definição na linha 692 do arquivo prj.c.

Referências crsGetNumMembers(), dspPanWindow(), PAN_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjPanLeft void   ) 
 

This function moves to the right the world coordinate limits of the visualization window based on a pan factor.

The result is that the displayed model will appear shifted to left in the canvas viewport.

Definição na linha 652 do arquivo prj.c.

Referências crsGetNumMembers(), dspPanWindow(), PAN_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjPanRight void   ) 
 

This function moves to the left the world coordinate limits of the visualization window based on a pan factor.

The result is that the displayed model will appear shifted to right in the canvas viewport.

Definição na linha 672 do arquivo prj.c.

Referências crsGetNumMembers(), dspPanWindow(), PAN_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjPanUp void   ) 
 

This function moves downwards the world coordinate limits of the visualization window based on a pan factor.

The result is that the displayed model will appear shifted upwards in the canvas viewport.

Definição na linha 712 do arquivo prj.c.

Referências crsGetNumMembers(), dspPanWindow(), PAN_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvKeyCrtl().

void prjPrint void   ) 
 

This function sends the current image on the screen to the active printer.

Definição na linha 565 do arquivo prj.c.

Referências crsGetNumMembers(), dspModel() e Gdatascreen.

Referenciado por drvKeyCrtl().

int prjProcessGoThru void   ) 
 

This function goes through the entire iterative solution process of the current ative model.

Nothing will happen if there is no model currently active or if all the nodes of the model are already balanced.

Retorna:
CRS_SUCCESS (1), CRS_NO_STEP_TO_GO (0), or CRS_NO_MODEL_DEFINED (-2).

Definição na linha 466 do arquivo prj.c.

Referências CRS_NO_MODEL_DEFINED, CRS_SUCCESS, crsGetNumMembers(), crsSolveModel() e prjRedisplay().

Referenciado por drvKeyCrtl().

void prjProcessInit void   ) 
 

This function reinitializes the iterative solution process of the current ative model.

Nothing will happen if there is no model currently active.

Definição na linha 447 do arquivo prj.c.

Referências crsGetNumMembers(), crsResetSolution(), prjRedisplay() e SOLUTION_TOL.

Referenciado por drvKeyCrtl().

int prjProcessNode double  x,
double  y
 

This function processes the equilibrium of a node that is close to the given point (x,y).

Nothing will happen if there is no model currently active or there is no node close to the given point.

Parâmetros:
x - x coordinate of given point (in)
y - y coordinate of given point (in)
Retorna:
CRS_SUCCESS (1), CRS_NO_STEP_TO_GO (0), CRS_FAILURE (-1), CRS_NO_MODEL_DEFINED (-2), or CRS_FIXED_NODE (-3).

Definição na linha 518 do arquivo prj.c.

Referências CRS_FAILURE, CRS_NO_MODEL_DEFINED, CRS_SUCCESS, crsGetNumMembers(), crsPickNode(), crsProcessNode(), PICK_FACTOR, prjRedisplay(), win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvMouseBt().

int prjProcessStep void   ) 
 

This function processes the equilibrium of a node that has the maximum unbalanced moment in absolute value.

Nothing will happen if there is no model currently active or if all the nodes of the model are already balanced.

Retorna:
CRS_SUCCESS (1), CRS_NO_STEP_TO_GO (0), or CRS_NO_MODEL_DEFINED (-2).

Definição na linha 490 do arquivo prj.c.

Referências CRS_NO_MODEL_DEFINED, CRS_SUCCESS, crsGetNumMembers(), crsStepSolution() e prjRedisplay().

Referenciado por drvKeyCrtl().

void prjQuit void   ) 
 

This function does everything is necessary to close the modeling and visualization part of this program.

Definição na linha 172 do arquivo prj.c.

Referências crs_model, crsFreeModel() e Gdatascreen.

Referenciado por drvKeyCrtl().

void prjRedisplay void   ) 
 

This function clears the main canvas and redisplays the current active model.

Definição na linha 223 do arquivo prj.c.

Referências dspModel().

Referenciado por drvRedisplay(), prjFit(), prjLoadDisplay(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjProcessGoThru(), prjProcessInit(), prjProcessNode(), prjProcessStep(), prjZoomIn() e prjZoomOut().

void prjResetWindow void   )  [static]
 

This function resets the limiting values of the visualization window.

Definição na linha 127 do arquivo prj.c.

Referências win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por prjNew() e prjOpenModel().

void prjResize int  width,
int  height
 

This function sets the main canvas viewport according to given canvas sizes.

Parâmetros:
width - new canvas width in pixels (in)
height - new canvas height in pixels (in)

Definição na linha 204 do arquivo prj.c.

Referências dspWindow(), Gdatascreen, win_xmax, win_xmin, win_ymax e win_ymin.

Referenciado por drvResize().

void prjSaveResults FILE *  fd  ) 
 

This function writes the results of the current model in memory in a file.

Parâmetros:
fd - input file descritor (in)

Definição na linha 415 do arquivo prj.c.

Referências crsGetMemberMoments(), crsGetMemberNodes(), crsGetNodeCoords() e crsGetNumMembers().

Referenciado por drvKeyCrtl().

void prjZoomIn void   ) 
 

This function adjusts the world coordinate limits of the visualization window based on a zoom factor.

It decreases the window sizes, maintaining its current center. The result is that the displayed model will appear bigger in the canvas viewport.

Definição na linha 619 do arquivo prj.c.

Referências crsGetNumMembers(), dspWindow(), prjRedisplay(), win_xmax, win_xmin, win_ymax, win_ymin e ZOOM_FACTOR.

Referenciado por drvKeyCrtl().

void prjZoomOut void   ) 
 

This function adjusts the world coordinate limits of the visualization window based on a zoom factor.

It increases the window sizes, maintaining its current center. The result is that the displayed model will appear smaller in the canvas viewport.

Definição na linha 636 do arquivo prj.c.

Referências crsGetNumMembers(), dspWindow(), prjRedisplay(), win_xmax, win_xmin, win_ymax, win_ymin e ZOOM_FACTOR.

Referenciado por drvKeyCrtl().


Variáveis

void* crs_model = NULL [static]
 

Pointer to model data.

Definição na linha 115 do arquivo prj.c.

Referenciado por prjNew(), prjOpenModel() e prjQuit().

char* trab_info [static]
 

Valor Inicial:

   {
    "\n"
    "\n"
    "                   CIV-2801  -- 2004.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"
   }
String for project information text.

Definição na linha 80 do arquivo prj.c.

Referenciado por prjInfo().

double win_xmax = 50.0 [static]
 

Current visualization window right limit.

Definição na linha 103 do arquivo prj.c.

Referenciado por prjFit(), prjHelp(), prjInit(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjProcessNode(), prjResetWindow(), prjResize(), prjZoomIn() e prjZoomOut().

double win_xmin = 0.0 [static]
 

Current visualization window left limit.

Definição na linha 99 do arquivo prj.c.

Referenciado por prjFit(), prjHelp(), prjInit(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjProcessNode(), prjResetWindow(), prjResize(), prjZoomIn() e prjZoomOut().

double win_ymax = 50.0 [static]
 

Current visualization window top limit.

Definição na linha 111 do arquivo prj.c.

Referenciado por prjFit(), prjHelp(), prjInit(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjProcessNode(), prjResetWindow(), prjResize(), prjZoomIn() e prjZoomOut().

double win_ymin = 0.0 [static]
 

Current visualization window bottom limit.

Definição na linha 107 do arquivo prj.c.

Referenciado por prjFit(), prjHelp(), prjInit(), prjNew(), prjOpenModel(), prjPanDown(), prjPanLeft(), prjPanRight(), prjPanUp(), prjProcessNode(), prjResetWindow(), prjResize(), prjZoomIn() e prjZoomOut().


Gerado em Tue Oct 5 04:55:08 2004 para Trab3 por doxygen 1.3.4