Frapper  1.0a
Signals | Public Member Functions | Protected Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | List of all members
Frapper::PinGraphicsItem Class Reference

Class for graphical representation of node connector pins. More...

#include <PinGraphicsItem.h>

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

Signals

void parameterClicked (PinGraphicsItem *pinItem, Parameter *parameter)
 Signal that is emitted when a parameter represented by the pin has been clicked. Is either emitted when a pin representing one parameter only itself has been clicked, or when an entry in the context menu of a pin representing a parameter group has been clicked.
 

Public Member Functions

 PinGraphicsItem (QGraphicsItem *parent, int index, Parameter *parameter)
 Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.
 
 PinGraphicsItem (QGraphicsItem *parent, int index, ParameterGroup *parameterGroup, Parameter::PinType pinType)
 Constructor of the PinGraphicsItem class. Creates a pin graphics item representing all parameters in the given parameter group.
 
 PinGraphicsItem (QGraphicsItem *parent, int index, ParameterGroup *parameterGroup, Parameter::PinType pinType, bool connected)
 Constructor of the PinGraphicsItem class. Creates a pin graphics item representing only connected or unconnected parameters in the given parameter group.
 
 ~PinGraphicsItem ()
 Destructor of the PinGraphicsItem class.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Paints the graphics item into a graphics view.
 
QPointF center () const
 Returns the center point of the pin item.
 
void setEnabled (bool enabled)
 Enables or disables the graphics item.
 
bool setEnabled (Parameter::Type parameterType, Parameter::PinType pinType)
 Enables the pin graphics item if it represents the given parameter type and pin type.
 
Parameter::PinType getPinType () const
 Returns the pin's type.
 
bool represents (Parameter *parameter) const
 Returns whether the pin represents the given parameter.
 
bool represents (Parameter::Type parameterType) const
 Returns whether the pin represents parameters of the given type.
 
- Public Member Functions inherited from Frapper::BaseRectItem
 BaseRectItem (const QColor &color, bool actAsButton=false, QGraphicsItem *parent=0)
 Constructor of the BaseRectItem class.
 
 ~BaseRectItem ()
 Destructor of the BaseRectItem class.
 
QRectF boundingRect () const
 Returns the bounding rectangle of the graphics item.
 
QColor getColor () const
 Returns the item's base color.
 

Protected Member Functions

void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Event handler that reacts to mouse release events.
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 Event handler that reacts to context menu events.
 
- Protected Member Functions inherited from Frapper::BaseRectItem
void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 Event handler that reacts to hover enter events.
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 Event handler that reacts to hover leave events.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Event handler that reacts to mouse press events.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Event handler that reacts to mouse release events.
 

Private Types

enum  ConnectedType { CT_All, CT_Connected, CT_NonConnected }
 Nested enumeration for the different types of connected states the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected. More...
 

Private Slots

void removeParameter ()
 Removes the parameter (m_abstractParameter). E.g. on deletion.
 

Private Member Functions

void fillMenu (QMenu *menu, ParameterGroup *parameterGroup)
 Fills the given menu with actions and sub menus for the parameters in the given parameter group.
 

Private Attributes

AbstractParameterm_abstractParameter
 The parameter or parameter group the pin represents.
 
bool m_isGroup
 Represented parameter is group.
 
bool m_isRootGroup
 Represented parameter is root group.
 
Parameter::PinType m_pinType
 The type of parameters in a parameter group the pin represents.
 
ConnectedType m_connectedType
 The connected type of parameters in a parameter group the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected.
 
Parameter::Type m_parameterTypeFilter
 The parameter type to filter in the context menu.
 

Additional Inherited Members

- Protected Attributes inherited from Frapper::BaseRectItem
QColor m_color
 The item's base color.
 
bool m_actAsButton
 Flag that states whether the item should act as a button.
 
bool m_hovered
 Flag that states whether the item is currently hovered by the mouse pointer.
 
bool m_clicked
 Flag that states whether the item is currently clicked by the mouse pointer (i.e. a mouse button is pressed).
 

Detailed Description

Class for graphical representation of node connector pins.

Inheritance Diagram
dot_inline_dotgraph_10.png
[legend]

Member Enumeration Documentation

Nested enumeration for the different types of connected states the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected.

Enumerator:
CT_All 
CT_Connected 
CT_NonConnected 

Constructor & Destructor Documentation

Frapper::PinGraphicsItem::PinGraphicsItem ( QGraphicsItem *  parent,
int  index,
Parameter parameter 
)

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.

Constructors and Destructors.

Parameters
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterThe parameter this pin item represents.

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.

Parameters
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterThe parameter this pin item represents.
Frapper::PinGraphicsItem::PinGraphicsItem ( QGraphicsItem *  parent,
int  index,
ParameterGroup parameterGroup,
Parameter::PinType  pinType 
)

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing all parameters in the given parameter group.

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the parameters in the given parameter group.

Parameters
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterGroupThe parameter group this pin item represents.
pinTypeThe type that states whether the item represents input or output parameters in the given group.
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterGroupThe parameter group this pin item represents.
pinTypeThe type that states whether the item represents input or output parameters in the given group.
connectedFlag that states whether the item represents connected parameters only.
Frapper::PinGraphicsItem::PinGraphicsItem ( QGraphicsItem *  parent,
int  index,
ParameterGroup parameterGroup,
Parameter::PinType  pinType,
bool  connected 
)

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing only connected or unconnected parameters in the given parameter group.

Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the parameters in the given parameter group.

Parameters
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterGroupThe parameter group this pin item represents.
pinTypeThe type that states whether the item represents input or output parameters in the given group.
connectedFlag that states whether the item represents connected or unconnected parameters.
parentThe graphics item this item will be a child of.
indexThe index of the pin in a list of pins.
parameterGroupThe parameter group this pin item represents.
pinTypeThe type that states whether the item represents input or output parameters in the given group.
connectedFlag that states whether the item represents connected parameters only.
Frapper::PinGraphicsItem::~PinGraphicsItem ( )

Destructor of the PinGraphicsItem class.

Member Function Documentation

void Frapper::PinGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual

Paints the graphics item into a graphics view.

Public Functions.

Parameters
painterThe object to use for painting.
optionStyle options for painting the graphics item.
widgetThe widget into which to paint the graphics item.

Paints the graphics item into a graphics view.

Parameters
painterThe object to use for painting.
optionStyle options for painting the graphics item.
widgetThe widget into which to paint the graphics item.

Implements Frapper::BaseRectItem.

QPointF Frapper::PinGraphicsItem::center ( ) const

Returns the center point of the pin item.

Returns
The center point of the pin item.
void Frapper::PinGraphicsItem::setEnabled ( bool  enabled)

Enables or disables the graphics item.

Parameters
enabledThe new enabled state for the item.
bool Frapper::PinGraphicsItem::setEnabled ( Parameter::Type  parameterType,
Parameter::PinType  pinType 
)

Enables the pin graphics item if it represents the given parameter type and pin type.

Parameters
parameterTypeThe parameter type of pins to enable.
pinTypeThe pin type of pins to enable.
Returns
True if the pin was enabled, otherwise False.
Parameter::PinType Frapper::PinGraphicsItem::getPinType ( ) const

Returns the pin's type.

Returns
The pin's type.
bool Frapper::PinGraphicsItem::represents ( Parameter parameter) const

Returns whether the pin represents the given parameter.

Parameters
parameterThe parameter to check.
Returns
True if the pin represents the given parameter, otherwise False.
bool Frapper::PinGraphicsItem::represents ( Parameter::Type  parameterType) const

Returns whether the pin represents parameters of the given type.

Parameters
parameterTypeThe parameter type to check.
Returns
True if the pin represents parameters of the given type, otherwise False.
void Frapper::PinGraphicsItem::parameterClicked ( PinGraphicsItem pinItem,
Parameter parameter 
)
signal

Signal that is emitted when a parameter represented by the pin has been clicked. Is either emitted when a pin representing one parameter only itself has been clicked, or when an entry in the context menu of a pin representing a parameter group has been clicked.

Parameters
pinItemThe pin item emitting the signal.
parameterThe parameter that was clicked.
void Frapper::PinGraphicsItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler that reacts to mouse release events.

Protected Functions.

Parameters
eventThe object containing details about the event.

Event handler that reacts to mouse release events.

Parameters
eventThe object containing details about the event.
void Frapper::PinGraphicsItem::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protected

Event handler that reacts to context menu events.

Parameters
eventThe object containing details about the event.
void Frapper::PinGraphicsItem::fillMenu ( QMenu *  menu,
ParameterGroup parameterGroup 
)
private

Fills the given menu with actions and sub menus for the parameters in the given parameter group.

Private Functions.

Parameters
menuThe menu to which the actions and sub menus will be added.
parameterGroupThe parameter group to create the context menu for.

Fills the given menu with actions and sub menus for the parameters in the given parameter group.

Parameters
menuThe menu to which the actions and sub menus will be added.
parameterGroupThe parameter group to create the context menu for.
void Frapper::PinGraphicsItem::removeParameter ( )
privateslot

Removes the parameter (m_abstractParameter). E.g. on deletion.

Member Data Documentation

AbstractParameter* Frapper::PinGraphicsItem::m_abstractParameter
private

The parameter or parameter group the pin represents.

bool Frapper::PinGraphicsItem::m_isGroup
private

Represented parameter is group.

bool Frapper::PinGraphicsItem::m_isRootGroup
private

Represented parameter is root group.

Parameter::PinType Frapper::PinGraphicsItem::m_pinType
private

The type of parameters in a parameter group the pin represents.

ConnectedType Frapper::PinGraphicsItem::m_connectedType
private

The connected type of parameters in a parameter group the pin represents. A pin can represent all parameters in a parameter group, just those that are connected, or just those that are not connected.

Parameter::Type Frapper::PinGraphicsItem::m_parameterTypeFilter
private

The parameter type to filter in the context menu.


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