OpenWalnut
1.5.0dev
|
Container widget to hold the WQtNetworkScene. More...
#include <WQtNetworkEditor.h>
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... | |
WQtNetworkItem * | findItemByModule (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... | |
WQtNetworkScene * | getScene () |
Returns the current scene. More... | |
WQtNetworkEditorView * | getView () |
Get the view handling the scene. More... | |
WQtNetworkSceneLayout * | getLayout () |
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 | |
WMainWindow * | m_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 | |
WQtNetworkScene * | m_scene |
the scene managing the items More... | |
WQtNetworkSceneLayout * | m_layout |
the layouter of the scene More... | |
QList< WQtNetworkItem * > | m_items |
a list of the WQtNetworkItems in the WQtNetworkScene More... | |
QAction * | m_connectWithModuleAction |
Action which uses a compatibles list (submenu) to connect a selected item with other existing modules. More... | |
QAction * | m_connectWithPrototypeAction |
Action which uses a compatibles list (submenu) to connect a selected item with other prototypes. More... | |
QAction * | m_disconnectAction |
Action which disconnects a connector from the module. More... | |
WQtNetworkEditorView * | m_view |
The view controlling several scene transformations. More... | |
WQtNetworkItemGrid * | m_grid |
we use a grid to place the items More... | |
Container widget to hold the WQtNetworkScene.
Definition at line 51 of file WQtNetworkEditor.h.
|
explicit |
constructor
parent | The 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().
|
virtual |
destructor.
Definition at line 97 of file WQtNetworkEditor.cpp.
void WQtNetworkEditor::clearSelection | ( | ) |
Clears the selection.
Definition at line 106 of file WQtNetworkEditor.cpp.
References m_scene.
Referenced by WQtControlPanel::deactivateModuleSelection().
void WQtNetworkEditor::connectSlots | ( | ) |
Connect SIGNALS with SLOTS.
|
protectedvirtual |
Everytime a module is associated, ready, connected, disconnected, removed or deleted the kernels emits a signal and here we look how to behave.
event | the event that should be handled here. |
Definition at line 146 of file WQtNetworkEditor.cpp.
References WQtNetworkItem::activate(), WQtNetworkPort::addArrow(), WQtNetworkSceneLayout::addItem(), WLogger::addLogMessage(), WQtNetworkSceneLayout::connection(), WQtNetworkItem::die(), WQtNetworkSceneLayout::disconnection(), findItemByModule(), WQtNetworkEditorView::focusOn(), WQtNetworkSceneLayout::getBoundingBox(), WQtNetworkInputPort::getConnector(), WQtNetworkOutputPort::getConnector(), WQtNetworkArrow::getEndPort(), WQtNetworkItem::getInPorts(), WModuleConnectEvent::getInput(), WModuleDisconnectEvent::getInput(), WLogger::getLogger(), WQtTreeItem::getModule(), WModuleAssocEvent::getModule(), WModuleCrashEvent::getModule(), WModuleReadyEvent::getModule(), WModuleRemovedEvent::getModule(), WQtNetworkItem::getOutPorts(), WModuleConnectEvent::getOutput(), WModuleDisconnectEvent::getOutput(), WQtNetworkArrow::getStartPort(), WModuleDeleteEvent::getTreeItem(), m_items, m_layout, m_scene, WQtNetworkPort::removeArrow(), WQtNetworkItem::setCrashed(), and WQtNetworkArrow::updatePosition().
WQtNetworkItem * WQtNetworkEditor::findItemByModule | ( | std::shared_ptr< WModule > | module | ) |
Simple search the WQtNetworkItem that belongs to the WModule.
module | a WModule |
Definition at line 479 of file WQtNetworkEditor.cpp.
References WQtNetworkItem::getModule(), and m_items.
Referenced by event(), WQtNetworkEditorProjectFileIO::save(), and selectByModule().
WQtNetworkSceneLayout * WQtNetworkEditor::getLayout | ( | ) |
Get the layouter of the scene.
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().
WQtNetworkScene * WQtNetworkEditor::getScene | ( | ) |
Returns the current scene.
Definition at line 493 of file WQtNetworkEditor.cpp.
References m_scene.
Referenced by WQtNetworkArrow::findNearestCompatibleInput(), and WQtNetworkItem::mousePressEvent().
WQtNetworkEditorView * WQtNetworkEditor::getView | ( | ) |
Get the view handling the scene.
Definition at line 498 of file WQtNetworkEditor.cpp.
References m_view.
Referenced by WQtControlPanel::completeGuiSetup(), WQtControlPanel::createCompatibleButtons(), WQtNetworkEditorProjectFileIO::done(), WQtNetworkItem::moveFinished(), WQtNetworkEditorProjectFileIO::save(), WMainWindow::setupGUI(), and WQtControlPanel::WQtControlPanel().
void WQtNetworkEditor::selectByModule | ( | WModule::SPtr | module | ) |
Select the item representing the given module.
If module not found or NULL, nothing is selected.
module | the module |
Definition at line 111 of file WQtNetworkEditor.cpp.
References findItemByModule(), and m_scene.
Referenced by WQtControlPanel::setActiveModule().
QList< QGraphicsItem * > WQtNetworkEditor::selectedItems | ( | ) | const |
Query a list of selected items.
Definition at line 101 of file WQtNetworkEditor.cpp.
References m_scene.
Referenced by WQtControlPanel::deleteModule().
|
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().
|
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().
|
slot |
Set new scene rect.
Definition at line 508 of file WQtNetworkEditor.cpp.
References WQtNetworkSceneLayout::getBoundingBox(), m_layout, and m_scene.
Referenced by WQtNetworkEditor().
|
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.
|
private |
Action which uses a compatibles list (submenu) to connect a selected item with other prototypes.
Definition at line 157 of file WQtNetworkEditor.h.
|
private |
Action which disconnects a connector from the module.
Definition at line 162 of file WQtNetworkEditor.h.
|
private |
we use a grid to place the items
Definition at line 169 of file WQtNetworkEditor.h.
Referenced by WQtNetworkEditor().
|
private |
a list of the WQtNetworkItems in the WQtNetworkScene
Definition at line 147 of file WQtNetworkEditor.h.
Referenced by event(), findItemByModule(), and updateCycle().
|
private |
the layouter of the scene
Definition at line 145 of file WQtNetworkEditor.h.
Referenced by event(), getLayout(), updateSceneRect(), and WQtNetworkEditor().
|
protected |
Reference to the main window of the application.
Definition at line 131 of file WQtNetworkEditor.h.
Referenced by selectItem(), and WQtNetworkEditor().
|
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().
|
private |
The view controlling several scene transformations.
Definition at line 167 of file WQtNetworkEditor.h.
Referenced by getView(), and WQtNetworkEditor().