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);
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 setTriggerThrottling(
int eventThrottling);
329 void specializeGenericPortType();
330 void unspecializePortType();
332 void removeInputPort();
334 void setDisableDragStickiness(
bool disable);
335 void updatePortAnimation(qreal value);
336 void endPortAnimation(
void);
337 void expandChangeNodeMenu();
340 void updatePopoversForActiveWindowChange(QWidget *old, QWidget *now);
341 void updatePopoversForApplicationStateChange(
bool active);
343 void repositionPopover();
346 static const qreal nodeMoveRate;
347 static const qreal nodeMoveRateMultiplier;
348 static const qreal showEventsModeUpdateInterval;
349 static const int initialChangeNodeSuggestionCount;
358 dispatch_queue_t runCompositionQueue;
359 dispatch_queue_t activePortPopoversQueue;
361 string linkedCompositionPath;
363 QAction *contextMenuDeleteSelected;
364 QAction *contextMenuHideSelectedCables;
365 QAction *contextMenuRenameSelected;
366 QAction *contextMenuRefactorSelected;
367 QAction *contextMenuPublishPort;
368 QAction *contextMenuDeleteCables;
369 QAction *contextMenuHideCables;
370 QAction *contextMenuUnhideCables;
371 QAction *contextMenuFireEvent;
372 QAction *contextMenuAddInputPort;
373 QAction *contextMenuRemoveInputPort;
374 QAction *contextMenuSetPortConstant;
375 QAction *contextMenuEditSelectedComments;
376 QMenu *contextMenuChangeNode;
377 QList<QAction *> contextMenuThrottlingActions;
378 QList<QAction *> contextMenuTintActions;
379 bool duplicateOnNextMouseMove;
380 bool duplicationDragInProgress;
381 bool duplicationCancelled;
382 QPointF cursorPosBeforeDuplicationDragMove;
384 bool cableInProgressWasNew;
385 bool cableInProgressShouldBeWireless;
388 bool menuSelectionInProgress;
389 QGraphicsItem *previousNearbyItem;
390 map<string, VuoNode *> nodeWithGraphvizIdentifier;
391 map<string, VuoPort *> portWithStaticIdentifier;
392 map<VuoPort *, string> staticIdentifierForPort;
393 bool dragStickinessDisabled;
394 bool ignoreApplicationStateChangeEvents;
396 QTimer *refreshComponentAlphaLevelTimer;
397 set<QGraphicsItemAnimation *> preparedAnimations;
398 map<QTimeLine *, QGraphicsItemAnimation *> animationForTimeline;
399 string triggerPortToRefire;
402 bool popoverEventsEnabled;
403 map<string, VuoPortPopover *> activePortPopovers;
404 set<string> portsWithPopoversClosedAtLastEvent;
407 void addActionToMenuAndMapper(QMenu *menu, QSignalMapper *mapper, QString name,
int index);
408 void mousePressEventNonLeftButton(QGraphicsSceneMouseEvent *event);
409 void correctForCancelledDuplication(QGraphicsSceneMouseEvent *event);
411 void concludeCableDrag(QGraphicsSceneMouseEvent *event);
412 void concludePublishedCableDrag(QGraphicsSceneMouseEvent *event);
413 void updateHoverHighlighting(QPointF scenePos,
bool disablePortHoverHighlighting=
false);
414 void highlightEligibleEndpointsForCable(
VuoCable *cable);
418 bool selectBridgingSolutionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
420 bool promptForBridgingSelectionFromOptions(vector<string> suitableTypecasts, map<string, VuoRendererPort *> portToSpecializeForTypecast, map<string, string> specializedTypeNameForTypecast,
string &selectedTypecast);
421 QString getDisplayTextForSpecializationOption(
VuoRendererPort *portToSpecialize,
string specializedTypeName);
422 bool hasFeedbackErrors(
void);
423 void buildComposition(
string compositionSnapshot,
const set<string> &dependenciesUninstalled = set<string>());
424 bool isRunningThreadUnsafe(
void);
425 string getIdentifierForRunningPort(
VuoPort *port);
426 void moveItemsBy(set<VuoRendererNode *> nodes, set<VuoRendererComment *> comments, qreal dx, qreal dy,
bool movedByDragging);
427 void setPopoversHideOnDeactivate(
bool shouldHide);
429 QGraphicsItemAnimation * setUpAnimationForPort(QGraphicsItemAnimation *animation,
VuoRendererPort *port);
431 QGraphicsItemAnimation * getAvailableAnimationForPort(
VuoRendererPort *port);
433 friend class TestVuoEditor;