UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-12-17)

#include </home/soft/ustk/ustk-web-script/ustk-code/tutorial/ustk/meshDeformation/usMeshDeformation.h>

+ Inheritance diagram for usMeshDeformation:

Public Slots

void updateMeshPosition (vpHomogeneousMatrix transform)
 

Public Member Functions

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

Detailed Description

Class used to render a 3D mesh in a 3D environment.

Examples
tutorial-mesh-deformation.cpp.

Definition at line 103 of file usMeshDeformation.h.

Constructor & Destructor Documentation

◆ usMeshDeformation()

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

Constructor.

Definition at line 44 of file usMeshDeformation.cpp.

◆ ~usMeshDeformation()

usMeshDeformation::~usMeshDeformation ( )

Definition at line 63 of file usMeshDeformation.cpp.

Member Function Documentation

◆ getMeshPoints()

vtkPoints * usMeshDeformation::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 157 of file usMeshDeformation.cpp.

◆ keyPressEvent()

void usMeshDeformation::keyPressEvent ( QKeyEvent *  event)

Qt key press event catcher, used int this example to move the first point of the mesh.

Parameters
eventQKeyEvent.

Definition at line 75 of file usMeshDeformation.cpp.

◆ paintEvent()

void usMeshDeformation::paintEvent ( QPaintEvent *  event)

Qt paint event overload if needed to update Qt widget

Parameters
eventQPaintEvent.

Definition at line 69 of file usMeshDeformation.cpp.

References usViewerWidget::paintEvent().

◆ render()

void usMeshDeformation::render ( )

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

Definition at line 162 of file usMeshDeformation.cpp.

◆ setMeshInScene()

void usMeshDeformation::setMeshInScene ( vtkUnstructuredGrid *  mesh)

Setter for the mesh to introcuce in the scene.

Parameters
meshThe mesh, under vtkPolydataFormat.
Examples
tutorial-mesh-deformation.cpp.

Definition at line 106 of file usMeshDeformation.cpp.

◆ updateMeshPosition

void usMeshDeformation::updateMeshPosition ( vpHomogeneousMatrix  transform)
slot

Slot to call every time you want to update the mesh position.

Parameters
transformThe homogeneous matrix of the mesh displacement to apply on current mesh position (can be considered as a movement).

Definition at line 124 of file usMeshDeformation.cpp.

References usVTKConverter::convert().