STORMM Source Documentation
Loading...
Searching...
No Matches
mdlmol_bond.h
1// -*-c++-*-
2#ifndef STORMM_MOLOBJ_BOND_H
3#define STORMM_MOLOBJ_BOND_H
4
5#include <string>
6#include <vector>
7#include "copyright.h"
8#include "Parsing/textfile.h"
9#include "molecule_format_enumerators.h"
10
11namespace stormm {
12namespace structure {
13
14using parse::TextFile;
15
18constexpr MdlMolBondOrder default_mdl_bond_order = MdlMolBondOrder::SINGLE;
19constexpr MdlMolBondStereo default_mdl_bond_stereochemistry = MdlMolBondStereo::NOT_STEREO;
20constexpr MolObjRingState default_mdl_ring_status = MolObjRingState::EITHER;
21constexpr MolObjReactionCenter default_mdl_bond_reactivity = MolObjReactionCenter::NON_CENTER;
23
28public:
29
43 MdlMolBond();
44 MdlMolBond(int i_atom_in, int j_atom_in);
45 MdlMolBond(int i_atom_in, int j_atom_in, MdlMolBondOrder order_in, MdlMolBondStereo stereo_in,
46 MolObjRingState ring_state_in, MolObjReactionCenter reactivity_in);
47 MdlMolBond(const TextFile &tf, int line_number, const std::string &title = std::string(""));
49
52 MdlMolBond(const MdlMolBond &original) = default;
53 MdlMolBond(MdlMolBond &&original) = default;
54 MdlMolBond& operator=(const MdlMolBond &other) = default;
55 MdlMolBond& operator=(MdlMolBond &&other) = default;
57
61 int getFirstAtom() const;
62
64 int getSecondAtom() const;
65
67 MdlMolBondOrder getOrder() const;
68
70 MdlMolBondStereo getStereochemistry() const;
71
73 MolObjRingState getRingStatus() const;
74
76 MolObjReactionCenter getReactivity() const;
77
79 void setFirstAtom(int index_in);
80
82 void setSecondAtom(int index_in);
83
86 void setOrder(MdlMolBondOrder order_in);
87
89 void setStereochemistry(MdlMolBondStereo stereo_in);
90
92 void setRingStatus(MolObjRingState status_in);
93
95 void setReactivity(MolObjReactionCenter potential_in);
96
97private:
98 int i_atom;
99 int j_atom;
100 MdlMolBondOrder order;
101 MdlMolBondStereo stereo;
102 MolObjRingState ring_state;
103 MolObjReactionCenter reactivity;
104
109 MdlMolBondOrder interpretBondOrder(int code_in, const std::string &title);
110
115 MdlMolBondStereo interpretBondStereochemistry(int code_in, const std::string &title);
116
121 MolObjRingState interpretRingState(int code_in, const std::string &title);
122
127 MolObjReactionCenter interpretBondReactivePotential(int code_in, const std::string &title);
128};
129
131std::vector<MdlMolBond> operator+(const std::vector<MdlMolBond> &lhs,
132 const std::vector<MdlMolBond> &rhs);
133
134} // namespace structure
135} // namespace stormm
136
137#endif
Structure for translating a text file into a compact, rapidly parsable vector of characters in CPU RA...
Definition textfile.h:45
MolObjReactionCenter getReactivity() const
Get the reactive potential of the bond.
Definition mdlmol_bond.cpp:185
void setRingStatus(MolObjRingState status_in)
Mark the status of the bond with respect to any ring features.
Definition mdlmol_bond.cpp:210
int getSecondAtom() const
Get the second atom in the bond.
Definition mdlmol_bond.cpp:165
void setOrder(MdlMolBondOrder order_in)
Set the order of the bond, perhaps after computations with an associated ChemicalFeatures object.
Definition mdlmol_bond.cpp:200
void setSecondAtom(int index_in)
Set the index of the second atom in the bond.
Definition mdlmol_bond.cpp:195
MdlMolBond()
The constructor can take all member variables, or just the atoms so that more information can be fill...
Definition mdlmol_bond.cpp:15
MolObjRingState getRingStatus() const
Get the ring status–is the bond known to be part of a ring?
Definition mdlmol_bond.cpp:180
MdlMolBond(const MdlMolBond &original)=default
The default copy and move constructors as well as assignment operators are adequate.
void setReactivity(MolObjReactionCenter potential_in)
Mark the reactive potential of the bond.
Definition mdlmol_bond.cpp:215
void setStereochemistry(MdlMolBondStereo stereo_in)
Set the stereochemical details of the bond.
Definition mdlmol_bond.cpp:205
void setFirstAtom(int index_in)
Set the index of the first atom in the bond.
Definition mdlmol_bond.cpp:190
MdlMolBondOrder getOrder() const
Get the order of the bond.
Definition mdlmol_bond.cpp:170
int getFirstAtom() const
Get the first atom in the bond. Having separate functions for each atom is a more intuitive way to of...
Definition mdlmol_bond.cpp:160
MdlMolBondStereo getStereochemistry() const
Get the order of the bond.
Definition mdlmol_bond.cpp:175