PK added extern C for rmpbc and atomprop
[gromacs.git] / include / xvgr.h
blob2088cfb1bb8deb5712dcf13fbba3ab4872d960c0
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
32 * And Hey:
33 * Gromacs Runs On Most of All Computer Systems
36 #ifndef _xvgr_h
37 #define _xvgr_h
39 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 #include "sysstuff.h"
48 #include "typedefs.h"
49 #include "viewit.h"
51 /***************************************************
52 * XVGR DEFINITIONS
53 ***************************************************/
54 enum {
55 elNone, elSolid, elDotted, elDashed,
56 elLongDashed, elDotDashed, elNR
58 /* xvgr line-styles */
60 enum {
61 ecWhite, ecFrank, ecBlack=ecFrank,
62 ecRed, ecGreen, ecBlue, ecYellow, ecBrown, ecGray,
63 ecPurple, ecLightBlue, ecViolet, ecHolland, ecLila, ecDarkGray,
64 ecAquamarine, ecOlive, ecNR
66 /* xvgr line-colors */
68 enum {
69 eppNone, eppColor, eppPattern, eppNR
71 /* xvgr pattern type */
73 enum {
74 evView, evWorld, evNR
76 /* view type */
78 /***************************************************
79 * XVGR ROUTINES
80 ***************************************************/
82 extern bool use_xmgr(void);
83 /* Returns if we use xmgr instead of xmgrace */
85 extern FILE *xvgropen(const char *fn,const char *title,const char *xaxis,const char *yaxis);
86 /* Open a file, and write a title, and axis-labels in Xvgr format */
88 /* Close xvgr file, and clean up internal file buffers correctly */
89 extern void xvgrclose(FILE *fp);
91 extern void xvgr_subtitle(FILE *out,const char *subtitle);
92 /* Set the subtitle in xvgr */
94 extern void xvgr_view(FILE *out,real xmin,real ymin,real xmax,real ymax);
95 /* Set the view in xvgr */
97 extern void xvgr_world(FILE *out,real xmin,real ymin,real xmax,real ymax);
98 /* Set the world in xvgr */
100 extern void xvgr_legend(FILE *out,int nsets,char **setnames);
101 /* Make a legend box, and also modifies the view to make room for the legend */
103 extern void xvgr_line_props(FILE *out,int NrSet,int LineStyle,int LineColor);
104 /* Set xvgr line styles and colors */
106 extern void xvgr_box(FILE *out,
107 int LocType,
108 real xmin,real ymin,real xmax,real ymax,
109 int LineStyle,int LineWidth,int LineColor,
110 int BoxFill,int BoxColor,int BoxPattern);
111 /* Make a box */
113 extern int read_xvg_legend(const char *fn,double ***y,int *ny,char ***legend);
114 /* Read an xvg file for post processing. The number of rows is returned
115 * fn is the filename, y is a pointer to a 2D array (to be allocated by
116 * the routine) ny is the number of columns (including X if appropriate).
117 * If legend!=NULL, read the legends for the sets (when present),
118 * 0 is the first y legend, the legend string will be NULL when not present.
121 extern int read_xvg(const char *fn,double ***y,int *ny);
122 /* As read_xvg_legend, but does not read legends. */
124 extern void write_xvg(const char *fn,const char *title,int nx,int ny,real **y,
125 char ** leg);
126 /* Write a two D array (y) of dimensions nx rows times
127 * ny columns to a file. If leg != NULL it will be written too.
131 /* This function reads ascii (xvg) files and extracts the data sets to a
132 * two dimensional array which is returned.
134 extern real **read_xvg_time(char *fn,
135 bool bHaveT,
136 bool bTB,real tb,
137 bool bTE,real te,
138 int nsets_in,int *nset,int *nval,
139 real *dt,real **t);
140 #ifdef __cplusplus
142 #endif
144 #endif /* _xvgr_h */