Frapper  1.0a
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PainterPanel::CurveItem Class Reference

CurveItem class. More...

#include <PainterGraphicsItems.h>

Inheritance diagram for PainterPanel::CurveItem:
Inheritance graph
[legend]
Collaboration diagram for PainterPanel::CurveItem:
Collaboration graph
[legend]

Public Member Functions

 CurveItem (QPointF startPos, QPen pen, QBrush brush)
 Constructor of the CurveItem class.
 
virtual ~CurveItem ()
 Destructor of the CurveItem class.
 
virtual void updatePosition (QPointF pos)
 Updates the last added position of the curve.
 
virtual void skipLastPosition (bool &emptyItem)
 Skip the last position of the curve.
 
virtual void addPosition (QPointF pos)
 Adds a new position to the curve.
 
virtual void updateShape ()
 Call this function to update the shape of the item.
 
virtual ItemType GetItemType ()
 Get the type of this item.
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 React on changes of the item.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paint the curveItem with the given pen and brush If selected, also the control polygon will be drawn.
 
- Public Member Functions inherited from PainterPanel::BaseShapeItem
 BaseShapeItem (QPen pen=QPen(), QBrush brush=QBrush())
 Constructor of the BaseShapeItem class.
 
virtual ~BaseShapeItem ()
 Destructor of the PainterPanel class.
 
virtual int type () const
 Enable the use of qgraphicsitem_cast with this item.
 
virtual QRectF boundingRect () const
 Get the bounding-rect of the shape.
 
QString getDescriptionText ()
 

Protected Attributes

QList< PointHandle * > m_cpoints
 The control points of the curve.
 
QPainterPath m_controlShape
 The polygon defined by the control points of the curve.
 
- Protected Attributes inherited from PainterPanel::BaseShapeItem
QPainterPath m_shape
 The shape of the item to draw.
 
QList< PointHandle * > m_points
 The list of point handles.
 
RotationHandlem_rotateHandle
 The handle to rotate this shape item.
 
TranslationHandlem_translateHandle
 The handle to translate this shape item.
 

Private Member Functions

void showControlHandles (bool show=true)
 Show/Hide handles for the control points of the curve.
 

Additional Inherited Members

- Public Types inherited from PainterPanel::BaseShapeItem
enum  ItemType {
  BASE =0, PAINT, LINE, RECT,
  CIRCLE, ELLIPSE, POLYGON, POLYLINE,
  CURVE, CLOSEDCURVE, NUM_ITEMTYPES
}
 
enum  { Type = UserType + 1 }
 

Detailed Description

CurveItem class.

This class implements an item which represents a curve of degree 3 by several positions and 2 additional control points per position

Constructor & Destructor Documentation

PainterPanel::CurveItem::CurveItem ( QPointF  startPos,
QPen  pen,
QBrush  brush 
)
inline

Constructor of the CurveItem class.

virtual PainterPanel::CurveItem::~CurveItem ( )
inlinevirtual

Destructor of the CurveItem class.

Member Function Documentation

virtual void PainterPanel::CurveItem::updatePosition ( QPointF  pos)
inlinevirtual

Updates the last added position of the curve.

Parameters
posThe new position of the last position of the curve

Implements PainterPanel::BaseShapeItem.

Reimplemented in PainterPanel::ClosedCurveItem.

virtual void PainterPanel::CurveItem::skipLastPosition ( bool &  emptyItem)
inlinevirtual

Skip the last position of the curve.

Parameters
emptyItemSet to true, if this operation creates an empty item, otherwise false

Reimplemented from PainterPanel::BaseShapeItem.

Reimplemented in PainterPanel::ClosedCurveItem.

virtual void PainterPanel::CurveItem::addPosition ( QPointF  pos)
inlinevirtual

Adds a new position to the curve.

Parameters
posThe new position to append to the curve

Implements PainterPanel::BaseShapeItem.

Reimplemented in PainterPanel::ClosedCurveItem.

virtual void PainterPanel::CurveItem::updateShape ( )
inlinevirtual

Call this function to update the shape of the item.

Reimplemented from PainterPanel::BaseShapeItem.

Reimplemented in PainterPanel::ClosedCurveItem.

virtual ItemType PainterPanel::CurveItem::GetItemType ( )
inlinevirtual

Get the type of this item.

Reimplemented from PainterPanel::BaseShapeItem.

Reimplemented in PainterPanel::ClosedCurveItem.

virtual QVariant PainterPanel::CurveItem::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
inlinevirtual

React on changes of the item.

Reimplemented from PainterPanel::BaseShapeItem.

virtual void PainterPanel::CurveItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
inlinevirtual

Paint the curveItem with the given pen and brush If selected, also the control polygon will be drawn.

Reimplemented from PainterPanel::BaseShapeItem.

void PainterPanel::CurveItem::showControlHandles ( bool  show = true)
inlineprivate

Show/Hide handles for the control points of the curve.

Member Data Documentation

QList<PointHandle*> PainterPanel::CurveItem::m_cpoints
protected

The control points of the curve.

QPainterPath PainterPanel::CurveItem::m_controlShape
protected

The polygon defined by the control points of the curve.


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