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

Class for graphics items representing keys in the Curve Editor panel. More...

#include <KeyGraphicsItem.h>

Inheritance diagram for Frapper::KeyGraphicsItem:
Inheritance graph
[legend]
Collaboration diagram for Frapper::KeyGraphicsItem:
Collaboration graph
[legend]

Public Member Functions

 KeyGraphicsItem (CurveEditorGraphicsView *curveEditorGraphicsView, const float scale=1.0f, const float posX=0.0f)
 Constructor of the KeyGraphicsItem class.
 
void setCurveScale (const float scale)
 Saves the scene/curve scale to a member variable.
 
void addSegment (SegmentGraphicsItem *segmentItem)
 Adds the given segment item to the list of segment items for the key item.
 

Protected Member Functions

QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 The item change handler for updating the node.
 
virtual QRectF boundingRect () const
 Returns a rectangle describing the bounding region of the key item.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 The paint function of the node.
 
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 Overwrite the default mouseMoveEvent handler to lock x axis.
 

Private Attributes

QList< SegmentGraphicsItem * > m_segmentItems
 The list containing all curve segment items connected to the key item.
 
qreal m_posX
 The old x position of the key.
 
qreal m_sceneScale
 The curve/scene scale.
 
qreal m_size
 The size of the item.
 

Detailed Description

Class for graphics items representing keys in the Curve Editor panel.

Constructor & Destructor Documentation

Frapper::KeyGraphicsItem::KeyGraphicsItem ( CurveEditorGraphicsView curveEditorGraphicsView,
const float  scale = 1.0f,
const float  posX = 0.0f 
)

Constructor of the KeyGraphicsItem class.

Constructors and Destructors.

Parameters
curveEditorGraphicsViewThe graphics view in which the key graphics item is contained.

Constructor of the KeyGraphicsItem class.

Parameters
curveEditorGraphicsViewThe graphics view in which the key graphics item is contained.

Member Function Documentation

void Frapper::KeyGraphicsItem::setCurveScale ( const float  scale)
inline

Saves the scene/curve scale to a member variable.

Saves the scene/curve to a member variable.

void Frapper::KeyGraphicsItem::addSegment ( SegmentGraphicsItem segmentItem)

Adds the given segment item to the list of segment items for the key item.

Parameters
segmentItemThe segment item to add to the list of segment items.
QVariant Frapper::KeyGraphicsItem::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protected

The item change handler for updating the node.

Protected Functions.

QRectF Frapper::KeyGraphicsItem::boundingRect ( ) const
protectedvirtual

Returns a rectangle describing the bounding region of the key item.

Public Functions.

Returns
A rectangle describing the bounding region of the key item.

Returns a rectangle describing the bounding region of the key item.

Returns
A rectangle describing the bounding region of the key item.
void Frapper::KeyGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
protectedvirtual

The paint function of the node.

void Frapper::KeyGraphicsItem::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Overwrite the default mouseMoveEvent handler to lock x axis.

Member Data Documentation

QList<SegmentGraphicsItem *> Frapper::KeyGraphicsItem::m_segmentItems
private

The list containing all curve segment items connected to the key item.

qreal Frapper::KeyGraphicsItem::m_posX
private

The old x position of the key.

qreal Frapper::KeyGraphicsItem::m_sceneScale
private

The curve/scene scale.

qreal Frapper::KeyGraphicsItem::m_size
private

The size of the item.


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