BALL  1.5.0
ringAnalyser.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_RINGANALYSER_H
6 #define BALL_STRUCTURE_RINGANALYSER_H
7 
8 #ifndef BALL_COMMON_GLOBAL_H
9 # include <BALL/common.h>
10 #endif
11 
12 #ifndef BALL_KERNEL_ATOMCONTAINER_H
14 #endif
15 
16 #ifndef BALL_CONCEPT_PROCESSOR_H
17 # include <BALL/CONCEPT/processor.h>
18 #endif
19 
20 #ifndef BALL_CONCEPT_PROPERTY_H
21 # include <BALL/CONCEPT/property.h>
22 #endif
23 
24 #include <vector>
25 #include <set>
26 #include <deque>
27 
28 namespace BALL
29 {
30  class Atom;
31  class Bond;
32 
37  : public UnaryProcessor<AtomContainer>
38  {
39  public:
40 
41  enum RingType
42  {
48  CORE
49  };
50 
52  : public PropertyManager
53  {
54  public:
56  Ring();
57 
59  Ring(std::vector<Atom*> const& atoms_);
60 
63 
66 
68  std::vector<Atom*> atoms;
69 
72 
74  std::set<Bond const*> shared_bonds;
75  };
76 
79 
84 
88  virtual ~RingAnalyser();
90 
93 
95  virtual bool start();
96 
101  virtual Processor::Result operator ()(AtomContainer& ac);
102 
104  virtual bool finish();
105 
107 
112  void clear();
113 
120  bool isInRing(const Atom* atom, std::vector<Atom*> const& ring) const;
121 
128  bool isInRingSystem(const Atom* atom, Index i) const;
129 
137  void sequenceRing(std::vector<Atom*>& ring);
138 
142 
145  std::vector<Ring> getRingSystem(Position i);
146 
149  std::vector<Position> getPeelingOrder(Position i);
150 
151  protected:
152 
157 
162 
166  void peelRings_();
167 
169  bool isCentralRing_(std::list<Position>::iterator ring, std::list<Position>& unassigned_rings);
170 
174  bool peelNextRing_(std::list<Position>& unassigned_rings, bool peel_fused = false);
175 
180  bool assignRTD_(std::list<Position>& trial_system);
181 
183  std::vector<Ring> rings_;
184 
186  std::vector<std::vector<Position> > ring_systems_;
187 
190 
192  std::vector<std::vector<Position> > peeling_order_;
193  };
194 
195 } // namespace BALL
196 
197 #endif // BALL_STRUCTURE_RINGANALYSER_H
BALL::RingAnalyser::Ring::shared_bonds
std::set< Bond const * > shared_bonds
the bonds shared with other rings
Definition: ringAnalyser.h:74
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::RingAnalyser::isInRing
bool isInRing(const Atom *atom, std::vector< Atom * > const &ring) const
helper-function; determines, whether an atom is part of a certain ring
BALL::RingAnalyser::clear
void clear()
BALL::RingAnalyser::RingType
RingType
Definition: ringAnalyser.h:42
property.h
BALL::RingAnalyser::assignRTD_
bool assignRTD_(std::list< Position > &trial_system)
interface for a Ring Template Database (RTD), no functionality yet
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions)
Definition: hashMap.h:74
BALL::AtomContainer
Definition: atomContainer.h:32
BALL::RingAnalyser::~RingAnalyser
virtual ~RingAnalyser()
Destructor.
BALL::RingAnalyser::isCentralRing_
bool isCentralRing_(std::list< Position >::iterator ring, std::list< Position > &unassigned_rings)
BALL::PropertyManager
Definition: property.h:344
BALL::Atom
Definition: atom.h:90
BALL::RingAnalyser::Ring::atoms
std::vector< Atom * > atoms
the atoms of this ring
Definition: ringAnalyser.h:68
BALL::RingAnalyser::peelRings_
void peelRings_()
performs an analysis of the structure of a ringsystem
BALL::RingAnalyser::SPIRO
@ SPIRO
Definition: ringAnalyser.h:47
BALL::RingAnalyser::sequenceRing
void sequenceRing(std::vector< Atom * > &ring)
BALL::RingAnalyser::getNumberOfRingSystems
Size getNumberOfRingSystems()
BALL::RingAnalyser::RingAnalyser
RingAnalyser()
Default-Constructor.
BALL::RingAnalyser::peeling_order_
std::vector< std::vector< Position > > peeling_order_
the order in which rings are peeled from their respective ring systems
Definition: ringAnalyser.h:192
BALL::RingAnalyser::isInRingSystem
bool isInRingSystem(const Atom *atom, Index i) const
helper-function; determines, whether an atom is part of a certain ring
BALL::RingAnalyser::NONE
@ NONE
Definition: ringAnalyser.h:43
BALL::RingAnalyser::Ring::Ring
Ring()
Default constructor.
BALL
Definition: constants.h:13
BALL::RingAnalyser::rings_per_bond_
HashMap< Bond const *, std::deque< Position > > rings_per_bond_
the ring memberships per bond
Definition: ringAnalyser.h:189
BALL::RingAnalyser::getRingSystem
std::vector< Ring > getRingSystem(Position i)
BALL::RingAnalyser::BRIDGED
@ BRIDGED
Definition: ringAnalyser.h:46
BALL::PDB::Atom
char Atom[5]
Definition: PDBdefs.h:257
BALL_INDEX_TYPE
BALL::RingAnalyser::start
virtual bool start()
Processor method which is called before the operator()-call.
BALL_SIZE_TYPE
BALL::RingAnalyser::finish
virtual bool finish()
Processor method which is called after the operator()-call.
BALL::RingAnalyser::TEMPLATE
@ TEMPLATE
Definition: ringAnalyser.h:44
BALL::UnaryProcessor
Definition: processor.h:60
BALL::RingAnalyser::Ring
Definition: ringAnalyser.h:53
BALL::RingAnalyser::ring_systems_
std::vector< std::vector< Position > > ring_systems_
the ring systems, stored as indices into the smallest set of smallest rings
Definition: ringAnalyser.h:186
processor.h
BALL::RingAnalyser::rings_
std::vector< Ring > rings_
the smallest set of smallest rings of our molecule
Definition: ringAnalyser.h:183
BALL::RingAnalyser::getPeelingOrder
std::vector< Position > getPeelingOrder(Position i)
BALL::RingAnalyser
Methods for the analysis of the structure of ringsystems.
Definition: ringAnalyser.h:38
common.h
BALL::RingAnalyser::Ring::type
RingType type
the type of this ring
Definition: ringAnalyser.h:71
BALL::RingAnalyser::Ring::Ring
Ring(std::vector< Atom * > const &atoms_)
Detailed constructor.
atomContainer.h
BALL::RingAnalyser::findSharedBonds_
void findSharedBonds_()
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL::RingAnalyser::Ring::successor
Position successor(Position i) const
The successor of atom i in the ring.
BALL::RingAnalyser::peelNextRing_
bool peelNextRing_(std::list< Position > &unassigned_rings, bool peel_fused=false)
BALL::RingAnalyser::Ring::predecessor
Position predecessor(Position i) const
The predecessor of atom i in the ring.
BALL::RingAnalyser::clusterRings_
void clusterRings_()
performs an agglomerative clustering of single rings to ringsystems
BALL::RingAnalyser::FUSED
@ FUSED
Definition: ringAnalyser.h:45