BALL 1.5.0
Loading...
Searching...
No Matches
sdGenerator.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_SDGENERATOR_H
6#define BALL_STRUCTURE_SDGENERATOR_H
7
8#ifndef BALL_DATATYPE_OPTIONS_H
10#endif
11
12#ifndef BALL_STRUCTURE_RINGANALYSER_H
14#endif
15
16#ifndef BALL_KERNEL_PDBATOM_H
17# include <BALL/KERNEL/PDBAtom.h>
18#endif
19
20#include <vector>
21#include <queue>
22
23namespace BALL
24{
25 class System;
26 class Atom;
27
34 {
35 public:
36
41 {
42 FIRST_SDGENERATOR_PROPERTY = PDBAtom::NUMBER_OF_PROPERTIES+1,
54 LAST_SDGENERATOR_PROPERTY
55 };
56
62 {
65 static const char* SHOW_HYDROGENS;
66
70 static const char* STANDARD_BOND_LENGTH;
71 };
72
75 {
76 static const bool SHOW_HYDROGENS;
77
78 static const float STANDARD_BOND_LENGTH;
79 };
81
85
89 SDGenerator(bool show_hydrogens = false);
90
94 virtual ~SDGenerator();
96
103
111
116 void generateSD(System& molecule_sys);
117
121 void clear();
122
123 protected:
124
128 {
129 public:
130 bool operator() (Atom const* first, Atom const* second) const
131 {
132 Size first_value = first->getProperty("SDGenerator::PRIORITY").getUnsignedInt();
133 Size second_value = second->getProperty("SDGenerator::PRIORITY").getUnsignedInt();
134
135 return first_value < second_value;
136 }
137 };
138
143 void prepare_();
144
149 void constructRingSystem_(Position current_ring_system);
150
151 // Obtain the CFS from the properties of the atom...
152 Angle getCFS_(Atom const* atom, bool hi);
153
154 // Convert a vector into the corresponding CFS angle
155 Angle computeCFS_(Vector3 const& input);
156
157 // store the CFS for an atom
158 void setCFS_(Atom* atom, Angle cfs, bool high);
159
160 // push the CFS before it is overwritten
161 void pushCFS_(Atom* atom);
162
163 // retrieve backup CVS values
164 Angle getBackupCFS_(Atom const*, bool hi);
165
166 // Compute the CFS values for a full regular polygon
167 void computeCoreCFS_(RingAnalyser::Ring& ring, bool clockwise);
168
169 //
171
172 //
174
175 //
176 std::vector<Atom*> sequenceSubstituents_(Atom* seed);
177
181
184 void buildRegularPolygon_(RingAnalyser::Ring& ring, Position first_anchor_index, bool clockwise);
185
188 void buildOpenPolygon_(RingAnalyser::Ring& ring, Position first_anchor_index, Position second_anchor_index);
189
196 void attachCore_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system, float x_start);
197
203 void attachTemplate_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
204
210 void attachFused_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
211
217 void attachBridged_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
218
224 void attachSpiro_(Position current_ring, std::vector<RingAnalyser::Ring>& current_system);
225
227 void computeAdjacencyMatrix_(std::vector<Atom*>& chain, std::vector<bool>& result);
228
230 static bool compareChains_(const vector<Atom*>& x, const vector<Atom*>& y);
231
236
237 //
239
240 //
241 void placeSubstituent_(Atom* seed, Atom* head, Atom* next);
242
243 //
244 void depositPFU_(Atom* seed_atom, Atom* next_neighbour);
245
246 //
247 void checkOverlap_(Atom* atom);
248
249 //Check whether the ring is clockwise or not
250 bool ringIsClockwise_(const RingAnalyser::Ring& ring, Index start_index = 0) const;
251
256
257 // The backtracking for our Floyd-Warshall implementation
258 void findFloydWarshallPath_(std::vector<int>& path, std::vector<Index>& next, Size remaining_atoms, Position i, Position j, std::list<Index>& output);
259
262
264 std::list<std::list<Atom*> > chains_;
265
267 std::priority_queue<Atom*, std::vector<Atom*>, AtomComparator> redraw_queue_;
268
271 };
272
273} // namepspace BALL
274
275#endif
char Atom[5]
Definition PDBdefs.h:257
unsigned int getUnsignedInt() const
const NamedProperty & getProperty(const std::string &name) const
Methods for the analysis of the structure of ringsystems.
void placeSubstituent_(Atom *seed, Atom *head, Atom *next)
void computeAdjacencyMatrix_(std::vector< Atom * > &chain, std::vector< bool > &result)
Compute adjacency matrix of the given atoms.
SDGenerator(bool show_hydrogens=false)
void computeShelleyPriorities_()
std::priority_queue< Atom *, std::vector< Atom * >, AtomComparator > redraw_queue_
our redraw queue
System * system_
the system we are working on
void pushCFS_(Atom *atom)
Property
Properties, used to describe atoms and their status.
Definition sdGenerator.h:41
void setDefaultOptions()
Angle computeAngularSeparation_(Atom *seed)
bool ringIsClockwise_(const RingAnalyser::Ring &ring, Index start_index=0) const
void buildOpenPolygon_(RingAnalyser::Ring &ring, Position first_anchor_index, Position second_anchor_index)
void attachBridged_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a bridged ring to a (partially) constructed ringsystem
Angle getCFS_(Atom const *atom, bool hi)
std::vector< Atom * > sequenceSubstituents_(Atom *seed)
void buildRegularPolygon_(RingAnalyser::Ring &ring, Position first_anchor_index, bool clockwise)
void depositPFU_(Atom *seed_atom, Atom *next_neighbour)
void attachTemplate_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a ring template to a (partially) constructed ringsystem (no functionality yet)
void setCFS_(Atom *atom, Angle cfs, bool high)
Options options
options
void generateSD(System &molecule_sys)
Generates a structure Diagram from the input System.
void attachCore_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system, float x_start)
construct the core-ring as a regular polygon
void smoothCFSAngle_(Atom *seed)
std::list< std::list< Atom * > > chains_
all chains
void attachSpiro_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a spiro ring to a (partially) constructed ringsystem
static bool compareChains_(const vector< Atom * > &x, const vector< Atom * > &y)
Comparator for chains of atoms.
void prepare_()
Distinguishes between ring-atoms and core-chain-atoms, removes all H-Atoms from the System.
virtual ~SDGenerator()
void treatChains_()
cluster and arrange all chains in the system
Angle getBackupCFS_(Atom const *, bool hi)
Angle computeCFS_(Vector3 const &input)
void checkOverlap_(Atom *atom)
Angle computeAngularDemand_(Atom *seed)
void computeCoreCFS_(RingAnalyser::Ring &ring, bool clockwise)
void constructRingSystem_(Position current_ring_system)
Constructs a ringsystem, providing the atoms with relative 2D-coordinates, starting in the point of o...
void attachFused_(Position current_ring, std::vector< RingAnalyser::Ring > &current_system)
attach a fused ring to a (partially) constructed ringsystem
void findFloydWarshallPath_(std::vector< int > &path, std::vector< Index > &next, Size remaining_atoms, Position i, Position j, std::list< Index > &output)
RingAnalyser ring_analyser_
The ring analyser containing all information about ring systems.
static const char * STANDARD_BOND_LENGTH
Definition sdGenerator.h:70
static const char * SHOW_HYDROGENS
Definition sdGenerator.h:65
Default values for options.
Definition sdGenerator.h:75
static const bool SHOW_HYDROGENS
Definition sdGenerator.h:76
static const float STANDARD_BOND_LENGTH
Definition sdGenerator.h:78
#define BALL_EXPORT