2 from PyQt4.QtGui import *
3 from PyQt4.QtCore import *
5 class GraphicsScene( View, QGraphicsScene ) :
7 def __init__( self, controller ) :
10 View.__init__( self, controller )
11 QGraphicsScene.__init__( self )
15 rect = QRectF( 0, 0, self.width(), self.height() )
18 def editPoint( self, oldPoint, newPoint ) :
19 polyline = self.getModel()
20 self.getController().editPoint( polyline, oldPoint, newPoint )
23 def editCenter( self, center ) :
24 circle = self.getModel()
25 self.getController().editCenter( circle, center )
28 def editRadius( self, radius ) :
29 circle = self.getModel()
30 self.getController().editRadius( circle, radius )
33 def update( self, mode ) :
34 if mode == 'creation' :
35 self.showInGlobalGraphicsView()
37 elif mode == "showing" :
38 self.showInGlobalGraphicsView()
39 elif mode == 'modification' :
41 self.showInGlobalGraphicsView()
43 elif mode == 'supression' :
44 self.removeFromGlobalGraphicsView()
49 def showInGlobalGraphicsView( self ) :
51 self.getController().getMainFrame().updateGlobalGraphicsView( self )
54 def removeFromGlobalGraphicsView( self ) :
55 self.getController().getMainFrame().updateGlobalGraphicsView( None )
59 print 'Virtual method'
63 for item in self.items() :
64 self.removeItem( item )