Esempio n. 1
0
    def __init__(self, graphics_view):

        #print 'GUI IS SHUTDOWN??1', rospy.is_shutdown()
        #add scene to QGraphicsView
        scene = qtg.QGraphicsScene()
        graphics_view.setViewport(qtl.QGLWidget())
        #print 'GUI IS SHUTDOWN??11', rospy.is_shutdown()
        self.drawing_widget = NodeBoxGUIHelper(graphics_view.viewport(), scene)
        #print 'GUI IS SHUTDOWN??111', rospy.is_shutdown()
        graphics_view.setScene(scene)
        # TODO: graphics_view._scene = scene
        #print 'GUI IS SHUTDOWN??112', rospy.is_shutdown()
        scene.setItemIndexMethod(qtg.QGraphicsScene.NoIndex)
        #print 'GUI IS SHUTDOWN??113', rospy.is_shutdown()
        scene.addItem(self.drawing_widget)
        #print 'GUI IS SHUTDOWN??2', rospy.is_shutdown()

        #Add NB to scene
        self.namespace = {}
        self.canvas = graphics.Canvas()
        #print 'text scale', QPixmap(1, 1).logicalDpiX() / 72.0
        self.canvas._setTextScaleFactor(qtg.QPixmap(1, 1).logicalDpiX() / 72.0)
        self.context = graphics.Context(self.canvas, self.namespace)

        #Setup the scene
        self.setup()
        self.animationTimer = qtc.QTimer(self)
        self.connect(self.animationTimer, qtc.SIGNAL("timeout()"), self._draw)
        self.animationTimer.start(1000.0 / self.canvas.speed)
Esempio n. 2
0
 def __init__(self):
     # Force NSApp initialisation.
     NSApplication.sharedApplication().activateIgnoringOtherApps_(0)
     self.namespace = {}
     self.canvas = graphics.Canvas()
     self.context = graphics.Context(self.canvas, self.namespace)
     self.__doc__ = {}
     self._pageNumber = 1
     self.frame = 1
Esempio n. 3
0
    def __init__(self):
        # Force QApplication initialisation.
        self.app = QApplication(sys.argv)

        self.namespace = {}
        self.canvas = graphics.Canvas()
        self.context = graphics.Context(self.canvas, self.namespace)
        self.__doc__ = {}
        self._pageNumber = 1
        self.frame = 1
    def __showLinkInfo(self,event):

        widget_id = event.widget.find_closest(event.x,event.y)
        jNode = Widget_to_Node[widget_id[0]]
        #print jNode,self.s1.pAll[jNode].follower
        #import nodebox_graph
        nbg.canvas = nbg.Canvas(width=640, height=480, name="NodeBox for OpenGL", resizable=False)
        nodebox_graph.create_graph(jNode,self.s1)
        nbg.canvas.clear
        #nbg.canvas.size = 700,700
        nbg.canvas.fullscreen = True
        nbg.canvas.run(nodebox_graph.draw)
        del nbg.canvas
Esempio n. 5
0
 def init(self):
     self = super(NodeBoxDocument, self).init()
     nc = NSNotificationCenter.defaultCenter()
     nc.addObserver_selector_name_object_(self, "textFontChanged:", "PyDETextFontChanged", None)
     self.namespace = {}
     self.canvas = graphics.Canvas()
     self.context = graphics.Context(self.canvas, self.namespace)
     self.animationTimer = None
     self.__doc__ = {}
     self._pageNumber = 1
     self._frame = 150
     self.fullScreen = None
     self._seed = time.time()
     self.currentView = self.graphicsView
     return self