Browse Source

Merge branch 'associate-camera-with-slice-view'

* associate-camera-with-slice-view:
  vtkLightBoxRendererManager - Fix warning related to missing active camera
Jean-Christophe Fillion-Robin 10 years ago
parent
commit
07222d02da
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Libs/Visualization/VTK/Core/vtkLightBoxRendererManager.cpp

+ 6 - 0
Libs/Visualization/VTK/Core/vtkLightBoxRendererManager.cpp

@@ -94,6 +94,11 @@ RenderWindowItem::RenderWindowItem(const double rendererBackgroundColor[3],
                                 rendererBackgroundColor[1],
                                 rendererBackgroundColor[2]);
 
+  // Ensure a vtkCamera is created and associated with the renderer
+  // This is particularly important to ensure WorldToView/ViewToWorld
+  // work as expected.
+  this->Renderer->GetActiveCamera();
+
   this->SetupImageMapperActor(colorWindow, colorLevel);
   this->SetupHighlightedBoxActor(highlightedBoxColor);
 }
@@ -669,6 +674,7 @@ void vtkLightBoxRendererManager::SetRenderWindowLayout(int rowCount, int columnC
     return;
     }
 
+
   if (this->Internal->RenderWindowRowCount == rowCount && 
       this->Internal->RenderWindowColumnCount == columnCount)
     {