RDKit: DrawTextQt.h Source File

| RDKit Open-source cheminformatics and machine learning.

Loading...
Searching...
No Matches
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>
14#include <GraphMol/MolDraw2D/DrawTextNotFT.h>
15
16class QPainter;
17
18namespace RDKit {
19
20namespace MolDraw2D_detail {
21
22// ****************************************************************************
23 class RDKIT_MOLDRAW2DQT_EXPORT DrawTextQt : public DrawTextNotFT {
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 void drawChar(char c, const Point2D &cds) override;
32
33 private:
34 QPainter *d_qp;
35
36 // return a vector of StringRects, one for each char in text, with
37 // super- and subscripts taken into account. Sizes in pixel coords,
38 // i.e. scaled by fontScale().
39 void getStringRects(const std::string &text,
40 std::vector<std::shared_ptr<StringRect>> &rects,
41 std::vector<TextDrawType> &draw_modes,
42 std::vector<char> &draw_chars) const override;
43};
44
45} // namespace MolDraw2D_detail
46} // namespace RDKit
47#endif // RDKIT_DRAWTEXTQT_H
DrawTextNotFT.h
RDGeom::Point2D
Definition point.h:284
RDKit::MolDraw2D_detail::DrawTextNotFT::DrawTextNotFT
DrawTextNotFT(double max_fnt_sz, double min_fnt_sz)
RDKit::MolDraw2D_detail::DrawTextQt::drawChar
void drawChar(char c, const Point2D &cds) override
RDKit::MolDraw2D_detail::DrawTextQt::operator=
DrawTextQt & operator=(DrawTextQt &&rhs)=delete
RDKit::MolDraw2D_detail::DrawTextQt::operator=
DrawTextQt & operator=(const DrawTextQt &rhs)=delete
RDKit::MolDraw2D_detail::DrawTextQt::DrawTextQt
DrawTextQt(double max_fnt_sz, double min_fnt_sz, QPainter *qp)
RDKit::MolDraw2D_detail::DrawTextQt::DrawTextQt
DrawTextQt(const DrawTextQt &rhs)=delete
RDKit::MolDraw2D_detail::DrawTextQt::DrawTextQt
DrawTextQt(DrawTextQt &&rhs)=delete
export.h
RDKIT_MOLDRAW2DQT_EXPORT
#define RDKIT_MOLDRAW2DQT_EXPORT
Definition export.h:321
RDKit::MolDraw2D_detail
Definition AtomSymbol.h:30
RDKit
Std stuff.
Definition Abbreviations.h:19