Beispiel #1
0
        public static void ShowEdgeNodes(Stencil stencil, GraphToolState graphToolState, IEdgeModel edgeModel, Vector2 position,
                                         Action <GraphNodeModelSearcherItem> callback)
        {
            var filter     = stencil.GetSearcherFilterProvider()?.GetEdgeSearcherFilter(edgeModel);
            var adapter    = stencil.GetSearcherAdapter(graphToolState.WindowState.GraphModel, "Insert Node");
            var dbProvider = stencil.GetSearcherDatabaseProvider();

            if (dbProvider == null)
            {
                return;
            }

            var dbs = dbProvider.GetGraphElementsSearcherDatabases(graphToolState.WindowState.GraphModel).ToList();

            ShowSearcher(graphToolState, position, callback, dbs, filter, adapter, Usage.k_CreateNode);
        }
Beispiel #2
0
        public static void ShowOutputToGraphNodes(Stencil stencil, GraphToolState graphToolState, IEnumerable <IPortModel> portModels, Vector2 position,
                                                  Action <GraphNodeModelSearcherItem> callback)
        {
            var filter     = stencil.GetSearcherFilterProvider()?.GetOutputToGraphSearcherFilter(portModels);
            var adapter    = stencil.GetSearcherAdapter(graphToolState.WindowState.GraphModel, $"Choose an action for {portModels.First().DataTypeHandle.GetMetadata(stencil).FriendlyName}", portModels);
            var dbProvider = stencil.GetSearcherDatabaseProvider();

            if (dbProvider == null)
            {
                return;
            }

            var dbs = dbProvider.GetGraphElementsSearcherDatabases(graphToolState.WindowState.GraphModel).ToList();

            ShowSearcher(graphToolState, position, callback, dbs, filter, adapter, Usage.k_CreateNode);
        }
Beispiel #3
0
        public static void ShowGraphNodes(Stencil stencil, GraphToolState graphToolState, Vector2 position, Action <GraphNodeModelSearcherItem> callback)
        {
            var filter     = stencil.GetSearcherFilterProvider()?.GetGraphSearcherFilter();
            var adapter    = stencil.GetSearcherAdapter(graphToolState.WindowState.GraphModel, "Add a graph node");
            var dbProvider = stencil.GetSearcherDatabaseProvider();

            if (dbProvider == null)
            {
                return;
            }

            var dbs = dbProvider.GetGraphElementsSearcherDatabases(graphToolState.WindowState.GraphModel)
                      .Concat(dbProvider.GetDynamicSearcherDatabases((IPortModel)null))
                      .ToList();

            ShowSearcher(graphToolState, position, callback, dbs, filter, adapter, Usage.k_CreateNode);
        }