BALL 1.5.0
Loading...
Searching...
No Matches
bond.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_KERNEL_BOND_H
6#define BALL_KERNEL_BOND_H
7
8#ifndef BALL_CONCEPT_PROPERTY_H
10#endif
11
12#ifndef BALL_CONCEPT_COMPOSITE_H
14#endif
15
16#ifndef BALL_CONCEPT_ATOMCONTAINER_H
18#endif
19
20#define BALL_BOND_DEFAULT_FIRST_ATOM 0
21#define BALL_BOND_DEFAULT_SECOND_ATOM 0
22#define BALL_BOND_DEFAULT_NAME ""
23#define BALL_BOND_DEFAULT_ORDER ORDER__UNKNOWN
24#define BALL_BOND_DEFAULT_TYPE TYPE__UNKNOWN
25
26
27namespace BALL
28{
29 class Atom;
30 class Fragment;
31 class System;
32
55 : public Composite,
56 public PropertyManager
57 {
58 public:
59
61 friend class Atom;
62
64
65
68
74 {
75 public:
76 NotBound(const char* file, int line);
77 };
78
79
83
86 typedef short Order;
87 typedef short Type;
88
90
93
115
137
148
149
153
163
175 Bond(const Bond& bond, bool deep = true);
176
186 Bond(const String& name, Atom& first, Atom& second, Order order = BALL_BOND_DEFAULT_ORDER,
188
198 static Bond* createBond(Bond& bond, Atom& first, Atom& second);
199
203 virtual ~Bond();
204
214 virtual void clear();
215
223 virtual void destroy();
225
229
233 void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
234
239
244 void finalize();
246
250
251 bool operator == (const Bond& bond) const;
252
254 bool operator != (const Bond& bond) const;
256
260
270 Bond& operator = (const Bond& bond);
271
276 void swap(Bond& bond);
278
282
287 void setFirstAtom(Atom* atom);
292 void setSecondAtom(Atom* atom);
293
295 const Atom* getFirstAtom() const;
298
300 const Atom* getSecondAtom() const;
303
311 Atom* getPartner(const Atom& atom) const;
312
314 void setName(const String& name);
315
317 const String& getName() const;
318
320 void setOrder(Order bond_order);
321
324
330 bool isAromatic() const;
331
333 void setType(Type bond_type);
334
336 Type getType() const;
337
342 float getLength() const;
343
349 const Atom* getBoundAtom(const Atom& atom) const;
350
356 Atom* getBoundAtom(const Atom& atom);
358
362
370 bool isBondOf(const Atom& atom) const;
371
377 bool isBound() const;
378
386 bool isInterBond() const;
387
396 bool isInterBondOf(const AtomContainer& atom_container) const;
397
406 bool isIntraBond() const;
407
416 bool isIntraBondOf(const AtomContainer& atom_container) const;
417
419
423
428 virtual bool isValid() const;
429
436 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
438
439 protected:
440
444
445 // First atom of the bond (bond owner)
447
448 // Second atom
450
451 // Bond name
453
454 // Bond order
456
457 // Bond type
460
461 private:
462
463 void arrangeBonds_();
464 void clear_();
465 };
466
467# ifndef BALL_NO_INLINE_FUNCTIONS
468# include <BALL/KERNEL/bond.iC>
469# endif
470} // namespace BALL
471
472#endif // BALL_KERNEL_BOND_H
473
#define BALL_EXPORT
#define BALL_BOND_DEFAULT_TYPE
Definition bond.h:24
#define BALL_BOND_DEFAULT_ORDER
Definition bond.h:23
NotBound(const char *file, int line)
const Atom * getFirstAtom() const
Return a pointer to the first atom.
void setSecondAtom(Atom *atom)
Atom * getSecondAtom()
Return a pointer to the second atom.
String name_
Definition bond.h:452
Bond(const Bond &bond, bool deep=true)
Atom * first_
Definition bond.h:446
bool isIntraBondOf(const AtomContainer &atom_container) const
void persistentWrite(PersistenceManager &pm, const char *name=0) const
bool isAromatic() const
short Type
Definition bond.h:87
Type getType() const
Return the bond type.
void setType(Type bond_type)
Set the bond type.
Type bond_type_
Definition bond.h:458
@ IS_AROMATIC
This property can be used to store aromaticity information without overwriting bond orders.
Definition bond.h:144
@ NUMBER_OF_PROPERTIES
Definition bond.h:146
bool isInterBond() const
Atom * getFirstAtom()
Return a pointer to the first atom.
void persistentRead(PersistenceManager &pm)
const String & getName() const
Return the atom name.
Bond(const String &name, Atom &first, Atom &second, Order order=BALL_BOND_DEFAULT_ORDER, Type type=BALL_BOND_DEFAULT_TYPE)
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
virtual ~Bond()
void finalize()
virtual bool isValid() const
static Bond * createBond(Bond &bond, Atom &first, Atom &second)
@ TYPE__DISULPHIDE_BRIDGE
Definition bond.h:129
@ NUMBER_OF_BOND_TYPES
Definition bond.h:135
@ TYPE__COVALENT
Definition bond.h:125
@ TYPE__SALT_BRIDGE
Definition bond.h:131
@ TYPE__UNKNOWN
Definition bond.h:123
@ TYPE__HYDROGEN
Definition bond.h:127
@ TYPE__PEPTIDE
Definition bond.h:133
bool isIntraBond() const
Atom * getPartner(const Atom &atom) const
float getLength() const
Order getOrder() const
Return the bond order.
void setFirstAtom(Atom *atom)
void swap(Bond &bond)
const Atom * getSecondAtom() const
Return a pointer to the second atom.
Atom * second_
Definition bond.h:449
friend class Atom
Definition bond.h:61
const Atom * getBoundAtom(const Atom &atom) const
virtual void clear()
bool isInterBondOf(const AtomContainer &atom_container) const
bool isBondOf(const Atom &atom) const
BondOrder
Definition bond.h:97
@ ORDER__QUADRUPLE
Quadruple bond.
Definition bond.h:107
@ ORDER__DOUBLE
Double bond.
Definition bond.h:103
@ ORDER__TRIPLE
Triple Bond.
Definition bond.h:105
@ ORDER__SINGLE
Single bond.
Definition bond.h:101
@ ORDER__AROMATIC
Aromatic bonds.
Definition bond.h:109
@ ORDER__ANY
Any bond orders (useful for predicates).
Definition bond.h:111
@ ORDER__UNKNOWN
Default value.
Definition bond.h:99
@ NUMBER_OF_BOND_ORDERS
The number of bond orders.
Definition bond.h:113
void setName(const String &name)
Assign the atom name.
Order bond_order_
Definition bond.h:455
bool isBound() const
virtual void destroy()
void setOrder(Order bond_order)
Assign the bond order.
short Order
Definition bond.h:86
Atom * getBoundAtom(const Atom &atom)
GeneralException()
Default constructor.
BALL_INLINE PropertyManager()
Default constructor.
#define BALL_CREATE_DEEP(name)
Definition create.h:26
BALL_SIZE_TYPE Size