Loading...
Searching...
No Matches
sdGenerator.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_STRUCTURE_SDGENERATOR_H
#define BALL_STRUCTURE_SDGENERATOR_H
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_STRUCTURE_RINGANALYSER_H
# include <BALL/STRUCTURE/ringAnalyser.h>
#endif
#ifndef BALL_KERNEL_PDBATOM_H
# include <BALL/KERNEL/PDBAtom.h>
#endif
#include <vector>
#include <queue>
namespace BALL
{
class System;
class Atom;
class BALL_EXPORT SDGenerator
{
public:
enum Property
{
FIRST_SDGENERATOR_PROPERTY = PDBAtom::NUMBER_OF_PROPERTIES+1,
IN_RING,
CORE_CHAIN,
DEPOSITED,
FXAS,
EQAS,
HEAD,
EDGE,
ASSEMBLED,
ZIG,
ZAG,
INITIALIZED_HEAD_CFS,
LAST_SDGENERATOR_PROPERTY
};
struct BALL_EXPORT Option
{
static const char* SHOW_HYDROGENS;
static const char* STANDARD_BOND_LENGTH;
};
struct BALL_EXPORT Default
{
static const bool SHOW_HYDROGENS;
static const float STANDARD_BOND_LENGTH;
};
SDGenerator(bool show_hydrogens = false);
virtual ~SDGenerator();
Options options;
void setDefaultOptions();
void generateSD(System& molecule_sys);
void clear();
protected:
class AtomComparator
{
public:
bool operator() (Atom const* first, Atom const* second) const
{
Size first_value = first->getProperty("SDGenerator::PRIORITY").getUnsignedInt();
Size second_value = second->getProperty("SDGenerator::PRIORITY").getUnsignedInt();
return first_value < second_value;
}
};
void prepare_();
void constructRingSystem_(Position current_ring_system);
// Obtain the CFS from the properties of the atom...
Angle getCFS_(Atom const* atom, bool hi);
// Convert a vector into the corresponding CFS angle
Angle computeCFS_(Vector3 const& input);
// store the CFS for an atom
void setCFS_(Atom* atom, Angle cfs, bool high);
// push the CFS before it is overwritten
void pushCFS_(Atom* atom);
// retrieve backup CVS values
Angle getBackupCFS_(Atom const*, bool hi);
// Compute the CFS values for a full regular polygon
void computeCoreCFS_(RingAnalyser::Ring& ring, bool clockwise);
//
Angle computeAngularSeparation_(Atom* seed);
//
Angle computeAngularDemand_(Atom* seed);
//
std::vector<Atom*> sequenceSubstituents_(Atom* seed);
void computeShelleyPriorities_();
void buildRegularPolygon_(RingAnalyser::Ring& ring, Position first_anchor_index, bool clockwise);
void buildOpenPolygon_(RingAnalyser::Ring& ring, Position first_anchor_index, Position second_anchor_index);
void attachCore_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system, float x_start);
void attachTemplate_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
void attachFused_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
void attachBridged_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
void attachSpiro_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
void computeAdjacencyMatrix_(std::vector<Atom*>& chain, std::vector<bool>& result);
static bool compareChains_(const vector<Atom*>& x, const vector<Atom*>& y);
void treatChains_();
//
void smoothCFSAngle_(Atom* seed);
//
void placeSubstituent_(Atom* seed, Atom* head, Atom* next);
//
void depositPFU_(Atom* seed_atom, Atom* next_neighbour);
//
void checkOverlap_(Atom* atom);
//Check whether the ring is clockwise or not
bool ringIsClockwise_(const RingAnalyser::Ring& ring, Index start_index = 0) const;
void assembleSD_();
// The backtracking for our Floyd-Warshall implementation
void findFloydWarshallPath_(std::vector<int>& path, std::vector<Index>& next, Size remaining_atoms, Position i, Position j, std::list<Index>& output);
RingAnalyser ring_analyser_;
std::list<std::list<Atom*> > chains_;
std::priority_queue<Atom*, std::vector<Atom*>, AtomComparator> redraw_queue_;
System* system_;
};
} // namepspace BALL
#endif
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
PDBAtom.h
BALL::Atom
Definition atom.h:90
BALL::NamedProperty::getUnsignedInt
unsigned int getUnsignedInt() const
BALL::Options
Definition options.h:48
BALL::PDBAtom::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
The number of properties in PDBAtom.
Definition PDBAtom.h:82
BALL::PropertyManager::getProperty
const NamedProperty & getProperty(const std::string &name) const
BALL::RingAnalyser::Ring
Definition ringAnalyser.h:53
BALL::RingAnalyser
Methods for the analysis of the structure of ringsystems.
Definition ringAnalyser.h:38
BALL::SDGenerator::AtomComparator
Definition sdGenerator.h:128
BALL::SDGenerator::placeSubstituent_
void placeSubstituent_(Atom *seed, Atom *head, Atom *next)
BALL::SDGenerator::computeAdjacencyMatrix_
void computeAdjacencyMatrix_(std::vector< Atom * > &chain, std::vector< bool > &result)
Compute adjacency matrix of the given atoms.
BALL::SDGenerator::SDGenerator
SDGenerator(bool show_hydrogens=false)
BALL::SDGenerator::assembleSD_
void assembleSD_()
BALL::SDGenerator::computeShelleyPriorities_
void computeShelleyPriorities_()
BALL::SDGenerator::redraw_queue_
std::priority_queue< Atom *, std::vector< Atom * >, AtomComparator > redraw_queue_
our redraw queue
Definition sdGenerator.h:267
BALL::SDGenerator::system_
System * system_
the system we are working on
Definition sdGenerator.h:270
BALL::SDGenerator::pushCFS_
void pushCFS_(Atom *atom)
BALL::SDGenerator::Property
Property
Properties, used to describe atoms and their status.
Definition sdGenerator.h:41
BALL::SDGenerator::DEPOSITED
@ DEPOSITED
Definition sdGenerator.h:45
BALL::SDGenerator::LAST_SDGENERATOR_PROPERTY
@ LAST_SDGENERATOR_PROPERTY
Definition sdGenerator.h:54
BALL::SDGenerator::EQAS
@ EQAS
Definition sdGenerator.h:47
BALL::SDGenerator::IN_RING
@ IN_RING
Definition sdGenerator.h:43
BALL::SDGenerator::HEAD
@ HEAD
Definition sdGenerator.h:48
BALL::SDGenerator::FIRST_SDGENERATOR_PROPERTY
@ FIRST_SDGENERATOR_PROPERTY
Definition sdGenerator.h:42
BALL::SDGenerator::FXAS
@ FXAS
Definition sdGenerator.h:46
BALL::SDGenerator::ZAG
@ ZAG
Definition sdGenerator.h:52
BALL::SDGenerator::INITIALIZED_HEAD_CFS
@ INITIALIZED_HEAD_CFS
Definition sdGenerator.h:53
BALL::SDGenerator::ZIG
@ ZIG
Definition sdGenerator.h:51
BALL::SDGenerator::ASSEMBLED
@ ASSEMBLED
Definition sdGenerator.h:50
BALL::SDGenerator::EDGE
@ EDGE
Definition sdGenerator.h:49
BALL::SDGenerator::CORE_CHAIN
@ CORE_CHAIN
Definition sdGenerator.h:44
BALL::SDGenerator::setDefaultOptions
void setDefaultOptions()
BALL::SDGenerator::computeAngularSeparation_
Angle computeAngularSeparation_(Atom *seed)
BALL::SDGenerator::ringIsClockwise_
bool ringIsClockwise_(const RingAnalyser::Ring &ring, Index start_index=0) const
BALL::SDGenerator::buildOpenPolygon_
void buildOpenPolygon_(RingAnalyser::Ring &ring, Position first_anchor_index, Position second_anchor_index)
BALL::SDGenerator::attachBridged_
void attachBridged_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a bridged ring to a (partially) constructed ringsystem
BALL::SDGenerator::getCFS_
Angle getCFS_(Atom const *atom, bool hi)
BALL::SDGenerator::sequenceSubstituents_
std::vector< Atom * > sequenceSubstituents_(Atom *seed)
BALL::SDGenerator::buildRegularPolygon_
void buildRegularPolygon_(RingAnalyser::Ring &ring, Position first_anchor_index, bool clockwise)
BALL::SDGenerator::depositPFU_
void depositPFU_(Atom *seed_atom, Atom *next_neighbour)
BALL::SDGenerator::attachTemplate_
void attachTemplate_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a ring template to a (partially) constructed ringsystem (no functionality yet)
BALL::SDGenerator::setCFS_
void setCFS_(Atom *atom, Angle cfs, bool high)
BALL::SDGenerator::options
Options options
options
Definition sdGenerator.h:101
BALL::SDGenerator::generateSD
void generateSD(System &molecule_sys)
Generates a structure Diagram from the input System.
BALL::SDGenerator::attachCore_
void attachCore_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system, float x_start)
construct the core-ring as a regular polygon
BALL::SDGenerator::smoothCFSAngle_
void smoothCFSAngle_(Atom *seed)
BALL::SDGenerator::chains_
std::list< std::list< Atom * > > chains_
all chains
Definition sdGenerator.h:264
BALL::SDGenerator::attachSpiro_
void attachSpiro_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a spiro ring to a (partially) constructed ringsystem
BALL::SDGenerator::compareChains_
static bool compareChains_(const vector< Atom * > &x, const vector< Atom * > &y)
Comparator for chains of atoms.
BALL::SDGenerator::prepare_
void prepare_()
Distinguishes between ring-atoms and core-chain-atoms, removes all H-Atoms from the System.
BALL::SDGenerator::~SDGenerator
virtual ~SDGenerator()
BALL::SDGenerator::treatChains_
void treatChains_()
cluster and arrange all chains in the system
BALL::SDGenerator::getBackupCFS_
Angle getBackupCFS_(Atom const *, bool hi)
BALL::SDGenerator::computeCFS_
Angle computeCFS_(Vector3 const &input)
BALL::SDGenerator::checkOverlap_
void checkOverlap_(Atom *atom)
BALL::SDGenerator::computeAngularDemand_
Angle computeAngularDemand_(Atom *seed)
BALL::SDGenerator::computeCoreCFS_
void computeCoreCFS_(RingAnalyser::Ring &ring, bool clockwise)
BALL::SDGenerator::constructRingSystem_
void constructRingSystem_(Position current_ring_system)
Constructs a ringsystem, providing the atoms with relative 2D-coordinates, starting in the point of o...
BALL::SDGenerator::attachFused_
void attachFused_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a fused ring to a (partially) constructed ringsystem
BALL::SDGenerator::clear
void clear()
BALL::SDGenerator::findFloydWarshallPath_
void findFloydWarshallPath_(std::vector< int > &path, std::vector< Index > &next, Size remaining_atoms, Position i, Position j, std::list< Index > &output)
BALL::SDGenerator::ring_analyser_
RingAnalyser ring_analyser_
The ring analyser containing all information about ring systems.
Definition sdGenerator.h:261
BALL::System
Definition KERNEL/system.h:40
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::Vector3
TVector3< float > Vector3
Definition vector3.h:1084
BALL::Angle
TAngle< float > Angle
Definition angle.h:697
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
options.h
ringAnalyser.h
BALL::SDGenerator::Default
Default values for options.
Definition sdGenerator.h:75
BALL::SDGenerator::Default::SHOW_HYDROGENS
static const bool SHOW_HYDROGENS
Definition sdGenerator.h:76
BALL::SDGenerator::Default::STANDARD_BOND_LENGTH
static const float STANDARD_BOND_LENGTH
Definition sdGenerator.h:78
BALL::SDGenerator::Option
Option names.
Definition sdGenerator.h:62
BALL::SDGenerator::Option::STANDARD_BOND_LENGTH
static const char * STANDARD_BOND_LENGTH
Definition sdGenerator.h:70
BALL::SDGenerator::Option::SHOW_HYDROGENS
static const char * SHOW_HYDROGENS
Definition sdGenerator.h:65