-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMolDraw2DQt.H
53 lines (38 loc) · 1.41 KB
/
MolDraw2DQt.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// file MolDraw2DQt.H
// David Cosgrove
// AstraZeneca
// 19th June 2014
//
// This is a concrete class derived from MolDraw2D that uses RDKit to draw a
// molecule into a QPainter.
#ifndef MOLDRAW2DQT_H
#define MOLDRAW2DQT_H
#include "MolDraw2D.H"
class QPainter;
class QString;
// ****************************************************************************
namespace RDKit {
class MolDraw2DQt : public MolDraw2D {
public :
MolDraw2DQt( int width , int height , QPainter &qp );
// set font size in molecule coordinate units. That's probably Angstrom for
// RDKit. It will turned into drawing units using scale_, which might be
// changed as a result, to make sure things still appear in the window.
void setFontSize( float new_size );
void setColour( const DrawColour &col );
private :
QPainter &qp_;
void drawLine( const std::pair<float,float> &cds1 ,
const std::pair<float,float> &cds2 );
void drawChar( char c , const std::pair<float,float> &cds );
void drawTriangle( const std::pair<float,float> &cds1 ,
const std::pair<float,float> &cds2 ,
const std::pair<float,float> &cds3 );
void clearDrawing();
// using the current scale, work out the size of the label in molecule coordinates
void getStringSize( const std::string &label , float &label_width ,
float &label_height ) const;
};
}
#endif // MOLDRAW2DQT_H