| 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 FASBOND_H |
| 21 |
#define FASBOND_H |
| 22 |
|
| 23 |
#include <iostream> |
| 24 |
#include <vector> |
| 25 |
|
| 26 |
#define FAS_UNKNOWN_BOND (1<<1) |
| 27 |
#define FAS_HYDROGEN_BOND (1<<2) |
| 28 |
#define FAS_AROMATIC_BOND (1<<3) |
| 29 |
#define FAS_RING_BOND (1<<4) |
| 30 |
|
| 31 |
using namespace std; |
| 32 |
|
| 33 |
namespace TBondType |
| 34 |
{ |
| 35 |
const int btUnknow = FAS_UNKNOWN_BOND; |
| 36 |
const int btHydrogen = FAS_HYDROGEN_BOND; |
| 37 |
const int btAromatic = FAS_AROMATIC_BOND; |
| 38 |
const int btRing = FAS_RING_BOND; |
| 39 |
}; |
| 40 |
|
| 41 |
class TFASAtom; |
| 42 |
class TFASModel; |
| 43 |
|
| 44 |
class TFASBond |
| 45 |
{ |
| 46 |
protected: |
| 47 |
unsigned int _index; |
| 48 |
unsigned int _bondOrder; |
| 49 |
int _bondType; |
| 50 |
TFASAtom *_begin; |
| 51 |
TFASAtom *_end; |
| 52 |
TFASModel *model; |
| 53 |
|
| 54 |
public: |
| 55 |
TFASBond(); |
| 56 |
TFASBond(int index); |
| 57 |
~TFASBond(); |
| 58 |
|
| 59 |
void SetIndex(unsigned int index) { _index = index;} |
| 60 |
void SetBondOrder(unsigned int bondOrder) { _bondOrder = bondOrder;} |
| 61 |
void SetBegin(TFASAtom *begin) { _begin = begin;} |
| 62 |
void SetEnd(TFASAtom *end) { _end = end;} |
| 63 |
void SetBondType(int bondType) { _bondType |= bondType;} |
| 64 |
bool HasBondType(int bondType) {return _bondType & bondType;} |
| 65 |
|
| 66 |
unsigned int GetIndex() { return _index;} |
| 67 |
unsigned int GetBondOrder() { return _bondOrder;} |
| 68 |
TFASAtom *GetBegin() { return _begin;} |
| 69 |
TFASAtom *GetEnd() { return _end;} |
| 70 |
TFASAtom *GetNbrAtom(const TFASAtom * atom); |
| 71 |
|
| 72 |
//methods of bond type |
| 73 |
bool IsHydrogenBond(); |
| 74 |
bool IsExteriorBond(); |
| 75 |
bool IsSingle(); |
| 76 |
bool IsDouble(); |
| 77 |
bool IsTriple(); |
| 78 |
bool IsRotor(); |
| 79 |
bool IsAmide(); |
| 80 |
bool IsPrimaryAmide(); |
| 81 |
bool IsSecondaryAmide(); |
| 82 |
bool IsEster(); |
| 83 |
bool IsCarbonyl(); |
| 84 |
bool IsAromatic(); |
| 85 |
|
| 86 |
//method of bond length |
| 87 |
float GetBondLength(int frameNum=-1); |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
}; |
| 92 |
|
| 93 |
#endif |