COIN-OR::LEMON - Graph Library

Changeset 1524:587a823bcdd0 in lemon-0.x


Ignore:
Timestamp:
06/29/05 17:41:33 (19 years ago)
Author:
Hegyi Péter
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2010
Message:

Function names are corrected according to naming conventions.

Location:
gui
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • gui/broken_edge.cc

    r1505 r1524  
    88  arrow=new Gnome::Canvas::Polygon(g);
    99  *arrow << Gnome::Canvas::Properties::fill_color("red");
    10   arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edge_former_event_handler));
    11   set_points(p);
     10  arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edgeFormerEventHandler));
     11  setPoints(p);
    1212}
    1313
     
    1717}
    1818
    19 void BrokenEdge::set_points(Gnome::Canvas::Points p, bool move)
     19void BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move)
    2020{
    2121  bool set_arrow=false;
     
    104104}
    105105
    106 bool BrokenEdge::edge_former_event_handler(GdkEvent* e)
     106bool BrokenEdge::edgeFormerEventHandler(GdkEvent* e)
    107107{
    108108  switch(e->type)
     
    110110    case GDK_BUTTON_PRESS:
    111111      //we mark the location of the event to be able to calculate parameters of dragging
    112       if(gdc.get_actual_tool()!=CREATE_NODE)
     112      if(gdc.getActualTool()!=CREATE_NODE)
    113113        {
    114           gdc.toggle_edge_activity(this, true);
     114          gdc.toggleEdgeActivity(this, true);
    115115          clicked_x=e->button.x;
    116116          clicked_y=e->button.y;
     
    119119      break;
    120120    case GDK_BUTTON_RELEASE:
    121       if(gdc.get_actual_tool()!=CREATE_NODE)
     121      if(gdc.getActualTool()!=CREATE_NODE)
    122122        {
    123           gdc.toggle_edge_activity(this, false);
     123          gdc.toggleEdgeActivity(this, false);
    124124          isbutton=false;
    125125        }
     
    143143          points_new.push_back(my_points[2]);
    144144
    145           set_points(points_new);
    146           gdc.text_reposition(xy<double>(my_points[1].get_x(),my_points[1].get_y()));
     145          setPoints(points_new);
     146          gdc.textReposition(xy<double>(my_points[1].get_x(),my_points[1].get_y()));
    147147
    148148          clicked_x=e->motion.x;
     
    156156}
    157157
    158 xy<double> BrokenEdge::get_arrow_pos()
     158xy<double> BrokenEdge::getArrowPos()
    159159{
    160160  xy<double> ret_val(my_points[1].get_x(),my_points[1].get_y());
  • gui/broken_edge.h

    r1505 r1524  
    2727
    2828  ///event handler for forming edges
    29   bool edge_former_event_handler(GdkEvent*);
     29  bool edgeFormerEventHandler(GdkEvent*);
    3030 public:
    3131  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
    3232  ~BrokenEdge();
    33   void set_points(Gnome::Canvas::Points, bool move=false);
    34   xy<double> get_arrow_pos();
     33  void setPoints(Gnome::Canvas::Points, bool move=false);
     34  xy<double> getArrowPos();
    3535};
    3636
  • gui/edit_win.cc

    r1494 r1524  
    22#include <set>
    33
    4 bool EditWin::close_if_escape_is_pressed(GdkEventKey* e)
     4bool EditWin::closeIfEscapeIsPressed(GdkEventKey* e)
    55{
    66  if(e->keyval==GDK_Escape)
     
    1616  set_default_size(200, 50);
    1717  set_keep_above(true);
    18   signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close_if_escape_is_pressed));
     18  signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::closeIfEscapeIsPressed));
    1919 
    2020  //buttons array
  • gui/edit_win.h

    r1478 r1524  
    3030  EditWin(const std::string& title, GraphDisplayerCanvas &);
    3131
    32   virtual bool close_if_escape_is_pressed(GdkEventKey*);
     32  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
    3333
    3434  ///Callback function in case of button pression.
  • gui/graph_displayer_canvas-event.cc

    r1512 r1524  
    2121        generated->type=GDK_BUTTON_RELEASE;
    2222        generated->button.button=3;
    23         create_edge_event_handler(generated);     
     23        createEdgeEventHandler(generated);     
    2424    }
    2525
     
    2929    {
    3030    case MOVE:
    31       actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::move_event_handler), false);
     31      actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
    3232      break;
    3333
    3434      //it has to assigned to canvas, because all the canvas has to be monitored, not only the elements of the already drawn group
    3535    case CREATE_NODE:
    36       actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false);
     36      actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false);
    3737      break;
    3838
    3939    case CREATE_EDGE:
    40       actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_edge_event_handler), false);
     40      actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createEdgeEventHandler), false);
    4141      break;
    4242
    4343    case ERASER:
    44       actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraser_event_handler), false);
     44      actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraserEventHandler), false);
    4545      break;
    4646
     
    5050}
    5151
    52 int GraphDisplayerCanvas::get_actual_tool()
     52int GraphDisplayerCanvas::getActualTool()
    5353{
    5454  return actual_tool;
    5555}
    5656
    57 bool GraphDisplayerCanvas::move_event_handler(GdkEvent* e)
     57bool GraphDisplayerCanvas::moveEventHandler(GdkEvent* e)
    5858{
    5959  switch(e->type)
     
    125125            if(isbutton==3)
    126126              {
    127                 edgesmap[ei]->set_points(coos);
     127                edgesmap[ei]->setPoints(coos);
    128128              }
    129129            else
    130130              {
    131                 edgesmap[ei]->set_points(coos,true);
     131                edgesmap[ei]->setPoints(coos,true);
    132132              }
    133133
    134134            //reposition of edgetext
    135             xy<double> text_pos=edgesmap[ei]->get_arrow_pos();
     135            xy<double> text_pos=edgesmap[ei]->getArrowPos();
    136136            text_pos+=(xy<double>(10,10));
    137137            edgetextmap[ei]->property_x().set_value(text_pos.x);
     
    153153            if(isbutton==3)
    154154              {
    155                 edgesmap[ei]->set_points(coos);
     155                edgesmap[ei]->setPoints(coos);
    156156              }
    157157            else
    158158              {
    159                 edgesmap[ei]->set_points(coos,true);
     159                edgesmap[ei]->setPoints(coos,true);
    160160              }
    161161
    162             xy<double> text_pos=edgesmap[ei]->get_arrow_pos();
     162            xy<double> text_pos=edgesmap[ei]->getArrowPos();
    163163            text_pos+=(xy<double>(10,10));
    164164            edgetextmap[ei]->property_x().set_value(text_pos.x);
     
    172172}
    173173
    174 bool GraphDisplayerCanvas::create_node_event_handler(GdkEvent* e)
     174bool GraphDisplayerCanvas::createNodeEventHandler(GdkEvent* e)
    175175{
    176176  switch(e->type)
     
    197197      nodetextmap[active_node]->property_fill_color().set_value("darkblue");
    198198
    199       mapwin->update_node(active_node);
     199      mapwin->updateNode(active_node);
    200200
    201201      break;
     
    210210        generated->motion.y=world_motion_y;
    211211        generated->type=GDK_MOTION_NOTIFY;
    212         move_event_handler(generated);     
     212        moveEventHandler(generated);     
    213213        break;
    214214      }
     
    228228}
    229229
    230 bool GraphDisplayerCanvas::create_edge_event_handler(GdkEvent* e)
     230bool GraphDisplayerCanvas::createEdgeEventHandler(GdkEvent* e)
    231231{
    232232  switch(e->type)
     
    290290
    291291                      //initiating values corresponding to new edge in maps
    292                       mapstorage.init_maps_for_edge(active_edge);
     292                      mapstorage.initMapsForEdge(active_edge);
    293293         
    294294                      //calculating coordinates of new edge
     
    312312
    313313                      //initializing edge-text as well, to empty string
    314                       xy<double> text_pos=edgesmap[active_edge]->get_arrow_pos();
     314                      xy<double> text_pos=edgesmap[active_edge]->getArrowPos();
    315315                      text_pos+=(xy<double>(10,10));
    316316
     
    319319
    320320                      //updating its properties
    321                       mapwin->update_edge(active_edge);
     321                      mapwin->updateEdge(active_edge);
    322322                    }
    323323                  else
     
    362362}
    363363
    364 bool GraphDisplayerCanvas::eraser_event_handler(GdkEvent* e)
     364bool GraphDisplayerCanvas::eraserEventHandler(GdkEvent* e)
    365365{
    366366  switch(e->type)
     
    415415              for(std::set<Graph::Edge>::iterator edge_set_it=edges_to_delete.begin();edge_set_it!=edges_to_delete.end();edge_set_it++)
    416416                {
    417                   delete_item(*edge_set_it);
    418                 }
    419               delete_item(active_node);
     417                  deleteItem(*edge_set_it);
     418                }
     419              deleteItem(active_node);
    420420            }
    421421          //a simple edge was chosen
    422422          else
    423423            {
    424               delete_item(active_edge);
     424              deleteItem(active_edge);
    425425            }
    426426
     
    454454}
    455455
    456 void GraphDisplayerCanvas::delete_item(NodeIt node_to_delete)
     456void GraphDisplayerCanvas::deleteItem(NodeIt node_to_delete)
    457457{
    458458  delete(nodetextmap[node_to_delete]);
     
    461461}
    462462
    463 void GraphDisplayerCanvas::delete_item(EdgeIt edge_to_delete)
     463void GraphDisplayerCanvas::deleteItem(EdgeIt edge_to_delete)
    464464{
    465465  delete(edgetextmap[edge_to_delete]);
     
    468468}
    469469
    470 void GraphDisplayerCanvas::delete_item(Graph::Edge edge_to_delete)
     470void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete)
    471471{
    472472  delete(edgetextmap[edge_to_delete]);
     
    475475}
    476476
    477 void GraphDisplayerCanvas::text_reposition(xy<double> new_place)
     477void GraphDisplayerCanvas::textReposition(xy<double> new_place)
    478478{
    479479  new_place+=(xy<double>(10,10));
     
    482482}
    483483
    484 void GraphDisplayerCanvas::toggle_edge_activity(BrokenEdge* active_bre, bool on)
     484void GraphDisplayerCanvas::toggleEdgeActivity(BrokenEdge* active_bre, bool on)
    485485{
    486486  if(on)
  • gui/graph_displayer_canvas.cc

    r1512 r1524  
    66{
    77 
    8   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false);
     8  actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false);
    99  actual_tool=CREATE_NODE;
    1010
     
    3131    //initializing edge-text as well, to empty string
    3232
    33     xy<double> text_pos=edgesmap[i]->get_arrow_pos();
     33    xy<double> text_pos=edgesmap[i]->getArrowPos();
    3434    text_pos+=(xy<double>(10,10));
    3535
  • gui/graph_displayer_canvas.h

    r1512 r1524  
    7171  ///of the canvas
    7272  ///DEPRECATED!!!!
    73   bool event_handler(GdkEvent* e, Node n);
     73  bool eventHandler(GdkEvent* e, Node n);
    7474
    7575  ///actual event handler
     
    7979
    8080  ///event handler for the case when move-tool is active
    81   bool move_event_handler(GdkEvent*);
     81  bool moveEventHandler(GdkEvent*);
    8282  ///event handler for the case when create_node-tool is active
    83   bool create_node_event_handler(GdkEvent*);
     83  bool createNodeEventHandler(GdkEvent*);
    8484  ///event handler for the case when create_edge-tool is active
    85   bool create_edge_event_handler(GdkEvent*);
     85  bool createEdgeEventHandler(GdkEvent*);
    8686  ///event handler for the case when eraser-tool is active
    87   bool eraser_event_handler(GdkEvent*);
     87  bool eraserEventHandler(GdkEvent*);
    8888  ///event handler for the case when eraser-tool is active
    89   bool edge_map_edit_event_handler(GdkEvent*);
     89  bool edgeMapEditEventHandler(GdkEvent*);
    9090
    9191public:
    9292  ///Moves the text to new place
    93   void text_reposition(xy<double>);
     93  void textReposition(xy<double>);
    9494  ///Activates an edge belonging to a BrokenEdge
    95   void toggle_edge_activity(BrokenEdge*, bool);
     95  void toggleEdgeActivity(BrokenEdge*, bool);
    9696
    9797public:
    9898  ///\return the actual tool in hand
    99   int get_actual_tool();
     99  int getActualTool();
    100100
    101101private:
    102102  ///Deletes the given element.
    103   void delete_item(NodeIt);
     103  void deleteItem(NodeIt);
    104104  ///Deletes the given element.
    105   void delete_item(EdgeIt);
     105  void deleteItem(EdgeIt);
    106106  ///Deletes the given element.
    107   void delete_item(Graph::Edge);
     107  void deleteItem(Graph::Edge);
    108108
    109109private:
    110110
    111111  ///The graph, on which we work
    112   Graph g;
     112  Graph & g;
    113113
    114114  ///Map of nodes of graph
  • gui/map_win.cc

    r1512 r1524  
    22#include <set>
    33
    4 bool MapWin::close_if_escape_is_pressed(GdkEventKey* e)
     4bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e)
    55{
    66  if(e->keyval==GDK_Escape)
     
    1616  set_default_size(200, 50);
    1717
    18   signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::close_if_escape_is_pressed));
     18  signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
    1919
    2020  e_combo_array=new Gtk::Combo [EDGE_PROPERTY_NUM];
     
    7575     sigc::bind
    7676     (
    77       sigc::mem_fun(*this, &MapWin::e_combo_changed),
     77      sigc::mem_fun(*this, &MapWin::eComboChanged),
    7878      i
    7979     )
     
    154154     sigc::bind
    155155     (
    156       sigc::mem_fun(*this, &MapWin::n_combo_changed),
     156      sigc::mem_fun(*this, &MapWin::nComboChanged),
    157157      i
    158158     )
     
    180180}
    181181
    182 void MapWin::e_combo_changed(int prop)
     182void MapWin::eComboChanged(int prop)
    183183{
    184184  Gtk::Entry* entry = e_combo_array[prop].get_entry();
     
    215215};
    216216
    217 void MapWin::n_combo_changed(int prop)
     217void MapWin::nComboChanged(int prop)
    218218{
    219219
     
    251251};
    252252
    253 void MapWin::update_node(Graph::Node node)
     253void MapWin::updateNode(Graph::Node node)
    254254{
    255255  for(int i=0;i<NODE_PROPERTY_NUM;i++)
     
    290290}
    291291
    292 void MapWin::update_edge(Graph::Edge edge)
     292void MapWin::updateEdge(Graph::Edge edge)
    293293{
    294294  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
  • gui/map_win.h

    r1512 r1524  
    4343  ///appropriate function of the \ref GraphDisplayerCanvas
    4444  ///to change the visible values of that attribute.
    45   virtual void e_combo_changed(int);
     45  virtual void eComboChanged(int);
    4646  ///If a radiobutton is clicked, this function determines
    4747  ///which button was that and after that calls the
    4848  ///appropriate function of the \ref GraphDisplayerCanvas
    4949  ///to change the visible values of that attribute.
    50   virtual void n_combo_changed(int);
     50  virtual void nComboChanged(int);
    5151
    5252  ///This function is created to set the appropriate maps on the newly created node
    53   void update_node(Graph::Node);
     53  void updateNode(Graph::Node);
    5454
    5555  ///This function is created to set the appropriate maps on the newly created edge
    56   void update_edge(Graph::Edge);
     56  void updateEdge(Graph::Edge);
    5757
    58   virtual bool close_if_escape_is_pressed(GdkEventKey*);
     58  virtual bool closeIfEscapeIsPressed(GdkEventKey*);
    5959};
    6060
  • gui/mapstorage.cc

    r1512 r1524  
    101101}
    102102
    103 void MapStorage::init_maps_for_edge(Graph::Edge e)
     103void MapStorage::initMapsForEdge(Graph::Edge e)
    104104{
    105105  e=e;
  • gui/mapstorage.h

    r1523 r1524  
    8383
    8484  ///This function sets a default base value for the newly created node
    85   void init_maps_for_node(NodeIt);
     85  void initMapsForNode(NodeIt);
    8686
    8787  ///This function sets a default base value for the newly created node
    88   void init_maps_for_edge(Graph::Edge);
     88  void initMapsForEdge(Graph::Edge);
    8989};
    9090
Note: See TracChangeset for help on using the changeset viewer.