gui/mapstorage.h
changeset 1642 a2dda876316f
parent 1525 6d94de269ab1
child 1645 4a04bb856ac7
equal deleted inserted replaced
6:afbea4741094 7:e629e6ee574a
     1 // -*- C++ -*- //
     1 // -*- C++ -*- //
     2 
     2 
     3 #ifndef MAPSTORAGE_H
     3 #ifndef MAPSTORAGE_H
     4 #define MAPSTORAGE_H
     4 #define MAPSTORAGE_H
     5 
     5 
     6 #include <all_include.h>
     6 #include "all_include.h"
       
     7 #include "xymap.h"
     7 
     8 
     8 ///Class MapStorage is responsible for storing
     9 ///Class MapStorage is responsible for storing
     9 ///NodeMaps and EdgeMaps that can be shown later
    10 ///NodeMaps and EdgeMaps that can be shown later
    10 ///on GUI. Therefore maps can be added to it,
    11 ///on GUI. Therefore maps can be added to it,
    11 ///and datas over the added maps can be queried.
    12 ///and datas over the added maps can be queried.
    16 ///\todo too many things are public!!
    17 ///\todo too many things are public!!
    17 class MapStorage
    18 class MapStorage
    18 {
    19 {
    19 public:
    20 public:
    20 
    21 
    21   Graph &g;
    22   Graph graph;
       
    23   XYMap<Graph::NodeMap<double> > coords;
       
    24 
       
    25   bool modified;
       
    26   std::string file_name;
    22 
    27 
    23   ///Stores double type NodeMaps
    28   ///Stores double type NodeMaps
    24   std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
    29   std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
    25 
    30 
    26   ///Stores double type EdgeMaps
    31   ///Stores double type EdgeMaps
    37   ///which maps will be stored in it.
    42   ///which maps will be stored in it.
    38   ///Its all activity is initializing default values
    43   ///Its all activity is initializing default values
    39   ///for different visualization attributes
    44   ///for different visualization attributes
    40   ///
    45   ///
    41   ///\param graph is the graph for which the maps are stored in this object.
    46   ///\param graph is the graph for which the maps are stored in this object.
    42   MapStorage(Graph &);
    47   MapStorage();
       
    48 
       
    49   ~MapStorage();
    43 
    50 
    44   ///Adds given map to storage. A name and the map itself has to be provided.
    51   ///Adds given map to storage. A name and the map itself has to be provided.
    45   ///\param name is the name of map
    52   ///\param name is the name of map
    46   ///\nodemap is the pointer of the given nodemap
    53   ///\nodemap is the pointer of the given nodemap
    47   ///\todo map should be given by reference!
    54   ///\todo map should be given by reference!
    90   ///This function sets a default base value for the newly created node
    97   ///This function sets a default base value for the newly created node
    91   void initMapsForNode(NodeIt);
    98   void initMapsForNode(NodeIt);
    92 
    99 
    93   ///This function sets a default base value for the newly created node
   100   ///This function sets a default base value for the newly created node
    94   void initMapsForEdge(Graph::Edge);
   101   void initMapsForEdge(Graph::Edge);
       
   102 
       
   103   void readFromFile(const std::string &);
       
   104   void writeToFile(const std::string &);
       
   105 
       
   106   void clear();
    95 };
   107 };
    96 
   108 
    97 #endif //MAPSTORAGE_H
   109 #endif //MAPSTORAGE_H