16 #include "VuoMovieExporter.hh"
19 #include <dispatch/dispatch.h>
66 void addNode(
VuoNode *node,
bool nodeShouldBeRendered=
true,
bool nodeShouldBeGivenUniqueIdentifier=
true);
107 void run(
string compositionSnapshot);
122 map<string, string>
publishPorts(set<string> portsToPublish);
132 QGraphicsItem *
findNearbyPort(QPointF scenePos,
bool limitPortCollisionRange=
true);
136 QList<QAction *>
getCompatibleTypesForMenu(
VuoRendererPort *genericPort, set<string> compatibleTypesInIsolation, set<string> compatibleTypesInContext,
bool limitToNodeSet,
string nodeSetName=
"", QMenu *menu=NULL);
185 #include "pro/VuoEditorComposition_Pro.hh"
208 void itemsMoved(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
212 void componentsRemoved(QList<QGraphicsItem *> removedComponents,
string commandDescription=
"Remove");
222 void protocolPortChangesRequested(map<VuoPublishedPort *, string> publishedPortsToRename, set<VuoPublishedPort *> publishedPortsToRemove, vector<VuoPublishedPort *> publishedPortsToAdd,
bool beginUndoStackMacro,
bool endUndoStackMacro);
262 void dropEvent(QGraphicsSceneDragDropEvent *event);
275 void openSelectedEditableNodes();
276 string getNonProtocolVariantForPortName(
string portName);
277 set<string> getRespecializationOptionsForPortInNetwork(
VuoRendererPort *port);
278 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
280 bool eventOnlyConnection,
281 bool forwardConnection);
282 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
284 bool eventOnlyConnection,
285 bool forwardConnection,
287 string &respecializedTypeName);
290 bool eventOnlyConnection,
291 bool forwardConnection,
293 string &respecializedTypeName);
295 bool portCanBeUnspecializedNondestructively(
VuoPort *port);
299 void fireTriggerPortEvent(
VuoPort *port);
300 QList<QAction *> promoteSingletonsFromSubmenus(QList<QAction *> actionList);
301 static bool nodeSetMenuActionLessThan(QAction *action1, QAction *action2);
302 static bool itemHigherOnCanvas(QGraphicsItem *item1, QGraphicsItem *item2);
307 void disablePopoverForPortThreadSafe(
string portID);
309 void moveDetachedPortPopoversBy(
int dx,
int dy);
310 void moveErrorPopoversBy(
int dx,
int dy);
312 set<VuoErrorPopover *> errorPopovers;
313 bool errorMarkingUpdatesEnabled;
316 void moveNodesBy(set<VuoRendererNode *> nodes, qreal dx, qreal dy,
bool movedByDragging);
317 void moveCommentsBy(set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
319 void editSelectedComments();
321 void insertComment();
322 void insertSubcomposition();
323 void deleteConnectedCables();
324 void hideConnectedCables();
325 void unhideConnectedCables();
326 void fireTriggerPortEvent();
327 void setPortConstant();
328 void specializeGenericPortType();
329 void unspecializePortType();
331 void removeInputPort();
333 void setDisableDragStickiness(
bool disable);
334 void updatePortAnimation(qreal value);
335 void endPortAnimation(
void);
336 void expandChangeNodeMenu();
339 void updatePopoversForActiveWindowChange(QWidget *old, QWidget *now);
340 void updatePopoversForApplicationStateChange(
bool active);
342 void repositionPopover();
345 static const qreal nodeMoveRate;
346 static const qreal nodeMoveRateMultiplier;
347 static const qreal showEventsModeUpdateInterval;
348 static const int initialChangeNodeSuggestionCount;
357 dispatch_queue_t runCompositionQueue;
358 dispatch_queue_t activePortPopoversQueue;
360 string linkedCompositionPath;
361 std::shared_ptr<VuoRunningCompositionLibraries> runningCompositionLibraries;
362 QAction *contextMenuDeleteSelected;
363 QAction *contextMenuHideSelectedCables;
364 QAction *contextMenuRenameSelected;
365 QAction *contextMenuRefactorSelected;
366 QAction *contextMenuPublishPort;
367 QAction *contextMenuDeleteCables;
368 QAction *contextMenuHideCables;
369 QAction *contextMenuUnhideCables;
370 QAction *contextMenuFireEvent;
371 QAction *contextMenuAddInputPort;
372 QAction *contextMenuRemoveInputPort;
373 QAction *contextMenuSetPortConstant;
374 QAction *contextMenuEditSelectedComments;
375 QMenu *contextMenuChangeNode;
376 QList<QAction *> contextMenuThrottlingActions;
377 QList<QAction *> contextMenuTintActions;
378 bool duplicateOnNextMouseMove;
379 bool duplicationDragInProgress;
380 bool duplicationCancelled;
381 QPointF cursorPosBeforeDuplicationDragMove;
383 bool cableInProgressWasNew;
384 bool cableInProgressShouldBeWireless;
387 bool menuSelectionInProgress;
388 QGraphicsItem *previousNearbyItem;
390 bool dragStickinessDisabled;
391 bool ignoreApplicationStateChangeEvents;
393 QTimer *refreshComponentAlphaLevelTimer;
394 set<QGraphicsItemAnimation *> preparedAnimations;
395 map<QTimeLine *, QGraphicsItemAnimation *> animationForTimeline;
396 string triggerPortToRefire;
399 bool popoverEventsEnabled;
400 map<string, VuoPortPopover *> activePortPopovers;
401 set<string> portsWithPopoversClosedAtLastEvent;
404 void mousePressEventNonLeftButton(QGraphicsSceneMouseEvent *event);
405 void correctForCancelledDuplication(QGraphicsSceneMouseEvent *event);
407 void concludeCableDrag(QGraphicsSceneMouseEvent *event);
408 void concludePublishedCableDrag(QGraphicsSceneMouseEvent *event);
409 void updateHoverHighlighting(QPointF scenePos,
bool disablePortHoverHighlighting=
false);
410 void highlightEligibleEndpointsForCable(
VuoCable *cable);
412 void updateEligibilityHighlightingForPort(
VuoRendererPort *portToHighlight,
VuoRendererPort *fixedPort,
bool eventOnlyConnection, map<string, VuoCompilerType *> &types);
414 bool selectBridgingSolutionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
415 vector<string>
findBridgingSolutions(
VuoRendererPort *fromPort,
VuoRendererPort *toPort,
bool toPortIsDragDestination, map<string, VuoRendererPort *> &portToSpecializeForTypecast, map<string, string> &specializedTypeNameForTypecast, map<string, VuoCompilerType *> &types);
416 bool promptForBridgingSelectionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
417 QString getDisplayTextForSpecializationOption(
VuoRendererPort *portToSpecialize,
string specializedTypeName);
418 bool hasFeedbackErrors(
void);
419 void buildComposition(
string compositionSnapshot,
const set<string> &dependenciesUninstalled = set<string>());
420 bool isRunningThreadUnsafe(
void);
421 string getIdentifierForRunningPort(
VuoPort *port);
422 void moveItemsBy(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
423 void setPopoversHideOnDeactivate(
bool shouldHide);
425 QGraphicsItemAnimation * setUpAnimationForPort(QGraphicsItemAnimation *animation,
VuoRendererPort *port);
427 QGraphicsItemAnimation * getAvailableAnimationForPort(
VuoRendererPort *port);
429 friend class TestVuoEditor;