UsTK : Ultrasound ToolKit  version 2.0.1 under development (2025-01-22)
main.cpp
1 #include <visp3/ustk_core/usConfig.h>
2 
3 #ifdef USTK_HAVE_VTK_QT
4 #include "usVirtualNeedle.h"
5 #include <vtkSmartPointer.h>
6 #include <vtkSphereSource.h>
7 
8 int main(int argc, char **argv)
9 {
10  // QT application
11  QApplication app(argc, argv);
12 
13  // setup view widget
14  usVirtualNeedle scene;
15 
16  // Create the mesh to display
17  vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();
18  sphereSource->SetCenter(0, 0.01, 0.01);
19  sphereSource->SetRadius(0.01);
20  sphereSource->Update();
21 
22  scene.setMeshInScene(sphereSource->GetOutput());
23 
24  app.setActiveWindow(&scene);
25  scene.show();
26  scene.showMaximized();
27 
28  return app.exec();
29 }
30 #else
31 #include <iostream>
32 
33 int main() { std::cout << "Install vtk with qt4 or qt5 support to run this tutorial." << std::endl; }
34 
35 #endif
Class used to render a virtual needle movable in a 3D environment.
void setMeshInScene(vtkPolyData *mesh)