16 #include "VuoMovieExporter.hh"
19 #include <dispatch/dispatch.h>
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);
188 #include "pro/VuoEditorComposition_Pro.hh"
211 void itemsMoved(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
215 void componentsRemoved(QList<QGraphicsItem *> removedComponents,
string commandDescription=
"Remove");
225 void protocolPortChangesRequested(map<VuoPublishedPort *, string> publishedPortsToRename, set<VuoPublishedPort *> publishedPortsToRemove, vector<VuoPublishedPort *> publishedPortsToAdd,
bool beginUndoStackMacro,
bool endUndoStackMacro);
265 void dropEvent(QGraphicsSceneDragDropEvent *event);
278 void openSelectedEditableNodes();
279 string getNonProtocolVariantForPortName(
string portName);
280 void populateSpecializePortMenu(QMenu *menu,
VuoRendererPort *port,
bool limitInitialOptions);
281 set<string> getRespecializationOptionsForPortInNetwork(
VuoRendererPort *port);
282 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
284 bool eventOnlyConnection,
285 bool forwardConnection);
286 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
288 bool eventOnlyConnection,
289 bool forwardConnection,
291 string &respecializedTypeName);
294 bool eventOnlyConnection,
295 bool forwardConnection,
297 string &respecializedTypeName);
299 bool portCanBeUnspecializedNondestructively(
VuoPort *port);
303 void fireTriggerPortEvent(
VuoPort *port);
304 QList<QAction *> promoteSingletonsFromSubmenus(QList<QAction *> actionList);
305 static bool nodeSetMenuActionLessThan(QAction *action1, QAction *action2);
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);
418 void updateEligibilityHighlightingForPort(
VuoRendererPort *portToHighlight,
VuoRendererPort *fixedPort,
bool eventOnlyConnection, map<string, VuoCompilerType *> &types);
420 bool selectBridgingSolutionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
421 vector<string>
findBridgingSolutions(
VuoRendererPort *fromPort,
VuoRendererPort *toPort,
bool toPortIsDragDestination, map<string, VuoRendererPort *> &portToSpecializeForTypecast, map<string, string> &specializedTypeNameForTypecast, map<string, VuoCompilerType *> &types);
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;