Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
//
//
// Copyright (C) 2020 Schrödinger, LLC
//
// @@ 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.
//
#pragma once
#include <vector>
#include "Descriptor.h"
#include "Mancude.h"
#include "Edge.h"
namespace RDKit {
class Atom;
namespace CIPLabeler {
class Digraph;
class Node {
public:
/**
* Flag indicates whether the node has been expanded.
*/
static const int EXPANDED = 0x1;
/**
* Flag indicates whether the node was duplicated
* at a ring closure.
*/
static const int RING_DUPLICATE = 0x2;
/**
* Flag indicates whether the node was duplicated
* at a bond with order &gt; 1.
*/
static const int BOND_DUPLICATE = 0x4;
/**
* Mask to check if a node is duplicated.
*/
static const int DUPLICATE = RING_DUPLICATE | BOND_DUPLICATE;
/**
* Node was created for an implicit hydrogen,
* the 'atom' value will be null.
*/
static const int IMPL_HYDROGEN = 0x8;
/**
* Mask to check if a node is duplicated or created for an implicit H (not a
* primary node).
*/
static const int DUPLICATE_OR_H =
RING_DUPLICATE | BOND_DUPLICATE | IMPL_HYDROGEN;
Node() = delete;
Node(const Node &) = delete;
Node &operator=(const Node &) = delete;
Node(Digraph *g, std::vector<char> &&visit, Atom *atom,
boost::rational<int> &&frac, int dist, int flags);
Digraph *getDigraph() const;
Atom *getAtom() const;
unsigned int getAtomIdx() const;
int getDistance() const;
boost::rational<int> getAtomicNumFraction() const;
int getAtomicNum() const;
unsigned getMassNum() const;
double getAtomicMass() const;
Descriptor getAux() const;
bool isSet(int mask) const;
bool isDuplicate() const;
bool isDuplicateOrH() const;
bool isTerminal() const;
bool isExpanded() const;
bool isVisited(int idx) const;
Node *newChild(int idx, Atom *atom) const;
Node *newBondDuplicateChild(int idx, Atom *atom) const;
Node *newRingDuplicateChild(int idx, Atom *atom) const;
Node *newImplicitHydrogenChild() const;
void add(Edge *e);
void setAux(Descriptor desc);
const std::vector<Edge *> &getEdges() const;
std::vector<Edge *> getEdges(Atom *end) const;
std::vector<Edge *> getNonTerminalOutEdges() const;
private:
Digraph *dp_g;
Atom *dp_atom;
int d_dist;
boost::rational<int> d_atomic_num;
double d_atomic_mass;
Descriptor d_aux = Descriptor::NONE;
int d_flags = 0x0;
std::vector<Edge *> d_edges;
std::vector<char> d_visit;
Node *newTerminalChild(int idx, Atom *atom, int flags) const;
};
} // namespace CIPLabeler
} // namespace RDKit
Descriptor.h
Edge.h
Mancude.h
RDKit::Atom
The class for representing atoms.
Definition Atom.h:74
RDKit::CIPLabeler::Digraph
Definition Digraph.h:48
RDKit::CIPLabeler::Edge
Definition Edge.h:23
RDKit::CIPLabeler::Node::getAtomicNum
int getAtomicNum() const
RDKit::CIPLabeler::Node::newRingDuplicateChild
Node * newRingDuplicateChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::getAtomicMass
double getAtomicMass() const
RDKit::CIPLabeler::Node::newBondDuplicateChild
Node * newBondDuplicateChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::Node
Node(const Node &)=delete
RDKit::CIPLabeler::Node::operator=
Node & operator=(const Node &)=delete
RDKit::CIPLabeler::Node::isDuplicateOrH
bool isDuplicateOrH() const
RDKit::CIPLabeler::Node::getDigraph
Digraph * getDigraph() const
RDKit::CIPLabeler::Node::newImplicitHydrogenChild
Node * newImplicitHydrogenChild() const
RDKit::CIPLabeler::Node::setAux
void setAux(Descriptor desc)
RDKit::CIPLabeler::Node::BOND_DUPLICATE
static const int BOND_DUPLICATE
Definition Node.h:44
RDKit::CIPLabeler::Node::getAtomIdx
unsigned int getAtomIdx() const
RDKit::CIPLabeler::Node::DUPLICATE_OR_H
static const int DUPLICATE_OR_H
Definition Node.h:62
RDKit::CIPLabeler::Node::RING_DUPLICATE
static const int RING_DUPLICATE
Definition Node.h:38
RDKit::CIPLabeler::Node::DUPLICATE
static const int DUPLICATE
Definition Node.h:50
RDKit::CIPLabeler::Node::getEdges
const std::vector< Edge * > & getEdges() const
RDKit::CIPLabeler::Node::getAtom
Atom * getAtom() const
RDKit::CIPLabeler::Node::getNonTerminalOutEdges
std::vector< Edge * > getNonTerminalOutEdges() const
RDKit::CIPLabeler::Node::newChild
Node * newChild(int idx, Atom *atom) const
RDKit::CIPLabeler::Node::getAux
Descriptor getAux() const
RDKit::CIPLabeler::Node::getEdges
std::vector< Edge * > getEdges(Atom *end) const
RDKit::CIPLabeler::Node::getDistance
int getDistance() const
RDKit::CIPLabeler::Node::isSet
bool isSet(int mask) const
RDKit::CIPLabeler::Node::getMassNum
unsigned getMassNum() const
RDKit::CIPLabeler::Node::add
void add(Edge *e)
RDKit::CIPLabeler::Node::EXPANDED
static const int EXPANDED
Definition Node.h:32
RDKit::CIPLabeler::Node::IMPL_HYDROGEN
static const int IMPL_HYDROGEN
Definition Node.h:56
RDKit::CIPLabeler::Node::isTerminal
bool isTerminal() const
RDKit::CIPLabeler::Node::isDuplicate
bool isDuplicate() const
RDKit::CIPLabeler::Node::Node
Node()=delete
RDKit::CIPLabeler::Node::getAtomicNumFraction
boost::rational< int > getAtomicNumFraction() const
RDKit::CIPLabeler::Node::isVisited
bool isVisited(int idx) const
RDKit::CIPLabeler::Node::Node
Node(Digraph *g, std::vector< char > &&visit, Atom *atom, boost::rational< int > &&frac, int dist, int flags)
RDKit::CIPLabeler::Node::isExpanded
bool isExpanded() const
RDKit::CIPLabeler
Definition CIPLabeler.h:27
RDKit::CIPLabeler::Descriptor
Descriptor
Definition Descriptor.h:25
RDKit::CIPLabeler::Descriptor::NONE
@ NONE
Definition Descriptor.h:26
RDKit
Std stuff.
Definition Abbreviations.h:19