5 #ifndef BALL_STRUCTURE_SMARTES_PARSER_H 6 #define BALL_STRUCTURE_SMARTES_PARSER_H 50 CHIRAL_CLASS_UNSPECIFIED = 1,
161 void setNot(
bool is_not) { not_ = is_not; }
164 bool equals(
const Bond* bond)
const;
246 void operator = (
const Property& rhs);
334 void setProperty(
Property property);
337 void addPropertiesFromSPAtom(
SPAtom* sp_atom);
349 Size countProperties()
const;
352 Size getDefaultValence(
const Atom* atom)
const;
355 Size countRealValences(
const Atom* atom)
const;
358 Size getNumberOfImplicitHydrogens(
const Atom* atom)
const;
364 bool equals(
const Atom* atom)
const;
405 bool isInternal()
const {
return internal_; }
433 bool isNot()
const {
return is_not_; }
436 void setNot(
bool is_not) { is_not_ = is_not; }
524 bool isInternal()
const {
return internal_; }
534 void setRecursive(
bool recursive);
564 void setNot(
bool is_not) { is_not_ = is_not; }
586 EdgeIterator begin() {
return edges_.begin(); }
590 EdgeIterator
end() {
return edges_.end(); }
593 EdgeConstIterator
begin()
const {
return edges_.begin(); }
596 EdgeConstIterator
end()
const {
return edges_.end(); }
651 void parse(
const String& s)
657 SPAtom* createAtom(
const String& symbol,
bool in_bracket =
false);
673 void addRingConnection(
SPNode* spnode,
Size index);
676 std::map<Size, std::vector<SPNode*> > getRingConnections()
const;
679 void setSSSR(
const std::vector<std::vector<Atom*> >& sssr);
711 const std::set<SPNode*>&
getNodes()
const {
return nodes_; }
714 const std::set<SPEdge*>&
getEdges()
const {
return edges_; }
729 void setNextComponentNumberToSubTree(
SPNode* spnode);
744 static vector<std::set<const Atom*> >*
sssr_;
747 void dumpTreeRecursive_(
SPNode* node,
Size depth);
750 void dumpTreeRecursive_(
SPEdge* edge,
Size depth);
776 #endif // BALL_STRUCTURE_SMARTS_PARSER_H bool recursive_
recursive flag
SmartsParser * current_parser
SPNode * getRoot() const
returns the root SPNode of the tree
static vector< std::set< const Atom * > > * sssr_
the sssr
SPBondOrder
the bond orders supported by SMARTS-patterns
static State state
static member for the parser itself
bool isRecursive() const
returns true if the SPNode is a recursive node (from recursive SMARTS)
BALL_EXTERN_VARIABLE const double E
Euler's number - base of the natural logarithm.
SPNode * second_
second SPNode
LogicalOperator getLogicalOperator() const
returns the logical operator of the SPNode
EdgeConstIterator begin() const
non-mutable access to begin of edges list
ZEIsomerType ze_type_
Z/E isomer type.
EdgeConstIterator end() const
non-mutable access to end of edges list
void setFirstSPNode(SPNode *first)
set the first SPNode of this edge
void setFirstEdge(SPEdge *first)
sets the first edge (for tree use)
void setSPAtom(SPAtom *sp_atom)
set the associated SPAtom
bool isNot() const
returns true if negation is enabled
SPNode * getFirstSPNode() const
returns the first SPNode of this edge
void setSecondEdge(SPEdge *second)
sets the second edge (for tree use)
bool recursive_
recursive flag
bool needs_SSSR_
sssr needed flag
const std::set< SPNode * > & getNodes() const
returns the eodes stored in the tree
Atom * atom_
the atom which this sp_atom belongs to
void setComponentGrouping(bool component_grouping)
sets the component level flag
SPEdge * getFirstEdge() const
returns the first edge (for tree use)
void setLogicalOperator(LogicalOperator log_op)
sets the logical operator associated with the SPNode
SPEdge * getFirstSPEdge() const
returns the first SPEdge (first tree child)
SPNode * first_
first SPNode
const Element * element_value
void addSPEdge(SPEdge *sp_edge)
flag whether the pattern is in brackets
std::set< SPNode * > nodes_
the nodes
SPAtom * sp_atom_
SPAtom associated with this SPNode.
SPNode * root_
the root node of the tree
std::vector< SPEdge * >::iterator EdgeIterator
non-constant edge iterator
std::set< PropertyType > not_properties_
the properties which are negated
SPEdge * getSecondEdge() const
returns the second edge (for tree use)
ChiralClass
chiral class definitions CW = clock wise, CCW = counter clock wise
SPEdge * first_edge_
first SPEdge
SPEdge * getSecondSPEdge() const
returns the second SPEdge (second tree child)
std::map< PropertyType, PropertyValue > properties_
the properties of this SPAtom
Smarts Parser Atom class.
void setNeedsSSSR(bool needs_sssr)
sets the sssr needed flag
bool isRecursive() const
returns true if the tree represents a recursive SMARTS pattern
LogicalOperator log_op_
in brackets flag
bool hasRecursiveEdge(SPEdge *edge) const
returns true if the tree has the given recursive edge
Representation of a node in the smarts parser graph.
void setInternal(bool internal)
set this edge to a internal edge
SPBond * bond_
associated bond
void setComponentNumber(int no)
set the component no of the component level grouping
void setNot(bool is_not)
set the general negation to the bool given
std::set< SPEdge * > rec_edges_
the recursive edges
void setZEType(ZEIsomerType type)
sets the Z/E isomer type
void setSecondSPEdge(SPEdge *second)
set the second SPEdge (second tree child)
void addEdge(SPEdge *edge)
adds an edge to the tree
std::vector< SPEdge * >::const_iterator EdgeConstIterator
constant edge iterator
Property struct of smarts parser atom.
ChiralClass chiral_class_value
SPBondOrder getBondOrder() const
returns the bond order
LogicalOperator getLogicalOperator() const
returns the asociated logical operator (for the child edges)
bool internal_
internal flag
Bond representation of the smarts parser.
bool component_grouping_
component level grouping flag
SPEdge * second_edge_
second edge
SPAtom * getSPAtom() const
returns the associated SPAtom
PropertyValue getValue() const
returns the value of the property
void setNot(bool is_not)
sets the negation flag
void setSPBond(SPBond *sp_bond)
sets the corresponding SPBond of this edge
SPBondOrder bond_order_
the bond order
void addRecursiveEdge(SPEdge *edge)
adds a recursive edge to the tree
std::vector< SPEdge * > edges_
edges list
bool isNot() const
return true if a general negation is set
Size getComponentNumber() const
returns the component number
LogicalOperator log_op_
logical operator associated with the SPEdges
-*- Mode: C++; tab-width: 2; -*-
void setLogicalOperator(LogicalOperator log_op)
sets the associated logical operator (for the child edges)
std::set< SPEdge * > edges_
the edges
SPEdge * first_edge_
first edge
bool internal_
internal flag
Parser state (used by the parser itself)
std::map< Size, std::vector< SPNode * > > ring_connections_
the ring connection sorted by index of the SMARTS pattern
Edge representation of the smarts parser graph.
bool hasComponentGrouping() const
returns true if the component level grouping was enabled
PropertyType
enum of all properties possible for a smarts parser atom
Size countEdges() const
counts the number of edges
static SmartsParser * current_parser_
current instance
possible types of the properties
int component_no_
component level
void setNot(bool is_not)
set the negation flag
void setFirstSPEdge(SPEdge *first)
set the first SPEdge (first tree child)
void setInternal(bool internal)
sets the internal flag
void addNode(SPNode *node)
adds a node to the tree
SPEdge * second_edge_
second SPEdge
void setRecursive(bool recursive)
sets the recursive flag
SPNode * getPartnerSPNode(SPNode *node)
returns the partner; either the first or the second SPNode
const std::set< SPEdge * > & getEdges() const
returns the edges stored in the tree
bool is_not_
negotiation flag
SPNode * getSecondSPNode() const
returns the second SPNode of this edge
bool getNot() const
returns the negation flag
bool is_not_
negation flag
void setRoot(SPNode *root)
sets the root SPNode of the tree
void setSecondSPNode(SPNode *second)
sets the second SPNode of this edge
EdgeIterator end()
mutable access to end of edges list
bool getNeedsSSSR() const
returns true if the SMARTS pattern contains ring related parts
SPBond * getSPBond() const
returns the corresponding SPBond of this edge
bool not_
general negation flag
int component_no_
the actual component number