45#include "types/AtomType.hpp"
52#include "types/MultipoleAdapter.hpp"
53#include "types/StickyAdapter.hpp"
58 AtomType::AtomType() {
68 myResponsibilities_[
"mass"] =
false;
71 void AtomType::useBase(AtomType* base) {
77 void AtomType::copyAllData(AtomType* orig) {
82 hasBase_ = orig->hasBase_;
85 name_ = string(orig->name_);
86 ident_ = orig->ident_;
88 map<string, bool>::iterator i;
90 map<string, RealType>::iterator j;
92 for (i = orig->myResponsibilities_.begin();
93 i != orig->myResponsibilities_.end(); ++i) {
94 myResponsibilities_[(*i).first] = orig->myResponsibilities_[(*i).first];
97 for (j = orig->myValues_.begin(); j != orig->myValues_.end(); ++j) {
98 myValues_[(*j).first] = orig->myValues_[(*j).first];
101 std::vector<std::shared_ptr<GenericData>> oprops = orig->getProperties();
102 std::vector<std::shared_ptr<GenericData>>::iterator it;
104 for (it = oprops.begin(); it != oprops.end(); ++it) {
110 myResponsibilities_[genData->getID()] =
true;
116 myResponsibilities_[propName] =
false;
128 if (hasBase_ && !myResponsibilities_[propName]) {
135 const string& propName) {
136 if (hasBase_ && !myResponsibilities_[propName]) {
142 void AtomType::setMass(RealType m) {
143 myResponsibilities_[
"mass"] =
true;
147 RealType AtomType::getMass(
void) {
148 if (hasBase_ && !myResponsibilities_[
"mass"])
149 return base_->getMass();
154 void AtomType::setIdent(
int id) { ident_ = id; }
156 int AtomType::getIdent() {
return ident_; }
158 void AtomType::setName(
const string& name) { name_ = name; }
160 string AtomType::getName() {
return name_; }
162 bool AtomType::isLennardJones() {
return hasProperty(
"LJ"); }
164 bool AtomType::isElectrostatic() {
return isCharge() || isMultipole(); }
166 bool AtomType::isEAM() {
return hasProperty(
"EAM"); }
168 bool AtomType::isCharge() {
return isFixedCharge() || isFluctuatingCharge(); }
170 bool AtomType::isDirectional() {
return hasProperty(
"Directional"); }
172 bool AtomType::isFluctuatingCharge() {
return hasProperty(
"FlucQ"); }
174 bool AtomType::isFixedCharge() {
return hasProperty(
"Charge"); }
176 bool AtomType::isDipole() {
177 MultipoleAdapter ma = MultipoleAdapter(
this);
178 if (ma.isMultipole()) {
179 return ma.isDipole();
184 bool AtomType::isQuadrupole() {
185 MultipoleAdapter ma = MultipoleAdapter(
this);
186 if (ma.isMultipole()) {
187 return ma.isQuadrupole();
192 bool AtomType::isMultipole() {
return hasProperty(
"Multipole"); }
194 bool AtomType::isGayBerne() {
return hasProperty(
"GB"); }
196 bool AtomType::isSticky() {
return hasProperty(
"Sticky"); }
198 bool AtomType::isStickyPower() {
199 StickyAdapter sa = StickyAdapter(
this);
200 return sa.isStickyPower();
203 bool AtomType::isShape() {
return hasProperty(
"Shape"); }
205 bool AtomType::isSC() {
return hasProperty(
"SC"); }
207 bool AtomType::isMetal() {
return isSC() || isEAM(); }
209 std::vector<AtomType*> AtomType::allYourBase() {
210 std::vector<AtomType*> myChain;
213 myChain = base_->allYourBase();
214 myChain.insert(myChain.begin(),
this);
216 myChain.push_back(
this);
std::shared_ptr< GenericData > getPropertyByName(const string &propName)
Returns property.
std::vector< std::shared_ptr< GenericData > > getProperties()
Returns all of the properties in PropertyMap.
void removeProperty(const string &propName)
Removes property from PropertyMap by name.
bool hasProperty(const string &propName)
Checks if property is in this PropertyMap.
std::vector< string > getPropertyNames()
Returns all names of properties.
void addProperty(std::shared_ptr< GenericData > genData)
Adds property into property map.
std::shared_ptr< GenericData > getPropertyByName(const std::string &propName)
Returns property.
std::vector< std::shared_ptr< GenericData > > getProperties()
Returns all of the properties in PropertyMap.
void addProperty(std::shared_ptr< GenericData > genData)
Adds property into property map.
bool removeProperty(const std::string &propName)
Removes property from PropertyMap by name.
bool hasProperty(const std::string &propName)
Checks if property is in this PropertyMap.
std::vector< std::string > getPropertyNames()
Returns all names of properties.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.