COIN-OR::LEMON - Graph Library

Changeset 96:e664d8aa3f72 in glemon-0.x for graph_displayer_canvas.cc


Ignore:
Timestamp:
12/06/05 11:53:38 (18 years ago)
Author:
Hegyi Péter
Branch:
gui
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2414
Message:

Notebook style is provided. Without opportunity to close tabs. :-) But with all other necessary things (I think).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graph_displayer_canvas.cc

    r94 r96  
    22#include <cmath>
    33
    4 GraphDisplayerCanvas::GraphDisplayerCanvas(MainWin & mainw) :
     4GraphDisplayerCanvas::GraphDisplayerCanvas(NoteBookTab & mainw) :
    55  nodesmap(mainw.mapstorage.graph), edgesmap(mainw.mapstorage.graph), edgetextmap(mainw.mapstorage.graph),
    66  nodetextmap(mainw.mapstorage.graph), displayed_graph(*(root()), 0, 0),
    77  isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
    8   edgemap_to_edit(""), mainwin(mainw)
     8  edgemap_to_edit(""), mytab(mainw)
    99{
    1010  //base event handler is move tool
     
    1919GraphDisplayerCanvas::~GraphDisplayerCanvas()
    2020{
    21   for (NodeIt n((mainwin.mapstorage).graph); n != INVALID; ++n)
     21  for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n)
    2222    {
    2323      delete nodesmap[n];
     
    2525    }
    2626 
    27   for (EdgeIt e((mainwin.mapstorage).graph); e != INVALID; ++e)
     27  for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e)
    2828    {
    2929      delete edgesmap[e];
     
    6464  dummy=dummy;
    6565
    66   std::string mapname=mainwin.getActiveNodeMap(prop);
     66  std::string mapname=mytab.getActiveNodeMap(prop);
    6767
    6868  if(mapname!="")
    6969    {
    70       if( ( ((mainwin.mapstorage).nodemap_storage).find(mapname) != ((mainwin.mapstorage).nodemap_storage).end() ) )
     70      if( ( ((mytab.mapstorage).nodemap_storage).find(mapname) != ((mytab.mapstorage).nodemap_storage).end() ) )
    7171        {
    7272          switch(prop)
     
    111111  dummy=dummy;
    112112
    113   std::string mapname=mainwin.getActiveEdgeMap(prop);
     113  std::string mapname=mytab.getActiveEdgeMap(prop);
    114114
    115115  if(mapname!="")
    116116    {
    117       if( ( ((mainwin.mapstorage).edgemap_storage).find(mapname) != ((mainwin.mapstorage).edgemap_storage).end() ) )
     117      if( ( ((mytab.mapstorage).edgemap_storage).find(mapname) != ((mytab.mapstorage).edgemap_storage).end() ) )
    118118        {
    119119          switch(prop)
     
    156156  //first edges are drawn, to hide joining with nodes later
    157157
    158   for (EdgeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
     158  for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
    159159  {
    160160
     
    163163    Gnome::Canvas::Points coos;
    164164    coos.push_back(Gnome::Art::Point(
    165           (mainwin.mapstorage).coords[(mainwin.mapstorage).graph.source(i)].x,
    166           (mainwin.mapstorage).coords[(mainwin.mapstorage).graph.source(i)].y));
     165          (mytab.mapstorage).coords[(mytab.mapstorage).graph.source(i)].x,
     166          (mytab.mapstorage).coords[(mytab.mapstorage).graph.source(i)].y));
    167167    coos.push_back(Gnome::Art::Point(
    168           (mainwin.mapstorage).coords[(mainwin.mapstorage).graph.target(i)].x,
    169           (mainwin.mapstorage).coords[(mainwin.mapstorage).graph.target(i)].y));
     168          (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].x,
     169          (mytab.mapstorage).coords[(mytab.mapstorage).graph.target(i)].y));
    170170   
    171171    edgesmap[i]=new BrokenEdge(displayed_graph, coos, *this);
     
    187187  //afterwards nodes come to be drawn
    188188
    189   for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
     189  for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
    190190  {
    191191    //drawing bule nodes, with black line around them
     
    193193    nodesmap[i]=new Gnome::Canvas::Ellipse(
    194194        displayed_graph,
    195         (mainwin.mapstorage).coords[i].x-20,
    196         (mainwin.mapstorage).coords[i].y-20,
    197         (mainwin.mapstorage).coords[i].x+20,
    198         (mainwin.mapstorage).coords[i].y+20);
     195        (mytab.mapstorage).coords[i].x-20,
     196        (mytab.mapstorage).coords[i].y-20,
     197        (mytab.mapstorage).coords[i].x+20,
     198        (mytab.mapstorage).coords[i].y+20);
    199199    *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue");
    200200    *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
     
    204204
    205205    xy<double> text_pos(
    206         ((mainwin.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),
    207         ((mainwin.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));
     206        ((mytab.mapstorage).coords[i].x+node_property_defaults[N_RADIUS]+5),
     207        ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5));
    208208
    209209    nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph,
     
    223223  forming_edge=INVALID;
    224224
    225   for (NodeIt n((mainwin.mapstorage).graph); n != INVALID; ++n)
     225  for (NodeIt n((mytab.mapstorage).graph); n != INVALID; ++n)
    226226  {
    227227    delete nodesmap[n];
     
    229229  }
    230230
    231   for (EdgeIt e((mainwin.mapstorage).graph); e != INVALID; ++e)
     231  for (EdgeIt e((mytab.mapstorage).graph); e != INVALID; ++e)
    232232  {
    233233    delete edgesmap[e];
Note: See TracChangeset for help on using the changeset viewer.