3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2009, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
32 * \brief Definition of \c gmx_ana_selcollection_t.
34 * This is an implementation header: there should be no need to use it outside
37 #ifndef SELECTION_COLLECTION_H
38 #define SELECTION_COLLECTION_H
42 #include <indexutil.h>
46 * Information for a collection of selections.
48 * The functions to deal with the structure are defined in selection.h.
49 * The structure is allocated with gmx_ana_selcollection_create() and
50 * freed with gmx_ana_selcollection_free().
51 * Some default values must then be set with
52 * gmx_ana_selcollection_set_refpostype() and
53 * gmx_ana_selcollection_set_outpostype().
55 * After setting the default values, one or more selections can be parsed
56 * with gmx_ana_selcollection_parse_*().
57 * At latest at this point, the topology must be set with
58 * gmx_ana_selcollection_set_topology() unless
59 * gmx_ana_selcollection_requires_top() returns FALSE.
60 * Once all selections are parsed, they must be compiled all at once using
61 * gmx_ana_selcollection_compile().
62 * After these calls, gmx_ana_selcollection_get_count() and
63 * gmx_ana_selcollection_get_selections() can be used
64 * to get the compiled selections.
65 * gmx_ana_selcollection_evaluate() can be used to update the selections for a
67 * gmx_ana_selcollection_evaluate_fin() can be called after all the frames have
68 * been processed to restore the selection values back to the ones they were
69 * after gmx_ana_selcollection_compile(), i.e., dynamic selections have the
70 * maximal index group as their value.
72 * At any point, gmx_ana_selcollection_requires_top() can be called to see
73 * whether the information provided so far requires loading the topology.
74 * gmx_ana_selcollection_print_tree() can be used to print the internal
75 * representation of the selections (mostly useful for debugging).
77 struct gmx_ana_selcollection_t
79 /** Default reference position type for selections. */
81 /** Default output position type for selections. */
83 /** TRUE if \ref POS_MASKONLY should be used for output position evaluation. */
86 /** Root of the selection element tree. */
87 struct t_selelem
*root
;
88 /** Number of selections in \p sel. */
90 /** Array of compiled selections. */
91 struct gmx_ana_selection_t
**sel
;
92 /** Number of variables defined. */
94 /** Selection strings for variables. */
97 /** Topology for the collection. */
99 /** Index group that contains all the atoms. */
100 struct gmx_ana_index_t gall
;
101 /** Position calculation collection used for selection position evaluation. */
102 struct gmx_ana_poscalc_coll_t
*pcc
;
103 /** Parser symbol table. */
104 struct gmx_sel_symtab_t
*symtab
;
107 /** Clears the symbol table in the collection */
109 _gmx_selcollection_clear_symtab(struct gmx_ana_selcollection_t
*sc
);