forked from CBDD/rDock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRbtTransformAgg.h
107 lines (86 loc) · 3.43 KB
/
RbtTransformAgg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/***********************************************************************
* The rDock program was developed from 1998 - 2006 by the software team
* at RiboTargets (subsequently Vernalis (R&D) Ltd).
* In 2006, the software was licensed to the University of York for
* maintenance and distribution.
* In 2012, Vernalis and the University of York agreed to release the
* program as Open Source software.
* This version is licensed under GNU-LGPL version 3.0 with support from
* the University of Barcelona.
* http://rdock.sourceforge.net/
***********************************************************************/
//Transform aggregate class. Manages collection of child transforms
#ifndef _RBTTRANSFORMAGG_H_
#define _RBTTRANSFORMAGG_H_
#include "RbtBaseTransform.h"
//Only check transform aggregate assertions in debug build
#ifdef _NDEBUG
const RbtBool TRANSFORMAGG_CHECK = false;
#else
const RbtBool TRANSFORMAGG_CHECK = true;
#endif //_NDEBUG
//Useful typedefs
class RbtTransformAgg : public RbtBaseTransform
{
public:
//Static data member for class type (i.e. "RbtTransformAgg")
static RbtString _CT;
////////////////////////////////////////
//Constructors/destructors
RbtTransformAgg(const RbtString& strName = "DOCK");
virtual ~RbtTransformAgg();
////////////////////////////////////////
//Public methods
////////////////
//Aggregate handling methods
virtual void Add(RbtBaseTransform*) throw (RbtError);
virtual void Remove(RbtBaseTransform*) throw (RbtError);
virtual RbtBool isAgg() const;
virtual RbtUInt GetNumTransforms() const;
virtual RbtBaseTransform* GetTransform(RbtUInt iTransform) const throw (RbtError);
//WorkSpace handling methods
//Register scoring function with a workspace
//Aggregate version registers all children, but NOT itself
//(Aggregates are just containers, and have no need for model information
virtual void Register(RbtWorkSpace*);
//Unregister with a workspace
//Aggregate version unregisters all children, but NOT itself
virtual void Unregister();
//Override RbtObserver pure virtual
//Notify observer that subject has changed
//Does nothing in RbtTransformAgg as aggregates do not require updating
virtual void Update(RbtSubject* theChangedSubject);
//Request Handling method
virtual void HandleRequest(RbtRequestPtr spRequest);
//Virtual function for dumping transform details to an output stream
//Called by operator <<
virtual void Print(ostream& s) const;
protected:
////////////////////////////////////////
//Protected methods
///////////////////
//Actually apply the transform
//Aggregate version loops over all child transforms
virtual void Execute();
private:
////////////////////////////////////////
//Private methods
/////////////////
RbtTransformAgg(const RbtTransformAgg&);//Copy constructor disabled by default
RbtTransformAgg& operator=(const RbtTransformAgg&);//Copy assignment disabled by default
protected:
////////////////////////////////////////
//Protected data
////////////////
private:
////////////////////////////////////////
//Private data
//////////////
RbtBaseTransformList m_transforms;
};
//Useful typedefs
typedef SmartPtr<RbtTransformAgg> RbtTransformAggPtr;//Smart pointer
typedef vector<RbtTransformAggPtr> RbtTransformAggList;//Vector of smart pointers
typedef RbtTransformAggList::iterator RbtTransformAggListIter;
typedef RbtTransformAggList::const_iterator RbtTransformAggListConstIter;
#endif //_RBTTRANSFORMAGG_H_