The items are objects that can be displayed by the widget. When the widget demands an update of the display, each item draws itself into the viewport. If the user wants to interact with some item, each item provides the information whether it has been picked by the user. More...
#include <item.h>
Public Member Functions | |
iil4mitkItem () | |
The constructor. | |
virtual | ~iil4mitkItem () |
virtual void | display (iil4mitkWidget *widget)=0 |
Displays the item. | |
virtual void | remove (iil4mitkWidget *widget) |
Frees the resources of the item for the given widget. | |
void | move (const float x, const float y) |
Sets the position of the item. | |
float | x () const |
Gets the position of the item. | |
float | y () const |
virtual float | width () const |
Gets the size of the item. | |
virtual float | height () const |
virtual void | setColor (const float red, const float green, const float blue, const float alpha) |
Sets the color of the item. | |
float | red () const |
Gets the color channels. | |
float | green () const |
float | blue () const |
float | alpha () const |
void | setLineWidth (const float width) |
Sets the widht of the isocontour. | |
float | lineWidth () const |
Gets the width of the isocontour. | |
void | setPickable (const bool on) |
Sets the flag whether the user can pick the item. | |
bool | pickable () const |
Checks if the user can pick the item. | |
virtual iil4mitkItem * | picked (iil4mitkWidget *widget, const float x, const float y) |
Checks if the item has been picked by the user. | |
void | setScalable (const bool scalable) |
Sets if items should be scaled when the viewport is zoomed. If so, items will grow as far as the viewport is zoomed. Otherwise, items will keep its size constant. | |
bool | scalable () const |
Checks if items will be scaled when the viewport changes. | |
void | setConstraint (iil4mitkWidget *widget) |
Sets the given widget as a constraint for rendering, i.e., the contents are rendered only if the widget that demands the rendering is the same as the given one. | |
iil4mitkWidget * | constraint () const |
Gets the widget which the rendering is constraint to. | |
void | setVisible (const bool visible) |
Makes the item visible or hidden, respectively. | |
bool | visible () const |
Checks if the item will be visible. | |
void | show () |
Shows the item. | |
void | hide () |
Hides the item. |
The items are objects that can be displayed by the widget. When the widget demands an update of the display, each item draws itself into the viewport. If the user wants to interact with some item, each item provides the information whether it has been picked by the user.
Definition at line 26 of file item.h.
iil4mitkItem::iil4mitkItem | ( | ) |
float iil4mitkItem::alpha | ( | ) | const |
Definition at line 74 of file item.cpp.
Referenced by iil4mitkPicImage::copyImage(), iil4mitkPicImage::display(), iil4mitkImage::display(), and setColor().
{
return _alpha;
}
float iil4mitkItem::blue | ( | ) | const |
Definition at line 68 of file item.cpp.
Referenced by iil4mitkPicImage::display(), iil4mitkImage::display(), and setColor().
{
return _blue;
}
iil4mitkWidget * iil4mitkItem::constraint | ( | ) | const |
Gets the widget which the rendering is constraint to.
Definition at line 131 of file item.cpp.
Referenced by iil4mitkImage::display().
{
return _constraint;
}
virtual void iil4mitkItem::display | ( | iil4mitkWidget * | widget ) | [pure virtual] |
Displays the item.
Implemented in iil4mitkImage, and iil4mitkPicImage.
float iil4mitkItem::green | ( | ) | const |
Definition at line 62 of file item.cpp.
Referenced by iil4mitkPicImage::display(), iil4mitkImage::display(), and setColor().
{
return _green;
}
float iil4mitkItem::height | ( | ) | const [virtual] |
Reimplemented in iil4mitkImage.
Definition at line 40 of file item.cpp.
Referenced by picked().
{
return 0.0;
}
void iil4mitkItem::hide | ( | ) |
Hides the item.
Definition at line 149 of file item.cpp.
References setVisible().
{ setVisible (false); }
float iil4mitkItem::lineWidth | ( | ) | const |
void iil4mitkItem::move | ( | const float | x, |
const float | y | ||
) |
bool iil4mitkItem::pickable | ( | ) | const |
iil4mitkItem * iil4mitkItem::picked | ( | iil4mitkWidget * | widget, |
const float | x, | ||
const float | y | ||
) | [virtual] |
float iil4mitkItem::red | ( | ) | const |
Gets the color channels.
Definition at line 56 of file item.cpp.
Referenced by iil4mitkPicImage::display(), iil4mitkImage::display(), and setColor().
{
return _red;
}
void iil4mitkItem::remove | ( | iil4mitkWidget * | widget ) | [virtual] |
Frees the resources of the item for the given widget.
Reimplemented in iil4mitkImage.
Definition at line 10 of file item.cpp.
{ }
bool iil4mitkItem::scalable | ( | ) | const |
Checks if items will be scaled when the viewport changes.
Definition at line 120 of file item.cpp.
Referenced by setScalable().
{
return _scalable;
}
void iil4mitkItem::setColor | ( | const float | red, |
const float | green, | ||
const float | blue, | ||
const float | alpha | ||
) | [virtual] |
Sets the color of the item.
red,green,blue | the channels of the rgb color model |
alpha | the opacity. If alpha is equal to one, the item is rendered opaque, otherwise it is rendered semi-transparent. If alpha is zero, the item won't be visible. |
Definition at line 47 of file item.cpp.
References alpha(), blue(), green(), and red().
Referenced by mitk::ImageMapperGL2D::ApplyProperties().
void iil4mitkItem::setConstraint | ( | iil4mitkWidget * | widget ) |
Sets the given widget as a constraint for rendering, i.e., the contents are rendered only if the widget that demands the rendering is the same as the given one.
widget | the widget which the rendering is constraint to. If null is given, the constraint will be removed. |
Definition at line 126 of file item.cpp.
{ _constraint = widget; }
void iil4mitkItem::setLineWidth | ( | const float | width ) |
void iil4mitkItem::setPickable | ( | const bool | on ) |
void iil4mitkItem::setScalable | ( | const bool | scalable ) |
Sets if items should be scaled when the viewport is zoomed. If so, items will grow as far as the viewport is zoomed. Otherwise, items will keep its size constant.
Definition at line 114 of file item.cpp.
References scalable().
{ _scalable = scalable; }
void iil4mitkItem::setVisible | ( | const bool | visible ) |
void iil4mitkItem::show | ( | ) |
Shows the item.
Definition at line 155 of file item.cpp.
References setVisible().
{ setVisible (true); }
bool iil4mitkItem::visible | ( | ) | const |
Checks if the item will be visible.
Definition at line 143 of file item.cpp.
Referenced by iil4mitkImage::display(), picked(), and setVisible().
{
return _visible;
}
float iil4mitkItem::width | ( | ) | const [virtual] |
Gets the size of the item.
Reimplemented in iil4mitkImage.
Definition at line 34 of file item.cpp.
Referenced by picked(), and setLineWidth().
{
return 0.0;
}
float iil4mitkItem::x | ( | ) | const |
Gets the position of the item.
Definition at line 22 of file item.cpp.
Referenced by iil4mitkImage::copyImage(), iil4mitkPicImage::display(), move(), picked(), and iil4mitkImage::setRegion().
{
return _x;
}
float iil4mitkItem::y | ( | ) | const |
Definition at line 28 of file item.cpp.
Referenced by iil4mitkPicImage::display(), move(), and iil4mitkImage::setRegion().
{
return _y;
}