コード例 #1
0
ファイル: NodeGraphConnector.cs プロジェクト: ywscr/NodeGraph
 /// <summary>
 /// Creates a new NodeGraphConnector, given a name, a parent container, type, index and DataType
 /// </summary>
 /// <param name="p_Name">The display name of the connector</param>
 /// <param name="p_parent">Reference to the parent NodeGraphNode</param>
 /// <param name="p_ConnectorType">Type of the connector (input/output)</param>
 /// <param name="p_ConnectorIndex">Connector Index</param>
 public NodeGraphConnector(string p_Name, NodeGraphNode p_parent, ConnectorType p_ConnectorType, int p_ConnectorIndex, string p_NodeGraphDataTypeName)
 {
     this.m_Name            = p_Name;
     this.m_oParentNode     = p_parent;
     this.m_oView           = p_parent.ParentView;
     this.m_oConnectorType  = p_ConnectorType;
     this.m_iConnectorIndex = p_ConnectorIndex;
     this.m_oDataType       = p_parent.ParentView.KnownDataTypes[p_NodeGraphDataTypeName];
 }
コード例 #2
0
ファイル: NodeGraphLink.cs プロジェクト: ywscr/NodeGraph
        /// <summary>
        /// SERIALIZATION: Creates a NodeGraphLink, given an XML Serialized copy of the link and a view
        /// </summary>
        /// <param name="p_TreeNode"></param>
        /// <param name="p_View"></param>
        public NodeGraphLink(XmlTreeNode p_TreeNode, NodeGraphView p_View)
        {
            int v_InputNodeId            = int.Parse(p_TreeNode.m_attributes["InputNodeId"]);
            int v_OutputNodeId           = int.Parse(p_TreeNode.m_attributes["OutputNodeId"]);
            int v_InputNodeConnectorIdx  = int.Parse(p_TreeNode.m_attributes["InputNodeConnectorIdx"]);
            int v_OutputNodeConnectorIdx = int.Parse(p_TreeNode.m_attributes["OutputNodeConnectorIdx"]);

            this.m_InputConnector    = p_View.NodeCollection[v_InputNodeId].Connectors[v_InputNodeConnectorIdx];
            this.m_OutputConnector   = p_View.NodeCollection[v_OutputNodeId].Connectors[v_OutputNodeConnectorIdx];
            this.m_NodeGraphDataType = p_View.NodeCollection[v_InputNodeId].Connectors[v_InputNodeConnectorIdx].DataType;
        }
コード例 #3
0
ファイル: NodeGraphLink.cs プロジェクト: ywscr/NodeGraph
 /// <summary>
 /// Creates a new NodeGraphLink, given input and output Connectors
 /// </summary>
 /// <param name="p_Input"></param>
 /// <param name="p_Output"></param>
 public NodeGraphLink(NodeGraphConnector p_Input, NodeGraphConnector p_Output, NodeGraphDataType p_DataType)
 {
     this.m_InputConnector    = p_Input;
     this.m_OutputConnector   = p_Output;
     this.m_NodeGraphDataType = p_DataType;
 }
コード例 #4
0
ファイル: NodeGraphView.cs プロジェクト: ywscr/NodeGraph
 /// <summary>
 /// Registers a new NodeGraphDataType into KnownDataTypes
 /// </summary>
 /// <param name="p_DataType"></param>
 public void RegisterDataType(NodeGraphDataType p_DataType)
 {
     this.m_KnownDataTypes.Add(p_DataType.ToString(), p_DataType);
 }