GraphNodeGroup(GraphNodeView graphView, DebugIdentifier root) { owner = graphView; this.root = root; UIElementsUtils.ApplyStyleSheet(styleSheet, this); RegisterCallback <GeometryChangedEvent>(GeometryChangededCallback); //inputPort = GraphNodePort.Create( // Direction.Input, typeof(GraphNode), DebugIdentifier.Invalid/*, null*/); //inputPort.Initialize(this, string.Empty); // headerContainer.Add(inputPort); }
void Initialize(GraphNodeView owner, Type type, DebugReference reference) { this.owner = owner; this.runtimeType = type; this.reference = reference; RegisterCallback <GeometryChangedEvent>(GeometryChangededCallback); UIElementsUtils.ApplyStyleSheet(styleSheet, this); InitializePorts(); InitializeView(); DrawDefaultInspector(); RefreshExpandedState(); RefreshPorts(); }
void LoadTemplate() { UIElementsUtils.ApplyStyleSheet(styleSheet, rootVisualElement); UIElementsUtils.ApplyStyleSheet(toolbarStyleSheet, rootVisualElement); UIElementsUtils.CloneTemplateInto("NodeGraphWindow.uxml", rootVisualElement); var breadcrumb = rootVisualElement.Q <Breadcrumb>("breadcrumb"); breadcrumb.Clear(); breadcrumb.PushItem("Root"); var content = rootVisualElement.Q <VisualElement>("content"); var graphNodeView = new GraphNodeView(this); graphNodeView.name = "graphNodeView"; content.Add(graphNodeView); DisplayMessages(); }
internal static GraphNode Create(GraphNodeView owner, Type type, DebugReference reference) { Type nodeType = GraphNodeAttribute.GetNodeType(reference.identifier.typeHashCode); if (nodeType != null) { Type runtimeType = DataTypes.GetTypeFromHashCode(reference.identifier.typeHashCode).Item1; var graphNode = Activator.CreateInstance(nodeType) as GraphNode; if (graphNode == null) { throw new InvalidOperationException( $"Failed to create node type {nodeType.FullName} for type {type.FullName}."); } graphNode.Initialize(owner, runtimeType, reference); return(graphNode); } return(null); }
internal static GraphNodeGroup Create(GraphNodeView graphView, DebugIdentifier root) { return(new GraphNodeGroup(graphView, root)); }