Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FourPointsFunc.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 // (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 /// @file
11 /// @brief
12 
13 
15 
18 #include <core/id/AtomID.hh>
19 
20 #include <utility/string_util.hh>
21 
22 #include <utility/vector1.hh>
23 
24 
25 namespace core {
26 namespace scoring {
27 namespace constraints {
28 
29 FourPointsFunc::FourPointsFunc() : points_( 4, Vector(0.0) ) {}
30 
31 /// @brief set the coordinate for one of the four atoms
32 void FourPointsFunc::xyz( Size atomno, Vector const & coord )
33 {
34  if ( atomno < 1 || atomno > 4 ) {
35  utility_exit_with_message( "Error: FourPointsFunc can only store coordinates for four atoms; id " + utility::to_string( atomno ) + " is invalid." );
36  }
37  points_[ atomno ] = coord;
38 }
39 
41 
42 Vector const &
44 {
45  if ( id.rsd() != 1 ) {
46  utility_exit_with_message( "Error: invalid AtomID for FourPointsFunc. Must request residu 1. Requested residue " + utility::to_string( id.rsd() ) + " instead");
47  }
48  if ( id.atomno() < 1 || id.atomno() > 4 ) {
49  utility_exit_with_message( "Error: FourPointsFunc can only store coordinates for four atoms; id " + utility::to_string( id.atomno() ) + " is invalid." );
50  }
51  return points_[ id.atomno() ];
52 }
53 
56 {
57  utility_exit_with_message( "FourPointsFunc does not implement a residue() method" );
58 
59  // unreachable -- appease compiler
60  chemical::AtomTypeSetCAP atset( 0 );
61  chemical::ElementSetCAP elements( 0 );
62  chemical::MMAtomTypeSetCAP mmset( 0 );
64  chemical::ResidueType rt( atset, elements, mmset, otset );
65  static conformation::Residue r( rt, true );
66  return r;
67 }
68 
69 } // constraints
70 } // scoring
71 } // core