BRL-CAD
dm.h File Reference
#include "common.h"
#include "vmath.h"
#include "bu/vls.h"
#include "bn.h"
#include "bv.h"
#include "icv.h"
#include "./dm/defines.h"
#include "./dm/fbserv.h"
#include "./dm/util.h"
#include "./dm/view.h"
#include <stdio.h>
#include "bsocket.h"
#include "pkg.h"
#include "bu/magic.h"
Include dependency graph for dm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dm_hook_data
 
struct  ColorMap
 
struct  fb_platform_specific
 

Macros

#define DM_NULL   (struct dm *)NULL
 
#define FONTBACK   "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
 
#define FONT5   "5x7"
 
#define FONT6   "6x10"
 
#define FONT7   "7x13"
 
#define FONT8   "8x13"
 
#define FONT9   "9x15"
 
#define FONT10   "10x20"
 
#define FONT12   "12x24"
 
#define DM_VALID_FONT_SIZE(_size)   (5 <= (_size) && (_size) <= 12 && (_size) != 11)
 
#define DM_FONT_SIZE_TO_NAME(_size)   (((_size) == 5) ? FONT5 : (((_size) == 6) ? FONT6 : (((_size) == 7) ? FONT7 : (((_size) == 8) ? FONT8 : (((_size) == 9) ? FONT9 : (((_size) == 10) ? FONT10 : FONT12))))))
 
#define PIXEL_NULL   (unsigned char *) 0
 
#define RGBPIXEL_NULL   (unsigned char *) 0
 
#define COLORMAP_NULL   (ColorMap *) 0
 
#define FB_NULL   (struct fb *) 0
 
#define FB_CK_FB(_p)   BU_CKMAG(_p, FB_MAGIC, "FB")
 
#define COPYRGB(to, from)
 
#define FB_DEBUG_BIO   1 /* Buffered io calls (less r/wpixel) */
 
#define FB_DEBUG_CMAP   2 /* Contents of colormaps */
 
#define FB_DEBUG_RW   4 /* Contents of reads and writes */
 
#define FB_DEBUG_BRW   8 /* Buffered IO rpixel and wpixel */
 
#define MSG_FBOPEN   1
 
#define MSG_FBCLOSE   2
 
#define MSG_FBCLEAR   3
 
#define MSG_FBREAD   4
 
#define MSG_FBWRITE   5
 
#define MSG_FBCURSOR   6
 fb_cursor(void) More...
 
#define MSG_FBWINDOW   7
 OLD. More...
 
#define MSG_FBZOOM   8
 OLD. More...
 
#define MSG_FBSCURSOR   9
 OLD. More...
 
#define MSG_FBVIEW   10
 NEW. More...
 
#define MSG_FBGETVIEW   11
 NEW. More...
 
#define MSG_FBRMAP   12
 
#define MSG_FBWMAP   13
 
#define MSG_FBHELP   14
 
#define MSG_FBREADRECT   15
 
#define MSG_FBWRITERECT   16
 
#define MSG_FBFLUSH   17
 
#define MSG_FBFREE   18
 
#define MSG_FBGETCURSOR   19
 NEW. More...
 
#define MSG_FBPOLL   30
 NEW. More...
 
#define MSG_FBSETCURSOR   31
 NEW in Release 4.4. More...
 
#define MSG_FBBWREADRECT   32
 NEW in Release 4.6. More...
 
#define MSG_FBBWWRITERECT   33
 NEW in Release 4.6. More...
 
#define MSG_DATA   20
 
#define MSG_RETURN   21
 
#define MSG_CLOSE   22
 
#define MSG_ERROR   23
 
#define MSG_NORETURN   100
 

Typedefs

typedef unsigned char RGBpixel[3]
 
typedef struct fb_internal FBIO
 

Enumerations

enum  dm_event_t { DM_MOTION_NOTIFY , DM_BUTTON_PRESS , DM_BUTTON_RELEASE }
 

Functions

void * dm_interp (struct dm *dmp)
 
void * dm_get_ctx (struct dm *dmp)
 
void * dm_get_udata (struct dm *dmp)
 
void dm_set_udata (struct dm *dmp, void *udata)
 
int dm_share_dlist (struct dm *dmp1, struct dm *dmp2)
 
fastf_t dm_Xx2Normal (struct dm *dmp, int x)
 
int dm_Normal2Xx (struct dm *dmp, fastf_t f)
 
fastf_t dm_Xy2Normal (struct dm *dmp, int y, int use_aspect)
 
int dm_Normal2Xy (struct dm *dmp, fastf_t f, int use_aspect)
 
void dm_fogHint (struct dm *dmp, int fastfog)
 
int dm_processOptions (struct dm *dmp, struct bu_vls *init_proc_vls, int argc, const char **argv)
 
int dm_limit (int i)
 
int dm_unlimit (int i)
 
fastf_t dm_wrap (fastf_t f)
 
void dm_draw_adc (struct dm *dmp, struct bv_adc_state *adcp, mat_t view2model, mat_t model2view)
 
void dm_draw_data_axes (struct dm *dmp, fastf_t viewSize, struct bv_data_axes_state *bndasp)
 
void dm_draw_scene_axes (struct dm *dmp, struct bv_scene_obj *s)
 
void dm_draw_hud_axes (struct dm *dmp, fastf_t viewSize, const mat_t rmat, struct bv_axes *bnasp)
 
int clip (fastf_t *, fastf_t *, fastf_t *, fastf_t *)
 
int vclip (point_t, point_t, fastf_t *, fastf_t *)
 
void dm_draw_grid (struct dm *dmp, struct bv_grid_state *ggsp, fastf_t scale, mat_t model2view, fastf_t base2local)
 
void dm_draw_rect (struct dm *dmp, struct bv_interactive_rect_state *grsp)
 
void dm_draw_scale (struct dm *dmp, fastf_t viewSize, const char *unit, int *lineColor, int *textColor)
 
const char * dm_version (void)
 
int dm_valid_type (const char *name, const char *dpy_string)
 
const char * dm_init_msgs (void)
 
struct dmdm_open (void *ctx, void *interp, const char *type, int argc, const char *argv[])
 
void dm_list_types (struct bu_vls *list, const char *separator)
 
const char * dm_bestXType (const char *dpy_string)
 
int dm_have_graphics (void)
 
const char * dm_graphics_system (const char *dmtype)
 
const char * dm_get_dm_name (const struct dm *dmp)
 
const char * dm_get_dm_lname (struct dm *dmp)
 
const char * dm_get_graphics_system (const struct dm *dmp)
 
int dm_get_width (struct dm *dmp)
 
int dm_get_height (struct dm *dmp)
 
void dm_set_width (struct dm *dmp, int width)
 
void dm_set_height (struct dm *dmp, int height)
 
void dm_geometry_request (struct dm *dmp, int width, int height)
 
void dm_internal_var (struct bu_vls *result, struct dm *dmp, const char *key)
 
fastf_t dm_get_aspect (struct dm *dmp)
 
int dm_graphical (const struct dm *dmp)
 
const char * dm_get_type (struct dm *dmp)
 
unsigned long dm_get_id (struct dm *dmp)
 
void dm_set_id (struct dm *dmp, unsigned long new_id)
 
int dm_get_displaylist (struct dm *dmp)
 
int dm_close (struct dm *dmp)
 
int dm_get_bg (unsigned char **bg1, unsigned char **bg2, struct dm *dmp)
 
int dm_set_bg (struct dm *dmp, unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2)
 
unsigned char * dm_get_fg (struct dm *dmp)
 
int dm_set_fg (struct dm *dmp, unsigned char r, unsigned char g, unsigned char b, int strict, fastf_t transparency)
 
int dm_reshape (struct dm *dmp, int width, int height)
 
int dm_make_current (struct dm *dmp)
 
int dm_doevent (struct dm *dmp, void *clientData, void *eventPtr)
 
int dm_get_dirty (struct dm *dmp)
 
void dm_set_dirty (struct dm *dmp, int i)
 
vect_tdm_get_clipmin (struct dm *dmp)
 
vect_tdm_get_clipmax (struct dm *dmp)
 
int dm_get_stereo (struct dm *dmp)
 
int dm_set_win_bounds (struct dm *dmp, fastf_t *w)
 
int dm_configure_win (struct dm *dmp, int force)
 
struct bu_vlsdm_get_pathname (struct dm *dmp)
 
void dm_set_pathname (struct dm *dmp, const char *pname)
 
struct bu_vlsdm_get_dname (struct dm *dmp)
 
const char * dm_get_name (const struct dm *dmp)
 
struct bu_vlsdm_get_tkname (struct dm *dmp)
 
int dm_get_fontsize (struct dm *dmp)
 
void dm_set_fontsize (struct dm *dmp, int size)
 
int dm_get_linewidth (struct dm *dmp)
 
void dm_set_linewidth (struct dm *dmp, int linewidth)
 
int dm_get_linestyle (struct dm *dmp)
 
void dm_set_linestyle (struct dm *dmp, int linestyle)
 
int dm_get_perspective (struct dm *dmp)
 
void dm_set_perspective (struct dm *dmp, fastf_t perspective)
 
int dm_get_display_image (struct dm *dmp, unsigned char **image, int flip, int alpha)
 
int dm_draw_vlist (struct dm *dmp, struct bv_vlist *vp)
 
int dm_draw_vlist_hidden_line (struct dm *dmp, struct bv_vlist *vp)
 
int dm_set_line_attr (struct dm *dmp, int width, int style)
 
int dm_draw_begin (struct dm *dmp)
 
int dm_draw_end (struct dm *dmp)
 
int dm_hud_begin (struct dm *dmp)
 
int dm_hud_end (struct dm *dmp)
 
int dm_loadmatrix (struct dm *dmp, fastf_t *mat, int eye)
 
int dm_loadpmatrix (struct dm *dmp, const fastf_t *mat)
 
void dm_pop_pmatrix (struct dm *dmp)
 
int dm_draw_string_2d (struct dm *dmp, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
 
int dm_string_bbox_2d (struct dm *dmp, vect2d_t *bmin, vect2d_t *bmax, const char *str, fastf_t x, fastf_t y, int size, int use_aspect)
 
int dm_draw_line_2d (struct dm *dmp, fastf_t x1, fastf_t y1_2d, fastf_t x2, fastf_t y2)
 
int dm_draw_line_3d (struct dm *dmp, point_t pt1, point_t pt2)
 
int dm_draw_lines_3d (struct dm *dmp, int npoints, point_t *points, int sflag)
 
int dm_draw_point_2d (struct dm *dmp, fastf_t x, fastf_t y)
 
int dm_draw_point_3d (struct dm *dmp, point_t pt)
 
int dm_draw_points_3d (struct dm *dmp, int npoints, point_t *points)
 
int dm_draw (struct dm *dmp, struct bv_vlist *(*callback)(void *), void **data)
 
int dm_set_depth_mask (struct dm *dmp, int d_on)
 
int dm_set_debug (struct dm *dmp, int lvl)
 
int dm_get_debug (struct dm *dmp)
 
int dm_logfile (struct dm *dmp, const char *filename)
 
struct fbdm_get_fb (struct dm *dmp)
 
int dm_get_fb_visible (struct dm *dmp)
 
int dm_set_fb_visible (struct dm *dmp, int is_fb_visible)
 
int dm_get_light (struct dm *dmp)
 
int dm_set_light (struct dm *dmp, int light)
 
int dm_get_transparency (struct dm *dmp)
 
int dm_set_transparency (struct dm *dmp, int transparency)
 
int dm_get_zbuffer (struct dm *dmp)
 
int dm_set_zbuffer (struct dm *dmp, int zbuffer)
 
int dm_get_zclip (struct dm *dmp)
 
void dm_set_zclip (struct dm *dmp, int zclip)
 
fastf_t dm_get_bound (struct dm *dmp)
 
void dm_set_bound (struct dm *dmp, fastf_t val)
 
int dm_get_bound_flag (struct dm *dmp)
 
void dm_set_bound_flag (struct dm *dmp, int bound)
 
int dm_draw_obj (struct dm *dmp, struct bv_scene_obj *s)
 
int dm_gen_dlists (struct dm *dmp, size_t range)
 
int dm_begin_dlist (struct dm *dmp, unsigned int list)
 
int dm_draw_dlist (struct dm *dmp, unsigned int list)
 
int dm_end_dlist (struct dm *dmp)
 
int dm_free_dlists (struct dm *dmp, unsigned int list, int range)
 
int dm_draw_display_list (struct dm *dmp, struct display_list *obj)
 
int dm_draw_head_dl (struct dm *dmp, struct bu_list *dl, fastf_t transparency_threshold, fastf_t inv_viewsize, short r, short g, short b, int line_width, int draw_style, int draw_edit, unsigned char *gdc, int solids_down, int mv_dlist)
 
int dm_write_image (struct bu_vls *msgs, FILE *fp, struct dm *dmp)
 
void dm_flush (struct dm *dmp)
 
void dm_sync (struct dm *dmp)
 
int dm_event_cmp (struct dm *dmp, dm_event_t type, int event)
 
void dm_set_vp (struct dm *dmp, fastf_t *vp)
 
int dm_set_hook (const struct bu_structparse_map *map, const char *key, void *data, struct dm_hook_data *hook)
 
struct bu_structparsedm_get_vparse (struct dm *dmp)
 
void * dm_get_mvars (struct dm *dmp)
 
const char * dm_default_type (void)
 
struct fbfb_get (void)
 
struct fbfb_raw (const char *type)
 
void fb_put (struct fb *ifp)
 
struct dmfb_get_dm (struct fb *ifp)
 
const char * fb_gettype (struct fb *ifp)
 
void fb_set_standalone (struct fb *ifp, int val)
 
int fb_get_standalone (struct fb *ifp)
 
int fb_get_max_width (struct fb *ifp)
 
int fb_get_max_height (struct fb *ifp)
 
int fb_getwidth (struct fb *ifp)
 
int fb_getheight (struct fb *ifp)
 
int fb_poll (struct fb *ifp)
 
long fb_poll_rate (struct fb *ifp)
 
int fb_help (struct fb *ifp)
 
int fb_free (struct fb *ifp)
 
int fb_clear (struct fb *ifp, unsigned char *pp)
 
ssize_t fb_read (struct fb *ifp, int x, int y, unsigned char *pp, size_t count)
 
ssize_t fb_write (struct fb *ifp, int x, int y, const unsigned char *pp, size_t count)
 
int fb_rmap (struct fb *ifp, ColorMap *cmap)
 
int fb_wmap (struct fb *ifp, const ColorMap *cmap)
 
int fb_view (struct fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
int fb_getview (struct fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
int fb_setcursor (struct fb *ifp, const unsigned char *bits, int xb, int yb, int xo, int yo)
 
int fb_cursor (struct fb *ifp, int mode, int x, int y)
 
int fb_getcursor (struct fb *ifp, int *mode, int *x, int *y)
 
int fb_readrect (struct fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
int fb_writerect (struct fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
int fb_bwreadrect (struct fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
int fb_bwwriterect (struct fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
struct fbfb_open (const char *file, int _width, int _height)
 
int fb_close (struct fb *ifp)
 
int fb_close_existing (struct fb *ifp)
 
int fb_genhelp (void)
 
int fb_ioinit (struct fb *ifp)
 
int fb_seek (struct fb *ifp, int x, int y)
 
int fb_tell (struct fb *ifp, int *xp, int *yp)
 
int fb_rpixel (struct fb *ifp, unsigned char *pp)
 
int fb_wpixel (struct fb *ifp, unsigned char *pp)
 
int fb_flush (struct fb *ifp)
 
int fb_configure_window (struct fb *, int, int)
 
int fb_refresh (struct fb *ifp, int x, int y, int w, int h)
 
void fb_log (const char *fmt,...) _BU_ATTR_PRINTF12
 
int fb_null (struct fb *ifp)
 
int fb_null_setcursor (struct fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
int fb_common_file_size (size_t *widthp, size_t *heightp, const char *filename, int pixel_size)
 
int fb_common_image_size (size_t *widthp, size_t *heightp, size_t npixels)
 
int fb_common_name_size (size_t *widthp, size_t *heightp, const char *name)
 
int fb_write_fp (struct fb *ifp, FILE *fp, int req_width, int req_height, int crunch, int inverse, struct bu_vls *result)
 
int fb_read_fd (struct fb *ifp, int fd, int file_width, int file_height, int file_xoff, int file_yoff, int scr_width, int scr_height, int scr_xoff, int scr_yoff, int fileinput, char *file_name, int one_line_only, int multiple_lines, int autosize, int inverse, int clear, int zoom, struct bu_vls *result)
 
int fb_read_icv (struct fb *ifp, icv_image_t *img, int file_xoff, int file_yoff, int file_maxwidth, int file_maxheight, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int one_line_only, int multiple_lines, struct bu_vls *result)
 
icv_image_tfb_write_icv (struct fb *ifp, int scr_xoff, int scr_yoff, int width, int height)
 
int fb_read_png (struct fb *ifp, FILE *fp_in, int file_xoff, int file_yoff, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int one_line_only, int multiple_lines, int verbose, int header_only, double def_screen_gamma, struct bu_vls *result)
 
int fb_set_interface (struct fb *ifp, const char *interface_type)
 
const char * fb_get_name (const struct fb *ifp)
 
void fb_set_magic (struct fb *ifp, uint32_t magic)
 
long fb_get_pagebuffer_pixel_size (struct fb *ifp)
 
int fb_is_set_fd (struct fb *ifp, fd_set *infds)
 
int fb_set_fd (struct fb *ifp, fd_set *select_list)
 
int fb_clear_fd (struct fb *ifp, fd_set *select_list)
 
int fb_is_linear_cmap (const ColorMap *cmap)
 
void fb_make_linear_cmap (ColorMap *cmap)
 
struct fb_platform_specificfb_get_platform_specific (uint32_t magic)
 
void fb_put_platform_specific (struct fb_platform_specific *fb_p)
 
struct fbfb_open_existing (const char *file, int _width, int _height, struct fb_platform_specific *fb_p)
 
void fb_setup_existing (struct fb *fbp, int _width, int _height, struct fb_platform_specific *fb_p)
 
int fb_reset (struct fb *ifp)
 
int fb_viewport (struct fb *ifp, int left, int top, int right, int bottom)
 
int fb_window (struct fb *ifp, int xcenter, int ycenter)
 
int fb_zoom (struct fb *ifp, int xzoom, int yzoom)
 
int fb_scursor (struct fb *ifp, int mode, int x, int y)
 
const char * fb_version (void)
 

Variables

struct dm dm_null