#include "GraphicsElement.h"
Public Types | |
enum | GraphicsElementState { NoState = 0x00 , HoverState = 0x01 , SelectedState = 0x02 } |
The GraphicsElementState is used to describe the current state of a GraphicsElement. More... | |
typedef Flags< GraphicsElementState > | GraphicsElementStateFlags |
Public Member Functions | |
GraphicsElement () | |
virtual | ~GraphicsElement () |
virtual qreal | calculateShortestDistanceToPoint (const QPointF &_pt) const |
Calculates and returns the shortest distance to the given point. Returns -1 if the distance is invalid (e.g. maximum distance exceeded). | |
virtual QGraphicsItem * | getQGraphicsItem (void)=0 |
Returns the QGraphicsItem. | |
virtual const QGraphicsItem * | getQGraphicsItem (void) const =0 |
Returns the const QGraphicsItem. | |
virtual void | setGraphicsScene (GraphicsScene *_scene) |
Set the GraphicsScene this element is placed at. | |
virtual GraphicsScene * | getGraphicsScene (void) const |
Returns the GraphicsScene this item is placed at. | |
void | setGraphicsElementState (GraphicsElementState _state, bool _active=true) |
Sets the provided state flag. | |
void | setGraphicsElementStateFlags (const GraphicsElementStateFlags &_state) |
Replaces the flags with the flags provided. | |
const GraphicsElementStateFlags & | getGraphicsElementState (void) const |
Returns the current GraphicsItemStateFlags set. | |
virtual std::list< GraphicsElement * > | getAllGraphicsElements (void) |
Returns all graphics elements nested in this element. The result contains this element and all of its childs. | |
virtual std::list< GraphicsElement * > | getAllDirectChildElements (void) |
Protected Member Functions | |
virtual void | graphicsElementStateChanged (const GraphicsElementStateFlags &_state) |
The GraphicsElementState is used to describe the current state of a GraphicsElement.
Enumerator | |
---|---|
NoState | |
HoverState | Default state. |
SelectedState | Item is hovered over by user. |
ot::GraphicsElement::GraphicsElement | ( | ) |
|
virtual |
|
inlinevirtual |
Calculates and returns the shortest distance to the given point. Returns -1 if the distance is invalid (e.g. maximum distance exceeded).
_pt | Point in scene coordinates. |
Reimplemented in ot::GraphicsConnectionItem, and ot::GraphicsItem.
|
virtual |
Reimplemented in ot::GraphicsGroupItem, ot::GraphicsLayoutItem, ot::GraphicsLayoutItemWrapper, and ot::GraphicsStackItem.
|
virtual |
Returns all graphics elements nested in this element. The result contains this element and all of its childs.
Reimplemented in ot::GraphicsGroupItem, ot::GraphicsLayoutItem, ot::GraphicsLayoutItemWrapper, and ot::GraphicsStackItem.
|
inline |
Returns the current GraphicsItemStateFlags set.
|
inlinevirtual |
Returns the GraphicsScene this item is placed at.
Reimplemented in ot::GraphicsItem.
|
pure virtual |
Returns the const QGraphicsItem.
Implemented in ot::CustomGraphicsItem, ot::GraphicsConnectionItem, ot::GraphicsGroupItem, ot::GraphicsLayoutItem, ot::GraphicsLayoutItemWrapper, and ot::GraphicsStackItem.
|
pure virtual |
Returns the QGraphicsItem.
Implemented in ot::CustomGraphicsItem, ot::GraphicsConnectionItem, ot::GraphicsGroupItem, ot::GraphicsLayoutItem, ot::GraphicsLayoutItemWrapper, and ot::GraphicsStackItem.
|
inlineprotectedvirtual |
Reimplemented in ot::GraphicsConnectionItem, ot::CustomGraphicsItem, ot::GraphicsGroupItem, ot::GraphicsItem, ot::GraphicsLayoutItem, and ot::GraphicsStackItem.
void ot::GraphicsElement::setGraphicsElementState | ( | GraphicsElementState | _state, |
bool | _active = true ) |
Sets the provided state flag.
_state | The state to set. |
_active | If true the flag will be set, otherwise unset. |
void ot::GraphicsElement::setGraphicsElementStateFlags | ( | const GraphicsElementStateFlags & | _state | ) |
Replaces the flags with the flags provided.
_flags | Flags to set. |
|
inlinevirtual |
Set the GraphicsScene this element is placed at.
Reimplemented in ot::GraphicsLayoutItem.