Eidolon
|
Inherits QMainWindow, and Ui_MainWindow.
Public Member Functions | |
def | __init__ (self, conf, width=1200, height=800) |
def | setRenderWinSize (self, w, h) |
def | relayoutViz (self) |
def | keyPressEvent (self, e) |
def | dragEnterEvent (self, e) |
def | callFuncUIThread (self, func, args, kwargs) |
def | sync (self) |
def | repaintScene (self) |
def | captureWidget (self, widg, filename) |
def | setStatus (self, msg, progress=0, progressmax=0) |
def | showMessage (self, msg, msTime=0) |
def | showTimeDialog (self, doShow, start, end, step) |
def | setTimeDisplay (self, ts) |
def | setTimeFPS (self, fps) |
def | setTimeStepsPerSec (self, sps) |
def | showScratchPad (self, doShow) |
def | toggleFullscreen (self) |
def | selectObject (self, obj) |
def | updateScrollAreas (self) |
def | setCameraValues (self, fov, nearclip, farclip) |
def | addMenuItem (self, menuName, objName, text, callback) |
def | addInterfaceTab (self, name, tab) |
def | createDock (self, name, widg, minw=200, minh=200) |
def | findWidgetItem (self, obj) |
def | findPropBox (self, obj) |
def | connect (self, signal, slot) |
def | chooseRGBColorDialog (self, origcolor, callback) |
def | chooseYesNoDialog (self, msg, title, callback) |
def | getYesNoDialogValue (self, msg, title, future) |
def | chooseStrDialog (self, title, defaultval, callback) |
def | chooseListItemsDialog (self, title, msg, items, callback, selected=[], multiSelect=False) |
def | chooseScreenshotDialog (self, start, end, fps, steps, sources, callback) |
def | chooseFileDialog (self, title, opendir=None, filterstr='', isOpen=True, chooseMultiple=False, confirmOverwrite=True, parent=None) |
def | chooseDirDialog (self, title, opendir=None) |
def | showLogfileView (self, logfile) |
def | showMsg (self, msg, title='Message', text=None, width=600, height=300) |
def | showTextBox (self, msg, title, text, width=600, height=300) |
def | addTreeObject (self, obj, label, parentObj, prop, updateFunc, dblClickFunc=None, menu=None, menuFunc=None, icon=None, parentName=None) |
def | updateTreeObjects (self) |
def | addProjectObj (self, proj, name, prop, updateFunc) |
def | addAsset (self, asset, text, assettype, propbox=None, updateFunc=None) |
def | addMaterial (self, mat, updateFunc) |
def | addSpectrum (self, spec) |
def | addTexture (self, tex) |
def | addLight (self, light, updateFunc) |
def | addGPUProgram (self, prog, updateFunc) |
def | fillTextureList (self, textures) |
def | getSelectedObject (self) |
def | getSelectedAsset (self) |
def | removeObject (self, obj) |
def | setVisibilityIcon (self, obj, val) |
Public Attributes | |
objMap | |
mgr | |
dockWidgets | |
isExec | |
timestepSliderMult | |
assetRootMap | |
logfileView | |
msgdialog | |
dialogDir | |
statusProgressBar | |
statusText | |
console | |
viz | |
scene | |
Static Public Attributes | |
method_signal | |
ObjMapTuple | |
Private Member Functions | |
def | _showAbout (self) |
def | _checkVersion (self) |
def | _callFuncAsSignal (self, func, future, args, kwargs) |
def | _executeScratch (self) |
def | _loadScratch (self) |
def | _saveScratch (self) |
def | _clickedTree (self, tree, item) |
def | _doubleClickedTree (self, tree, item) |
def | _menuClickedTree (self, tree, p) |
def | _updateScrollAreasSig (self) |
def | _addUIObj (self, treeItem, args, kwargs) |
The main window of the application. This contains the render widget, scene panel, console panel, scratch pad panel, and whatever dock windows are created. The code defined in this class is meant only to actuate the UI, fill lists and other widgets with values, create input or notification windows, and perform other functions which don't delve into the model or controller layer.
def __init__ | ( | self, | |
conf, | |||
width = 1200 , |
|||
height = 800 |
|||
) |
|
private |
|
private |
Call the function `func' with the given arguments, and storing the result (or thrown exception) in `future'.
|
private |
Check the application version against the repository API URL and show the results with the link to the site.
|
private |
|
private |
|
private |
Execute the contents of the scratch pad line-by-line in the console, making it visible first.
|
private |
|
private |
|
private |
Save the scratch pad contents to a chosen file.
|
private |
Show the about dialog box.
|
private |
Updates the possibly visible property boxes when a change occurs. This executes as a signal.
def addAsset | ( | self, | |
asset, | |||
text, | |||
assettype, | |||
propbox = None , |
|||
updateFunc = None |
|||
) |
def addGPUProgram | ( | self, | |
prog, | |||
updateFunc | |||
) |
def addInterfaceTab | ( | self, | |
name, | |||
tab | |||
) |
Add the widget `tab' to the tab panel in the Scene Elements dock.
def addLight | ( | self, | |
light, | |||
updateFunc | |||
) |
def addMaterial | ( | self, | |
mat, | |||
updateFunc | |||
) |
def addMenuItem | ( | self, | |
menuName, | |||
objName, | |||
text, | |||
callback | |||
) |
Add a menu item to the menu `menuName', which must be one of ('File','Import','Export','Create','Project'). The menu item is named `objName' with label `text', when clicked `callback' will be called with no arguments.
def addProjectObj | ( | self, | |
proj, | |||
name, | |||
prop, | |||
updateFunc | |||
) |
def addSpectrum | ( | self, | |
spec | |||
) |
def addTexture | ( | self, | |
tex | |||
) |
def addTreeObject | ( | self, | |
obj, | |||
label, | |||
parentObj, | |||
prop, | |||
updateFunc, | |||
dblClickFunc = None , |
|||
menu = None , |
|||
menuFunc = None , |
|||
icon = None , |
|||
parentName = None |
|||
) |
def callFuncUIThread | ( | self, | |
func, | |||
args, | |||
kwargs | |||
) |
Call the given function with the given arguments in the UI (main) thread. This allows operations needing to be done by the UI thread to be defined in arbitrary functions and despatched from any thread. This assumes that whatever `func' does is thread-safe and won't wait on another event from the UI thread, otherwise it will deadlock since the call to callFuncUIThread() will wait indefinitely for a result from `func'. This method can be safely called from the UI thread however, assuming these properties of `func'.
def captureWidget | ( | self, | |
widg, | |||
filename | |||
) |
def chooseDirDialog | ( | self, | |
title, | |||
opendir = None |
|||
) |
def chooseFileDialog | ( | self, | |
title, | |||
opendir = None , |
|||
filterstr = '' , |
|||
isOpen = True , |
|||
chooseMultiple = False , |
|||
confirmOverwrite = True , |
|||
parent = None |
|||
) |
def chooseListItemsDialog | ( | self, | |
title, | |||
msg, | |||
items, | |||
callback, | |||
selected = [] , |
|||
multiSelect = False |
|||
) |
def chooseRGBColorDialog | ( | self, | |
origcolor, | |||
callback | |||
) |
Opens a color pick dialog initialized with `origcolor' (RGBA tuple or color object). If Ok is pressed, the callable `callback' is invoked with the RGBA color tuple passed as the single argument, otherwise does nothing. This is threadsafe and non-blocking.
def chooseScreenshotDialog | ( | self, | |
start, | |||
end, | |||
fps, | |||
steps, | |||
sources, | |||
callback | |||
) |
Shows the dialog for choosing screenshot parameters and calls `callback' with the results if OK is chosen. The first 4 arguments specify the timestep start, end, frames per second, and steps per second. The `sources' value is a list of (name,source,width,height) tuples specifying what cameras or widgets are acceptable as sources, the given name from each tuple will be the source comboboxentry and (width,height) will be set as the default values for those fields. The result arguments for `callback' are: file path, sources, width, height, start time, end time, interval.
def chooseStrDialog | ( | self, | |
title, | |||
defaultval, | |||
callback | |||
) |
Opens a dialog box asking for an input string with title string `title' and default string value `defaultval'. When the dialog closes, the callable `callback' is called with the given string value as the only argument. This is threadsafe and non-blocking.
def chooseYesNoDialog | ( | self, | |
msg, | |||
title, | |||
callback | |||
) |
Opens a Yes/No dialog box with message string `msg' and title string `title'. If Yes is selected, the callable `callback' is called with no arguments. This is threadsafe and non-blocking.
def connect | ( | self, | |
signal, | |||
slot | |||
) |
Performs signal connections which must be done within the main UI thread.
def createDock | ( | self, | |
name, | |||
widg, | |||
minw = 200 , |
|||
minh = 200 |
|||
) |
Add the widget `widg' to the interface in its own docked subwindow with minimum dimensions (minw,minh). If `widg' has a parentClosed() method, this will be called when the dock is closed with the close event passed as the only argument.
def dragEnterEvent | ( | self, | |
e | |||
) |
def fillTextureList | ( | self, | |
textures | |||
) |
def findPropBox | ( | self, | |
obj | |||
) |
def findWidgetItem | ( | self, | |
obj | |||
) |
def getSelectedAsset | ( | self | ) |
def getSelectedObject | ( | self | ) |
def getYesNoDialogValue | ( | self, | |
msg, | |||
title, | |||
future | |||
) |
Opens a Yes/No dialog box with message string `msg' and title string `title'. If Yes is selected, the Future object `future' is set to True, otherwise False. This is threadsafe and non-blocking.
def keyPressEvent | ( | self, | |
e | |||
) |
def relayoutViz | ( | self | ) |
Cause the 3D visualization widget to redo its layout.
def removeObject | ( | self, | |
obj | |||
) |
def repaintScene | ( | self | ) |
def selectObject | ( | self, | |
obj | |||
) |
Select an object in the scene object tree view. This will set the selection in the tree and replace the properties box with the correct one for that object. Passing None as the argument will clear the selection.
def setCameraValues | ( | self, | |
fov, | |||
nearclip, | |||
farclip | |||
) |
Set the field-of-view, near and far clipping distance UI elements.
def setRenderWinSize | ( | self, | |
w, | |||
h | |||
) |
Resize the window so that the rendering widget's draw area has dimensions (w,h).
def setStatus | ( | self, | |
msg, | |||
progress = 0 , |
|||
progressmax = 0 |
|||
) |
def setTimeDisplay | ( | self, | |
ts | |||
) |
def setTimeFPS | ( | self, | |
fps | |||
) |
def setTimeStepsPerSec | ( | self, | |
sps | |||
) |
def setVisibilityIcon | ( | self, | |
obj, | |||
val | |||
) |
def showLogfileView | ( | self, | |
logfile | |||
) |
def showMessage | ( | self, | |
msg, | |||
msTime = 0 |
|||
) |
def showMsg | ( | self, | |
msg, | |||
title = 'Message' , |
|||
text = None , |
|||
width = 600 , |
|||
height = 300 |
|||
) |
Shows the string `msg' in a message dialog with the given title. If `text' is not None, this is displayed in a text box within a message dialog that recalls previous messages, otherwise a simple dialog is used.
def showScratchPad | ( | self, | |
doShow | |||
) |
def showTextBox | ( | self, | |
msg, | |||
title, | |||
text, | |||
width = 600 , |
|||
height = 300 |
|||
) |
Shows a box with the given title displaying the mssage `msg' with text content `text'.
def showTimeDialog | ( | self, | |
doShow, | |||
start, | |||
end, | |||
step | |||
) |
def sync | ( | self | ) |
Cause the calling thread to wait until all slot operations prior to this one have completed.
def toggleFullscreen | ( | self | ) |
def updateScrollAreas | ( | self | ) |
Updates the possibly visible property boxes when a change occurs. This delays for 0.1s before executing.
def updateTreeObjects | ( | self | ) |
assetRootMap |
console |
dialogDir |
dockWidgets |
isExec |
logfileView |
|
static |
mgr |
msgdialog |
objMap |
|
static |
scene |
statusProgressBar |
statusText |
timestepSliderMult |
viz |