UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-11-21)

#include </home/soft/ustk/ustk-web-script/ustk-code/tutorial/ustk/virtualNeedle/usVirtualNeedle.h>

+ Inheritance diagram for usVirtualNeedle:

Public Slots

void updateNeedlePosition (vpHomogeneousMatrix transform)
 

Public Member Functions

 usVirtualNeedle (QWidget *parent=NULL, Qt::WindowFlags f=Qt::WindowFlags())
 
virtual ~usVirtualNeedle ()
 
void keyPressEvent (QKeyEvent *event)
 
vtkPoints * getMeshPoints ()
 
void setMeshInScene (vtkPolyData *mesh)
 
void paintEvent (QPaintEvent *event)
 
void render ()
 

Detailed Description

Class used to render a virtual needle movable in a 3D environment.

Definition at line 102 of file usVirtualNeedle.h.

Constructor & Destructor Documentation

◆ usVirtualNeedle()

usVirtualNeedle::usVirtualNeedle ( QWidget *  parent = NULL,
Qt::WindowFlags  f = Qt::WindowFlags() 
)

Constructor.

Definition at line 45 of file usVirtualNeedle.cpp.

◆ ~usVirtualNeedle()

virtual usVirtualNeedle::~usVirtualNeedle ( )
inlinevirtual

Definition at line 108 of file usVirtualNeedle.h.

Member Function Documentation

◆ getMeshPoints()

vtkPoints * usVirtualNeedle::getMeshPoints ( )

Point set of the mesh getter. To update a point position: call GetPoint(int ptIndex), update the coordinates, and then call SetPoint(ptIndex,yourPoint) followed by Modified() to update vtk object.

Returns
The points of the mesh (pointer);

Definition at line 219 of file usVirtualNeedle.cpp.

◆ keyPressEvent()

void usVirtualNeedle::keyPressEvent ( QKeyEvent *  event)

Qt key press event catcher, used to move the virtual needle in the scene.

Parameters
eventQKeyEvent.

Definition at line 106 of file usVirtualNeedle.cpp.

References updateNeedlePosition().

◆ paintEvent()

void usVirtualNeedle::paintEvent ( QPaintEvent *  event)

Qt paint event overload if needed to update Qt widget

Parameters
eventQPaintEvent.

Definition at line 100 of file usVirtualNeedle.cpp.

References usViewerWidget::paintEvent().

◆ render()

void usVirtualNeedle::render ( )

To render the scene, after some updates done on objects.

Definition at line 224 of file usVirtualNeedle.cpp.

◆ setMeshInScene()

void usVirtualNeedle::setMeshInScene ( vtkPolyData *  mesh)

Setter for the mesh to introcuce in the scene.

Parameters
meshThe mesh, under vtkPolydataFormat.

Definition at line 167 of file usVirtualNeedle.cpp.

◆ updateNeedlePosition

void usVirtualNeedle::updateNeedlePosition ( vpHomogeneousMatrix  transform)
slot

Slot to call every time you want to update the virtual needle positon.

Parameters
transformThe homogeneous matrix of the needle movement since last call (can be considered as a "delta" movement).

Definition at line 185 of file usVirtualNeedle.cpp.

References usVTKConverter::convert().

Referenced by keyPressEvent().