16#include "rxdock/Atom.h"
17#include "rxdock/Bond.h"
18#include "rxdock/Config.h"
19#include "rxdock/ModelMutator.h"
20#include "rxdock/PrincipalAxes.h"
21#include "rxdock/PseudoAtom.h"
22#include "rxdock/Variant.h"
24#include <nlohmann/json.hpp>
26using json = nlohmann::json;
30class BaseMolecularFileSource;
45 RBTDLL_EXPORT
Model(AtomList &atomList, BondList &bondList);
52 friend void to_json(json &j,
const Model &model);
53 friend void from_json(
const json &j,
Model &model);
70 std::string GetName()
const {
return m_strName; }
73 int GetNumTitles()
const {
return m_titleList.size(); }
74 std::vector<std::string> GetTitleList()
const {
return m_titleList; }
75 void SetTitle(std::size_t index,
const std::string &strTitle) {
76 m_titleList[index] = strTitle;
80 int GetNumAtoms()
const {
return m_atomList.size(); }
81 AtomList GetAtomList()
const {
return m_atomList; }
84 int GetNumBonds()
const {
return m_bondList.size(); }
85 BondList GetBondList()
const {
return m_bondList; }
88 int GetNumSegments()
const {
return m_segmentMap.size(); }
89 SegmentMap GetSegmentMap()
const {
return m_segmentMap; }
92 int GetNumRings()
const {
return m_ringList.size(); }
93 AtomListList GetRingAtomLists()
const {
return m_ringList; }
97 int GetNumData()
const {
return m_dataMap.size(); }
99 std::vector<std::string> GetDataFieldList()
const;
102 StringVariantMap GetDataMap()
const {
return m_dataMap; }
104 bool isDataFieldPresent(
const std::string &strDataField)
const;
106 RBTDLL_EXPORT
Variant GetDataValue(
const std::string &strDataField)
const;
108 RBTDLL_EXPORT
void SetDataValue(
const std::string &strDataField,
111 void ClearDataField(
const std::string &strDataField);
113 RBTDLL_EXPORT
void ClearAllDataFields(
const std::string &strDataFieldPrefix);
115 void ClearAllDataFields();
119 void ClearPseudoAtoms();
120 void UpdatePseudoAtoms();
121 unsigned int GetNumPseudoAtoms()
const;
122 PseudoAtomList GetPseudoAtomList()
const;
125 unsigned int GetNumTetheredAtoms()
const;
126 AtomList GetTetheredAtomList()
const;
137 double GetOccupancy()
const {
return m_occupancy; }
138 bool GetEnabled()
const {
return m_enabled; }
140 RBTDLL_EXPORT
void SetOccupancy(
double occupancy,
double threshold = 0.5);
151 void Translate(
const Vector &vector);
154 void Rotate(
const Vector &axis,
double thetaDeg);
157 void Rotate(
const Vector &axis,
double thetaDeg,
const Coord ¢er);
160 RBTDLL_EXPORT
void RotateBond(
BondPtr spBond,
double thetaDeg);
163 void RotateBond(
BondPtr spBond,
double thetaDeg,
AtomPtr spFixedAtom);
167 RBTDLL_EXPORT
void RotateBond(
BondPtr spBond,
double thetaDeg,
bool bSwap);
170 void SaveCoords(
const std::string &coordName =
"");
171 RBTDLL_EXPORT
void RevertCoords(
const std::string &coordName =
"");
172 std::map<std::string, int> GetSavedCoordNames()
const {
return m_coordNames; }
173 int GetNumSavedCoords()
const {
return m_coordNames.size(); }
174 int GetCurrentCoords()
const {
return m_currentCoord; }
175 RBTDLL_EXPORT
void RevertCoords(
int);
178 Coord GetCenterOfMass()
const;
180 void SetCenterOfMass(
const Coord &c) { Translate(c - GetCenterOfMass()); }
184 RBTDLL_EXPORT
double GetTotalMass()
const;
194 bool bAlignCOM =
true);
199 RBTDLL_EXPORT
void SetFlexData(
FlexData *pFlexData);
202 RBTDLL_EXPORT
FlexData *GetFlexData()
const;
208 bool isFlexible()
const;
209 const AtomRList &GetFlexIntns(
Atom *pAtom)
const;
210 BondList GetFlexBonds()
const;
230 void SetAtomSelectionFlags(
bool bSelected =
true);
231 unsigned int GetNumSelectedAtoms();
232 AtomList GetSelectedAtomList();
235 void SetAtomCyclicFlags(
bool bCyclic =
true);
236 unsigned int GetNumCyclicAtoms();
237 AtomList GetCyclicAtomList();
240 void SetAtomUser1Flags(
bool bUser1 =
true);
242 void SetAtomUser1Values(
double dUser1 = 0.0);
244 void SetAtomUser2Values(
double dUser2 = 0.0);
247 unsigned int GetNumHBondAcceptorAtoms();
248 AtomList GetHBondAcceptorAtomList();
251 unsigned int GetNumHBondDonorAtoms();
252 AtomList GetHBondDonorAtomList();
255 unsigned int GetNumChargedAtoms();
256 AtomList GetChargedAtomList();
259 unsigned int GetNumPlanarAtoms();
260 AtomList GetPlanarAtomList();
265 unsigned int GetNumAtomsWithAtomicNo(
int nAtomicNo);
266 AtomList GetAtomListWithAtomicNo(
int nAtomicNo);
269 unsigned int GetNumAtomsWithFFType(std::string strFFType);
270 AtomList GetAtomListWithFFType(std::string strFFType);
283 template <
class Predicate>
unsigned int GetNumBonds(
const Predicate &pred);
285 template <
class Predicate> BondList GetBondList(
const Predicate &pred);
288 void SetBondSelectionFlags(
bool bSelected =
true);
289 unsigned int GetNumSelectedBonds();
290 BondList GetSelectedBondList();
293 void SetBondCyclicFlags(
bool bCyclic =
true);
294 unsigned int GetNumCyclicBonds();
295 BondList GetCyclicBondList();
309 void GetMinMaxCoords(
Coord &minCoord,
Coord &maxCoord,
bool bInit =
true);
312 std::map<std::string, int> GetAtomTypeMap();
316 std::map<std::string, int> GetBondTypeMap();
331 void AddAtoms(AtomList &atomList);
337 std::string m_strName;
338 std::vector<std::string> m_titleList;
341 SegmentMap m_segmentMap;
342 AtomListList m_ringList;
343 std::map<std::string, int>
347 StringVariantMap m_dataMap;
360void to_json(json &j,
const Model &model);
361void from_json(
const json &j,
Model &model);
365typedef std::vector<ModelPtr> ModelList;
366typedef ModelList::iterator ModelListIter;
367typedef ModelList::const_iterator ModelListConstIter;
Definition BaseMolecularFileSource.h:29
Definition ChromElement.h:36
Definition ModelMutator.h:39
Definition PrincipalAxes.h:29
Definition SmartPointer.h:48