[Paraview] setting the Glyph filter' SetScaleFactor value in a macro

Hal Canary hal at cs.unc.edu
Tue Apr 17 15:32:35 EDT 2012


I am writing a ParaView macro to apply several glyph filters on the same 
data set.  Each filter wants to set its own SetScaleFactor value, but I 
am trying to override the default to make each glyph filter scale 
correctly with the other filters.  I can't seem to get the expected 
behavior out of the filter.

Here's my test case, as a ParaView macro:
	vector1 = 'vector1'
	scalar1 = 'scalar1'
	vector2 = 'vector2'
	scalar2 = 'scalar2'
	
	s = Wavelet()
	Show(s)
	Hide(s)
	s = Calculator(
		Function='RTData*5-6',
		ResultArrayName=scalar1 )
	Show(s)
	Hide(s)
	s = Calculator(
		Function='RTData*sin(coordsX)',
		ResultArrayName=scalar2)
	Show(s)
	Hide(s)
	s = Gradient(
		Dimensionality='Three',
		SelectInputScalars=['POINTS', 'scalar2'] )
	Show(s)
	Hide(s)
	s = Gradient(
		Dimensionality='Three',
		SelectInputScalars=['POINTS', 'scalar1'] )
	Show(s)
	Hide(s)
	s = Calculator(
		Function='scalar1Gradient',
		ResultArrayName=vector1 )
	Show(s)
	Hide(s)
	s =  Calculator(
		Function='scalar2Gradient',
		ResultArrayName=vector2 )
	Show(s)
	Hide(s)
	arrowGlyph = Glyph(
		Input=s,
		ScaleMode='scalar',
		MaskPoints=0,
		Vectors=['POINTS', vector1],
		Scalars=['POINTS', scalar1],
		GlyphTransform="Transform2",
		GlyphType="Arrow",
		Orient=1 )
	arrowGlyph.SetScaleFactor = 0.01
	Show(arrowGlyph)
	arrowGlyph = Glyph(
		Input=s,
		ScaleMode='scalar',
		MaskPoints=0,
		Vectors=['POINTS', vector2],
		Scalars=['POINTS', scalar2],
		GlyphTransform="Transform2",
		GlyphType="Arrow",
		Orient=1 )
	arrowGlyph.SetScaleFactor = 0.01
	Show(arrowGlyph)
	Render()

Any idea what I can do differently?

Thanks,

-- 
Hal Canary
http://cs.unc.edu/~hal/


More information about the ParaView mailing list