gui/mapstorage.h
changeset 1855 c72636dcf0bd
parent 1645 4a04bb856ac7
child 1860 27a9a75b957b
equal deleted inserted replaced
8:64bad0bdb0e7 9:d34662fa18b0
     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 class Mapstorage;
       
     7 
     6 #include "all_include.h"
     8 #include "all_include.h"
     7 #include "xymap.h"
     9 #include "xymap.h"
       
    10 #include <libgnomecanvasmm.h>
     8 
    11 
     9 ///Class MapStorage is responsible for storing
    12 ///Class MapStorage is responsible for storing
    10 ///NodeMaps and EdgeMaps that can be shown later
    13 ///NodeMaps and EdgeMaps that can be shown later
    11 ///on GUI. Therefore maps can be added to it,
    14 ///on GUI. Therefore maps can be added to it,
    12 ///and datas over the added maps can be queried.
    15 ///and datas over the added maps can be queried.
    35   std::vector<Graph::NodeMap<double> > default_nodemaps;
    38   std::vector<Graph::NodeMap<double> > default_nodemaps;
    36 
    39 
    37   //Stores the default values for the different visualization edge attributes
    40   //Stores the default values for the different visualization edge attributes
    38   std::vector<Graph::EdgeMap<double> > default_edgemaps;
    41   std::vector<Graph::EdgeMap<double> > default_edgemaps;
    39 
    42 
       
    43   //Stores the active maps for the different visualization node attributes
       
    44   std::vector< std::string > active_nodemaps;
       
    45 
       
    46   //Stores the active maps for the different visualization edge attributes
       
    47   std::vector< std::string > active_edgemaps;
       
    48 
    40   // Default values for the maps
    49   // Default values for the maps
    41   std::map< std::string, double > nodemap_default;
    50   std::map< std::string, double > nodemap_default;
    42 
    51 
    43   // Default values for the maps
    52   // Default values for the maps
    44   std::map< std::string, double > edgemap_default;
    53   std::map< std::string, double > edgemap_default;
       
    54 
       
    55 protected:
       
    56   typedef sigc::signal<void, bool, int> Signal_Prop;
       
    57   Signal_Prop signal_prop;
    45 
    58 
    46 public:
    59 public:
    47   ///Constructor of MapStorage. Expects the Graph of
    60   ///Constructor of MapStorage. Expects the Graph of
    48   ///which maps will be stored in it.
    61   ///which maps will be stored in it.
    49   ///Its all activity is initializing default values
    62   ///Its all activity is initializing default values
    51   ///
    64   ///
    52   ///\param graph is the graph for which the maps are stored in this object.
    65   ///\param graph is the graph for which the maps are stored in this object.
    53   MapStorage();
    66   MapStorage();
    54 
    67 
    55   ~MapStorage();
    68   ~MapStorage();
       
    69 
       
    70   void changeActiveMap(bool, int, std::string);
       
    71 
       
    72   std::string getActiveEdgeMap(int);
       
    73   std::string getActiveNodeMap(int);
       
    74 
       
    75   std::vector<std::string> getEdgeMapList();
       
    76   std::vector<std::string> getNodeMapList();
       
    77 
       
    78   Signal_Prop signal_prop_ch();
    56 
    79 
    57   ///Adds given map to storage. A name and the map itself has to be provided.
    80   ///Adds given map to storage. A name and the map itself has to be provided.
    58   ///\param name is the name of map
    81   ///\param name is the name of map
    59   ///\nodemap is the pointer of the given nodemap
    82   ///\nodemap is the pointer of the given nodemap
    60   ///\todo map should be given by reference!
    83   ///\todo map should be given by reference!