gui/mapstorage.h
changeset 1654 0917756ba533
parent 1606 dc4ea2010dee
child 1837 8dd6160ff699
equal deleted inserted replaced
7:e629e6ee574a 8:64bad0bdb0e7
    35   std::vector<Graph::NodeMap<double> > default_nodemaps;
    35   std::vector<Graph::NodeMap<double> > default_nodemaps;
    36 
    36 
    37   //Stores the default values for the different visualization edge attributes
    37   //Stores the default values for the different visualization edge attributes
    38   std::vector<Graph::EdgeMap<double> > default_edgemaps;
    38   std::vector<Graph::EdgeMap<double> > default_edgemaps;
    39 
    39 
       
    40   // Default values for the maps
       
    41   std::map< std::string, double > nodemap_default;
       
    42 
       
    43   // Default values for the maps
       
    44   std::map< std::string, double > edgemap_default;
       
    45 
    40 public:
    46 public:
    41   ///Constructor of MapStorage. Expects the Graph of
    47   ///Constructor of MapStorage. Expects the Graph of
    42   ///which maps will be stored in it.
    48   ///which maps will be stored in it.
    43   ///Its all activity is initializing default values
    49   ///Its all activity is initializing default values
    44   ///for different visualization attributes
    50   ///for different visualization attributes
    50 
    56 
    51   ///Adds given map to storage. A name and the map itself has to be provided.
    57   ///Adds given map to storage. A name and the map itself has to be provided.
    52   ///\param name is the name of map
    58   ///\param name is the name of map
    53   ///\nodemap is the pointer of the given nodemap
    59   ///\nodemap is the pointer of the given nodemap
    54   ///\todo map should be given by reference!
    60   ///\todo map should be given by reference!
    55   int addNodeMap(const std::string &,Graph::NodeMap<double> *);
    61   int addNodeMap(const std::string &,Graph::NodeMap<double> *, double);
    56 
    62 
    57   ///Adds given map to storage. A name and the map itself has to be provided.
    63   ///Adds given map to storage. A name and the map itself has to be provided.
    58   ///\param name is the name of map
    64   ///\param name is the name of map
    59   ///\edgemap is the pointer of the given edgemap
    65   ///\edgemap is the pointer of the given edgemap
    60   ///\todo map should be given by reference!
    66   ///\todo map should be given by reference!
    61   int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
    67   int addEdgeMap(const std::string &,Graph::EdgeMap<double> *, double);
    62 
    68 
    63   ///Returns how much nodemaps is stored in \ref MapStorage
    69   ///Returns how much nodemaps is stored in \ref MapStorage
    64   int numOfNodeMaps() {return nodemap_storage.size();};
    70   int numOfNodeMaps() {return nodemap_storage.size();};
    65 
    71 
    66   ///Returns how much edgemaps is stored in \ref MapStorage
    72   ///Returns how much edgemaps is stored in \ref MapStorage
    92   std::map< std::string,Graph::NodeMap<double> * >::iterator endOfNodeMaps(){return nodemap_storage.end();};
    98   std::map< std::string,Graph::NodeMap<double> * >::iterator endOfNodeMaps(){return nodemap_storage.end();};
    93 
    99 
    94   ///To be able to iterate through each maps this function returns an iterator pointing to the last edgemap in the storage.
   100   ///To be able to iterate through each maps this function returns an iterator pointing to the last edgemap in the storage.
    95   std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();};
   101   std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();};
    96 
   102 
    97   ///This function sets a default base value for the newly created node
   103   int readFromFile(const std::string &);
    98   void initMapsForNode(NodeIt);
       
    99 
       
   100   ///This function sets a default base value for the newly created node
       
   101   void initMapsForEdge(Graph::Edge);
       
   102 
       
   103   void readFromFile(const std::string &);
       
   104   void writeToFile(const std::string &);
   104   void writeToFile(const std::string &);
   105 
   105 
   106   void clear();
   106   void clear();
   107 };
   107 };
   108 
   108