OGS
VtkPickCallback Class Reference

Detailed Description

VtkPickCallback is a vtkCommand that implements functionality when picking a vtk object through a vtkCellPicker.

Definition at line 28 of file VtkPickCallback.h.

#include <VtkPickCallback.h>

Inheritance diagram for VtkPickCallback:
[legend]
Collaboration diagram for VtkPickCallback:
[legend]

Signals

void actorPicked (vtkProp3D *actor)
 Is emitted when an vtkActor was picked.
 

Public Member Functions

void Execute (vtkObject *caller, unsigned long eventId, void *callData) override
 

Static Public Member Functions

static VtkPickCallbackNew ()
 

Protected Member Functions

 VtkPickCallback ()
 

Constructor & Destructor Documentation

◆ VtkPickCallback()

VtkPickCallback::VtkPickCallback ( )
protected

Definition at line 51 of file VtkPickCallback.cpp.

51{}

Referenced by New().

Member Function Documentation

◆ actorPicked

void VtkPickCallback::actorPicked ( vtkProp3D * actor)
signal

Is emitted when an vtkActor was picked.

Referenced by Execute().

◆ Execute()

void VtkPickCallback::Execute ( vtkObject * caller,
unsigned long eventId,
void * callData )
override

Definition at line 28 of file VtkPickCallback.cpp.

31{
32 auto* picker = static_cast<vtkCellPicker*>(caller);
33 if (picker->GetCellId() < 0)
34 {
35 // Nothing is picked
36 }
37 else
38 {
39 vtkActor* actor = picker->GetActor();
40 if (actor)
41 {
42 emit actorPicked(actor);
43 }
44
45 double* pos = picker->GetPickPosition();
46 INFO("Picked cell id is: {:d}", picker->GetCellId());
47 INFO("Picked position is: {:f} {:f} {:f}", pos[0], pos[1], pos[2]);
48 }
49}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void actorPicked(vtkProp3D *actor)
Is emitted when an vtkActor was picked.

References actorPicked(), and INFO().

◆ New()

VtkPickCallback * VtkPickCallback::New ( )
static

Definition at line 23 of file VtkPickCallback.cpp.

24{
25 return new VtkPickCallback();
26}

References VtkPickCallback().

Referenced by VisualizationWidget::VisualizationWidget().


The documentation for this class was generated from the following files: