Loading...
Searching...
No Matches
molecularGraph.h
Go to the documentation of this file.
#ifndef BALL_DATATYPE_MOLECULARGRAPH_H
#define BALL_DATATYPE_MOLECULARGRAPH_H
#include <boost/graph/properties.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/copy.hpp>
#include <list>
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#ifndef BALL_DATATYPE_GRAPH_GRAPHALGORITHMS_H
# include <BALL/DATATYPE/GRAPH/graphAlgorithms.h>
#endif
namespace BALL
{
//Forward declarations
class Atom;
class Bond;
class AtomContainer;
//Define a properly adjusted boost graph type
typedef 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;
class MolecularGraph
: public MolecularGraphBase
{
public:
enum ExportOptions { INCLUDE_ALL = -1 };
typedef boost::graph_traits<MolecularGraph>::vertex_descriptor Vertex;
typedef boost::graph_traits<MolecularGraph>::edge_descriptor Edge;
typedef boost::graph_traits<MolecularGraph>::vertex_iterator VertexIterator;
typedef boost::graph_traits<MolecularGraph>::edge_iterator EdgeIterator;
typedef boost::property_map<MolecularGraphBase, boost::vertex_atom_ptr_t>::type AtomPtrMap;
typedef boost::property_map<MolecularGraphBase, boost::edge_bond_ptr_t>::type BondPtrMap;
typedef boost::property_map<MolecularGraphBase, boost::vertex_atom_ptr_t>::const_type ConstAtomPtrMap;
typedef boost::property_map<MolecularGraphBase, boost::edge_bond_ptr_t>::const_type ConstBondPtrMap;
typedef GRAPH::GraphTraits<MolecularGraph>::EditableGraph EditableGraph;
MolecularGraph(AtomContainer& ac, ExportOptions opt = INCLUDE_ALL);
const Edge& getEdge (const Bond* bond) const;
const Vertex& getVertex(const Atom* atom) const;
void editableCopy(EditableGraph& eg);
private:
std::map<const Bond*, Edge> bond_to_edge_;
std::map<const Atom*, Vertex> atom_to_vertex_;
};
typedef GRAPH::GraphTraits<MolecularGraph> MolecularGraphTraits;
typedef MolecularGraph::EditableGraph EditableMolecularGraph;
}
#endif //BALL_DATATYPE_MOLECULARGRAPH_H
global.h
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Atom
Definition atom.h:90
BALL::Bond
Definition bond.h:57
BALL::GRAPH::GraphTraits
Definition graphAlgorithms.h:75
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::ConstAtomPtrMap
boost::property_map< MolecularGraphBase, boost::vertex_atom_ptr_t >::const_type ConstAtomPtrMap
Definition molecularGraph.h:60
BALL::MolecularGraph::AtomPtrMap
boost::property_map< MolecularGraphBase, boost::vertex_atom_ptr_t >::type AtomPtrMap
Definition molecularGraph.h:58
BALL::MolecularGraph::ConstBondPtrMap
boost::property_map< MolecularGraphBase, boost::edge_bond_ptr_t >::const_type ConstBondPtrMap
Definition molecularGraph.h:61
BALL::MolecularGraph::getEdge
const Edge & getEdge(const Bond *bond) const
BALL::MolecularGraph::VertexIterator
boost::graph_traits< MolecularGraph >::vertex_iterator VertexIterator
Definition molecularGraph.h:56
BALL::MolecularGraph::MolecularGraph
MolecularGraph(AtomContainer &ac, ExportOptions opt=INCLUDE_ALL)
BALL::MolecularGraph::editableCopy
void editableCopy(EditableGraph &eg)
BALL::MolecularGraph::EditableGraph
GRAPH::GraphTraits< MolecularGraph >::EditableGraph EditableGraph
Definition molecularGraph.h:63
BALL::MolecularGraph::Vertex
boost::graph_traits< MolecularGraph >::vertex_descriptor Vertex
Definition molecularGraph.h:53
BALL::MolecularGraph::BondPtrMap
boost::property_map< MolecularGraphBase, boost::edge_bond_ptr_t >::type BondPtrMap
Definition molecularGraph.h:59
BALL::MolecularGraph::Edge
boost::graph_traits< MolecularGraph >::edge_descriptor Edge
Definition molecularGraph.h:54
BALL::MolecularGraph::getVertex
const Vertex & getVertex(const Atom *atom) const
BALL::MolecularGraph::EdgeIterator
boost::graph_traits< MolecularGraph >::edge_iterator EdgeIterator
Definition molecularGraph.h:57
BALL::MolecularGraph::ExportOptions
ExportOptions
@TODO do something useful with this
Definition molecularGraph.h:51
BALL::MolecularGraph::INCLUDE_ALL
@ INCLUDE_ALL
Definition molecularGraph.h:51
graphAlgorithms.h
BALL
Definition constants.h:13
BALL::EditableMolecularGraph
MolecularGraph::EditableGraph EditableMolecularGraph
Definition molecularGraph.h:78
BALL::MolecularGraphTraits
GRAPH::GraphTraits< MolecularGraph > MolecularGraphTraits
Definition molecularGraph.h:77
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:30