gui/broken_edge.h
author deba
Wed, 09 Nov 2005 12:07:00 +0000
changeset 1781 dca4c8a54e0a
parent 1524 587a823bcdd0
permissions -rw-r--r--
Path length limit for belmann_ford.h
hegyi@1497
     1
// -*- C++ -*- //
hegyi@1497
     2
hegyi@1497
     3
#ifndef BROKEN_EDGE_H
hegyi@1497
     4
#define BROKEN_EDGE_H
hegyi@1497
     5
hegyi@1501
     6
class BrokenEdge;
hegyi@1501
     7
ladanyi@1606
     8
#include "all_include.h"
hegyi@1497
     9
#include <libgnomecanvasmm.h>
hegyi@1497
    10
#include <libgnomecanvasmm/polygon.h>
ladanyi@1606
    11
#include "graph_displayer_canvas.h"
hegyi@1505
    12
#include <lemon/xy.h>
hegyi@1497
    13
hegyi@1497
    14
class BrokenEdge : public Gnome::Canvas::Line
hegyi@1497
    15
{
hegyi@1501
    16
  GraphDisplayerCanvas & gdc;
hegyi@1499
    17
  Gnome::Canvas::Polygon * arrow;
hegyi@1499
    18
  Gnome::Art::Point * my_points;
hegyi@1499
    19
hegyi@1501
    20
hegyi@1499
    21
  ///Indicates whether the button of mouse is pressed or not
hegyi@1499
    22
  bool isbutton;
hegyi@1499
    23
hegyi@1499
    24
  ///At this location was the mousebutton pressed.
hegyi@1499
    25
  ///It helps to calculate the distance of dragging.
hegyi@1499
    26
  double clicked_x, clicked_y;
hegyi@1499
    27
hegyi@1499
    28
  ///event handler for forming edges
hegyi@1524
    29
  bool edgeFormerEventHandler(GdkEvent*);
hegyi@1497
    30
 public:
hegyi@1501
    31
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
hegyi@1499
    32
  ~BrokenEdge();
hegyi@1524
    33
  void setPoints(Gnome::Canvas::Points, bool move=false);
hegyi@1524
    34
  xy<double> getArrowPos();
hegyi@1497
    35
};
hegyi@1497
    36
hegyi@1497
    37
hegyi@1497
    38
#endif //BROKEN_EDGE_H
hegyi@1497
    39