Vuo  0.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
VuoEditorGraph Class Reference

Description

Handles drags-and-drops and performs node instantiation for the editor window.

Public Slots

void deleteSelectedGraphComponents (string commandDescription="Delete")
 Deletes currently selected nodes and cables.
 
void selectAllGraphComponents ()
 Selects all nodes and cables on the canvas.
 
void selectAllNodes ()
 Selects all nodes on the canvas.
 
void selectAllCables ()
 Selects all cables on the canvas.
 
void deselectAllGraphComponents ()
 Deselects all nodes and cables on the canvas.
 
void moveSelectedNodesBy (qreal dx, qreal dy)
 Moves currently selected nodes dx points horizontally and dy points vertically.
 

Signals

void leftMouseButtonReleased (void)
 
void nodesMoved (set< VuoRendererNode * > nodes, qreal dx, qreal dy, bool movedByDragging)
 
void selectedComponentsCopied ()
 
void componentsPasted (bool pasteWithOffset, string commandDescription="Paste")
 
void componentsAdded (QList< QGraphicsItem * > addedComponents)
 
void componentsRemoved (QList< QGraphicsItem * > removedComponents, string commandDescription="Remove")
 
void connectionCompleted (VuoRendererCable *cableInProgress, VuoRendererPort *targetPort, VuoRendererCable *previousConnectedCable)
 
void dataEditorRequested (VuoRendererPort *port)
 

Public Member Functions

 VuoEditorGraph ()
 Creates an empty canvas upon which nodes and cables can be rendered.
 
void setCompiler (VuoCompiler *compiler)
 Specifies a compiler instance to be used by this graph (for, e.g., instantiating dropped nodes).
 
VuoRendererNodecreateNode (QString nodeClassName, string displayName="", double x=0, double y=0)
 Instantiates a node of class nodeClass.
 
QAction * getContextMenuDeleteSelectedAction (void)
 
vector< VuoRendererNode * > getNodes ()
 Returns an ordered list of the nodes contained in this scene, starting with those that existed in the original composition and continuing with those created anew.
 
vector< VuoRendererCable * > getCables ()
 Returns an ordered list of the cables contained in this scene, sorted primarily by the creation order of their 'From' nodes, and secondarily by lexicographic order of the full cable declarations.
 
void printGraph (stringstream &output, string header="", string footer="")
 Prints the .vuo representation of this graph, making use of the optional input header and footer.
 
void printSubgraphWithElements (stringstream &output, vector< VuoRendererNode * > nodes, vector< VuoRendererCable * > cables, string header="", string footer="", bool forcePositionPrinting=false, qreal xPositionOffset=0, qreal yPositionOffset=0)
 Prints the .vuo representation of the subgraph with the provided input elements.
 
set< VuoRendererCable * > getCablesInternalToSubgraph (QList< QGraphicsItem * > subgraphComponents)
 Returns the set of cables creating internal connections within the set of input subgraphComponents.
 
string getNodeDeclaration (const VuoRendererNode *node, bool forcePositionPrinting=false, qreal xPositionOffset=0, qreal yPositionOffset=0) const
 Returns a string containing the declaration of this node as it would appear in a .vuo file.
 
string getAvailableNodeName (string displayName)
 Returns a unique Graphviz node name based on the node's displayName , with a counter appended if necessary.
 
void cancelCableDrag (void)
 Cancel the current cable drag operation, if applicable.
 
void run (string graphPath)
 Builds the graph at graphPath and runs the resulting executable.
 
void stop (void)
 Stops the running graph.
 
bool isRunning (void)
 Returns true if the graph is running.
 
- Public Member Functions inherited from VuoRendererGraph
 VuoRendererGraph ()
 Creates an empty canvas upon which nodes and cables can be rendered.
 
void setParser (VuoCompilerGraphvizParser *parser)
 Specifies a Graphviz parser instance to be used by this graph.
 
VuoRendererNodecreateNode (VuoNode *node)
 Creates a renderer detail for the specified node.
 
VuoRendererNodeaddNode (VuoNode *node)
 Creates a renderer detail for the specified node and adds it to the canvas.
 
VuoRendererNodeaddExistingNode (VuoRendererNode *rn)
 Adds a pre-existing renderer node to the canvas.
 
VuoRendererCablecreateCable (VuoCable *c)
 Creates a renderer detail for the specified cable.
 
VuoRendererCableaddCable (VuoCable *cable)
 Creates a renderer detail for the specified cable and adds it to the canvas.
 
VuoRendererCableaddExistingCable (VuoRendererCable *rc)
 Adds a pre-existing renderer cable to the canvas.
 
void loadComposition (void)
 Loads the composition associated with the input parser if one is provided, and with the graph's member parser otherwise.
 
VuoRendererNodegetNodeNameTaken (string name)
 Returns a pointer to the VuoRendererNode currently assigned the input Graphviz identifier, or NULL if the identifier is unassigned.
 
void collapseTypecastNodes (void)
 Once all nodes and cables have been added to the scene, call this to convert each freestanding typecast node into a mini-node attached to its destination node.
 
VuoRendererTypecastPortcollapseTypecastNode (VuoRendererNode *rn)
 Convert a freestanding typecast node into a mini-node attached to its destination node; returns a pointer to the newly collapsed node.
 
VuoRendererNodeuncollapseTypecastNode (VuoRendererTypecastPort *typecast)
 Convert a collapsed typecast mini-node back into a freestanding node.
 
void removePortEligibilityHighlighting (void)
 Removes connection eligibility highlighting from all ports in the scene.
 
void setAnyNodeHasBeenRepositioned (bool repositioned)
 Sets a boolean indicating whether any node in this graph has been repositioned since the graph was first loaded.
 
bool getAnyNodeHasBeenRepositioned (void) const
 Returns a boolean indicating whether any node in this graph has been repositioned since the graph was first loaded.
 

Static Public Attributes

static const string defaultHeader = "digraph G\n"
 

Protected Member Functions

void dragEnterEvent (QGraphicsSceneDragDropEvent *event)
 Decide whether we can accept the dragged data.
 
void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 Decide what to do with the dragged data as it leaves.
 
void dragMoveEvent (QGraphicsSceneDragDropEvent *event)
 Decide what to do with the moved drag-drop data.
 
void dropEvent (QGraphicsSceneDragDropEvent *event)
 Handle the dropped data.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse press events.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse release events.
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
 Handle mouse move events.
 
void keyPressEvent (QKeyEvent *event)
 Handle keypress events.
 
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
 Display a node's context menu.
 
VuoRendererCablefindNearbyCable (QPointF scenePos)
 Returns a pointer to the cable that should be selected if the user clicks at position scenePos, or NULL if no cable is within selection range.
 

Additional Inherited Members

- Protected Attributes inherited from VuoRendererGraph
VuoCompilerGraphvizParserparser
 
map< string, VuoRendererNode * > nodeNameTaken
 
bool anyNodeHasBeenRepositioned
 
VuoRendererSignalersignaler
 

Member Function Documentation

void VuoEditorGraph::run ( string  graphPath)

Builds the graph at graphPath and runs the resulting executable.

Assumes the graph is not already running.

Parameters
graphPathThe path to the graph (.vuo file).
void VuoEditorGraph::stop ( void  )

Stops the running graph.

Assumes the graph is running.


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