Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VirtualCoordinate.cc
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 // This file is made available under the Rosetta Commons license.
5 // See http://www.rosettacommons.org/license
6 // (C) 199x-2007 University of Washington
7 // (C) 199x-2007 University of California Santa Cruz
8 // (C) 199x-2007 University of California San Francisco
9 // (C) 199x-2007 Johns Hopkins University
10 // (C) 199x-2007 University of North Carolina, Chapel Hill
11 // (C) 199x-2007 Vanderbilt University
12 
13 /// @brief VirtualCoordinate container
14 /// @file core/conformation/symmetry/VirtualCoordinate.cc
15 /// @author Ingemar Andre
16 
17 // Unit headers
19 
20 // C++ headers
21 #include <iostream>
22 
23 // Utility header
24 // AUTO-REMOVED #include <utility/io/izstream.hh>
25 #include <utility/string_util.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 namespace core {
31 namespace conformation {
32 namespace symmetry {
33 
35 {
36  axis_x_ = src.axis_x_;
37  axis_y_ = src.axis_y_;
39 }
40 
42 
43  /// @brief copy constructor
44 //VirtualCoordinate::VirtualCoordinate( VirtualCoordinate const & src );
45 
50  )
51  {
52  axis_x_ = axis_x;
53  axis_y_ = axis_y;
54  axis_origin_ = axis_origin;
55  }
56 
59  axis_x_ = src.axis_x_;
60  axis_y_ = src.axis_y_;
62  return *this;
63  }
64 
66 
67  // @details accessor functions
70  {
71  return axis_x_;
72  }
73 
76  {
77  return axis_y_;
78  }
79 
82  {
83  return axis_origin_;
84  }
85 
86  // @details accessor functions
89  {
90  return axis_x_;
91  }
92 
95  {
96  return axis_y_;
97  }
98 
101  {
102  return axis_origin_;
103  }
104 // @details read the coordinates of a virtual residues from string. Start reading
105 // coordinates from coord_start. The coordinates correspond to the unit vectors for
106 // X, Y axis and a origin. Vectors are not automatically normalized here. Should we
107 // do that?
108 void
111  core::Size coord_start )
112 {
113  assert( coords.size() >= 3 );
114  utility::vector1< std::string> split ( utility::string_split( coords[ coord_start ], ',' ) );
115  assert( split.size() == 3 );
116  axis_x_ = Vector( ( static_cast<core::Real>( std::atof( split[1].c_str() ) ) ),
117  ( static_cast<core::Real>( std::atof( split[2].c_str() ) ) ),
118  ( static_cast<core::Real>( std::atof( split[3].c_str() ) ) ) );
119  split = utility::string_split( coords[ coord_start +1 ], ',' );
120  axis_y_ = Vector( ( static_cast<core::Real>( std::atof( split[1].c_str() ) ) ),
121  ( static_cast<core::Real>( std::atof( split[2].c_str() ) ) ),
122  ( static_cast<core::Real>( std::atof( split[3].c_str() ) ) ) );
123  axis_origin_ = Vector(0,0,0);
124  if ( coords.size() == 5 ) {
125  split = utility::string_split( coords[ coord_start +2 ], ',' );
126  axis_origin_ = Vector( ( static_cast<core::Real>( std::atof( split[1].c_str() ) ) ),
127  ( static_cast<core::Real>( std::atof( split[2].c_str() ) ) ),
128  ( static_cast<core::Real>( std::atof( split[3].c_str() ) ) ) );
129  }
130 }
131 
132 bool
134  VirtualCoordinate const & a,
135  VirtualCoordinate const & b
136 ) {
137  return
138  (a.axis_x_ == b.axis_x_) &&
139  (a.axis_y_ == b.axis_y_) &&
140  (a.axis_origin_ == b.axis_origin_);
141 }
142 
143 bool
145  VirtualCoordinate const & a,
146  VirtualCoordinate const & b
147 ) {
148  return !(a == b);
149 }
150 
151 
152 } // symmetry
153 } // conformation
154 } // core