gui/mapstorage.h
changeset 1440 3d2e3cfb2a6c
parent 1435 8e85e6bbefdf
child 1442 1e3c69aa035b
     1.1 --- a/gui/mapstorage.h	Thu May 26 16:32:26 2005 +0000
     1.2 +++ b/gui/mapstorage.h	Fri May 27 10:34:20 2005 +0000
     1.3 @@ -5,32 +5,80 @@
     1.4  
     1.5  #include <all_include.h>
     1.6  
     1.7 +///Class MapStorage is responsible for storing
     1.8 +///NodeMaps and EdgeMaps that can be shown later
     1.9 +///on GUI. Therefore maps can be added to it,
    1.10 +///and datas over the added maps can be queried.
    1.11 +///The maps will be stored in an std::map,
    1.12 +///referenced with their names. Unfortunately at
    1.13 +///the moment it works only with double type maps
    1.14 +///
    1.15 +///\todo too many things are public!!
    1.16  class MapStorage
    1.17  {
    1.18 +public:
    1.19  
    1.20 -public: ///!!!!!!!!
    1.21    Graph g;
    1.22 +
    1.23 +  ///Stores double type NodeMaps
    1.24    std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
    1.25 +
    1.26 +  ///Stores double type EdgeMaps
    1.27    std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
    1.28  
    1.29 +  //Stores the default values for the different visualization node attributes
    1.30    std::vector<Graph::NodeMap<double> > default_nodemaps;
    1.31 +
    1.32 +  //Stores the default values for the different visualization edge attributes
    1.33    std::vector<Graph::EdgeMap<double> > default_edgemaps;
    1.34  
    1.35  public:
    1.36 +  ///Constructor of MapStorage. Expects the Graph of
    1.37 +  ///which maps will be stored in it.
    1.38 +  ///Its all activity is initializing default values
    1.39 +  ///for different visualization attributes
    1.40 +  ///
    1.41 +  ///\param graph is the graph for which the maps are stored in this object.
    1.42    MapStorage(Graph &);
    1.43 +
    1.44 +  ///Adds given map to storage. A name and the map itself has to be provided.
    1.45 +  ///\param name is the name of map
    1.46 +  ///\nodemap is the pointer of the given nodemap
    1.47 +  ///\todo map should be given by reference!
    1.48    int addNodeMap(const std::string &,Graph::NodeMap<double> *);
    1.49 +
    1.50 +  ///Adds given map to storage. A name and the map itself has to be provided.
    1.51 +  ///\param name is the name of map
    1.52 +  ///\edgemap is the pointer of the given edgemap
    1.53 +  ///\todo map should be given by reference!
    1.54    int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
    1.55  
    1.56 +  ///Returns how much nodemaps is stored in \ref MapStorage
    1.57    int numOfNodeMaps() {return nodemap_storage.size();};
    1.58 +
    1.59 +  ///Returns how much edgemaps is stored in \ref MapStorage
    1.60    int numOfEdgeMaps() {return edgemap_storage.size();};
    1.61  
    1.62 +  ///Returns the maximum value of the given NodeMap. NodeMap has to be given by its name.
    1.63 +  ///\param name is the name of map of which maximum is searched
    1.64    double maxOfNodeMap(const std::string &);
    1.65 +
    1.66 +  ///Returns the maximum value of the given EdgeMap. EdgeMap has to be given by its name.
    1.67 +  ///\param name is the name of map of which maximum is searched
    1.68    double maxOfEdgeMap(const std::string &);
    1.69  
    1.70 +  ///Returns the minimum value of the given NodeMap. NodeMap has to be given by its name.
    1.71 +  ///\param name is the name of map of which minimum is searched
    1.72    double minOfNodeMap(const std::string &);
    1.73 +
    1.74 +  ///Returns the minimum value of the given EdgeMap. EdgeMap has to be given by its name.
    1.75 +  ///\param name is the name of map of which minimum is searched
    1.76    double minOfEdgeMap(const std::string &);
    1.77  
    1.78 +  ///To be able to iterate through each maps this function returns an iterator pointing to the first nodemap in the storage.
    1.79    std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
    1.80 +
    1.81 +  ///To be able to iterate through each maps this function returns an iterator pointing to the first edgemap in the storage.
    1.82    std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
    1.83  };
    1.84