RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
BaseTransform.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Abstract base class for all classes which manipulate molecular coords
14
15#ifndef _RBTBASETRANSFORM_H_
16#define _RBTBASETRANSFORM_H_
17
18#include "rxdock/BaseObject.h"
19#include "rxdock/Config.h"
20
21#include <nlohmann/json.hpp>
22
23using json = nlohmann::json;
24
25namespace rxdock {
26
27class TransformAgg; // forward declaration
28
29class BaseTransform : public BaseObject {
30public:
31 // Class type string
32 static const std::string _CT;
33 // Parameter names
34
36 // Constructors/destructors
37 virtual ~BaseTransform();
38
39 friend void to_json(json &j, const BaseTransform &bt);
40 friend void from_json(const json &j, BaseTransform &bt);
41
42 // Give aggregates access to BaseSF private methods/data
43 friend class TransformAgg;
44
46 // Public methods
48 // Fully qualified name, prefixed by all ancestors
49 std::string GetFullName() const;
50
51 // Main public method - actually apply the transform
52 // Not virtual. Base class method checks if transform is enabled,
53 // sends SFRequests to reconfigure the scoring function
54 // then calls private virtual method Execute() to apply the transform
55 void Go();
56
57 // Aggregate handling methods
58 virtual void Add(BaseTransform *);
59 virtual void Remove(BaseTransform *);
60 virtual bool isAgg() const;
61 virtual unsigned int GetNumTransforms() const;
62 virtual BaseTransform *GetTransform(unsigned int) const;
63 void Orphan(); // Force removal from the parent aggregate
64 BaseTransform *GetParentTransform() const;
65
66 // Scoring function request handling
67 // Transforms can store up a list of requests to send to the workspace
68 // scoring function each time Go() is executed
69 void AddSFRequest(RequestPtr);
70 void ClearSFRequests();
71 void SendSFRequests();
72
73protected:
75 // Protected methods
77 BaseTransform(const std::string &strClass, const std::string &strName);
78
79private:
81 // Private methods
84 BaseTransform(const BaseTransform &); // Copy constructor disabled by default
86 operator=(const BaseTransform &); // Copy assignment disabled by default
87
88 // PURE VIRTUAL - subclasses should override. Applies the transform
89 virtual void Execute() = 0;
90
91protected:
93 // Protected data
95
96private:
98 // Private data
100 BaseTransform *m_parent;
101 RequestList m_SFRequests;
102};
103
104void to_json(json &j, const BaseTransform &bt);
105void from_json(const json &j, BaseTransform &bt);
106
107// Useful typedefs
108typedef std::vector<BaseTransform *>
109 BaseTransformList; // Vector of smart pointers
110typedef BaseTransformList::iterator BaseTransformListIter;
111typedef BaseTransformList::const_iterator BaseTransformListConstIter;
112
113} // namespace rxdock
114
115#endif //_RBTBASETRANSFORM_H_
Definition BaseObject.h:32
Definition BaseTransform.h:29
Definition TransformAgg.h:31