[Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in ascript?
Sylvester Gerardson
sylvester.gerardson at gmail.com
Wed Jun 18 09:29:47 EDT 2008
Hi Robert,
To create a glyph filter using python scripting I always use something like:
sourceArrow = servermanager.sources.ArrowSource()
sourceCone = servermanager.sources.ConeSource()
sourceCube = servermanager.sources.CubeSource()
sourceCylinder = servermanager.sources.CylinderSource()
sourceLine = servermanager.sources.LineSource()
sourceSphere = servermanager.sources.SphereSource()
sourceGlyph2D = servermanager.sources.GlyphSource2D()
sourcePoint = servermanager.sources.PointSource()
Glyph01 =
servermanager.filters.Glyph(registrationGroup='sources',registrationName='Gl
yph01',Input=SurfVec01)
propertyGlyph01 = Glyph01.GetProperty('Source')
domainGlyph01 = propertyGlyph01.GetDomain('proxy_list');
domainGlyph01.AddProxy(sourceArrow.SMProxy)
domainGlyph01.AddProxy(sourceCone.SMProxy)
domainGlyph01.AddProxy(sourceCube.SMProxy)
domainGlyph01.AddProxy(sourceCylinder.SMProxy)
domainGlyph01.AddProxy(sourceLine.SMProxy)
domainGlyph01.AddProxy(sourceSphere.SMProxy)
domainGlyph01.AddProxy(sourceGlyph2D.SMProxy)
Glyph01.Source = sourceArrow
Glyph01.SetScaleFactor = 0.02
Glyph01.RandomMode = 0
Glyph01.UseMaskPoints = 0
Glyph01.SetScaleMode = 3
repGlyph01 =
servermanager.CreateRepresentation(Glyph01,view,registrationGroup='represent
ations')
This works fine for me.
Regards,
Sylvester
-----Original Message-----
From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
On Behalf Of Robert Cimrman
Sent: 18 June 2008 14:23
To: paraview at paraview.org
Subject: [Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in
ascript?
Hi all,
I try to visualize a point vector field 'u' using arrow glyphs, but no
matter how I set 'ScaleFactor' property the arrows stay the same (too
big). The relevant part of the code is below - what I am doing wrong? I
have even created the scene in the GUI, saved it into .pvsm file, loaded
into another script, examined the Glyph proxy and set the Glyph
properties in my script accordingly. No change :(
...
reader = servermanager.sources.LegacyVTKFileReader( FileNames =
[inFileName] )
view = servermanager.CreateRenderView()
arrows = servermanager.filters.Glyph( Input = reader )
arrows.SelectInputScalars = [ '', '', '', '', 'p' ]
arrows.SelectInputVectors = [ '1', '', '', '', 'u' ]
arrows.ScaleMode = 1
arrows.Orient = 1
arrows.ScaleFactor = 0.001
arrows.Source = servermanager.sources.ArrowSource()
arep = servermanager.CreateRepresentation( arrows, view )
view.StillRender()
view.ResetCamera()
camera = view.GetActiveCamera()
camera.Elevation( 45 )
view.StillRender()
...
r.
_______________________________________________
ParaView mailing list
ParaView at paraview.org
http://www.paraview.org/mailman/listinfo/paraview
More information about the ParaView
mailing list