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)); }
public override void GCode_GenerateCode(ref string strDefinitionSegment, ref string strSegment, int nLayer, CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context) { if (InputLinkX.HasLink) { InputLinkX.GetLinkedObject(0, true).GCode_GenerateCode(ref strDefinitionSegment, ref strSegment, nLayer, element, context); } if (InputLinkY.HasLink) { InputLinkY.GetLinkedObject(0, true).GCode_GenerateCode(ref strDefinitionSegment, ref strSegment, nLayer, element, context); } if (InputLinkAlpha.HasLink) { InputLinkAlpha.GetLinkedObject(0, true).GCode_GenerateCode(ref strDefinitionSegment, ref strSegment, nLayer, element, context); } }
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)); }