OpenWalnut  1.5.0dev
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Slots | Private Attributes | List of all members
WQtNetworkEditor Class Reference

Container widget to hold the WQtNetworkScene. More...

#include <WQtNetworkEditor.h>

+ Inheritance diagram for WQtNetworkEditor:
+ Collaboration diagram for WQtNetworkEditor:

Public Slots

void updateSceneRect ()
 Set new scene rect. More...
 
- Public Slots inherited from WQtDockWidget
void showHelp ()
 Show help. More...
 

Public Member Functions

 WQtNetworkEditor (WMainWindow *parent=0)
 constructor More...
 
virtual ~WQtNetworkEditor ()
 destructor. More...
 
WQtNetworkItemfindItemByModule (std::shared_ptr< WModule > module)
 Simple search the WQtNetworkItem that belongs to the WModule. More...
 
void connectSlots ()
 Connect SIGNALS with SLOTS. More...
 
QList< QGraphicsItem * > selectedItems () const
 Query a list of selected items. More...
 
void clearSelection ()
 Clears the selection. More...
 
void selectByModule (WModule::SPtr module)
 Select the item representing the given module. More...
 
WQtNetworkScenegetScene ()
 Returns the current scene. More...
 
WQtNetworkEditorViewgetView ()
 Get the view handling the scene. More...
 
WQtNetworkSceneLayoutgetLayout ()
 Get the layouter of the scene. More...
 
- Public Member Functions inherited from WQtDockWidget
 WQtDockWidget (const QString &title, QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget with title. More...
 
 WQtDockWidget (QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags())
 Construct dock widget. More...
 
virtual ~WQtDockWidget ()
 Destructor. More...
 
virtual void addTitleProperty (WPropTrigger prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropBool prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleProperty (WPropGroup prop, WGEImage::SPtr icon=WGEImage::SPtr())
 Add a property to the title of this dock. More...
 
virtual void addTitleAction (QAction *action, bool instantPopup=false)
 Add the given action to the titlebar. More...
 
virtual void addTitleButton (QToolButton *button)
 Add the given tool button to the titlebar. More...
 
virtual void removeTitleAction (QAction *action)
 Remove the given action from the list. More...
 
virtual void addTitleSeperator ()
 Add a separator. More...
 
virtual void addTitleWidget (QWidget *widget)
 Add an arbitrary widget. More...
 
virtual void removeTitleWidget (QWidget *widget)
 Remove the specified widget from the title bar. More...
 
virtual void setHelpContext (const QString &id)
 Set a string which identifies help material for this dock. More...
 
virtual const QString & getHelpContext ()
 Return the help context id. More...
 
virtual void saveSettings ()
 Save settings. More...
 
virtual void restoreSettings ()
 Restore settings. More...
 
void disableCloseButton (bool disable=true)
 Disable close button? Might come in handy when embedding these widgets into others. More...
 

Protected Member Functions

virtual bool event (QEvent *event)
 Everytime a module is associated, ready, connected, disconnected, removed or deleted the kernels emits a signal and here we look how to behave. More...
 
- Protected Member Functions inherited from WQtDockWidget
virtual void closeEvent (QCloseEvent *event)
 Called whenever a close event is received. More...
 

Protected Attributes

WMainWindowm_mainWindow
 Reference to the main window of the application. More...
 

Private Slots

void selectItem ()
 Determines possible Connections and the propertytab. More...
 
void updateCycle ()
 Called by a timer to allow updates of all module items. More...
 

Private Attributes

WQtNetworkScenem_scene
 the scene managing the items More...
 
WQtNetworkSceneLayoutm_layout
 the layouter of the scene More...
 
QList< WQtNetworkItem * > m_items
 a list of the WQtNetworkItems in the WQtNetworkScene More...
 
QActionm_connectWithModuleAction
 Action which uses a compatibles list (submenu) to connect a selected item with other existing modules. More...
 
QActionm_connectWithPrototypeAction
 Action which uses a compatibles list (submenu) to connect a selected item with other prototypes. More...
 
QActionm_disconnectAction
 Action which disconnects a connector from the module. More...
 
WQtNetworkEditorViewm_view
 The view controlling several scene transformations. More...
 
WQtNetworkItemGridm_grid
 we use a grid to place the items More...
 

Detailed Description

Container widget to hold the WQtNetworkScene.

Definition at line 51 of file WQtNetworkEditor.h.

Constructor & Destructor Documentation

◆ WQtNetworkEditor()

WQtNetworkEditor::WQtNetworkEditor ( WMainWindow parent = 0)
explicit

constructor

Parameters
parentThe widget that manages this widget

Definition at line 55 of file WQtNetworkEditor.cpp.

References m_grid, m_layout, m_mainWindow, m_scene, m_view, WProjectFile::registerParser(), selectItem(), updateCycle(), and updateSceneRect().

+ Here is the call graph for this function:

◆ ~WQtNetworkEditor()

WQtNetworkEditor::~WQtNetworkEditor ( )
virtual

destructor.

Definition at line 97 of file WQtNetworkEditor.cpp.

Member Function Documentation

◆ clearSelection()

void WQtNetworkEditor::clearSelection ( )

Clears the selection.

Definition at line 106 of file WQtNetworkEditor.cpp.

References m_scene.

Referenced by WQtControlPanel::deactivateModuleSelection().

+ Here is the caller graph for this function:

◆ connectSlots()

void WQtNetworkEditor::connectSlots ( )

Connect SIGNALS with SLOTS.

◆ event()

bool WQtNetworkEditor::event ( QEvent event)
protectedvirtual

◆ findItemByModule()

WQtNetworkItem * WQtNetworkEditor::findItemByModule ( std::shared_ptr< WModule module)

Simple search the WQtNetworkItem that belongs to the WModule.

Parameters
modulea WModule
Returns
WQtNetworkItem belongs to the WModule

Definition at line 479 of file WQtNetworkEditor.cpp.

References WQtNetworkItem::getModule(), and m_items.

Referenced by event(), WQtNetworkEditorProjectFileIO::save(), and selectByModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLayout()

WQtNetworkSceneLayout * WQtNetworkEditor::getLayout ( )

Get the layouter of the scene.

Returns
the layout instance

Definition at line 503 of file WQtNetworkEditor.cpp.

References m_layout.

Referenced by WQtNetworkEditorProjectFileIO::done(), WQtNetworkItem::mouseMoveEvent(), WQtNetworkItem::mousePressEvent(), WQtNetworkItem::mouseReleaseEvent(), WQtNetworkItem::removalAnimationDone(), and WQtNetworkEditorProjectFileIO::save().

+ Here is the caller graph for this function:

◆ getScene()

WQtNetworkScene * WQtNetworkEditor::getScene ( )

Returns the current scene.

Returns
the scene

Definition at line 493 of file WQtNetworkEditor.cpp.

References m_scene.

Referenced by WQtNetworkArrow::findNearestCompatibleInput(), and WQtNetworkItem::mousePressEvent().

+ Here is the caller graph for this function:

◆ getView()

WQtNetworkEditorView * WQtNetworkEditor::getView ( )

◆ selectByModule()

void WQtNetworkEditor::selectByModule ( WModule::SPtr  module)

Select the item representing the given module.

If module not found or NULL, nothing is selected.

Parameters
modulethe module

Definition at line 111 of file WQtNetworkEditor.cpp.

References findItemByModule(), and m_scene.

Referenced by WQtControlPanel::setActiveModule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectedItems()

QList< QGraphicsItem * > WQtNetworkEditor::selectedItems ( ) const

Query a list of selected items.

Returns
the list

Definition at line 101 of file WQtNetworkEditor.cpp.

References m_scene.

Referenced by WQtControlPanel::deleteModule().

+ Here is the caller graph for this function:

◆ selectItem

void WQtNetworkEditor::selectItem ( )
privateslot

Determines possible Connections and the propertytab.

Definition at line 121 of file WQtNetworkEditor.cpp.

References WQtControlPanel::deactivateModuleSelection(), WMainWindow::getControlPanel(), m_mainWindow, m_scene, and WQtControlPanel::setActiveModule().

Referenced by WQtNetworkEditor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCycle

void WQtNetworkEditor::updateCycle ( )
privateslot

Called by a timer to allow updates of all module items.

Definition at line 138 of file WQtNetworkEditor.cpp.

References m_items.

Referenced by WQtNetworkEditor().

+ Here is the caller graph for this function:

◆ updateSceneRect

void WQtNetworkEditor::updateSceneRect ( )
slot

Set new scene rect.

Definition at line 508 of file WQtNetworkEditor.cpp.

References WQtNetworkSceneLayout::getBoundingBox(), m_layout, and m_scene.

Referenced by WQtNetworkEditor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_connectWithModuleAction

QAction* WQtNetworkEditor::m_connectWithModuleAction
private

Action which uses a compatibles list (submenu) to connect a selected item with other existing modules.

Definition at line 152 of file WQtNetworkEditor.h.

◆ m_connectWithPrototypeAction

QAction* WQtNetworkEditor::m_connectWithPrototypeAction
private

Action which uses a compatibles list (submenu) to connect a selected item with other prototypes.

Definition at line 157 of file WQtNetworkEditor.h.

◆ m_disconnectAction

QAction* WQtNetworkEditor::m_disconnectAction
private

Action which disconnects a connector from the module.

Definition at line 162 of file WQtNetworkEditor.h.

◆ m_grid

WQtNetworkItemGrid* WQtNetworkEditor::m_grid
private

we use a grid to place the items

Definition at line 169 of file WQtNetworkEditor.h.

Referenced by WQtNetworkEditor().

◆ m_items

QList< WQtNetworkItem* > WQtNetworkEditor::m_items
private

a list of the WQtNetworkItems in the WQtNetworkScene

Definition at line 147 of file WQtNetworkEditor.h.

Referenced by event(), findItemByModule(), and updateCycle().

◆ m_layout

WQtNetworkSceneLayout* WQtNetworkEditor::m_layout
private

the layouter of the scene

Definition at line 145 of file WQtNetworkEditor.h.

Referenced by event(), getLayout(), updateSceneRect(), and WQtNetworkEditor().

◆ m_mainWindow

WMainWindow* WQtNetworkEditor::m_mainWindow
protected

Reference to the main window of the application.

Definition at line 131 of file WQtNetworkEditor.h.

Referenced by selectItem(), and WQtNetworkEditor().

◆ m_scene

WQtNetworkScene* WQtNetworkEditor::m_scene
private

the scene managing the items

Definition at line 143 of file WQtNetworkEditor.h.

Referenced by clearSelection(), event(), getScene(), selectByModule(), selectedItems(), selectItem(), updateSceneRect(), and WQtNetworkEditor().

◆ m_view

WQtNetworkEditorView* WQtNetworkEditor::m_view
private

The view controlling several scene transformations.

Definition at line 167 of file WQtNetworkEditor.h.

Referenced by getView(), and WQtNetworkEditor().


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