Back to index

salome-paravis  6.5.0
Functions | Variables
demo8 Namespace Reference

Functions

def demo8

Variables

tuple testdir = os.getenv("TESTDIR")
tuple pvdata = os.getenv("PVDATA")

Function Documentation

def demo8.demo8 (   fname,
  impth 
)
This method demonstrates the Glyph filter.

Definition at line 26 of file demo8.py.

00026 
00027 def demo8(fname, impth):
00028     """This method demonstrates the Glyph filter."""
00029 
00030     reader = ExodusIIReader(FileName=fname)
00031     v=GetActiveView()
00032     Show(reader, view=v)
00033     camera = GetActiveCamera()
00034     camera.SetPosition(0, 5, -45)
00035     camera.Elevation(30)
00036 
00037     #Change the can to be wireframe so we can see the glyphs
00038     dp1 = GetDisplayProperties(reader, view=v)
00039     dp1.Representation = 'Wireframe'
00040     glyphFilter = Glyph(reader)
00041 
00042     #We won't see much if we don't move forward in the animation a little bit
00043     tsteps = reader.TimestepValues
00044     v = GetActiveView()
00045     v.ViewTime = tsteps[20]
00046     glyphFilter.Vectors
00047     ## ['POINTS', 'DISPL']
00048 
00049     #Set the glyphs to use the acceleration vectors and adjust scale factor
00050     glyphFilter.Vectors = 'ACCL'
00051     ##glyphFilter.GetScaleFactor
00052     ##1.0
00053     glyphFilter.SetScaleFactor = 0.0000002
00054     
00055     Show()
00056     Render()
00057     WriteImage(filename = (impth + "glyphFilter_1.png"), view=v, Magnification=2)
00058 
00059     #Set the glyphs to use the velocity vectors and adjust scale factor
00060     glyphFilter.Vectors = 'VEL'
00061     glyphFilter.SetScaleFactor = 3e-4
00062  
00063     #Add some color
00064     dp2 = GetDisplayProperties(glyphFilter)
00065     glyphFilter.PointData[:]
00066     ##[Array: PedigreeNodeId, Array: DISPL, Array: VEL, Array: ACCL, Array: GlobalNodeId, Array: GlyphVector]
00067 
00068     #We'll color by velocity so use that array.
00069     vel = glyphFilter.PointData[2]
00070     vel.GetName()
00071     ##'VEL'
00072 
00073     vel.GetRange()
00074     ##(-2479.9521484375, 1312.5040283203125)
00075     dp2.LookupTable = MakeBlueToRedLT(-2479.9521,1312.5)
00076     dp2.ColorAttributeType = 'POINT_DATA'
00077     dp2.ColorArrayName = 'VEL'
00078     Render()
00079     WriteImage(filename = (impth + "glyphFilter_2.png"), view=v, Magnification=2)

Here is the call graph for this function:


Variable Documentation

tuple demo8.pvdata = os.getenv("PVDATA")

Definition at line 81 of file demo8.py.

tuple demo8.testdir = os.getenv("TESTDIR")

Definition at line 80 of file demo8.py.