Shape keeping movement is implemented, at last. Many thanks to Alpar.
6 #include "all_include.h"
9 ///Class MapStorage is responsible for storing
10 ///NodeMaps and EdgeMaps that can be shown later
11 ///on GUI. Therefore maps can be added to it,
12 ///and datas over the added maps can be queried.
13 ///The maps will be stored in an std::map,
14 ///referenced with their names. Unfortunately at
15 ///the moment it works only with double type maps
17 ///\todo too many things are public!!
23 XYMap<Graph::NodeMap<double> > coords;
26 std::string file_name;
28 ///Stores double type NodeMaps
29 std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
31 ///Stores double type EdgeMaps
32 std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
34 //Stores the default values for the different visualization node attributes
35 std::vector<Graph::NodeMap<double> > default_nodemaps;
37 //Stores the default values for the different visualization edge attributes
38 std::vector<Graph::EdgeMap<double> > default_edgemaps;
40 // Default values for the maps
41 std::map< std::string, double > nodemap_default;
43 // Default values for the maps
44 std::map< std::string, double > edgemap_default;
47 ///Constructor of MapStorage. Expects the Graph of
48 ///which maps will be stored in it.
49 ///Its all activity is initializing default values
50 ///for different visualization attributes
52 ///\param graph is the graph for which the maps are stored in this object.
57 ///Adds given map to storage. A name and the map itself has to be provided.
58 ///\param name is the name of map
59 ///\nodemap is the pointer of the given nodemap
60 ///\todo map should be given by reference!
61 int addNodeMap(const std::string &,Graph::NodeMap<double> *, double);
63 ///Adds given map to storage. A name and the map itself has to be provided.
64 ///\param name is the name of map
65 ///\edgemap is the pointer of the given edgemap
66 ///\todo map should be given by reference!
67 int addEdgeMap(const std::string &,Graph::EdgeMap<double> *, double);
69 ///Returns how much nodemaps is stored in \ref MapStorage
70 int numOfNodeMaps() {return nodemap_storage.size();};
72 ///Returns how much edgemaps is stored in \ref MapStorage
73 int numOfEdgeMaps() {return edgemap_storage.size();};
75 ///Returns the maximum value of the given NodeMap. NodeMap has to be given by its name.
76 ///\param name is the name of map of which maximum is searched
77 double maxOfNodeMap(const std::string &);
79 ///Returns the maximum value of the given EdgeMap. EdgeMap has to be given by its name.
80 ///\param name is the name of map of which maximum is searched
81 double maxOfEdgeMap(const std::string &);
83 ///Returns the minimum value of the given NodeMap. NodeMap has to be given by its name.
84 ///\param name is the name of map of which minimum is searched
85 double minOfNodeMap(const std::string &);
87 ///Returns the minimum value of the given EdgeMap. EdgeMap has to be given by its name.
88 ///\param name is the name of map of which minimum is searched
89 double minOfEdgeMap(const std::string &);
91 ///To be able to iterate through each maps this function returns an iterator pointing to the first nodemap in the storage.
92 std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
94 ///To be able to iterate through each maps this function returns an iterator pointing to the first edgemap in the storage.
95 std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
97 ///To be able to iterate through each maps this function returns an iterator pointing to the last nodemap in the storage.
98 std::map< std::string,Graph::NodeMap<double> * >::iterator endOfNodeMaps(){return nodemap_storage.end();};
100 ///To be able to iterate through each maps this function returns an iterator pointing to the last edgemap in the storage.
101 std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();};
103 int readFromFile(const std::string &);
104 void writeToFile(const std::string &);
109 #endif //MAPSTORAGE_H