Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
constraints
XYZ_Func.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
/// Unit headers
14
#include <
core/scoring/constraints/XYZ_Func.hh
>
15
16
#include <
core/types.hh
>
17
18
#include <
core/conformation/Residue.hh
>
19
#include <
core/conformation/Conformation.hh
>
20
#include <
core/id/AtomID.hh
>
21
22
#include <utility/assert.hh>
23
24
#include <utility/vector1.hh>
25
26
27
namespace
core {
28
namespace
scoring {
29
namespace
constraints {
30
31
//////////////////////////////////////////////////////////////////////////////////
32
//////////////////////////////////////////////////////////////////////////////////
33
/// helper classes to reuse code
34
//////////////////////////////////////////////////////////////////////////////////
35
//////////////////////////////////////////////////////////////////////////////////
36
37
38
XYZ_Func::~XYZ_Func
(){}
39
40
41
ResidueXYZ::ResidueXYZ
(
Residue
const
& rsd_in ): rsd_( rsd_in ) {}
42
43
44
Vector
const
&
45
ResidueXYZ::operator()
(
AtomID
const
&
id
)
const
46
{
47
assert(
id
.rsd() ==
rsd_
.
seqpos
() &&
id
.atomno() <=
rsd_
.
natoms
() );
48
return
rsd_
.
xyz
(
id
.atomno() );
49
}
50
51
52
conformation::Residue
const
&
53
ResidueXYZ::residue
(
Size
ASSERT_ONLY( seqpos ) )
const
{
54
assert( (
Size
)
rsd_
.
seqpos
() == seqpos );
55
return
rsd_
;
56
}
57
58
59
ResidueXYZ::~ResidueXYZ
(){}
60
61
ResiduePairXYZ::ResiduePairXYZ
(
Residue
const
& rsd1_in,
Residue
const
& rsd2_in )
62
:
63
rsd1_( rsd1_in ),
64
rsd2_( rsd2_in )
65
{}
66
67
68
Vector
const
&
69
ResiduePairXYZ::operator()
(
AtomID
const
&
id
)
const
70
{
71
Residue
const
& rsd( (
id
.rsd() ==
rsd1_
.
seqpos
() ) ?
rsd1_
:
rsd2_
);
72
assert(
id
.rsd() == rsd.
seqpos
() &&
id
.atomno() <= rsd.
natoms
() );
73
return
rsd.
xyz
(
id
.atomno() );
74
}
75
76
77
conformation::Residue
const
&
78
ResiduePairXYZ::residue
(
Size
seqpos )
const
{
79
assert( (
Size
)
rsd1_
.
seqpos
() == seqpos || (
Size
)
rsd2_
.
seqpos
() == seqpos );
80
return
(
Size
)
rsd1_
.
seqpos
() == seqpos ?
rsd1_
:
rsd2_
;
81
}
82
83
ResiduePairXYZ::~ResiduePairXYZ
() {}
84
85
ConformationXYZ::ConformationXYZ
(
Conformation
const
& conformation_in ): conformation_( conformation_in ) {}
86
87
88
Vector
const
&
89
ConformationXYZ::operator()
(
AtomID
const
&
id
)
const
90
{
91
return
conformation_
.
xyz
(
id
);
92
}
93
94
95
conformation::Residue
const
&
96
ConformationXYZ::residue
(
Size
seqpos )
const
{
97
return
conformation_
.
residue
( seqpos );
98
}
99
100
ConformationXYZ::~ConformationXYZ
() {}
101
102
}
// constraints
103
}
// scoring
104
}
// core
105
Generated on Sat Jun 1 2013 11:35:57 for Rosetta 3.5 by
1.8.4