RDKit
Open-source cheminformatics and machine learning.
RDKit::MolDraw2D Class Referenceabstract

#include <MolDraw2D.h>

Inheritance diagram for RDKit::MolDraw2D:
RDKit::MolDraw2DCairo RDKit::MolDraw2DQt RDKit::MolDraw2DSVG RDKit::MolDraw2Dwx

Public Types

enum  OrientType {
  C = 0, N, E, S,
  W
}
 
enum  TextDrawType { TextDrawNormal = 0, TextDrawSuperscript, TextDrawSubscript }
 

Public Member Functions

 MolDraw2D (int width, int height, int panelWidth=-1, int panelHeight=-1)
 
virtual ~MolDraw2D ()
 
virtual void drawMolecule (const ROMol &mol, const std::vector< int > *highlight_atoms=NULL, const std::map< int, DrawColour > *highlight_map=NULL, const std::map< int, double > *highlight_radii=NULL, int confId=-1)
 
virtual void drawMolecule (const ROMol &mol, const std::string &legend, const std::vector< int > *highlight_atoms=NULL, const std::map< int, DrawColour > *highlight_map=NULL, const std::map< int, double > *highlight_radii=NULL, int confId=-1)
 
virtual void drawMolecule (const ROMol &mol, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map=NULL, const std::map< int, DrawColour > *highlight_bond_map=NULL, const std::map< int, double > *highlight_radii=NULL, int confId=-1)
 
virtual void drawMolecule (const ROMol &mol, const std::string &legend, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map=NULL, const std::map< int, DrawColour > *highlight_bond_map=NULL, const std::map< int, double > *highlight_radii=NULL, int confId=-1)
 
virtual void drawMolecules (const std::vector< ROMol * > &mols, const std::vector< std::string > *legends=NULL, const std::vector< std::vector< int > > *highlight_atoms=NULL, const std::vector< std::vector< int > > *highlight_bonds=NULL, const std::vector< std::map< int, DrawColour > > *highlight_atom_maps=NULL, const std::vector< std::map< int, DrawColour > > *highlight_bond_maps=NULL, const std::vector< std::map< int, double > > *highlight_radii=NULL, const std::vector< int > *confIds=NULL)
 
virtual Point2D getDrawCoords (const Point2D &mol_cds) const
 
virtual Point2D getDrawCoords (int at_num) const
 
virtual Point2D getAtomCoords (const std::pair< int, int > &screen_cds) const
 
virtual Point2D getAtomCoords (const std::pair< double, double > &screen_cds) const
 
virtual Point2D getAtomCoords (int at_num) const
 
virtual int width () const
 
virtual int height () const
 
virtual int panelWidth () const
 
virtual int panelHeight () const
 
double scale () const
 
void calculateScale (int width, int height)
 
void calculateScale ()
 
void setScale (int width, int height, const Point2D &minv, const Point2D &maxv)
 
void setOffset (int x, int y)
 
Point2D offset ()
 
virtual double fontSize () const
 
virtual void setFontSize (double new_size)
 
virtual void setColour (const DrawColour &col)
 
virtual DrawColour colour () const
 
virtual void setDash (const DashPattern &patt)
 
virtual const DashPatterndash () const
 
virtual void setLineWidth (int width)
 
virtual int lineWidth () const
 
bool setStringDrawMode (const std::string &instring, TextDrawType &draw_mode, int &i) const
 
virtual void clearDrawing ()=0
 
virtual void drawLine (const Point2D &cds1, const Point2D &cds2)=0
 
virtual void getStringSize (const std::string &label, double &label_width, double &label_height) const =0
 
virtual void drawString (const std::string &str, const Point2D &cds)
 
virtual void drawPolygon (const std::vector< Point2D > &cds)=0
 
virtual void drawTriangle (const Point2D &cds1, const Point2D &cds2, const Point2D &cds3)
 
virtual void drawEllipse (const Point2D &cds1, const Point2D &cds2)
 
virtual void drawRect (const Point2D &cds1, const Point2D &cds2)
 
virtual void drawAttachmentLine (const Point2D &cds1, const Point2D &cds2, const DrawColour &col, double len=1.0, unsigned int nSegments=16)
 
virtual void drawWavyLine (const Point2D &cds1, const Point2D &cds2, const DrawColour &col1, const DrawColour &col2, unsigned int nSegments=16, double vertOffset=0.05)
 
virtual void tagAtoms (const ROMol &mol)
 
virtual bool fillPolys () const
 
virtual void setFillPolys (bool val)
 
MolDrawOptionsdrawOptions ()
 
const MolDrawOptionsdrawOptions () const
 
const std::vector< Point2D > & atomCoords () const
 
const std::vector< std::pair< std::string, OrientType > > & atomSyms () const
 

Protected Member Functions

virtual void doContinuousHighlighting (const ROMol &mol, const std::vector< int > *highlight_atoms, const std::vector< int > *highlight_bonds, const std::map< int, DrawColour > *highlight_atom_map, const std::map< int, DrawColour > *highlight_bond_map, const std::map< int, double > *highlight_radii)
 
virtual void highlightCloseContacts ()
 
Point2D calcPerpendicular (const Point2D &cds1, const Point2D &cds2)
 

Detailed Description

Definition at line 84 of file MolDraw2D.h.

Member Enumeration Documentation

Enumerator

Definition at line 86 of file MolDraw2D.h.

Enumerator
TextDrawNormal 
TextDrawSuperscript 
TextDrawSubscript 

Definition at line 87 of file MolDraw2D.h.

Constructor & Destructor Documentation

RDKit::MolDraw2D::MolDraw2D ( int  width,
int  height,
int  panelWidth = -1,
int  panelHeight = -1 
)
virtual RDKit::MolDraw2D::~MolDraw2D ( )
inlinevirtual

Definition at line 95 of file MolDraw2D.h.

Member Function Documentation

const std::vector<Point2D>& RDKit::MolDraw2D::atomCoords ( ) const
inline

Definition at line 220 of file MolDraw2D.h.

References PRECONDITION.

const std::vector<std::pair<std::string, OrientType> >& RDKit::MolDraw2D::atomSyms ( ) const
inline
Point2D RDKit::MolDraw2D::calcPerpendicular ( const Point2D cds1,
const Point2D cds2 
)
protected
void RDKit::MolDraw2D::calculateScale ( int  width,
int  height 
)
void RDKit::MolDraw2D::calculateScale ( )
inline

Definition at line 154 of file MolDraw2D.h.

References calculateScale().

Referenced by calculateScale().

virtual void RDKit::MolDraw2D::clearDrawing ( )
pure virtual
virtual DrawColour RDKit::MolDraw2D::colour ( ) const
inlinevirtual

Definition at line 169 of file MolDraw2D.h.

Referenced by RDKit::MolDraw2Dwx::setColour().

virtual const DashPattern& RDKit::MolDraw2D::dash ( ) const
inlinevirtual

Definition at line 172 of file MolDraw2D.h.

virtual void RDKit::MolDraw2D::doContinuousHighlighting ( const ROMol mol,
const std::vector< int > *  highlight_atoms,
const std::vector< int > *  highlight_bonds,
const std::map< int, DrawColour > *  highlight_atom_map,
const std::map< int, DrawColour > *  highlight_bond_map,
const std::map< int, double > *  highlight_radii 
)
protectedvirtual
virtual void RDKit::MolDraw2D::drawAttachmentLine ( const Point2D cds1,
const Point2D cds2,
const DrawColour col,
double  len = 1.0,
unsigned int  nSegments = 16 
)
virtual
virtual void RDKit::MolDraw2D::drawEllipse ( const Point2D cds1,
const Point2D cds2 
)
virtual

Reimplemented in RDKit::MolDraw2DSVG.

virtual void RDKit::MolDraw2D::drawLine ( const Point2D cds1,
const Point2D cds2 
)
pure virtual
virtual void RDKit::MolDraw2D::drawMolecule ( const ROMol mol,
const std::vector< int > *  highlight_atoms = NULL,
const std::map< int, DrawColour > *  highlight_map = NULL,
const std::map< int, double > *  highlight_radii = NULL,
int  confId = -1 
)
virtual
virtual void RDKit::MolDraw2D::drawMolecule ( const ROMol mol,
const std::string &  legend,
const std::vector< int > *  highlight_atoms = NULL,
const std::map< int, DrawColour > *  highlight_map = NULL,
const std::map< int, double > *  highlight_radii = NULL,
int  confId = -1 
)
virtual
virtual void RDKit::MolDraw2D::drawMolecule ( const ROMol mol,
const std::vector< int > *  highlight_atoms,
const std::vector< int > *  highlight_bonds,
const std::map< int, DrawColour > *  highlight_atom_map = NULL,
const std::map< int, DrawColour > *  highlight_bond_map = NULL,
const std::map< int, double > *  highlight_radii = NULL,
int  confId = -1 
)
virtual
virtual void RDKit::MolDraw2D::drawMolecule ( const ROMol mol,
const std::string &  legend,
const std::vector< int > *  highlight_atoms,
const std::vector< int > *  highlight_bonds,
const std::map< int, DrawColour > *  highlight_atom_map = NULL,
const std::map< int, DrawColour > *  highlight_bond_map = NULL,
const std::map< int, double > *  highlight_radii = NULL,
int  confId = -1 
)
virtual
virtual void RDKit::MolDraw2D::drawMolecules ( const std::vector< ROMol * > &  mols,
const std::vector< std::string > *  legends = NULL,
const std::vector< std::vector< int > > *  highlight_atoms = NULL,
const std::vector< std::vector< int > > *  highlight_bonds = NULL,
const std::vector< std::map< int, DrawColour > > *  highlight_atom_maps = NULL,
const std::vector< std::map< int, DrawColour > > *  highlight_bond_maps = NULL,
const std::vector< std::map< int, double > > *  highlight_radii = NULL,
const std::vector< int > *  confIds = NULL 
)
virtual
MolDrawOptions& RDKit::MolDraw2D::drawOptions ( )
inline

Definition at line 217 of file MolDraw2D.h.

Referenced by RDKit::MolDraw2Dwx::clearDrawing().

const MolDrawOptions& RDKit::MolDraw2D::drawOptions ( ) const
inline

Definition at line 218 of file MolDraw2D.h.

virtual void RDKit::MolDraw2D::drawPolygon ( const std::vector< Point2D > &  cds)
pure virtual
virtual void RDKit::MolDraw2D::drawRect ( const Point2D cds1,
const Point2D cds2 
)
virtual
virtual void RDKit::MolDraw2D::drawString ( const std::string &  str,
const Point2D cds 
)
virtual

Reimplemented in RDKit::MolDraw2DSVG.

virtual void RDKit::MolDraw2D::drawTriangle ( const Point2D cds1,
const Point2D cds2,
const Point2D cds3 
)
virtual
virtual void RDKit::MolDraw2D::drawWavyLine ( const Point2D cds1,
const Point2D cds2,
const DrawColour col1,
const DrawColour col2,
unsigned int  nSegments = 16,
double  vertOffset = 0.05 
)
virtual
virtual bool RDKit::MolDraw2D::fillPolys ( ) const
inlinevirtual

Definition at line 214 of file MolDraw2D.h.

virtual double RDKit::MolDraw2D::fontSize ( ) const
inlinevirtual

Definition at line 163 of file MolDraw2D.h.

Referenced by RDKit::MolDraw2Dwx::setFontSize().

virtual Point2D RDKit::MolDraw2D::getAtomCoords ( const std::pair< int, int > &  screen_cds) const
virtual
virtual Point2D RDKit::MolDraw2D::getAtomCoords ( const std::pair< double, double > &  screen_cds) const
virtual
virtual Point2D RDKit::MolDraw2D::getAtomCoords ( int  at_num) const
virtual
virtual Point2D RDKit::MolDraw2D::getDrawCoords ( const Point2D mol_cds) const
virtual
virtual Point2D RDKit::MolDraw2D::getDrawCoords ( int  at_num) const
virtual
virtual void RDKit::MolDraw2D::getStringSize ( const std::string &  label,
double &  label_width,
double &  label_height 
) const
pure virtual
virtual int RDKit::MolDraw2D::height ( ) const
inlinevirtual
virtual void RDKit::MolDraw2D::highlightCloseContacts ( )
protectedvirtual
virtual int RDKit::MolDraw2D::lineWidth ( ) const
inlinevirtual

Definition at line 175 of file MolDraw2D.h.

References RDKit::Drawing::detail::drawLine().

Point2D RDKit::MolDraw2D::offset ( )
inline

Definition at line 161 of file MolDraw2D.h.

virtual int RDKit::MolDraw2D::panelHeight ( ) const
inlinevirtual

Definition at line 150 of file MolDraw2D.h.

virtual int RDKit::MolDraw2D::panelWidth ( ) const
inlinevirtual

Definition at line 149 of file MolDraw2D.h.

double RDKit::MolDraw2D::scale ( ) const
inline
virtual void RDKit::MolDraw2D::setColour ( const DrawColour col)
inlinevirtual
virtual void RDKit::MolDraw2D::setDash ( const DashPattern patt)
inlinevirtual

Definition at line 171 of file MolDraw2D.h.

virtual void RDKit::MolDraw2D::setFillPolys ( bool  val)
inlinevirtual

Definition at line 215 of file MolDraw2D.h.

virtual void RDKit::MolDraw2D::setFontSize ( double  new_size)
virtual
virtual void RDKit::MolDraw2D::setLineWidth ( int  width)
inlinevirtual

Definition at line 174 of file MolDraw2D.h.

void RDKit::MolDraw2D::setOffset ( int  x,
int  y 
)
inline

Definition at line 157 of file MolDraw2D.h.

void RDKit::MolDraw2D::setScale ( int  width,
int  height,
const Point2D minv,
const Point2D maxv 
)
bool RDKit::MolDraw2D::setStringDrawMode ( const std::string &  instring,
TextDrawType draw_mode,
int &  i 
) const
virtual void RDKit::MolDraw2D::tagAtoms ( const ROMol mol)
inlinevirtual

Reimplemented in RDKit::MolDraw2DSVG.

Definition at line 212 of file MolDraw2D.h.

References RDUNUSED_PARAM.

virtual int RDKit::MolDraw2D::width ( ) const
inlinevirtual

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