16#ifndef RDKIT_DRAWMOL_H
17#define RDKIT_DRAWMOL_H
37namespace MolDraw2D_detail {
73 const std::vector<std::pair<DrawColour, DrawColour>> *
bondColours =
141 const Atom &atom)
const;
156 const std::pair<DrawColour, DrawColour> &
cols);
158 const std::pair<DrawColour, DrawColour> &
cols);
160 const std::pair<DrawColour, DrawColour> &
cols);
162 const std::pair<DrawColour, DrawColour> &
cols);
164 const std::pair<DrawColour, DrawColour> &
cols);
239 double offset,
bool trunc)
const;
254 std::vector<Point2D> &
points);
278 std::vector<std::unique_ptr<DrawShape>>
bonds_;
282 std::vector<std::pair<std::string, OrientType>>
atomSyms_;
286 std::vector<std::unique_ptr<DrawAnnotation>>
legends_;
287 std::vector<std::tuple<StringRect, OrientType, int>>
radicals_;
342 const std::vector<std::tuple<StringRect, OrientType, int>> &
radicals,
358 double tol = 1.0e-4);
The class for representing atoms.
class for representing a bond
std::pair< std::string, OrientType > getAtomSymbolAndOrientation(const Atom &atom) const
void newBondLine(const Point2D &pt1, const Point2D &pt2, const DrawColour &col1, const DrawColour &col2, int atom1Idx, int atom2Idx, int bondIdx, const DashPattern &dashPattern)
void makeDativeBond(Bond *bond, double offset, const std::pair< DrawColour, DrawColour > &cols)
void extractAttachments()
void extractVariableBonds()
void calcDoubleBondLines(double offset, const Bond &bond, Point2D &l1s, Point2D &l1f, Point2D &l2s, Point2D &l2f) const
void bondInsideRing(const Bond &bond, double offset, Point2D &l2s, Point2D &l2f) const
Point2D getDrawCoords(const Point2D &atCds) const
std::pair< DrawColour, DrawColour > getBondColours(Bond *bond)
void tagAtomsWithCoords()
DrawMol & operator=(DrawMol &&)=delete
void doubleBondTerminal(Atom *at1, Atom *at2, double offset, Point2D &l1s, Point2D &l1f, Point2D &l2s, Point2D &l2f) const
std::unique_ptr< RWMol > drawMol_
std::map< int, DrawColour > highlightAtomMap_
std::vector< int > singleBondLines_
void calcMeanBondLength()
void setTransformation(const DrawMol &sourceMol)
std::vector< std::unique_ptr< AtomSymbol > > atomLabels_
std::string getAtomSymbol(const Atom &atom, OrientType orientation) const
std::map< int, double > highlightRadii_
void extractCloseContacts()
void shrinkToFit(bool withPadding=true)
std::map< int, DrawColour > highlightBondMap_
void extractStereoGroups()
std::vector< std::pair< std::string, OrientType > > atomSyms_
virtual ~DrawMol()=default
void drawRadicals(MolDraw2D &drawer) const
void setScale(double newScale, double newFontScale, bool ignoreFontLimits=true)
void bondNonRing(const Bond &bond, double offset, Point2D &l2s, Point2D &l2f) const
DrawColour getColour(int atom_idx) const
std::vector< std::unique_ptr< DrawAnnotation > > annotations_
Point2D getAtomCoords(int atnum) const
std::vector< int > highlightAtoms_
DrawMol(const DrawMol &)=delete
Point2D transformPoint(const Point2D &pt, const Point2D *trans=nullptr, Point2D *scale=nullptr, const Point2D *toCentre=nullptr) const
void makeWedgedBond(Bond *bond, const std::pair< DrawColour, DrawColour > &cols)
std::vector< std::unique_ptr< DrawShape > > preShapes_
void finishCreateDrawObjects()
std::vector< std::pair< DrawColour, DrawColour > > bondColours_
void setOffsets(double xOffset, double yOffset)
std::vector< std::unique_ptr< DrawAnnotation > > legends_
Point2D doubleBondEnd(unsigned int at1, unsigned int at2, unsigned int at3, double offset, bool trunc) const
void makeStandardBond(Bond *bond, double doubleBondOffset)
void makeTripleBondLines(Bond *bond, double doubleBondOffset, const std::pair< DrawColour, DrawColour > &cols)
Point2D getAtomCoords(const Point2D &screenCds) const
void partitionForLegend()
double getNoteStartAngle(const Atom *atom) const
void makeAtomEllipseHighlights(double lineWidth)
const MolDrawOptions & drawOptions_
void makeAtomCircleHighlights()
std::vector< std::tuple< StringRect, OrientType, int > > radicals_
void makeQueryBond(Bond *bond, double doubleBondOffset)
DrawMol(const ROMol &mol, const std::string &legend, int width, int height, const MolDrawOptions &drawOptions, DrawText &textDrawer, const std::vector< int > *highlightAtoms=nullptr, const std::vector< int > *highlightBonds=nullptr, const std::map< int, DrawColour > *highlightAtomMap=nullptr, const std::map< int, DrawColour > *highlightBondMap=nullptr, const std::vector< std::pair< DrawColour, DrawColour > > *bondColours=nullptr, const std::map< int, double > *highlight_radii=nullptr, bool includeAnnotations=true, int confId=-1, bool isReactionMol=false)
DrawMol & operator=(const DrawMol &)=delete
std::vector< std::unique_ptr< DrawShape > > postShapes_
std::vector< Point2D > atCds_
int doesRectClash(const StringRect &rect, double padding) const
std::vector< std::unique_ptr< DrawShape > > highlights_
std::vector< int > atomicNums_
std::vector< int > highlightBonds_
void draw(MolDraw2D &drawer) const
void calcTripleBondLines(double offset, const Bond &bond, Point2D &l1s, Point2D &l1f, Point2D &l2s, Point2D &l2f)
void transformAll(const Point2D *trans=nullptr, Point2D *scale=nullptr, const Point2D *toCentre=nullptr)
void makeContinuousHighlights(double scale)
void findOtherBondVecs(const Atom *atom, const Atom *otherAtom, std::vector< Point2D > &otherBondVecs) const
void getDrawTransformers(Point2D &trans, Point2D &scale, Point2D &toCentre) const
OrientType calcRadicalRect(const Atom *atom, StringRect &rad_rect) const
void makeZeroBond(Bond *bond, const std::pair< DrawColour, DrawColour > &cols, const DashPattern &dashPattern)
void makeHighlightEnd(const Atom *end1, const Atom *end2, double lineWidth, const std::vector< Atom * > &end1HighNbrs, std::vector< Point2D > &points)
std::vector< std::unique_ptr< DrawShape > > bonds_
void makeBondHighlightLines(double lineWidth, double scale)
int doesNoteClash(const DrawAnnotation &annot) const
void extractAtomSymbols()
void calcAnnotationPosition(const Atom *atom, DrawAnnotation &annot) const
void calcAnnotationPosition(const Bond *bond, DrawAnnotation &annot) const
Point2D getDrawCoords(int atnum) const
OrientType getAtomOrientation(const Atom &atom) const
Point2D getDrawCoords(const Point2D &atCds, const Point2D &trans, const Point2D &scaleFactor, const Point2D &toCentre) const
void extractAll(double scale)
virtual void extractHighlights(double scale)
DrawMol(DrawMol &&)=delete
void adjustBondsOnSolidWedgeEnds()
void makeDoubleBondLines(Bond *bond, double doubleBondOffset, const std::pair< DrawColour, DrawColour > &cols)
double getFontScale() const
void adjustBondEndsForLabels(int begAtIdx, int endAtIdx, Point2D &begCds, Point2D &endCds) const
void initDrawMolecule(const ROMol &mol)
DrawMol(int width, int height, const MolDrawOptions &drawOptions, DrawText &textDrawer, double xmin, double xmax, double ymin, double ymax, double scale, double fontscale)
void makeWavyBond(Bond *bond, double offset, const std::pair< DrawColour, DrawColour > &cols)
void changeToDrawCoords()
MolDraw2D is the base class for doing 2D renderings of molecules.
RWMol is a molecule class that is intended to be edited.
Point2D calcPerpendicular(const Point2D &cds1, const Point2D &cds2)
Point2D calcInnerPerpendicular(const Point2D &cds1, const Point2D &cds2, const Point2D &cds3)
void findRectExtremes(const StringRect &rect, const TextAlignType &align, double &xmin, double &xmax, double &ymin, double &ymax)
bool isLinearAtom(const Atom &atom, const std::vector< Point2D > &atCds)
void findRadicalExtremes(const std::vector< std::tuple< StringRect, OrientType, int > > &radicals, double &xmin, double &xmax, double &ymin, double &ymax)
void centerMolForDrawing(RWMol &mol, int confId=1)
bool areBondsTrans(const Point2D &at1, const Point2D &at2, const Point2D &at3, const Point2D &at4)
const Atom * otherNeighbor(const Atom *firstAtom, const Atom *secondAtom, int nborNum, const ROMol &mol)
void adjustBondEndForString(const Point2D &end2, double padding, const std::vector< std::shared_ptr< StringRect > > &rects, Point2D &moveEnd)
bool areBondsParallel(const Point2D &at1, const Point2D &at2, const Point2D &at3, const Point2D &at4, double tol=1.0e-4)
DrawColour getColourByAtomicNum(int atomicNum, const MolDrawOptions &drawOptions)
double getHighlightBondWidth(const MolDrawOptions &drawOptions, int bond_idx, const std::map< int, int > *highlight_linewidth_multipliers)
DrawColour getHighlightBondColour(const Bond *bond, const MolDrawOptions &drawOptions, const std::vector< int > &highlightBonds, const std::map< int, DrawColour > &highlightBondMap, const std::vector< int > &highlightAtoms, const std::map< int, DrawColour > &highlightAtomMap)
void getBondHighlightsForAtoms(const ROMol &mol, const std::vector< int > &highlight_atoms, std::vector< int > &highlight_bonds)
std::string getAtomListText(const Atom &atom)
std::vector< double > DashPattern
bool rdvalue_is(const RDValue_cast_t)