66 void addNode(
VuoNode *node,
bool nodeShouldBeRendered=
true,
bool nodeShouldBeGivenUniqueIdentifier=
true);
110 void run(
string compositionSnapshot);
125 map<string, string>
publishPorts(set<string> portsToPublish);
135 QGraphicsItem *
findNearbyPort(QPointF scenePos,
bool limitPortCollisionRange=
true);
139 QList<QAction *>
getCompatibleTypesForMenu(
VuoRendererPort *genericPort, set<string> compatibleTypesInIsolation, set<string> compatibleTypesInContext,
bool limitToNodeSet,
string nodeSetName=
"", QMenu *menu=NULL);
189#include "pro/VuoEditorComposition_Pro.hh"
212 void itemsMoved(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
216 void componentsRemoved(QList<QGraphicsItem *> removedComponents,
string commandDescription=
"Remove");
226 void protocolPortChangesRequested(map<VuoPublishedPort *, string> publishedPortsToRename, set<VuoPublishedPort *> publishedPortsToRemove, vector<VuoPublishedPort *> publishedPortsToAdd,
bool beginUndoStackMacro,
bool endUndoStackMacro);
266 void dropEvent(QGraphicsSceneDragDropEvent *event);
279 void openSelectedEditableNodes();
280 string getNonProtocolVariantForPortName(
string portName);
281 void populateSpecializePortMenu(QMenu *menu,
VuoRendererPort *port,
bool limitInitialOptions);
282 set<string> getRespecializationOptionsForPortInNetwork(
VuoRendererPort *port);
283 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
285 bool eventOnlyConnection,
286 bool forwardConnection);
287 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
289 bool eventOnlyConnection,
290 bool forwardConnection,
292 string &respecializedTypeName);
295 bool eventOnlyConnection,
296 bool forwardConnection,
298 string &respecializedTypeName);
300 bool portCanBeUnspecializedNondestructively(
VuoPort *port);
302 bool portsPassSanityCheckToTypeconvert(
VuoRendererPort *fromPort,
VuoRendererPort *toPort,
const string &candidateFromTypeName=
"",
const string &candidateToTypeName=
"");
304 void fireTriggerPortEvent(
VuoPort *port);
305 QList<QAction *> promoteSingletonsFromSubmenus(QList<QAction *> actionList);
306 static bool itemHigherOnCanvas(QGraphicsItem *item1, QGraphicsItem *item2);
311 void disablePopoverForPortThreadSafe(
string portID);
313 void moveDetachedPortPopoversBy(
int dx,
int dy);
314 void moveErrorPopoversBy(
int dx,
int dy);
316 set<VuoErrorPopover *> errorPopovers;
317 bool errorMarkingUpdatesEnabled;
320 void moveNodesBy(set<VuoRendererNode *> nodes, qreal dx, qreal dy,
bool movedByDragging);
321 void moveCommentsBy(set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
323 void editSelectedComments();
325 void insertComment();
326 void insertSubcomposition();
327 void deleteConnectedCables();
328 void hideConnectedCables();
329 void unhideConnectedCables();
330 void fireTriggerPortEvent();
331 void setPortConstant();
332 void specializeGenericPortType();
333 void unspecializePortType();
335 void removeInputPort();
337 void setDisableDragStickiness(
bool disable);
338 void updatePortAnimation(qreal value);
339 void endPortAnimation(
void);
340 void expandChangeNodeMenu();
341 void expandSpecializePortMenu();
344 void updatePopoversForActiveWindowChange(QWidget *old, QWidget *now);
345 void updatePopoversForApplicationStateChange(
bool active);
347 void repositionPopover();
350 static const qreal nodeMoveRate;
351 static const qreal nodeMoveRateMultiplier;
352 static const qreal showEventsModeUpdateInterval;
353 static const int initialChangeNodeSuggestionCount;
362 dispatch_queue_t runCompositionQueue;
363 dispatch_queue_t activePortPopoversQueue;
365 string linkedCompositionPath;
366 std::shared_ptr<VuoRunningCompositionLibraries> runningCompositionLibraries;
367 QAction *contextMenuDeleteSelected;
368 QAction *contextMenuHideSelectedCables;
369 QAction *contextMenuRenameSelected;
370 QAction *contextMenuRefactorSelected;
371 QAction *contextMenuPublishPort;
372 QAction *contextMenuDeleteCables;
373 QAction *contextMenuHideCables;
374 QAction *contextMenuUnhideCables;
375 QAction *contextMenuFireEvent;
376 QAction *contextMenuAddInputPort;
377 QAction *contextMenuRemoveInputPort;
378 QAction *contextMenuSetPortConstant;
379 QAction *contextMenuEditSelectedComments;
380 QMenu *contextMenuChangeNode;
381 QMenu *contextMenuSpecializeGenericType;
382 QList<QAction *> contextMenuThrottlingActions;
383 QList<QAction *> contextMenuTintActions;
384 bool duplicateOnNextMouseMove;
385 bool duplicationDragInProgress;
386 bool duplicationCancelled;
387 QPointF cursorPosBeforeDuplicationDragMove;
389 bool cableInProgressWasNew;
390 bool cableInProgressShouldBeWireless;
393 bool menuSelectionInProgress;
394 QGraphicsItem *previousNearbyItem;
396 bool dragStickinessDisabled;
397 bool ignoreApplicationStateChangeEvents;
399 QTimer *refreshComponentAlphaLevelTimer;
400 set<QGraphicsItemAnimation *> preparedAnimations;
401 map<QTimeLine *, QGraphicsItemAnimation *> animationForTimeline;
402 string triggerPortToRefire;
405 bool popoverEventsEnabled;
406 map<string, VuoPortPopover *> activePortPopovers;
407 set<string> portsWithPopoversClosedAtLastEvent;
410 void mousePressEventNonLeftButton(QGraphicsSceneMouseEvent *event);
411 void correctForCancelledDuplication(QGraphicsSceneMouseEvent *event);
413 void concludeCableDrag(QGraphicsSceneMouseEvent *event);
414 void concludePublishedCableDrag(QGraphicsSceneMouseEvent *event);
415 void updateHoverHighlighting(QPointF scenePos,
bool disablePortHoverHighlighting=
false);
416 void highlightEligibleEndpointsForCable(
VuoCable *cable);
420 bool selectBridgingSolutionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
422 bool promptForBridgingSelectionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
423 QString getDisplayTextForSpecializationOption(
VuoRendererPort *portToSpecialize,
string specializedTypeName);
424 bool hasFeedbackErrors(
void);
425 void buildComposition(
string compositionSnapshot,
const set<string> &dependenciesUninstalled = set<string>());
426 bool isRunningThreadUnsafe(
void);
427 string getIdentifierForRunningPort(
VuoPort *port);
428 void moveItemsBy(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
429 void setPopoversHideOnDeactivate(
bool shouldHide);
431 QGraphicsItemAnimation * setUpAnimationForPort(QGraphicsItemAnimation *animation,
VuoRendererPort *port);
433 QGraphicsItemAnimation * getAvailableAnimationForPort(
VuoRendererPort *port);
435 friend class TestVuoEditor;
436 friend class TestEditorCommands;