Loading...
Searching...
No Matches
ringAnalyser.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_RINGANALYSER_H
#define BALL_STRUCTURE_RINGANALYSER_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/common.h>
#endif
#ifndef BALL_KERNEL_ATOMCONTAINER_H
# include <BALL/KERNEL/atomContainer.h>
#endif
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#ifndef BALL_CONCEPT_PROPERTY_H
# include <BALL/CONCEPT/property.h>
#endif
#include <vector>
#include <set>
#include <deque>
namespace BALL
{
class Atom;
class Bond;
class BALL_EXPORT RingAnalyser
: public UnaryProcessor<AtomContainer>
{
public:
enum RingType
{
NONE,
TEMPLATE,
FUSED,
BRIDGED,
SPIRO,
CORE
};
class BALL_EXPORT Ring
: public PropertyManager
{
public:
Ring();
Ring(std::vector<Atom*> const& atoms_);
Position predecessor(Position i) const;
Position successor(Position i) const;
std::vector<Atom*> atoms;
RingType type;
std::set<Bond const*> shared_bonds;
};
RingAnalyser();
virtual ~RingAnalyser();
virtual bool start();
virtual Processor::Result operator ()(AtomContainer& ac);
virtual bool finish();
void clear();
bool isInRing(const Atom* atom, std::vector<Atom*> const& ring) const;
bool isInRingSystem(const Atom* atom, Index i) const;
void sequenceRing(std::vector<Atom*>& ring);
Size getNumberOfRingSystems();
std::vector<Ring> getRingSystem(Position i);
std::vector<Position> getPeelingOrder(Position i);
protected:
void clusterRings_();
void findSharedBonds_();
void peelRings_();
bool isCentralRing_(std::list<Position>::iterator ring, std::list<Position>& unassigned_rings);
bool peelNextRing_(std::list<Position>& unassigned_rings, bool peel_fused = false);
bool assignRTD_(std::list<Position>& trial_system);
std::vector<Ring> rings_;
std::vector<std::vector<Position> > ring_systems_;
HashMap<Bond const*, std::deque<Position> > rings_per_bond_;
std::vector<std::vector<Position> > peeling_order_;
};
} // namespace BALL
#endif // BALL_STRUCTURE_RINGANALYSER_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atomContainer.h
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Atom
Definition atom.h:90
BALL::Bond
Definition bond.h:57
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::Processor::Result
int Result
Definition processor.h:36
BALL::PropertyManager::PropertyManager
BALL_INLINE PropertyManager()
Default constructor.
BALL::RingAnalyser::Ring::predecessor
Position predecessor(Position i) const
The predecessor of atom i in the ring.
BALL::RingAnalyser::Ring::shared_bonds
std::set< Bond const * > shared_bonds
the bonds shared with other rings
Definition ringAnalyser.h:74
BALL::RingAnalyser::Ring::successor
Position successor(Position i) const
The successor of atom i in the ring.
BALL::RingAnalyser::Ring::Ring
Ring()
Default constructor.
BALL::RingAnalyser::Ring::atoms
std::vector< Atom * > atoms
the atoms of this ring
Definition ringAnalyser.h:68
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.
BALL::RingAnalyser::peelNextRing_
bool peelNextRing_(std::list< Position > &unassigned_rings, bool peel_fused=false)
BALL::RingAnalyser::start
virtual bool start()
Processor method which is called before the operator()-call.
BALL::RingAnalyser::findSharedBonds_
void findSharedBonds_()
BALL::RingAnalyser::finish
virtual bool finish()
Processor method which is called after the operator()-call.
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::RingAnalyser
RingAnalyser()
Default-Constructor.
BALL::RingAnalyser::getPeelingOrder
std::vector< Position > getPeelingOrder(Position i)
BALL::RingAnalyser::isCentralRing_
bool isCentralRing_(std::list< Position >::iterator ring, std::list< Position > &unassigned_rings)
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::clear
void clear()
BALL::RingAnalyser::RingType
RingType
Definition ringAnalyser.h:42
BALL::RingAnalyser::SPIRO
@ SPIRO
Definition ringAnalyser.h:47
BALL::RingAnalyser::NONE
@ NONE
Definition ringAnalyser.h:43
BALL::RingAnalyser::BRIDGED
@ BRIDGED
Definition ringAnalyser.h:46
BALL::RingAnalyser::CORE
@ CORE
Definition ringAnalyser.h:48
BALL::RingAnalyser::FUSED
@ FUSED
Definition ringAnalyser.h:45
BALL::RingAnalyser::TEMPLATE
@ TEMPLATE
Definition ringAnalyser.h:44
BALL::RingAnalyser::~RingAnalyser
virtual ~RingAnalyser()
Destructor.
BALL::RingAnalyser::sequenceRing
void sequenceRing(std::vector< Atom * > &ring)
BALL::RingAnalyser::peelRings_
void peelRings_()
performs an analysis of the structure of a ringsystem
BALL::RingAnalyser::getNumberOfRingSystems
Size getNumberOfRingSystems()
BALL::RingAnalyser::assignRTD_
bool assignRTD_(std::list< Position > &trial_system)
interface for a Ring Template Database (RTD), no functionality yet
BALL::RingAnalyser::rings_
std::vector< Ring > rings_
the smallest set of smallest rings of our molecule
Definition ringAnalyser.h:183
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
BALL::RingAnalyser::clusterRings_
void clusterRings_()
performs an agglomerative clustering of single rings to ringsystems
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::getRingSystem
std::vector< Ring > getRingSystem(Position i)
BALL::RingAnalyser::rings_per_bond_
HashMap< Bond const *, std::deque< Position > > rings_per_bond_
the ring memberships per bond
Definition ringAnalyser.h:189
BALL::UnaryProcessor< AtomContainer >::UnaryProcessor
UnaryProcessor()
Definition processor.h:69
common.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Position
BALL_SIZE_TYPE Position
Definition COMMON/global.h:140
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
processor.h
property.h