| 48 | }; |
| 49 | |
| 50 | vtkUserData initializeVTK(vtkRenderWindow* renderWindow) override |
| 51 | { |
| 52 | // Create our vtk user data |
| 53 | vtkNew<Data> vtk; |
| 54 | |
| 55 | // Create a cone pipeline and add it to the view |
| 56 | vtkNew<vtkConeSource> cone; |
| 57 | cone->SetHeight(3.0); |
| 58 | cone->SetRadius(1.0); |
| 59 | cone->SetResolution(10); |
| 60 | |
| 61 | vtkNew<vtkPolyDataMapper> mapper; |
| 62 | mapper->SetInputConnection(cone->GetOutputPort()); |
| 63 | |
| 64 | vtkNew<vtkNamedColors> colors; |
| 65 | vtkNew<vtkActor> actor; |
| 66 | actor->SetMapper(mapper); |
| 67 | actor->GetProperty()->SetColor(colors->GetColor3d("Bisque").GetData()); |
| 68 | |
| 69 | vtkNew<vtkRenderer> renderer; |
| 70 | renderer->AddActor(actor); |
| 71 | renderer->ResetCamera(); |
| 72 | renderer->SetBackground(colors->GetColor3d("LightBlue").GetData()); |
| 73 | |
| 74 | renderWindow->AddRenderer(renderer); |
| 75 | renderWindow->SetMultiSamples(16); |
| 76 | |
| 77 | vtk->boxWidget->SetInteractor(renderWindow->GetInteractor()); |
| 78 | vtk->boxWidget->SetPlaceFactor(1.25); |
| 79 | vtk->boxWidget->GetOutlineProperty()->SetColor(colors->GetColor3d("Gold").GetData()); |
| 80 | vtk->boxWidget->SetProp3D(actor); |
| 81 | vtk->boxWidget->PlaceWidget(); |
| 82 | vtk->boxWidget->On(); |
| 83 | |
| 84 | vtkNew<Callback> callback; |
| 85 | vtk->boxWidget->AddObserver(vtkCommand::InteractionEvent, callback); |
| 86 | |
| 87 | return vtk; |
| 88 | } |
| 89 | }; |
| 90 | vtkStandardNewMacro(MyVtkItem::Data); |
| 91 | vtkStandardNewMacro(MyVtkItem::Callback); |
nothing calls this directly
no test coverage detected