source: branches/profile/GDE/PHYLIP/draw.h

Last change on this file was 2175, checked in by westram, 20 years ago

upgrade to PHYLIP 3.6

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1
2#include "phylip.h"
3
4#ifdef X
5#include <X11/Xlib.h>
6#include <X11/Intrinsic.h>
7#include <X11/StringDefs.h>
8#include <X11/Xaw/Label.h>
9#include <X11/Xatom.h>
10#include <X11/Shell.h>
11#include <X11/Xaw/SimpleMenu.h>
12#include <X11/Xaw/Paned.h>
13#include <X11/Xaw/Box.h>
14#include <X11/Xaw/MenuButton.h>
15#include <X11/Xaw/SmeBSB.h>
16#include <X11/Xaw/Form.h>
17#include <X11/Xaw/Dialog.h>
18#include <X11/Xlib.h>
19#include <X11/Xutil.h>
20#endif
21
22#ifdef MAC
23#include "interface.h"
24#endif
25
26/* Added by Dan F. for bmp code */
27#include "math.h" 
28#define  DEFAULT_STRIPE_HEIGHT 20
29
30#define maxnodes        1200
31#define minus           '-'
32#define stripewidth     3000L
33#define maxstripedepth  3500
34#define fontsize        3800
35#define pi              3.1415926535897932384626433
36#define epsilond        0.00001
37#define ebcdic          EBCDIC
38#define segments        40
39#define xstart          10
40#define ystart          35
41#define LF              10
42#define CR              13
43#define escape  (ebcdic ?  '\'' :  '\033')
44#define null  '\000'
45#define AFMDIR "/usr/lib/transcript/" /* note trailing slash */
46
47typedef unsigned char byte;
48/*typedef char byte; */
49typedef enum {treepen, labelpen} pentype;
50typedef enum {lw,hp,tek,ibm,mac,houston,decregis,epson,oki,fig,
51                citoh,toshiba,pcx,pcl,pict,ray,pov,xpreview,xbm,bmp,
52                gif,idraw,vrml,winpreview,other} plottertype;
53typedef enum {vertical, horizontal} growth;
54typedef enum {cladogram,phenogram,curvogram,
55              eurogram,swoopogram,circular} treestyle;
56typedef enum {penup,pendown} pensttstype;
57typedef enum {plotnow, changeparms, quitnow} winactiontype;
58typedef short fonttype[fontsize];
59typedef Char *striparray;
60typedef striparray striptype[maxstripedepth];
61
62struct LOC_plottext {              /* Local variables for plottext: */
63  double height, compress;
64  short *font;
65  short coord;
66  double heightfont, xfactor, yfactor, xfont, yfont, xplot, yplot, sinslope,
67         cosslope, xx, yy;
68  pensttstype penstatus;
69} ;
70
71typedef struct colortype {
72  const char *name;
73  double red, green, blue;
74} colortype;
75
76typedef struct vrmllighttype {
77  double intensity, x, y, z;
78} vrmllighttype;
79
80double lengthtext(char *, long, char *, fonttype);
81double heighttext(fonttype, char *);
82void plotrparms(long ntips);
83void   clearit(void);
84void   getplotter(void);
85void   getpreview(void);
86const char *figfontname(int id);
87boolean isfigfont(char *);
88void   plot(pensttstype, double, double);
89void   curvespline(double, double, double, double, boolean, long);
90void swoopspline(double x1, double y1, double x2, double y2, double x3,
91                 double y3, boolean sense, long segs);
92void changepen(pentype pen);
93void plottext(Char *pstring,long nchars,double height_,double cmpress2,
94               double x,double y,double slope,short *font_,char *fontname);
95void loadfont(short *font, char *application);
96long allocstripe(striptype stripe, long x, long y);
97boolean plotpreview(char *, double *, double *, double *, long , node *);
98void initplotter(long ntips, char *fontname);
99void drawit(char *fontname, double *xoffset, double *yoffset,
100                        long numlines, node *root);
101void   finishplotter(void);
102void   write_bmp_header(FILE *, int, int);
103void   turn_rows(byte *, int, int);
104void   write_full_pic(byte *, int);
105void translate_stripe_to_bmp(striptype *stripe, byte *full_pic,
106                           int increment, int width, int div, int *total_bytes);
107void   plottree(node *, node *);
108void plotlabels(char *fontname);
109void   pout(long);
110double computeAngle(double oldx, double oldy, double newx, double newy);
111boolean plot_without_preview(char *, double *, double *, double *, long,
112                             node *);
113
114
115/* For povray, added by Dan F. */
116#define TREE_TEXTURE "T_Tree\0"
117#define NAME_TEXTURE "T_Name\0"
118
119
120
121#ifdef X
122Display *display;               /* the X display */
123extern Window  mainwin;         /* the main display window */
124int x, y;                       /* the corner of the window */
125unsigned int width, height;     /* the width and height of the window */
126#define FONT "-*-new century schoolbook-medium-r-*-*-14-*"
127char *fontrsc;                  /* the font resource */
128XFontStruct *fontst;            /* the font strcture for the font */
129XGCValues gcv;                  /* graphics context values */
130GC gc1;                         /* a graphics context */
131XtAppContext appcontext;
132Widget toplevel;
133int nargc;
134char** nargv;
135extern String res[16];
136
137#define DEFGEOMETRY "600x400+20+50"
138#endif
139#define LARGE_BUF_LENGTH 500
140extern char fontname[LARGE_BUF_LENGTH]; /* the font name to use */
141
142#ifdef WIN32
143#define DEFPLOTTER lw
144#define DEFPREV winpreview
145#endif
146#ifdef DOS
147#define DEFPLOTTER lw
148#define DEFPREV ibm
149#endif   
150#ifdef MAC
151#define DEFPLOTTER pict
152#define DEFPREV mac
153#endif   
154#ifdef VMS
155#define DEFPLOTTER lw
156#define DEFPREV decregis
157#endif
158#ifndef DOS
159#ifndef MAC
160#ifndef VMS
161#ifndef WIN32
162#define DEFPLOTTER lw
163#ifdef X
164#define DEFPREV xpreview
165#endif
166#ifndef X
167#define DEFPREV tek
168#endif
169#endif
170#endif   
171#endif   
172#endif   
173
174/* Define SEEK_SET (needed for fseek()) for machines that haven't
175   got it already, */
176#ifndef SEEK_SET
177#define SEEK_SET 0
178#endif
179
Note: See TracBrowser for help on using the repository browser.