X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fsgp.h;h=d913ede25d3f2ed589f39fdd3021104585d80e46;hb=e559ff1655d5c6103447912e345a1229fdaa4a35;hp=32ac0843e60bdcfde61b45feb0fca77fe10eb702;hpb=13838bda88b63a2535b5baaf7197006767de4b8e;p=ctsim.git diff --git a/include/sgp.h b/include/sgp.h index 32ac084..d913ede 100644 --- a/include/sgp.h +++ b/include/sgp.h @@ -1,3 +1,38 @@ +/***************************************************************************** +** This is part of the CTSim program +** Copyright (C) 1983-2000 Kevin Rosenberg +** +** $Id: sgp.h,v 1.6 2000/05/11 14:07:00 kevin Exp $ +** $Log: sgp.h,v $ +** Revision 1.6 2000/05/11 14:07:00 kevin +** Added support for Windows NT +** +** Revision 1.5 2000/05/07 12:46:19 kevin +** made c++ compatible +** +** Revision 1.4 2000/04/30 19:17:35 kevin +** Set up include files for conditional INTERACTIVE_GRAPHICS +** +** Revision 1.3 2000/04/28 18:35:21 kevin +** removed unused files +** +** Revision 1.2 2000/04/28 14:14:16 kevin +** *** empty log message *** +** +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License (version 2) as +** published by the Free Software Foundation. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +******************************************************************************/ /*----------------------------------------------------------------------*/ /* Standard Graphics Package Header File */ /*----------------------------------------------------------------------*/ @@ -6,13 +41,12 @@ #define __H_SGP #include "kstddef.h" +#include "kmath.h" -/* Write modes for CPIX_?????() routines */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ -#define CPIX_WRT 0 -#define CPIX_XOR 1 -#define CPIX_AND 2 -#define CPIX_OR 3 /* device names */ @@ -157,166 +191,96 @@ typedef struct raster_st RASTER; /*-------------------------------------------------------------------------*/ -typedef double GRFMTX_2D[3][3]; -typedef double GRFMTX_3D[4][4]; - /* circle.c */ void circle(const double r); void drawarc(double start, double stop, const double r); -/* cliprect.c */ -int cliprect(double *x1, double *y1, double *x2, double *y2, const double rect[4]); -/* crt_line.c */ -void crt_line(int x1, int y1, int x2, int y2, int color); -int prtline(int func, int x1, int y1, int x2, int y2, int arg1, int arg2); -void crt_line_style(int style); -/* crt_wdot.c */ -void crt_wdot(int x, int y, int c); -void ega_wdot(int x, int y, int c); -void prtdot(int x, int y, int c); -void prtndc(void); -void cpix_set(int x, int y, int c); -void cpix_init(void); -void cpix_set_wrt_mode(int mode); -void cpix_calc_addr(void); -void cpix_set_addr(int addr); -void cpix_inc_col(void); -int cpix_get_addr(void); -void cpix_term(void); -void cpix_setcolor(int c); -void cpix_set_at_addr(int addr, int c); -void cpix_inc_row(void); -void cpix_set_color(int c); /* ctm.c */ -int ctm_xlat_pre_2(double x, double y); -int ctm_xlat_post_2(double x, double y); -int ctm_scale_pre_2(double sx, double sy); -int ctm_scale_post_2(double sx, double sy); -int ctm_rotate_pre_2(double theta); -int ctm_rotate_post_2(double theta); -int ctm_shear_pre_2(double shrx, double shry); -int ctm_shear_post_2(double shrx, double shry); -int xlat_gmtx_2(GRFMTX_2D m, double x, double y); -int scale_gmtx_2(GRFMTX_2D m, double sx, double sy); -int shear_gmtx_2(GRFMTX_2D m, double shrx, double shry); -int rotate_gmtx_2(GRFMTX_2D m, double theta); -int ident_gmtx_2(GRFMTX_2D m); -int mult_gmtx_2(GRFMTX_2D a, GRFMTX_2D b, GRFMTX_2D c); -int invert_gmtx_2(GRFMTX_2D a, GRFMTX_2D b); +void ctm_xlat_pre_2(double x, double y); +void ctm_xlat_post_2(double x, double y); +void ctm_scale_pre_2(double sx, double sy); +void ctm_scale_post_2(double sx, double sy); +void ctm_rotate_pre_2(double theta); +void ctm_rotate_post_2(double theta); +void ctm_shear_pre_2(double shrx, double shry); +void ctm_shear_post_2(double shrx, double shry); +void xlat_gmtx_2(GRFMTX_2D m, double x, double y); +void scale_gmtx_2(GRFMTX_2D m, double sx, double sy); +void shear_gmtx_2(GRFMTX_2D m, double shrx, double shry); +void rotate_gmtx_2(GRFMTX_2D m, double theta); +void ident_gmtx_2(GRFMTX_2D m); +void mult_gmtx_2(GRFMTX_2D a, GRFMTX_2D b, GRFMTX_2D c); +void invert_gmtx_2(GRFMTX_2D a, GRFMTX_2D b); double determ_gmtx_2(GRFMTX_2D a); /* drawbox.c */ -int drawbox(double xmin, double ymin, double xmax, double ymax); -/* gp.c */ -int gptrace(int state); -int viewprt3(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax); -int window3(double xmin, double ymin, double xmax, double ymax); -int setproj(int pr, double x, double y, double z); -int setvrp(double x, double y, double z); -int setvpn(double x, double y, double z); -int setvup(double x, double y, double z); -int viewdepth(double front, double back); -int gpfrontclip(int on_off); -int gpbackclip(int on_off); -int calcnper(void); -int calcnpar(void); -int calcrot(double rot[5][5]); -int calcpertrans(void); -int calcpartrans(void); -int matident(double mtx[5][5]); -int matmult(double premtx[5][5], double postmtx[5][5], double result[5][5]); -int crossprod(struct point *v, struct point *w, struct point *result); -int transform(double mtx[5][5], double *x, double *y, double *z); -int homotrans(double mtx[5][5], double *x, double *y, double *z, double *w); -int moveabs3(double x, double y, double z); -int moverel3(double xr, double yr, double zr); -int lineabs3(double x, double y, double z); -int linerel3(double xr, double yr, double zr); -int drawline(double xinput, double yinput, double zinput); -int mastertondc(double *x, double *y, double *z); -int checkchange(void); -int initgrf3(void); -int termgrf3(void); -int matwrite(double mtx[5][5]); -int pyr_edge(double x, double y, double z, int *pos); -int clippyramid(double *x1, double *y1, double *z1, double *x2, double *y2, double *z2, int *accept); -int cube_edge(double x, double y, double z, int *pos); -int clipcube(double *x1, double *y1, double *z1, double *x2, double *y2, double *z2, int *accept); -/* pickbox.c */ -int pickbox(int dev, int *xmin, int *ymin, int *xmax, int *ymax, int xtab[], int ytab[]); -/* pickloc.c */ -int pickloc(int dev, int *xloc, int *yloc, int xtab[], int ytab[]); -/* pixblock.c */ -int readblock(char array[], int x1, int y1, int x2, int y2); -int writeblock(char array[], int x1, int y1, int mode); -char *allocblock(int x1, int y1, int x2, int y2); -/* readloc.c */ -int readloc(int dev, int *x, int *y); -int loc_to_ndc(int xloc, int yloc, float *xndc, float *yndc); -int readbutt(int dev); +void drawbox(double xmin, double ymin, double xmax, double ymax); /* sgp.c */ -int gp_init_2(void); -int window2(double xmin, double ymin, double xmax, double ymax); -int window_2(double xmin, double ymin, double xmax, double ymax); -int viewprt2(double xmin, double ymin, double xmax, double ymax); -int viewport_2(double xmin, double ymin, double xmax, double ymax); -int framevpt(void); -int calc_wc_to_ndc(void); -int calc_ndc_to_mc(void); -int wc_to_ndc(double xw, double yw, double *xn, double *yn); -int ndc_to_wc(double xn, double yn, double *xw, double *yw); -int color(int icol); -int linestyle(int style); -int line_abs_2(double x, double y); -int lineabs2(double x, double y); -int move_abs_2(double x, double y); -int moveabs2(double x, double y); -int line_rel_2(double x, double y); -int linerel2(double x, double y); -int move_rel_2(double x, double y); -int moverel2(double x, double y); -int draw_text(char *message); -int drawtext(char *message); -int polylnabs2(double x[], double y[], int n); -int markabs2(double x, double y); -int markrel2(double x, double y); -int pntabs2(double x, double y); -int pntrel2(double x, double y); -int ctm_clr_2(void); -int ctm_get_2(GRFMTX_2D m); -int ctm_set_2(GRFMTX_2D m); -int ctm_pre_mult_2(GRFMTX_2D m); -int ctm_post_mult_2(GRFMTX_2D m); +void gp_init_2(void); +void window2(double xmin, double ymin, double xmax, double ymax); +void window_2(double xmin, double ymin, double xmax, double ymax); +void viewprt2(double xmin, double ymin, double xmax, double ymax); +void viewport_2(double xmin, double ymin, double xmax, double ymax); +void framevpt(void); +void calc_wc_to_ndc(void); +void calc_ndc_to_mc(void); +void wc_to_ndc(double xw, double yw, double *xn, double *yn); +void ndc_to_wc(double xn, double yn, double *xw, double *yw); +void color(int icol); +void linestyle(int style); +void line_abs_2(double x, double y); +void lineabs2(double x, double y); +void move_abs_2(double x, double y); +void moveabs2(double x, double y); +void line_rel_2(double x, double y); +void linerel2(double x, double y); +void move_rel_2(double x, double y); +void moverel2(double x, double y); +void draw_text(char *message); +void drawtext(char *message); +void polylnabs2(double x[], double y[], int n); +void markabs2(double x, double y); +void markrel2(double x, double y); +void pntabs2(double x, double y); +void pntrel2(double x, double y); +void ctm_clr_2(void); +void ctm_get_2(GRFMTX_2D m); +void ctm_set_2(GRFMTX_2D m); +void ctm_pre_mult_2(GRFMTX_2D m); +void ctm_post_mult_2(GRFMTX_2D m); /* sgpdrive.c */ int initgrf2(void); int initdevice(int dev, int mode, int xsize, int ysize); int opendevice(int dev); -int closedevice(int dev); -int termdevice(int dev); +void closedevice(int dev); +void termdevice(int dev); void stylus(double x, double y, int beam); -int pntndc(double x, double y); -int markndc(double x, double y); +void pntndc(double x, double y); +void markndc(double x, double y); GRFSTATE *inqstate(void); -int gp_set_aspect(int dev, double asp); +void gp_set_aspect(int dev, double asp); void setlinestyle(int style); -int setlinewidth(int wid); +void setlinewidth(int wid); DEVICE *inqdev(int dev); -int settext(double width, double height, double textangle, int font); -int settextclr(int fore, int back); -int setcolor(int fore); -int setbackg(int back); +void settext(double width, double height, double textangle, int font); +void settextclr(int fore, int back); +void setcolor(int fore); +void setbackg(int back); int initmarker(int marker, int color); int settextdir(int direction); -int charsize(double wid, double height); -int textangle(double angle); -int drivtext(char *message); -int termgrf2(void); -int flushdevice(int dev); +void charsize(double wid, double height); +void textangle(double angle); +void drivtext(char *message); +void termgrf2(void); +void flushdevice(int dev); /* sgptext.c */ -int wrtsymbol(int sym, int x, int y, DEVICE *dev); -int wrtchar(int ch, int x, int y, CHARSPEC *cspec, DEVICE *dev); -int wrttext(char txtstr[], int x, int y, CHARSPEC *cspec, DEVICE *dev); +void wrtsymbol(int sym, int x, int y, DEVICE *dev); +void wrtchar(int ch, int x, int y, CHARSPEC *cspec, DEVICE *dev); +void wrttext(char txtstr[], int x, int y, CHARSPEC *cspec, DEVICE *dev); void crtcolor(int mode, int *f, int *b); -/* trackloc.c */ -int trackloc(int dev, int *xloc, int *yloc, int (*loc_on)(int x, int y), int (*loc_off)(int x, int y)); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif