RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDKit::MolDraw2D_detail::DrawMolMCH Class Referenceabstract

#include <DrawMolMCH.h>

Inheritance diagram for RDKit::MolDraw2D_detail::DrawMolMCH:
RDKit::MolDraw2D_detail::DrawMol RDKit::MolDraw2D_detail::DrawMolMCHCircleAndLine RDKit::MolDraw2D_detail::DrawMolMCHLasso

Public Member Functions

 DrawMolMCH (const ROMol &mol, const std::string &legend, int width, int height, MolDrawOptions &drawOptions, DrawText &textDrawer, const std::map< int, std::vector< DrawColour > > &highlight_atom_map, const std::map< int, std::vector< DrawColour > > &highlight_bond_map, const std::map< int, double > &highlight_radii, const std::map< int, int > &highlight_linewidth_multipliers, int confId=-1)
 
 DrawMolMCH (const DrawMol &)=delete
 
 DrawMolMCH (DrawMol &&)=delete
 
DrawMolMCHoperator= (const DrawMol &)=delete
 
DrawMolMCHoperator= (DrawMol &&)=delete
 
void extractHighlights (double scale) override
 
virtual void extractMCHighlights ()=0
 
void getAtomRadius (unsigned int atomIdx, double &xradius, double &yradius) const
 
- Public Member Functions inherited from RDKit::MolDraw2D_detail::DrawMol
virtual ~DrawMol ()=default
 
 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 (int width, int height, const MolDrawOptions &drawOptions, DrawText &textDrawer, double xmin, double xmax, double ymin, double ymax, double scale, double fontscale)
 
 DrawMol (const DrawMol &)=delete
 
 DrawMol (DrawMol &&)=delete
 
DrawMoloperator= (const DrawMol &)=delete
 
DrawMoloperator= (DrawMol &&)=delete
 
void createDrawObjects ()
 
void finishCreateDrawObjects ()
 
void initDrawMolecule (const ROMol &mol)
 
void extractAll (double scale)
 
void extractAtomCoords ()
 
void extractAtomSymbols ()
 
void extractBonds ()
 
void extractRegions ()
 
void extractAttachments ()
 
void extractMolNotes ()
 
void extractStereoGroups ()
 
void extractAtomNotes ()
 
void extractBondNotes ()
 
void extractRadicals ()
 
void extractSGroupData ()
 
void extractVariableBonds ()
 
void extractBrackets ()
 
void extractLinkNodes ()
 
void extractCloseContacts ()
 
void calculateScale ()
 
void findExtremes ()
 
void changeToDrawCoords ()
 
void draw (MolDraw2D &drawer) const
 
void drawRadicals (MolDraw2D &drawer) const
 
void resetEverything ()
 
void shrinkToFit (bool withPadding=true)
 
std::pair< std::string, OrientTypegetAtomSymbolAndOrientation (const Atom &atom) const
 
std::string getAtomSymbol (const Atom &atom, OrientType orientation) const
 
OrientType getAtomOrientation (const Atom &atom) const
 
void partitionForLegend ()
 
void extractLegend ()
 
void calcMeanBondLength ()
 
void makeStandardBond (Bond *bond, double doubleBondOffset)
 
void makeQueryBond (Bond *bond, double doubleBondOffset)
 
void makeDoubleBondLines (Bond *bond, double doubleBondOffset, const std::pair< DrawColour, DrawColour > &cols)
 
void makeTripleBondLines (Bond *bond, double doubleBondOffset, const std::pair< DrawColour, DrawColour > &cols)
 
void makeWedgedBond (Bond *bond, const std::pair< DrawColour, DrawColour > &cols)
 
void makeWavyBond (Bond *bond, double offset, const std::pair< DrawColour, DrawColour > &cols)
 
void makeDativeBond (Bond *bond, double offset, const std::pair< DrawColour, DrawColour > &cols)
 
void makeZeroBond (Bond *bond, const std::pair< DrawColour, DrawColour > &cols, const DashPattern &dashPattern)
 
void adjustBondEndsForLabels (int begAtIdx, int endAtIdx, Point2D &begCds, Point2D &endCds) const
 
void newBondLine (const Point2D &pt1, const Point2D &pt2, const DrawColour &col1, const DrawColour &col2, int atom1Idx, int atom2Idx, int bondIdx, const DashPattern &dashPattern)
 
std::pair< DrawColour, DrawColourgetBondColours (Bond *bond)
 
void makeContinuousHighlights (double scale)
 
void makeAtomCircleHighlights ()
 
void makeAtomEllipseHighlights (double lineWidth)
 
void makeBondHighlightLines (double lineWidth, double scale)
 
void calcAnnotationPosition (const Atom *atom, DrawAnnotation &annot) const
 
void calcAnnotationPosition (const Bond *bond, DrawAnnotation &annot) const
 
double getNoteStartAngle (const Atom *atom) const
 
int doesNoteClash (const DrawAnnotation &annot) const
 
int doesRectClash (const StringRect &rect, double padding) const
 
OrientType calcRadicalRect (const Atom *atom, StringRect &rad_rect) const
 
void getDrawTransformers (Point2D &trans, Point2D &scale, Point2D &toCentre) const
 
Point2D getDrawCoords (const Point2D &atCds, const Point2D &trans, const Point2D &scaleFactor, const Point2D &toCentre) const
 
Point2D getDrawCoords (const Point2D &atCds) const
 
Point2D getDrawCoords (int atnum) const
 
Point2D getAtomCoords (const Point2D &screenCds) const
 
Point2D getAtomCoords (int atnum) const
 
double getScale () const
 
double getFontScale () const
 
void setScale (double newScale, double newFontScale, bool ignoreFontLimits=true)
 
void setTransformation (const DrawMol &sourceMol)
 
void setOffsets (double xOffset, double yOffset)
 
void tagAtomsWithCoords ()
 
void transformAll (const Point2D *trans=nullptr, Point2D *scale=nullptr, const Point2D *toCentre=nullptr)
 
Point2D transformPoint (const Point2D &pt, const Point2D *trans=nullptr, Point2D *scale=nullptr, const Point2D *toCentre=nullptr) const
 
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
 
void bondNonRing (const Bond &bond, double offset, Point2D &l2s, Point2D &l2f) const
 
void doubleBondTerminal (Atom *at1, Atom *at2, double offset, Point2D &l1s, Point2D &l1f, Point2D &l2s, Point2D &l2f) const
 
Point2D doubleBondEnd (unsigned int at1, unsigned int at2, unsigned int at3, double offset, bool trunc) const
 
void calcTripleBondLines (double offset, const Bond &bond, Point2D &l1s, Point2D &l1f, Point2D &l2s, Point2D &l2f)
 
void findOtherBondVecs (const Atom *atom, const Atom *otherAtom, std::vector< Point2D > &otherBondVecs) const
 
void adjustBondsOnSolidWedgeEnds ()
 
void smoothBondJoins ()
 
void makeHighlightEnd (const Atom *end1, const Atom *end2, double lineWidth, const std::vector< Atom * > &end1HighNbrs, std::vector< Point2D > &points)
 
DrawColour getColour (int atom_idx) const
 

Public Attributes

const std::map< int, std::vector< DrawColour > > & mcHighlightAtomMap_
 
const std::map< int, std::vector< DrawColour > > & mcHighlightBondMap_
 
const std::map< int, int > & highlightLinewidthMultipliers_
 
- Public Attributes inherited from RDKit::MolDraw2D_detail::DrawMol
const MolDrawOptionsdrawOptions_
 
DrawTexttextDrawer_
 
double marginPadding_
 
std::vector< inthighlightAtoms_
 
std::vector< inthighlightBonds_
 
std::map< int, DrawColourhighlightAtomMap_
 
std::map< int, DrawColourhighlightBondMap_
 
std::vector< std::pair< DrawColour, DrawColour > > bondColours_
 
std::map< int, doublehighlightRadii_
 
bool includeAnnotations_
 
bool isReactionMol_
 
std::string legend_
 
std::unique_ptr< RWMoldrawMol_
 
int confId_
 
std::vector< Point2DatCds_
 
std::vector< std::unique_ptr< DrawShape > > bonds_
 
std::vector< std::unique_ptr< DrawShape > > preShapes_
 
std::vector< std::unique_ptr< DrawShape > > postShapes_
 
std::vector< intatomicNums_
 
std::vector< std::pair< std::string, OrientType > > atomSyms_
 
std::vector< std::unique_ptr< AtomSymbol > > atomLabels_
 
std::vector< std::unique_ptr< DrawShape > > highlights_
 
std::vector< std::unique_ptr< DrawAnnotation > > annotations_
 
std::vector< std::unique_ptr< DrawAnnotation > > legends_
 
std::vector< std::tuple< StringRect, OrientType, int > > radicals_
 
std::vector< intsingleBondLines_
 
int width_
 
int height_
 
int drawWidth_
 
int drawHeight_
 
double scale_
 
double fontScale_
 
double xMin_
 
double yMin_
 
double xMax_
 
double yMax_
 
double xRange_
 
double yRange_
 
double xOffset_ = 0.0
 
double yOffset_ = 0.0
 
double meanBondLength_ = 0.0
 
int molHeight_
 
int legendHeight_ = 0
 
bool drawingInitialised_ = false
 
int activeAtmIdxOffset_ = 0
 
int activeBndIdxOffset_ = 0
 
bool flexiCanvasX_ = false
 
bool flexiCanvasY_ = false
 

Detailed Description

Definition at line 25 of file DrawMolMCH.h.

Constructor & Destructor Documentation

◆ DrawMolMCH() [1/3]

RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH ( const ROMol mol,
const std::string &  legend,
int  width,
int  height,
MolDrawOptions drawOptions,
DrawText textDrawer,
const std::map< int, std::vector< DrawColour > > &  highlight_atom_map,
const std::map< int, std::vector< DrawColour > > &  highlight_bond_map,
const std::map< int, double > &  highlight_radii,
const std::map< int, int > &  highlight_linewidth_multipliers,
int  confId = -1 
)

Make a DrawMol that does multi-coloured highlights. Both atoms and bonds can have more than 1 highlight. There's no maximum although more than 4 is very cluttered.

Parameters
mol: the molecule to draw
legend: the legend (to be drawn under the molecule)
width: width (in pixels) of the rendering set this to -1 to have the canvas size set automatically
height: height (in pixels) of the rendering set this to -1 to have the canvas size set automatically
drawOptions: a MolDrawOptions object from the owning MolDraw2D
textDrawer: a DrawText object from the owning MolDraw2D
highlight_atom_map: indexed on atom idx, the colours to be used to highlight atoms. Not all atoms need to be mentioned.
highlight_bond_map: indexed on bond idx, the colours to be used to highlight bonds. Not all bonds need to be mentioned.
highlightRadii: map from atomId -> radius (in molecule coordinates) for the radii of atomic highlights. If not provided for an atom, the default value from drawOptions() will be used.
highlight_linewidth_multipliers: map from bondId -> int, to change the thickness of the lines used for the highlighting.
confId: (optional) conformer ID to be used for atomic coordinates

◆ DrawMolMCH() [2/3]

RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH ( const DrawMol )
delete

◆ DrawMolMCH() [3/3]

RDKit::MolDraw2D_detail::DrawMolMCH::DrawMolMCH ( DrawMol &&  )
delete

Member Function Documentation

◆ extractHighlights()

void RDKit::MolDraw2D_detail::DrawMolMCH::extractHighlights ( double  scale)
overridevirtual

◆ extractMCHighlights()

virtual void RDKit::MolDraw2D_detail::DrawMolMCH::extractMCHighlights ( )
pure virtual

◆ getAtomRadius()

void RDKit::MolDraw2D_detail::DrawMolMCH::getAtomRadius ( unsigned int  atomIdx,
double xradius,
double yradius 
) const

◆ operator=() [1/2]

DrawMolMCH & RDKit::MolDraw2D_detail::DrawMolMCH::operator= ( const DrawMol )
delete

◆ operator=() [2/2]

DrawMolMCH & RDKit::MolDraw2D_detail::DrawMolMCH::operator= ( DrawMol &&  )
delete

Member Data Documentation

◆ highlightLinewidthMultipliers_

const std::map<int, int>& RDKit::MolDraw2D_detail::DrawMolMCH::highlightLinewidthMultipliers_

Definition at line 70 of file DrawMolMCH.h.

◆ mcHighlightAtomMap_

const std::map<int, std::vector<DrawColour> >& RDKit::MolDraw2D_detail::DrawMolMCH::mcHighlightAtomMap_

Definition at line 68 of file DrawMolMCH.h.

◆ mcHighlightBondMap_

const std::map<int, std::vector<DrawColour> >& RDKit::MolDraw2D_detail::DrawMolMCH::mcHighlightBondMap_

Definition at line 69 of file DrawMolMCH.h.


The documentation for this class was generated from the following file: