Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkAngleWidgetModel2D Class Reference

mitkAngleWidgetModel2D - a 2D widget for measuring angles More...

#include <mitkAngleWidgetModel2D.h>

Inherits mitkWidgetModel2D.

Inheritance diagram for mitkAngleWidgetModel2D:

Inheritance graph
[legend]
Collaboration diagram for mitkAngleWidgetModel2D:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
virtual int Render (mitkScene *scene)
virtual void Pick (const WidgetNames &names)
virtual void Release ()
void SetStartPoint (float p[2])
void SetStartPoint (float x, float y)
void SetStartPoint (int sx, int sy)
void SetEndPoint0 (float p[2])
void SetEndPoint0 (float x, float y)
void SetEndPoint0 (int sx, int sy)
void SetEndPoint1 (float p[2])
void SetEndPoint1 (float x, float y)
void SetEndPoint1 (int sx, int sy)
float GetAngleInDegree ()
float GetAngleInRadian ()

Protected Member Functions

virtual void _onMouseDown (int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos)
virtual void _onMouseUp (int mouseButton, bool ctrlDown, bool shiftDown, int xPos, int yPos)
virtual void _onMouseMove (bool ctrlDown, bool shiftDown, int xPos, int yPos, int deltaX, int deltaY)

Detailed Description

mitkAngleWidgetModel2D - a 2D widget for measuring angles

mitkAngleWidgetModel2D is a 2D widget for measuring angles. It can respond the mouse events and return the current angle in units of degrees or radian. It is supposed to be attached to a 2D data model (e.g. mitkImageModel) and add to a 2D scene (e.g. mitkImageScene), and in other conditions the display could be improper.


Member Function Documentation

virtual void mitkAngleWidgetModel2D::_onMouseDown int  mouseButton,
bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos
[protected, virtual]
 

Deal with mouse down event.

Parameters:
mouseButton indicates which mouse button is pressed
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse down event occurs
yPos y-coordinate of the mouse position when mouse down event occurs

Implements mitkWidgetModel.

virtual void mitkAngleWidgetModel2D::_onMouseMove bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos,
int  deltaX,
int  deltaY
[protected, virtual]
 

Deal with mouse move event.

Parameters:
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse move event occurs
yPos y-coordinate of the mouse position when mouse move event occurs
deltaX movement along x-axis of the mouse when mouse move event occurs
deltaY movement along y-axis of the mouse when mouse move event occurs

Implements mitkWidgetModel.

virtual void mitkAngleWidgetModel2D::_onMouseUp int  mouseButton,
bool  ctrlDown,
bool  shiftDown,
int  xPos,
int  yPos
[protected, virtual]
 

Deal with mouse up event.

Parameters:
mouseButton indicates which mouse button was pressed and now released
ctrlDown indicates if the key "Ctrl" is pressed
shiftDown indicates if the key "Shift" is pressed
xPos x-coordinate of the mouse position when mouse up event occurs
yPos y-coordinate of the mouse position when mouse up event occurs

Implements mitkWidgetModel.

float mitkAngleWidgetModel2D::GetAngleInDegree  ) 
 

Get the value of angle in degree.

Returns:
Return value of this angle in degree.

float mitkAngleWidgetModel2D::GetAngleInRadian  ) 
 

Get the value of angle in radian.

Returns:
Return value of this angle in radian.

virtual void mitkAngleWidgetModel2D::Pick const WidgetNames &  names  )  [virtual]
 

Maintain the selection status when this widget is picked.

Parameters:
names a constant reference to an WidgerNames which contains the names of selected parts of this widget.

Implements mitkWidgetModel.

virtual void mitkAngleWidgetModel2D::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkWidgetModel2D.

virtual void mitkAngleWidgetModel2D::Release  )  [virtual]
 

Maintain the selection status when this widget is released.

Implements mitkWidgetModel.

virtual int mitkAngleWidgetModel2D::Render mitkScene scene  )  [virtual]
 

Render this model.

Parameters:
scene the pointer of an mitkScene in which this model will be shown
Returns:
Return 1 if this model is rendered successfully. Otherwise return 0.

Reimplemented from mitkModel.

void mitkAngleWidgetModel2D::SetEndPoint0 int  sx,
int  sy
[inline]
 

Set ont end point of the angle.

Parameters:
sx x-coordinate of this point on screen
sy y-coordinate of this point on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkAngleWidgetModel2D::SetEndPoint0 float  x,
float  y
[inline]
 

Set ont end point of the angle in object coordinate.

Parameters:
x x-coordinate of this point in the object space
y y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.

void mitkAngleWidgetModel2D::SetEndPoint0 float  p[2]  )  [inline]
 

Set ont end point of the angle in object coordinate.

Parameters:
p[0] x-coordinate of this point in the object space
p[1] y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.

void mitkAngleWidgetModel2D::SetEndPoint1 int  sx,
int  sy
[inline]
 

Set the other end point of the angle.

Parameters:
sx x-coordinate of this point on screen
sy y-coordinate of this point on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkAngleWidgetModel2D::SetEndPoint1 float  x,
float  y
[inline]
 

Set the other end point of the angle in object coordinate.

Parameters:
x x-coordinate of this point in the object space
y y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.

void mitkAngleWidgetModel2D::SetEndPoint1 float  p[2]  )  [inline]
 

Set the other end point of the angle in object coordinate.

Parameters:
p[0] x-coordinate of this point in the object space
p[1] y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.

void mitkAngleWidgetModel2D::SetStartPoint int  sx,
int  sy
[inline]
 

Set the start point of the angle.

Parameters:
sx x-coordinate of this point on screen
sy y-coordinate of this point on screen
Note:
The coordinates of the point are in the screen coordinate system. This function is useful when you can not get the original coordinates in the object space easily outside. It can do this job for you. But if this widget is attach to a data model, you must ensure the source model and the scene which contains this widget and the source model are properly set to this widget (e.g. call SetSourceModel() of this widget or call AddWidget() of the source model and SetScene() of this widget first) before calling this function, because this function needs the transform matrix of the source model and the scene to calculate the original coordinates.

void mitkAngleWidgetModel2D::SetStartPoint float  x,
float  y
[inline]
 

Set the start point of the angle in object coordinate.

Parameters:
x x-coordinate of this point in the object space
y y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.

void mitkAngleWidgetModel2D::SetStartPoint float  p[2]  )  [inline]
 

Set the start point of the angle in object coordinate.

Parameters:
p[0] x-coordinate of this point in the object space
p[1] y-coordinate of this point in the object space
Note:
Because this widget is for 2D image, the z-coordinate will always be zero.


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:00:58 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3