MCPcopy Create free account
hub / github.com/Kitware/VTK / SetRenderWindow

Method SetRenderWindow

Views/Core/vtkRenderViewBase.cxx:61–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void vtkRenderViewBase::SetRenderWindow(vtkRenderWindow* win)
62{
63 if (!win)
64 {
65 vtkErrorMacro(<< "SetRenderWindow called with a null window pointer."
66 << " That can't be right.");
67 return;
68 }
69
70 // move renderers to new window
71 vtkRendererCollection* rens = this->RenderWindow->GetRenderers();
72 while (rens->GetNumberOfItems())
73 {
74 vtkRenderer* ren = rens->GetFirstRenderer();
75 ren->SetRenderWindow(nullptr);
76 win->AddRenderer(ren);
77 this->RenderWindow->RemoveRenderer(ren);
78 }
79
80 vtkSmartPointer<vtkInteractorObserver> style =
81 this->GetInteractor() ? this->GetInteractor()->GetInteractorStyle() : nullptr;
82 this->RenderWindow = win;
83 if (this->GetInteractor())
84 {
85 this->GetInteractor()->SetInteractorStyle(style);
86 }
87 else if (style)
88 {
89 vtkGenericRenderWindowInteractor* iren = vtkGenericRenderWindowInteractor::New();
90 win->SetInteractor(iren);
91 iren->SetInteractorStyle(style);
92 iren->Delete();
93 }
94}
95
96vtkRenderWindowInteractor* vtkRenderViewBase::GetInteractor()
97{

Callers 1

SetRendererMethod · 0.45

Calls 11

GetInteractorMethod · 0.95
GetRenderersMethod · 0.80
GetFirstRendererMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetNumberOfItemsMethod · 0.45
AddRendererMethod · 0.45
RemoveRendererMethod · 0.45
GetInteractorStyleMethod · 0.45
SetInteractorStyleMethod · 0.45
SetInteractorMethod · 0.45

Tested by

no test coverage detected