broken_edge.h
author hegyi
Sun, 07 Aug 2005 22:14:59 +0000
branchgui
changeset 58 a27ab230a178
parent 30 f70bbee5350a
permissions -rw-r--r--
Until this commitment gui gave us segmentation fault in the case when no element was on graph_displayer_canvas and a map to visualize by a property has been changed.
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
ladanyi@53
     8
#include "all_include.h"
hegyi@17
     9
#include <libgnomecanvasmm.h>
hegyi@17
    10
#include <libgnomecanvasmm/polygon.h>
ladanyi@53
    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