RDKit
Open-source cheminformatics and machine learning.
DrawTextSVG.h
Go to the documentation of this file.
1
//
2
// @@ All Rights Reserved @@
3
// This file is part of the RDKit.
4
// The contents are covered by the terms of the BSD license
5
// which is included in the file license.txt, found at the root
6
// of the RDKit source tree.
7
//
8
// Original author: David Cosgrove (CozChemIx) on 29/04/2020.
9
//
10
// A concrete class derived from DrawText that uses SVG
11
// to draw text onto a picture.
12
13
#ifndef RDKIT_DRAWTEXTSVG_H
14
#define RDKIT_DRAWTEXTSVG_H
15
16
#include <iosfwd>
17
18
#include <
GraphMol/MolDraw2D/DrawText.h
>
19
20
namespace
RDKit
{
21
22
// ****************************************************************************
23
24
class
DrawTextSVG
:
public
DrawText
{
25
public
:
26
DrawTextSVG
(
double
max_fnt_sz,
double
min_fnt_sz, std::ostream &oss,
27
std::string &d_act_class);
28
29
void
drawChar
(
char
c,
const
Point2D
&cds)
override
;
30
31
private
:
32
std::ostream &oss_;
33
std::string &d_active_class_;
34
35
// fills a vector of StringRects, one for each char in text, with
36
// super- and subscripts taken into account. Sizes in pixel coords,
37
// i.e. scaled by fontScale().
38
void
getStringRects(
const
std::string &text,
39
std::vector<std::shared_ptr<StringRect>> &rects,
40
std::vector<TextDrawType> &draw_modes,
41
std::vector<char> &draw_chars)
const override
;
42
};
43
44
}
// namespace RDKit
45
46
#endif
// RDKIT_DRAWTEXTSVG_H
DrawText.h
RDGeom::Point2D
Definition:
point.h:272
RDKit::DrawTextSVG
Definition:
DrawTextSVG.h:24
RDKit::DrawTextSVG::drawChar
void drawChar(char c, const Point2D &cds) override
RDKit::DrawTextSVG::DrawTextSVG
DrawTextSVG(double max_fnt_sz, double min_fnt_sz, std::ostream &oss, std::string &d_act_class)
RDKit::DrawText
Definition:
DrawText.h:38
RDKit
Std stuff.
Definition:
Abbreviations.h:18
GraphMol
MolDraw2D
DrawTextSVG.h
Generated on Sun Nov 28 2021 08:45:28 for RDKit by
1.9.1