12 #ifndef RDKITMOLDRAW2DDETAILS_H
13 #define RDKITMOLDRAW2DDETAILS_H
21 #include <boost/tuple/tuple.hpp>
22 #include <boost/format.hpp>
28 namespace MolDraw2D_detail {
34 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
35 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
36 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 222, 333, 333,
37 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556,
38 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667,
39 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667,
40 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 222, 556,
41 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556,
42 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334,
43 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
44 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
45 0, 0, 0, 0, 0, 0, 0, 333, 556, 556, 167, 556, 556, 556,
46 556, 191, 333, 556, 333, 333, 500, 500, 0, 556, 556, 556, 278, 0,
47 537, 350, 222, 333, 333, 556, 1000, 1000, 0, 611, 0, 333, 333, 333,
48 333, 333, 333, 333, 333, 0, 333, 333, 0, 333, 333, 333, 1000, 0,
49 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
50 0, 1000, 0, 370, 0, 0, 0, 0, 556, 778, 1000, 365, 0, 0,
51 0, 0, 0, 889, 0, 0, 0, 278, 0, 0, 222, 611, 944, 611,
56 std::vector<Point2D> &res,
57 float startAng = 0,
float extent = 360);
61 const ROMol &mol,
bool includeRelativeCIP =
false);
67 if (mol.
hasProp(
"_atomIndicesAdded")) {
71 mol.
setProp(
"_atomIndicesAdded", 1, computed);
72 for (
auto atom : mol.
atoms()) {
85 if (mol.
hasProp(
"_bondIndicesAdded")) {
89 mol.
setProp(
"_bondIndicesAdded", 1, computed);
90 for (
auto bond : mol.
bonds()) {
101 const std::vector<std::pair<Point2D, Point2D>> &bondSegments,
102 double bracketFrac = 0.1);
105 Point2D cds1,
Point2D cds2,
double scale,
bool shiftBegin =
false,
106 bool shiftEnd =
false,
unsigned nSteps = 4,
double deviation = 0.03,
107 double endShift = 0.5);
110 return boost::str(boost::format(
"%.1f") % val);
114 const Point2D &end2,
double padding);
120 double yradius,
double padding,
124 double start_ang,
double stop_ang,
double padding,
pulls in the core RDKit functionality
bool hasProp(const std::string &key) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setProp(const std::string &key, T val, bool computed=false) const
sets a property value
CXXBondIterator< MolGraph, Bond * > bonds()
CXXAtomIterator< MolGraph, Atom * > atoms()
C++11 Range iterator.
#define RDKIT_MOLDRAW2D_EXPORT
static std::string to_string(const Descriptor &desc)
RDKIT_MOLDRAW2D_EXPORT void arcPoints(const Point2D &cds1, const Point2D &cds2, std::vector< Point2D > &res, float startAng=0, float extent=360)
bool doesLineIntersectArc(const Point2D ¢re, double xradius, double yradius, double start_ang, double stop_ang, double padding, const Point2D &end1, const Point2D &end2)
bool doesLineIntersect(const StringRect &rect, const Point2D &end1, const Point2D &end2, double padding)
RDKIT_MOLDRAW2D_EXPORT void addBondIndices(const ROMol &mol)
add annotations with bond indices.
bool doesLineIntersectEllipse(const Point2D ¢re, double xradius, double yradius, double padding, const Point2D &end1, const Point2D &end2)
bool doLinesIntersect(const Point2D &l1s, const Point2D &l1f, const Point2D &l2s, const Point2D &l2f, Point2D *ip)
RDKIT_MOLDRAW2D_EXPORT void addAtomIndices(const ROMol &mol)
add annotations with atom indices.
RDKIT_MOLDRAW2D_EXPORT void addStereoAnnotation(const ROMol &mol, bool includeRelativeCIP=false)
add R/S, relative stereo, and E/Z annotations to atoms and bonds
RDKIT_MOLDRAW2D_EXPORT std::vector< Point2D > getBracketPoints(const Point2D &p1, const Point2D &p2, const Point2D &refPt, const std::vector< std::pair< Point2D, Point2D >> &bondSegments, double bracketFrac=0.1)
std::string formatDouble(double val)
RDKIT_MOLDRAW2D_EXPORT std::vector< Point2D > handdrawnLine(Point2D cds1, Point2D cds2, double scale, bool shiftBegin=false, bool shiftEnd=false, unsigned nSteps=4, double deviation=0.03, double endShift=0.5)
bool doesTriangleIntersect(const StringRect &rect, const Point2D &pt1, const Point2D &pt2, const Point2D &pt3, double padding)
bool isPointInTriangle(const Point2D &pt, const Point2D &t1, const Point2D &t2, const Point2D &t3)
RDKIT_RDGENERAL_EXPORT const std::string bondNote
RDKIT_RDGENERAL_EXPORT const std::string atomNote