gui/mapstorage.cc
author deba
Wed, 25 Jan 2006 14:40:26 +0000
changeset 1903 f3d24016dad5
parent 1881 f40cdc2057c2
child 1939 591e717155ac
permissions -rw-r--r--
Bug fix
ladanyi@1606
     1
#include "mapstorage.h"
ladanyi@1860
     2
#include "gui_writer.h"
ladanyi@1860
     3
#include "gui_reader.h"
ladanyi@1645
     4
#include <gtkmm.h>
ladanyi@1634
     5
#include <cmath>
ladanyi@1442
     6
deba@1686
     7
#include <cmath>
deba@1686
     8
ladanyi@1860
     9
MapStorage::MapStorage() : modified(false), file_name(""), arrow_pos_read_ok(false)
ladanyi@1442
    10
{
ladanyi@1606
    11
  nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
ladanyi@1606
    12
  coords.setXMap(*nodemap_storage["coordinates_x"]);
ladanyi@1606
    13
  nodemap_storage["coordinates_y"] = new Graph::NodeMap<double>(graph);
ladanyi@1606
    14
  coords.setYMap(*nodemap_storage["coordinates_y"]);
ladanyi@1606
    15
ladanyi@1860
    16
  edgemap_storage["arrow_pos_x"] = new Graph::EdgeMap<double>(graph);
ladanyi@1860
    17
  arrow_pos.setXMap(*edgemap_storage["arrow_pos_x"]);
ladanyi@1860
    18
  edgemap_storage["arrow_pos_y"] = new Graph::EdgeMap<double>(graph);
ladanyi@1860
    19
  arrow_pos.setYMap(*edgemap_storage["arrow_pos_y"]);
ladanyi@1860
    20
ladanyi@1606
    21
  nodemap_storage["id"] = new Graph::NodeMap<double>(graph);
ladanyi@1606
    22
  edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
ladanyi@1646
    23
ladanyi@1646
    24
  nodemap_default["id"] = 1.0;
ladanyi@1646
    25
  edgemap_default["id"] = 1.0;
hegyi@1837
    26
hegyi@1837
    27
  active_nodemaps.resize(NODE_PROPERTY_NUM);
hegyi@1837
    28
  for(int i=0;i<NODE_PROPERTY_NUM;i++)
hegyi@1837
    29
    {
hegyi@1837
    30
      active_nodemaps[i]="";
hegyi@1837
    31
    }
hegyi@1837
    32
hegyi@1837
    33
  active_edgemaps.resize(EDGE_PROPERTY_NUM);
hegyi@1837
    34
  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
hegyi@1837
    35
    {
hegyi@1837
    36
      active_edgemaps[i]="";
hegyi@1837
    37
    }
ladanyi@1606
    38
}
ladanyi@1606
    39
ladanyi@1606
    40
MapStorage::~MapStorage()
ladanyi@1606
    41
{
ladanyi@1606
    42
  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
ladanyi@1606
    43
      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
ladanyi@1606
    44
  {
ladanyi@1606
    45
    delete it->second;
ladanyi@1606
    46
  }
ladanyi@1606
    47
  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
ladanyi@1606
    48
      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
ladanyi@1606
    49
  {
ladanyi@1606
    50
    delete it->second;
ladanyi@1606
    51
  }
ladanyi@1606
    52
}
ladanyi@1442
    53
hegyi@1888
    54
int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap, double default_value)
ladanyi@1442
    55
{
hegyi@1888
    56
  std::cout << default_value << std::endl;
hegyi@1597
    57
  if( nodemap_storage.find(name) == nodemap_storage.end() )
hegyi@1597
    58
    {
hegyi@1597
    59
      nodemap_storage[name]=nodemap;
ladanyi@1645
    60
      // set the maps default value
ladanyi@1645
    61
      nodemap_default[name] = default_value;
hegyi@1878
    62
hegyi@1878
    63
      //announce changement in maps
hegyi@1878
    64
      signal_node_map.emit(name);
hegyi@1597
    65
      return 0;
hegyi@1597
    66
    }
hegyi@1597
    67
  return 1;
ladanyi@1442
    68
}
ladanyi@1442
    69
hegyi@1837
    70
void MapStorage::changeActiveMap(bool itisedge, int prop, std::string mapname)
hegyi@1837
    71
{
hegyi@1837
    72
  if(itisedge)
hegyi@1837
    73
    {
hegyi@1837
    74
      active_edgemaps[prop]=mapname;
hegyi@1837
    75
    }
hegyi@1837
    76
  else
hegyi@1837
    77
    {
hegyi@1837
    78
      active_nodemaps[prop]=mapname;
hegyi@1837
    79
    }
hegyi@1837
    80
  signal_prop.emit(itisedge, prop);
hegyi@1837
    81
}
hegyi@1837
    82
hegyi@1837
    83
std::string MapStorage::getActiveEdgeMap(int prop)
hegyi@1837
    84
{
hegyi@1837
    85
  return active_edgemaps[prop];
hegyi@1837
    86
}
hegyi@1837
    87
hegyi@1837
    88
std::string MapStorage::getActiveNodeMap(int prop)
hegyi@1837
    89
{
hegyi@1837
    90
  return active_nodemaps[prop];
hegyi@1837
    91
}
hegyi@1837
    92
hegyi@1837
    93
std::vector<std::string> MapStorage::getEdgeMapList()
hegyi@1837
    94
{
hegyi@1837
    95
  std::vector<std::string> eml;
hegyi@1837
    96
  eml.resize(edgemap_storage.size());
hegyi@1837
    97
  int i=0;
hegyi@1837
    98
  std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=beginOfEdgeMaps();
hegyi@1837
    99
  for(;emsi!=endOfEdgeMaps();emsi++)
hegyi@1837
   100
    {
hegyi@1837
   101
      eml[i]=(emsi->first);
hegyi@1837
   102
      i++;
hegyi@1837
   103
    }
hegyi@1837
   104
  return eml;
hegyi@1837
   105
}
hegyi@1837
   106
hegyi@1837
   107
std::vector<std::string> MapStorage::getNodeMapList()
hegyi@1837
   108
{
hegyi@1837
   109
  std::vector<std::string> nml;
hegyi@1837
   110
  nml.resize(nodemap_storage.size());
hegyi@1837
   111
  int i=0;
hegyi@1837
   112
  std::map< std::string,Graph::NodeMap<double> * >::iterator nmsi=beginOfNodeMaps();
hegyi@1837
   113
  for(;nmsi!=endOfNodeMaps();nmsi++)
hegyi@1837
   114
    {
hegyi@1837
   115
      nml[i]=(nmsi->first);
hegyi@1837
   116
      i++;
hegyi@1837
   117
    }
hegyi@1837
   118
  return nml;
hegyi@1837
   119
}
hegyi@1837
   120
hegyi@1837
   121
MapStorage::Signal_Prop MapStorage::signal_prop_ch()
hegyi@1837
   122
{
hegyi@1837
   123
  return signal_prop;
hegyi@1837
   124
}
hegyi@1837
   125
hegyi@1888
   126
int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap, double default_value)
ladanyi@1442
   127
{
hegyi@1597
   128
  if( edgemap_storage.find(name) == edgemap_storage.end() )
hegyi@1597
   129
    {
hegyi@1597
   130
      edgemap_storage[name]=edgemap;
ladanyi@1645
   131
      // set the maps default value
ladanyi@1645
   132
      edgemap_default[name] = default_value;
hegyi@1878
   133
hegyi@1878
   134
      //announce changement in maps
hegyi@1878
   135
      signal_edge_map.emit(name);
hegyi@1597
   136
      return 0;
hegyi@1597
   137
    }
hegyi@1597
   138
  return 1;
ladanyi@1442
   139
}
ladanyi@1442
   140
ladanyi@1442
   141
double MapStorage::maxOfNodeMap(const std::string & name)
ladanyi@1442
   142
{
ladanyi@1442
   143
  double max=0;
ladanyi@1606
   144
  for (NodeIt j(graph); j!=INVALID; ++j)
ladanyi@1442
   145
  {
ladanyi@1442
   146
    if( (*nodemap_storage[name])[j]>max )
ladanyi@1442
   147
    {
ladanyi@1442
   148
      max=(*nodemap_storage[name])[j];
ladanyi@1442
   149
    }
ladanyi@1442
   150
  }
ladanyi@1442
   151
  return max;
ladanyi@1442
   152
}
ladanyi@1442
   153
ladanyi@1442
   154
double MapStorage::maxOfEdgeMap(const std::string & name)
ladanyi@1442
   155
{
ladanyi@1442
   156
  double max=0;
ladanyi@1606
   157
  for (EdgeIt j(graph); j!=INVALID; ++j)
ladanyi@1442
   158
  {
ladanyi@1442
   159
    if( (*edgemap_storage[name])[j]>max )
ladanyi@1442
   160
    {
ladanyi@1442
   161
      max=(*edgemap_storage[name])[j];
ladanyi@1442
   162
    }
ladanyi@1442
   163
  }
ladanyi@1442
   164
  return max;
ladanyi@1442
   165
}
ladanyi@1442
   166
ladanyi@1442
   167
double MapStorage::minOfNodeMap(const std::string & name)
ladanyi@1442
   168
{
ladanyi@1606
   169
  NodeIt j(graph);
hegyi@1617
   170
  double min;
hegyi@1617
   171
  if(j!=INVALID)
hegyi@1617
   172
    {
hegyi@1617
   173
      min=(*nodemap_storage[name])[j];
hegyi@1617
   174
    }
hegyi@1617
   175
  else
hegyi@1617
   176
    {
hegyi@1617
   177
      min=0;
hegyi@1617
   178
    }
ladanyi@1442
   179
  for (; j!=INVALID; ++j)
ladanyi@1442
   180
  {
ladanyi@1442
   181
    if( (*nodemap_storage[name])[j]<min )
ladanyi@1442
   182
    {
ladanyi@1442
   183
      min=(*nodemap_storage[name])[j];
ladanyi@1442
   184
    }
ladanyi@1442
   185
  }
ladanyi@1442
   186
  return min;
ladanyi@1442
   187
}
ladanyi@1442
   188
ladanyi@1442
   189
double MapStorage::minOfEdgeMap(const std::string & name)
ladanyi@1442
   190
{
ladanyi@1606
   191
  EdgeIt j(graph);
hegyi@1617
   192
  double min;
hegyi@1617
   193
  if(j!=INVALID)
hegyi@1617
   194
    {
hegyi@1617
   195
      min=(*edgemap_storage[name])[j];
hegyi@1617
   196
    }
hegyi@1617
   197
  else
hegyi@1617
   198
    {
hegyi@1617
   199
      min=0;
hegyi@1617
   200
    }
ladanyi@1606
   201
  for (EdgeIt j(graph); j!=INVALID; ++j)
ladanyi@1442
   202
  {
ladanyi@1442
   203
    if( (*edgemap_storage[name])[j]<min )
ladanyi@1442
   204
    {
ladanyi@1442
   205
      min=(*edgemap_storage[name])[j];
ladanyi@1442
   206
    }
ladanyi@1442
   207
  }
ladanyi@1442
   208
  return min;
ladanyi@1442
   209
}
ladanyi@1442
   210
ladanyi@1645
   211
int MapStorage::readFromFile(const std::string &filename)
ladanyi@1606
   212
{
ladanyi@1606
   213
  bool read_x = false;
ladanyi@1606
   214
  bool read_y = false;
ladanyi@1646
   215
  bool read_edge_id = false;
ladanyi@1606
   216
ladanyi@1606
   217
  try {
ladanyi@1606
   218
    LemonReader lreader(filename);
ladanyi@1606
   219
    ContentReader content(lreader);
ladanyi@1606
   220
    lreader.run();
ladanyi@1606
   221
ladanyi@1867
   222
    if (content.nodeSetNum() < 1)
ladanyi@1867
   223
    {
ladanyi@1867
   224
      Gtk::MessageDialog mdialog("No nodeset found in file.");
ladanyi@1867
   225
      mdialog.run();
ladanyi@1867
   226
      clear();
ladanyi@1867
   227
      return 1;
ladanyi@1867
   228
    }
ladanyi@1867
   229
ladanyi@1867
   230
    if (content.edgeSetNum() < 1)
ladanyi@1867
   231
    {
ladanyi@1867
   232
      Gtk::MessageDialog mdialog("No edgeset found in file.");
ladanyi@1867
   233
      mdialog.run();
ladanyi@1867
   234
      clear();
ladanyi@1867
   235
      return 1;
ladanyi@1867
   236
    }
ladanyi@1867
   237
ladanyi@1606
   238
    const std::vector<std::string>& nodeMapNames = content.nodeSetMaps(0);
ladanyi@1606
   239
    const std::vector<std::string>& edgeMapNames = content.edgeSetMaps(0);
ladanyi@1606
   240
ladanyi@1606
   241
    GraphReader<Graph> greader(filename, graph);
ladanyi@1606
   242
    for (std::vector<std::string>::const_iterator it = nodeMapNames.begin();
ladanyi@1606
   243
        it != nodeMapNames.end(); ++it)
ladanyi@1606
   244
    {
ladanyi@1606
   245
      if (*it == "coordinates_x")
ladanyi@1606
   246
      {
ladanyi@1606
   247
        read_x = true;
ladanyi@1606
   248
        //std::cout << "read X nodemap" << std::endl;
ladanyi@1606
   249
      }
ladanyi@1606
   250
      else if (*it == "coordinates_y")
ladanyi@1606
   251
      {
ladanyi@1606
   252
        read_y = true;
ladanyi@1606
   253
        //std::cout << "read Y nodemap" << std::endl;
ladanyi@1606
   254
      }
ladanyi@1606
   255
      else if (*it == "id")
ladanyi@1606
   256
      {
ladanyi@1606
   257
        //std::cout << "read id nodemap" << std::endl;
ladanyi@1606
   258
      }
ladanyi@1606
   259
      else
ladanyi@1606
   260
      {
ladanyi@1606
   261
        nodemap_storage[*it] = new Graph::NodeMap<double>(graph);
ladanyi@1606
   262
        //std::cout << "read " << *it << " nodemap" << std::endl;
ladanyi@1606
   263
      }
ladanyi@1606
   264
      greader.readNodeMap(*it, *nodemap_storage[*it]);
ladanyi@1606
   265
    }
ladanyi@1606
   266
    for (std::vector<std::string>::const_iterator it = edgeMapNames.begin();
ladanyi@1606
   267
        it != edgeMapNames.end(); ++it)
ladanyi@1606
   268
    {
ladanyi@1606
   269
      if (*it == "id")
ladanyi@1606
   270
      {
ladanyi@1606
   271
        //std::cout << "read id edgemap" << std::endl;
ladanyi@1606
   272
      }
ladanyi@1606
   273
      else
ladanyi@1606
   274
      {
ladanyi@1606
   275
        edgemap_storage[*it] = new Graph::EdgeMap<double>(graph);
ladanyi@1606
   276
        //std::cout << "read " << *it << " edgemap" << std::endl;
ladanyi@1606
   277
      }
ladanyi@1606
   278
      greader.readEdgeMap(*it, *edgemap_storage[*it]);
ladanyi@1606
   279
    }
ladanyi@1860
   280
    GuiReader gui_reader(greader, this);
ladanyi@1606
   281
    greader.run();
ladanyi@1867
   282
  } catch (Exception& error) {
ladanyi@1708
   283
    Gtk::MessageDialog mdialog(error.what());
ladanyi@1606
   284
    mdialog.run();
ladanyi@1645
   285
    clear();
ladanyi@1645
   286
    return 1;
ladanyi@1606
   287
  }
ladanyi@1606
   288
ladanyi@1646
   289
  if (!read_edge_id)
ladanyi@1646
   290
  {
ladanyi@1646
   291
    edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
ladanyi@1646
   292
    int i = 1;
ladanyi@1646
   293
    for (EdgeIt e(graph); e != INVALID; ++e)
ladanyi@1646
   294
    {
ladanyi@1646
   295
      (*edgemap_storage["id"])[e] = i++;
ladanyi@1646
   296
    }
ladanyi@1646
   297
  }
ladanyi@1646
   298
ladanyi@1606
   299
  if (!read_x || !read_y)
ladanyi@1606
   300
  {
ladanyi@1606
   301
    int node_num = 0;
ladanyi@1606
   302
    for (NodeIt n(graph); n != INVALID; ++n)
ladanyi@1606
   303
    {
ladanyi@1606
   304
      node_num++;
ladanyi@1606
   305
    }
ladanyi@1606
   306
    const double pi = 3.142;
ladanyi@1606
   307
    double step = 2 * pi / (double) node_num;
ladanyi@1606
   308
    int i = 0;
ladanyi@1606
   309
    for (NodeIt n(graph); n != INVALID; ++n)
ladanyi@1606
   310
    {
deba@1686
   311
      nodemap_storage["coordinates_x"]->set(n, 250.0 * std::cos(i * step));
deba@1686
   312
      nodemap_storage["coordinates_y"]->set(n, 250.0 * std::sin(i * step));
ladanyi@1606
   313
      i++;
ladanyi@1606
   314
    }
ladanyi@1606
   315
  }
ladanyi@1645
   316
ladanyi@1860
   317
  if (!arrow_pos_read_ok)
ladanyi@1860
   318
  {
ladanyi@1860
   319
    arrow_pos_read_ok = false;
ladanyi@1860
   320
    for (EdgeIt e(graph); e != INVALID; ++e)
ladanyi@1860
   321
    {
ladanyi@1860
   322
      arrow_pos.set(e, (coords[graph.source(e)] + coords[graph.target(e)]) / 2.0);
ladanyi@1860
   323
    }
ladanyi@1860
   324
  }
ladanyi@1860
   325
ladanyi@1645
   326
  // fill in the default values for the maps
ladanyi@1645
   327
  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
ladanyi@1645
   328
      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
ladanyi@1645
   329
  {
ladanyi@1645
   330
    if ((it->first != "id") &&
ladanyi@1645
   331
        (it->first != "coordiantes_x") &&
ladanyi@1645
   332
        (it->first != "coordinates_y"))
ladanyi@1645
   333
    {
ladanyi@1645
   334
      nodemap_default[it->first] = 0.0;
ladanyi@1645
   335
    }
ladanyi@1646
   336
    else if (it->first == "id")
ladanyi@1646
   337
    {
ladanyi@1646
   338
      NodeIt n(graph);
ladanyi@1646
   339
      double max = (*nodemap_storage["id"])[n];
ladanyi@1646
   340
      for (; n != INVALID; ++n)
ladanyi@1646
   341
      {
ladanyi@1646
   342
        if ((*nodemap_storage["id"])[n] > max)
ladanyi@1646
   343
          max = (*nodemap_storage["id"])[n];
ladanyi@1646
   344
      }
ladanyi@1646
   345
      nodemap_default["id"] = max + 1.0;
ladanyi@1646
   346
    }
ladanyi@1645
   347
  }
ladanyi@1645
   348
  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
ladanyi@1645
   349
      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
ladanyi@1645
   350
  {
ladanyi@1645
   351
    if (it->first != "id")
ladanyi@1645
   352
    {
ladanyi@1645
   353
      edgemap_default[it->first] = 0.0;
ladanyi@1645
   354
    }
ladanyi@1646
   355
    else
ladanyi@1646
   356
    {
ladanyi@1649
   357
      double max = std::numeric_limits<double>::min();
ladanyi@1649
   358
      for (EdgeIt e(graph); e != INVALID; ++e)
ladanyi@1646
   359
      {
ladanyi@1646
   360
        if ((*edgemap_storage["id"])[e] > max)
ladanyi@1646
   361
          max = (*edgemap_storage["id"])[e];
ladanyi@1646
   362
      }
ladanyi@1649
   363
      if (max > std::numeric_limits<double>::min())
ladanyi@1649
   364
        edgemap_default["id"] = max + 1.0;
ladanyi@1649
   365
      else
ladanyi@1649
   366
        edgemap_default["id"] = 1.0;
ladanyi@1646
   367
    }
ladanyi@1645
   368
  }
ladanyi@1645
   369
ladanyi@1645
   370
  return 0;
ladanyi@1606
   371
}
ladanyi@1606
   372
ladanyi@1606
   373
void MapStorage::writeToFile(const std::string &filename)
ladanyi@1606
   374
{
ladanyi@1606
   375
  GraphWriter<Graph> gwriter(filename, graph);
ladanyi@1606
   376
ladanyi@1606
   377
  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
ladanyi@1606
   378
      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
ladanyi@1606
   379
  {
ladanyi@1606
   380
    gwriter.writeNodeMap(it->first, *(it->second));
ladanyi@1606
   381
  }
ladanyi@1606
   382
  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
ladanyi@1606
   383
      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
ladanyi@1606
   384
  {
ladanyi@1860
   385
    if ((it->first != "arrow_pos_x") &&
ladanyi@1860
   386
        (it->first != "arrow_pos_y"))
ladanyi@1860
   387
    {
ladanyi@1860
   388
      gwriter.writeEdgeMap(it->first, *(it->second));
ladanyi@1860
   389
    }
ladanyi@1606
   390
  }
ladanyi@1860
   391
ladanyi@1860
   392
  GuiWriter gui_writer(gwriter, this);
ladanyi@1860
   393
ladanyi@1606
   394
  gwriter.run();
ladanyi@1606
   395
}
ladanyi@1606
   396
ladanyi@1606
   397
void MapStorage::clear()
ladanyi@1606
   398
{
ladanyi@1606
   399
  for (std::map<std::string, Graph::NodeMap<double>*>::iterator it =
ladanyi@1606
   400
      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
ladanyi@1606
   401
  {
ladanyi@1606
   402
    if ((it->first != "coordinates_x") &&
ladanyi@1606
   403
        (it->first != "coordinates_y") &&
ladanyi@1606
   404
        (it->first != "id"))
ladanyi@1606
   405
    {
ladanyi@1606
   406
      delete it->second;
ladanyi@1606
   407
      nodemap_storage.erase(it);
ladanyi@1606
   408
    }
ladanyi@1606
   409
  }
ladanyi@1606
   410
  for (std::map<std::string, Graph::EdgeMap<double>*>::iterator it =
ladanyi@1606
   411
      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
ladanyi@1606
   412
  {
ladanyi@1860
   413
    if ((it->first != "id") &&
ladanyi@1860
   414
        (it->first != "arrow_pos_x") &&
ladanyi@1860
   415
        (it->first != "arrow_pos_y"))
ladanyi@1606
   416
    {
ladanyi@1606
   417
      delete it->second;
ladanyi@1606
   418
      edgemap_storage.erase(it);
ladanyi@1606
   419
    }
ladanyi@1606
   420
  }
ladanyi@1645
   421
  for (std::map<std::string, double>::iterator it =
ladanyi@1645
   422
      nodemap_default.begin(); it != nodemap_default.end(); ++it)
ladanyi@1645
   423
  {
ladanyi@1646
   424
    if (it->first != "id")
ladanyi@1646
   425
      nodemap_default.erase(it);
ladanyi@1645
   426
  }
ladanyi@1645
   427
  for (std::map<std::string, double>::iterator it =
ladanyi@1645
   428
      edgemap_default.begin(); it != edgemap_default.end(); ++it)
ladanyi@1645
   429
  {
ladanyi@1646
   430
    if (it->first != "id")
ladanyi@1646
   431
      edgemap_default.erase(it);
ladanyi@1645
   432
  }
ladanyi@1606
   433
  graph.clear();
ladanyi@1606
   434
  file_name = "";
ladanyi@1606
   435
  modified = false;
ladanyi@1606
   436
}
ladanyi@1860
   437
ladanyi@1860
   438
void MapStorage::ArrowPosReadOK()
ladanyi@1860
   439
{
ladanyi@1860
   440
  arrow_pos_read_ok = true;
ladanyi@1860
   441
}
hegyi@1881
   442
hegyi@1881
   443
void MapStorage::mapChanged(bool itisedge, std::string mapname)
hegyi@1881
   444
{
hegyi@1881
   445
  if(itisedge)
hegyi@1881
   446
    {
hegyi@1881
   447
      for(int i=0;i<EDGE_PROPERTY_NUM;i++)
hegyi@1881
   448
	{
hegyi@1881
   449
	  if(active_edgemaps[i]==mapname)
hegyi@1881
   450
	    {
hegyi@1881
   451
	      signal_prop.emit(itisedge, i);
hegyi@1881
   452
	    }
hegyi@1881
   453
	}
hegyi@1881
   454
    }
hegyi@1881
   455
  else
hegyi@1881
   456
    {
hegyi@1881
   457
      for(int i=0;i<NODE_PROPERTY_NUM;i++)
hegyi@1881
   458
	{
hegyi@1881
   459
	  if(active_nodemaps[i]==mapname)
hegyi@1881
   460
	    {
hegyi@1881
   461
	      signal_prop.emit(itisedge, i);
hegyi@1881
   462
	    }
hegyi@1881
   463
	}
hegyi@1881
   464
    }
hegyi@1881
   465
}