Back to index

salome-paravis  6.5.0
Functions | Variables
demo1 Namespace Reference

Functions

def demo1

Variables

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

Function Documentation

def demo1.demo1 (   impth)
Simple demo that create the following pipeline
sphere - shrink - \
                   - append
cone            - /

Definition at line 25 of file demo1.py.

00025 
00026 def demo1(impth):
00027     """Simple demo that create the following pipeline
00028     sphere - shrink - \
00029                        - append
00030     cone            - /
00031     """
00032 
00033     # Create a sphere of radius = 0.5, theta res. = 32
00034     # This object becomes the active source.
00035     ss = Sphere(Radius=0.5, ThetaResolution=32, PhiResolution=8)
00036 
00037     # The view and representation
00038     v = GetRenderView()
00039     if not v:
00040        v = CreateRenderView()
00041     v.CameraPosition = [-3, -3, -3]
00042     v.CameraViewUp = [0, 0, 1]
00043     v.StillRender()
00044 
00045     # Apply the shrink filter. The Input property is optional. If Input
00046     # is not specified, the filter is applied to the active source.
00047     shr = Shrink(Input=ss)
00048  
00049     # Create a cone source. 
00050     cs = Cone()
00051 
00052     # Append cone and shrink
00053     app = AppendDatasets()
00054     app.Input = [shr, cs]
00055 
00056     # Show the output of the append filter. The argument is optional
00057     # as the app filter is now the active object.
00058     Show(app)
00059     WriteImage(filename = (impth + "demo1_1.png"), view=v, Magnification=2) 
00060 
00061     PointData = app.GetDataInformation().GetNumberOfPoints()
00062     CellData = app.GetDataInformation().GetNumberOfCells()
00063     print PointData, " Points"
00064     print CellData, " Cells"
00065 
00066     # Render the default view.
00067     Render()
00068 
    

Here is the call graph for this function:


Variable Documentation

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

Definition at line 70 of file demo1.py.

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

Definition at line 69 of file demo1.py.