1.1 --- a/mapstorage.h Wed Jun 01 23:30:13 2005 +0000
1.2 +++ b/mapstorage.h Wed Jun 01 23:33:26 2005 +0000
1.3 @@ -1,85 +1,85 @@
1.4 -// -*- C++ -*- //
1.5 -
1.6 -#ifndef MAPSTORAGE_H
1.7 -#define MAPSTORAGE_H
1.8 -
1.9 -#include <all_include.h>
1.10 -
1.11 -///Class MapStorage is responsible for storing
1.12 -///NodeMaps and EdgeMaps that can be shown later
1.13 -///on GUI. Therefore maps can be added to it,
1.14 -///and datas over the added maps can be queried.
1.15 -///The maps will be stored in an std::map,
1.16 -///referenced with their names. Unfortunately at
1.17 -///the moment it works only with double type maps
1.18 -///
1.19 -///\todo too many things are public!!
1.20 -class MapStorage
1.21 -{
1.22 -public:
1.23 -
1.24 - Graph g;
1.25 -
1.26 - ///Stores double type NodeMaps
1.27 - std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
1.28 -
1.29 - ///Stores double type EdgeMaps
1.30 - std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
1.31 -
1.32 - //Stores the default values for the different visualization node attributes
1.33 - std::vector<Graph::NodeMap<double> > default_nodemaps;
1.34 -
1.35 - //Stores the default values for the different visualization edge attributes
1.36 - std::vector<Graph::EdgeMap<double> > default_edgemaps;
1.37 -
1.38 -public:
1.39 - ///Constructor of MapStorage. Expects the Graph of
1.40 - ///which maps will be stored in it.
1.41 - ///Its all activity is initializing default values
1.42 - ///for different visualization attributes
1.43 - ///
1.44 - ///\param graph is the graph for which the maps are stored in this object.
1.45 - MapStorage(Graph &);
1.46 -
1.47 - ///Adds given map to storage. A name and the map itself has to be provided.
1.48 - ///\param name is the name of map
1.49 - ///\nodemap is the pointer of the given nodemap
1.50 - ///\todo map should be given by reference!
1.51 - int addNodeMap(const std::string &,Graph::NodeMap<double> *);
1.52 -
1.53 - ///Adds given map to storage. A name and the map itself has to be provided.
1.54 - ///\param name is the name of map
1.55 - ///\edgemap is the pointer of the given edgemap
1.56 - ///\todo map should be given by reference!
1.57 - int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
1.58 -
1.59 - ///Returns how much nodemaps is stored in \ref MapStorage
1.60 - int numOfNodeMaps() {return nodemap_storage.size();};
1.61 -
1.62 - ///Returns how much edgemaps is stored in \ref MapStorage
1.63 - int numOfEdgeMaps() {return edgemap_storage.size();};
1.64 -
1.65 - ///Returns the maximum value of the given NodeMap. NodeMap has to be given by its name.
1.66 - ///\param name is the name of map of which maximum is searched
1.67 - double maxOfNodeMap(const std::string &);
1.68 -
1.69 - ///Returns the maximum value of the given EdgeMap. EdgeMap has to be given by its name.
1.70 - ///\param name is the name of map of which maximum is searched
1.71 - double maxOfEdgeMap(const std::string &);
1.72 -
1.73 - ///Returns the minimum value of the given NodeMap. NodeMap has to be given by its name.
1.74 - ///\param name is the name of map of which minimum is searched
1.75 - double minOfNodeMap(const std::string &);
1.76 -
1.77 - ///Returns the minimum value of the given EdgeMap. EdgeMap has to be given by its name.
1.78 - ///\param name is the name of map of which minimum is searched
1.79 - double minOfEdgeMap(const std::string &);
1.80 -
1.81 - ///To be able to iterate through each maps this function returns an iterator pointing to the first nodemap in the storage.
1.82 - std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
1.83 -
1.84 - ///To be able to iterate through each maps this function returns an iterator pointing to the first edgemap in the storage.
1.85 - std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
1.86 -};
1.87 -
1.88 -#endif //MAPSTORAGE_H
1.89 +// -*- C++ -*- //
1.90 +
1.91 +#ifndef MAPSTORAGE_H
1.92 +#define MAPSTORAGE_H
1.93 +
1.94 +#include <all_include.h>
1.95 +
1.96 +///Class MapStorage is responsible for storing
1.97 +///NodeMaps and EdgeMaps that can be shown later
1.98 +///on GUI. Therefore maps can be added to it,
1.99 +///and datas over the added maps can be queried.
1.100 +///The maps will be stored in an std::map,
1.101 +///referenced with their names. Unfortunately at
1.102 +///the moment it works only with double type maps
1.103 +///
1.104 +///\todo too many things are public!!
1.105 +class MapStorage
1.106 +{
1.107 +public:
1.108 +
1.109 + Graph g;
1.110 +
1.111 + ///Stores double type NodeMaps
1.112 + std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
1.113 +
1.114 + ///Stores double type EdgeMaps
1.115 + std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
1.116 +
1.117 + //Stores the default values for the different visualization node attributes
1.118 + std::vector<Graph::NodeMap<double> > default_nodemaps;
1.119 +
1.120 + //Stores the default values for the different visualization edge attributes
1.121 + std::vector<Graph::EdgeMap<double> > default_edgemaps;
1.122 +
1.123 +public:
1.124 + ///Constructor of MapStorage. Expects the Graph of
1.125 + ///which maps will be stored in it.
1.126 + ///Its all activity is initializing default values
1.127 + ///for different visualization attributes
1.128 + ///
1.129 + ///\param graph is the graph for which the maps are stored in this object.
1.130 + MapStorage(Graph &);
1.131 +
1.132 + ///Adds given map to storage. A name and the map itself has to be provided.
1.133 + ///\param name is the name of map
1.134 + ///\nodemap is the pointer of the given nodemap
1.135 + ///\todo map should be given by reference!
1.136 + int addNodeMap(const std::string &,Graph::NodeMap<double> *);
1.137 +
1.138 + ///Adds given map to storage. A name and the map itself has to be provided.
1.139 + ///\param name is the name of map
1.140 + ///\edgemap is the pointer of the given edgemap
1.141 + ///\todo map should be given by reference!
1.142 + int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
1.143 +
1.144 + ///Returns how much nodemaps is stored in \ref MapStorage
1.145 + int numOfNodeMaps() {return nodemap_storage.size();};
1.146 +
1.147 + ///Returns how much edgemaps is stored in \ref MapStorage
1.148 + int numOfEdgeMaps() {return edgemap_storage.size();};
1.149 +
1.150 + ///Returns the maximum value of the given NodeMap. NodeMap has to be given by its name.
1.151 + ///\param name is the name of map of which maximum is searched
1.152 + double maxOfNodeMap(const std::string &);
1.153 +
1.154 + ///Returns the maximum value of the given EdgeMap. EdgeMap has to be given by its name.
1.155 + ///\param name is the name of map of which maximum is searched
1.156 + double maxOfEdgeMap(const std::string &);
1.157 +
1.158 + ///Returns the minimum value of the given NodeMap. NodeMap has to be given by its name.
1.159 + ///\param name is the name of map of which minimum is searched
1.160 + double minOfNodeMap(const std::string &);
1.161 +
1.162 + ///Returns the minimum value of the given EdgeMap. EdgeMap has to be given by its name.
1.163 + ///\param name is the name of map of which minimum is searched
1.164 + double minOfEdgeMap(const std::string &);
1.165 +
1.166 + ///To be able to iterate through each maps this function returns an iterator pointing to the first nodemap in the storage.
1.167 + std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
1.168 +
1.169 + ///To be able to iterate through each maps this function returns an iterator pointing to the first edgemap in the storage.
1.170 + std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
1.171 +};
1.172 +
1.173 +#endif //MAPSTORAGE_H