2 if not ('servermanager' in dir()):
8 """This method demonstrates an artificial data sources,
9 probes it with a line, etc"""
14 v = CreateRenderView()
15 v.CameraPosition = [-30, -20, -65]
16 v.CameraFocalPoint = [0.0, 0.0, 0.0]
17 v.CameraViewUp = [-0.65, -0.55, 0.5]
18 v.CameraViewAngle = [30]
22 # Get some information about the data. First, for the source to execute
25 di = src.GetDataInformation()
26 print "Data type:", di.GetPrettyDataTypeString()
27 print "Extent:", di.GetExtent()
29 ##src.Representation = 3 # outline
33 # Apply a contour filter
34 cf = Contour(Input = src)
35 cf.ContourBy = ['POINTS', 'RTData']
36 cf.Isosurfaces = [37.353099999999998, 63.961533333333335, 90.569966666666673, 117.1784, 143.78683333333333, 170.39526666666666,
37 197.00370000000001, 223.61213333333333, 250.22056666666668, 276.82900000000001]
41 SetViewProperties(Background = [.50, .20, .30])
44 # Reset the camera to include the whole thing
47 rv.CameraPosition = [-2.50, 60, -40]
48 rv.CameraFocalPoint = [1.25, 1.0, 1.35]
49 rv.CameraViewUp = [-0.955, 0.1, 0.25]
50 rv.CameraViewAngle = [30]
53 # Now, let's probe the data
54 probe = ResampleWithDataset(Input=src)
57 line = Line(Resolution=60)
59 # that spans the dataset
60 bounds = di.GetBounds()
62 print "Bounds: ", bounds
63 line.Point1 = bounds[0:6:2]
64 line.Point2 = bounds[1:6:2]
68 # Render with the line
71 WriteImage(filename = (impth + "demo3_1.png"), view=v, Magnification=2)
72 WriteImage(filename = (impth + "demo3_2.png"), view=rv, Magnification=2)
74 testdir = os.getenv("TESTDIR")
75 pvdata = os.getenv("PVDATA")
77 if __name__ == "__main__":
78 demo3(impth=testdir+"/Pic/")