Loading...
Searching...
No Matches
Flippers.h
Go to the documentation of this file.
//
// Copyright (C) David Cosgrove 2025.
//
// @@ 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.
//
#ifndef FLIPPERS_H
#define FLIPPERS_H
#include <RDGeneral/export.h>
#include <GraphMol/Atom.h>
#include <GraphMol/Bond.h>
#include <GraphMol/Chirality.h>
#include <GraphMol/StereoGroup.h>
namespace RDKit {
namespace EnumerateStereoisomers {
namespace details {
// The classes are called Flipper because that's what they were
// called in the Python, but in fact they set a particular
// stereochemistry at a centre according to whether a bool is
// true or not. Setters would be a more accurate name.
struct RDKIT_ENUMERATESTEREOISOMERS_EXPORT Flipper {
public:
Flipper() = default;
Flipper(const Flipper &other) = delete;
Flipper(Flipper &&other) = delete;
Flipper &operator=(const Flipper &other) = delete;
Flipper &operator=(Flipper &&other) = delete;
virtual ~Flipper() = default;
// Sets the stereo at the centre, one way if flag is true,
// the other way if it is false.
virtual void flip(bool flag) = 0;
};
struct RDKIT_ENUMERATESTEREOISOMERS_EXPORT AtomFlipper : public Flipper {
public:
AtomFlipper() = delete;
AtomFlipper(RWMol &mol, const Chirality::StereoInfo &si);
AtomFlipper(const AtomFlipper &other) = delete;
AtomFlipper(AtomFlipper &&other) = delete;
AtomFlipper &operator=(const AtomFlipper &other) = delete;
AtomFlipper &operator=(AtomFlipper &&other) = delete;
~AtomFlipper() override = default;
void flip(bool flag) override;
Atom *dp_atom{nullptr};
};
struct RDKIT_ENUMERATESTEREOISOMERS_EXPORT BondFlipper : public Flipper {
public:
BondFlipper() = delete;
// This c'tor may leave dp_bond as a nullptr if the bond
// is not appropriate.
BondFlipper(RWMol &mol, const Chirality::StereoInfo &si);
BondFlipper(const BondFlipper &other) = delete;
BondFlipper(BondFlipper &&other) = delete;
BondFlipper &operator=(const BondFlipper &other) = delete;
BondFlipper &operator=(BondFlipper &&other) = delete;
~BondFlipper() override = default;
void flip(bool flag) override;
Bond *dp_bond{nullptr};
};
struct RDKIT_ENUMERATESTEREOISOMERS_EXPORT StereoGroupFlipper : public Flipper {
public:
StereoGroupFlipper() = delete;
StereoGroupFlipper(const StereoGroup &sg);
StereoGroupFlipper(const StereoGroupFlipper &other) = delete;
StereoGroupFlipper(StereoGroupFlipper &&other) = delete;
StereoGroupFlipper &operator=(const StereoGroupFlipper &other) = delete;
StereoGroupFlipper &operator=(StereoGroupFlipper &&other) = delete;
~StereoGroupFlipper() override = default;
void flip(bool flag) override;
std::vector<std::pair<Atom *, Atom::ChiralType>> d_original_parities;
};
struct RDKIT_ENUMERATESTEREOISOMERS_EXPORT AtropisomerFlipper : public Flipper {
public:
AtropisomerFlipper() = delete;
AtropisomerFlipper(RWMol &mol, const Chirality::StereoInfo &si);
AtropisomerFlipper(const AtropisomerFlipper &other) = delete;
AtropisomerFlipper(AtropisomerFlipper &&other) = delete;
AtropisomerFlipper &operator=(const AtropisomerFlipper &other) = delete;
AtropisomerFlipper &operator=(AtropisomerFlipper &&other) = delete;
~AtropisomerFlipper() override = default;
void flip(bool flag) override;
Bond *dp_bond{nullptr};
std::vector<unsigned int> d_ctrlAtoms;
};
} // namespace details
} // namespace EnumerateStereoisomers
} // namespace RDKit
#endif // FLIPPERS_H
Atom.h
Defines the Atom class and associated typedefs.
Bond.h
Chirality.h
StereoGroup.h
Defines the class StereoGroup which stores relationships between the absolute configurations of atoms...
RDKit::Atom
The class for representing atoms.
Definition Atom.h:75
RDKit::Bond
class for representing a bond
Definition Bond.h:47
RDKit::RWMol
RWMol is a molecule class that is intended to be edited.
Definition RWMol.h:32
RDKit::StereoGroup
Definition StereoGroup.h:44
export.h
RDKIT_ENUMERATESTEREOISOMERS_EXPORT
#define RDKIT_ENUMERATESTEREOISOMERS_EXPORT
Definition export.h:161
RDKit::EnumerateStereoisomers::details
Definition Flippers.h:22
RDKit::EnumerateStereoisomers
Definition EnumerateStereoisomers.h:30
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::Chirality::StereoInfo
Definition Chirality.h:117
RDKit::EnumerateStereoisomers::details::AtomFlipper::AtomFlipper
AtomFlipper(AtomFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::AtomFlipper::operator=
AtomFlipper & operator=(const AtomFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::AtomFlipper::operator=
AtomFlipper & operator=(AtomFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::AtomFlipper::~AtomFlipper
~AtomFlipper() override=default
RDKit::EnumerateStereoisomers::details::AtomFlipper::dp_atom
Atom * dp_atom
Definition Flippers.h:53
RDKit::EnumerateStereoisomers::details::AtomFlipper::AtomFlipper
AtomFlipper(const AtomFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::AtomFlipper::flip
void flip(bool flag) override
RDKit::EnumerateStereoisomers::details::AtomFlipper::AtomFlipper
AtomFlipper(RWMol &mol, const Chirality::StereoInfo &si)
RDKit::EnumerateStereoisomers::details::AtomFlipper::AtomFlipper
AtomFlipper()=delete
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::flip
void flip(bool flag) override
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::AtropisomerFlipper
AtropisomerFlipper(RWMol &mol, const Chirality::StereoInfo &si)
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::~AtropisomerFlipper
~AtropisomerFlipper() override=default
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::AtropisomerFlipper
AtropisomerFlipper(const AtropisomerFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::d_ctrlAtoms
std::vector< unsigned int > d_ctrlAtoms
Definition Flippers.h:101
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::dp_bond
Bond * dp_bond
Definition Flippers.h:100
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::AtropisomerFlipper
AtropisomerFlipper(AtropisomerFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::AtropisomerFlipper
AtropisomerFlipper()=delete
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::operator=
AtropisomerFlipper & operator=(AtropisomerFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::AtropisomerFlipper::operator=
AtropisomerFlipper & operator=(const AtropisomerFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::~BondFlipper
~BondFlipper() override=default
RDKit::EnumerateStereoisomers::details::BondFlipper::BondFlipper
BondFlipper()=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::flip
void flip(bool flag) override
RDKit::EnumerateStereoisomers::details::BondFlipper::BondFlipper
BondFlipper(BondFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::dp_bond
Bond * dp_bond
Definition Flippers.h:70
RDKit::EnumerateStereoisomers::details::BondFlipper::operator=
BondFlipper & operator=(BondFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::operator=
BondFlipper & operator=(const BondFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::BondFlipper
BondFlipper(const BondFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::BondFlipper::BondFlipper
BondFlipper(RWMol &mol, const Chirality::StereoInfo &si)
RDKit::EnumerateStereoisomers::details::Flipper::Flipper
Flipper()=default
RDKit::EnumerateStereoisomers::details::Flipper::operator=
Flipper & operator=(const Flipper &other)=delete
RDKit::EnumerateStereoisomers::details::Flipper::Flipper
Flipper(Flipper &&other)=delete
RDKit::EnumerateStereoisomers::details::Flipper::Flipper
Flipper(const Flipper &other)=delete
RDKit::EnumerateStereoisomers::details::Flipper::~Flipper
virtual ~Flipper()=default
RDKit::EnumerateStereoisomers::details::Flipper::flip
virtual void flip(bool flag)=0
RDKit::EnumerateStereoisomers::details::Flipper::operator=
Flipper & operator=(Flipper &&other)=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::StereoGroupFlipper
StereoGroupFlipper(const StereoGroup &sg)
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::d_original_parities
std::vector< std::pair< Atom *, Atom::ChiralType > > d_original_parities
Definition Flippers.h:85
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::operator=
StereoGroupFlipper & operator=(StereoGroupFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::operator=
StereoGroupFlipper & operator=(const StereoGroupFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::~StereoGroupFlipper
~StereoGroupFlipper() override=default
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::StereoGroupFlipper
StereoGroupFlipper()=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::StereoGroupFlipper
StereoGroupFlipper(StereoGroupFlipper &&other)=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::StereoGroupFlipper
StereoGroupFlipper(const StereoGroupFlipper &other)=delete
RDKit::EnumerateStereoisomers::details::StereoGroupFlipper::flip
void flip(bool flag) override