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 |
Specifies the display format for node classes within the library.
Definition at line 36 of file VuoNodeLibrary.hh.
Specifies the node library visibility setting.
Definition at line 45 of file VuoNodeLibrary.hh.
|
explicit |
Creates a window for browsing node classes.
Definition at line 40 of file VuoNodeLibrary.cc.
|
signal |
Emitted when the Node Library's destructor has been called, but has not yet had any effect.
|
signal |
Emitted when the Node Library's display mode is changed.
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.
|
slot |
Called when the Flat Class button is clicked.
Definition at line 172 of file VuoNodeLibrary.cc.
|
slot |
Called when the Names button is clicked.
Definition at line 162 of file VuoNodeLibrary.cc.
|
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.
|
signal |
Emitted when the user has used the Node Library to add nodes to the composition.
|
static |
Removes from nodeClasses those that should not be displayed in the node library.
Definition at line 101 of file VuoNodeLibrary.cc.
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.
|
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.
|
signal |
Emitted when the documentation text selection changes.
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.
bool VuoNodeLibrary::eventFilter | ( | QObject * | object, |
QEvent * | event | ||
) |
Filters events on watched objects.
Definition at line 127 of file VuoNodeLibrary.cc.
void VuoNodeLibrary::fixWidth | ( | bool | fix | ) |
Enables and disables horizontal resizing of the node library.
Definition at line 924 of file VuoNodeLibrary.cc.
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.
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.
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.
void VuoNodeLibrary::getState | ( | QString & | filterText, |
set< string > & | selectedNodeClasses, | ||
string & | documentedNodeClass | ||
) |
Retrieves certain components of the node library's current state.
filterText | The current text content of the search filter. |
selectedNodeClasses | The names of the currently selected node classes within the class list. |
documentedNodeClass | The name of the node class whose documentation is currently displayed, or the empty string if none. |
Definition at line 642 of file VuoNodeLibrary.cc.
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.
|
static |
Returns a boolean indicating whether the input word
is a stop word.
Definition at line 1256 of file VuoNodeLibrary.cc.
|
protected |
Handles keypress events.
Definition at line 847 of file VuoNodeLibrary.cc.
|
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.
|
signal |
Emitted when the node documentation panel's height changes.
|
signal |
Emitted when the node documentation panel's width changes.
|
signal |
Emitted when the node library's height changes.
|
signal |
Emitted when the Node Library's visibility is changed.
|
signal |
Emitted when the node library's position changes relative to its parent.
|
signal |
Emitted when Node Library's text filter receives the keyboard shortcut for the 'Paste' command.
|
signal |
Emitted when the node library's width changes.
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.
|
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.
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.
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.
|
protected |
Receive resize events.
When the widget receives this event, it already has its new geometry.
Definition at line 775 of file VuoNodeLibrary.cc.
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.
void VuoNodeLibrary::setCompiler | ( | VuoCompiler * | compiler | ) |
Sets the compiler instance to query for information about loaded modules.
Definition at line 182 of file VuoNodeLibrary.cc.
|
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.
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.
|
protected |
Receive show events.
Definition at line 873 of file VuoNodeLibrary.cc.
|
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.
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.
|
slot |
Updates the UI elements (e.g., enables/disables buttons) based on the application's state.
Definition at line 625 of file VuoNodeLibrary.cc.