Update mdrun test comparison infrastructure
[gromacs.git] / src / programs / view / manager.h
blobed30a55a8bf200b3b39a2a91f1f1ed4028ad2ea5
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2019, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
38 #ifndef _manager_h
39 #define _manager_h
41 #include <stdio.h>
43 #include "gromacs/fileio/trxio.h"
44 #include "gromacs/pbcutil/rmpbc.h"
45 #include "gromacs/topology/topology.h"
46 #include "gromacs/utility/real.h"
48 #include "3dview.h"
49 #include "buttons.h"
50 #include "nleg.h"
51 #include "x11.h"
52 #include "xutil.h"
54 struct gmx_output_env_t;
56 /* Some window sizes */
57 #define EWIDTH 200
58 #define EHEIGHT 0
59 #define LDHEIGHT 0
60 #define LEGHEIGHT 60
62 enum eObject {
63 eOSingle, eOBond, eOHBond, eONR
66 enum eVisible {
67 eVNormal, eVSpecial, eVHidden, evNR
70 enum eBwidth {
71 eBThin, eBFat, eBVeryFat, eBSpheres, eBNR
74 enum esBox {
75 esbNone, esbRect, esbTri, esbTrunc, esbNR
78 typedef struct {
79 t_windata wd; /* Mol window structure */
80 bool bShowHydrogen; /* Show Hydrogens? */
81 int bond_type; /* Show one of the above bondtypes */
82 int ePBC; /* PBC type */
83 int boxtype; /* Rectangular, Tric, TruncOct (display)*/
84 int realbox; /* Property of the real box */
85 } t_molwin;
87 typedef struct {
88 eObject eO; /* The type of object */
89 eVisible eV; /* Visibility status of the object */
90 unsigned long color; /* The color (only when eV==evSpecial) */
91 int ai, aj; /* The int for i (and j if bond) */
92 real z; /* The Z-coordinate for depht cueing */
93 } t_object;
95 typedef struct {
96 t_blocka *grps; /* Blocks with atom numbers */
97 char **grpnames; /* The names of the groups */
98 bool *bDisable; /* Group indexes out of natoms in TRX */
99 bool *bShow; /* Show a group ? */
100 } t_filter;
103 * t_manager structure:
105 * This structure manages the display area for the gmx program.
106 * It reads the status file and sends messages when windows need to
107 * be updated.
110 typedef struct {
111 t_trxstatus *status;
112 const char *trajfile;
113 int natom; /* The number of atoms */
114 t_topology top; /* topology */
115 rvec box_size;
116 real time; /* The actual time */
117 rvec *x; /* The coordinates */
118 iv2 *ix; /* The coordinates after projection */
119 real *zz; /* Z-coords */
120 matrix box; /* The box */
121 int nobj; /* The number of objects */
122 t_object *obj; /* The objects on screen */
123 bool *bHydro; /* true for hydrogen atoms */
124 bool *bLabel; /* Show a label on atom i? */
125 char **szLab; /* Array of pointers to labels */
126 unsigned long *col; /* The colour of the atoms */
127 int *size; /* The size of the atoms */
128 real *vdw; /* The VDWaals radius of the atoms */
129 bool *bVis; /* visibility of atoms */
130 bool bPbc; /* Remove Periodic boundary */
131 bool bAnimate; /* Animation going on? */
132 bool bEof; /* End of file reached? */
133 bool bStop; /* Stopped by user? */
134 bool bSort; /* Sort the coordinates */
135 bool bPlus; /* Draw plus for single atom */
136 int nSkip; /* Skip n steps after each frame */
137 int nWait; /* Wait n ms after each frame */
138 gmx_rmpbc_t gpbc; /* For removing peridiocity */
140 t_windata wd; /* The manager subwindow */
141 t_windata title; /* Title window */
142 t_3dview *view; /* The 3d struct */
143 t_molwin *molw; /* The molecule window */
144 t_butbox *vbox; /* The video box */
145 t_butbox *bbox; /* The button box */
146 t_legendwin *legw; /* The legend window */
148 gmx_output_env_t *oenv; /* output env data */
149 } t_manager;
151 extern t_manager *init_man(t_x11 *x11, Window Parent,
152 int x, int y, int width, int height,
153 unsigned long fg, unsigned long bg,
154 int ePBC, matrix box, gmx_output_env_t *oenv);
155 /* Initiate the display manager */
157 extern void move_man(t_x11 *x11, t_manager *man, int width, int height);
158 /* Set the right size for this window */
160 extern void step_message(t_x11 *x11, t_manager *man);
161 /* Send a message to the manager */
163 extern void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
164 const char *status);
165 /* Read a new trajectory and topology */
167 extern void map_man(t_x11 *x11, t_manager *man);
171 extern bool toggle_animate (t_x11 *x11, t_manager *man);
173 extern bool toggle_pbc (t_manager *man);
175 extern void no_labels(t_x11 *x11, t_manager *man);
176 /* Turn off all labels */
178 extern void done_man(t_x11 *x11, t_manager *man);
179 /* Clean up man struct */
181 extern void draw_mol(t_x11 *x11, t_manager *man);
183 extern void do_filter(t_x11 *x11, t_manager *man, t_filter *filter);
185 #endif