1 |
gezelter |
1210 |
/********************************************************************** |
2 |
|
|
|
3 |
|
|
This basic Element data-holding class was originally taken from the data.h |
4 |
|
|
file in OpenBabel. The code has been modified to match the OOPSE coding style. |
5 |
|
|
|
6 |
|
|
We have retained the OpenBabel copyright and GPL license on this class: |
7 |
|
|
|
8 |
|
|
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc. |
9 |
|
|
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison |
10 |
|
|
|
11 |
|
|
This file is part of the Open Babel project. |
12 |
|
|
For more information, see <http://openbabel.sourceforge.net/> |
13 |
|
|
|
14 |
|
|
This program is free software; you can redistribute it and/or modify |
15 |
|
|
it under the terms of the GNU General Public License as published by |
16 |
|
|
the Free Software Foundation version 2 of the License. |
17 |
|
|
|
18 |
|
|
This program is distributed in the hope that it will be useful, |
19 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 |
|
|
GNU General Public License for more details. |
22 |
|
|
***********************************************************************/ |
23 |
|
|
|
24 |
|
|
/** |
25 |
|
|
* @file Element.hpp |
26 |
|
|
* @author gezelter |
27 |
|
|
* @date 12/21/2007 |
28 |
|
|
* @version 1.0 |
29 |
|
|
*/ |
30 |
|
|
|
31 |
|
|
#ifndef PRIMITIVES_ELEMENT_HPP |
32 |
|
|
#define PRIMITIVES_ELEMENT_HPP |
33 |
|
|
#include <string> |
34 |
|
|
#include "config.h" |
35 |
|
|
|
36 |
|
|
namespace oopse{ |
37 |
|
|
class Element { |
38 |
|
|
public: |
39 |
|
|
Element() {} |
40 |
|
|
Element(int num, const char *sym, RealType rcov, RealType rvdw, |
41 |
|
|
int maxbo, RealType mass, RealType elNeg, RealType ionize, |
42 |
|
|
RealType elAffin, RealType red, RealType green, RealType blue, |
43 |
|
|
std::string name) : |
44 |
|
|
num_(num), name_(name), Rcov_(rcov), Rvdw_(rvdw), mass_(mass), |
45 |
|
|
elNeg_(elNeg), ionize_(ionize), elAffinity_(elAffin), |
46 |
|
|
red_(red), green_(green), blue_(blue), |
47 |
|
|
maxbonds_(maxbo) |
48 |
|
|
{ |
49 |
|
|
strncpy(symbol_, sym, 3); |
50 |
|
|
} |
51 |
|
|
|
52 |
|
|
|
53 |
|
|
/** |
54 |
|
|
* Returns the atomic number of this element |
55 |
|
|
* @return the atomic number of this element |
56 |
|
|
*/ |
57 |
|
|
int GetAtomicNum() { |
58 |
|
|
return(num_); |
59 |
|
|
} |
60 |
|
|
|
61 |
|
|
/** |
62 |
|
|
* Returns the atomic symbol for this element |
63 |
|
|
* @return the atomic symbol for this element |
64 |
|
|
*/ |
65 |
|
|
char *GetSymbol() { |
66 |
|
|
return(symbol_); |
67 |
|
|
} |
68 |
|
|
|
69 |
|
|
/** |
70 |
|
|
* Returns the covalent radius of this element |
71 |
|
|
* @return the covalent radius of this element |
72 |
|
|
*/ |
73 |
|
|
RealType GetCovalentRad() { |
74 |
|
|
return(Rcov_); |
75 |
|
|
} |
76 |
|
|
|
77 |
|
|
/** |
78 |
|
|
* Returns the van der Waals radius of this element |
79 |
|
|
* @return the van der Waals radius of this element |
80 |
|
|
*/ |
81 |
|
|
RealType GetVdwRad() { |
82 |
|
|
return(Rvdw_); |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
/** |
86 |
|
|
* Returns the standard atomic mass for this element (in amu) |
87 |
|
|
* @return the standard atomic mass for this element (in amu) |
88 |
|
|
*/ |
89 |
|
|
RealType GetMass() { |
90 |
|
|
return(mass_); |
91 |
|
|
} |
92 |
|
|
|
93 |
|
|
/** |
94 |
|
|
* Returns the maximum expected number of bonds to this element |
95 |
|
|
* @return the maximum expected number of bonds to this element |
96 |
|
|
*/ |
97 |
|
|
int GetMaxBonds() { |
98 |
|
|
return(maxbonds_); |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
/** |
102 |
|
|
* Returns the Pauling electronegativity for this element |
103 |
|
|
* @return the Pauling electronegativity for this element |
104 |
|
|
*/ |
105 |
|
|
RealType GetElectroNeg() { |
106 |
|
|
return(elNeg_); |
107 |
|
|
} |
108 |
|
|
|
109 |
|
|
/** |
110 |
|
|
* Returns the ionization potential (in eV) of this element |
111 |
|
|
* @return the ionization potential (in eV) of this element |
112 |
|
|
*/ |
113 |
|
|
RealType GetIonization() { |
114 |
|
|
return(ionize_); |
115 |
|
|
} |
116 |
|
|
|
117 |
|
|
/** |
118 |
|
|
* Returns the electron affinity (in eV) of this element |
119 |
|
|
* @return the electron affinity (in eV) of this element |
120 |
|
|
*/ |
121 |
|
|
RealType GetElectronAffinity() { |
122 |
|
|
return(elAffinity_); |
123 |
|
|
} |
124 |
|
|
|
125 |
|
|
/** |
126 |
|
|
* Returns the name of this element (in English) |
127 |
|
|
* @return the name of this element (in English) |
128 |
|
|
*/ |
129 |
|
|
std::string GetName() { |
130 |
|
|
return(name_); |
131 |
|
|
} |
132 |
|
|
|
133 |
|
|
/** |
134 |
|
|
* Returns the red component of this element's default visualization color |
135 |
|
|
* @return the red component of this element's default visualization color |
136 |
|
|
*/ |
137 |
|
|
RealType GetRed() { |
138 |
|
|
return(red_); |
139 |
|
|
} |
140 |
|
|
|
141 |
|
|
/** |
142 |
|
|
* Returns the green component of this element's default color |
143 |
|
|
* @return the green component of this element's default color |
144 |
|
|
*/ |
145 |
|
|
RealType GetGreen() { |
146 |
|
|
return(green_); |
147 |
|
|
} |
148 |
|
|
|
149 |
|
|
/** |
150 |
|
|
* Returns the blue component of this element's default color |
151 |
|
|
* @return the blue component of this element's default color |
152 |
|
|
*/ |
153 |
|
|
RealType GetBlue() { |
154 |
|
|
return(blue_); |
155 |
|
|
} |
156 |
|
|
|
157 |
|
|
protected: |
158 |
|
|
int num_; |
159 |
|
|
char symbol_[3]; |
160 |
|
|
std::string name_; |
161 |
|
|
RealType Rcov_, Rvdw_, mass_, elNeg_, ionize_, elAffinity_; |
162 |
|
|
RealType red_, green_, blue_; |
163 |
|
|
int maxbonds_; |
164 |
|
|
|
165 |
|
|
}; |
166 |
|
|
} |
167 |
|
|
#endif |