45#include "types/AtomStamp.hpp"
53 AtomStamp::AtomStamp(
int index) :
54 havePos_(false), haveOrt_(false), hasOverride_(false), index_(index) {
55 DefineParameter(Type,
"type");
58 bool AtomStamp::setPosition(
const std::vector<RealType>& pos) {
60 if (pos.size() == 3) {
61 position_[0] = pos[0];
62 position_[1] = pos[1];
63 position_[2] = pos[2];
66 std::ostringstream oss;
67 oss <<
"position" << containerToString(pos) <<
" is invalid" << std::endl;
68 throw OpenMDException(oss.str());
73 bool AtomStamp::setOrientation(
const std::vector<RealType>& ort) {
75 if (ort.size() == 3) {
76 orientation_[0] = ort[0];
77 orientation_[1] = ort[1];
78 orientation_[2] = ort[2];
81 std::ostringstream oss;
82 oss <<
"orientation" << containerToString(ort) <<
" is invalid"
84 throw OpenMDException(oss.str());
90 void AtomStamp::validate() {
91 DataHolder::validate();
92 CheckParameter(Type, isNotEmpty());
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.