1 |
+ |
/********************************************************************** |
2 |
+ |
* Copyright (C) 2002-2003 by Gezelter's Group |
3 |
+ |
*This program is free software; you can redistribute it and/or modify |
4 |
+ |
*it under the terms of the GNU General Public License as published by |
5 |
+ |
*the Free Software Foundation version 2 of the License. |
6 |
+ |
* |
7 |
+ |
*This program is distributed in the hope that it will be useful, |
8 |
+ |
*but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 |
+ |
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 |
+ |
*GNU General Public License for more details. |
11 |
+ |
* |
12 |
+ |
************************************************************************ |
13 |
+ |
*Author: Teng Lin Email: tlin@nd.edu |
14 |
+ |
*Date: 08/13/2002 Version: 1.0 |
15 |
+ |
* |
16 |
+ |
************************************************************************ |
17 |
+ |
*Description: |
18 |
+ |
* |
19 |
+ |
***********************************************************************/ |
20 |
|
#include <iostream> |
21 |
|
#include <vector> |
22 |
|
#include "fasatom.h" |
23 |
|
|
24 |
|
using namespace std; |
25 |
|
|
26 |
+ |
/*********************************************************************** |
27 |
+ |
* Class TFASAtom |
28 |
+ |
***********************************************************************/ |
29 |
|
void TFASAtom::Clear() |
30 |
|
{ |
31 |
|
_index = 0; |
32 |
+ |
_frameIndex = 0; |
33 |
|
_atomicNum = 0; |
34 |
|
_nameIndex = 0; |
35 |
|
_typeIndex = 0; |
51 |
|
_residue = NULL; |
52 |
|
_mol = NULL; |
53 |
|
_model = NULL; |
54 |
< |
_bondList.clear(); |
55 |
< |
|
54 |
> |
_bondList.clear(); |
55 |
> |
|
56 |
|
} |
57 |
|
|
58 |
+ |
TFASAtom::TFASAtom() |
59 |
+ |
{ |
60 |
+ |
Clear(); |
61 |
+ |
} |
62 |
+ |
|
63 |
|
TFASAtom::TFASAtom(int index) |
64 |
|
{ |
65 |
|
Clear(); |
66 |
|
_index = index; |
67 |
+ |
_frameIndex = (index - 1) * 3; |
68 |
|
} |
69 |
|
|
70 |
+ |
TFASAtom::TFASAtom(const TFASAtom &src) |
71 |
+ |
{ |
72 |
+ |
|
73 |
+ |
} |
74 |
+ |
|
75 |
|
TFASAtom::~TFASAtom() |
76 |
|
{ |
77 |
< |
|
77 |
> |
Clear(); |
78 |
|
} |
79 |
|
|
80 |
+ |
// |
81 |
|
unsigned int TFASAtom::GetHvyValence() |
82 |
|
{ |
83 |
|
unsigned int count; |
84 |
|
vector<TFASBond *>::iterator i; |
85 |
|
TFASAtom *atom; |
86 |
|
count=0; |
87 |
< |
|
87 |
> |
|
88 |
|
for(atom = BeginNbrAtom(i); atom != NULL; atom = NextNbrAtom(i)) |
89 |
|
if(!atom->IsHydrogen()) count++; |
90 |
< |
|
90 |
> |
|
91 |
|
return count; |
92 |
|
} |
93 |
|
|
94 |
+ |
//Get Coordinate & Velocity |
95 |
+ |
/* |
96 |
+ |
float TFASAtom::GetRX(int frameNum) |
97 |
+ |
{ |
98 |
+ |
if (_model != NULL) |
99 |
+ |
{ |
100 |
+ |
return _model->GetRX(_frameIndex, frameNum); |
101 |
+ |
} |
102 |
+ |
else |
103 |
+ |
{ |
104 |
+ |
|
105 |
+ |
} |
106 |
+ |
} |
107 |
+ |
|
108 |
+ |
float TFASAtom::GetRY(int frameNum) |
109 |
+ |
{ |
110 |
+ |
if (_model != NULL) |
111 |
+ |
{ |
112 |
+ |
return _model->GetRY(_frameIndex+1, frameNum); |
113 |
+ |
} |
114 |
+ |
else |
115 |
+ |
{ |
116 |
+ |
|
117 |
+ |
} |
118 |
+ |
|
119 |
+ |
} |
120 |
+ |
|
121 |
+ |
float TFASAtom::GetRZ(int frameNum) |
122 |
+ |
{ |
123 |
+ |
if (_model != NULL) |
124 |
+ |
{ |
125 |
+ |
return _model->GetRZ(_frameIndex+2, frameNum); |
126 |
+ |
} |
127 |
+ |
else |
128 |
+ |
{ |
129 |
+ |
|
130 |
+ |
} |
131 |
+ |
|
132 |
+ |
} |
133 |
+ |
|
134 |
+ |
float TFASAtom::GetVX(int frameNum) |
135 |
+ |
{ |
136 |
+ |
if (_model != NULL) |
137 |
+ |
{ |
138 |
+ |
return _model->GetVX(_frameIndex, frameNum); |
139 |
+ |
} |
140 |
+ |
else |
141 |
+ |
{ |
142 |
+ |
|
143 |
+ |
} |
144 |
+ |
|
145 |
+ |
} |
146 |
+ |
|
147 |
+ |
float TFASAtom::GetVY(int frameNum) |
148 |
+ |
{ |
149 |
+ |
if (_model != NULL) |
150 |
+ |
{ |
151 |
+ |
return _model->GetVY(_frameIndex+1, frameNum); |
152 |
+ |
} |
153 |
+ |
else |
154 |
+ |
{ |
155 |
+ |
|
156 |
+ |
} |
157 |
+ |
|
158 |
+ |
} |
159 |
+ |
|
160 |
+ |
float TFASAtom::GetVZ(int frameNum) |
161 |
+ |
{ |
162 |
+ |
if (_model != NULL) |
163 |
+ |
{ |
164 |
+ |
return _model->GetVZ(_frameIndex+2, frameNum); |
165 |
+ |
} |
166 |
+ |
else |
167 |
+ |
{ |
168 |
+ |
|
169 |
+ |
} |
170 |
+ |
|
171 |
+ |
} |
172 |
+ |
*/ |
173 |
|
void TFASAtom::AddBond(TFASBond * bond) |
174 |
|
{ |
175 |
|
if (bond==NULL) |
176 |
|
{ |
177 |
< |
|
177 |
> |
|
178 |
|
} |
179 |
|
else |
180 |
|
{ |
181 |
|
_bondList.push_back(bond); |
68 |
– |
back(bond); |
182 |
|
} |
183 |
|
} |
184 |
|
|
319 |
|
|
320 |
|
bool TFASAtom::IsPhosphateOxygen() |
321 |
|
{ |
322 |
+ |
if (!IsOxygen()) return false; |
323 |
|
|
324 |
+ |
|
325 |
|
} |
326 |
|
|
327 |
|
bool TFASAtom::IsSulfateOxygen() |
379 |
|
|
380 |
|
} |
381 |
|
|
382 |
< |
bool TFASAtom::HasAlphaBetaUnsat(bool includePandS=true) |
382 |
> |
bool TFASAtom::HasAlphaBetaUnsat(bool includePandS) |
383 |
|
{ |
384 |
|
|
385 |
|
} |