Go to the documentation of this file.
5 #ifndef BALL_KERNEL_ATOM_H
6 #define BALL_KERNEL_ATOM_H
8 #ifndef BALL_CONCEPT_COMPOSITE_H
12 #ifndef BALL_CONCEPT_PROPERTY_H
16 #ifndef BALL_CONCEPT_RANDOMACCESSITERATOR_H
20 #ifndef BALL_MATHS_VECTOR3_H
25 #define BALL_ATOM_DEFAULT_ELEMENT &Element::UNKNOWN
26 #define BALL_ATOM_DEFAULT_CHARGE 0
27 #define BALL_ATOM_DEFAULT_FORMAL_CHARGE 0
28 #define BALL_ATOM_DEFAULT_NAME ""
29 #define BALL_ATOM_DEFAULT_TYPE_NAME "?"
30 #define BALL_ATOM_DEFAULT_POSITION 0,0,0
31 #define BALL_ATOM_DEFAULT_RADIUS 0
32 #define BALL_ATOM_DEFAULT_TYPE Atom::UNKNOWN_TYPE
33 #define BALL_ATOM_DEFAULT_VELOCITY 0,0,0
34 #define BALL_ATOM_DEFAULT_FORCE 0,0,0
43 class SecondaryStructure;
45 class MolecularInteractions;
124 MAX_NUMBER_OF_BONDS = 12
132 NUMBER_OF_PROPERTIES = 0
151 ADD_VARIANT_EXTENSIONS_AND_CHAIN_RESIDUE_ID
686 virtual bool isAtom()
const {
return true; }
707 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
743 : bound_((
Atom*)&atom),
749 : bound_(traits.bound_),
750 position_(traits.position_)
756 bound_ = traits.bound_;
757 position_ = traits.position_;
776 return (position_ == traits.position_);
781 return !(position_ == traits.position_);
786 return (position_ < traits.position_);
791 return (
Distance)(position_ - traits.position_);
796 return (bound_ != 0 && position_ >= 0 && position_ < bound_->number_of_bonds_);
807 bool isBegin()
const {
return (position_ == 0); }
809 void toEnd() { position_ = bound_->number_of_bonds_; }
811 bool isEnd()
const {
return (position_ >= bound_->number_of_bonds_);}
815 const Bond&
getData()
const {
return *(bound_->bond_[position_]); }
821 return (s << traits.position_ <<
' ');
824 void dump(std::ostream& s)
const
826 s << position_ << std::endl;
831 position_ = bound_->number_of_bonds_ - 1;
836 return (position_ == bound_->number_of_bonds_ - 1);
846 return (position_ <= -1);
856 position_ -= distance;
861 position_ += distance;
866 return *(bound_->bond_[index]);
871 return *(bound_->bond_[index]);
892 return BondIterator::begin(*
this);
898 return BondIterator::end(*
this);
903 <
Atom,
Bond, BondIteratorPosition, BondIteratorTraits>
909 return BondConstIterator::begin(*
this);
915 return BondConstIterator::end(*
this);
982 Bond* bond_[MAX_NUMBER_OF_BONDS];
1003 void swapLastBond_(
const Atom* atom);
1008 #ifdef BALL_COMPILER_MSVC
1013 # ifndef BALL_NO_INLINE_FUNCTIONS
1014 # include <BALL/KERNEL/atom.iC>
1018 #ifndef BALL_KERNEL_BONDITERATOR_H
1023 #endif // BALL_KERNEL_ATOM_H
#define BALL_ATOM_DEFAULT_RADIUS
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
#define BALL_ATOM_DEFAULT_CHARGE
const BondIteratorPosition & getPosition() const
const Atom * getContainer() const
virtual void persistentWrite(PersistenceManager &pm, const char *name=0) const
const Bond * getBond(const Atom &atom) const
void dump(std::ostream &s) const
Distance getDistance(const BondIteratorTraits &traits) const
void setType(Type atom_type)
Assign the numerical atom type.
#define BALL_ATOM_DEFAULT_TYPE_NAME
Bond * getBond(const Atom &atom)
@ ADD_VARIANT_EXTENSIONS_AND_ID
#define BALL_ATOM_DEFAULT_TYPE
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
#define BALL_ATOM_DEFAULT_VELOCITY
BondIteratorTraits(const Atom &atom)
void setElement(const Element &element)
Assign the atom's element.
float getDistance(const Atom &a) const
const Bond * getBond(Position index) const
Atom(Element &element, const String &name, const String &type_name=BALL_ATOM_DEFAULT_TYPE_NAME, Type atom_type=BALL_ATOM_DEFAULT_TYPE, const Vector3 &position=Vector3(BALL_ATOM_DEFAULT_POSITION), const Vector3 &velocity=Vector3(BALL_ATOM_DEFAULT_VELOCITY), const Vector3 &force=Vector3(BALL_ATOM_DEFAULT_FORCE), float charge=BALL_ATOM_DEFAULT_CHARGE, float radius=BALL_ATOM_DEFAULT_RADIUS, Index formal_charge=BALL_ATOM_DEFAULT_FORMAL_CHARGE)
static AtomIndexList free_list_
BALL_EXPORT bool operator<(const String &s1, const String &s2)
Bond * createBond(Bond &bond, Atom &atom)
bool isBoundTo(const Atom &atom) const
const Vector3 & getPosition() const
Return the atom coordinates (const)
#define BALL_CREATE_DEEP(name)
const Element & getElement() const
Return the atom's element.
Atom(const Atom &atom, bool deep=true)
#define BALL_ATOM_DEFAULT_POSITION
BondConstIterator endBond() const
Return a constant past-the-end bond iterator.
BondReverseIterator rbeginBond()
Return a reverse bond iterator pointing to the last bond.
Bond & getData(Index index)
virtual bool isValid() const
void backward(Distance distance)
BondConstReverseIterator rendBond() const
Return a constant past-the-end bond iterator for reverse traversal.
void setRadius(float radius)
Vector3 & getForce()
Return the atom's force vector (mutable)
BondConstIterator beginBond() const
Return a constant bond iterator pointing to the first bond.
void addInteraction(String interaction_type, double energy)
std::reverse_iterator< BondIterator > BondReverseIterator
Reverse random access iterator for bonds.
const Atom * getPartnerAtom(Position i) const
Bond * getBond(Position index)
Molecule * getMolecule()
Return the molecule the atom is contained in (mutable)
Bond * cloneBond(Bond &bond, Atom &atom)
const Chain * getChain() const
String getTypeName() const
Return the atom type name.
bool isVicinal(const Atom &atom) const
TVector3< float > Vector3
void setPosition(const Vector3 &position)
const Residue * getResidue() const
BondIterator endBond()
Return a past-the-end bond iterator.
Chain * getChain()
Return the chain the atom is contained in (mutable)
bool applyBonds(UnaryProcessor< Bond > &processor)
void setFormalCharge(Index formal_charge)
Set the atom's formal charge.
bool hasBond(const Bond &bond) const
void setCharge(float charge)
BondConstReverseIterator rbeginBond() const
Return a constant reverse bond iterator pointing to the first atom.
bool destroyBond(const Atom &atom)
const Molecule * getMolecule() const
MolecularInteractions * interactions
const Bond & getData(Index index) const
bool isGeminal(const Atom &atom) const
Bond * createBond(Atom &atom)
#define BALL_ATOM_DEFAULT_FORCE
Index getFormalCharge() const
Return the atom's formal charge.
void get(Atom &atom, bool deep=true) const
Atom * getPartnerAtom(Position i)
const Bond & getData() const
BondIteratorTraits(const BondIteratorTraits &traits, bool=true)
BondIterator beginBond()
Return a bond iterator pointing to the first bond of the atom.
Index BondIteratorPosition
#define BALL_ATOM_DEFAULT_FORMAL_CHARGE
Type getType() const
Return the (numerical) atom type.
Residue * getResidue()
Return the residue the atom is contained in (mutable)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
void forward(Distance distance)
virtual void persistentRead(PersistenceManager &pm)
void set(const Atom &atom, bool deep=true)
void addInteraction(const Atom *atom, String interaction_type, double energy)
BALL_EXPORT std::ostream & operator<<(std::ostream &os, const Exception::GeneralException &e)
String getFullName(FullNameType type=ADD_VARIANT_EXTENSIONS) const
unsigned char number_of_bonds_
Vector3 & getPosition()
Return the atom coordinates (mutable)
void setForce(const Vector3 &force)
const Vector3 & getVelocity() const
void setVelocity(const Vector3 &velocity)
std::list< Atom * > AtomPtrList
std::reverse_iterator< BondConstIterator > BondConstReverseIterator
Constant reverse random access iterator for bonds.
const String & getName() const
Return the atom name.
const Fragment * getFragment() const
bool store_interactions_disabled_
void setTypeName(const String &name)
Assign the atom type name.
std::list< Position > AtomIndexList
Size countBonds() const
Return the number of bonds.
ConstRandomAccessIterator< Atom, Bond, BondIteratorPosition, BondIteratorTraits > BondConstIterator
Constant random access iterator for bonds.
BondReverseIterator rendBond()
Return a past-the-end bond iterator for reverse traversal.
void disableStoreInteractions()
const SecondaryStructure * getSecondaryStructure() const
float getRadius() const
Return the atom radius.
Fragment * getFragment()
Return the fragment the atom is contained in (mutable)
void setName(const String &name)
Set the atom name.
SecondaryStructure * getSecondaryStructure()
Return the secondary structure the atom is contained in (mutable)
const Vector3 & getForce() const
Return the atom's force vector (const)
RandomAccessIterator< Atom, Bond, BondIteratorPosition, BondIteratorTraits > BondIterator
void enableStoreInteractions()
BondIteratorPosition & getPosition()