#ifndef __anatdia_h #define __anatdia_h #include "graph.h" #include "ebsclass.h" #undef DEBUG class AnatomicalDiagram { private: unsigned int get_opcode (void); int get_int16 (void); char get_int8 (void); public: enum cgm_context { CGM_BACKGROUND_CONTEXT, CGM_FOREGROUND_CONTEXT, CGM_XOR_CONTEXT, CGM_LINE_CONTEXT, CGM_EDGE_CONTEXT, CGM_FILL_CONTEXT, CGM_TEXT_CONTEXT, CGM_SYMBOL_CONTEXT, CGM_MARKER_CONTEXT, CGM_ENDCONTEXTS}; struct arcctrdat { GWindow::GPoint center; short dx_start, dy_start, dx_end, dy_end, radius, close; }; struct colortabchange { int start, end, *value; }; struct cgm_gpe { int type; /* graphical primitve element type */ int arg_len; /* length of argument */ void *arg; /* ptr to arguments */ struct cgm_gpe *next_gpe; /* ptr to graphical primitive element */ }; struct cgm_picture { char *name; int min_x, min_y, max_x, max_y; /* values of VDC EXTENT */ int background; GWindow::GColor *cgm_color; struct cgm_gpe *first_gpe; /* ptr to graphical primitive element */ struct cgm_picture *next_picture; int ncgm_colors, maxcolorindex, initcolormode; }; struct Location { unsigned int chn_number, pic_number; int x1, y1, x2, y2; int marked; }; typedef char *(*GetChannelLabelProc) (Location *loc); char **chn_label; char *name; int version; struct cgm_picture *first_picture; struct cgm_picture *pic; /* ptr to current picture */ int npictures; int actpic; int colrprec; int cgm_linecolor, cgm_edgecolor, cgm_fillcolor, cgm_markercolor; int cgm_textcolor, cgm_symbolcolor, cgm_backgroundcolor; int width, height; int xoffset, yoffset; float factor; char *content; unsigned long content_length; int background; Location *location; int nlocations; int actlocation; GetChannelLabelProc labelproc; GWindow::GGC gc [CGM_ENDCONTEXTS]; GWindow *win; EBSFile *ebsfile; void Error (void); void CalcFactor (void); virtual void DrawLocations (void); void RewindCGMMetafile (void *ptr, unsigned long length); void ReadCGMPictureBody (cgm_picture *picture); void ReadCGMPicture (cgm_picture *picture); void ReadCGMMetafile (EBSFile::LocationDiagram *ptr); void DeleteCGMMetafile (void); void GetCGMMetafile (void **pptr, unsigned long *len); void ReadChannelLocations (EBSFile::ChannelLocations *chn, int nchans); void GetChannelLocations (Location **loc, unsigned long *no); void DeleteChannelLocations (void); int VDC2X_X (int x); int VDC2X_Y (int y); int X2VDC_X (int x); int X2VDC_Y (int y); int InSubwindowVDC (int x, int y); int InSubwindowX (int x, int y); public: enum {COORD_UNDEFINED= 0x80000000}; enum channel_type {none, big_rectangle, small_circle, only_label}; AnatomicalDiagram (GWindow *win, EBSFile *ebsfile, enum channel_type channel_dot= small_circle, GetChannelLabelProc labelproc = (GetChannelLabelProc) 0); virtual ~AnatomicalDiagram (void); virtual void Repaint (void); int GetNPictures (void); int GetCurrentPicture (void); /* -1: no current picture, */ /* picturenumbers range from 0..(n-1) */ void SetPicture (int no); /* -1 means repaint current picture, */ /* picturenumbers range from 0..(n-1) */ char *GetPictureName (void); void SetEBSFile(EBSFile *ebsfile); protected: enum channel_type channel_dot; private: void DoRepaint (void) {Repaint ();}; }; #endif