OpenGLContext.wxinteractivecontext
index
p:\openglcontext\wxinteractivecontext.py

Interactive context using the wxPython API (provides navigation support)

 
Modules
            
clip_dndc
cmndlgsc
OpenGLContext.context
controls2c
controlsc
eventsc
filesysc
fontsc
framesc
gdic
imagec
OpenGLContext.interactivecontext
mdic
misc2c
miscc
printfwc
sizersc
stattoolc
streamsc
sys
types
utilsc
OpenGLContext.viewplatformmixin
windows2c
windows3c
windowsc
wxPython.wx
wxPython.wxc
OpenGLContext.wxcontext
 
Classes
            
InteractiveContext(EventHandlerMixin)
wxInteractiveContext(ViewPlatformMixin, InteractiveContext, wxContext)
ViewPlatformMixin
wxInteractiveContext(ViewPlatformMixin, InteractiveContext, wxContext)
wxContext(wxGLCanvas, EventHandlerMixin, Context)
wxInteractiveContext(ViewPlatformMixin, InteractiveContext, wxContext)
 
class wxInteractiveContext(ViewPlatformMixin, InteractiveContext, wxContext)
      Sub-class of Context providing navigation support
 
This is basically just a shell class which inherits
all of its functionality from its superclasses.
 
  
Method resolution order:
wxInteractiveContext
ViewPlatformMixin
InteractiveContext
EventHandlerMixin
wxContext
wxGLCanvas
wxGLCanvasPtr
wxWindowPtr
wxEvtHandlerPtr
wxObjectPtr
EventHandlerMixin
Context

Data and non-method functions defined here:
__doc__ = 'Sub-class of Context providing navigation suppor...all of its functionality from its superclasses.\n\t'
__module__ = 'OpenGLContext.wxinteractivecontext'

Methods inherited from ViewPlatformMixin:
ViewPort(self, width, height)
Set the size of the OpenGL rendering viewport for the context
 
Because the ViewPlatform provide support for
"constant aspect ratio" in scenes, it is necessary
to keep the ViewPlatform updated regarding the current
aspect ratio of the ViewPort.  This implementation
merely calls the platform's setViewport, then
calls the super-class ViewPort method.
 
XXX
        Unfortunately, because Context objects may be
        old-style classes, we can't use super(), so
        this implementation actually calls
        context.Context.ViewPort directly.
Viewpoint(self, mode=None)
Customization point: Sets up the projection matrix
 
This implementation potentially instantiates the
view platform object, and then calls the object's
render method with the mode as argument.
backward(self, event)
(callback) Move platform backward by STEPDISTANCE
 
triggers redraw after completion
down(self, event)
(callback) Move platform downward by STEPDISTANCE
 
triggers redraw after completion
forward(self, event)
(callback) Move platform forward by STEPDISTANCE
 
triggers redraw after completion
getViewPlatform(self)
Customization Point: Instantiate ViewPlatform for this context
 
The default implementation is to instantiate a
viewplatform.ViewPlatform with position equal to
self.initialPosition and orientation equal to
self.initialOrientation.
 
See:
        OpenGLContext.shadow.shadowcontext for
        example where this method is overridden
left(self, event)
(callback) Move platform left by STEPDISTANCE
 
triggers redraw after completion
right(self, event)
(callback) Move platform right by STEPDISTANCE
 
triggers redraw after completion
setupDefaultEventCallbacks(self)
Customization point: Setup application default callbacks
 
This method binds a large number of callbacks which support
the OpenGLContext default camera-manipulation modes.  In
particular:
        * unmodified arrow keys for x,z (in camera coordinate
                space) movement
        * Alt+arrow keys for x,y (in camera coordinate space)
                movement
        * Ctrl+up/down arrow keys for rotating the head backward/
                forward
        * Mouse-button-2 (right) for entering "examine" mode
        * '-' for straightening the view platform
startExamineMode(self, event)
(callback) Create an examine mode interaction manager
 
This callback creates an instance of
examinemanager.ExamineManager, which will manage
the user interaction during an "examination" of
the scene.
 
XXX
        Currently the "center" determination is broken,
        so rotation tends to occur around random points.
        I haven't yet figured out why :(
straighten(self, event)
(callback) Straightens the platform orientation
 
Attempts to make the orientation equal to the
y-axis orientation of the current orientation.
 
In other words, tries to make the camera's horizon
equal to the object-space horizon (the x,z plane)
without altering the y-axis orientation.
 
See:
        OpenGLContext.viewplatform.ViewPlatform.straighten
 
triggers redraw after completion
turndown(self, event)
(callback) Rotates "head" forward (looks downward) by TURNANGLE
 
triggers redraw after completion
turnleft(self, event)
(callback) Rotates "head" to the left by TURNANGLE
 
triggers redraw after completion
turnright(self, event)
(callback) Rotates "head" to the right by TURNANGLE
 
triggers redraw after completion
turnup(self, event)
(callback) Rotates "head" backward (looks upward) by TURNANGLE
 
triggers redraw after completion
up(self, event)
(callback) Move platform upward by STEPDISTANCE
 
triggers redraw after completion

Data and non-method functions inherited from ViewPlatformMixin:
STEPDISTANCE = 0.25
TURNANGLE = 0.098174770424681035
initialOrientation = (0, 1, 0, 0)
initialPosition = (0, 0, 10)
platform = None
slider = None

Data and non-method functions inherited from InteractiveContext:
EventManagerClasses = [('keyboard', <class 'OpenGLContext.events.keyboardevents.KeyboardEventManager'>), ('keypress', <class 'OpenGLContext.events.keyboardevents.KeypressEventManager'>), ('mousebutton', <class 'OpenGLContext.events.mouseevents.MouseButtonEventManager'>), ('mousemove', <class 'OpenGLContext.events.mouseevents.MouseMoveEventManager'>)]
TimeManagerClass = <class 'OpenGLContext.events.timeeventgeneratormanager.TimeEventGeneratorManager'>
TimeEventGenerator EventManager object
 
This object conforms to the EventManager interface,
although it doesn't actually inherit from that class.
 
It provides support for the InternalTime generators
on which the Timer object is based.

Methods inherited from EventHandlerMixin:
DoEventCascade(self)
Do pre-rendering event cascade
 
Returns the total number of events generated by
timesensors and/or processed from the event cascade queue
ProcessEvent(self, event)
Primary dispatch point for events.
 
ProcessEvent uses the event's type attribute to determine the
appropriate manager for processing, then dispatches to that manager's
ProcessEvent method.
addEventHandler(self, eventType, *arguments, **namedarguments)
Add a new event handler function for the given event type
 
This is the primary client API for dealing with the event system.
Each event class will define a particular set of data values
required to form the routing key for the event.  Each event handler
class will define a registerCallback function which converts
its arguments into a matching key.
 
This function merely determines the appropriate handler then
dispatches to the handler's registerCallback method (without the
eventType argument).
 
See: mouseevents, keyboardevents
addEventManager(self, eventType, manager=None)
Add an event manager to the internal table of managers.
 
The return value is the previous manager or None if there was
no previous manager.
captureEvents(self, eventType, manager=None)
Temporarily capture events of a particular type.
 
This temporarily replaces a particular manager within the
dispatch set with provided manager.  This will normally be
used to create "modal" interfaces such as active drag
functions (where the interface is in a different "interaction
mode", so that actions have different meaning than in the
"default mode").
 
Passing None as the manager will restore the previous manager
to functioning.
 
Note: this function does not perform a "system capture"
of input (that is, mouse movements are only available if they
occur over the context's window and that window has focus).
 
Note: for capturing mouse input, you will likely want to
capture both movement and button events, it should be possible
to define a single handler to deal with both event types,
and pass that handler twice, once for each event type.
getEventManager(self, eventType)
Retrieve an event manager from the internal table of managers
 
Returns the appropriate manager, or None if there was no
manager registered for the given event type.
getTimeManager(self)
initializeEventManagers(self)
Initialize the event manager classes for this context.
 
This implementation iterates over self.EventManagerClasses
(a list of (eventType, managerClass) values) and calls
addEventManager for each item.

Methods inherited from wxContext:
DoInit(self)
Call the OnInit method at a time when the context is valid
 
This method provides a customization point where
contexts which do not completely initialize during
their __init__ method can arrange to have the OnInit
method processed after their initialization has
completed.  The default implementation here simply
calls OnInit directly w/ appropriate setCurrent
and unsetCurrent calls.
 
Note:
        The only context currently known to require
        this customization is the wxPython-on-GTK context,
        everything else completes context initialization
        before calling Context.__init__.
_OnInitCallback(self, event=None)
Callback for GTK initialisation-finished event
 
On all platforms other than GTK, will be called
immediately by the DoInit method.  On GTK, it will
be called as the EVT_WINDOW_CREATE event handler.
 
On GTK where this context is not being created
as a child of a new frame, this will get called
during the first OnPaint method.
__init__(self, parent, id=-1, pos=wxPoint(-1, -1), size=wxSize(-1, -1), style=262144, name='GLContext', attribList=[1, 4, 12, 8])
Initialize the wxContext object and window
 
parent -- wxWindow parent of the context window
id -- wxPython ID for the window, can normally be left
        as the default
pos -- wxPython position object or a two-tuple of coordinates
        for the wxPython window that we are creating
size -- wxPython  size object, or a two-tuple of dimensions
        for the wxPython window that we are creating
style -- wxPython style integer (a bit-mask) dictating the
        window style
name -- string determining the wxPython window's name,
        which is an internal value which allows wxPython
        programmers to search for particular windows.
 
This implementation simply passes the wxPython-specific
arguments to the wxGLCanvas initializer, then calls the
context.Context initializer.
setCurrent(self)
Acquire the OpenGL "focus"
 
Basically this just calls the GUI library SetCurrent
method after dispatching to the superclass's
implementation.
setupCallbacks(self)
Setup various callbacks for this context
 
Binds most of the wxPython event types to callbacks on this
object, which allows interactive sub-classes to easily
manage the bindings without needing any wxPython-specific
logic.
wxOnEraseBackground(self, event)
Prevent flashing of the window by capturing and ignoring background erase events
 
As you might imagine, this is just a hack.
wxOnIdle(self, event)
Callback: Handle wxPython idle event notification
 
The major function of this callback is to virtualize
OnIdle handling, that is, to call self.OnIdle if it
actually exists.
wxOnPaint(self, event)
Callback: Called for each paint event
 
wxOnPaint is responsible for doing all of the processing
required to setup-for and trigger a redraw of the OpenGL
context.  Because this callback can only occur in the
GUI/rendering thread, the call to triggerRedraw should
always cause an immediate rendering cycle.
 
Note the use of GetClientSize and Viewport, which
updates the viewport dimensions before rendering.
 
Note also the use of wxPaintDC.  Without this
instantiation the paint handler would fail, even
though we don't actually use the dc at all.
wxOnSize(self, event)
Handle window re-size event
 
We actually just trigger a redraw, as the
paint event handler does all the work for us.

Data and non-method functions inherited from wxContext:
calledDoInit = 0
init = None

Methods inherited from wxGLCanvasPtr:
CreateDefaultPalette(self, *_args, **_kwargs)
GetContext(self, *_args, **_kwargs)
GetPalette(self, *_args, **_kwargs)
SetColour(self, *_args, **_kwargs)
SetCurrent(self, *_args, **_kwargs)
SetupPalette(self, *_args, **_kwargs)
SetupPixelFormat(self, *_args, **_kwargs)
SwapBuffers(self, *_args, **_kwargs)
__repr__(self)

Methods inherited from wxWindowPtr:
AcceptsFocus(self, *_args, **_kwargs)
AddChild(self, *_args, **_kwargs)
CaptureMouse(self, *_args, **_kwargs)
Center(self, *_args, **_kwargs)
CenterOnParent(self, *_args, **_kwargs)
CenterOnScreen(self, *_args, **_kwargs)
Centre(self, *_args, **_kwargs)
CentreOnParent(self, *_args, **_kwargs)
CentreOnScreen(self, *_args, **_kwargs)
Clear(self, *_args, **_kwargs)
ClientToScreen(self, *_args, **_kwargs)
ClientToScreenXY(self, *_args, **_kwargs)
Close(self, *_args, **_kwargs)
ConvertDialogPointToPixels(self, *_args, **_kwargs)
ConvertDialogSizeToPixels(self, *_args, **_kwargs)
ConvertPixelPointToDialog(self, *_args, **_kwargs)
ConvertPixelSizeToDialog(self, *_args, **_kwargs)
Create(self, *_args, **_kwargs)
DLG_PNT(self, *_args, **_kwargs)
DLG_SZE(self, *_args, **_kwargs)
Destroy(self, *_args, **_kwargs)
DestroyChildren(self, *_args, **_kwargs)
DragAcceptFiles(self, *_args, **_kwargs)
Enable(self, *_args, **_kwargs)
FindWindowById(self, *_args, **_kwargs)
FindWindowByName(self, *_args, **_kwargs)
Fit(self, *_args, **_kwargs)
FitInside(self, *_args, **_kwargs)
Freeze(self, *_args, **_kwargs)
GetAcceleratorTable(self, *_args, **_kwargs)
GetAdjustedBestSize(self, *_args, **_kwargs)
GetAutoLayout(self, *_args, **_kwargs)
GetBackgroundColour(self, *_args, **_kwargs)
GetBestSize(self, *_args, **_kwargs)
GetBestVirtualSize(self, *_args, **_kwargs)
GetBorder(self, *_args, **_kwargs)
GetCaret(self, *_args, **_kwargs)
# replaces broken shadow method
GetCharHeight(self, *_args, **_kwargs)
GetCharWidth(self, *_args, **_kwargs)
GetChildren(self, *_args, **_kwargs)
GetClientAreaOrigin(self, *_args, **_kwargs)
GetClientRect(self, *_args, **_kwargs)
GetClientSize(self, *_args, **_kwargs)
GetClientSizeTuple(self, *_args, **_kwargs)
GetConstraints(self, *_args, **_kwargs)
GetContainingSizer(self, *_args, **_kwargs)
GetCursor(self, *_args, **_kwargs)
GetDefaultItem(self, *_args, **_kwargs)
GetDropTarget(self, *_args, **_kwargs)
GetEventHandler(self, *_args, **_kwargs)
GetFont(self, *_args, **_kwargs)
GetForegroundColour(self, *_args, **_kwargs)
GetFullTextExtent(self, *_args, **_kwargs)
GetGrandParent(self, *_args, **_kwargs)
GetHandle(self, *_args, **_kwargs)
GetHelpText(self, *_args, **_kwargs)
GetId(self, *_args, **_kwargs)
GetLabel(self, *_args, **_kwargs)
GetMaxSize(self, *_args, **_kwargs)
GetName(self, *_args, **_kwargs)
GetParent(self, *_args, **_kwargs)
GetPosition(self, *_args, **_kwargs)
GetPositionTuple(self, *_args, **_kwargs)
GetRect(self, *_args, **_kwargs)
GetScrollPos(self, *_args, **_kwargs)
GetScrollRange(self, *_args, **_kwargs)
GetScrollThumb(self, *_args, **_kwargs)
GetSize(self, *_args, **_kwargs)
GetSizeTuple(self, *_args, **_kwargs)
GetSizer(self, *_args, **_kwargs)
GetTextExtent(self, *_args, **_kwargs)
GetTitle(self, *_args, **_kwargs)
GetToolTip(self, *_args, **_kwargs)
GetUpdateRegion(self, *_args, **_kwargs)
GetValidator(self, *_args, **_kwargs)
GetVirtualSize(self, *_args, **_kwargs)
GetVirtualSizeTuple(self, *_args, **_kwargs)
GetWindowStyleFlag(self, *_args, **_kwargs)
HasCapture(self, *_args, **_kwargs)
HasScrollbar(self, *_args, **_kwargs)
Hide(self, *_args, **_kwargs)
HitTest(self, *_args, **_kwargs)
InitDialog(self, *_args, **_kwargs)
IsBeingDeleted(self, *_args, **_kwargs)
IsEnabled(self, *_args, **_kwargs)
IsExposed(self, *_args, **_kwargs)
IsExposedPoint(self, *_args, **_kwargs)
IsExposedRect(self, *_args, **_kwargs)
IsRetained(self, *_args, **_kwargs)
IsShown(self, *_args, **_kwargs)
IsTopLevel(self, *_args, **_kwargs)
Layout(self, *_args, **_kwargs)
LineDown(self, *_args, **_kwargs)
LineUp(self, *_args, **_kwargs)
Lower(self, *_args, **_kwargs)
MakeModal(self, *_args, **_kwargs)
Move(self, *_args, **_kwargs)
MoveXY(self, *_args, **_kwargs)
OnPaint(self, *_args, **_kwargs)
PageDown(self, *_args, **_kwargs)
PageUp(self, *_args, **_kwargs)
PopEventHandler(self, *_args, **_kwargs)
PopupMenu(self, *_args, **_kwargs)
PopupMenuXY(self, *_args, **_kwargs)
PushEventHandler(self, *_args, **_kwargs)
Raise(self, *_args, **_kwargs)
Refresh(self, *_args, **_kwargs)
RefreshRect(self, *_args, **_kwargs)
ReleaseMouse(self, *_args, **_kwargs)
RemoveChild(self, *_args, **_kwargs)
RemoveEventHandler(self, *_args, **_kwargs)
Reparent(self, *_args, **_kwargs)
ScreenToClient(self, *_args, **_kwargs)
ScreenToClientXY(self, *_args, **_kwargs)
ScrollLines(self, *_args, **_kwargs)
ScrollPages(self, *_args, **_kwargs)
ScrollWindow(self, *_args, **_kwargs)
SetAcceleratorTable(self, *_args, **_kwargs)
SetAutoLayout(self, *_args, **_kwargs)
SetBackgroundColour(self, *_args, **_kwargs)
SetCaret(self, *_args, **_kwargs)
SetClientSize(self, *_args, **_kwargs)
SetClientSizeWH(self, *_args, **_kwargs)
SetConstraints(self, *_args, **_kwargs)
SetContainingSizer(self, *_args, **_kwargs)
SetCursor(self, *_args, **_kwargs)
SetDefaultItem(self, *_args, **_kwargs)
SetDimensions(self, *_args, **_kwargs)
SetDropTarget(self, *_args, **_kwargs)
SetEventHandler(self, *_args, **_kwargs)
SetExtraStyle(self, *_args, **_kwargs)
SetFocus(self, *_args, **_kwargs)
SetFocusFromKbd(self, *_args, **_kwargs)
SetFont(self, *_args, **_kwargs)
SetForegroundColour(self, *_args, **_kwargs)
SetHelpText(self, *_args, **_kwargs)
SetHelpTextForId(self, *_args, **_kwargs)
SetId(self, *_args, **_kwargs)
SetLabel(self, *_args, **_kwargs)
SetName(self, *_args, **_kwargs)
SetPosition(self, *_args, **_kwargs)
SetRect(self, *_args, **_kwargs)
SetScrollPos(self, *_args, **_kwargs)
SetScrollbar(self, *_args, **_kwargs)
SetSize(self, *_args, **_kwargs)
SetSizeHints(self, *_args, **_kwargs)
SetSizer(self, *_args, **_kwargs)
SetSizerAndFit(self, *_args, **_kwargs)
SetTitle(self, *_args, **_kwargs)
SetTmpDefaultItem(self, *_args, **_kwargs)
SetToolTip(self, *_args, **_kwargs)
SetToolTipString(self, *_args, **_kwargs)
SetValidator(self, *_args, **_kwargs)
SetVirtualSize(self, *_args, **_kwargs)
SetVirtualSizeHints(self, *_args, **_kwargs)
SetVirtualSizeWH(self, *_args, **_kwargs)
SetWindowStyle(self, *_args, **_kwargs)
SetWindowStyleFlag(self, *_args, **_kwargs)
Show(self, *_args, **_kwargs)
Thaw(self, *_args, **_kwargs)
TransferDataFromWindow(self, *_args, **_kwargs)
TransferDataToWindow(self, *_args, **_kwargs)
UnsetConstraints(self, *_args, **_kwargs)
Update(self, *_args, **_kwargs)
UpdateWindowUI(self, *_args, **_kwargs)
Validate(self, *_args, **_kwargs)
WarpPointer(self, *_args, **_kwargs)

Methods inherited from wxEvtHandlerPtr:
AddPendingEvent(self, *_args, **_kwargs)
Connect(self, *_args, **_kwargs)
Disconnect(self, *_args, **_kwargs)
GetEvtHandlerEnabled(self, *_args, **_kwargs)
GetNextHandler(self, *_args, **_kwargs)
GetPreviousHandler(self, *_args, **_kwargs)
SetEvtHandlerEnabled(self, *_args, **_kwargs)
SetNextHandler(self, *_args, **_kwargs)
SetPreviousHandler(self, *_args, **_kwargs)
_setOORInfo(self, *_args, **_kwargs)

Methods inherited from wxObjectPtr:
GetClassName(self, *_args, **_kwargs)

Methods inherited from EventHandlerMixin:
wxOnCharacter(self, event)
Convert character (non-control) press to context event
wxOnKeyDown(self, event)
Convert a key-press to a context-style event
wxOnKeyUp(self, event)
Convert a key-release to a context-style event
wxOnMouseButton(self, event)
Convert mouse-button event to context event
wxOnMouseMove(self, event)
Convert mouse-movement event to context event

Methods inherited from Context:
Background(self, mode=None)
Customization point for clearing/drawing the background.
 
The default implementation clears the color and depth
buffers, using solid white for the clear color.
 
Note: This method is only called if there is no scene graph,
and if there is no SetupBindables( mode ) method
available on the Context.
Lights(self, mode=None)
Customization point for setting up global illumination parameters
Depending on the mode, should either enable or disable
lighting for all of those lights in the scene.
 
The default implementation enables lighting and light 0
if render mode is not select, disables them otherwise.
 
Note: This method is only called if there is no scene graph,
and if there is no SetupBindables( mode ) method
available on the Context.
OnDraw(self, force=1, *arguments)
Callback for the rendering/drawing mechanism
 
force -- if true, force a redraw.  If false, then only
        do a redraw if the event cascade has generated events.
 
return value is whether a visible change occured
 
This implementation does the following:
 
        * calls lockScenegraph()
                o calls DoEventCascade()
        * calls unlockScenegraph()
        * calls setCurrent()
        * calls renderPasses( self )
                See: visitor.py, rendervisitor.py, renderpass.py,
                shadow/passes.py for examples of render-pass-sets
                which can be triggered.
 
                The RenderPasses define the core of the rendering
                mechanism.  The default rendering passes will defer
                most rendering options to the scenegraph returned by
                getSceneGraph().  If that value is None (default)
                then the pass will use the Context's callbacks.
 
                You can define new RenderPasses to replace the
                rendering algorithm, override the Context's various
                callbacks to write raw OpenGL code, or work by
                customizing the scene graph library.
        * if there was a visible change (which is the return value
                from the render-pass-set), calls SwapBuffers()
        * calls unsetCurrent()
OnIdle(self, *arguments)
 Override to perform actions when the rendering loop is idle
OnInit(self)
Customization point for scene set up and initial processing
 
You override this method to do housekeeping chores such as
loading images and generating textures, loading pre-established
geometry, spawning new threads, etc.
 
This method is called after the completion of the Context.__init__
method for the rendering context.  GUI implementers:
        Wherever possible, this should be the very last function
        called in the initialization of the context to allow user
        code to use all the functionality of the context.
OnResize(self, *arguments)
Resize the window when the windowing library says to
Render(self, mode=None)
Customization point for geometry rendering
 
This method is called by the default render passes to
render the geometry for the system.  Wherever possible,
you should pay attention to the rendering modes to allow
for optimization of your geometry (for instance,
selection passes do not require lighting).
 
The default implementation merely ensures that matrix mode
is currently model view.
 
See: visitor.py, rendervisitor.py, renderpass.py,
shadow/passes.py for definitions of the properties of the
mode.
addPickEvent(self, event)
Add event to list of events to be processed by selection-render-mode
 
This is a method of the Context, rather than the
rendering pass (which might seem more elegant given
that it is the rendering pass which deals with the
events being registered) because the requests to
render a pick event occur outside of the rendering
loop.  As a result, there is (almost) never an
active context when the pick-event-request comes in.
drawPoll(self, timeout=None)
Wait timeout seconds for a redraw request
 
timeout -- timeout in seconds, if None, use
        self.drawPollTimeout
 
returns 0 if timeout, 1 if true
getPickEvents(self)
Get the currently active pick-events
getSceneGraph(self)
Get the scene graph for the context (or None)
 
Overriding this method is the primary customization
point for those wishing to use the scene graph APIs
of OpenGLContext.  You must return an instance of:
 
        OpenGLContext.scenegraph.scenegraph.SceneGraph
 
Normally you would create that using either a loader
from OpenGLContext.loader:
 
        from OpenGLContext.loader import vrml97
        def OnInit( self ):
                self.sg = vrml97.load( 'c:\somefile\world.wrl' )
        def getSceneGraph( self ):
                return self.sg
 
or by using the classes in OpenGLContext.scenegraph.basenodes:
 
        from OpenGLContext.scenegraph import basenodes
        def OnInit( self ):
                self.sg = basenodes.sceneGraph(
                        children = [
                                basenodes.Transform(...)
                        ],
                )
 
to define the scenegraph in Python code.
getTTFFiles(self)
Get TrueType font-file registry object
getViewPort(self)
Method to retrieve the current dimensions of the context
 
Return value is a width, height tuple. See Context.ViewPort
for setting of this value.
lockScenegraph(self, blocking=1)
Lock scenegraph locks to prevent other update/rendering actions
 
Potentially this could be called from a thread other than the
GUI thread, allowing the other thread to update structures in
the scenegraph without mucking up any active rendering pass.
renderedChildren(self, types=None)
Get the rendered children of the scenegraph
setupCache(self)
Setup caching strutures for content
 
This includes the general compiled-geometry caches
and the texture cache
setupExtensionManager(self)
Create an extension manager for this context
setupFontProviders(self)
Load font providers for the context
 
See the OpenGLContext.scenegraph.text package for the
available font providers.
setupRedrawRequest(self)
Setup the redraw-request (threading) event
setupScenegraphLock(self)
Setup lock to protect scenegraph from updates during rendering
setupThreading(self)
Setup primitives (locks, events) for threading
shouldRedraw(self)
Return whether or not the context contents need to be redrawn
suppressRedraw(self)
Indicate to the context that there is no need to re-render
 
This method signals to the context that there are no updates
currently requiring redrawing of the context's contents.
 
See:
        Context.shouldRedraw and Context.triggerRedraw
triggerPick(self)
Trigger a selection rendering pass
 
If the context is not currently drawing, the selection render will
occur immediately, otherwise it will occur the next time the
rendering loop reaches the selection stage.
triggerRedraw(self, force=0)
Indicate to the context that it should redraw when possible
 
If force is true, the rendering will begin immediately if the
context is not already drawing.  Otherwise only the indicator flag
will be set.
unlockScenegraph(self)
Unlock scenegraph locks to allow other update/rendering actions
 
Potentially this could be called from a thread other than the
GUI thread, allowing the other thread to update structures in
the scenegraph without mucking up any active rendering pass.
unsetCurrent(self)
Give up the OpenGL focus from this context

Class methods inherited from Context:
getApplicationName(cls) from __builtin__.class
Retrieve the application name for configuration purposes
getUserAppDataDirectory(cls) from __builtin__.class
Retrieve user-specific configuration directory
 
Default implementation gives a directory-name in the
user's (system-specific) "application data" directory
named

Data and non-method functions inherited from Context:
APPLICATION_NAME = 'OpenGLContext'
DEF = '#Context'
PROTO = 'Context'
allContexts = []
alreadyDrawn = None
currentContext = None
drawPollTimeout = 0.01
drawing = None
renderPasses = [<class 'OpenGLContext.renderpass.OpaqueRenderPa...ass 'OpenGLContext.renderpass.SelectRenderPass'>]
Callable list of sub-passes with associated OverallPass
 
The PassSet is called once per render-cycle,
and is responsible for creating the OverallPass
which does the actual rendering.  It simply
creates the OverallPass with the given sub-passes
and calls the OverallPass, returning the result.
ttfFileRegistry = None
viewportDimensions = (0, 0)