Frapper  1.0a
Signals | Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PainterPanel::PainterPanel Class Reference

Class representing a view for displaying and editing parameters of nodes. More...

#include <PainterPanel.h>

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

Signals

void triggerRedraw ()
 This signal is emitted when the node output changes.
 

Public Member Functions

 PainterPanel (QWidget *parent=0, Qt::WindowFlags flags=0)
 Constructor of the PainterPanel class.
 
virtual ~PainterPanel ()
 Destructor of the PainterPanel class.
 
virtual void registerControl (NodeModel *nodeModel, SceneModel *sceneModel)
 Connects the panel with the scene.
 
void fillToolBars (QToolBar *mainToolBar, QToolBar *panelToolBar)
 Fills the given tool bars with actions for the PainterPanel view.
 
- Public Member Functions inherited from Frapper::ViewPanel
 ViewPanel (Type viewPanelType, QWidget *parent=0, Qt::WindowFlags flags=0)
 Constructor of the ViewPanel class.
 
Type getViewPanelType ()
 Returns the type of the view panel.
 
- Public Member Functions inherited from Frapper::Panel
 Panel (QWidget *parent=0, Qt::WindowFlags flags=0)
 Constructor of the Panel class.
 
virtual ~Panel ()
 Destructor of the Panel class.
 
QMap< QString, QString > getPanelParameters ()
 Gets the panel parameters. For load and save functionality.
 
virtual void setPanelParameters (const QMap< QString, QString > &parameterMap)
 Sets the panel parameters. For load and save functionality.
 

Static Public Attributes

static QList
< PainterPanelImageListItemData * > 
s_items
 The static list of known PainterPanelListItems, shared across instances of the PainterPanel.
 
static size_t s_numInstances = 0
 Instance counter, used to clear the above list of items after the last instance has been destroyed.
 

Private Slots

void selectedNodeChanged (Node *selectedNode)
 Is called when a node is selected.
 
void sceneChanged (QGraphicsScene *scene)
 Is called when the displayed scene changes.
 
void updateImageList ()
 Updates the list of images if the selected node(s) change.
 
void imageListItemChanged (QListWidgetItem *clickedItem)
 Slot which is called when an item in the image list is selected.
 
void historyListItemChanged (QListWidgetItem *clickedItem)
 Slot which is called when an item in the history list is selected.
 
void historyListLayoutChanged ()
 Slot which is called when the history list is sorted, e.g. via drag and drop.
 
void selectionChanged (bool selected)
 Updates the scene and the panel if the node selection changes.
 
void storeToNode ()
 Stores the painted scene and the background image to the nodes render target.
 
void changeDrawMode (int mode)
 Slot which is called when the user changes the draw mode via combo box.
 
void onSceneSelectionChanged (QList< QGraphicsItem * > selectedItems)
 Slot which is called when the scene selection changes.
 
void onPenChanged (QPen pen)
 Slot which is called when the current pen changes, e.g. by selecting a different item in the scene.
 
void onBrushChanged (QBrush brush)
 Slot which is called when the current brush changes, e.g. by selecting a different item in the scene.
 
void onFillCheckToggled (bool checked)
 Slot which is called when checked state of the fill check box changes.
 
void onRefreshButtonClicked ()
 Slot which is called when the refresh scene button was clicked.
 
void updateDrawModeCombo (int drawmode)
 Slot which is called when the current draw mode changes.
 
void selectPenColor ()
 Slot which is called when the user selects a different pen color.
 
void selectPenSize (QString size)
 Slot which is called when the user selects a different pen size.
 
void selectBrushColor ()
 Slot which is called when the user selects a different brush color.
 

Private Member Functions

void setPenColorButton (QColor color)
 Sets the color of the pen color button.
 
void setBrushColorButton (QColor color)
 Sets the color of the brush color button.
 
void setStandardPenColor (PainterGraphicsView::DrawMode drawMode)
 Set the standard pen color for the selected draw mode.
 

Static Private Member Functions

static void deleteListItems ()
 clears the static list of list items. Call this function after the last PainterPanel instance has been destroyed
 

Private Attributes

NodeModelm_nodeModel
 Node model.
 
ImageNodem_imageNode
 selected node
 
SceneModelm_sceneModel
 Scene model.
 
PainterGraphicsViewm_painterArea
 The painter area, a QGaphicsView.
 
QListWidget * m_imageListWidget
 The GUI Elements of the upper toolbar.
 
QListWidget * m_historyListWidget
 The list widget holding the images of the currently selected node.
 
QComboBox * m_drawModeCombo
 The combo box of draw modes.
 
QComboBox * m_penSizeCombo
 The combo box of pen sizes.
 
QPushButton * m_penColorButton
 The button to select the pen color.
 
QPushButton * m_brushColorButton
 The button to select the brush color.
 
QPushButton * m_refreshBackground
 The button to refresh the background of the current scene.
 
QPushButton * m_deleteItemButton
 The button to delete the current item(s)
 
QCheckBox * m_fillCheck
 The check box to fill the current item.
 
QColor m_penColor
 current pen, brush, pencolor & brushcolor
 
QColor m_brushColor
 
QBrush m_brush
 
QPen m_pen
 
QIcon m_inIcon
 Some icons.
 
QIcon m_outIcon
 
QIcon m_inOutIcon
 

Additional Inherited Members

- Public Types inherited from Frapper::ViewPanel
enum  Type {
  T_Documentation, T_Viewport, T_NetworkEditor, T_HierarchyEditor,
  T_ParameterEditor, T_CurveEditor, T_Timeline, T_PluginPanel,
  T_PainterPanel, T_NumTypes
}
 Nested enumeration for the different types of view panels. More...
 
- Static Public Member Functions inherited from Frapper::Panel
static QString getTypeName (Type panelType)
 Returns the name of the given panel type.
 
static QString getTypeIconName (Type panelType)
 Returns the icon name for the given panel type.
 
- Protected Attributes inherited from Frapper::Panel
QMap< QString, QString > m_parameterMap
 Map with default values. For load and save functionality.
 

Detailed Description

Class representing a view for displaying and editing parameters of nodes.

Constructor & Destructor Documentation

PainterPanel::PainterPanel::PainterPanel ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

Constructor of the PainterPanel class.

Parameters
parentThe parent widget the created instance will be a child of.
flagsExtra widget options.
virtual PainterPanel::PainterPanel::~PainterPanel ( )
virtual

Destructor of the PainterPanel class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.

Member Function Documentation

void PainterPanel::PainterPanel::registerControl ( NodeModel nodeModel,
SceneModel sceneModel 
)
virtual

Connects the panel with the scene.

Public Functions.

Parameters
*nodeModelNodeModel of the scene
*sceneModelSceneModel of the scene

Connects the panel with the scene.

Parameters
*nodeModelNodeModel of the scene
*sceneModelSceneModel of the scene

Reimplemented from Frapper::Panel.

void PainterPanel::PainterPanel::fillToolBars ( QToolBar *  mainToolBar,
QToolBar *  panelToolBar 
)
virtual

Fills the given tool bars with actions for the PainterPanel view.

Parameters
mainToolBarThe main tool bar to fill with actions.
panelToolBarThe panel tool bar to fill with actions.

Reimplemented from Frapper::Panel.

void PainterPanel::PainterPanel::selectedNodeChanged ( Node selectedNode)
privateslot

Is called when a node is selected.

Private Slots.

Parameters
selecedNodethe selected which was selected

Is called a node is selected

Parameters
selecedNodethe selected wich was selected
void PainterPanel::PainterPanel::sceneChanged ( QGraphicsScene *  scene)
privateslot

Is called when the displayed scene changes.

Parameters
sceneThe new scene that is displayed
void PainterPanel::PainterPanel::updateImageList ( )
privateslot

Updates the list of images if the selected node(s) change.

Updates the list of images if the node model changes.

void PainterPanel::PainterPanel::imageListItemChanged ( QListWidgetItem *  clickedItem)
privateslot

Slot which is called when an item in the image list is selected.

Updates the panel if the node model changes.

void PainterPanel::PainterPanel::historyListItemChanged ( QListWidgetItem *  clickedItem)
privateslot

Slot which is called when an item in the history list is selected.

void PainterPanel::PainterPanel::historyListLayoutChanged ( )
privateslot

Slot which is called when the history list is sorted, e.g. via drag and drop.

void PainterPanel::PainterPanel::selectionChanged ( bool  selected)
privateslot

Updates the scene and the panel if the node selection changes.

Parameters
enabledTrue if selected, false otherwise
void PainterPanel::PainterPanel::storeToNode ( )
privateslot

Stores the painted scene and the background image to the nodes render target.

Stores the painted scene and the background image to the nodes internal render target.

void PainterPanel::PainterPanel::changeDrawMode ( int  mode)
privateslot

Slot which is called when the user changes the draw mode via combo box.

void PainterPanel::PainterPanel::onSceneSelectionChanged ( QList< QGraphicsItem * >  selectedItems)
privateslot

Slot which is called when the scene selection changes.

void PainterPanel::PainterPanel::onPenChanged ( QPen  pen)
privateslot

Slot which is called when the current pen changes, e.g. by selecting a different item in the scene.

void PainterPanel::PainterPanel::onBrushChanged ( QBrush  brush)
privateslot

Slot which is called when the current brush changes, e.g. by selecting a different item in the scene.

void PainterPanel::PainterPanel::onFillCheckToggled ( bool  checked)
privateslot

Slot which is called when checked state of the fill check box changes.

void PainterPanel::PainterPanel::onRefreshButtonClicked ( )
privateslot

Slot which is called when the refresh scene button was clicked.

void PainterPanel::PainterPanel::updateDrawModeCombo ( int  drawmode)
privateslot

Slot which is called when the current draw mode changes.

void PainterPanel::PainterPanel::selectPenColor ( )
privateslot

Slot which is called when the user selects a different pen color.

void PainterPanel::PainterPanel::selectPenSize ( QString  size)
privateslot

Slot which is called when the user selects a different pen size.

void PainterPanel::PainterPanel::selectBrushColor ( )
privateslot

Slot which is called when the user selects a different brush color.

void PainterPanel::PainterPanel::triggerRedraw ( )
signal

This signal is emitted when the node output changes.

void PainterPanel::PainterPanel::setPenColorButton ( QColor  color)
private

Sets the color of the pen color button.

void PainterPanel::PainterPanel::setBrushColorButton ( QColor  color)
private

Sets the color of the brush color button.

void PainterPanel::PainterPanel::deleteListItems ( )
staticprivate

clears the static list of list items. Call this function after the last PainterPanel instance has been destroyed

void PainterPanel::PainterPanel::setStandardPenColor ( PainterGraphicsView::DrawMode  drawMode)
private

Set the standard pen color for the selected draw mode.

Member Data Documentation

QList< PainterPanelImageListItemData * > PainterPanel::PainterPanel::s_items
static

The static list of known PainterPanelListItems, shared across instances of the PainterPanel.

size_t PainterPanel::PainterPanel::s_numInstances = 0
static

Instance counter, used to clear the above list of items after the last instance has been destroyed.

NodeModel* PainterPanel::PainterPanel::m_nodeModel
private

Node model.

ImageNode* PainterPanel::PainterPanel::m_imageNode
private

selected node

SceneModel* PainterPanel::PainterPanel::m_sceneModel
private

Scene model.

PainterGraphicsView* PainterPanel::PainterPanel::m_painterArea
private

The painter area, a QGaphicsView.

QListWidget* PainterPanel::PainterPanel::m_imageListWidget
private

The GUI Elements of the upper toolbar.

The list widget holding the images of the currently selected node

QListWidget* PainterPanel::PainterPanel::m_historyListWidget
private

The list widget holding the images of the currently selected node.

QComboBox* PainterPanel::PainterPanel::m_drawModeCombo
private

The combo box of draw modes.

QComboBox* PainterPanel::PainterPanel::m_penSizeCombo
private

The combo box of pen sizes.

QPushButton* PainterPanel::PainterPanel::m_penColorButton
private

The button to select the pen color.

QPushButton* PainterPanel::PainterPanel::m_brushColorButton
private

The button to select the brush color.

QPushButton* PainterPanel::PainterPanel::m_refreshBackground
private

The button to refresh the background of the current scene.

QPushButton* PainterPanel::PainterPanel::m_deleteItemButton
private

The button to delete the current item(s)

QCheckBox* PainterPanel::PainterPanel::m_fillCheck
private

The check box to fill the current item.

QColor PainterPanel::PainterPanel::m_penColor
private

current pen, brush, pencolor & brushcolor

QColor PainterPanel::PainterPanel::m_brushColor
private
QBrush PainterPanel::PainterPanel::m_brush
private
QPen PainterPanel::PainterPanel::m_pen
private
QIcon PainterPanel::PainterPanel::m_inIcon
private

Some icons.

QIcon PainterPanel::PainterPanel::m_outIcon
private
QIcon PainterPanel::PainterPanel::m_inOutIcon
private

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