25 #ifndef WQTNETWORKSCENELAYOUT_H
26 #define WQTNETWORKSCENELAYOUT_H
34 #include "core/common/WSharedAssociativeContainer.h"
51 typedef std::shared_ptr< WQtNetworkSceneLayout >
SPtr;
56 typedef std::shared_ptr< const WQtNetworkSceneLayout >
ConstSPtr;
std::shared_ptr< WModule > SPtr
Shared pointer to a WModule.
Container widget to hold the WQtNetworkScene.
Implement a virtual grid for placing QGraphicsItems.
This class represents a WModule as QGraphicsItem and contains a reference to its in- and outports.
Layout manager class for a QGraphicsScene.
std::map< std::string, LayoutFlags > ModuleDefaultFlags
Map between module UUID and network flags.
virtual void addItem(WQtNetworkItem *item)
Add an item to the layout.
WSharedAssociativeContainer< ModuleDefaultCoordinates > m_moduleDefaultCoords
The mapping of network coordinates for each module.
void snapAccept(WQtNetworkItem *item, QPointF worldCoords)
Accept the current item position and update layout accordingly.
void blendOut()
Allows blending out the underlaying layout structure.
std::pair< std::string, QPoint > ModuleDefaultCoordinatesItem
The type inside the map.
WSharedAssociativeContainer< ModuleDefaultFlags > m_moduleDefaultFlags
The mapping of network flags for each module.
WQtNetworkSceneLayout(WQtNetworkScene *scene, WQtNetworkItemGrid *grid)
Default constructor.
WQtNetworkItemGrid * m_grid
we use a grid to place the items
virtual void connection(WQtNetworkItem *outItem, WQtNetworkItem *inItem)
Two module got connected.
virtual void removeItem(WQtNetworkItem *item)
Remove the item from the layout.
void blendIn()
Allows blending in the underlaying layout structure.
virtual ~WQtNetworkSceneLayout()
Destructor.
void setModuleDefaultFlags(WModule::SPtr module, bool layedOut, bool manuallyLayedOut)
Set a default flag combination for the given module.
WQtNetworkItemGrid * getGrid() const
Get the grid used for the layout.
std::map< std::string, QPoint > ModuleDefaultCoordinates
Map between module UUID and network coord.
std::shared_ptr< const WQtNetworkSceneLayout > ConstSPtr
Convenience typedef for a std::shared_ptr< const WQtNetworkSceneLayout >.
void disconnection(WQtNetworkItem *outItem, WQtNetworkItem *inItem)
Two modules got disconnected.
void setModuleDefaultPosition(WModule::SPtr module, QPoint coord)
Set a default position for a given module.
QRectF getBoundingBox()
Return the bounding box of this layout.
void snapTemporarily(WQtNetworkItem *item, QPointF worldCoords, bool noPhysicalMove=false)
Snap the item to the nearest layout element.
std::shared_ptr< WQtNetworkSceneLayout > SPtr
Convenience typedef for a std::shared_ptr< WQtNetworkSceneLayout >.
The scene containing the whole graph.
Some flags used in the layouter as defaults.
bool m_manuallyLayedOut
Manual layout done.
bool m_layedOut
Automatically layed out.