[Lemon-commits] [lemon_svn] hegyi: r1978 - hugo/trunk/gui

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:49:13 CET 2006


Author: hegyi
Date: Wed Jun 15 15:05:09 2005
New Revision: 1978

Added:
   hugo/trunk/gui/broken_edge.cc
   hugo/trunk/gui/broken_edge.cc~
   hugo/trunk/gui/broken_edge.h
   hugo/trunk/gui/broken_edge.h~
Modified:
   hugo/trunk/gui/Makefile.am
   hugo/trunk/gui/graph_displayer_canvas.cc

Log:
Broken edges are appearing.

Modified: hugo/trunk/gui/Makefile.am
==============================================================================
--- hugo/trunk/gui/Makefile.am	(original)
+++ hugo/trunk/gui/Makefile.am	Wed Jun 15 15:05:09 2005
@@ -15,7 +15,10 @@
 	map_win.cc \
 	map_win.h \
 	edit_win.cc \
-	edit_win.h
+	edit_win.h \
+	broken_edge.cc \
+	broken_edge.h
+
 
 gd_CXXFLAGS = $(GTK_CFLAGS)
 gd_LDFLAGS = $(GTK_LIBS)

Added: hugo/trunk/gui/broken_edge.cc
==============================================================================
--- (empty file)
+++ hugo/trunk/gui/broken_edge.cc	Wed Jun 15 15:05:09 2005
@@ -0,0 +1,14 @@
+#include <broken_edge.h>
+
+BrokenEdge::BrokenEdge(Gnome::Canvas::Group & g, Gnome::Canvas::Points p) : Line(g)
+{
+  if(p.size()==2)
+    {
+      Gnome::Canvas::Points points_with_center;
+      points_with_center.push_back(p[0]);
+      points_with_center.push_back(Gnome::Art::Point( (p[0].get_x()+p[1].get_x())/2+30 , (p[0].get_y()+p[1].get_y())/2 )+30 );
+      points_with_center.push_back(p[1]);
+      
+      property_points().set_value(points_with_center);
+    }
+}

Added: hugo/trunk/gui/broken_edge.cc~
==============================================================================
--- (empty file)
+++ hugo/trunk/gui/broken_edge.cc~	Wed Jun 15 15:05:09 2005
@@ -0,0 +1,3 @@
+BrokenEdge::BrokenEdge(Group g, Points p)
+{
+}

Added: hugo/trunk/gui/broken_edge.h
==============================================================================
--- (empty file)
+++ hugo/trunk/gui/broken_edge.h	Wed Jun 15 15:05:09 2005
@@ -0,0 +1,18 @@
+// -*- C++ -*- //
+
+#ifndef BROKEN_EDGE_H
+#define BROKEN_EDGE_H
+
+#include <all_include.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class BrokenEdge : public Gnome::Canvas::Line
+{
+ public:
+  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points);
+};
+
+
+#endif //BROKEN_EDGE_H
+

Added: hugo/trunk/gui/broken_edge.h~
==============================================================================
--- (empty file)
+++ hugo/trunk/gui/broken_edge.h~	Wed Jun 15 15:05:09 2005
@@ -0,0 +1,5 @@
+// -*- C++ -*- //
+
+#ifndef BORKEN_EDGE_H
+#define BORKEN_EDGE_H
+

Modified: hugo/trunk/gui/graph_displayer_canvas.cc
==============================================================================
--- hugo/trunk/gui/graph_displayer_canvas.cc	(original)
+++ hugo/trunk/gui/graph_displayer_canvas.cc	Wed Jun 15 15:05:09 2005
@@ -1,4 +1,5 @@
 #include <graph_displayer_canvas.h>
+#include <broken_edge.h>
 #include <math.h>
 
 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(false),active_item(NULL),target_item(NULL)
@@ -22,7 +23,8 @@
     coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y));
     coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y));
     
-    edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
+    //edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
+    edgesmap[i]=new BrokenEdge(displayed_graph, coos);
     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
     edgesmap[i]->property_width_pixels().set_value(10);    
     



More information about the Lemon-commits mailing list