11#ifndef RD_DEPICT_UTILS_H
12#define RD_DEPICT_UTILS_H
41 return pd1.first > pd2.first;
45typedef std::priority_queue<PAIR_I_I, VECT_PII, gtIIPair>
PR_QUEUE;
191 bool ascending =
true);
209 angle = 2 *
M_PI / 3;
213 angle = 2 *
M_PI / 3;
216 angle = 2. *
M_PI / degree;
252 auto pt1 = loc1 - center;
253 auto pt2 = loc2 - center;
254 auto cross = pt1.
x * pt2.y - pt1.y * pt2.x;
255 auto diffAngle =
M_PI - remAngle;
273 auto res = other - center;
275 std::swap(res.x, res.y);
291 auto v1 = loc1 - center;
292 auto v2 = loc2 - center;
373 const int maxAtNum = 1000;
374 const int maxDeg = 100;
376 anum = anum == 1 ? maxAtNum : anum;
378 return maxDeg * anum + deg;
387 std::vector<RDKit::MatchVectType> &matches);
pulls in the core RDKit functionality
Defines the primary molecule class ROMol as well as associated typedefs.
Defines the editable molecule class RWMol.
void normalize() override
double angleTo(const Point2D &other) const
The class for representing atoms.
HybridizationType
store hybridization
@ UNSPECIFIED
hybridization that hasn't been specified
int getAtomicNum() const
returns our atomic number
unsigned int getDegree() const
RWMol is a molecule class that is intended to be edited.
#define RDKIT_DEPICTOR_EXPORT
int getAtomDepictRank(const RDKit::Atom *at)
returns the rank of the atom for determining draw order
RDKIT_DEPICTOR_EXPORT unsigned int NUM_BONDS_FLIPS
RDKIT_DEPICTOR_EXPORT double COLLISION_THRES
RDKIT_DEPICTOR_EXPORT void reducedToFullMatches(const RDKit::RWMol &reducedQuery, const RDKit::RWMol &molHs, std::vector< RDKit::MatchVectType > &matches)
RDKIT_DEPICTOR_EXPORT RDGeom::INT_POINT2D_MAP embedRing(const RDKit::INT_VECT &ring)
Some utility functions used in generating 2D coordinates.
std::pair< int, int > PAIR_I_I
RDKIT_DEPICTOR_EXPORT RDKit::VECT_INT_VECT findCoreRings(const RDKit::VECT_INT_VECT &fusedRings, RDKit::INT_VECT &coreRingsIds, const RDKit::ROMol &mol)
From a given set of fused rings find the "core" rings, i.e. the rings that are left after iteratively...
int rotationDir(const RDGeom::Point2D ¢er, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2, double remAngle)
computes the rotation direction between two vectors
RDKIT_DEPICTOR_EXPORT bool invertWedgingIfMolHasFlipped(RDKit::ROMol &mol, const RDGeom::Transform3D &trans)
RDKIT_DEPICTOR_EXPORT std::unique_ptr< RDKit::RWMol > prepareTemplateForRGroups(RDKit::RWMol &templateMol)
std::pair< double, INT_PAIR > DOUBLE_INT_PAIR
RDKIT_DEPICTOR_EXPORT int pickFirstRingToEmbed(const RDKit::ROMol &mol, const RDKit::VECT_INT_VECT &fusedRings)
pick the ring to embed first in a fused system
RDKIT_DEPICTOR_EXPORT double ANGLE_OPEN
RDKIT_DEPICTOR_EXPORT double BOND_LEN
std::vector< const RDGeom::Point2D * > VECT_C_POINT
RDKIT_DEPICTOR_EXPORT RDKit::INT_VECT getRotatableBonds(const RDKit::ROMol &mol, unsigned int aid1, unsigned int aid2)
find the rotatable bonds on the shortest path between two atoms we will ignore ring atoms,...
RDKIT_DEPICTOR_EXPORT void getNbrAtomAndBondIds(unsigned int aid, const RDKit::ROMol *mol, RDKit::INT_VECT &aids, RDKit::INT_VECT &bids)
Get the ids of the atoms and bonds that are connected to aid.
std::priority_queue< PAIR_I_I, VECT_PII, gtIIPair > PR_QUEUE
std::list< PAIR_D_I_I > LIST_PAIR_DII
RDKIT_DEPICTOR_EXPORT double HETEROATOM_COLL_SCALE
RDKIT_DEPICTOR_EXPORT RDKit::INT_VECT setNbrOrder(unsigned int aid, const RDKit::INT_VECT &nbrs, const RDKit::ROMol &mol)
double computeSubAngle(unsigned int degree, RDKit::Atom::HybridizationType htype)
computes a subangle for an atom of given hybridization and degree
std::vector< PAIR_I_I > VECT_PII
std::vector< INT_PAIR > INT_PAIR_VECT
RDKIT_DEPICTOR_EXPORT void transformPoints(RDGeom::INT_POINT2D_MAP &nringCor, const RDGeom::Transform2D &trans)
RDKIT_DEPICTOR_EXPORT INT_PAIR_VECT findBondsPairsToPermuteDeg4(const RDGeom::Point2D ¢er, const RDKit::INT_VECT &nbrBids, const VECT_C_POINT &nbrLocs)
Find pairs of bonds that can be permuted at a non-ring degree 4 atom.
std::pair< double, PAIR_I_I > PAIR_D_I_I
double computeAngle(const RDGeom::Point2D ¢er, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
computes the rotation angle between two vectors
RDKIT_DEPICTOR_EXPORT double BOND_THRES
RDKIT_DEPICTOR_EXPORT RDKit::INT_VECT getAllRotatableBonds(const RDKit::ROMol &mol)
find all the rotatable bonds in a molecule we will ignore ring atoms, and double bonds which are mark...
RDKIT_DEPICTOR_EXPORT RDGeom::Point2D reflectPoint(const RDGeom::Point2D &point, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
RDKIT_DEPICTOR_EXPORT RDGeom::Point2D computeBisectPoint(const RDGeom::Point2D &rcr, double ang, const RDGeom::Point2D &nb1, const RDGeom::Point2D &nb2)
Find a point that bisects the angle at rcr.
RDKIT_DEPICTOR_EXPORT RDKit::INT_VECT findNextRingToEmbed(const RDKit::INT_VECT &doneRings, const RDKit::VECT_INT_VECT &fusedRings, int &nextId)
From a given set of rings find the ring the largest common elements with other rings.
RDGeom::Point2D computeNormal(const RDGeom::Point2D ¢er, const RDGeom::Point2D &other)
computes and return the normal of a vector between two points
RDKIT_DEPICTOR_EXPORT bool hasTerminalRGroupOrQueryHydrogen(const RDKit::ROMol &query)
RDKIT_DEPICTOR_EXPORT void reflectPoints(RDGeom::INT_POINT2D_MAP &coordMap, const RDGeom::Point2D &loc1, const RDGeom::Point2D &loc2)
Reflect a set of point through the line joining two point.
RDKIT_DEPICTOR_EXPORT unsigned int MAX_COLL_ITERS
INT_PAIR_VECT::const_iterator INT_PAIR_VECT_CI
RDKIT_DEPICTOR_EXPORT T rankAtomsByRank(const RDKit::ROMol &mol, const T &commAtms, bool ascending=true)
Sort a list of atoms by their CIP rank.
std::pair< int, int > INT_PAIR
std::map< int, Point2D > INT_POINT2D_MAP
std::vector< int > INT_VECT
std::vector< INT_VECT > VECT_INT_VECT
bool operator()(const PAIR_I_I &pd1, const PAIR_I_I &pd2) const