<P>
I have some elementary doubts regarding python scripts in paraview :<BR>
<BR>
1. Can we get the normal VTK pipeline working in paraview.<BR>
<BR>
If we just want to have the conventional VTK pipeline in paraview script the script does not seem to work<BR>
<BR>
import paraview<BR>
<BR>
paraview.ActiveConnection = paraview.Connect()<BR>
<BR>
reader = paraview.CreateProxy("sources", "XMLUnstructuredGridReader", "sources")<BR>
<BR>
pyproxy = paraview.pyProxy(reader)<BR>
pyproxy.SetFileName("fire_ug.vtu")<BR>
pyproxy.UpdateVTKObjects()<BR>
<BR>
isosurface_filter = paraview.CreateProxy("filters", "Contour", "filters")<BR>
<BR>
pyproxy1 = paraview.pyProxy(isosurface_filter)<BR>
pyproxy1.SetInput(reader)<BR>
pyproxy1.SetContourValues(298.38, 396.84, 495.31, 593.775, 692)<BR>
pyproxy1.UpdateVTKObjects()<BR>
<BR>
mapper = paraview.CreateProxy("mappers", "PolyDataMapper", "mappers")<BR>
pyproxy2 = paraview.pyProxy(mapper)<BR>
pyproxy2.SetInput(isosurface_filter)<BR>
<BR>
actor = paraview.CreateProxy("props", "Actor", "props")<BR>
pyproxy3 = paraview.pyProxy(actor)<BR>
pyproxy3.SetMapper(mapper)<BR>
<BR>
renderer = paraview.CreateProxy("renderers", "Renderer", "renderers")<BR>
pyproxy4 = paraview.pyProxy(renderer)<BR>
<BR>
outline_filter = paraview.CreateProxy("filters", "OutlineFilter", "filters")<BR>
pyproxy5 = paraview.pyProxy(outline_filter)<BR>
pyproxy5.SetInput(reader)<BR>
<BR>
renWin = paraview.CreateRenderWindow()<BR>
<BR>
display1 = paraview.CreateDisplay(isosurface_filter, renWin)<BR>
display2 = paraview.CreateDisplay(outline_filter, renWin)<BR>
<BR>
renWin.ResetCamera()<BR>
renWin.StillRender()<BR>
raw_input("Enter") <BR>
<BR>
Traceback (most recent call last):<BR>
File "test5.py", line 24, in <module><BR>
pyproxy3.SetMapper(mapper)<BR>
File "/home/raashid/Desktop/paraview-3.0.1-Linux-x86/lib/paraview-3.0/paraview/__init__.py", line 250, in __getattr__<BR>
if re.compile("^Set").match(name) and self.SMProxy.GetProperty(name[3:]):<BR>
TypeError: __GetProperty() takes exactly 1 argument (2 given)<BR>
<BR>
Renderer : ['AutomaticLightCreation', 'Background',<BR>
'DepthPeeling', 'Erase', 'Layer', 'Lights', 'ViewProps',<BR>
'Viewport'] <BR>
The Renderder does not have a AddActor() method.<BR>
<BR>
Render Window : ['CacheLimit', 'CacheUpdate', 'Displays',<BR>
'GUISize', 'InteractiveRender', 'InvalidateGeometry',<BR>
'LODResolution', 'LODThreshold', 'RenderInterruptsEnabled',<BR>
'StillRender', 'UseImmediateMode', 'UseLight',<BR>
'UseTriangleStrips', 'ViewTime', 'WindowPosition',<BR>
'BackLightAzimuth', 'BackLightElevation', 'BackLightK:B Ratio',<BR>
'BackLightWarmth', 'Background', 'CameraClippingRange',<BR>
'CameraClippingRangeInfo', 'CameraFocalPoint',<BR>
'CameraFocalPointInfo', 'CameraParallelProjection',<BR>
'CameraParallelScale', 'CameraPosition', 'CameraPositionInfo',<BR>
'CameraViewAngle', 'CameraViewUp', 'CameraViewUpInfo',<BR>
'CenterOfRotation', 'EyeAngle', 'FillLightAzimuth',<BR>
'FillLightElevation', 'FillLightK:F Ratio', 'FillLightWarmth',<BR>
'FullScreen', 'HeadLightK:H Ratio', 'HeadLightWarmth',<BR>
'InteractorStyle', 'KeyLightAzimuth', 'KeyLightElevation',<BR>
'KeyLightIntensity', 'KeyLightWarmth', 'LightAmbientColor',<BR>
'LightDiffuseColor', 'LightIntensity', 'LightSpecularColor',<BR>
'LightSwitch', 'MaintainLuminance', 'OffScreenRendering',<BR>
'RenderWindowSize', 'RenderWindowSizeInfo', 'Viewport']<BR>
The Render Window does not have a AddRenderer() method.<BR>
<BR>
<BR>
2. How to get the scaler range of a given dataset. <BR>
<BR>
The normal vtk script that I have written for the velocity glyph for a particular data-set is :<BR>
<BR>
import vtk<BR>
<BR>
reader = vtk.vtkXMLUnstructuredGridReader() <BR>
reader.SetFileName("fire_ug.vtu")<BR>
reader.Update()<BR>
<BR>
range = reader.GetOutput().GetScalarRange()<BR>
<BR>
.................... the usual VTK pipeline<BR>
<BR>
How do we get the scaler range in paraview<BR>
<BR>
<BR>
3. How to color the Iso-surfaces.<BR>
<BR>
import vtk<BR>
<BR>
reader = vtk.vtkXMLUnstructuredGridReader() <BR>
reader.SetFileName("fire_ug.vtu")<BR>
reader.Update()<BR>
<BR>
range = reader.GetOutput().GetScalarRange()<BR>
<BR>
iso = vtk.vtkContourFilter() <BR>
iso.SetInput(reader.GetOutput())<BR>
iso.GenerateValues(50,range) <BR>
<BR>
isoMapper = vtk.vtkPolyDataMapper()<BR>
isoMapper.SetInput(iso.GetOutput())<BR>
isoMapper.SetScalarRange(reader.GetOutput().GetScalarRange())<BR>
<BR>
.................... the usual VTK pipeline<BR>
<BR>
Poly Data Mapper<BR>
None<BR>
None<BR>
None<BR>
['ClippingPlanes', 'ColorArray', 'ColorMode', 'ImmediateModeRendering', 'Input', 'InterpolateScalarsBeforeMapping', 'LookupTable', <BR>
'MapScalars', 'NumberOfSubPieces', 'ScalarMode', 'ScalarVisibility', 'UseLookupTableScalarRange']<BR>
<BR>
PolyDataMapper does not seem to have a ScalerRange method.<BR>
<BR>
<BR>
4. SetFactor not working with the Velocity glyph, and how to use the other parameters ?<BR>
<BR>
The normal vtk script that I have written for the velocity glyph for a particular data-set is :<BR>
<BR>
import vtk<BR>
<BR>
reader = vtk.vtkXMLUnstructuredGridReader() <BR>
reader.SetFileName("fire_ug.vtu")<BR>
reader.Update()<BR>
<BR>
arrow = vtk.vtkArrowSource()<BR>
<BR>
glyph = vtk.vtkGlyph3D()<BR>
glyph.SetInput(reader.GetOutput())<BR>
glyph.SetSource(arrow.GetOutput())<BR>
glyph.SetVectorModeToUseVector()<BR>
glyph.SetScaleModeToScaleByVector()<BR>
glyph.SetScaleFactor(0.1)<BR>
<BR>
.................... the usual VTK pipeline<BR>
<BR>
The corresponding paraview script that I have written is :<BR>
<BR>
import paraview<BR>
<BR>
paraview.ActiveConnection = paraview.Connect()<BR>
<BR>
reader = paraview.CreateProxy("sources", "XMLUnstructuredGridReader", "sources")<BR>
<BR>
pyproxy = paraview.pyProxy(reader)<BR>
pyproxy.SetFileName("fire_ug.vtu")<BR>
pyproxy.UpdateVTKObjects()<BR>
<BR>
arrow = paraview.CreateProxy("sources", "ArrowSource", "sources")<BR>
<BR>
glyph = paraview.CreateProxy("filters", "Glyph", "filters")<BR>
pyproxy1 = paraview.pyProxy(glyph)<BR>
pyproxy1.SetInput(reader)<BR>
pyproxy1.SetSource(arrow)<BR>
pyproxy1.SetScaleMode = "Vector"<BR>
pyproxy1.SetScaleFactor = 0.1<BR>
pyproxy1.UpdateVTKObjects()<BR>
<BR>
.................... the usual paraview pipeline<BR>
<BR>
The problem is that the SetScaleFactor dose not seem to have any effect and the velocity Glyph's dose not scale<BR>
What will be the corresponding paraview script for above vtk one.<BR>
<BR>
5. How to get an Event/Observer pattern of VTK work in paraview ?<BR>
I cannot find an AddObserver() method for any 3d_widgets. <BR>
</P>
<br><br>
<Table border=0 Width=644 Height=57 cellspacing=0 cellpadding=0 style='font-family:Verdana;font-size:11px;line-height:15px;'><TR><td><a href='http://adworks.rediff.com/cgi-bin/AdWorks/click.cgi/www.rediff.com/signature-home.htm/1050715198@Middle5/1261609_1255360/1260817/1?PARTNER=3&OAS_QUERY=null target=new '><img src =http://imadworks.rediff.com/cgi-bin/AdWorks/adimage.cgi/1261609_1255360/creative_1260817.gif alt='smot' border=0></a></td></TR></Table>