Commit e0de6460 authored by Sebastien Barre's avatar Sebastien Barre
Browse files

BUG: [backward compat change]. GetActiveCamera() does not reset the camera...

BUG: [backward compat change]. GetActiveCamera() does not reset the camera anymore. If the renderer had no camera, it would create one automatically *and* reset it. This side effect would trigger the whole pipeline to get the props bounds. Moreover, a call to GetActiveCamera()->Foobar() would have different/inconsistent results depending on whether or not the renderer had a camera already. GetActiveCamera() still creates a cam, but does not reset it. If one calls GetActiveCamera(), it should have full control of it anyway at this point (and reset it or not). The old friendly behaviour remains though, if the user does not bother with the camera at all, it is created during the first render *and* reset to show the whole scene.
parent 4bf5d204
......@@ -86,6 +86,7 @@ class TestTensorGlyph(Testing.vtkTest):
for j in i.GetActors():
ren.AddActor(j)
ren.ResetCamera();
cam = ren.GetActiveCamera()
cam.Azimuth(-20)
cam.Elevation(20)
......
......@@ -70,6 +70,7 @@ class TestTextureGlyph(Testing.vtkTest):
ren.SetBackground(0.5, 0.5, 0.5)
ren.AddActor(a)
ren.ResetCamera();
cam = ren.GetActiveCamera()
cam.Azimuth(-90)
cam.Zoom(1.4)
......
......@@ -48,6 +48,7 @@ trans.SetMatrix(mat)
# assign our actor to the renderer
ren.AddActor(coneActor)
ren.ResetCamera();
ren.GetActiveCamera().SetUserTransform(trans);
renWin.Render()
......
......@@ -36,8 +36,9 @@ vtkActor actor
vtkRenderer ren
ren AddActor actor
ren AddActor sphereActor
set camera [ren GetActiveCamera]
ren ResetCamera
set camera [ren GetActiveCamera]
#$camera SetPosition 68.1939 -23.4323 12.6465
#$camera SetViewUp 0.46563 0.882375 0.0678508
#$camera SetFocalPoint 3.65707 11.4552 1.83509
......
......@@ -37,8 +37,9 @@ actor SetMapper mapper
vtkRenderer ren
ren AddActor actor
set camera [ren GetActiveCamera]
ren ResetCamera
set camera [ren GetActiveCamera]
#$camera SetPosition 68.1939 -23.4323 12.6465
#$camera SetViewUp 0.46563 0.882375 0.0678508
#$camera SetFocalPoint 3.65707 11.4552 1.83509
......
......@@ -135,6 +135,7 @@ class TestImagePlaneWidget(Testing.vtkTest):
planeWidgetZ.On()
# Create an initial interesting view
ren.ResetCamera();
cam1 = ren.GetActiveCamera()
cam1.Elevation(110)
cam1.SetViewUp(0, 0, -1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment