PinGraphicsItem Class Reference

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

#include <PinGraphicsItem.h>

Inheritance diagram for PinGraphicsItem:

Inheritance graph
[legend]
Collaboration diagram for PinGraphicsItem:

Collaboration graph
[legend]

List of all members.

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.

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.

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.


Detailed Description

Class for graphical representation of node connector pins.

Inheritance Diagram

inline_dotgraph_14.dot
[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

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:
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameter The parameter this pin item represents.
Constructor of the PinGraphicsItem class. Creates a pin graphics item representing the given parameter.

Parameters:
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameter The parameter this pin item represents.

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:
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameterGroup The parameter group this pin item represents.
pinType The type that states whether the item represents input or output parameters in the given group.
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameterGroup The parameter group this pin item represents.
pinType The type that states whether the item represents input or output parameters in the given group.
connected Flag that states whether the item represents connected parameters only.

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:
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameterGroup The parameter group this pin item represents.
pinType The type that states whether the item represents input or output parameters in the given group.
connected Flag that states whether the item represents connected or unconnected parameters.
parent The graphics item this item will be a child of.
index The index of the pin in a list of pins.
parameterGroup The parameter group this pin item represents.
pinType The type that states whether the item represents input or output parameters in the given group.
connected Flag that states whether the item represents connected parameters only.

PinGraphicsItem::~PinGraphicsItem (  ) 

Destructor of the PinGraphicsItem class.


Member Function Documentation

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

Paints the graphics item into a graphics view.

Public Functions.

Parameters:
painter The object to use for painting.
option Style options for painting the graphics item.
widget The widget into which to paint the graphics item.
Paints the graphics item into a graphics view.

Parameters:
painter The object to use for painting.
option Style options for painting the graphics item.
widget The widget into which to paint the graphics item.

Implements BaseRectItem.

QPointF PinGraphicsItem::center (  )  const

Returns the center point of the pin item.

Returns:
The center point of the pin item.

void PinGraphicsItem::setEnabled ( bool  enabled  ) 

Enables or disables the graphics item.

Parameters:
enabled The new enabled state for the item.

bool PinGraphicsItem::setEnabled ( Parameter::Type  parameterType,
Parameter::PinType  pinType 
)

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

Parameters:
parameterType The parameter type of pins to enable.
pinType The pin type of pins to enable.
Returns:
True if the pin was enabled, otherwise False.

Parameter::PinType PinGraphicsItem::getPinType (  )  const

Returns the pin's type.

Returns:
The pin's type.

bool PinGraphicsItem::represents ( Parameter parameter  )  const

Returns whether the pin represents the given parameter.

Parameters:
parameter The parameter to check.
Returns:
True if the pin represents the given parameter, otherwise False.

bool PinGraphicsItem::represents ( Parameter::Type  parameterType  )  const

Returns whether the pin represents parameters of the given type.

Parameters:
parameterType The parameter type to check.
Returns:
True if the pin represents parameters of the given type, otherwise False.

void 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:
pinItem The pin item emitting the signal.
parameter The parameter that was clicked.

void PinGraphicsItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Event handler that reacts to mouse release events.

Protected Functions.

Parameters:
event The object containing details about the event.
Event handler that reacts to mouse release events.

Parameters:
event The object containing details about the event.

Reimplemented from BaseRectItem.

void PinGraphicsItem::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event  )  [protected]

Event handler that reacts to context menu events.

Parameters:
event The object containing details about the event.

void 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:
menu The menu to which the actions and sub menus will be added.
parameterGroup The 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:
menu The menu to which the actions and sub menus will be added.
parameterGroup The parameter group to create the context menu for.

void PinGraphicsItem::removeParameter (  )  [private, slot]

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


Member Data Documentation

The parameter or parameter group the pin represents.

Represented parameter is group.

Represented parameter is root group.

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

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.

The parameter type to filter in the context menu.


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

Generated on Wed Feb 24 15:01:02 2010 for Frapper by  doxygen 1.5.9