Back to index

salome-paravis  6.5.0
Functions | Variables
demo3 Namespace Reference

Functions

def demo3

Variables

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

Function Documentation

def demo3.demo3 (   impth)
This method demonstrates an artificial data sources,
probes it with a line, etc

Definition at line 26 of file demo3.py.

00026 
00027 def demo3(impth):
00028     """This method demonstrates an artificial data sources,
00029     probes it with a line, etc"""
00030 
00031     # The TWO views
00032     rv = GetRenderView()
00033     
00034     v = CreateRenderView()  
00035     v.CameraPosition = [-30, -20, -65]
00036     v.CameraFocalPoint = [0.0, 0.0, 0.0]
00037     v.CameraViewUp = [-0.65, -0.55, 0.5]
00038     v.CameraViewAngle = [30]
00039     SetActiveView(rv)
00040 
00041     src = Wavelet()
00042     # Get some information about the data. First, for the source to execute
00043     UpdatePipeline()
00044 
00045     di = src.GetDataInformation()
00046     print "Data type:", di.GetPrettyDataTypeString()
00047     print "Extent:", di.GetExtent()
00048 
00049     ##src.Representation = 3 # outline
00050     Show(src, view=v)
00051     v.StillRender()
00052 
00053     # Apply a contour filter
00054     cf = Contour(Input = src)
00055     cf.ContourBy = ['POINTS', 'RTData']
00056     cf.Isosurfaces = [37.353099999999998, 63.961533333333335, 90.569966666666673, 117.1784, 143.78683333333333, 170.39526666666666, 
00057                                  197.00370000000001, 223.61213333333333, 250.22056666666668, 276.82900000000001]
00058     Show(cf, view=rv)
00059 
00060     #Set background
00061     SetViewProperties(Background = [.50, .20, .30])
00062     Render()
00063 
00064     # Reset the camera to include the whole thing
00065     rv.StillRender()
00066     rv.ResetCamera()
00067     rv.CameraPosition = [-2.50, 60, -40]
00068     rv.CameraFocalPoint = [1.25, 1.0, 1.35]
00069     rv.CameraViewUp = [-0.955, 0.1, 0.25]
00070     rv.CameraViewAngle = [30]
00071     rv.StillRender()
00072 
00073     # Now, let's probe the data
00074     probe = ResampleWithDataset(Input=src)
00075 
00076     # with a line
00077     line = Line(Resolution=60)
00078 
00079     # that spans the dataset
00080     bounds = di.GetBounds()
00081 
00082     print "Bounds: ", bounds
00083     line.Point1 = bounds[0:6:2]
00084     line.Point2 = bounds[1:6:2]
00085 
00086     probe.Source = line
00087 
00088     # Render with the line
00089     Show(line, view=rv)
00090     rv.StillRender()
00091     WriteImage(filename = (impth + "demo3_1.png"), view=v, Magnification=2)
00092     WriteImage(filename = (impth + "demo3_2.png"), view=rv, Magnification=2)

Here is the call graph for this function:


Variable Documentation

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

Definition at line 94 of file demo3.py.

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

Definition at line 93 of file demo3.py.