OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::GraphicsElement Class Referenceabstract

#include "GraphicsElement.h"

Inheritance diagram for ot::GraphicsElement:
ot::GraphicsConnectionItem ot::GraphicsItem ot::CustomGraphicsItem ot::GraphicsGroupItem ot::GraphicsLayoutItem ot::GraphicsLayoutItemWrapper ot::GraphicsStackItem ot::GraphicsArcItem ot::GraphicsEllipseItem ot::GraphicsInvisibleItem ot::GraphicsLineItem ot::GraphicsPixmapItem ot::GraphicsPolygonItem ot::GraphicsRectangularItem ot::GraphicsShapeItem ot::GraphicsTextItem ot::GraphicsTriangleItem ot::GraphicsBoxLayoutItem ot::GraphicsGridLayoutItem ot::VersionGraphItem

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< GraphicsElementStateGraphicsElementStateFlags
 

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

Member Typedef Documentation

◆ GraphicsElementStateFlags

Member Enumeration Documentation

◆ GraphicsElementState

The GraphicsElementState is used to describe the current state of a GraphicsElement.

Enumerator
NoState 
HoverState 

Default state.

SelectedState 

Item is hovered over by user.

Constructor & Destructor Documentation

◆ GraphicsElement()

ot::GraphicsElement::GraphicsElement ( )

◆ ~GraphicsElement()

ot::GraphicsElement::~GraphicsElement ( )
virtual

Member Function Documentation

◆ calculateShortestDistanceToPoint()

virtual qreal ot::GraphicsElement::calculateShortestDistanceToPoint ( const QPointF & _pt) const
inlinevirtual

Calculates and returns the shortest distance to the given point. Returns -1 if the distance is invalid (e.g. maximum distance exceeded).

Parameters
_ptPoint in scene coordinates.

Reimplemented in ot::GraphicsConnectionItem, and ot::GraphicsItem.

◆ getAllDirectChildElements()

std::list< ot::GraphicsElement * > ot::GraphicsElement::getAllDirectChildElements ( void )
virtual

◆ getAllGraphicsElements()

std::list< ot::GraphicsElement * > ot::GraphicsElement::getAllGraphicsElements ( void )
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.

◆ getGraphicsElementState()

const GraphicsElementStateFlags & ot::GraphicsElement::getGraphicsElementState ( void ) const
inline

Returns the current GraphicsItemStateFlags set.

See also
GraphicsItem, GraphicsItemStateFlags

◆ getGraphicsScene()

virtual GraphicsScene * ot::GraphicsElement::getGraphicsScene ( void ) const
inlinevirtual

Returns the GraphicsScene this item is placed at.

Reimplemented in ot::GraphicsItem.

◆ getQGraphicsItem() [1/2]

virtual const QGraphicsItem * ot::GraphicsElement::getQGraphicsItem ( void ) const
pure virtual

◆ getQGraphicsItem() [2/2]

virtual QGraphicsItem * ot::GraphicsElement::getQGraphicsItem ( void )
pure virtual

◆ graphicsElementStateChanged()

virtual void ot::GraphicsElement::graphicsElementStateChanged ( const GraphicsElementStateFlags & _state)
inlineprotectedvirtual

◆ setGraphicsElementState()

void ot::GraphicsElement::setGraphicsElementState ( GraphicsElementState _state,
bool _active = true )

Sets the provided state flag.

See also
GraphicsItem, GraphicsItemState
Parameters
_stateThe state to set.
_activeIf true the flag will be set, otherwise unset.

◆ setGraphicsElementStateFlags()

void ot::GraphicsElement::setGraphicsElementStateFlags ( const GraphicsElementStateFlags & _state)

Replaces the flags with the flags provided.

Parameters
_flagsFlags to set.

◆ setGraphicsScene()

virtual void ot::GraphicsElement::setGraphicsScene ( GraphicsScene * _scene)
inlinevirtual

Set the GraphicsScene this element is placed at.

Reimplemented in ot::GraphicsLayoutItem.


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