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

#include <DrawMolMCHLasso.h>

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

Public Member Functions

 DrawMolMCHLasso (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)
 
 DrawMolMCHLasso (const DrawMol &)=delete
 
 DrawMolMCHLasso (DrawMol &&)=delete
 
DrawMolMCHLassooperator= (const DrawMol &)=delete
 
DrawMolMCHLassooperator= (DrawMol &&)=delete
 
void extractHighlights (double scale) override
 
void extractMCHighlights () override
 
void extractAtomColourLists (std::vector< DrawColour > &colours, std::vector< std::vector< int > > &colourAtoms, std::vector< std::vector< int > > &colourLists) const
 
void drawLasso (size_t lassoNum, const DrawColour &col, const std::vector< int > &colAtoms)
 
void extractBondLines (size_t lassoNum, const DrawColour &col, const std::vector< int > &colAtoms, std::vector< std::unique_ptr< DrawShapeSimpleLine > > &lines, std::vector< std::vector< LinePair > > &atomLines) const
 
void extractAtomArcs (std::vector< std::vector< LinePair > > &atomLines, std::vector< std::unique_ptr< DrawShapeArc > > &arcs) const
 
void addNoLineArcs (const std::vector< int > &colAtoms, size_t lassoNum, const RDKit::DrawColour &col, const std::vector< std::unique_ptr< DrawShapeSimpleLine > > &lines, std::vector< std::unique_ptr< DrawShapeArc > > &arcs) const
 
void makeIntersectingArcs (const std::vector< std::vector< unsigned int > > &intersects, int lassoNum, const RDKit::DrawColour &col, std::vector< std::unique_ptr< DrawShapeArc > > &currArcs, std::vector< DrawShapeArc * > &arcs) const
 
void orderAtomLines (std::vector< std::vector< LinePair > > &atomLines) const
 
- Public Member Functions inherited from 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)
 
 DrawMolMCH (const DrawMol &)=delete
 
 DrawMolMCH (DrawMol &&)=delete
 
DrawMolMCHoperator= (const DrawMol &)=delete
 
DrawMolMCHoperator= (DrawMol &&)=delete
 
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 resolveAtomSymbolClashes ()
 
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
 

Additional Inherited Members

- Public Attributes inherited from RDKit::MolDraw2D_detail::DrawMolMCH
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 33 of file DrawMolMCHLasso.h.

Constructor & Destructor Documentation

◆ DrawMolMCHLasso() [1/3]

RDKit::MolDraw2D_detail::DrawMolMCHLasso::DrawMolMCHLasso ( 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: If this is empty, then the lassos will be between all bonded atoms in the highlight_atom_map, in the appropriate colours. If it is given, the lasso will be in more than one part if there is a bond between 2 highlighted atoms that isn't in the highlight_bond_map. The colours in highlight_bond_map will be NOT used for the lines between the atoms - the lasso will be one colour, taken from the atoms.
highlightRadii: ignored in this molecule representation.
highlight_linewidth_multipliers: ignored in this molecule representation.
confId: (optional) conformer ID to be used for atomic coordinates

◆ DrawMolMCHLasso() [2/3]

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

◆ DrawMolMCHLasso() [3/3]

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

Member Function Documentation

◆ addNoLineArcs()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::addNoLineArcs ( const std::vector< int > &  colAtoms,
size_t  lassoNum,
const RDKit::DrawColour col,
const std::vector< std::unique_ptr< DrawShapeSimpleLine > > &  lines,
std::vector< std::unique_ptr< DrawShapeArc > > &  arcs 
) const

◆ drawLasso()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::drawLasso ( size_t  lassoNum,
const DrawColour col,
const std::vector< int > &  colAtoms 
)

◆ extractAtomArcs()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::extractAtomArcs ( std::vector< std::vector< LinePair > > &  atomLines,
std::vector< std::unique_ptr< DrawShapeArc > > &  arcs 
) const

◆ extractAtomColourLists()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::extractAtomColourLists ( std::vector< DrawColour > &  colours,
std::vector< std::vector< int > > &  colourAtoms,
std::vector< std::vector< int > > &  colourLists 
) const

◆ extractBondLines()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::extractBondLines ( size_t  lassoNum,
const DrawColour col,
const std::vector< int > &  colAtoms,
std::vector< std::unique_ptr< DrawShapeSimpleLine > > &  lines,
std::vector< std::vector< LinePair > > &  atomLines 
) const

◆ extractHighlights()

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

◆ extractMCHighlights()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::extractMCHighlights ( )
overridevirtual

◆ makeIntersectingArcs()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::makeIntersectingArcs ( const std::vector< std::vector< unsigned int > > &  intersects,
int  lassoNum,
const RDKit::DrawColour col,
std::vector< std::unique_ptr< DrawShapeArc > > &  currArcs,
std::vector< DrawShapeArc * > &  arcs 
) const

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ orderAtomLines()

void RDKit::MolDraw2D_detail::DrawMolMCHLasso::orderAtomLines ( std::vector< std::vector< LinePair > > &  atomLines) const

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