Package DejaVu :: Module Geom :: Class Geom
[hide private]
[frames] | no frames]

Class Geom

source code

Common2d3dObject.Common2d3dObject --+
                                    |
      Transformable.Transformable --+
                                    |
          Displayable.Displayable --+
                                    |
                                   Geom
Known Subclasses:
IndexedGeom.IndexedGeom, glfLabels.GlfLabels, VolumeGeom.VolumeGeom, Ellipsoids.Ellipsoids, Spheres.Spheres, Polylines.Polylines, Points.Points, Arcs3D.Arcs3D, Arcs3D.Fan3D

Base class for objects that can be displayed in a camera

Instance Methods [hide private]
  __init__(self, name=None, check=1, **kw)
Constructor
  getState(self)
return a dictionary describing this object's state This dictionary can be passed to the Set method to restore the object's state
  getGeomMaterialCode(self, geomName, indent='', includePerVertexOrFace=True)
Returns a list of strings containing Python code to restore the material of this geoemtry.
  getGeomClipPlanesCode(self, geomName, indent='')
Returns a list of strings containing Python code to restore the clipping planes of this geoemtry.
  delete(self)
  getVertices(self)
returns a handle to the vertices array
  getVNormals(self)
returns a handle to the vertices array
  getDepthMask(self)
  SetPolyMode(self, face, mode)
Modify polymode
  SetFrontPolyMode(self, val)
Modify the current Object's frontPolyMode
  SetBackPolyMode(self, val)
Modify the current Object's frontPolyMode
  SetFrontBackPolyMode(self, val)
Modify the current Object's frontPolyMode
  GetFrontPolyMode(self)
  getDrawOutlineMode(self)
  GetShading(self)
  GetLighting(self)
  getSharpColorBoundaries(self)
  MaterialBindingMode(self, num, face=GL.GL_FRONT, mode=None)
Figure out how materials should be used to color the object
  AddMaterial(self, values, propNum=None, face=GL.GL_FRONT, mode=None)
Add materials to the current set
  SetMaterial(self, values, propNum, face=GL.GL_FRONT, mode=None)
Set the materials WARNING: when back face colors are set, two sided lighting has to be enabled
  GetNormals(self)
Find the normals to be used for a given shading
  Add(self, check=1, redo=1, **kw)
add data to this object set self.redoDspLst to 1 to force re-building of geometries DpyList which implies recontruction of main display list.
  SetForChildren(self, recursive=False, **kw)
set properties for children of this object.
  Set(self, check=1, redo=1, updateOwnGui=True, **kw)
set data for this object check=1 : verify that all the keywords present can be handle by this func redo=1 : append self to viewer.objectsNeedingRedo updateOwnGui=True : allow to update owngui at the end this func
  setTransparency(self, val)
  __repr__(self)
  BoundingBox(self, display=None, color=None, lineWidth=None)
Turn Bounding Box drawing on and off, set attributs
  Draw(self)
function that make the opengl call to draw the geom Should be call by RedoDisplayList in between glNewList/ glEndList
  deleteOpenglTemplateList(self)
  deleteOpenglList(self)
  RedoDisplayList(self)
Next Redraw will force to rebuild the OpenGL display list
  AddClipPlane(self, cp, side=-1, clipChildren=True, tagModified=True)
Add the arbitrary clipping plane 'cp' to this geometry
  RemoveClipPlane(self, cp)
Remove the clip.
  ApplyParentsTransform(self, coords, instance=None)
Return a vector of 3D coordinates transformed by all transformations up to root (excluded)
  TransformedCoords(self, root=None, instance=None)
Return the vertices after applying the current transformation
  ObjSubTreeBB(self, obj)
  ComputeBB(self)
This method computes the bounding box of the visible objects in the tree rooted at this object.
  _DrawBox(self, bbmin, bbmax)
Draw the bounding box using lines
  DrawTreeBoundingBox(self)
Draw's the bounding box of this object and all of its visible descendants
  DrawBoundingBox(self)
Draw's the objects bounding box
  addVertexNormalsGeom(self)
  faceCenterVector(self, faceIndex)
  addFaceNormalsGeom(self)
  removeVertexNormalsGeom(self)
  removeFaceNormalsGeom(self)
  RenderMode(self, mode=None, shading=None, face=GL.GL_FRONT, redo=1)
Set the render mode
  asIndexedPolygons(self, **kw)
Should return an IndexedPolygons object if this object can be represented using triangles, else return None
  sortPoly(self, order=-1)
None <- sortPoly(order=-1) Sorts the geometry polygons according to z values of polygon's geomtric centers.
  sortPoly_cb(self, event=None)
  setViewer(self, viewer, buildDisplayList)
set viewer in all children of geom object
  AllObjects(self)
Return a list of all children of this object in the object tree
  AllVisibleObjects(self)
Return a list of all visible children of this object in the object tree
  DisplayFunction(self)
Dummy display function.
  LastParentBeforeRoot(self)
return the last parent of a node before the root object is reached
  _Hide(self)
Transient signal handler
  _Remove(self, a, b)
Transient signal handler
  isTransparent(self)
  updateParentsForImmediateRendering(self, val)

Inherited from Common2d3dObject.Common2d3dObject: BuildFullName, getVisible, hideOwnGui, showOwnGui

Inherited from Transformable.Transformable: BuildMat, ConcatRotation, ConcatRotationRelative, ConcatScale, ConcatTranslation, Decompose4x4, FrameTransform, GetMatrix, GetMatrixInverse, MakeMat, MoveWith, RedirectTransformTo, ResetTransformation, SetMatrix, SetPivot, SetRotation, SetScale, SetTransformation, SetTranslation, multMat4pt, setMatrixComponents, transformIsIdentity, transformationSourceCode

Inherited from Transformable.Transformable (private): _SetPivot

Inherited from Displayable.Displayable: InitColor, InitMaterial, SetupGL, getLineWidth, getPointWidth, getStippleLines, getStipplePolygons


Class Variables [hide private]
  _numberOfDeletedGeoms = 0
  keywords = ['immediateRendering', 'listed', 'name', 'needsRedoD...
  sourceBlendFunctions = [0, 1, 774, 775, 770, 771, 772, 773, 776]
  destBlendFunctions = [0, 1, 768, 769, 770, 771, 772, 773]

Method Details [hide private]

__init__(self, name=None, check=1, **kw)
(Constructor)

source code 
Constructor
Overrides: Common2d3dObject.Common2d3dObject.__init__
(inherited documentation)

getState(self)

source code 
return a dictionary describing this object's state This dictionary can be passed to the Set method to restore the object's state
Overrides: Common2d3dObject.Common2d3dObject.getState

getGeomMaterialCode(self, geomName, indent='', includePerVertexOrFace=True)

source code 
Returns a list of strings containing Python code to restore the material of this geoemtry. indent is the level of indentation that is desired. geomName is the name of the Geom object in the source code generated.

getGeomClipPlanesCode(self, geomName, indent='')

source code 
Returns a list of strings containing Python code to restore the clipping planes of this geoemtry. indent is the level of indentation that is desired. geomName is the name of the Geom object in the source code generated.

delete(self)

source code 
None

getVertices(self)

source code 
returns a handle to the vertices array

getVNormals(self)

source code 
returns a handle to the vertices array

getDepthMask(self)

source code 
None
Overrides: Common2d3dObject.Common2d3dObject.getDepthMask

SetPolyMode(self, face, mode)

source code 
Modify polymode

SetFrontPolyMode(self, val)

source code 
Modify the current Object's frontPolyMode

SetBackPolyMode(self, val)

source code 
Modify the current Object's frontPolyMode

SetFrontBackPolyMode(self, val)

source code 
Modify the current Object's frontPolyMode

GetFrontPolyMode(self)

source code 
None

getDrawOutlineMode(self)

source code 
None

GetShading(self)

source code 
None

GetLighting(self)

source code 
None

getSharpColorBoundaries(self)

source code 
None

MaterialBindingMode(self, num, face=GL.GL_FRONT, mode=None)

source code 
Figure out how materials should be used to color the object

AddMaterial(self, values, propNum=None, face=GL.GL_FRONT, mode=None)

source code 
Add materials to the current set

SetMaterial(self, values, propNum, face=GL.GL_FRONT, mode=None)

source code 
Set the materials WARNING: when back face colors are set, two sided lighting has to be enabled

GetNormals(self)

source code 
Find the normals to be used for a given shading

Add(self, check=1, redo=1, **kw)

source code 
add data to this object set self.redoDspLst to 1 to force re-building of geometries DpyList which implies recontruction of main display list. set redoMain to 1 to force on reconstruction of main DpyList

SetForChildren(self, recursive=False, **kw)

source code 
set properties for children of this object. If recursive is True the properties are set for the entire subtree.

Set(self, check=1, redo=1, updateOwnGui=True, **kw)

source code 
set data for this object check=1 : verify that all the keywords present can be handle by this func redo=1 : append self to viewer.objectsNeedingRedo updateOwnGui=True : allow to update owngui at the end this func
Overrides: Common2d3dObject.Common2d3dObject.Set

setTransparency(self, val)

source code 
None

__repr__(self)
(Representation operator)

source code 
None

BoundingBox(self, display=None, color=None, lineWidth=None)

source code 
Turn Bounding Box drawing on and off, set attributs

Draw(self)

source code 
function that make the opengl call to draw the geom Should be call by RedoDisplayList in between glNewList/ glEndList

deleteOpenglTemplateList(self)

source code 
None

deleteOpenglList(self)

source code 
None
Overrides: Common2d3dObject.Common2d3dObject.deleteOpenglList

RedoDisplayList(self)

source code 
Next Redraw will force to rebuild the OpenGL display list
Overrides: Common2d3dObject.Common2d3dObject.RedoDisplayList

AddClipPlane(self, cp, side=-1, clipChildren=True, tagModified=True)

source code 
Add the arbitrary clipping plane 'cp' to this geometry

RemoveClipPlane(self, cp)

source code 
Remove the clip. plane from the list of CP clipping this object

ApplyParentsTransform(self, coords, instance=None)

source code 
Return a vector of 3D coordinates transformed by all transformations up to root (excluded)

TransformedCoords(self, root=None, instance=None)

source code 
Return the vertices after applying the current transformation

ObjSubTreeBB(self, obj)

source code 
None

ComputeBB(self)

source code 
This method computes the bounding box of the visible objects in the tree rooted at this object. This method handles properly instance matrices

_DrawBox(self, bbmin, bbmax)

source code 
Draw the bounding box using lines

DrawTreeBoundingBox(self)

source code 
Draw's the bounding box of this object and all of its visible descendants

DrawBoundingBox(self)

source code 
Draw's the objects bounding box

addVertexNormalsGeom(self)

source code 
None

faceCenterVector(self, faceIndex)

source code 
None

addFaceNormalsGeom(self)

source code 
None

removeVertexNormalsGeom(self)

source code 
None

removeFaceNormalsGeom(self)

source code 
None

RenderMode(self, mode=None, shading=None, face=GL.GL_FRONT, redo=1)

source code 
Set the render mode

asIndexedPolygons(self, **kw)

source code 
Should return an IndexedPolygons object if this object can be represented using triangles, else return None

sortPoly(self, order=-1)

source code 
None <- sortPoly(order=-1) Sorts the geometry polygons according to z values of polygon's geomtric centers. Order=-1 sorts by furthest z first,, order=1 sorts by closest z first

sortPoly_cb(self, event=None)

source code 
None

setViewer(self, viewer, buildDisplayList)

source code 
set viewer in all children of geom object
Overrides: Common2d3dObject.Common2d3dObject.setViewer

AllObjects(self)

 
Return a list of all children of this object in the object tree
Overrides: Common2d3dObject.Common2d3dObject.AllObjects

AllVisibleObjects(self)

 
Return a list of all visible children of this object in the object tree
Overrides: Common2d3dObject.Common2d3dObject.AllVisibleObjects

DisplayFunction(self)

 
Dummy display function. Needs to be implemented by subclass
Overrides: Common2d3dObject.Common2d3dObject.DisplayFunction

LastParentBeforeRoot(self)

 
return the last parent of a node before the root object is reached
Overrides: Common2d3dObject.Common2d3dObject.LastParentBeforeRoot

_Hide(self)

 
Transient signal handler
Overrides: Common2d3dObject.Common2d3dObject._Hide

_Remove(self, a, b)

 
Transient signal handler
Overrides: Common2d3dObject.Common2d3dObject._Remove

isTransparent(self)

 
None

updateParentsForImmediateRendering(self, val)

 
None

Class Variable Details [hide private]

_numberOfDeletedGeoms

None
Value:
0                                                                     
      

keywords

None
Value:
['immediateRendering',
 'listed',
 'name',
 'needsRedoDpyListOnResize',
 'pickable',
 'protected',
 'replace',
 'tagModified',
...                                                                    
      

sourceBlendFunctions

None
Value:
[0, 1, 774, 775, 770, 771, 772, 773, 776]                              
      

destBlendFunctions

None
Value:
[0, 1, 768, 769, 770, 771, 772, 773]