RDKit
Open-source cheminformatics and machine learning.
DrawTextQt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2020 Greg Landrum and T5 Informatics GmbH
3 // @@ All Rights Reserved @@
4 // This file is part of the RDKit.
5 // The contents are covered by the terms of the BSD license
6 // which is included in the file license.txt, found at the root
7 // of the RDKit source tree.
8 //
9 
10 #ifndef RDKIT_DRAWTEXTQT_H
11 #define RDKIT_DRAWTEXTQT_H
12 
13 #include <RDGeneral/export.h>
15 
16 class QPainter;
17 
18 namespace RDKit {
19 
20 namespace MolDraw2D_detail {
21 
22 // ****************************************************************************
24  public:
25  DrawTextQt(double max_fnt_sz, double min_fnt_sz, QPainter *qp);
26  DrawTextQt(const DrawTextQt &rhs) = delete;
27  DrawTextQt(DrawTextQt &&rhs) = delete;
28  DrawTextQt &operator=(const DrawTextQt &rhs) = delete;
29  DrawTextQt &operator=(DrawTextQt &&rhs) = delete;
30 
31 #if 0
32  void getStringSize(const std::string &label, double &label_width,
33  double &label_height) const override;
34 #endif
35  void drawChar(char c, const Point2D &cds) override;
36 
37  private:
38  QPainter *d_qp;
39 
40  // return a vector of StringRects, one for each char in text, with
41  // super- and subscripts taken into account. Sizes in pixel coords,
42  // i.e. scaled by fontScale().
43  void getStringRects(const std::string &text,
44  std::vector<std::shared_ptr<StringRect>> &rects,
45  std::vector<TextDrawType> &draw_modes,
46  std::vector<char> &draw_chars) const override;
47 };
48 
49 } // namespace MolDraw2D_detail
50 } // namespace RDKit
51 #endif // RDKIT_DRAWTEXTQT_H
void drawChar(char c, const Point2D &cds) override
DrawTextQt & operator=(const DrawTextQt &rhs)=delete
DrawTextQt & operator=(DrawTextQt &&rhs)=delete
DrawTextQt(double max_fnt_sz, double min_fnt_sz, QPainter *qp)
DrawTextQt(const DrawTextQt &rhs)=delete
DrawTextQt(DrawTextQt &&rhs)=delete
#define RDKIT_MOLDRAW2DQT_EXPORT
Definition: export.h:281
Std stuff.
Definition: Abbreviations.h:18