# Restore scene to initial state

**URL:** https://discourse.vtk.org/t/restore-scene-to-initial-state/9824
**Category:** Support
**Created:** [November 15, 2022, 11:33am UTC](https://discourse.vtk.org/t/restore-scene-to-initial-state/9824 "2022-11-15T11:33:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SpareSimian](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@SpareSimian](https://discourse.vtk.org/u/SpareSimian)
#### Post date: [November 15, 2022, 11:33am UTC](https://discourse.vtk.org/t/restore-scene-to-initial-state/9824/1 "2022-11-15T11:33:57Z")

</div>

ResetCamera appears to point the camera from its current position back at the actors. I’m looking for something that restores the initial scene conditions, including restoring the initial camera location and settings.

My app creates an interactor with its window, renderer, and camera, then loads and adds a PolyData made up of a stack of quads. So the initial view is down at the top of the stack. If a user swings the camera around and pans and zooms, I’d like to provide the facility to return to the initial state, before interaction, without reloading the whole thing.

Is there a method or set of methods to call to do that? Perhaps a save/restore sequence?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [November 26, 2022, 9:57pm UTC](https://discourse.vtk.org/t/restore-scene-to-initial-state/9824/2 "2022-11-26T21:57:32Z")

</div>

Hello,

My two cents: create a 2nd `vtkCamera` object and do this after you init the scene:

```cpp
   defaultCamera->deepCopy( theCamera );

```

Then, wherever you need to restore the original camera settings, do:

```cpp
   theCamera->deepCopy( defaultCamera );

```

You can easily extend this rationale with a stack (say, with 10 camera objects) if you wish to implement an undo-list-like behavior.

take care,

Paulo

---

<div class="post-metadata">

### Author: ![SpareSimian](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@SpareSimian](https://discourse.vtk.org/u/SpareSimian)
#### Post date: [November 27, 2022, 4:30pm UTC](https://discourse.vtk.org/t/restore-scene-to-initial-state/9824/3 "2022-11-27T16:30:49Z")

</div>

Perfect, thanks!

In C++, the method is DeepCopy. In my button handler for OnResetView, I just had to add a renderWindow-\>render() to update the display.
