Re: [Paraview] ParaView and Python: Position of a slice and pressing the "Rescale to Data Range"-Button

2010-03-04 Thread Stefan Kroboth
At first: thanks for your fast answer!

>> Is there an option to automatically render a slice when it is moved? I 
>> basically don't want to press the Apply-button whenever the slice is moved. 
>> If this isn't possible, how do i "press" the Apply-button with python?
> 
> Yes, go to Edit | Settings. There's a check box for "Auto Accept" on
> the "General" page -- check that. ParaView then auto-apply.

Thanks, thats exactly what I was looking for!

>> I could read the Origin-values from the Properties field of the Object 
>> Inspector and set the Origin-values from the Display field to this values. 
>> But how do I get this Origin-values (I only found the ones from the Display 
>> field in python).
> 
> I am not sure I understand what you are trying to do here.

Nevermind, I don't need this with the solution you provided above.

>> I also need to press the "Rescale to Data Range" button when the slice is 
>> moved. Is this even possible? If so, how?
> 
> Not currently. However, you can always write up a python script that
> achieves the same effect. Let me know if you need help with that.

I guess I have to create a Lookup-Table? It seems that I need the 'scalars' 
values from the 'Information' page of the Object Inspector (Subsection Data 
Arrays). How do I get these?

It seems that I'm having another problem now. After creating the Slice, I set 
the ColorArrayName to 'scalars'. The "Color by" field changes, but the Slice is 
just red and pressing "Rescale to Data Range" doesn't change anything. When I 
manually change it to "Solid Color" and then change it back to "scalars", it 
works fine.

This is the code:

s=Slice()
sdp = GetDisplayProperties(s)
sdp.Input.SliceType.Normal = [0,0,1]
sdp.ColorArrayName = 'scalars'

What am I doing wrong?

Thanks,
   Stefan


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] ParaView and Python: Position of a slice and pressing the "Rescale to Data Range"-Button

2010-03-03 Thread pat marion
I think you are trying to set the origin of the slice plane from python?  It
would be sliceFilter.SliceType.Origin = [0, 0, 0].

Try entering these lines in the python console for a demo:

Sphere()
s = Slice()
Show()

for i in range(100):

s.SliceType.Origin=[-0.5 + i*0.01, 0,0]

Render()


Note that when you set the Origin property from python it is automatically
applied, you don't need to click the apply button, but the screen does not
automatically render, so you need to call Render().

Pat

On Wed, Mar 3, 2010 at 10:17 AM, Utkarsh Ayachit <
utkarsh.ayac...@kitware.com> wrote:

> > Is there an option to automatically render a slice when it is moved? I
> basically don't want to press the Apply-button whenever the slice is moved.
> If this isn't possible, how do i "press" the Apply-button with python?
>
> Yes, go to Edit | Settings. There's a check box for "Auto Accept" on
> the "General" page -- check that. ParaView then auto-apply.
>
> > I could read the Origin-values from the Properties field of the Object
> Inspector and set the Origin-values from the Display field to this values.
> But how do I get this Origin-values (I only found the ones from the Display
> field in python).
>
> I am not sure I understand what you are trying to do here.
>
> > I also need to press the "Rescale to Data Range" button when the slice is
> moved. Is this even possible? If so, how?
>
> Not currently. However, you can always write up a python script that
> achieves the same effect. Let me know if you need help with that.
>
> Utkarsh
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


Re: [Paraview] ParaView and Python: Position of a slice and pressing the "Rescale to Data Range"-Button

2010-03-03 Thread Utkarsh Ayachit
> Is there an option to automatically render a slice when it is moved? I 
> basically don't want to press the Apply-button whenever the slice is moved. 
> If this isn't possible, how do i "press" the Apply-button with python?

Yes, go to Edit | Settings. There's a check box for "Auto Accept" on
the "General" page -- check that. ParaView then auto-apply.

> I could read the Origin-values from the Properties field of the Object 
> Inspector and set the Origin-values from the Display field to this values. 
> But how do I get this Origin-values (I only found the ones from the Display 
> field in python).

I am not sure I understand what you are trying to do here.

> I also need to press the "Rescale to Data Range" button when the slice is 
> moved. Is this even possible? If so, how?

Not currently. However, you can always write up a python script that
achieves the same effect. Let me know if you need help with that.

Utkarsh
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview