[GRASS-SVN] r42697 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 2 16:17:15 EDT 2010


Author: martinl
Date: 2010-07-02 20:17:15 +0000 (Fri, 02 Jul 2010)
New Revision: 42697

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
Log:
wxGUI/modeler: close loop
(merge r42696 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-07-02 20:06:19 UTC (rev 42696)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-07-02 20:17:15 UTC (rev 42697)
@@ -1359,9 +1359,20 @@
         
         # close loop
         rel = ModelRelation(action, loop)
-        print action.GetPosition()
         self.AddLine(rel)
-        
+        dx = loop.GetWidth() / 2 + 50
+        dy = action.GetHeight() / 2 + 50
+        rel.MakeLineControlPoints(0)
+        rel.InsertLineControlPoint(point = wx.RealPoint(loop.GetX() - loop.GetWidth() / 2,
+                                                        loop.GetY()))
+        rel.InsertLineControlPoint(point = wx.RealPoint(action.GetX(),
+                                                        action.GetY() + action.GetHeight() / 2))
+        rel.InsertLineControlPoint(point = wx.RealPoint(action.GetX(),
+                                                        action.GetY() + dy))
+        rel.InsertLineControlPoint(point = wx.RealPoint(action.GetX() - dx,
+                                                        action.GetY() + dy))
+        rel.InsertLineControlPoint(point = wx.RealPoint(action.GetX() - dx,
+                                                        loop.GetY()))
         self.canvas.Refresh()
         
 class ModelCanvas(ogl.ShapeCanvas):



More information about the grass-commit mailing list