Adjust more copyright headers
[alexxy/gromacs.git] / src / programs / view / manager.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013, 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.
10  *
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.
15  *
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.
20  *
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.
25  *
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.
33  *
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.
36  */
37
38 #ifndef _manager_h
39 #define _manager_h
40
41 #include <stdio.h>
42 #include "typedefs.h"
43 #include "x11.h"
44 #include "xutil.h"
45 #include "3dview.h"
46 #include "nleg.h"
47 #include "buttons.h"
48 #include "statutil.h"
49 #include "rmpbc.h"
50 #include "gromacs/fileio/trxio.h"
51
52 /* Some window sizes */
53 #define EWIDTH      200
54 #define EHEIGHT       0
55 #define LDHEIGHT      0
56 #define LEGHEIGHT    60
57
58 enum eObject {
59     eOSingle, eOBond, eOHBond, eONR
60 };
61
62 enum eVisible {
63     eVNormal, eVSpecial, eVHidden, evNR
64 };
65
66 enum eBwidth {
67     eBThin, eBFat, eBVeryFat, eBSpheres, eBNR
68 };
69
70 enum esBox {
71     esbNone, esbRect, esbTri, esbTrunc, esbNR
72 };
73
74 typedef struct {
75     t_windata     wd;            /* Mol window structure                        */
76     bool          bShowHydrogen; /* Show Hydrogens?                     */
77     int           bond_type;     /* Show one of the above bondtypes      */
78     int           ePBC;          /* PBC type                             */
79     int           boxtype;       /* Rectangular, Tric, TruncOct (display)*/
80     int           realbox;       /* Property of the real box             */
81 } t_molwin;
82
83 typedef struct {
84     eObject           eO;     /* The type of object                     */
85     eVisible          eV;     /* Visibility status of the object        */
86     unsigned long     color;  /* The color (only when eV==evSpecial)    */
87     atom_id           ai, aj; /* The atom_id for i (and j if bond)      */
88     real              z;      /* The Z-coordinate for depht cueing      */
89 } t_object;
90
91 typedef struct {
92     t_blocka    *grps;     /* Blocks with atom numbers          */
93     char       **grpnames; /* The names of the groups           */
94     bool        *bDisable; /* Group indexes out of natoms in TRX   */
95     bool        *bShow;    /* Show a group ?                    */
96 } t_filter;
97
98 /*
99  * t_manager structure:
100  *
101  * This structure manages the display area for the gmx program.
102  * It reads the status file and sends messages when windows need to
103  * be updated.
104  *
105  */
106 typedef struct {
107     t_trxstatus   *status;
108     const char    *trajfile;
109     int            natom;    /* The number of atoms                     */
110     t_topology     top;      /* topology                             */
111     rvec           box_size;
112     real           time;     /* The actual time                      */
113     rvec          *x;        /* The coordinates                 */
114     iv2           *ix;       /* The coordinates after projection        */
115     real          *zz;       /* Z-coords                             */
116     matrix         box;      /* The box                         */
117     int            nobj;     /* The number of objects           */
118     t_object      *obj;      /* The objects on screen           */
119     bool          *bHydro;   /* true for hydrogen atoms         */
120     bool          *bLabel;   /* Show a label on atom i?              */
121     char         **szLab;    /* Array of pointers to labels          */
122     unsigned long *col;      /* The colour of the atoms         */
123     int           *size;     /* The size of the atoms           */
124     real          *vdw;      /* The VDWaals radius of the atoms */
125     bool          *bVis;     /* visibility of atoms                  */
126     bool           bPbc;     /* Remove Periodic boundary             */
127     bool           bAnimate; /* Animation going on?                     */
128     bool           bEof;     /* End of file reached?                 */
129     bool           bStop;    /* Stopped by user?                     */
130     bool           bSort;    /* Sort the coordinates                    */
131     bool           bPlus;    /* Draw plus for single atom               */
132     int            nSkip;    /* Skip n steps after each frame   */
133     int            nWait;    /* Wait n ms after each frame           */
134     gmx_rmpbc_t    gpbc;     /* For removing peridiocity             */
135
136     t_windata      wd;       /* The manager subwindow                */
137     t_windata      title;    /* Title window                            */
138     t_3dview      *view;     /* The 3d struct                        */
139     t_molwin      *molw;     /* The molecule window                     */
140     t_butbox      *vbox;     /* The video box                   */
141     t_butbox      *bbox;     /* The button box                  */
142     t_legendwin   *legw;     /* The legend window                       */
143
144     output_env_t   oenv;     /* output env data */
145 } t_manager;
146
147 extern t_manager *init_man(t_x11 *x11, Window Parent,
148                            int x, int y, int width, int height,
149                            unsigned long fg, unsigned long bg,
150                            int ePBC, matrix box, const output_env_t oenv);
151 /* Initiate the display manager */
152
153 extern void move_man(t_x11 *x11, t_manager *man, int width, int height);
154 /* Set the right size for this window */
155
156 extern void step_message(t_x11 *x11, t_manager *man);
157 /* Send a message to the manager */
158
159 extern void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
160                      const char *status);
161 /* Read a new trajectory and topology */
162
163 extern void map_man(t_x11 *x11, t_manager *man);
164
165 extern void move_man(t_x11 *x11, t_manager *man, int width, int height);
166
167 extern bool toggle_animate (t_x11 *x11, t_manager *man);
168
169 extern bool toggle_pbc (t_manager *man);
170
171 extern void no_labels(t_x11 *x11, t_manager *man);
172 /* Turn off all labels */
173
174 extern void done_man(t_x11 *x11, t_manager *man);
175 /* Clean up man struct */
176
177 extern void draw_mol(t_x11 *x11, t_manager *man);
178
179 extern void create_visibility(t_manager *man);
180
181 extern void do_filter(t_x11 *x11, t_manager *man, t_filter *filter);
182
183 #endif