RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
MolDraw2DSGroupData.h
Go to the documentation of this file.
1//
2// Copyright (C) 2026 Greg Landrum 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
11#include <RDGeneral/export.h>
12#ifndef RDKITMOLDRAW2DSGROUPDATA_H
13#define RDKITMOLDRAW2DSGROUPDATA_H
14
15#include <string>
16#include <vector>
17
18#include <Geometry/point.h>
19
20namespace RDKit {
21
22class ROMol;
23
24namespace MolDraw2D_detail {
25
26//! Holds the text and position of a DAT SGroup label.
28 std::string text; ///< label text
29 RDGeom::Point2D pos; ///< position in molecule coordinates
30 bool positioned; ///< true if pos came from FIELDDISP; false if pos is
31 ///< the associated atom's conformer position (fallback)
32 int atomIdx; ///< index of the associated atom (-1 if none)
33};
34
35//! Returns the text and positions of DAT SGroup labels for a molecule,
36//! using the same placement logic as the drawing code.
37/*!
38 \param mol the molecule
39 \param rotate optional rotation angle in degrees (default 0.0)
40 \return a vector of SGroupDataLabel objects, one per rendered DAT SGroup
41*/
42RDKIT_MOLDRAW2D_EXPORT std::vector<SGroupDataLabel> getSGroupDataLabels(
43 const ROMol &mol, double rotate = 0.0);
44
45} // namespace MolDraw2D_detail
46} // namespace RDKit
47
48#endif
#define RDKIT_MOLDRAW2D_EXPORT
Definition export.h:401
RDKIT_MOLDRAW2D_EXPORT std::vector< SGroupDataLabel > getSGroupDataLabels(const ROMol &mol, double rotate=0.0)
Std stuff.
Holds the text and position of a DAT SGroup label.
int atomIdx
index of the associated atom (-1 if none)
RDGeom::Point2D pos
position in molecule coordinates