示例#1
0
        public override string GCode_GetTypeString(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context)
        {
            if (InputLinkX.HasLink)
            {
                return(InputLinkX.GetLinkedObject(0, true).GCode_GetTypeString(InputLinkX.GetLinkedPinControl(0, true), context));
            }

            return(base.GCode_GetTypeString(element, context));
        }
示例#2
0
        public override string GCode_GetValueName(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context)
        {
            string strInputValueNameX;
            string strInputValueNameY;
            string strInputValueNameAlpha;
            string strFinalInputValueNameAlpha;

            if (InputLinkX.HasLink && InputLinkY.HasLink && InputLinkAlpha.HasLink)
            {
                strInputValueNameX     = InputLinkX.GetLinkedObject(0, true).GCode_GetValueName(InputLinkX.GetLinkedPinControl(0, true), context);
                strInputValueNameY     = InputLinkY.GetLinkedObject(0, true).GCode_GetValueName(InputLinkY.GetLinkedPinControl(0, true), context);
                strInputValueNameAlpha = InputLinkAlpha.GetLinkedObject(0, true).GCode_GetValueName(InputLinkAlpha.GetLinkedPinControl(0, true), context);

                strFinalInputValueNameAlpha = strInputValueNameAlpha;
                switch (InputLinkX.GetLinkedObject(0, true).GCode_GetTypeString(InputLinkX.GetLinkedPinControl(0, true), context))
                {
                case "float4":
                {
                    strFinalInputValueNameAlpha = "float4(" + strInputValueNameAlpha + "," + strInputValueNameAlpha + "," + strInputValueNameAlpha + "," + strInputValueNameAlpha + ")";
                }
                break;

                case "float3":
                {
                    strFinalInputValueNameAlpha = "float3(" + strInputValueNameAlpha + "," + strInputValueNameAlpha + "," + strInputValueNameAlpha + ")";
                }
                break;

                case "float2":
                {
                    strFinalInputValueNameAlpha = "float2(" + strInputValueNameAlpha + "," + strInputValueNameAlpha + ")";
                }
                break;
                }

                return("lerp(" + strInputValueNameX + "," + strInputValueNameY + "," + strFinalInputValueNameAlpha + ")");
            }

            return(base.GCode_GetValueName(element, context));
        }