BALL  1.5.0
molecularGraph.h
Go to the documentation of this file.
1 #ifndef BALL_DATATYPE_MOLECULARGRAPH_H
2 #define BALL_DATATYPE_MOLECULARGRAPH_H
3 
4 #include <boost/graph/properties.hpp>
5 #include <boost/graph/graph_traits.hpp>
6 #include <boost/graph/adjacency_list.hpp>
7 #include <boost/graph/copy.hpp>
8 
9 #include <list>
10 
11 #ifndef BALL_COMMON_GLOBAL_H
12 # include <BALL/COMMON/global.h>
13 #endif
14 
15 #ifndef BALL_DATATYPE_GRAPH_GRAPHALGORITHMS_H
17 #endif
18 
19 namespace BALL
20 {
21  //Forward declarations
22  class Atom;
23  class Bond;
25 
26  //Define a properly adjusted boost graph type
27  typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
28  boost::property<boost::vertex_atom_ptr_t, const Atom*>,
29  boost::property<boost::edge_bond_ptr_t, const Bond*>
31 
47  : public MolecularGraphBase
48  {
49  public:
51  enum ExportOptions { INCLUDE_ALL = -1 };
52 
53  typedef boost::graph_traits<MolecularGraph>::vertex_descriptor Vertex;
54  typedef boost::graph_traits<MolecularGraph>::edge_descriptor Edge;
55 
56  typedef boost::graph_traits<MolecularGraph>::vertex_iterator VertexIterator;
57  typedef boost::graph_traits<MolecularGraph>::edge_iterator EdgeIterator;
58  typedef boost::property_map<MolecularGraphBase, boost::vertex_atom_ptr_t>::type AtomPtrMap;
59  typedef boost::property_map<MolecularGraphBase, boost::edge_bond_ptr_t>::type BondPtrMap;
60  typedef boost::property_map<MolecularGraphBase, boost::vertex_atom_ptr_t>::const_type ConstAtomPtrMap;
61  typedef boost::property_map<MolecularGraphBase, boost::edge_bond_ptr_t>::const_type ConstBondPtrMap;
62 
64 
66 
67  const Edge& getEdge (const Bond* bond) const;
68  const Vertex& getVertex(const Atom* atom) const;
69 
70  void editableCopy(EditableGraph& eg);
71 
72  private:
73  std::map<const Bond*, Edge> bond_to_edge_;
74  std::map<const Atom*, Vertex> atom_to_vertex_;
75  };
76 
79 }
80 
81 #endif //BALL_DATATYPE_MOLECULARGRAPH_H
BALL::MolecularGraph::ExportOptions
ExportOptions
@TODO do something useful with this
Definition: molecularGraph.h:51
BALL::MolecularGraph::Edge
boost::graph_traits< MolecularGraph >::edge_descriptor Edge
Definition: molecularGraph.h:54
BALL::MolecularGraph::VertexIterator
boost::graph_traits< MolecularGraph >::vertex_iterator VertexIterator
Definition: molecularGraph.h:56
BALL::MolecularGraph::EdgeIterator
boost::graph_traits< MolecularGraph >::edge_iterator EdgeIterator
Definition: molecularGraph.h:57
BALL::MolecularGraph::ConstBondPtrMap
boost::property_map< MolecularGraphBase, boost::edge_bond_ptr_t >::const_type ConstBondPtrMap
Definition: molecularGraph.h:61
BALL::Bond
Definition: bond.h:54
BALL::GRAPH::GraphTraits
Definition: graphAlgorithms.h:74
BALL::AtomContainer
Definition: atomContainer.h:29
BALL::MolecularGraph::editableCopy
void editableCopy(EditableGraph &eg)
BALL::MolecularGraph::ConstAtomPtrMap
boost::property_map< MolecularGraphBase, boost::vertex_atom_ptr_t >::const_type ConstAtomPtrMap
Definition: molecularGraph.h:60
BALL::Atom
Definition: atom.h:87
MolecularGraphBase
BALL::MolecularGraph::INCLUDE_ALL
@ INCLUDE_ALL
Definition: molecularGraph.h:51
graphAlgorithms.h
BALL
Definition: constants.h:12
BALL::PDB::Atom
char Atom[5]
Definition: PDBdefs.h:257
BALL::MolecularGraphBase
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS, boost::property< boost::vertex_atom_ptr_t, const Atom * >, boost::property< boost::edge_bond_ptr_t, const Bond * > > MolecularGraphBase
Definition: molecularGraph.h:24
BALL::MolecularGraph
Definition: molecularGraph.h:46
BALL::MolecularGraphTraits
GRAPH::GraphTraits< MolecularGraph > MolecularGraphTraits
Definition: molecularGraph.h:77
BALL::EditableMolecularGraph
MolecularGraph::EditableGraph EditableMolecularGraph
Definition: molecularGraph.h:78
BALL::MolecularGraph::Vertex
boost::graph_traits< MolecularGraph >::vertex_descriptor Vertex
Definition: molecularGraph.h:53
global.h
BALL::GRAPH::GraphTraits::EditableGraph
boost::adjacency_list< boost::listS, boost::listS, boost::undirectedS, boost::property< boost::vertex_orig_ptr_t, VertexType, boost::property< boost::vertex_index_t, int > >, boost::property< boost::edge_orig_ptr_t, EdgeType > > EditableGraph
Definition: graphAlgorithms.h:88
BALL::MolecularGraph::getEdge
const Edge & getEdge(const Bond *bond) const
BALL::MolecularGraph::getVertex
const Vertex & getVertex(const Atom *atom) const
BALL::MolecularGraph::AtomPtrMap
boost::property_map< MolecularGraphBase, boost::vertex_atom_ptr_t >::type AtomPtrMap
Definition: molecularGraph.h:58
BALL::MolecularGraph::BondPtrMap
boost::property_map< MolecularGraphBase, boost::edge_bond_ptr_t >::type BondPtrMap
Definition: molecularGraph.h:59
BALL::MolecularGraph::MolecularGraph
MolecularGraph(AtomContainer &ac, ExportOptions opt=INCLUDE_ALL)
BALL::MolecularGraph::EditableGraph
GRAPH::GraphTraits< MolecularGraph >::EditableGraph EditableGraph
Definition: molecularGraph.h:63