RDKit: DrawTextSVG.h Source File

| RDKit Open-source cheminformatics and machine learning.

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