ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/FAS/src/fasbond.h
Revision: 88
Committed: Mon Aug 19 20:49:08 2002 UTC (22 years ago) by tim
Content type: text/plain
File size: 2509 byte(s)
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 tim 88 /**********************************************************************
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 tim 66 #ifndef FASBOND_H
21     #define FASBOND_H
22    
23     #include <iostream>
24     #include <vector>
25    
26 tim 88 #define FAS_UNKNOWN_BOND (1<<1)
27 tim 66 #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 tim 88 TFASModel *model;
53 tim 66
54     public:
55     TFASBond();
56 tim 88 TFASBond(int index);
57 tim 66 ~TFASBond();
58 tim 88
59 tim 66 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 tim 88
66 tim 66 unsigned int GetIndex() { return _index;}
67     unsigned int GetBondOrder() { return _bondOrder;}
68     TFASAtom *GetBegin() { return _begin;}
69 tim 88 TFASAtom *GetEnd() { return _end;}
70 tim 66 TFASAtom *GetNbrAtom(const TFASAtom * atom);
71 tim 88
72 tim 66 //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 tim 88 bool IsAromatic();
85 tim 66
86     //method of bond length
87     float GetBondLength(int frameNum=-1);
88    
89 tim 88
90    
91 tim 66 };
92    
93     #endif