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;
123 MAX_NUMBER_OF_BONDS = 12
131 NUMBER_OF_PROPERTIES = 0
150 ADD_VARIANT_EXTENSIONS_AND_CHAIN_RESIDUE_ID
188 Atom(
const Atom& atom,
bool deep =
true);
239 virtual void clear();
246 virtual void destroy();
277 void set(
const Atom& atom,
bool deep =
true);
284 void get(
Atom& atom,
bool deep =
true)
const;
294 Atom& operator = (
const Atom& atom);
300 void swap(
Atom& atom);
311 bool operator == (
const Atom& atom)
const;
316 bool operator != (
const Atom& atom)
const;
324 void setElement(
const Element& element);
327 const Element& getElement()
const;
333 void setCharge(
float charge);
339 float getCharge()
const;
342 void setFormalCharge(
Index formal_charge);
345 Index getFormalCharge()
const;
354 const Molecule* getMolecule()
const;
366 const Fragment* getFragment()
const;
377 const Residue* getResidue()
const;
395 const Chain* getChain()
const;
400 void setName(
const String& name);
434 String getFullName(FullNameType type = ADD_VARIANT_EXTENSIONS)
const;
439 void setPosition(
const Vector3& position);
445 const Vector3& getPosition()
const;
450 void setRadius(
float radius);
453 float getRadius()
const;
456 void setType(Type atom_type);
459 Type getType()
const;
462 String getTypeName()
const;
465 void setTypeName(
const String& name);
470 void setVelocity(
const Vector3& velocity);
480 const Vector3& getVelocity()
const;
485 void setForce(
const Vector3& force);
487 const Vector3& getForce()
const;
493 Size countBonds()
const;
530 const Bond* getBond(
const Atom& atom)
const;
579 bool destroyBond(
const Atom& atom);
620 float getDistance(
const Atom& a)
const;
634 bool hasBond(
const Bond& bond)
const;
644 bool isBoundTo(
const Atom& atom)
const;
651 bool isBound()
const;
660 bool isGeminal(
const Atom& atom)
const;
668 bool isVicinal(
const Atom& atom)
const;
679 virtual bool isValid()
const;
688 virtual void dump(std::ostream& s = std::cout,
Size depth = 0)
const;
724 : bound_((
Atom*)&atom),
730 : bound_(traits.bound_),
731 position_(traits.position_)
777 return (bound_ != 0 && position_ >= 0 && position_ < bound_->number_of_bonds_);
788 bool isBegin()
const {
return (position_ == 0); }
790 void toEnd() { position_ = bound_->number_of_bonds_; }
792 bool isEnd()
const {
return (position_ >= bound_->number_of_bonds_);}
796 const Bond&
getData()
const {
return *(bound_->bond_[position_]); }
805 void dump(std::ostream& s)
const
807 s << position_ << std::endl;
812 position_ = bound_->number_of_bonds_ - 1;
815 bool isRBegin()
const
817 return (position_ == bound_->number_of_bonds_ - 1);
827 return (position_ <= -1);
837 position_ -= distance;
842 position_ += distance;
847 return *(bound_->bond_[index]);
852 return *(bound_->bond_[index]);
873 return BondIterator::begin(*
this);
879 return BondIterator::end(*
this);
884 <
Atom,
Bond, BondIteratorPosition, BondIteratorTraits>
890 return BondConstIterator::begin(*
this);
896 return BondConstIterator::end(*
this);
963 Bond* bond_[MAX_NUMBER_OF_BONDS];
984 void swapLastBond_(
const Atom* atom);
989 #ifdef BALL_COMPILER_MSVC
994 # ifndef BALL_NO_INLINE_FUNCTIONS
995 # include <BALL/KERNEL/atom.iC>
999 #ifndef BALL_KERNEL_BONDITERATOR_H
1004 #endif // BALL_KERNEL_ATOM_H