16 #include "VuoMovieExporter.hh"
19 #include <dispatch/dispatch.h>
64 void addNode(
VuoNode *node,
bool nodeShouldBeRendered=
true,
bool nodeShouldBeGivenUniqueIdentifier=
true);
105 void run(
string compositionSnapshot);
121 map<string, string>
publishPorts(set<string> portsToPublish);
131 QGraphicsItem *
findNearbyPort(QPointF scenePos,
bool limitPortCollisionRange=
true);
135 QList<QAction *>
getCompatibleTypesForMenu(
VuoRendererPort *genericPort, set<string> compatibleTypesInIsolation, set<string> compatibleTypesInContext,
bool limitToNodeSet,
string nodeSetName=
"", QMenu *menu=NULL);
184 #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);
273 void registerNodeID(
VuoNode *node);
276 void openSelectedEditableNodes();
277 string getNonProtocolVariantForPortName(
string portName);
278 set<string> getRespecializationOptionsForPortInNetwork(
VuoRendererPort *port);
279 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
281 bool eventOnlyConnection,
282 bool forwardConnection);
283 bool canConnectDirectlyWithRespecializationNondestructively(
VuoRendererPort *fromPort,
285 bool eventOnlyConnection,
286 bool forwardConnection,
288 string &respecializedTypeName);
291 bool eventOnlyConnection,
292 bool forwardConnection,
294 string &respecializedTypeName);
296 bool portCanBeUnspecializedNondestructively(
VuoPort *port);
300 void fireTriggerPortEvent(
VuoPort *port);
301 QList<QAction *> promoteSingletonsFromSubmenus(QList<QAction *> actionList);
302 static bool nodeSetMenuActionLessThan(QAction *action1, QAction *action2);
303 static bool itemHigherOnCanvas(QGraphicsItem *item1, QGraphicsItem *item2);
308 void disablePopoverForPortThreadSafe(
string portID);
310 void moveDetachedPortPopoversBy(
int dx,
int dy);
311 void moveErrorPopoversBy(
int dx,
int dy);
313 set<VuoErrorPopover *> errorPopovers;
314 bool errorMarkingUpdatesEnabled;
317 void moveNodesBy(set<VuoRendererNode *> nodes, qreal dx, qreal dy,
bool movedByDragging);
318 void moveCommentsBy(set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
320 void editSelectedComments();
322 void insertComment();
323 void insertSubcomposition();
324 void deleteConnectedCables();
325 void hideConnectedCables();
326 void unhideConnectedCables();
327 void fireTriggerPortEvent();
328 void setPortConstant();
329 void setTriggerThrottling(
int eventThrottling);
330 void specializeGenericPortType();
331 void unspecializePortType();
333 void removeInputPort();
335 void setDisableDragStickiness(
bool disable);
336 void updatePortAnimation(qreal value);
337 void endPortAnimation(
void);
338 void expandChangeNodeMenu();
341 void updatePopoversForActiveWindowChange(QWidget *old, QWidget *now);
342 void updatePopoversForApplicationStateChange(
bool active);
344 void repositionPopover();
347 static const qreal nodeMoveRate;
348 static const qreal nodeMoveRateMultiplier;
349 static const qreal showEventsModeUpdateInterval;
350 static const int initialChangeNodeSuggestionCount;
359 dispatch_queue_t runCompositionQueue;
360 dispatch_queue_t activePortPopoversQueue;
362 string linkedCompositionPath;
364 QAction *contextMenuDeleteSelected;
365 QAction *contextMenuHideSelectedCables;
366 QAction *contextMenuRenameSelected;
367 QAction *contextMenuRefactorSelected;
368 QAction *contextMenuPublishPort;
369 QAction *contextMenuDeleteCables;
370 QAction *contextMenuHideCables;
371 QAction *contextMenuUnhideCables;
372 QAction *contextMenuFireEvent;
373 QAction *contextMenuAddInputPort;
374 QAction *contextMenuRemoveInputPort;
375 QAction *contextMenuSetPortConstant;
376 QAction *contextMenuEditSelectedComments;
377 QMenu *contextMenuChangeNode;
378 QList<QAction *> contextMenuThrottlingActions;
379 QList<QAction *> contextMenuTintActions;
380 bool duplicateOnNextMouseMove;
381 bool duplicationDragInProgress;
382 bool duplicationCancelled;
383 QPointF cursorPosBeforeDuplicationDragMove;
385 bool cableInProgressWasNew;
386 bool cableInProgressShouldBeWireless;
389 bool menuSelectionInProgress;
390 QGraphicsItem *previousNearbyItem;
391 map<string, VuoNode *> nodeWithGraphvizIdentifier;
392 map<string, VuoPort *> portWithStaticIdentifier;
393 map<VuoPort *, string> staticIdentifierForPort;
394 bool dragStickinessDisabled;
395 bool ignoreApplicationStateChangeEvents;
397 QTimer *refreshComponentAlphaLevelTimer;
398 set<QGraphicsItemAnimation *> preparedAnimations;
399 map<QTimeLine *, QGraphicsItemAnimation *> animationForTimeline;
400 string triggerPortToRefire;
403 bool popoverEventsEnabled;
404 map<string, VuoPortPopover *> activePortPopovers;
405 set<string> portsWithPopoversClosedAtLastEvent;
408 void addActionToMenuAndMapper(QMenu *menu, QSignalMapper *mapper, QString name,
int index);
409 void mousePressEventNonLeftButton(QGraphicsSceneMouseEvent *event);
410 void correctForCancelledDuplication(QGraphicsSceneMouseEvent *event);
412 void concludeCableDrag(QGraphicsSceneMouseEvent *event);
413 void concludePublishedCableDrag(QGraphicsSceneMouseEvent *event);
414 void updateHoverHighlighting(QPointF scenePos,
bool disablePortHoverHighlighting=
false);
415 void highlightEligibleEndpointsForCable(
VuoCable *cable);
419 bool selectBridgingSolutionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
421 bool promptForBridgingSelectionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
422 QString getDisplayTextForSpecializationOption(
VuoRendererPort *portToSpecialize,
string specializedTypeName);
423 bool hasFeedbackErrors(
void);
424 void buildComposition(
string compositionSnapshot,
const set<string> &dependenciesUninstalled = set<string>());
425 bool isRunningThreadUnsafe(
void);
426 string getIdentifierForRunningPort(
VuoPort *port);
427 void moveItemsBy(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
428 void setPopoversHideOnDeactivate(
bool shouldHide);
430 QGraphicsItemAnimation * setUpAnimationForPort(QGraphicsItemAnimation *animation,
VuoRendererPort *port);
432 QGraphicsItemAnimation * getAvailableAnimationForPort(
VuoRendererPort *port);
434 friend class TestVuoEditor;