def __init__(self, rows=None, camera=None):
        Controller.__init__(self, camera) 

        self.rows = list([LayoutRow(r) if type(r) is list else r for r in rows or []])
        self._prepared = False 
        self._frames = None
        self.on_keyboard.append(self.keyboard_callback)
Exemplo n.º 2
0
 def __init__(self):
     Controller.__init__(self)
     self._rendered = False
Exemplo n.º 3
0
    def __init__(self,
        camera            = None,
        axis              = [2,2],
        origin            = [0,0],
        axis_units        = [1,1],
        xlabel            = None,
        ylabel            = None,
        title             = None,
        plotmode          = None,
        colorlegend      = None,
        axis_unit_symbols = [None,None],
        axis_subunits     = [4,4],
        color_scheme      = DEFAULT_COLORS,
        on_keyboard = (lambda s,a,p: None),
        graphs            = {},
        axis_measures     = [],
        render_axis = (True, True),
        plotplane_margin=[5, 10, 40, 5],
        plotplane_minsize=(100, 100),
        min_label_space=(0,0),
        widget = None,
        axis_density=(80,80),
    ):
        plot_info('Yo bro', 'plotter cant wait to plot for you')
        Controller.__init__(self, camera)

        if GlApplication.DEBUG:
            color_scheme = DEBUG_COLORS

        self.graphs               = graphs or OrderedDict()
        self.plot_camera          = None
        self.color_scheme         = color_scheme
        self.plotmode = plotmode
        self.widget = widget
        self.colorlegend = colorlegend
        self._on_keyboard = on_keyboard
        if type(plotmode) is str:
            if plotmode not in _PLOTMODE_ALIASES:
                raise ValueError('unkown plotmode "{}". Available aliases are: {}'.format(
                    plotmode, ', '.join(_PLOTMODE_ALIASES.keys())
                ))
            self.plotmode = _PLOTMODE_ALIASES[plotmode][0](
                *_PLOTMODE_ALIASES[plotmode][1],
                **_PLOTMODE_ALIASES[plotmode][2]
            )

        self._axis_measures = axis_measures

        self.on_state = Event()
        self.min_label_space = min_label_space
        self._axis_translation      = (10, 0)
        self._plotplane_margin      = plotplane_margin
        self._plot_plane_min_size   = plotplane_minsize
        self._axis                  = axis
        self._axis_units            = axis_units
        self.colorlegend_speed      = 0.01
        self._xlabel                = xlabel
        self._ylabel                = ylabel
        self._title                 = title
        self._title_font            = None
        self._xlabel_font           = None
        self._ylabel_font           = None
        self._axis_density = axis_density
        self._axis_subunits         = axis_subunits
        self._axis_unit_symbols     = axis_unit_symbols
        self._origin                = origin
        self._margin_changed        = False
        self._plotframe             = None
        self._xaxis                 = None
        self._yaxis                 = None
        self._colorlegend_axis      = None
        self._debug                 = False
        self._fontrenderer          = None
        self._render_axis           = render_axis
        self._axis_texts            = [[],[]]
        self._yboxwidths            = []
        # dstates
        self.render_graphs          = True
        self._graphs_initialized    = False
        self._has_rendered          = False
        self._state                 = 0
        self._select_area           = [0,0,0,0]
        self._select_area_rectangle = None
        self._colorlegend_frame     = None
        self._colorlegend           = None
        self._colorlegend_graph     = None
        self._colorlegend_texts = []

        self.xlabel_text = None
        self.ylabel_text = None
        self.title_text = None

        self._fntrenderer = FontRenderer2()
        self._fntlayout = AlignedLayout(self.camera)
        self.on_cursor.append(self.cursor_reload)
        self.on_keyboard.append(self.keyboard_callback)
        self.on_mouse.append(self.mouse_callback)
        self.on_pre_render.insert(0, self.pre_render)
        self.on_pre_render.insert(0, self.check_graphs)
        self.on_post_render.append(self.post_render)
        self.on_render.append(self.render)

        if self.widget is not None:
            self.widget.attach(self)
Exemplo n.º 4
0
	def __init__(self, camera=None):
		Controller.__init__(self, camera)