OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsItemDesignerItemBase Class Referenceabstract

#include "GraphicsItemDesignerItemBase.h"

Inheritance diagram for GraphicsItemDesignerItemBase:
GraphicsItemDesignerPropertyHandler WrappedArcItem WrappedCircleItem WrappedEllipseItem WrappedLineItem WrappedPolygonItem WrappedRectItem WrappedSquareItem WrappedTextItem WrappedTriangleItem

Public Types

enum class  DesignerItemFlag { NoDesignerItemFlags = 0x00 , DesignerItemIgnoreEvents = 0x01 }
 
typedef ot::Flags< DesignerItemFlagDesignerItemFlags
 

Public Member Functions

 GraphicsItemDesignerItemBase ()
 
virtual ~GraphicsItemDesignerItemBase ()
 
void addControlPoint (const QPointF &_pt)
 \breif Adds the provided control point and calls controlPointsChanged().
 
void setControlPoints (const QList< QPointF > &_points)
 Sets the current list of control points and calls controlPointsChanged().
 
void updateControlPoints (const QList< QPointF > &_points)
 Replaces the current list of control points. This method does not call controlPointsChanged().
 
const QList< QPointF > & getControlPoints (void) const
 Returns a list containing the currently set control points.
 
void setLastPos (const QPointF &_pos)
 Sets the last position.
 
const QPointF & getLastPos (void) const
 Returns the last position. The last position ist the last position of this graphics item. The position is used to adjust the control points.
 
void setDesignerItemFlag (DesignerItemFlag _flag, bool _active=true)
 
void setDesignerItemFlags (const DesignerItemFlags &_flags)
 
const DesignerItemFlagsgetDesignerItemFlags (void) const
 
void graphicsItemWasMoved (const QPointF &_newPos)
 Will move all control points by the move delta (lastPos - newPos). The method will set the last pos after moving.
 
virtual bool isDesignedItemCompleted (void) const =0
 Returns true if the current item is completed. A completed item has all required control points set (e.g. Line start and Line end) and no more points may be set.
 
virtual bool isDesignedItemValid (void) const =0
 Returns true if the current item is valid. A valid item has all required control points set (e.g. Line start and Line end). More points may be added (e.g. Polygon).
 
virtual ot::GraphicsItemgetGraphicsItem (void)=0
 Returns the actual GraphicsItem.
 
virtual QString getDefaultItemName (void) const =0
 Returns the default item name.
 
virtual ot::TreeWidgetItemInfo createNavigationInformation (void)=0
 Creates the navigation information for this item and its childs.
 
virtual void makeItemTransparent (void)
 Will make the item transparent.
 
virtual void setupDesignerItemFromConfig (const ot::GraphicsItemCfg *_config)=0
 
- Public Member Functions inherited from GraphicsItemDesignerPropertyHandler
 GraphicsItemDesignerPropertyHandler ()
 
virtual ~GraphicsItemDesignerPropertyHandler ()
 
void setNavigation (GraphicsItemDesignerNavigation *_navigation)
 
GraphicsItemDesignerNavigationgetNavigation (void) const
 
void setNavigationItem (QTreeWidgetItem *_item)
 
QTreeWidgetItem * getNavigationItem (void) const
 
void setPropertyGrid (ot::PropertyGrid *_grid)
 
void unsetPropertyGrid (void)
 
ot::PropertyGridgetPropertyGrid (void) const
 
virtual void itemAboutToBeDestroyed (void)
 

Protected Member Functions

virtual void controlPointsChanged (void)=0
 Is called whenever the control points have changed (except when calling updateControlPoints()).
 
virtual void fillPropertyGrid (void) override=0
 Is called when the property grid needs to be filled.
 
virtual void propertyChanged (const ot::Property *_property) override=0
 
virtual void propertyDeleteRequested (const ot::Property *_property) override=0
 
void initializeBaseData (const QList< QPointF > &_controlPoints, const QPointF &_pos)
 
void fillBasePropertyGrid (ot::PropertyGridCfg &_config)
 Adds the default properties. Creates the "General" and "Transform" groups.
 
bool basePropertyChanged (const ot::Property *_property)
 Handles base properties. Returns true if the changed property was handled.
 
bool basePropertyDeleteRequested (const ot::Property *_property)
 Handles base properties. Returns true if the requested property was handled.
 

Member Typedef Documentation

◆ DesignerItemFlags

Member Enumeration Documentation

◆ DesignerItemFlag

Enumerator
NoDesignerItemFlags 
DesignerItemIgnoreEvents 

Constructor & Destructor Documentation

◆ GraphicsItemDesignerItemBase()

GraphicsItemDesignerItemBase::GraphicsItemDesignerItemBase ( )

◆ ~GraphicsItemDesignerItemBase()

GraphicsItemDesignerItemBase::~GraphicsItemDesignerItemBase ( )
virtual

Member Function Documentation

◆ addControlPoint()

void GraphicsItemDesignerItemBase::addControlPoint ( const QPointF & _pt)

\breif Adds the provided control point and calls controlPointsChanged().

◆ basePropertyChanged()

bool GraphicsItemDesignerItemBase::basePropertyChanged ( const ot::Property * _property)
protected

Handles base properties. Returns true if the changed property was handled.

◆ basePropertyDeleteRequested()

bool GraphicsItemDesignerItemBase::basePropertyDeleteRequested ( const ot::Property * _property)
protected

Handles base properties. Returns true if the requested property was handled.

◆ controlPointsChanged()

virtual void GraphicsItemDesignerItemBase::controlPointsChanged ( void )
protectedpure virtual

Is called whenever the control points have changed (except when calling updateControlPoints()).

Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.

◆ createNavigationInformation()

virtual ot::TreeWidgetItemInfo GraphicsItemDesignerItemBase::createNavigationInformation ( void )
pure virtual

Creates the navigation information for this item and its childs.

Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.

◆ fillBasePropertyGrid()

void GraphicsItemDesignerItemBase::fillBasePropertyGrid ( ot::PropertyGridCfg & _config)
protected

Adds the default properties. Creates the "General" and "Transform" groups.

◆ fillPropertyGrid()

virtual void GraphicsItemDesignerItemBase::fillPropertyGrid ( void )
overrideprotectedpure virtual

◆ getControlPoints()

const QList< QPointF > & GraphicsItemDesignerItemBase::getControlPoints ( void ) const
inline

Returns a list containing the currently set control points.

◆ getDefaultItemName()

virtual QString GraphicsItemDesignerItemBase::getDefaultItemName ( void ) const
pure virtual

◆ getDesignerItemFlags()

const DesignerItemFlags & GraphicsItemDesignerItemBase::getDesignerItemFlags ( void ) const
inline

◆ getGraphicsItem()

virtual ot::GraphicsItem * GraphicsItemDesignerItemBase::getGraphicsItem ( void )
pure virtual

◆ getLastPos()

const QPointF & GraphicsItemDesignerItemBase::getLastPos ( void ) const
inline

Returns the last position. The last position ist the last position of this graphics item. The position is used to adjust the control points.

◆ graphicsItemWasMoved()

void GraphicsItemDesignerItemBase::graphicsItemWasMoved ( const QPointF & _newPos)

Will move all control points by the move delta (lastPos - newPos). The method will set the last pos after moving.

Parameters
_newPosThe position the item was moved to.

◆ initializeBaseData()

void GraphicsItemDesignerItemBase::initializeBaseData ( const QList< QPointF > & _controlPoints,
const QPointF & _pos )
protected

◆ isDesignedItemCompleted()

virtual bool GraphicsItemDesignerItemBase::isDesignedItemCompleted ( void ) const
pure virtual

Returns true if the current item is completed. A completed item has all required control points set (e.g. Line start and Line end) and no more points may be set.

Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.

◆ isDesignedItemValid()

virtual bool GraphicsItemDesignerItemBase::isDesignedItemValid ( void ) const
pure virtual

Returns true if the current item is valid. A valid item has all required control points set (e.g. Line start and Line end). More points may be added (e.g. Polygon).

Implemented in WrappedArcItem, WrappedCircleItem, WrappedEllipseItem, WrappedLineItem, WrappedPolygonItem, WrappedRectItem, WrappedSquareItem, WrappedTextItem, and WrappedTriangleItem.

◆ makeItemTransparent()

virtual void GraphicsItemDesignerItemBase::makeItemTransparent ( void )
inlinevirtual

◆ propertyChanged()

virtual void GraphicsItemDesignerItemBase::propertyChanged ( const ot::Property * _property)
overrideprotectedpure virtual

◆ propertyDeleteRequested()

virtual void GraphicsItemDesignerItemBase::propertyDeleteRequested ( const ot::Property * _property)
overrideprotectedpure virtual

◆ setControlPoints()

void GraphicsItemDesignerItemBase::setControlPoints ( const QList< QPointF > & _points)

Sets the current list of control points and calls controlPointsChanged().

◆ setDesignerItemFlag()

void GraphicsItemDesignerItemBase::setDesignerItemFlag ( DesignerItemFlag _flag,
bool _active = true )
inline

◆ setDesignerItemFlags()

void GraphicsItemDesignerItemBase::setDesignerItemFlags ( const DesignerItemFlags & _flags)
inline

◆ setLastPos()

void GraphicsItemDesignerItemBase::setLastPos ( const QPointF & _pos)
inline

Sets the last position.

See also
getLastPos

◆ setupDesignerItemFromConfig()

virtual void GraphicsItemDesignerItemBase::setupDesignerItemFromConfig ( const ot::GraphicsItemCfg * _config)
pure virtual

◆ updateControlPoints()

void GraphicsItemDesignerItemBase::updateControlPoints ( const QList< QPointF > & _points)
inline

Replaces the current list of control points. This method does not call controlPointsChanged().


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