Fraxinus  18.10
An IGT application

Picking of points in an image. More...

#include <cxPickerRep.h>

Inheritance diagram for cx::PickerRep:
cx::RepImpl cx::Rep

Public Slots

void pickLandmarkSlot (vtkObject *renderWindowInteractor)
 When you use the renderwindowinteractor. More...
 

Signals

void pointPicked (Vector3D p_r)
 
void dataPicked (QString uid)
 the rep sends out a signal when the user picks a point on it More...
 

Public Member Functions

virtual ~PickerRep ()
 empty More...
 
virtual QString getType () const
 returns a string identifying this class type More...
 
void setTool (ToolPtr tool)
 set the tool to listen to More...
 
void setEnabled (bool on)
 
void setGlyph (MeshPtr glyph)
 
void pickLandmark (const Vector3D &clickPosition, vtkRendererPtr renderer)
 When you don't use the renderwindowinteractor. More...
 
Vector3D getPosition () const
 
void setSphereRadius (double radius)
 
- Public Member Functions inherited from cx::RepImpl
 RepImpl (const QString &uid="", const QString &name="")
 
virtual ~RepImpl ()
 
virtual void connectToView (ViewPtr theView)
 
virtual void disconnectFromView (ViewPtr theView)
 
virtual bool isConnectedToView (ViewPtr theView) const
 
void setName (QString name)
 
QString getName () const
 
QString getUid () const
 
virtual void printSelf (std::ostream &os, Indent indent)
 
- Public Member Functions inherited from cx::Rep
virtual ~Rep ()
 

Static Public Member Functions

static PickerRepPtr New (PatientModelServicePtr dataManager, const QString &uid="")
 for creating new instances More...
 
- Static Public Member Functions inherited from cx::RepImpl
template<class REP >
static boost::shared_ptr< REP > wrap_new (REP *object, QString uid)
 

Protected Member Functions

 PickerRep (PatientModelServicePtr dataManager)
 use New instead More...
 
virtual void addRepActorsToViewRenderer (ViewPtr view)
 connects to the renderwindowinteractor More...
 
virtual void removeRepActorsFromViewRenderer (ViewPtr view)
 disconnects from the renderwindowinteractor More...
 
void connectInteractor ()
 
void disconnectInteractor ()
 
void scaleSphere ()
 
virtual void onModifiedStartRender ()
 
void toolHasChanged ()
 
void OnLeftButtonDown ()
 
void OnLeftButtonUp ()
 
void OnMouseMove ()
 
Vector3D getDisplacement ()
 
Vector3D ComputeDisplayToWorld (Vector3D p_d)
 
Vector3D ComputeWorldToDisplay (Vector3D p_w)
 
void setGlyphCenter (Vector3D pos)
 
- Protected Member Functions inherited from cx::RepImpl
ViewPtr getView () const
 
vtkRendererPtr getRenderer ()
 
RepPtr getSelf ()
 
virtual void onEveryRender ()
 

Static Protected Member Functions

static void ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)
 

Protected Attributes

bool mEnabled
 
bool mConnected
 Interactor connected. More...
 
ToolPtr mTool
 the connected tool More...
 
Vector3D mPickedPoint
 the last point that was successfully sampled from intersection with an image More...
 
double mSphereRadius
 
MeshPtr mGlyph
 
GeometricRepPtr mGlyphRep
 
Vector3D mClickedPoint
 
bool mIsDragging
 
bool mSnapToSurface
 if set, clicking on a Data surface will pick that point More...
 
GraphicalPoint3DPtr mGraphicalPoint
 
ViewportListenerPtr mViewportListener
 
vtkCallbackCommandPtr mCallbackCommand
 
PatientModelServicePtr mDataManager
 

Additional Inherited Members

- Protected Slots inherited from cx::RepImpl
void setModified ()
 

Detailed Description

Picking of points in an image.

When enabled, clicking in the view is interpreted as picking a point on the attached image. The picked point is the projection of the mouse click onto the image. Threshold is used to determine hit.

The point is displayed, and the value emitted as a signal.

Used by CustusX. Not used by Sonowand.

Definition at line 49 of file cxPickerRep.h.

Constructor & Destructor Documentation

cx::PickerRep::~PickerRep ( )
virtual

empty

Definition at line 86 of file cxPickerRep.cpp.

cx::PickerRep::PickerRep ( PatientModelServicePtr  dataManager)
protected

use New instead

Definition at line 58 of file cxPickerRep.cpp.

Member Function Documentation

void cx::PickerRep::addRepActorsToViewRenderer ( ViewPtr  view)
protectedvirtual

connects to the renderwindowinteractor

Implements cx::RepImpl.

Definition at line 405 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::ComputeDisplayToWorld ( Vector3D  p_d)
protected

Convert a point in display to world. Based on method in vtkInteractorObserver

Definition at line 291 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::ComputeWorldToDisplay ( Vector3D  p_w)
protected

Convert a point in world to display Based on method in vtkInteractorObserver

Definition at line 304 of file cxPickerRep.cpp.

void cx::PickerRep::connectInteractor ( )
protected

Definition at line 377 of file cxPickerRep.cpp.

void cx::PickerRep::dataPicked ( QString  uid)
signal

the rep sends out a signal when the user picks a point on it

void cx::PickerRep::disconnectInteractor ( )
protected

Definition at line 392 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::getDisplacement ( )
protected

Get the displacement in the view plane since last event.

Definition at line 316 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::getPosition ( ) const

Definition at line 443 of file cxPickerRep.cpp.

QString cx::PickerRep::getType ( ) const
virtual

returns a string identifying this class type

Implements cx::RepImpl.

Definition at line 89 of file cxPickerRep.cpp.

PickerRepPtr cx::PickerRep::New ( PatientModelServicePtr  dataManager,
const QString &  uid = "" 
)
static

for creating new instances

Definition at line 54 of file cxPickerRep.cpp.

void cx::PickerRep::OnLeftButtonDown ( )
protected

Definition at line 338 of file cxPickerRep.cpp.

void cx::PickerRep::OnLeftButtonUp ( )
protected

Definition at line 368 of file cxPickerRep.cpp.

void cx::PickerRep::onModifiedStartRender ( )
protectedvirtual

Reimplemented from cx::RepImpl.

Definition at line 228 of file cxPickerRep.cpp.

void cx::PickerRep::OnMouseMove ( )
protected

Definition at line 343 of file cxPickerRep.cpp.

void cx::PickerRep::pickLandmark ( const Vector3D clickPosition,
vtkRendererPtr  renderer 
)

When you don't use the renderwindowinteractor.

Trace a ray from clickPosition along the camera view direction and intersect the image.

Parameters
[in]clickPositionthe click position in DISPLAY coordinates
[in]rendererthe renderer from which to get the camera
Returns
the point where the ray intersects the image

Definition at line 148 of file cxPickerRep.cpp.

void cx::PickerRep::pickLandmarkSlot ( vtkObject *  renderWindowInteractor)
slot

When you use the renderwindowinteractor.

Definition at line 209 of file cxPickerRep.cpp.

void cx::PickerRep::pointPicked ( Vector3D  p_r)
signal
void cx::PickerRep::ProcessEvents ( vtkObject *  object,
unsigned long  event,
void *  clientdata,
void *  calldata 
)
staticprotected

Definition at line 268 of file cxPickerRep.cpp.

void cx::PickerRep::removeRepActorsFromViewRenderer ( ViewPtr  view)
protectedvirtual

disconnects from the renderwindowinteractor

Implements cx::RepImpl.

Definition at line 430 of file cxPickerRep.cpp.

void cx::PickerRep::scaleSphere ( )
protected

Definition at line 76 of file cxPickerRep.cpp.

void cx::PickerRep::setEnabled ( bool  on)

Definition at line 248 of file cxPickerRep.cpp.

void cx::PickerRep::setGlyph ( MeshPtr  glyph)

Definition at line 122 of file cxPickerRep.cpp.

void cx::PickerRep::setGlyphCenter ( Vector3D  pos)
protected

Definition at line 359 of file cxPickerRep.cpp.

void cx::PickerRep::setSphereRadius ( double  radius)

Definition at line 94 of file cxPickerRep.cpp.

void cx::PickerRep::setTool ( ToolPtr  tool)

set the tool to listen to

Definition at line 101 of file cxPickerRep.cpp.

void cx::PickerRep::toolHasChanged ( )
protected

Definition at line 233 of file cxPickerRep.cpp.

Member Data Documentation

vtkCallbackCommandPtr cx::PickerRep::mCallbackCommand
protected

Definition at line 110 of file cxPickerRep.h.

Vector3D cx::PickerRep::mClickedPoint
protected

Definition at line 103 of file cxPickerRep.h.

bool cx::PickerRep::mConnected
protected

Interactor connected.

Definition at line 97 of file cxPickerRep.h.

PatientModelServicePtr cx::PickerRep::mDataManager
protected

Definition at line 111 of file cxPickerRep.h.

bool cx::PickerRep::mEnabled
protected

Definition at line 96 of file cxPickerRep.h.

MeshPtr cx::PickerRep::mGlyph
protected

Definition at line 101 of file cxPickerRep.h.

GeometricRepPtr cx::PickerRep::mGlyphRep
protected

Definition at line 102 of file cxPickerRep.h.

GraphicalPoint3DPtr cx::PickerRep::mGraphicalPoint
protected

Definition at line 108 of file cxPickerRep.h.

bool cx::PickerRep::mIsDragging
protected

Definition at line 104 of file cxPickerRep.h.

Vector3D cx::PickerRep::mPickedPoint
protected

the last point that was successfully sampled from intersection with an image

Definition at line 99 of file cxPickerRep.h.

bool cx::PickerRep::mSnapToSurface
protected

if set, clicking on a Data surface will pick that point

Definition at line 106 of file cxPickerRep.h.

double cx::PickerRep::mSphereRadius
protected

Definition at line 100 of file cxPickerRep.h.

ToolPtr cx::PickerRep::mTool
protected

the connected tool

Definition at line 98 of file cxPickerRep.h.

ViewportListenerPtr cx::PickerRep::mViewportListener
protected

Definition at line 109 of file cxPickerRep.h.


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