[Paraview] Help getting resetting cameras between batch viz runs

2011-09-01 Thread Rick Muller
I'm using the Python scripting facility in Paraview to do some batch
visualization of some semiconductor models I'm simulating. The Start/Stop
Trace feature is great, and I've already put together something quite
usable. However, I can't figure out how to reset the camera between
different simulations.

The code coming out of the Trace feature looked something like:
rv = pv.GetRenderView()
rv.CameraFocalPoint = [0.223, -0.0160,-0.334]
rv.CameraParallelScale = 1.684
rv.CenterOfRotation = [0.223, -0.0160,-0.334]
rv.CameraPosition = [0.223, -0.0160, 4.105]
rv.CameraClippingRange = [5.308, 8.033]
i.e. they already got the center of the object from some query to the
objects already in the database. What would I have to do to get this
information myself? I'm having a hard time finding info. I've tried reading
the doctext for the Outline and OutlineCorners features, and I've seen a
couple refs to a GetBounds command while googling around, but I can't find
anything that really helps.

My pipeline looks something like:
* Use the ExodusIIReader to create a reader object
* Use the aforementioned render view object to control the camera
* Create a slice object in the z-direction at a certain height
* Create a data representation and a colormap
* Render the object.
I can't tell which of the objects I would use for an Outline() or a
GetBounds() call. For example, I get the min/max values for the data in the
slice via
min,max = slice.PointData[0].GetRange()
but using s or s.PointData with Outline() or GetBounds() doesn't get me
anywhere. Can anyone nudge me in the right direction?

Thanks,
Rick

-- 
Rick Muller
rpmul...@gmail.com
505-750-7557
___
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] Help getting resetting cameras between batch viz runs

2011-09-02 Thread Rick Muller
Marco,

Thanks very much for your reply. Actually, it isn't the camera I need
information on, it's the rest of the object. I need to know how big the
thing I'm looking at is, so I can know where exactly I should move the
camera. And I can't figure out how to get bounding box on any of the objects
that are available to me. Do you have any idea?

On Fri, Sep 2, 2011 at 4:05 AM, Marco Nawijn  wrote:

> Hello Rick,
>
> You can get a direct reference to the camera like this:
>
>>>> camera = GetActiveCamera()
>
> You have than full control with the different Get/Set methods. Like:
>
>>>> camera.GetFocalPoint()
>(-12.119979858398438, -3.0926971435546875, 36.27721977233887)
>
> Don't forget to call Render() if you set camera parameters.
>
>
>
>
> On Thu, Sep 1, 2011 at 11:46 PM, Rick Muller  wrote:
> > I'm using the Python scripting facility in Paraview to do some batch
> > visualization of some semiconductor models I'm simulating. The Start/Stop
> > Trace feature is great, and I've already put together something quite
> > usable. However, I can't figure out how to reset the camera between
> > different simulations.
> >
> > The code coming out of the Trace feature looked something like:
> > rv = pv.GetRenderView()
> > rv.CameraFocalPoint = [0.223, -0.0160,-0.334]
> > rv.CameraParallelScale = 1.684
> > rv.CenterOfRotation = [0.223, -0.0160,-0.334]
> > rv.CameraPosition = [0.223, -0.0160, 4.105]
> > rv.CameraClippingRange = [5.308, 8.033]
> > i.e. they already got the center of the object from some query to the
> > objects already in the database. What would I have to do to get this
> > information myself? I'm having a hard time finding info. I've tried
> reading
> > the doctext for the Outline and OutlineCorners features, and I've seen a
> > couple refs to a GetBounds command while googling around, but I can't
> find
> > anything that really helps.
> >
> > My pipeline looks something like:
> > * Use the ExodusIIReader to create a reader object
> > * Use the aforementioned render view object to control the camera
> > * Create a slice object in the z-direction at a certain height
> > * Create a data representation and a colormap
> > * Render the object.
> > I can't tell which of the objects I would use for an Outline() or a
> > GetBounds() call. For example, I get the min/max values for the data in
> the
> > slice via
> > min,max = slice.PointData[0].GetRange()
> > but using s or s.PointData with Outline() or GetBounds() doesn't get me
> > anywhere. Can anyone nudge me in the right direction?
> >
> > Thanks,
> > Rick
> >
> > --
> > Rick Muller
> > rpmul...@gmail.com
> > 505-750-7557
> >
> >
> > ___
> > 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
> >
> >
>



-- 
Rick Muller
rpmul...@gmail.com
505-750-7557
___
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] Help getting resetting cameras between batch viz runs

2011-09-08 Thread Rick Muller
Thanks for the help people gave me for the question below. I now have a
workable solution for much of the batch imaging I need to do.

I'd now like to add some surface rendering, that is, setting
>>> DataRepresentation.Representation = 'Surface'
>>> DataRepresentation.ColorArrayName = 'solution'

Previously, I had used the slice object to get the range of values and the
bounds:

>>> s = Slice(SliceType="Plane")
>>> m,M = s.CellData[0].GetRange()
>>> xmin,xmax,ymin,ymax,zmin,zmax =
s.GetDataInformation().DataInformation.GetBounds()

However, I no longer have the slice object. I have the DataRepresentation
object, and the RenderView, and the output of the ExodusIIReader() call.
I've also defined a number of elementblocks that I can set via:

>>> reader.ElementBlocks = ['a','b']

Can I use any of the available objects to get the data and the boundary
ranges?

Thanks in advance...


On Thu, Sep 1, 2011 at 3:46 PM, Rick Muller  wrote:

> I'm using the Python scripting facility in Paraview to do some batch
> visualization of some semiconductor models I'm simulating. The Start/Stop
> Trace feature is great, and I've already put together something quite
> usable. However, I can't figure out how to reset the camera between
> different simulations.
>
> The code coming out of the Trace feature looked something like:
> rv = pv.GetRenderView()
> rv.CameraFocalPoint = [0.223, -0.0160,-0.334]
> rv.CameraParallelScale = 1.684
> rv.CenterOfRotation = [0.223, -0.0160,-0.334]
> rv.CameraPosition = [0.223, -0.0160, 4.105]
> rv.CameraClippingRange = [5.308, 8.033]
> i.e. they already got the center of the object from some query to the
> objects already in the database. What would I have to do to get this
> information myself? I'm having a hard time finding info. I've tried reading
> the doctext for the Outline and OutlineCorners features, and I've seen a
> couple refs to a GetBounds command while googling around, but I can't find
> anything that really helps.
>
> My pipeline looks something like:
> * Use the ExodusIIReader to create a reader object
> * Use the aforementioned render view object to control the camera
> * Create a slice object in the z-direction at a certain height
> * Create a data representation and a colormap
> * Render the object.
> I can't tell which of the objects I would use for an Outline() or a
> GetBounds() call. For example, I get the min/max values for the data in the
> slice via
> min,max = slice.PointData[0].GetRange()
> but using s or s.PointData with Outline() or GetBounds() doesn't get me
> anywhere. Can anyone nudge me in the right direction?
>
> Thanks,
> Rick
>
> --
> Rick Muller
> rpmul...@gmail.com
> 505-750-7557
>
>


-- 
Rick Muller
rpmul...@gmail.com
505-750-7557
___
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


[Paraview] WriteImage in the background

2011-09-29 Thread Rick Muller
I'm currently doing some rendering on a large collection of exodus files
using pvpython. I would like for this rendering to be done in the
background. However, when I call WriteImage(filename), paraview pops up an
X-window, and renders to the screen while saving the image. Is there any way
to keep the window from showing up?

Rick Muller
___
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