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

Referência do Arquivo dsp.c

#include <stdio.h>
#include <math.h>
#include "cd.h"
#include "wd.h"
#include "crs.h"
#include "dsp.h"
#include "t2d.h"

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

Include dependency graph

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

Display module

Data:
05-Oct-2004
Autor:
Luiz F. Martha
Versão:
1.0
This file contains functions to display primitives of a model in current database. It also contains functions to adjust the window (visible portion of the model) for visualization.

The adopted model data structure is described in module "crs.c".

The basic graphics system used to display primitives is the "CD - Canvas Drawing". Please refer to CD documentation for additional information.

This file must be completed as part of this assignment. The points to complete are indicated by a comment of the type: **** COMPLETE AQUI: xxx ****

Revisions:

  • Report modifications here (including name and date).


#define ToDegree(a)   ((a)*(double)57.295779513)
 Defines factor to transform angles in radians to degree.

#define ANGLE_TOL   0.01
 Defines a tolerance value for angles in degrees.

#define LOAD_TOL   0.01
 Defines a tolerance value for load values.

#define BACKGROUND_COLOR   CD_WHITE
 Defines white as background color.

#define MEMBER_COLOR   CD_DARK_YELLOW
 Defines dark yellow as foreground color for beam members.

#define LOAD_COLOR   CD_DARK_BLUE
 Defines dark blue as foreground color for beam loads.

#define MOMENT_COLOR   CD_BLACK
 Defines black as foreground color for beam end moments.

#define UNBALANCED_COLOR   CD_RED
 Defines red color for unbalanced nodes.

#define BALANCED_COLOR   CD_GREEN
 Defines green color for balanced nodes.

#define FIXED_COLOR   CD_BLACK
 Defines black color for fixed-rotation nodes.

#define UNBALANCED_MARK   CD_BOX
 Defines box mark for unbalanced nodes.

#define BALANCED_MARK   CD_DIAMOND
 Defines diamond mark for balanced nodes.

#define FIXED_MARK   CD_BOX
 Defines box mark for fixed-rotation nodes.

#define NODE_MARK_SIZE   7
 Defines size in pixels for node marks.

#define HINGE_BACKGROUND_MARK   CD_CIRCLE
 Define circle mark for hinge background.

#define HINGE_FOREGROUND_MARK   CD_HOLLOW_CIRCLE
 Define hollow circle mark for hinge background.

#define HINGE_MARK_SIZE   9
 Define size in pixels for hinge mark.

#define HINGE_AXIAL_SHIFT   0.015
 Defines factor of axial shift for member end hinge.

#define MOMENT_AXIAL_SHIFT   0.01
 Defines factor of axial shift for moment value display with respect to window maximum size.

#define MOMENT_TRANSV_SHIFT   0.007
 Defines factor of transversal shift for moment value display with respect to window maximum size.

#define LOAD_AXIAL_SHIFT   0.01
 Defines factor of axial shift for member uniform load display with respect to window maximum size.

#define LOAD_TRANSV_SHIFT   0.008
 Defines factor of transversal shift for member uniform load and load value display with respect to window maximum size.

#define LOAD_ARROW_SIZE   0.02
 Defines factor of member uniform load arrow size with respect to window maximum size.

#define LOAD_TIP_SIZE   0.004
 Defines factor of member uniform load tip size with respect to window maximum size.

#define LOAD_STEP_SIZE   0.02
 Defines factor of member uniform load step size with respect to window maximum size.

void _dspAttSizes (void)
 This function computes the attributes sizes according to the defined factors and the maximum window size.

void _dspMember (int id)
 This function displays a member that is given by its index in the global axis system.

void _dspMemberAtt (double x0, double y0, double len, double angle, double q, int rotlib0, int rotlib1, double m0, double m1)
 This function displays the attributes of a member.

void _dspMemberLoad (double len, double q, int def_orient)
 This function displays the load of a member.

void _dspLoadArrow (double x, double q, int def_orient)
 This function displays the a load arrow load.

void dspInit (void)
 This function initializes the dsp module.

void dspWindow (double scale, double *xmin, double *xmax, double *ymin, double *ymax)
 This function adjusts the given window limits according to the given scaling factor.

void dspPanWindow (double dx, double dy, double *xmin, double *xmax, double *ymin, double *ymax)
 This function shifts the given window limits according to the given pan (displacement) factors.

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

void dspModel (void)
 This function displays the current active model according to its current solution status.

double hinge_axial_shift
 Axial shift for member end hinge display.

double moment_axial_shift
 Axial shift for moment value display.

double moment_transv_shift
 Tranversal shift for moment value display.

double load_axial_shift
 Axial shift for member uniform load display.

double load_transv_shift
 Transversal shift for member uniform load and load value display.

double load_arrow_size
 Member uniform load arrow size.

double load_tip_size
 Member uniform load tip size.

double load_step_size
 Member uniform load step size.

int dsp_load = 1
 Visibility flag for member loads.


Deinições e macros

#define ANGLE_TOL   0.01
 

Defines a tolerance value for angles in degrees.

Definição na linha 59 do arquivo dsp.c.

Referenciado por _dspMember().

#define BACKGROUND_COLOR   CD_WHITE
 

Defines white as background color.

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

Referenciado por _dspMemberAtt() e dspInit().

#define BALANCED_COLOR   CD_GREEN
 

Defines green color for balanced nodes.

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

#define BALANCED_MARK   CD_DIAMOND
 

Defines diamond mark for balanced nodes.

Definição na linha 89 do arquivo dsp.c.

#define FIXED_COLOR   CD_BLACK
 

Defines black color for fixed-rotation nodes.

Definição na linha 83 do arquivo dsp.c.

#define FIXED_MARK   CD_BOX
 

Defines box mark for fixed-rotation nodes.

Definição na linha 92 do arquivo dsp.c.

#define HINGE_AXIAL_SHIFT   0.015
 

Defines factor of axial shift for member end hinge.

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

Referenciado por _dspAttSizes().

#define HINGE_BACKGROUND_MARK   CD_CIRCLE
 

Define circle mark for hinge background.

Definição na linha 98 do arquivo dsp.c.

Referenciado por _dspMemberAtt().

#define HINGE_FOREGROUND_MARK   CD_HOLLOW_CIRCLE
 

Define hollow circle mark for hinge background.

Definição na linha 101 do arquivo dsp.c.

Referenciado por _dspMemberAtt().

#define HINGE_MARK_SIZE   9
 

Define size in pixels for hinge mark.

Definição na linha 104 do arquivo dsp.c.

Referenciado por _dspMemberAtt().

#define LOAD_ARROW_SIZE   0.02
 

Defines factor of member uniform load arrow size with respect to window maximum size.

Definição na linha 142 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define LOAD_AXIAL_SHIFT   0.01
 

Defines factor of axial shift for member uniform load display with respect to window maximum size.

Definição na linha 128 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define LOAD_COLOR   CD_DARK_BLUE
 

Defines dark blue as foreground color for beam loads.

Definição na linha 71 do arquivo dsp.c.

Referenciado por _dspMemberLoad().

#define LOAD_STEP_SIZE   0.02
 

Defines factor of member uniform load step size with respect to window maximum size.

Definição na linha 156 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define LOAD_TIP_SIZE   0.004
 

Defines factor of member uniform load tip size with respect to window maximum size.

Definição na linha 149 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define LOAD_TOL   0.01
 

Defines a tolerance value for load values.

Definição na linha 62 do arquivo dsp.c.

Referenciado por _dspMemberAtt().

#define LOAD_TRANSV_SHIFT   0.008
 

Defines factor of transversal shift for member uniform load and load value display with respect to window maximum size.

Definição na linha 135 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define MEMBER_COLOR   CD_DARK_YELLOW
 

Defines dark yellow as foreground color for beam members.

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

Referenciado por _dspMemberAtt().

#define MOMENT_AXIAL_SHIFT   0.01
 

Defines factor of axial shift for moment value display with respect to window maximum size.

Definição na linha 114 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define MOMENT_COLOR   CD_BLACK
 

Defines black as foreground color for beam end moments.

Definição na linha 74 do arquivo dsp.c.

Referenciado por _dspMemberAtt().

#define MOMENT_TRANSV_SHIFT   0.007
 

Defines factor of transversal shift for moment value display with respect to window maximum size.

Definição na linha 121 do arquivo dsp.c.

Referenciado por _dspAttSizes().

#define NODE_MARK_SIZE   7
 

Defines size in pixels for node marks.

Definição na linha 95 do arquivo dsp.c.

#define ToDegree  )     ((a)*(double)57.295779513)
 

Defines factor to transform angles in radians to degree.

Definição na linha 56 do arquivo dsp.c.

Referenciado por _dspMember().

#define UNBALANCED_COLOR   CD_RED
 

Defines red color for unbalanced nodes.

Definição na linha 77 do arquivo dsp.c.

#define UNBALANCED_MARK   CD_BOX
 

Defines box mark for unbalanced nodes.

Definição na linha 86 do arquivo dsp.c.


Funções

void _dspAttSizes void   )  [static]
 

This function computes the attributes sizes according to the defined factors and the maximum window size.

Definição na linha 181 do arquivo dsp.c.

Referências HINGE_AXIAL_SHIFT, hinge_axial_shift, LOAD_ARROW_SIZE, load_arrow_size, LOAD_AXIAL_SHIFT, load_axial_shift, LOAD_STEP_SIZE, load_step_size, LOAD_TIP_SIZE, load_tip_size, LOAD_TRANSV_SHIFT, load_transv_shift, MOMENT_AXIAL_SHIFT, moment_axial_shift, MOMENT_TRANSV_SHIFT e moment_transv_shift.

Referenciado por dspModel().

void _dspLoadArrow double  x,
double  q,
int  def_orient
[static]
 

This function displays the a load arrow load.

Parâmetros:
x - arrow position along member (local system)
q - member uniform load (positive uppward in local sys.)
def_orient - flag for default orientation (left to right or vert.)

Definição na linha 445 do arquivo dsp.c.

Referenciado por _dspMemberLoad().

void _dspMember int  id  )  [static]
 

This function displays a member that is given by its index in the global axis system.

The function displays hinges for member end rotation liberations (if they exist), the member uniform load (if there one), and the bending moments values at its ends.

Parâmetros:
id - index of tarbet member to display (in)

Definição na linha 218 do arquivo dsp.c.

Referências _dspMemberAtt(), ANGLE_TOL, crsGetMemberMoments(), crsGetMemberNodes(), crsGetMemberRotLibs(), crsGetMemberUnifLoad(), crsGetNodeCoords() e ToDegree.

Referenciado por dspModel().

void _dspMemberAtt double  x0,
double  y0,
double  len,
double  angle,
double  q,
int  rotlib0,
int  rotlib1,
double  m0,
double  m1
[static]
 

This function displays the attributes of a member.

Parâmetros:
x0 - first node x coordinate
y0 - first node y coordinate
len - member length
angle - member orientation angle in degrees
q - member uniform load (positive uppward in local sys.)
rotlib0 - code of first end member rotation liberation
rotlib1 - code of second end member rotation liberation
m0 - bending moment at first member end
m1 - bending moment at second member end

Definição na linha 297 do arquivo dsp.c.

Referências _dspMemberLoad(), BACKGROUND_COLOR, dsp_load, hinge_axial_shift, HINGE_BACKGROUND_MARK, HINGE_FOREGROUND_MARK, HINGE_MARK_SIZE, LOAD_TOL, MEMBER_COLOR, moment_axial_shift, MOMENT_COLOR, moment_transv_shift, ROT_FIX, ROT_FREE, t2dIdentity(), t2dRotate(), t2dTransform() e t2dTranslate().

Referenciado por _dspMember().

void _dspMemberLoad double  len,
double  q,
int  def_orient
[static]
 

This function displays the load of a member.

Parâmetros:
len - member length
q - member uniform load (positive uppward in local sys.)
def_orient - flag for default orientation (left to right or vert.)

Definição na linha 397 do arquivo dsp.c.

Referências _dspLoadArrow(), load_axial_shift, LOAD_COLOR e load_step_size.

Referenciado por _dspMemberAtt().

void dspInit void   ) 
 

This function initializes the dsp module.

It sets the background color as white. It sets the font type as Courier small.

Definição na linha 462 do arquivo dsp.c.

Referências BACKGROUND_COLOR.

Referenciado por prjInit().

void dspLoadDisplay 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 556 do arquivo dsp.c.

Referências dsp_load.

Referenciado por prjLoadDisplay().

void dspModel void   ) 
 

This function displays the current active model according to its current solution status.

Definição na linha 566 do arquivo dsp.c.

Referências _dspAttSizes(), _dspMember() e crsGetNumMembers().

Referenciado por prjClipboard(), prjPrint() e prjRedisplay().

void dspPanWindow double  dx,
double  dy,
double *  xmin,
double *  xmax,
double *  ymin,
double *  ymax
 

This function shifts the given window limits according to the given pan (displacement) factors.

A negative horizontal displacement will result in a shift to the right of the displayed objects in the canvas viewport. A positive horizontal displacement will result in a shift to the left. A negative vertical displacement will result in a upward shift and a positive vertical displacement in a downward shift.

Parâmetros:
dx - horizontal window displacement (in)
dy - vertical window displacement (in)
xmin - given and adjusted left window limit (in/out)
xmax - given and adjusted right window limit (in/out)
ymin - given and adjusted bottom window limit (in/out)
ymax - given and adjusted top window limit (in/out)

Definição na linha 535 do arquivo dsp.c.

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

void dspWindow double  scale,
double *  xmin,
double *  xmax,
double *  ymin,
double *  ymax
 

This function adjusts the given window limits according to the given scaling factor.

A factor less than one indicates that the window will be decreased, and the result is that the displayed objects will appear bigger in the canvas viewport. A factor greater than one will result in smaller displayed objects in the canvas viewport. The limits are adjusted to be consistent with the current active canvas viewport aspect ratio. The adjustment is such that the center of the given window is maintained.

Parâmetros:
scale - scaling factor for adjusting window (in)
xmin - given and adjusted left window limit (in/out)
xmax - given and adjusted right window limit (in/out)
ymin - given and adjusted bottom window limit (in/out)
ymax - given and adjusted top window limit (in/out)

Definição na linha 486 do arquivo dsp.c.

Referenciado por prjFit(), prjHelp(), prjInit(), prjNew(), prjOpenModel(), prjResize(), prjZoomIn() e prjZoomOut().


Variáveis

int dsp_load = 1 [static]
 

Visibility flag for member loads.

Definição na linha 162 do arquivo dsp.c.

Referenciado por _dspMemberAtt() e dspLoadDisplay().

double hinge_axial_shift [static]
 

Axial shift for member end hinge display.

Definição na linha 110 do arquivo dsp.c.

Referenciado por _dspAttSizes() e _dspMemberAtt().

double load_arrow_size [static]
 

Member uniform load arrow size.

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

Referenciado por _dspAttSizes().

double load_axial_shift [static]
 

Axial shift for member uniform load display.

Definição na linha 131 do arquivo dsp.c.

Referenciado por _dspAttSizes() e _dspMemberLoad().

double load_step_size [static]
 

Member uniform load step size.

Definição na linha 159 do arquivo dsp.c.

Referenciado por _dspAttSizes() e _dspMemberLoad().

double load_tip_size [static]
 

Member uniform load tip size.

Definição na linha 152 do arquivo dsp.c.

Referenciado por _dspAttSizes().

double load_transv_shift [static]
 

Transversal shift for member uniform load and load value display.

Definição na linha 138 do arquivo dsp.c.

Referenciado por _dspAttSizes().

double moment_axial_shift [static]
 

Axial shift for moment value display.

Definição na linha 117 do arquivo dsp.c.

Referenciado por _dspAttSizes() e _dspMemberAtt().

double moment_transv_shift [static]
 

Tranversal shift for moment value display.

Definição na linha 124 do arquivo dsp.c.

Referenciado por _dspAttSizes() e _dspMemberAtt().


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