Пример #1
0
        /// <summary>
        /// CONVERSION: 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(ConnectionDescriptor connection, NodeGraphView p_View)
        {
            int v_InputNodeId            = connection.sourceModule;
            int v_OutputNodeId           = connection.destinationModule;
            int v_InputNodeConnectorIdx  = connection.sourcePort;
            int v_OutputNodeConnectorIdx = connection.destinationPort;

            if (v_InputNodeId != 0x0FFFFFFF)
            {
                //this.m_InputConnector = p_View.NodeCollection[v_InputNodeId].Connectors[v_InputNodeConnectorIdx];
                this.m_InputConnector = p_View.NodeCollection[v_InputNodeId].GetConnector(v_InputNodeConnectorIdx, ConnectorType.OutputConnector);
            }
            else
            {
                this.m_InputConnector = p_View.NodeConnectorCollection[v_InputNodeConnectorIdx];
            }

            if (v_OutputNodeId != 0x0FFFFFFF)
            {
                //this.m_OutputConnector = p_View.NodeCollection[v_OutputNodeId].Connectors[v_OutputNodeConnectorIdx];
                this.m_OutputConnector = p_View.NodeCollection[v_OutputNodeId].GetConnector(v_OutputNodeConnectorIdx, ConnectorType.InputConnector);
            }
            else
            {
                this.m_OutputConnector = p_View.NodeConnectorCollection[v_OutputNodeConnectorIdx];
            }
        }
Пример #2
0
 /// <summary>
 /// Creates a new NodeGraphConnector, given a name, a parent container, type and index
 /// </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)
 {
     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;
 }
Пример #3
0
 public AbsNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     this.m_sName = "Abs(A)";
     this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0));
     this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0));
     this.Height = 45;
 }
Пример #4
0
 public NodeGraphConnector(EndpointDescriptor descriptor, NodeGraphNode p_parent, ConnectorType type)
 {
     this.m_Name = String.Empty;
     this.m_oParentNode = p_parent;
     this.m_oView = p_parent.ParentView;
     this.m_oConnectorType = type;
     this.m_iConnectorIndex = descriptor.index;
 }
Пример #5
0
        public NodeGraphConnector(EndpointDescriptor descriptor, NodeGraphView p_view, ConnectorType type)
        {
            this.m_Name        = String.Empty;
            this.m_oParentNode = null;

            this.m_oView           = p_view;
            this.m_oConnectorType  = type;
            this.m_iConnectorIndex = descriptor.index;
        }
Пример #6
0
 /// <summary>
 /// Creates a new NodeGraphConnector, given a name, a parent container, type and index
 /// </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)
 {
     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["Generic"];
 }
Пример #7
0
 /// <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];
 }
Пример #8
0
        public AbsNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
            : base(p_X, p_Y, p_View, p_CanBeSelected)
        {
            this.m_sName = "Abs(A)";
            this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("Result", this, ConnectorType.OutputConnector, 0));
            this.Height = 45;

        }
Пример #9
0
 public DivideNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     this.m_sName = "A/B";
     this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0));
     this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1));
     this.m_Connectors.Add(new NodeGraphConnector("Result (A/B)", this, ConnectorType.OutputConnector, 0));
     this.Height = 64;
 }
Пример #10
0
 public ReferenceRoot(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     this.m_sName = "Output";
     this.m_Connectors.Add(new NodeGraphConnector("Result 1", this, ConnectorType.InputConnector, 0));
     this.m_Connectors.Add(new NodeGraphConnector("Result 2", this, ConnectorType.InputConnector, 1));
     this.m_Connectors.Add(new NodeGraphConnector("Result 3", this, ConnectorType.InputConnector, 2));
     this.Height = 86;
 }
Пример #11
0
        public NodeGraphConnector(EndpointDescriptor descriptor, NodeGraphView p_view, ConnectorType type)
        {
            this.m_Name = String.Empty;
            this.m_oParentNode = null;

            this.m_oView = p_view;
            this.m_oConnectorType = type;
            this.m_iConnectorIndex = descriptor.index;
        }
Пример #12
0
        /// <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];
        }
Пример #13
0
        public DivideNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
            : base(p_X, p_Y, p_View, p_CanBeSelected)
        {
            this.m_sName = "A/B";
            this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1));
            this.m_Connectors.Add(new NodeGraphConnector("Result (A/B)", this, ConnectorType.OutputConnector, 0));
            this.Height = 64;

        }
Пример #14
0
 public FloatConstNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     this.m_sName = "Float: NAN";
     this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0));
     this.Width = 80;
     this.Height = 45;
     this.Value = 0.0f;
    
 }
Пример #15
0
        /// <summary>
        /// CONVERSION: 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(ConnectionDescriptor connection, NodeGraphView p_View)
        {
            int v_InputNodeId = connection.sourceModule;
            int v_OutputNodeId = connection.destinationModule;
            int v_InputNodeConnectorIdx = connection.sourceModule;
            int v_OutputNodeConnectorIdx = connection.sourcePort;

            this.m_InputConnector = p_View.NodeCollection[v_InputNodeId].Connectors[v_InputNodeConnectorIdx];
            this.m_OutputConnector = p_View.NodeCollection[v_OutputNodeId].Connectors[v_OutputNodeConnectorIdx];
        }
Пример #16
0
 public TemplateModule(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     this.m_sName = "TemplateModule";
     this.m_Connectors.Add(new NodeGraphConnector("Input 0", this, ConnectorType.InputConnector, 0));
     this.m_Connectors.Add(new NodeGraphConnector("Input 1", this, ConnectorType.InputConnector, 1));
     this.m_Connectors.Add(new NodeGraphConnector("Output 0", this, ConnectorType.OutputConnector, 0));
     this.m_Connectors.Add(new NodeGraphConnector("Output 1", this, ConnectorType.OutputConnector, 1));
     this.Height = 100;
 }
Пример #17
0
        /// <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];
        }
Пример #18
0
        public ReferenceRoot(int p_X, int p_Y, NodeGraphView p_View)
            : base(p_X, p_Y, p_View, false)
        {
            this.m_sName = "Output";
            this.m_Connectors.Add(new NodeGraphConnector("Result 1", this, ConnectorType.InputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("Result 2", this, ConnectorType.InputConnector, 1));
            this.m_Connectors.Add(new NodeGraphConnector("Result 3", this, ConnectorType.InputConnector, 2));
            this.Height = 86;

        }
Пример #19
0
        public TemplateModule(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
            : base(p_X, p_Y, p_View, p_CanBeSelected)
        {
            this.m_sName = "TemplateModule";
            this.m_Connectors.Add(new NodeGraphConnector("Input 0", this, ConnectorType.InputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("Input 1", this, ConnectorType.InputConnector, 1));
            this.m_Connectors.Add(new NodeGraphConnector("Output 0", this, ConnectorType.OutputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("Output 1", this, ConnectorType.OutputConnector, 1));
            this.Height = 100;

        }
Пример #20
0
 public FloatConstNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
     : base(p_X, p_Y, p_View, p_CanBeSelected)
 {
     this.m_sName = "Float: NAN";
     this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0));
     this.Width = 80;
     this.Height = 45;
     this.Value = 0.0f;
     
     
 }
Пример #21
0
 /// <summary>
 /// SERIALIZATION: Creates a NodeGraphNode from a XML Serialized Copy
 /// </summary>
 /// <param name="p_Input"></param>
 /// <param name="p_View"></param>
 public NodeGraphNode(Xml.XmlTreeNode p_Input, NodeGraphView p_View)
 {
     this.m_oView          = p_View;
     this.m_sName          = p_Input.m_attributes["Name"];
     this.m_sComment       = p_Input.m_attributes["Comment"];
     this.X                = int.Parse(p_Input.m_attributes["X"]);
     this.Y                = int.Parse(p_Input.m_attributes["Y"]);
     this.Width            = int.Parse(p_Input.m_attributes["Width"]);
     this.Height           = int.Parse(p_Input.m_attributes["Height"]);
     this.m_bCanBeSelected = bool.Parse(p_Input.m_attributes["CanBeSelected"]);
     this.m_Connectors     = new List <NodeGraphConnector>();
 }
Пример #22
0
        /// <summary>
        /// STATIC: Deserializes a new NodeGraphNode given a XML Serialized Copy
        /// </summary>
        /// <param name="p_Node"></param>
        /// <param name="p_View"></param>
        /// <returns></returns>
        public static NodeGraphNode DeserializeFromXML(Xml.XmlTreeNode p_Node, NodeGraphView p_View)
        {
            string className = p_Node.m_nodeName;

            object[] arguments = { p_Node, p_View };

            object v_Out = System.Reflection.Assembly.GetEntryAssembly().CreateInstance(className, false,
                                                                                        System.Reflection.BindingFlags.CreateInstance,
                                                                                        null,
                                                                                        arguments, System.Globalization.CultureInfo.GetCultureInfo("fr-fr"),
                                                                                        null);

            return(v_Out as NodeGraphNode);
        }
Пример #23
0
        /// <summary>
        /// SERIALIZATION: Creates a XML Serialized copy of the link
        /// </summary>
        /// <param name="p_XmlParentTreeNode"></param>
        /// <returns></returns>
        public XmlTreeNode SerializeToXML(XmlTreeNode p_XmlParentTreeNode)
        {
            XmlTreeNode v_Out = new XmlTreeNode(SerializationUtils.GetFullTypeName(this), p_XmlParentTreeNode);

            NodeGraphView v_View       = Input.Parent.ParentView;
            NodeGraphNode v_InputNode  = Input.Parent;
            NodeGraphNode v_OutputNode = Output.Parent;

            v_Out.AddParameter("InputNodeId", v_View.GetNodeIndex(v_InputNode).ToString());
            v_Out.AddParameter("OutputNodeId", v_View.GetNodeIndex(v_OutputNode).ToString());
            v_Out.AddParameter("InputNodeConnectorIdx", v_InputNode.GetConnectorIndex(Input).ToString());
            v_Out.AddParameter("OutputNodeConnectorIdx", v_OutputNode.GetConnectorIndex(Output).ToString());

            return(v_Out);
        }
Пример #24
0
        public NodeGraphConnector(EndpointDescriptor descriptor, NodeGraphNode p_parent, ConnectorType type)
        {
            this.m_Name = String.Empty;
            if (p_parent != null)
            {
                this.m_oParentNode = p_parent;
            }
            else
            {
                this.m_oParentNode = null;
            }

            this.m_oView           = p_parent.ParentView;
            this.m_oConnectorType  = type;
            this.m_iConnectorIndex = descriptor.index;
        }
Пример #25
0
        /// <summary>
        /// SERIALIZATION: Creates a NodeGraphLink from XML, used for inherited classes
        /// </summary>
        /// <param name="p_ObjectXml"></param>
        /// <param name="p_View"></param>
        /// <returns></returns>
        public static NodeGraphLink DeserializeFromXML(XmlTreeNode p_ObjectXml, NodeGraphView p_View)
        {
            string className = p_ObjectXml.m_nodeName;

            object[] arguments = { p_ObjectXml, p_View };

            System.Reflection.Assembly v_Assembly = System.Reflection.Assembly.GetExecutingAssembly();

            object v_Out = v_Assembly.CreateInstance(className, false,
                                                     System.Reflection.BindingFlags.CreateInstance,
                                                     null,
                                                     arguments, System.Globalization.CultureInfo.GetCultureInfo("en-us"),
                                                     null);

            return(v_Out as NodeGraphLink);
        }
Пример #26
0
        /// <summary>
        /// Creates a new NodeGraphNode into the NodeGraphView, given coordinates and ability to be selected
        /// </summary>
        /// <param name="p_X"></param>
        /// <param name="p_Y"></param>
        /// <param name="p_View"></param>
        /// <param name="p_CanBeSelected"></param>
        public NodeGraphNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
        {
            this.X                = p_X;
            this.Y                = p_Y;
            this.m_oView          = p_View;
            this.m_Width          = 140;
            this.m_Height         = 64;
            this.m_sName          = "Test Void Node";
            this.m_bCanBeSelected = p_CanBeSelected;
            this.Highlighted      = false;
            this.m_sComment       = "";

            UpdateHitRectangle();

            this.m_Connectors = new List <NodeGraphConnector>();
        }
Пример #27
0
        /// <summary>
        /// EDITOR CONSTRUCTOR: Builds the node.
        /// </summary>
        /// <param name="p_X">X Position (in the view)</param>
        /// <param name="p_Y">Y Position (in the view)</param>
        /// <param name="p_View">NodeGraphView Object that will contain the node</param>
        /// <param name="p_CanBeSelected">if the node can be selected</param>
        public IfNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
            : base(p_X, p_Y, p_View, p_CanBeSelected)
        {
            this.m_sName = "If condition";
            this.m_Connectors.Add(new NodeGraphConnector("A", this, ConnectorType.InputConnector, 0));
            this.m_Connectors.Add(new NodeGraphConnector("B", this, ConnectorType.InputConnector, 1));
            this.m_Connectors.Add(new NodeGraphConnector("A>B", this, ConnectorType.InputConnector, 2));
            this.m_Connectors.Add(new NodeGraphConnector("A=B", this, ConnectorType.InputConnector, 3));
            this.m_Connectors.Add(new NodeGraphConnector("A<B", this, ConnectorType.InputConnector, 4));
            this.m_Connectors.Add(new NodeGraphConnector("Value", this, ConnectorType.OutputConnector, 0));
            this.Height = 110;

            // Sets our members to default values
            this.m_eBehavior = IfNodeBehavior.ErrorOnMissingInput;
            this.m_fDefaultValue = 0.0f;

        }
Пример #28
0
        /// <summary>
        /// CONVERTATION : Creates a NodeGraphNode from a XML Serialized Copy
        /// </summary>
        /// <param name="p_Input"></param>
        /// <param name="p_View"></param>
        public NodeGraphNode(ModuleDescriptor descriptor, NodeGraphView p_View)
        {
            this.m_oView    = p_View;
            this.m_sName    = descriptor.name;
            this.m_sComment = descriptor.description;
            ///! TODO : X,Y ? set later?
            //this.X = ;
            //this.Y = ;
            this.Width            = 80;
            this.Height           = 40;
            this.m_bCanBeSelected = true;
            this.m_Connectors     = new List <NodeGraphConnector>();
            foreach (var inputEndpoint in descriptor.inputEndpoints)
            {
                this.m_Connectors.Add(new NodeGraphConnector(inputEndpoint, this, ConnectorType.InputConnector));
            }

            foreach (var outputEndpoint in descriptor.outputEndpoints)
            {
                this.m_Connectors.Add(new NodeGraphConnector(outputEndpoint, this, ConnectorType.OutputConnector));
            }
        }
Пример #29
0
        /// <summary>
        /// CONVERSION: 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(ConnectionDescriptor connection, NodeGraphView p_View)
        {
            int v_InputNodeId = connection.sourceModule;
            int v_OutputNodeId = connection.destinationModule;
            int v_InputNodeConnectorIdx = connection.sourcePort;
            int v_OutputNodeConnectorIdx = connection.destinationPort;

            if (v_InputNodeId != 0x0FFFFFFF)
            {
                //this.m_InputConnector = p_View.NodeCollection[v_InputNodeId].Connectors[v_InputNodeConnectorIdx];
                this.m_InputConnector = p_View.NodeCollection[v_InputNodeId].GetConnector(v_InputNodeConnectorIdx, ConnectorType.OutputConnector);
            }
            else
                this.m_InputConnector = p_View.NodeConnectorCollection[v_InputNodeConnectorIdx];

            if (v_OutputNodeId != 0x0FFFFFFF)
            {
                //this.m_OutputConnector = p_View.NodeCollection[v_OutputNodeId].Connectors[v_OutputNodeConnectorIdx];
                this.m_OutputConnector = p_View.NodeCollection[v_OutputNodeId].GetConnector(v_OutputNodeConnectorIdx, ConnectorType.InputConnector);
            }
            else
                this.m_OutputConnector = p_View.NodeConnectorCollection[v_OutputNodeConnectorIdx];
        }
Пример #30
0
        /// <summary>
        /// Creates a UserControl component that displays NodeGraphViews and let interact with NodeGraphNodes & NodeGraphLinks
        /// </summary>
        public NodeGraphPanel()
        {
            InitializeComponent();

            this.m_oView = new NodeGraphView(this);
            this.m_oDebugFont = new Font("Tahoma", 8.0f);
            this.m_ScrollMargins = 32;
            this.m_ScrollMarginsValue = 10;
            this.m_eEditMode = NodeGraphEditMode.Idle;
            this.m_ViewSpaceCursorLocation = new Point();
            this.m_bAltPressed = false;
            this.m_bCtrlPressed = false;
            this.m_NodeText = new SolidBrush(Color.White);
            this.m_NodeTextShadow = new SolidBrush(Color.Black);
            this.NodeTitleZoomThreshold = 0.5f;
            this.NodeConnectorTextZoomTreshold = 0.8f;
            this.NodeHeaderSize = 24;
            this.NodeTextColor = Color.FromArgb(255, 255, 255, 255);
            this.NodeTextShadowColor = Color.FromArgb(128, 0, 0, 0);
            this.NodeFillColor = Color.FromArgb(255, 128, 128, 128);
            this.NodeFillSelectedColor = Color.FromArgb(255, 160, 128, 100);
            this.NodeOutlineColor = Color.FromArgb(255, 180, 180, 180);
            this.NodeOutlineSelectedColor = Color.FromArgb(255, 192, 160, 128);
            this.ConnectorTextColor = Color.FromArgb(255, 64, 64, 64);
            this.ConnectorFillColor = Color.FromArgb(255, 0, 0, 0);
            this.ConnectorFillSelectedColor = Color.FromArgb(255, 32, 32, 32);
            this.ConnectorOutlineColor = Color.FromArgb(255, 32, 32, 32);
            this.ConnectorOutlineSelectedColor = Color.FromArgb(255, 64, 64, 64);
            this.SelectionFillColor = Color.FromArgb(64, 128, 90, 30);
            this.SelectionOutlineColor = Color.FromArgb(192, 255, 180, 60);
            this.NodeHeaderColor = Color.FromArgb(128, 0, 0, 0);
            this.LinkColor = Color.FromArgb(255, 180, 180, 180);
            this.LinkEditableColor = Color.FromArgb(255, 64, 255, 0);
            this.NodeSignalValidColor = Color.FromArgb(255, 0, 255, 0);
            this.NodeSignalInvalidColor = Color.FromArgb(255, 255, 0, 0);
            this.m_NodeTitleFont = new Font("Tahoma", 8.0f);
            this.m_NodeConnectorFont = new Font("Tahoma", 7.0f);
            this.m_NodeScaledTitleFont = new Font(m_NodeTitleFont.Name, m_NodeTitleFont.Size);
            this.m_NodeScaledConnectorFont = new Font(m_NodeConnectorFont.Name, m_NodeConnectorFont.Size);
            this.m_LinkVisualStyle = LinkVisualStyle.Curve;
            this.ConnectorHitZoneBleed = 2;
            this.m_SelectBoxOrigin = new Point();
            this.m_SelectBoxCurrent = new Point();
            this.LinkHardness = 2.0f;
            this.m_iScrollLastX = 0;
            this.m_iScrollLastY = 0;
            this.EnableDrawDebug = true;
            this.Dock = DockStyle.Fill;
            this.DoubleBuffered = true;
            this.m_InputLink = null;
            this.m_OutputLink = null;
            this.m_bShowGrid = false;
            this.m_iGridPadding = 256;
            this.m_iGridAlpha = 32;
            this.m_bDrawShadow = true;
            this.m_bSmoothBehavior = false;
        }
Пример #31
0
 public TextureConstNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
     : base(p_X, p_Y, p_View, p_CanBeSelected)
 {
     Setup();
 }
Пример #32
0
 public TextureConstNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     Setup();
     Value = p_TreeNode.m_attributes["Value"];
 }
Пример #33
0
        internal static NodeGraphLink FromConnectionDescriptor(ConnectionDescriptor connection, NodeGraphView nodeGraphView)
        {
//             string className = typeof(NodeGraphLink).Name;
// 
//             object[] arguments = { connection, nodeGraphView};
// 
//             System.Reflection.Assembly v_Assembly = System.Reflection.Assembly.GetExecutingAssembly();
// 
//             object v_Out = v_Assembly.CreateInstance(className, false,
//                                                     System.Reflection.BindingFlags.CreateInstance,
//                                                     null,
//                                                     arguments, System.Globalization.CultureInfo.GetCultureInfo("en-us"),
//                                                     null);
//                                                     
            return new NodeGraphLink(connection, nodeGraphView);
        }
Пример #34
0
        /// <summary>
        /// STATIC: Deserializes a new NodeGraphNode given a XML Serialized Copy
        /// </summary>
        /// <param name="p_Node"></param>
        /// <param name="p_View"></param>
        /// <returns></returns>
        public static NodeGraphNode DeserializeFromXML(Xml.XmlTreeNode p_Node, NodeGraphView p_View)
        {
            string className = p_Node.m_nodeName;

            object[] arguments = { p_Node, p_View };

            object v_Out = ReflectionHelper.CreateInstance(className, arguments);

            return v_Out as NodeGraphNode;
        }
Пример #35
0
 /// <summary>
 /// SERIALIZATION: Creates a NodeGraphNode from a XML Serialized Copy
 /// </summary>
 /// <param name="p_Input"></param>
 /// <param name="p_View"></param>
 public NodeGraphNode(Xml.XmlTreeNode p_Input, NodeGraphView p_View)
 {
     this.m_oView = p_View;
     this.m_sName = p_Input.m_attributes["Name"];
     this.m_sComment = p_Input.m_attributes["Comment"];
     this.X = int.Parse(p_Input.m_attributes["X"]);
     this.Y = int.Parse(p_Input.m_attributes["Y"]);
     this.Width = int.Parse(p_Input.m_attributes["Width"]);
     this.Height = int.Parse(p_Input.m_attributes["Height"]);
     this.m_bCanBeSelected = bool.Parse(p_Input.m_attributes["CanBeSelected"]);
     this.m_Connectors = new List<NodeGraphConnector>();
 }
Пример #36
0
 public FloatLerpNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
     : base(p_X, p_Y, p_View, p_CanBeSelected)
 {
     Setup();
 }
Пример #37
0
 public FloatLerpNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     Setup();
 }
Пример #38
0
        public static NodeGraphNode FromModuleDescriptor(NuiApiWrapper.ModuleDescriptor module, NodeGraphView p_View)
        {
//             string className = typeof(NodeGraphNode).Name;
//
//             object[] arguments = { module, p_View };
//
//             object v_Out = System.Reflection.Assembly.GetEntryAssembly().CreateInstance(className, false,
//                                                                                     System.Reflection.BindingFlags.CreateInstance,
//                                                                                     null,
//                                                                                     arguments, System.Globalization.CultureInfo.GetCultureInfo("fr-fr"),
//                                                                                     null);

            return(new NodeGraphNode(module, p_View));
        }
Пример #39
0
        /// <summary>
        /// SERIALIZATION: Creates a NodeGraphLink from XML, used for inherited classes
        /// </summary>
        /// <param name="p_ObjectXml"></param>
        /// <param name="p_View"></param>
        /// <returns></returns>
        public static NodeGraphLink DeserializeFromXML(XmlTreeNode p_ObjectXml, NodeGraphView p_View)
        {
            string className = p_ObjectXml.m_nodeName;

            object[] arguments = { p_ObjectXml, p_View };

            System.Reflection.Assembly v_Assembly = System.Reflection.Assembly.GetExecutingAssembly();

            object v_Out = v_Assembly.CreateInstance(className, false,
                                                    System.Reflection.BindingFlags.CreateInstance,
                                                    null,
                                                    arguments, System.Globalization.CultureInfo.GetCultureInfo("en-us"),
                                                    null);

            return v_Out as NodeGraphLink;
        }
Пример #40
0
 /// <summary>
 ///  SERIALIZATION: Loads a serialized XML Copy into the current view
 /// </summary>
 /// <param name="p_FileName"></param>
 public void LoadCurrentView(string p_FileName)
 {
     try
     {
         Xml.XmlTree v_InTree = new Xml.XmlTree("NodeGraphControl");
         v_InTree.LoadXML(p_FileName);
         this.View = new NodeGraphView(v_InTree.m_rootNode.GetFirstChild(Xml.SerializationUtils.GetFullTypeName(this.View)), this);
         this.UpdateFontSize();
         this.Refresh();
     }catch{
        // ERROR loading View
     }
 }
Пример #41
0
 public void LoadPipeline(PipelineDescriptor descriptor)
 {
     this.View = new NodeGraphView(descriptor, this);
     this.View.SelectedItems.Clear();
     this.UpdateFontSize();
     this.Refresh();
 }
Пример #42
0
        /// <summary>
        /// Creates a new NodeGraphNode into the NodeGraphView, given coordinates and ability to be selected
        /// </summary>
        /// <param name="p_X"></param>
        /// <param name="p_Y"></param>
        /// <param name="p_View"></param>
        /// <param name="p_CanBeSelected"></param>
        public NodeGraphNode(int p_X, int p_Y, NodeGraphView p_View, bool p_CanBeSelected)
        {
            this.X = p_X;
            this.Y = p_Y;
            this.m_oView = p_View;
            this.m_Width = 140;
            this.m_Height = 64;
            this.m_sName = "Test Void Node";
            this.m_bCanBeSelected = p_CanBeSelected;
            this.Highlighted = false;
            this.m_sComment = "";

            UpdateHitRectangle();

            this.m_Connectors = new List<NodeGraphConnector>();
        }
Пример #43
0
 public Vector4ConstNode(XmlTreeNode p_TreeNode, NodeGraphView p_View)
     : base(p_TreeNode, p_View)
 {
     Setup();
     Value = Common.StringConverter.Parse<Vector4>(p_TreeNode.m_attributes["Value"]);
 }
Пример #44
0
        internal static NodeGraphLink FromConnectionDescriptor(ConnectionDescriptor connection, NodeGraphView nodeGraphView)
        {
//             string className = typeof(NodeGraphLink).Name;
//
//             object[] arguments = { connection, nodeGraphView};
//
//             System.Reflection.Assembly v_Assembly = System.Reflection.Assembly.GetExecutingAssembly();
//
//             object v_Out = v_Assembly.CreateInstance(className, false,
//                                                     System.Reflection.BindingFlags.CreateInstance,
//                                                     null,
//                                                     arguments, System.Globalization.CultureInfo.GetCultureInfo("en-us"),
//                                                     null);
//
            return(new NodeGraphLink(connection, nodeGraphView));
        }