broken_edge.h
author hegyi
Thu, 28 Jul 2005 15:54:00 +0000
branchgui
changeset 48 b8ec84524fa2
parent 25 c45a34eaa118
child 53 e73d7540bd24
permissions -rw-r--r--
cout->cerr, node radius and edge width is now scaled, maps are editable by clicking on texts.
hegyi@17
     1
// -*- C++ -*- //
hegyi@17
     2
hegyi@17
     3
#ifndef BROKEN_EDGE_H
hegyi@17
     4
#define BROKEN_EDGE_H
hegyi@17
     5
hegyi@21
     6
class BrokenEdge;
hegyi@21
     7
hegyi@17
     8
#include <all_include.h>
hegyi@17
     9
#include <libgnomecanvasmm.h>
hegyi@17
    10
#include <libgnomecanvasmm/polygon.h>
hegyi@21
    11
#include <graph_displayer_canvas.h>
hegyi@25
    12
#include <lemon/xy.h>
hegyi@17
    13
hegyi@17
    14
class BrokenEdge : public Gnome::Canvas::Line
hegyi@17
    15
{
hegyi@21
    16
  GraphDisplayerCanvas & gdc;
hegyi@19
    17
  Gnome::Canvas::Polygon * arrow;
hegyi@19
    18
  Gnome::Art::Point * my_points;
hegyi@19
    19
hegyi@21
    20
hegyi@19
    21
  ///Indicates whether the button of mouse is pressed or not
hegyi@19
    22
  bool isbutton;
hegyi@19
    23
hegyi@19
    24
  ///At this location was the mousebutton pressed.
hegyi@19
    25
  ///It helps to calculate the distance of dragging.
hegyi@19
    26
  double clicked_x, clicked_y;
hegyi@19
    27
hegyi@19
    28
  ///event handler for forming edges
hegyi@30
    29
  bool edgeFormerEventHandler(GdkEvent*);
hegyi@17
    30
 public:
hegyi@21
    31
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
hegyi@19
    32
  ~BrokenEdge();
hegyi@30
    33
  void setPoints(Gnome::Canvas::Points, bool move=false);
hegyi@30
    34
  xy<double> getArrowPos();
hegyi@17
    35
};
hegyi@17
    36
hegyi@17
    37
hegyi@17
    38
#endif //BROKEN_EDGE_H
hegyi@17
    39