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