dm-pex.h

Go to the documentation of this file.
00001 /*                          D M - P E X . H
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 1993-2006 United States Government as represented by
00005  * the U.S. Army Research Laboratory.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this file; see the file named COPYING for more
00019  * information.
00020  */
00021 /** @addtogroup libdm */
00022 /*@{*/
00023 /** @file dm-pex.h
00024  *
00025  */
00026 #ifndef SEEN_DM_PEX
00027 #define SEEN_DM_PEX
00028 
00029 /*
00030  * Display coordinate conversion:
00031  *  GED is using -2048..+2048,
00032  *  X is 0..width,0..height
00033  */
00034 #define GED_TO_Xx(_dmp, x) ((int)(((x)/4096.0+0.5)*((struct pex_vars *)((_dmp)->dmr_vars))->width))
00035 #define GED_TO_Xy(_dmp, x) ((int)((0.5-(x)/4096.0)*((struct pex_vars *)((_dmp)->dmr_vars))->height))
00036 #define Xx_TO_GED(_dmp, x) ((int)(((x)/(double)((struct pex_vars *)((_dmp)->dmr_vars))->width - 0.5) * 4095))
00037 #define Xy_TO_GED(_dmp, x) ((int)((0.5 - (x)/(double)((struct pex_vars *)((_dmp)->dmr_vars))->height) * 4095))
00038 
00039 #define TRY_DEPTHCUE 0
00040 #define Pex_MV_O(_m) offsetof(struct modifiable_pex_vars, _m)
00041 
00042 struct modifiable_pex_vars {
00043 #if TRY_DEPTHCUE
00044   int cue;
00045 #endif
00046   int perspective_mode;
00047   int dummy_perspective;
00048 };
00049 
00050 struct pex_vars {
00051   struct bu_list l;
00052   Display *dpy;
00053   Window win;
00054   Tk_Window xtkwin;
00055   int width;
00056   int height;
00057   int omx, omy;
00058   unsigned int mb_mask;
00059   int perspective_angle;
00060   XFontStruct *fontstruct;
00061   GC gc;
00062 #ifdef DOUBLE_BUFFERING_WITH_PIXMAPS
00063   Pixmap pix;
00064   int pix_width, pix_height;
00065 #endif
00066   PEXRenderer renderer;
00067   PEXRendererAttributes rattrs;
00068   int is_monochrome;
00069   unsigned long black,gray,white,yellow,red,blue;
00070   unsigned long bd, bg, fg;   /* color of border, background, foreground */
00071   struct modifiable_pex_vars mvars;
00072 };
00073 
00074 extern void Pex_configure_window_shape();
00075 extern void Pex_establish_perspective();
00076 extern void Pex_set_perspective();
00077 extern struct pex_vars head_pex_vars;
00078 
00079 #endif /* SEEN_DM_PEX */
00080 /*@}*/
00081 /*
00082  * Local Variables:
00083  * mode: C
00084  * tab-width: 8
00085  * c-basic-offset: 4
00086  * indent-tabs-mode: t
00087  * End:
00088  * ex: shiftwidth=4 tabstop=8
00089  */
00090 

Generated on Mon Sep 18 01:24:40 2006 for BRL-CAD by  doxygen 1.4.6