Eidolon
|
Public Member Functions | |
def | __init__ (self, parent, reprtype, reprcount, matname='Default') |
def | __getattr__ (self, name) |
def | isInScene (self) |
def | getAABB (self, isTransformed=False, isDerived=True, recalculate=False) |
def | calculateAABB (self) |
def | getLabel (self) |
def | getName (self) |
def | setName (self, name) |
def | getDataset (self) |
def | getMaterialName (self) |
def | setTimestep (self, ts) |
def | getTimestep (self) |
def | getTimestepList (self) |
def | getTimestepRange (self) |
def | getTimestepInterval (self) |
def | getTimestepRepr (self, ts=0) |
def | setParent (self, prepr) |
def | getParent (self) |
def | enumChildren (self, allChildren=False) |
def | addChild (self, child) |
def | removeChild (self, child) |
def | enumSubreprs (self) |
def | enumFigures (self) |
def | enumInternalMaterials (self) |
def | addModifier (self, mod) |
def | removeModifier (self, mod) |
def | getParamDefs (self) |
def | getParam (self, name) |
def | setParam (self, name, value) |
def | setGPUParam (self, name, val, progtype, kwargs) |
def | getRayIntersect (self, ray) |
def | getPropTuples (self) |
def | removeFromScene (self, scene) |
def | applySpectrum (self, spec) |
def | createHandles (self, kwargs) |
def | setMaterialName (self, matname) |
def | setVisible (self, isVisible) |
def | isVisible (self) |
def | setTransparent (self, isTrans) |
def | isTransparent (self) |
def | addToScene (self, scene) |
def | prepareBuffers (self) |
def | update (self, scene) |
def | setPosition (self, pos) |
def | getPosition (self, isDerived=False) |
def | setRotation (self, yaw, pitch, roll) |
def | getRotation (self, isDerived=False) |
def | setScale (self, scale) |
def | getScale (self, isDerived=False) |
def | getTransform (self, isDerived=False) |
def | setTransform (self, trans) |
def | __repr__ (self) |
Public Attributes | |
parent | |
plugin | |
name | |
matname | |
reprcount | |
reprtype | |
aabb | |
rparent | |
children | |
Private Member Functions | |
def | _getInteralFigures (self) |
Private Attributes | |
_isVisible | |
A SceneObjectRepr encapsulates a single method of representing a SceneObject visually in the scene. It contains the information generated from the SceneObject's data which is sent to the renderer for drawing, and has the facilities controlling how it appears in the scene such as the use of materials. A representation can be a range of renderable concepts, such as a point list represented using points or billboards, line lists used to draw the outlines of figures, triangle meshes for rendering solid objects, texture planes for representing imaging data, and so forth.
def __init__ | ( | self, | |
parent, | |||
reprtype, | |||
reprcount, | |||
matname = 'Default' |
|||
) |
def __getattr__ | ( | self, | |
name | |||
) |
def __repr__ | ( | self | ) |
|
private |
def addChild | ( | self, | |
child | |||
) |
Add a child to the internal children set, should only be called by setParent().
def addModifier | ( | self, | |
mod | |||
) |
def addToScene | ( | self, | |
scene | |||
) |
Initialize the scene data objects and call 'update' to fill in their data.
def applySpectrum | ( | self, | |
spec | |||
) |
Replaces the spectrum information for each internal material with that in `spec'.
def calculateAABB | ( | self | ) |
Recalculate the AABB after the data has changed.
def createHandles | ( | self, | |
kwargs | |||
) |
Returns either a single Handle object or a list thereof for this representation. The default code simply calls the same function of the plugin, which will create one TransformHandle by default. Handles are objects rendered in the scene which can be manipulated with the mouse in conjunction with the keyboard to perform some operation or transformation on the associated object (or its components). This method should be called only once per object otherwise multiple redundant handles are created.
def enumChildren | ( | self, | |
allChildren = False |
|||
) |
Yield every child of this object, descending depth first into the scene node tree if allChildren is true.
def enumFigures | ( | self | ) |
Yield every Figure object which comprises this representation.
def enumInternalMaterials | ( | self | ) |
Yield every internal material (ie. created by this object) used to define this representation.
def enumSubreprs | ( | self | ) |
Yield every internal sub-representation of this object excluding `self', or [`self'] if no internal representations are used in this type.
def getAABB | ( | self, | |
isTransformed = False , |
|||
isDerived = True , |
|||
recalculate = False |
|||
) |
Returns the untransformed axis-aligned bound box enclosing the geometry of this representation.
def getDataset | ( | self | ) |
Returns the Dataset object for this representation, or whatever data object is used.
def getLabel | ( | self | ) |
Returns the UI label, this may be different from the name and include additional information.
def getMaterialName | ( | self | ) |
Returns the applied material's name.
def getName | ( | self | ) |
Returns the name of this representation.
def getParam | ( | self, | |
name | |||
) |
Get the value of an additional parameter.
def getParamDefs | ( | self | ) |
Get the ParamDef objects describing the additional parameters to this representation.
def getParent | ( | self | ) |
Returns the parent representation object.
def getPosition | ( | self, | |
isDerived = False |
|||
) |
Returns the position vec3 object.
def getPropTuples | ( | self | ) |
Returns a list of name/value pairs listing the properties to display for this scene object in the UI.
def getRayIntersect | ( | self, | |
ray | |||
) |
Return the distance value where `ray' intersects this object, or None if not known or not intersected.
def getRotation | ( | self, | |
isDerived = False |
|||
) |
Returns a (yaw,pitch,roll) triple of Euler angles, each angle between -pi and +pi.
def getScale | ( | self, | |
isDerived = False |
|||
) |
Returns the scale vec3 object.
def getTimestep | ( | self | ) |
Get the current timestep position.
def getTimestepInterval | ( | self | ) |
Returns the interval between timesteps.
def getTimestepList | ( | self | ) |
Returns the list of timesteps, [0] for non-time-dependent objects.
def getTimestepRange | ( | self | ) |
Returns the timestep start and end values.
def getTimestepRepr | ( | self, | |
ts = 0 |
|||
) |
Returns the subrepresentation at timestep `ts' or nearest if `ts' is non-integer. For non-time-dependent representations, this instead returns `self'.
def getTransform | ( | self, | |
isDerived = False |
|||
) |
def isInScene | ( | self | ) |
Returns true if this representation has been initialized and included into the scene, false otherwise.
def isTransparent | ( | self | ) |
Returns whether the scene data objects have been set to be transparent or not.
def isVisible | ( | self | ) |
Returns True if the object is in the scene and visible, False otherwise.
def prepareBuffers | ( | self | ) |
Fill internal buffers with data before they are sent to the Figure objects in update().
def removeChild | ( | self, | |
child | |||
) |
Remove a child to the internal children set, should only be called by setParent().
def removeFromScene | ( | self, | |
scene | |||
) |
Removes the representation from the scene, but may not destroy scene data (ie. just sets visibility).
def removeModifier | ( | self, | |
mod | |||
) |
def setGPUParam | ( | self, | |
name, | |||
val, | |||
progtype, | |||
kwargs | |||
) |
Sets the GPU program parameter `name' with value `val' for every internal material. The `progtype' value specifies which program type this is for. The value of `val' must be a vec3, real, int, long, or color.
def setMaterialName | ( | self, | |
matname | |||
) |
Sets the material name of the representation's internal components.
def setName | ( | self, | |
name | |||
) |
Sets the name of the object.
def setParam | ( | self, | |
name, | |||
value | |||
) |
Set the value of an additional parameter.
def setParent | ( | self, | |
prepr | |||
) |
Set this object's parent representation to `prepr'. This sets every internal figure to be a child of the first figure yielded by `prepr.enumFigures()'. This establishes a one-to-many relationship between objects such that an affine transformation performed on the parent is compounded with that applied to the child. In effect the child exists and is transformed in the local coordinates of its parent. If `prepr' is None then this representation will have no parent and its subfigures will be children of the root scene node only.
def setPosition | ( | self, | |
pos | |||
) |
Sets the vec3 position of the representation.
def setRotation | ( | self, | |
yaw, | |||
pitch, | |||
roll | |||
) |
Sets the rotation in terms of Euler angles.
def setScale | ( | self, | |
scale | |||
) |
Sets the scale in terms of a vec3 object to multiply the nodes of the representation by.
def setTimestep | ( | self, | |
ts | |||
) |
Set the current timestep to that which is nearest to `ts'.
def setTransform | ( | self, | |
trans | |||
) |
def setTransparent | ( | self, | |
isTrans | |||
) |
Sets the transparency properties of the scene data objects, this is necessary to get alpha compositing to look correct since transparent objects get rendered in a separate queue. This does not actually make the objects transparent, only allows transparent objects to be rendered correctly.
def setVisible | ( | self, | |
isVisible | |||
) |
Sets the visibility of the representation's geometry in the scene.
def update | ( | self, | |
scene | |||
) |
Fill or refill the scene data objects with their geometry information. This is called by SceneManager and probably should never be called by any other client.
|
private |
aabb |
children |
matname |
name |
parent |
plugin |
reprcount |
reprtype |
rparent |