------------------------------------------------------------------------------
| 555 | |
| 556 | //------------------------------------------------------------------------------ |
| 557 | void vtkImageViewer2::InstallPipeline() |
| 558 | { |
| 559 | if (this->RenderWindow && this->Renderer) |
| 560 | { |
| 561 | this->RenderWindow->AddRenderer(this->Renderer); |
| 562 | } |
| 563 | |
| 564 | if (this->Interactor) |
| 565 | { |
| 566 | if (!this->InteractorStyle) |
| 567 | { |
| 568 | this->InteractorStyle = vtkInteractorStyleImage::New(); |
| 569 | vtkImageViewer2Callback* cbk = vtkImageViewer2Callback::New(); |
| 570 | cbk->IV = this; |
| 571 | this->InteractorStyle->AddObserver(vtkCommand::WindowLevelEvent, cbk); |
| 572 | this->InteractorStyle->AddObserver(vtkCommand::StartWindowLevelEvent, cbk); |
| 573 | this->InteractorStyle->AddObserver(vtkCommand::ResetWindowLevelEvent, cbk); |
| 574 | cbk->Delete(); |
| 575 | } |
| 576 | |
| 577 | this->Interactor->SetInteractorStyle(this->InteractorStyle); |
| 578 | this->Interactor->SetRenderWindow(this->RenderWindow); |
| 579 | } |
| 580 | |
| 581 | if (this->Renderer && this->ImageActor) |
| 582 | { |
| 583 | this->Renderer->AddViewProp(this->ImageActor); |
| 584 | } |
| 585 | |
| 586 | if (this->ImageActor && this->WindowLevel) |
| 587 | { |
| 588 | this->ImageActor->GetMapper()->SetInputConnection(this->WindowLevel->GetOutputPort()); |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | //------------------------------------------------------------------------------ |
| 593 | void vtkImageViewer2::UnInstallPipeline() |
no test coverage detected