pyGLV.GUI.Viewer
Viewer classes, part of the pyGLV
pyGLV (Computer Graphics for Deep Learning and Scientific Visualization)
@Copyright 2021-2022 Dr. George Papagiannakis
The classes below are all related to the GUI and Display part of the package
- Basic design principles are based on the Decorator Design pattern:
-
-
class pyGLV.GUI.Viewer.RenderWindow[source]
The Abstract base class of the Viewer GUI/Display sub-system of pyglGA
based on the Decorator Pattern, this class is “wrapped” by decorators
in order to provide extra cpapabilities e.g. SDL2 window, context and ImGUI widgets
-
property eventManager
Get RenderWindow’s eventManager
-
property scene
Get RenderWindow’s Scene reference
-
abstract accept(system: pyECSS.System, event=None)[source]
Accepts a class object to operate on the RenderWindow, based on the Visitor pattern.
- Parameters
system ([System]) – [a System object]
-
class pyGLV.GUI.Viewer.SDL2Window(windowWidth=None, windowHeight=None, windowTitle=None, scene=None, eventManager=None, openGLversion=4)[source]
The concrete subclass of RenderWindow for the SDL2 GUI API
- Parameters
RenderWindow ([type]) – [description]
-
init()[source]
Initialise an SDL2 RenderWindow, not directly but via the SDL2Decorator
-
init_post()[source]
Post init method for SDL2
this should be ctypiically alled AFTER all other GL contexts have been created
-
display()[source]
Main display window method to be called standalone or from within a concrete Decorator
-
display_post()[source]
To be called at the end of each drawn frame to swap double buffers
-
shutdown()[source]
Shutdown and cleanup SDL2 operations
-
event_input_process(running=True)[source]
process SDL2 basic events and input
-
accept(system: pyECSS.System, event=None)[source]
Accepts a class object to operate on the RenderWindow, based on the Visitor pattern.
- Parameters
system ([System]) – [a System object]
-
class pyGLV.GUI.Viewer.RenderDecorator(wrapee: pyGLV.GUI.Viewer.RenderWindow)[source]
Main Decorator class that wraps a RenderWindow so that all other Decorator classes can dynamically be
adding layered functionality on top of the wrapee (RenderWindow) e.g. ImGUI widgets etc.
- Parameters
RenderWindow ([type]) – [description]
-
init()[source]
[summary]
-
display()[source]
Main decorator display method
-
shutdown()[source]
[summary]
-
event_input_process(running=True)[source]
extra decorator method to handle input events
:param running: [description], defaults to True
:type running: bool, optional
-
display_post()[source]
Post diplay method after all other display calls have been issued
-
init_post()[source]
Post init method
this should be ctypiically alled AFTER all other GL contexts have been created, e.g. ImGUI context
-
accept(system: pyECSS.System, event=None)[source]
Accepts a class object to operate on the RenderWindow, based on the Visitor pattern.
- Parameters
system ([System]) – [a System object]
-
class pyGLV.GUI.Viewer.ImGUIDecorator(wrapee: pyGLV.GUI.Viewer.RenderWindow, imguiContext=None)[source]
ImGUI decorator
- Parameters
RenderDecorator ([type]) – [description]
-
init()[source]
Calls Decoratee init() and also sets up events
-
display()[source]
ImGUI decorator display: calls wrapee (RenderWindow::display) as well as extra ImGUI widgets
-
event_input_process(running=True)[source]
process SDL2 basic events and input
-
display_post()[source]
Post diplay method after all other display calls have been issued
sample ImGUI widgets to be rendered on a RenderWindow
-
scenegraphVisualiser()[source]
display the ECSS in an ImGUI tree node structure
Typically this is a custom widget to be extended in an ImGUIDecorator subclass
-
accept(system: pyECSS.System, event=None)[source]
Accepts a class object to operate on the RenderWindow, based on the Visitor pattern.
- Parameters
system ([System]) – [a System object]
-
class pyGLV.GUI.Viewer.ImGUIecssDecorator(wrapee: pyGLV.GUI.Viewer.RenderWindow, imguiContext=None)[source]
custom ImGUI decorator for this example
- Parameters
ImGUIDecorator ([type]) – [description]
-
scenegraphVisualiser()[source]
display the ECSS in an ImGUI tree node structure
Typically this is a custom widget to be extended in an ImGUIDecorator subclass
-
class pyGLV.GUI.Viewer.RenderGLStateSystem(name=None, type=None, id=None)[source]
System that operates on a RenderDecorator (ImGUIDecorator) and affect GL State
-
update()[source]
method to be subclassed for behavioral or logic computation
-
apply2ImGUIDecorator(imGUIDecorator, event=None)[source]
method for behavioral or logic computation
when visits Components.
In this case update GL State from ImGUIDecorator
-
apply2SDLWindow(sdlWindow, event=None)[source]
method for behavioral or logic computation
when visits Components.
In this case update GL State from SDLWindow
- Parameters
sdlWindow ([type]) – [description]
event ([type], optional) – [description], defaults to None