NorMIT-nav  16.5
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::PickerRep Class Reference

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 ()
 

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 70 of file cxPickerRep.h.

Constructor & Destructor Documentation

cx::PickerRep::~PickerRep ( )
virtual

empty

Definition at line 107 of file cxPickerRep.cpp.

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

use New instead

Definition at line 79 of file cxPickerRep.cpp.

Member Function Documentation

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

connects to the renderwindowinteractor

Implements cx::RepImpl.

Definition at line 426 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 312 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 325 of file cxPickerRep.cpp.

void cx::PickerRep::connectInteractor ( )
protected

Definition at line 398 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 413 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::getDisplacement ( )
protected

Get the displacement in the view plane since last event.

Definition at line 337 of file cxPickerRep.cpp.

Vector3D cx::PickerRep::getPosition ( ) const

Definition at line 464 of file cxPickerRep.cpp.

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

returns a string identifying this class type

Implements cx::RepImpl.

Definition at line 110 of file cxPickerRep.cpp.

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

for creating new instances

Definition at line 75 of file cxPickerRep.cpp.

void cx::PickerRep::OnLeftButtonDown ( )
protected

Definition at line 359 of file cxPickerRep.cpp.

void cx::PickerRep::OnLeftButtonUp ( )
protected

Definition at line 389 of file cxPickerRep.cpp.

void cx::PickerRep::onModifiedStartRender ( )
protectedvirtual

Reimplemented from cx::RepImpl.

Definition at line 249 of file cxPickerRep.cpp.

void cx::PickerRep::OnMouseMove ( )
protected

Definition at line 364 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 169 of file cxPickerRep.cpp.

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

When you use the renderwindowinteractor.

Definition at line 230 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 289 of file cxPickerRep.cpp.

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

disconnects from the renderwindowinteractor

Implements cx::RepImpl.

Definition at line 451 of file cxPickerRep.cpp.

void cx::PickerRep::scaleSphere ( )
protected

Definition at line 97 of file cxPickerRep.cpp.

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

Definition at line 269 of file cxPickerRep.cpp.

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

Definition at line 143 of file cxPickerRep.cpp.

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

Definition at line 380 of file cxPickerRep.cpp.

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

Definition at line 115 of file cxPickerRep.cpp.

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

set the tool to listen to

Definition at line 122 of file cxPickerRep.cpp.

void cx::PickerRep::toolHasChanged ( )
protected

Definition at line 254 of file cxPickerRep.cpp.

Member Data Documentation

vtkCallbackCommandPtr cx::PickerRep::mCallbackCommand
protected

Definition at line 131 of file cxPickerRep.h.

Vector3D cx::PickerRep::mClickedPoint
protected

Definition at line 124 of file cxPickerRep.h.

bool cx::PickerRep::mConnected
protected

Interactor connected.

Definition at line 118 of file cxPickerRep.h.

PatientModelServicePtr cx::PickerRep::mDataManager
protected

Definition at line 132 of file cxPickerRep.h.

bool cx::PickerRep::mEnabled
protected

Definition at line 117 of file cxPickerRep.h.

MeshPtr cx::PickerRep::mGlyph
protected

Definition at line 122 of file cxPickerRep.h.

GeometricRepPtr cx::PickerRep::mGlyphRep
protected

Definition at line 123 of file cxPickerRep.h.

GraphicalPoint3DPtr cx::PickerRep::mGraphicalPoint
protected

Definition at line 129 of file cxPickerRep.h.

bool cx::PickerRep::mIsDragging
protected

Definition at line 125 of file cxPickerRep.h.

Vector3D cx::PickerRep::mPickedPoint
protected

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

Definition at line 120 of file cxPickerRep.h.

bool cx::PickerRep::mSnapToSurface
protected

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

Definition at line 127 of file cxPickerRep.h.

double cx::PickerRep::mSphereRadius
protected

Definition at line 121 of file cxPickerRep.h.

ToolPtr cx::PickerRep::mTool
protected

the connected tool

Definition at line 119 of file cxPickerRep.h.

ViewportListenerPtr cx::PickerRep::mViewportListener
protected

Definition at line 130 of file cxPickerRep.h.


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