Vuo  2.0.0
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
VuoNodeLibrary Class Reference

Description

A dockable window displaying the list of node classes that can be added to compositions.

Definition at line 28 of file VuoNodeLibrary.hh.

Public Types

enum  nodeLibraryDisplayMode { displayByClass, displayByName }
 Specifies the display format for node classes within the library. More...
 
enum  nodeLibraryState { nodeLibraryHidden, nodeLibraryDocked, nodeLibraryFloating }
 Specifies the node library visibility setting. More...
 

Public Slots

void clickedNamesButton ()
 Called when the Names button is clicked. More...
 
void clickedFlatClassButton ()
 Called when the Flat Class button is clicked. More...
 
void setHumanReadable (bool humanReadable)
 Sets the boolean indicating whether node class names are currently displayed in "human-readable" mode (i.e., using default node titles rather than class names). More...
 
void prepareAndDisplayNodePopoverForClass (VuoNodeClass *nodeClass)
 Prepares (extracts any necessary resources for) and displays the popover relevant to the provided node class. More...
 
void displayPopoverInPane (QWidget *panelContentWidget, QString resourceDir="")
 Displays the provided widget in the popover pane. More...
 
void updateUI ()
 Updates the UI elements (e.g., enables/disables buttons) based on the application's state. More...
 

Signals

void componentsAdded (QList< QGraphicsItem * > addedComponents, VuoEditorComposition *target)
 Emitted when the user has used the Node Library to add nodes to the composition. More...
 
void changedIsHumanReadable (bool humanReadable)
 Emitted when the Node Library's display mode is changed. More...
 
void nodeLibraryHiddenOrUnhidden (bool unhidden)
 Emitted when the Node Library's visibility is changed. More...
 
void nodeLibraryReceivedPasteCommand ()
 Emitted when Node Library's text filter receives the keyboard shortcut for the 'Paste' command. More...
 
void nodeLibraryMoved (QPoint newPos)
 Emitted when the node library's position changes relative to its parent. More...
 
void nodeLibraryWidthChanged (int)
 Emitted when the node library's width changes. More...
 
void nodeLibraryHeightChanged (int)
 Emitted when the node library's height changes. More...
 
void nodeDocumentationPanelWidthChanged (int)
 Emitted when the node documentation panel's width changes. More...
 
void nodeDocumentationPanelHeightChanged (int)
 Emitted when the node documentation panel's height changes. More...
 
void documentationSelectionChanged ()
 Emitted when the documentation text selection changes. More...
 
void aboutToBeDestroyed ()
 Emitted when the Node Library's destructor has been called, but has not yet had any effect. More...
 

Public Member Functions

 VuoNodeLibrary (VuoCompiler *compiler, QWidget *parent=0, VuoNodeLibrary::nodeLibraryDisplayMode displayMode=VuoNodeLibrary::displayByClass)
 Creates a window for browsing node classes. More...
 
void setCompiler (VuoCompiler *compiler)
 Sets the compiler instance to query for information about loaded modules. More...
 
void prepareAndMakeVisible ()
 Makes the node library visible and sets its minimum and maximum widths to their original values. More...
 
void fixWidth (bool fix)
 Enables and disables horizontal resizing of the node library. More...
 
void displayPopoverForCurrentNodeClass ()
 Enables display of popovers in response to user interaction and prepares and displays the popover for the currently selected node class. More...
 
bool eventFilter (QObject *object, QEvent *event) VuoWarnUnusedResult
 Filters events on watched objects. More...
 
bool getHumanReadable ()
 Returns a boolean indicating whether node class names are currently displayed in "human-readable" mode (i.e., using default node titles rather than class names). More...
 
void focusTextFilter ()
 Focuses the node library's text filter widget and highlights any text already displayed within the filter. More...
 
void searchForText (QString text)
 Sets the node library's text filter content to the input text. More...
 
void getState (QString &filterText, set< string > &selectedNodeClasses, string &documentedNodeClass)
 Retrieves certain components of the node library's current state. More...
 
void setState (QString filterText, set< string > selectedNodeClasses, string documentedNodeClass)
 Sets the filter text, node class selection, and node class documentation as indicated. More...
 
QString getSelectedDocumentationText ()
 Returns the currently selected text in the documentation pane, or the empty string if none. More...
 
void emitNodeLibraryHiddenOrUnhidden (bool unhidden)
 Emits a nodeLibraryHiddenOrUnhidden(bool unhidden) signal to indicate that the visibility of this node library has changed. More...
 
void releaseDocumentationWidget ()
 Disassociates the currently displayed documentation widget from the documentation panel, to ensure that the widget is not destroyed along with the panel and may be used elsewhere. More...
 
void clearNodeClassList ()
 Clears the stored list of node classes. More...
 
void updateNodeClassList (const vector< string > &nodeClassesToRemove, const vector< VuoCompilerNodeClass * > &nodeClassesToAdd)
 Updates the display and the stored list of node classes, removing those with class names in nodeClassesToRemove and adding those in nodeClassesToAdd. More...
 
void highlightNodeClass (string targetNodeClassName, bool highlightAsNewlyInstalled=true, bool resetPreviousSelection=true)
 Selects the provided node class within the library. More...
 
void prepareAndDisplayNodePopoverForClass (string nodeClassName)
 Prepares (extracts any necessary resources for) and displays the popover for the node class with the provided name, which in this case is not case-sensitive. More...
 

Static Public Member Functions

static void cullHiddenNodeClasses (vector< VuoCompilerNodeClass * > &nodeClasses)
 Removes from nodeClasses those that should not be displayed in the node library. More...
 
static QStringList tokenizeNodeName (QString nodeName, QString className)
 Tokenizes the human-readable nodeName on whitespace; tokenizes the className on '. More...
 
static bool isStopWord (QString word)
 Returns a boolean indicating whether the input word is a stop word. More...
 

Protected Member Functions

void moveEvent (QMoveEvent *event)
 Receive move events. More...
 
void resizeEvent (QResizeEvent *event)
 Receive resize events. More...
 
void showEvent (QShowEvent *event)
 Receive show events. More...
 
void closeEvent (QCloseEvent *event)
 Emits a signal indicating that this node class library should be hidden (and that all other node class libraries application-wide should follow suit). More...
 
void keyPressEvent (QKeyEvent *event)
 Handles keypress events. More...
 

Friends

class TestVuoEditor
 

Member Enumeration Documentation

◆ nodeLibraryDisplayMode

Specifies the display format for node classes within the library.

Definition at line 36 of file VuoNodeLibrary.hh.

◆ nodeLibraryState

Specifies the node library visibility setting.

Definition at line 45 of file VuoNodeLibrary.hh.

Constructor & Destructor Documentation

◆ VuoNodeLibrary()

VuoNodeLibrary::VuoNodeLibrary ( VuoCompiler compiler,
QWidget *  parent = 0,
VuoNodeLibrary::nodeLibraryDisplayMode  displayMode = VuoNodeLibrary::displayByClass 
)
explicit

Creates a window for browsing node classes.

Definition at line 40 of file VuoNodeLibrary.cc.

Member Function Documentation

◆ aboutToBeDestroyed

void VuoNodeLibrary::aboutToBeDestroyed ( )
signal

Emitted when the Node Library's destructor has been called, but has not yet had any effect.

◆ changedIsHumanReadable

void VuoNodeLibrary::changedIsHumanReadable ( bool  humanReadable)
signal

Emitted when the Node Library's display mode is changed.

◆ clearNodeClassList()

void VuoNodeLibrary::clearNodeClassList ( )

Clears the stored list of node classes.

Also resets the filter text, clears the popover pane, and resets the list of cached popovers.

Definition at line 1108 of file VuoNodeLibrary.cc.

◆ clickedFlatClassButton

void VuoNodeLibrary::clickedFlatClassButton ( )
slot

Called when the Flat Class button is clicked.

Definition at line 172 of file VuoNodeLibrary.cc.

◆ clickedNamesButton

void VuoNodeLibrary::clickedNamesButton ( )
slot

Called when the Names button is clicked.

Definition at line 162 of file VuoNodeLibrary.cc.

◆ closeEvent()

void VuoNodeLibrary::closeEvent ( QCloseEvent *  event)
protected

Emits a signal indicating that this node class library should be hidden (and that all other node class libraries application-wide should follow suit).

Definition at line 836 of file VuoNodeLibrary.cc.

◆ componentsAdded

void VuoNodeLibrary::componentsAdded ( QList< QGraphicsItem * >  addedComponents,
VuoEditorComposition target 
)
signal

Emitted when the user has used the Node Library to add nodes to the composition.

◆ cullHiddenNodeClasses()

void VuoNodeLibrary::cullHiddenNodeClasses ( vector< VuoCompilerNodeClass * > &  nodeClasses)
static

Removes from nodeClasses those that should not be displayed in the node library.

Definition at line 101 of file VuoNodeLibrary.cc.

◆ displayPopoverForCurrentNodeClass()

void VuoNodeLibrary::displayPopoverForCurrentNodeClass ( )

Enables display of popovers in response to user interaction and prepares and displays the popover for the currently selected node class.

Definition at line 993 of file VuoNodeLibrary.cc.

◆ displayPopoverInPane

void VuoNodeLibrary::displayPopoverInPane ( QWidget *  panelContentWidget,
QString  resourceDir = "" 
)
slot

Displays the provided widget in the popover pane.

Assumes the popover has been prepared (had any relevant resources extracted) already.

Definition at line 1002 of file VuoNodeLibrary.cc.

◆ documentationSelectionChanged

void VuoNodeLibrary::documentationSelectionChanged ( )
signal

Emitted when the documentation text selection changes.

◆ emitNodeLibraryHiddenOrUnhidden()

void VuoNodeLibrary::emitNodeLibraryHiddenOrUnhidden ( bool  unhidden)

Emits a nodeLibraryHiddenOrUnhidden(bool unhidden) signal to indicate that the visibility of this node library has changed.

Definition at line 1026 of file VuoNodeLibrary.cc.

◆ eventFilter()

bool VuoNodeLibrary::eventFilter ( QObject *  object,
QEvent *  event 
)

Filters events on watched objects.

Definition at line 127 of file VuoNodeLibrary.cc.

◆ fixWidth()

void VuoNodeLibrary::fixWidth ( bool  fix)

Enables and disables horizontal resizing of the node library.

Definition at line 924 of file VuoNodeLibrary.cc.

◆ focusTextFilter()

void VuoNodeLibrary::focusTextFilter ( )

Focuses the node library's text filter widget and highlights any text already displayed within the filter.

Definition at line 737 of file VuoNodeLibrary.cc.

◆ getHumanReadable()

bool VuoNodeLibrary::getHumanReadable ( )

Returns a boolean indicating whether node class names are currently displayed in "human-readable" mode (i.e., using default node titles rather than class names).

Definition at line 728 of file VuoNodeLibrary.cc.

◆ getSelectedDocumentationText()

QString VuoNodeLibrary::getSelectedDocumentationText ( )

Returns the currently selected text in the documentation pane, or the empty string if none.

Definition at line 676 of file VuoNodeLibrary.cc.

◆ getState()

void VuoNodeLibrary::getState ( QString &  filterText,
set< string > &  selectedNodeClasses,
string &  documentedNodeClass 
)

Retrieves certain components of the node library's current state.

Parameters
filterTextThe current text content of the search filter.
selectedNodeClassesThe names of the currently selected node classes within the class list.
documentedNodeClassThe name of the node class whose documentation is currently displayed, or the empty string if none.

Definition at line 642 of file VuoNodeLibrary.cc.

◆ highlightNodeClass()

void VuoNodeLibrary::highlightNodeClass ( string  targetNodeClassName,
bool  highlightAsNewlyInstalled = true,
bool  resetPreviousSelection = true 
)

Selects the provided node class within the library.

If highlightAsNewlyInstalled is true, also marks the node class as being newly installed, for possible custom display. If resetSelection is true, clears any previous node class selection.

Definition at line 1188 of file VuoNodeLibrary.cc.

◆ isStopWord()

bool VuoNodeLibrary::isStopWord ( QString  word)
static

Returns a boolean indicating whether the input word is a stop word.

Definition at line 1256 of file VuoNodeLibrary.cc.

◆ keyPressEvent()

void VuoNodeLibrary::keyPressEvent ( QKeyEvent *  event)
protected

Handles keypress events.

Definition at line 847 of file VuoNodeLibrary.cc.

◆ moveEvent()

void VuoNodeLibrary::moveEvent ( QMoveEvent *  event)
protected

Receive move events.

When the widget receives this event, it is already at the new position.

Definition at line 764 of file VuoNodeLibrary.cc.

◆ nodeDocumentationPanelHeightChanged

void VuoNodeLibrary::nodeDocumentationPanelHeightChanged ( int  )
signal

Emitted when the node documentation panel's height changes.

◆ nodeDocumentationPanelWidthChanged

void VuoNodeLibrary::nodeDocumentationPanelWidthChanged ( int  )
signal

Emitted when the node documentation panel's width changes.

◆ nodeLibraryHeightChanged

void VuoNodeLibrary::nodeLibraryHeightChanged ( int  )
signal

Emitted when the node library's height changes.

◆ nodeLibraryHiddenOrUnhidden

void VuoNodeLibrary::nodeLibraryHiddenOrUnhidden ( bool  unhidden)
signal

Emitted when the Node Library's visibility is changed.

◆ nodeLibraryMoved

void VuoNodeLibrary::nodeLibraryMoved ( QPoint  newPos)
signal

Emitted when the node library's position changes relative to its parent.

◆ nodeLibraryReceivedPasteCommand

void VuoNodeLibrary::nodeLibraryReceivedPasteCommand ( )
signal

Emitted when Node Library's text filter receives the keyboard shortcut for the 'Paste' command.

◆ nodeLibraryWidthChanged

void VuoNodeLibrary::nodeLibraryWidthChanged ( int  )
signal

Emitted when the node library's width changes.

◆ prepareAndDisplayNodePopoverForClass() [1/2]

void VuoNodeLibrary::prepareAndDisplayNodePopoverForClass ( string  nodeClassName)

Prepares (extracts any necessary resources for) and displays the popover for the node class with the provided name, which in this case is not case-sensitive.

Definition at line 972 of file VuoNodeLibrary.cc.

◆ prepareAndDisplayNodePopoverForClass [2/2]

void VuoNodeLibrary::prepareAndDisplayNodePopoverForClass ( VuoNodeClass nodeClass)
slot

Prepares (extracts any necessary resources for) and displays the popover relevant to the provided node class.

Definition at line 984 of file VuoNodeLibrary.cc.

◆ prepareAndMakeVisible()

void VuoNodeLibrary::prepareAndMakeVisible ( )

Makes the node library visible and sets its minimum and maximum widths to their original values.

Definition at line 911 of file VuoNodeLibrary.cc.

◆ releaseDocumentationWidget()

void VuoNodeLibrary::releaseDocumentationWidget ( )

Disassociates the currently displayed documentation widget from the documentation panel, to ensure that the widget is not destroyed along with the panel and may be used elsewhere.

Definition at line 865 of file VuoNodeLibrary.cc.

◆ resizeEvent()

void VuoNodeLibrary::resizeEvent ( QResizeEvent *  event)
protected

Receive resize events.

When the widget receives this event, it already has its new geometry.

Definition at line 775 of file VuoNodeLibrary.cc.

◆ searchForText()

void VuoNodeLibrary::searchForText ( QString  text)

Sets the node library's text filter content to the input text.

Definition at line 746 of file VuoNodeLibrary.cc.

◆ setCompiler()

void VuoNodeLibrary::setCompiler ( VuoCompiler compiler)

Sets the compiler instance to query for information about loaded modules.

Definition at line 182 of file VuoNodeLibrary.cc.

◆ setHumanReadable

void VuoNodeLibrary::setHumanReadable ( bool  humanReadable)
slot

Sets the boolean indicating whether node class names are currently displayed in "human-readable" mode (i.e., using default node titles rather than class names).

Definition at line 755 of file VuoNodeLibrary.cc.

◆ setState()

void VuoNodeLibrary::setState ( QString  filterText,
set< string >  selectedNodeClasses,
string  documentedNodeClass 
)

Sets the filter text, node class selection, and node class documentation as indicated.

Definition at line 658 of file VuoNodeLibrary.cc.

◆ showEvent()

void VuoNodeLibrary::showEvent ( QShowEvent *  event)
protected

Receive show events.

Definition at line 873 of file VuoNodeLibrary.cc.

◆ tokenizeNodeName()

QStringList VuoNodeLibrary::tokenizeNodeName ( QString  nodeName,
QString  className 
)
static

Tokenizes the human-readable nodeName on whitespace; tokenizes the className on '.

' and, additionally, on both '.' and transitions from lowercase to uppercase; also includes all '.'-segmented suffixes of the class name; returns the combined token list.

Definition at line 688 of file VuoNodeLibrary.cc.

◆ updateNodeClassList()

void VuoNodeLibrary::updateNodeClassList ( const vector< string > &  nodeClassesToRemove,
const vector< VuoCompilerNodeClass * > &  nodeClassesToAdd 
)

Updates the display and the stored list of node classes, removing those with class names in nodeClassesToRemove and adding those in nodeClassesToAdd.

Also resets the filter text and, if any node classes are being removed, clears the popover pane and resets the list of cached popovers.

Definition at line 1126 of file VuoNodeLibrary.cc.

◆ updateUI

void VuoNodeLibrary::updateUI ( )
slot

Updates the UI elements (e.g., enables/disables buttons) based on the application's state.

Definition at line 625 of file VuoNodeLibrary.cc.


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