| 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 |
|
#ifndef FASATOM_H |
| 21 |
|
#define FASATOM_H |
| 22 |
|
#include <iostream> |
| 23 |
|
#include <vector> |
| 24 |
|
#include "fasbond.h" |
| 25 |
+ |
#include "fasmodel.h" |
| 26 |
|
using namespace std; |
| 27 |
|
|
| 28 |
|
class TFASModel; |
| 32 |
|
|
| 33 |
|
//ATOM Property Macros |
| 34 |
|
#define FAS_NORMAL_ATOM (1<<1) |
| 35 |
< |
#define FAS_PROTEINBACK_ATOM (1<<2) |
| 35 |
> |
#define FAS_PROTEINBACK_ATOM (1<<2) |
| 36 |
|
#define FAS_NUCLEIC_ATOM (1<<3) |
| 37 |
|
#define FAS_AROMATIC_ATOM (1<<4) |
| 38 |
< |
#define FAS_RING_ATOM (1<<5) |
| 38 |
> |
#define FAS_RING_ATOM (1<<5) |
| 39 |
|
#define FAS_CSTEREO_ATOM (1<<6) |
| 40 |
|
#define FAS_ACSTEREO_ATOM (1<<7) |
| 41 |
|
#define FAS_DONOR_ATOM (1<<8) |
| 42 |
< |
#define FAS_ACCEPTOR_ATOM (1<<8) |
| 42 |
> |
#define FAS_ACCEPTOR_ATOM (1<<9) |
| 43 |
|
#define FAS_CHIRAL_ATOM (1<<10) |
| 44 |
|
|
| 45 |
|
namespace TAtomProp |
| 47 |
|
const int apNormal = FAS_NORMAL_ATOM; |
| 48 |
|
const int apProtein = FAS_PROTEINBACK_ATOM; |
| 49 |
|
const int apNucleic = FAS_NUCLEIC_ATOM; |
| 30 |
– |
const int ap4Ring = FAS_4RING_ATOM; |
| 31 |
– |
const int ap3Ring = FAS_3RING_ATOM; |
| 50 |
|
const int apAromatic = FAS_AROMATIC_ATOM; |
| 51 |
|
const int apRing = FAS_RING_ATOM; |
| 52 |
|
const int apCStereo = FAS_CSTEREO_ATOM; |
| 53 |
|
const int apACStereo = FAS_ACSTEREO_ATOM; |
| 54 |
|
const int apDonor = FAS_DONOR_ATOM; |
| 55 |
|
const int apAcceptor = FAS_ACCEPTOR_ATOM; |
| 56 |
< |
const int apChiral = FAS_CHIRAL_ATOM; |
| 56 |
> |
const int apChiral = FAS_CHIRAL_ATOM; |
| 57 |
|
}; |
| 58 |
|
|
| 59 |
|
class TFASAtom |
| 60 |
|
{ |
| 61 |
|
protected: |
| 62 |
|
unsigned int _index; |
| 63 |
+ |
unsigned int _frameIndex; |
| 64 |
|
unsigned int _atomicNum; |
| 65 |
|
unsigned int _nameIndex; |
| 66 |
|
unsigned int _typeIndex; |
| 70 |
|
unsigned int _chainIndex; |
| 71 |
|
unsigned int _segnameIndex; |
| 72 |
|
int _atomProp; |
| 73 |
< |
|
| 74 |
< |
//actually we can put these properties on an element table, but we may want to change them sometime, who |
| 73 |
> |
|
| 74 |
> |
//actually we can put these properties on an element table, but we may want to change them sometime, who |
| 75 |
|
//knows, anyway it is a trade off between space and speed |
| 76 |
|
float _mass; |
| 77 |
|
float _charge; |
| 82 |
|
float _pcharge; |
| 83 |
|
unsigned int _hyb; |
| 84 |
|
unsigned int _impval; |
| 85 |
< |
|
| 85 |
> |
|
| 86 |
|
TFASResidue *_residue; |
| 87 |
|
TFASMolecule *_mol; |
| 88 |
|
TFASModel * _model; |
| 89 |
|
vector<TFASBond *> _bondList; |
| 90 |
|
bool _pseudo; |
| 91 |
< |
|
| 91 |
> |
|
| 92 |
|
void SetAtomProp(int atomProp) { _atomProp |= atomProp;} |
| 93 |
|
void Clear(); |
| 94 |
|
public: |
| 95 |
+ |
TFASAtom(); |
| 96 |
|
TFASAtom(int index); |
| 97 |
+ |
TFASAtom(const TFASAtom & src); |
| 98 |
|
~TFASAtom(); |
| 99 |
< |
|
| 99 |
> |
|
| 100 |
|
//methods to set atomic information |
| 101 |
< |
void SetIndex(unsigned int index) { _index = index;} |
| 101 |
> |
void SetIndex(unsigned int index) { _index = index, _frameIndex = 3*(index-1);} |
| 102 |
|
void SetAtomicNum(unsigned int atomicNum) { _atomicNum = atomicNum;} |
| 103 |
< |
void SetNameIndex(unsigned int nameIndex) { _nameIndex = nameIndex;} |
| 103 |
> |
void SetNameIndex(unsigned int nameIndex) { _nameIndex = nameIndex;} |
| 104 |
|
void SetTypeIndex(unsigned int typeIndex) { _typeIndex = typeIndex;} |
| 105 |
|
void SetResid(unsigned int resid) { _resid=resid;} |
| 106 |
|
void SetResidIndex(unsigned int residIndex) { _residIndex = residIndex;} |
| 107 |
|
void SetResnameIndex(unsigned int resnameIndex) { _resnameIndex = resnameIndex;} |
| 108 |
|
void SetChainIndex(unsigned int chainIndex) { _chainIndex = chainIndex;} |
| 109 |
< |
void SetSegnameIndex(unsigned int segnameIndex) { _segnameIndex = segnameIndex;} |
| 109 |
> |
void SetSegnameIndex(unsigned int segnameIndex) { _segnameIndex = segnameIndex;} |
| 110 |
|
void SetResidue(TFASResidue *residue) { _residue = residue;} |
| 111 |
|
void SetMolecule(TFASMolecule *mol) { _mol = mol;} |
| 112 |
|
void SetModel(TFASModel *model) { _model = model;} |
| 120 |
|
void SetMaxBonds(float maxBonds) { _maxBonds=maxBonds;} |
| 121 |
|
void SetHyb(unsigned int hyb) { _hyb = hyb;} |
| 122 |
|
void SetImplicitValence (unsigned int impval) { _impval = impval;} |
| 123 |
< |
|
| 123 |
> |
|
| 124 |
|
//methods to get atomic information |
| 125 |
|
unsigned int GetIndex() { return _index;} |
| 126 |
+ |
unsigned int GetFrameIndex() { return _frameIndex;} |
| 127 |
|
unsigned int GetAtomicNum() { return _atomicNum;} |
| 128 |
|
unsigned int GetNameIndex() { return _nameIndex;} |
| 129 |
|
unsigned int GetTypeIndex() { return _typeIndex;} |
| 130 |
< |
unsigned int GetResid() { return _resid;} |
| 130 |
> |
unsigned int GetResid() { return _resid;} |
| 131 |
|
unsigned int GetResidIndex() { return _residIndex;} |
| 132 |
|
unsigned int GetResnameIndex() { return _resnameIndex;} |
| 133 |
|
unsigned int GetChainIndex() { return _chainIndex;} |
| 134 |
|
unsigned int GetSegnameIndex() { return _segnameIndex;} |
| 135 |
< |
|
| 135 |
> |
|
| 136 |
|
TFASResidue *GetResidue() { return _residue;} |
| 137 |
|
TFASMolecule *GetMolecule() { return _mol;} |
| 138 |
|
TFASModel *GetModel() { return _model;} |
| 139 |
|
bool IsPseudo() { return _pseudo;} |
| 140 |
< |
|
| 140 |
> |
|
| 141 |
|
float GetMass() { return _mass;} |
| 142 |
|
float GetCharge() { return _charge;} |
| 143 |
|
float GetPartialCharge() { return _pcharge;} |
| 149 |
|
unsigned int GetImplicitValence() { return _impval;} |
| 150 |
|
unsigned int GetHvyValence(); |
| 151 |
|
unsigned int GetValence() {return (unsigned int)_bondList.size();} |
| 152 |
< |
|
| 152 |
> |
|
| 153 |
> |
//Get Coordinate and Velocity |
| 154 |
> |
/* |
| 155 |
> |
float GetRX(int frameNum = -1); |
| 156 |
> |
float GetRY(int frameNum = -1); |
| 157 |
> |
float GetRZ(int frameNum = -1); |
| 158 |
> |
float GetVX(int frameNum = -1); |
| 159 |
> |
float GetVY(int frameNum = -1); |
| 160 |
> |
float GetVZ(int frameNum = -1); |
| 161 |
> |
*/ |
| 162 |
|
//meothds to manipulate bond |
| 163 |
|
void AddBond(TFASBond * bond); |
| 164 |
|
void DeleteBond(TFASBond *bond); |
| 165 |
|
TFASBond *BeginBond(vector<TFASBond *>::iterator &i); |
| 166 |
|
TFASBond *NextBond(vector<TFASBond *>::iterator &i); |
| 167 |
< |
TFASBond *GetBond(TFASAtom *nbrAtom); |
| 167 |
> |
TFASBond *GetBond(TFASAtom *nbrAtom); |
| 168 |
|
//methods to traverse neighbor atoms |
| 169 |
|
TFASAtom *BeginNbrAtom(vector<TFASBond *>::iterator &i); |
| 170 |
|
TFASAtom *NextNbrAtom(vector<TFASBond *>::iterator &i); |
| 171 |
< |
|
| 171 |
> |
|
| 172 |
|
// |
| 173 |
|
|
| 174 |
|
int GetAtomProp() { return _atomProp;} |