View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013942ParaView(No Category)public2013-03-14 10:192014-08-29 11:00
ReporterAlejandro Ribes 
Assigned ToUtkarsh Ayachit 
PriorityhighSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version4.2Fixed in Version4.2 
Summary0013942: "FitAll" function in python scripting
DescriptionHello,

I have a request concerning the function that set the viewing position so that all visible datasets in the selected 3D view are within the viewing frustum. This function is the first icon in the Camera Control Toolbar. I would like to use this function when scripting in python. Can you expose this function via a "FitAll" method or something similar? I know there exists a ResetCamera function but it seems that does not correspond to what I want.

Exemple:

_RenderView = GetRenderView()
_RenderView.CenterAxesVisibility = 0
_RenderView.CenterOfRotation = [2.05, 2.05, 2.13]
_RenderView.CameraViewUp = [-0.1462842057166934, -0.63184311527201897, -0.76116700456679443] _RenderView.CameraPosition = [4.3574016706599696, 7.6016996854983274, -3.0256734058706636] _RenderView.CameraClippingRange = [2.9513133656308672, 13.226048282992661]
_RenderView.CameraFocalPoint = [2.9930930754568661, 1.7779227807543228, 2.0708298819357598]

The last 4 commands of this code are necessary to do the "FitAll" BUT they are dependent on the mesh and then not adapted to a pure scripting environment.
Thanks in advance,

Alejandro.
TagsNo tags attached.
ProjectParaViS
Topic Name
Typefeature
Attached Files

 Relationships

  Notes
(0030505)
Utkarsh Ayachit (administrator)
2013-04-03 07:10

Alejandro,

That's exactly what "ResetCamera()" should do. What is the problem you're seeing with ResetCamera()? The first icon in the Camera toolbar, indeed calls the same method as the ResetCamera() call.
(0032623)
Vadim SANDLER (reporter)
2014-05-07 03:50

Hello Utkarsh,

As I understand a ResetCamera()method doesn’t change the camera position, in the result of the presented below actions a presentation is not visible:

v = GetActiveView()
c = Cone()
representation = Show()
Render()
v.CameraPosition = [0,0,0]
v.ResetCamera()
Render()

Required a method which sets the camera parameters so that all displayed presentations can be seen.

Regards,
Roman
(0032624)
Utkarsh Ayachit (administrator)
2014-05-07 09:24

Roman,

The only reason the specific code fails is because when you change CameraPosition to [0, 0, 0], the CameraFocalPoint is by default [0, 0, 0] too and then VTK totally gets lost since it doesn't have any view direction to work with. ResetCamera will indeed update both, the CameraPosition and the CameraFocalPoint, however it does need a valid view direction to start with.

Utkarsh
(0032713)
Vadim SANDLER (reporter)
2014-06-03 04:26

Utkarsh,

Thanks you for the detailed explanations.
This issue can be closed.

Roman.

 Issue History
Date Modified Username Field Change
2013-03-14 10:19 Alejandro Ribes New Issue
2013-04-03 07:10 Utkarsh Ayachit Note Added: 0030505
2014-05-07 03:50 Vadim SANDLER Note Added: 0032623
2014-05-07 09:24 Utkarsh Ayachit Note Added: 0032624
2014-06-03 04:26 Vadim SANDLER Note Added: 0032713
2014-06-05 11:30 Joachim Pouderoux Resolution open => fixed
2014-06-05 11:30 Joachim Pouderoux Description Updated
2014-06-08 12:11 Utkarsh Ayachit Status backlog => closed
2014-06-08 12:11 Utkarsh Ayachit Assigned To => Utkarsh Ayachit
2014-06-08 12:11 Utkarsh Ayachit Fixed in Version => git-master
2014-06-17 09:21 Utkarsh Ayachit Target Version => 4.2
2014-08-29 11:00 Utkarsh Ayachit Fixed in Version git-master => 4.2


Copyright © 2000 - 2018 MantisBT Team