Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Atom.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 //////////////////////////////////////////////////////////////////////
10 /// @begin Atom.hh
11 ///
12 /// @brief
13 /// The conformation class of the atom object
14 ///
15 /// @detailed
16 /// This atom class differs from the AtomType/AtomTypeSet class in that it only contains the
17 /// information about the xyz coordinates, the index of the atom, and the index of the atomtype.
18 /// This information is generally initialized and set by conformation/Residue.hh.
19 /// Steven Combs - comments
20 ///
21 /// @authors
22 /// Phil Bradley
23 ///
24 ///
25 ///
26 /// @last_modified December 9 2010
27 /////////////////////////////////////////////////////////////////////////
28 
29 #ifndef INCLUDED_core_conformation_Atom_hh
30 #define INCLUDED_core_conformation_Atom_hh
31 
32 
33 // Unit headers
35 
36 // Project headers
37 #include <core/types.hh>
38 
39 // Utility headers
40 #include <numeric/xyzVector.hh>
41 
42 // C++ headers
43 
44 namespace core {
45 namespace conformation {
46 
47 /// A simple object with atom's position and its chemical type
48 class Atom {
49 
50 public:
51  /// @brief default constructor and set atom type number to 0 and place the
52  /// atom at the origin
53  Atom():
54  xyz_( 0.0 ),
55  type_( 0 ),
56  mm_type_( 0 )
57  {}
58 
59  /// @brief constructor with an atom type number
60  // type is set at construction time -- atom is placed at the origin
61  Atom( ShortSize const type_in, ShortSize const mm_type_in ):
62  xyz_( 0.0 ),
63  type_( type_in ),
64  mm_type_( mm_type_in )
65  {}
66 
67  /// @brief constructor with xyz and an atom type number
68  // Atom( Vector const & xyz_in, int const type_in, Real temperature = 0.0 ):
69  Atom( Vector const & xyz_in, ShortSize const type_in, ShortSize const mm_type_in ):
70  xyz_( xyz_in ),
71  type_( type_in ),
72  mm_type_( mm_type_in )
73  {}
74 
75  /// @brief destructor
76  virtual
77  ~Atom() {}
78 
79  /// @brief set the atom type number
80  void type( ShortSize const type_in )
81  {
82  type_ = type_in;
83  }
84 
85  /// @brief Returns the AtomType number
86  ShortSize
87  type() const
88  {
89  return type_;
90  }
91 
92  /// @brief set the mm atom type number
93  void mm_type( ShortSize const mm_type_in )
94  {
95  mm_type_ = mm_type_in;
96  }
97 
98  /// @brief get the mm atom type number
99  ShortSize
100  mm_type() const
101  {
102  return mm_type_;
103  }
104 
105  /// @brief Returns the atom coordinates as an xyzVector
106  Vector const &
107  xyz() const
108  {
109  return xyz_;
110  }
111 
112  /// @brief Sets the atom coordinates using an xyzVector
113  void
114  xyz( Vector const & xyz_in )
115  {
116  xyz_ = xyz_in;
117  }
118 
119  // /// @brief access temperature Real
120  // Real temperature() const {
121  // return temperature_;
122  // }
123  //
124  // /// @brief set temperature Real
125  // void
126  // temperature( Real temp ) {
127  // temperature_ = temp;
128  // }
129 
130 private:
131 #ifdef USEBOOSTSERIALIZE
132  friend class boost::serialization::access;
133 
134  template<class Archive>
135  void serialize(Archive & ar, const unsigned int version) {
136  ar & xyz_;
137  ar & type_;
138  ar & mm_type_;
139  }
140 #endif
141  // data
142 
143  /// position
145 
146  /// rosetta atom_type
148 
149  /// mm_atom_type
151 
152  /// b-factor from pdb file
153  // Real temperature_;
154 };
155 
156 std::ostream & operator << ( std::ostream & os, Atom const & atom );
157 
158 } // pose
159 } // core
160 
161 
162 
163 #endif // INCLUDED_core_pose_Residues_HH