StereoGroup.h
Go to the documentation of this file.
//
// Copyright (C) 2018 T5 Informatics GmbH
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
/*! \file StereoGroup.h
\brief Defines the class StereoGroup which stores relationships between
the absolute configurations of atoms within a structure.
*/
#include <RDGeneral/export.h>
#ifndef RD_StereoGroup_092018
#define RD_StereoGroup_092018
#include <vector>
namespace RDKit {
class Atom;
// OR means that it is known to be one or the other, but not both
// AND means that it is known to be a mix.
enum class StereoGroupType {
STEREO_ABSOLUTE = 0,
STEREO_OR = 1,
STEREO_AND = 2
};
//! StereoGroup is a collection of atoms with a known stereochemical
//! relationship
/*!
Used to help represent a sample with unknown stereochemistry, or that is a mix
of diastereomers.
*/
class RDKIT_GRAPHMOL_EXPORT StereoGroup {
private:
StereoGroupType d_grouptype{StereoGroupType::STEREO_ABSOLUTE};
std::vector<Atom*> d_atoms;
public:
StereoGroup() : d_atoms(0u) {}
// Takes control of atoms if possible.
StereoGroup(StereoGroupType grouptype, std::vector<Atom*>&& atoms);
StereoGroup(StereoGroupType grouptype, const std::vector<Atom*>& atoms);
StereoGroupType getGroupType() const;
const std::vector<Atom*>& getAtoms() const;
// Seems odd to have to define these, but otherwise the SWIG wrappers
// won't build
bool operator==(const StereoGroup& other) const {
return (d_grouptype == other.d_grouptype) && (d_atoms == other.d_atoms);
}
bool operator!=(const StereoGroup& other) const {
return (d_grouptype != other.d_grouptype) || (d_atoms != other.d_atoms);
}
};
RDKIT_GRAPHMOL_EXPORT void removeGroupsWithAtom(
const Atom* atom, std::vector<StereoGroup>& groups);
RDKIT_GRAPHMOL_EXPORT void removeGroupsWithAtoms(
const std::vector<Atom*>& atoms, std::vector<StereoGroup>& groups);
} // namespace RDKit
#endif
RDKit::Atom
The class for representing atoms.
Definition: Atom.h:68
RDKit::StereoGroup
Definition: StereoGroup.h:41
RDKit::StereoGroup::getAtoms
const std::vector< Atom * > & getAtoms() const
RDKit::StereoGroup::StereoGroup
StereoGroup(StereoGroupType grouptype, std::vector< Atom * > &&atoms)
RDKit::StereoGroup::getGroupType
StereoGroupType getGroupType() const
RDKit::StereoGroup::operator==
bool operator==(const StereoGroup &other) const
Definition: StereoGroup.h:55
RDKit::StereoGroup::StereoGroup
StereoGroup(StereoGroupType grouptype, const std::vector< Atom * > &atoms)
RDKit::StereoGroup::operator!=
bool operator!=(const StereoGroup &other) const
Definition: StereoGroup.h:58
RDKit::StereoGroup::StereoGroup
StereoGroup()
Definition: StereoGroup.h:47
export.h
RDKIT_GRAPHMOL_EXPORT
#define RDKIT_GRAPHMOL_EXPORT
Definition: export.h:209
RDKit
Std stuff.
Definition: Abbreviations.h:18
RDKit::StereoGroupType
StereoGroupType
Definition: StereoGroup.h:28
RDKit::StereoGroupType::STEREO_OR
@ STEREO_OR
RDKit::StereoGroupType::STEREO_AND
@ STEREO_AND
RDKit::StereoGroupType::STEREO_ABSOLUTE
@ STEREO_ABSOLUTE
RDKit::removeGroupsWithAtom
RDKIT_GRAPHMOL_EXPORT void removeGroupsWithAtom(const Atom *atom, std::vector< StereoGroup > &groups)
RDKit::removeGroupsWithAtoms
RDKIT_GRAPHMOL_EXPORT void removeGroupsWithAtoms(const std::vector< Atom * > &atoms, std::vector< StereoGroup > &groups)