IMP  2.0.0
The Integrative Modeling Platform
CHARMMAtom.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/CHARMMAtom.h
3  * \brief A decorator for an atom that has a defined CHARMM type.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_CHARMM_ATOM_H
10 #define IMPATOM_CHARMM_ATOM_H
11 
12 #include <IMP/atom/atom_config.h>
13 
14 #include "Atom.h"
15 #include "Hierarchy.h"
17 
18 #include <vector>
19 #include <limits>
20 
21 IMPATOM_BEGIN_NAMESPACE
22 
23 //! A decorator for an atom that has a defined CHARMM type.
24 class IMPATOMEXPORT CHARMMAtom : public Atom
25 {
26 public:
28 
29  /** Create a decorator with the passed CHARMM type.
30  The particle is assumed to already have all atom attributes.
31  */
32  static CHARMMAtom setup_particle(Particle *p, String charmm_type) {
33  IMP_USAGE_CHECK(Atom::particle_is_instance(p),
34  "Particle must already be an Atom particle");
35  p->add_attribute(get_charmm_type_key(), charmm_type);
36  return CHARMMAtom(p);
37  }
38 
39  IMP_DECORATOR_GET_SET(charmm_type, get_charmm_type_key(), String, String);
40 
41  //! Return true if the particle is an instance of a CHARMMAtom
42  static bool particle_is_instance(Particle *p) {
44  && p->has_attribute(get_charmm_type_key());
45  }
46 
47  static StringKey get_charmm_type_key();
48 };
49 
50 //! Get all atoms in the Hierarchy that do not have CHARMM types.
51 /** \return a list of every Atom in the given Hierarchy that is not also
52  a CHARMMAtom.
53  \see remove_charmm_untyped_atoms
54  */
55 IMPATOMEXPORT Atoms get_charmm_untyped_atoms(Hierarchy hierarchy);
56 
57 //! Remove any atom from the Hierarchy that does not have a CHARMM type.
58 /** \see get_charmm_untyped_atoms, CHARMMTopology::add_missing_atoms
59  */
60 IMPATOMEXPORT void remove_charmm_untyped_atoms(Hierarchy hierarchy);
61 
62 IMPATOM_END_NAMESPACE
63 
64 #endif /* IMPATOM_CHARMM_ATOM_H */