diff --git a/Code/GraphMol/MolTransforms/MolTransforms.cpp b/Code/GraphMol/MolTransforms/MolTransforms.cpp index 6fa901259..55cc900cb 100644 --- a/Code/GraphMol/MolTransforms/MolTransforms.cpp +++ b/Code/GraphMol/MolTransforms/MolTransforms.cpp @@ -244,9 +244,9 @@ void _toBeMovedIdxList(const ROMol &mol, unsigned int iAtomId, } } } -double getBondLength(Conformer &conf, unsigned int iAtomId, +double getBondLength(const Conformer &conf, unsigned int iAtomId, unsigned int jAtomId) { - RDGeom::POINT3D_VECT &pos = conf.getPositions(); + const RDGeom::POINT3D_VECT &pos = conf.getPositions(); URANGE_CHECK(iAtomId, pos.size() - 1); URANGE_CHECK(jAtomId, pos.size() - 1); @@ -278,9 +278,9 @@ void setBondLength(Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, } } -double getAngleRad(Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, +double getAngleRad(const Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId) { - RDGeom::POINT3D_VECT &pos = conf.getPositions(); + const RDGeom::POINT3D_VECT &pos = conf.getPositions(); URANGE_CHECK(iAtomId, pos.size() - 1); URANGE_CHECK(jAtomId, pos.size() - 1); URANGE_CHECK(kAtomId, pos.size() - 1); @@ -342,10 +342,10 @@ void setAngleRad(Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, } } -double getDihedralRad(Conformer &conf, unsigned int iAtomId, +double getDihedralRad(const Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId, unsigned int lAtomId) { - RDGeom::POINT3D_VECT &pos = conf.getPositions(); + const RDGeom::POINT3D_VECT &pos = conf.getPositions(); URANGE_CHECK(iAtomId, pos.size() - 1); URANGE_CHECK(jAtomId, pos.size() - 1); URANGE_CHECK(kAtomId, pos.size() - 1); diff --git a/Code/GraphMol/MolTransforms/MolTransforms.h b/Code/GraphMol/MolTransforms/MolTransforms.h index 9bce66e4c..5f17efbc5 100644 --- a/Code/GraphMol/MolTransforms/MolTransforms.h +++ b/Code/GraphMol/MolTransforms/MolTransforms.h @@ -102,7 +102,7 @@ void canonicalizeMol(RDKit::ROMol &mol, bool normalizeCovar = false, bool ignoreHs = true); //! Get the bond length between the specified atoms i, j -double getBondLength(RDKit::Conformer &conf, unsigned int iAtomId, +double getBondLength(const RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId); //! Set the bond length between the specified atoms i, j @@ -111,11 +111,11 @@ void setBondLength(RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, double value); //! Get the angle in radians among the specified atoms i, j, k -double getAngleRad(RDKit::Conformer &conf, unsigned int iAtomId, +double getAngleRad(const RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId); //! Get the angle in degrees among the specified atoms i, j, k -inline double getAngleDeg(RDKit::Conformer &conf, unsigned int iAtomId, +inline double getAngleDeg(const RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId) { return (180. / M_PI * getAngleRad(conf, iAtomId, jAtomId, kAtomId)); } @@ -134,12 +134,12 @@ inline void setAngleDeg(RDKit::Conformer &conf, unsigned int iAtomId, } //! Get the dihedral angle in radians among the specified atoms i, j, k, l -double getDihedralRad(RDKit::Conformer &conf, unsigned int iAtomId, +double getDihedralRad(const RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId, unsigned int lAtomId); //! Get the dihedral angle in degrees among the specified atoms i, j, k, l -inline double getDihedralDeg(RDKit::Conformer &conf, unsigned int iAtomId, +inline double getDihedralDeg(const RDKit::Conformer &conf, unsigned int iAtomId, unsigned int jAtomId, unsigned int kAtomId, unsigned int lAtomId) { return (180. / M_PI *