Workspace 6.21.5
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
ConnectionRack Class Referenceabstract

Base class for organizing a set of ports into a vertical rack.

#include <Workspace/Presentation/ConnectionRacks/connectionrack.h>

Inheritance diagram for ConnectionRack:
[legend]

Public Types

enum class  Visibility { Full , OnlyValidDrops , Hidden }
 

Public Slots

void handleConnectedRackHoverEnter ()
 
void handleConnectedRackHoverLeave ()
 
void handlePortHoverEnter ()
 
void handlePortHoverLeave (const QPointF &pos)
 
void refreshVisibility ()
 
void setPinned (bool pinned)
 

Signals

void hoverEnter ()
 
void hoverLeave ()
 
void portLabelsFlipped ()
 
void portLabelsReset ()
 
void portsRepositioned ()
 
void requestOpLabelVisibilityChange (bool show)
 
void requestZValueForConnections (int zValue)
 
void setStatusMessage (const QString &message)
 
void setWorkspaceTooltip (const QString &tooltip)
 

Public Member Functions

 ConnectionRack (DataExecution::Operation &op, OperationViewBase &box, const WorkspaceGraphicsEffectFactory &graphicsEffectFactory)
 
 ~ConnectionRack () override
 
virtual void dragFromIOBaseFinished ()=0
 
void flipOverlappingRackLabels (bool onlyConnectedRacks)
 
void flipRackLabels ()
 
const WorkspaceGraphicsEffectFactorygetGraphicsEffectFactory () const
 
virtual QMap< DataExecution::Updatable *, QGraphicsItem * > getItemMap () const =0
 
int getNumberOfVisiblePorts ()
 
virtual QMap< DataExecution::Updatable *, QObject * > getObjectMap () const =0
 
virtual QList< ConnectionPort * > getPortList () const =0
 
virtual QMap< DataExecution::IOBase *, ConnectionPort * > getPortMap () const =0
 
Visibility getVisibilityState () const
 
void hideObscuredOperationLabel ()
 
void initializePosAndVis ()
 
bool isDragStarter ()
 
virtual bool isInputRack () const =0
 
bool isLabelFlipInitiator ()
 
bool isPinButtonVisible () const
 
bool isPinned () const
 
bool isVisible () const
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
void registerPortConnections (ConnectionPort &port)
 
virtual void repositionRackItems ()=0
 
void resetPortLabelLocations ()
 
void setAlwaysShow (bool alwaysShow)
 
void setDragStarter (bool dragStarter)
 
void setNeverShowDependenciesPort (bool neverShow)
 
void setNeverShowPinButton (bool neverShowPinButton)
 
void setPinButtonVisible (bool visible)
 
void setVisibility (Visibility visState, bool force=false)
 
void updateBoundingRect ()
 

Static Public Member Functions

static void generateNextVerticalPos (const QGraphicsItem &item, QPointF &pos, double spacing=0)
 

Static Public Attributes

static constexpr int DEFAULT_HIDE_DELAY_MS = 650
 
static constexpr const char * NEVER_SHOW_IOBASE_PROPERTY_NAME = "neverShowIoBase"
 

Protected Member Functions

virtual bool canShowItem (DataExecution::IOBase &ioBase) const
 
void dragEnterEvent (QGraphicsSceneDragDropEvent *event) override
 
void dragLeaveEvent (QGraphicsSceneDragDropEvent *event) override
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
bool neverShow () const
 
void setItemsToShow (const QList< ConnectionPort * > &portsToShow)
 
void setNeverShow (bool neverShow)
 
void setPinPosition (const QPointF &pos)
 

Member Enumeration Documentation

◆ Visibility

enum class Visibility
strong
Enumerator
Full 
OnlyValidDrops 
Hidden 

Constructor & Destructor Documentation

◆ ConnectionRack()

ConnectionRack ( DataExecution::Operation op,
OperationViewBase box,
const WorkspaceGraphicsEffectFactory graphicsEffectFactory 
)

◆ ~ConnectionRack()

~ConnectionRack ( )
overridedefault

Member Function Documentation

◆ canShowItem()

bool canShowItem ( DataExecution::IOBase ioBase) const
protectedvirtual

Reimplemented in InputRack, and OutputRack.

◆ dragEnterEvent()

void dragEnterEvent ( QGraphicsSceneDragDropEvent *  event)
overrideprotected

◆ dragFromIOBaseFinished()

virtual void dragFromIOBaseFinished ( )
pure virtual

Implemented in InputRack, and OutputRack.

◆ dragLeaveEvent()

void dragLeaveEvent ( QGraphicsSceneDragDropEvent *  event)
overrideprotected

◆ flipOverlappingRackLabels()

void flipOverlappingRackLabels ( bool  onlyConnectedRacks)
Parameters
onlyConnectedRacks1. When set to true, only this rack and other connected racks will have their labels checked for overlapping port labels. This is used for mouse hover events because in that case we don't want to flip racks which are not connected to this one.
  1. When set to false, this rack and any other overlapping racks are eligible to have their port labels flipped.

◆ flipRackLabels()

void flipRackLabels ( )

◆ generateNextVerticalPos()

void generateNextVerticalPos ( const QGraphicsItem &  item,
QPointF &  pos,
double  spacing = 0 
)
static

◆ getGraphicsEffectFactory()

const WorkspaceGraphicsEffectFactory & getGraphicsEffectFactory ( ) const
Returns

◆ getItemMap()

virtual QMap< DataExecution::Updatable *, QGraphicsItem * > getItemMap ( ) const
pure virtual

Implemented in InputRack, and OutputRack.

◆ getNumberOfVisiblePorts()

int getNumberOfVisiblePorts ( )

◆ getObjectMap()

virtual QMap< DataExecution::Updatable *, QObject * > getObjectMap ( ) const
pure virtual

Implemented in InputRack, and OutputRack.

◆ getPortList()

virtual QList< ConnectionPort * > getPortList ( ) const
pure virtual

Implemented in InputRack, and OutputRack.

◆ getPortMap()

virtual QMap< DataExecution::IOBase *, ConnectionPort * > getPortMap ( ) const
pure virtual

Implemented in InputRack, and OutputRack.

◆ getVisibilityState()

ConnectionRack::Visibility getVisibilityState ( ) const

◆ handleConnectedRackHoverEnter

void handleConnectedRackHoverEnter ( )
slot

◆ handleConnectedRackHoverLeave

void handleConnectedRackHoverLeave ( )
slot

◆ handlePortHoverEnter

void handlePortHoverEnter ( )
slot

◆ handlePortHoverLeave

void handlePortHoverLeave ( const QPointF &  pos)
slot

◆ hideObscuredOperationLabel()

void hideObscuredOperationLabel ( )

Only hides operation label if there are too many ports visible.

◆ hoverEnter

void hoverEnter ( )
signal

◆ hoverEnterEvent()

void hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

◆ hoverLeave

void hoverLeave ( )
signal

◆ hoverLeaveEvent()

void hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
overrideprotected

◆ initializePosAndVis()

void initializePosAndVis ( )

Initializes the visibility and position of the ports based on flags set by mini Operations.

◆ isDragStarter()

bool isDragStarter ( )

◆ isInputRack()

virtual bool isInputRack ( ) const
pure virtual

Implemented in InputRack, and OutputRack.

◆ isLabelFlipInitiator()

bool isLabelFlipInitiator ( )

◆ isPinButtonVisible()

bool isPinButtonVisible ( ) const

◆ isPinned()

bool isPinned ( ) const

◆ isVisible()

bool isVisible ( ) const

◆ itemChange()

QVariant itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
overrideprotected

◆ neverShow()

bool neverShow ( ) const
protected

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
override

◆ portLabelsFlipped

void portLabelsFlipped ( )
signal

◆ portLabelsReset

void portLabelsReset ( )
signal

◆ portsRepositioned

void portsRepositioned ( )
signal

◆ refreshVisibility

void refreshVisibility ( )
slot

Refresh port visibility. This is useful if the state underlying the connection rack has changed (e.g. if the operation's inputs/outputs have changed visibility state) and the UI needs to be updated to reflect this.

◆ registerPortConnections()

void registerPortConnections ( ConnectionPort port)

◆ repositionRackItems()

virtual void repositionRackItems ( )
pure virtual

Implemented in InputRack, and OutputRack.

◆ requestOpLabelVisibilityChange

void requestOpLabelVisibilityChange ( bool  show)
signal

◆ requestZValueForConnections

void requestZValueForConnections ( int  zValue)
signal

◆ resetPortLabelLocations()

void resetPortLabelLocations ( )

◆ setAlwaysShow()

void setAlwaysShow ( bool  alwaysShow)

◆ setDragStarter()

void setDragStarter ( bool  dragStarter)

◆ setItemsToShow()

void setItemsToShow ( const QList< ConnectionPort * > &  portsToShow)
protected

Allows base classes to specify a list of ports to show before calling setVisibility(Visibility::OnlyValidDropPorts)

◆ setNeverShow()

void setNeverShow ( bool  neverShow)
protected

◆ setNeverShowDependenciesPort()

void setNeverShowDependenciesPort ( bool  neverShow)

◆ setNeverShowPinButton()

void setNeverShowPinButton ( bool  neverShowPinButton)

◆ setPinButtonVisible()

void setPinButtonVisible ( bool  visible)

◆ setPinned

void setPinned ( bool  pinned)
slot

◆ setPinPosition()

void setPinPosition ( const QPointF &  pos)
protected

◆ setStatusMessage

void setStatusMessage ( const QString &  message)
signal

◆ setVisibility()

void setVisibility ( Visibility  visState,
bool  force = false 
)

◆ setWorkspaceTooltip

void setWorkspaceTooltip ( const QString &  tooltip)
signal

◆ updateBoundingRect()

void updateBoundingRect ( )

Member Data Documentation

◆ DEFAULT_HIDE_DELAY_MS

constexpr int DEFAULT_HIDE_DELAY_MS = 650
staticconstexpr

◆ NEVER_SHOW_IOBASE_PROPERTY_NAME

constexpr const char* NEVER_SHOW_IOBASE_PROPERTY_NAME = "neverShowIoBase"
staticconstexpr