[Paraview] paraview3.3.0: Glyph filter ignores ScaleFactor in ascript?

Robert Cimrman cimrman3 at ntc.zcu.cz
Wed Jun 18 09:27:06 EDT 2008


Whoops, now I can see what was wrong... I should stop today.

arrows.ScaleFactor = 0.001
instead of
arrows.SetScaleFactor = 0.001

It works now, thanks Sylvester!

BTW. how do I color the glyphs according to their magnitude?
If you happen to have a complete example code with colorbars, opacity
setting, etc. that you could share I would be very happy. :) The public
documentation is a little bit terse (I do not have the manual).

Is it possible to force paraview to report something/raise an error if
one sets an attribute that is not a valid property name? The mistake
that I made is very difficult to detect for a paraview newbie...

cheers,
r.

Sylvester Gerardson wrote:
> 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