Esempio n. 1
0
        public static IValueIn CreateValueInput(this IPluginHost host, InputAttribute attribute, Type type)
        {
            attribute = NormalizePinAttribute(attribute, type);

            IValueIn result = null;

            host.CreateValueInput(attribute.Name, attribute.Dimension, attribute.DimensionNames, (TSliceMode)attribute.SliceMode, (TPinVisibility)attribute.Visibility, out result);
            switch (attribute.Dimension)
            {
            case 2:
                result.SetSubType2D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            case 3:
                result.SetSubType3D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            case 4:
                result.SetSubType4D(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValues[0], attribute.DefaultValues[1], attribute.DefaultValues[2], attribute.DefaultValues[3], attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;

            default:
                result.SetSubType(attribute.MinValue, attribute.MaxValue, attribute.StepSize, attribute.DefaultValue, attribute.IsBang, attribute.IsToggle, attribute.AsInt);
                break;
            }
            result.Order        = attribute.Order;
            result.AutoValidate = attribute.AutoValidate;
            return(result);
        }
Esempio n. 2
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Input ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FMyValueInput);
            FMyValueInput.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);

            //create outputs
            FHost.CreateValueOutput("Output ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FMyValueOutput);
            FMyValueOutput.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);
        }
Esempio n. 3
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Vertices ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInVertices);
            FPinInVertices.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);
            FHost.CreateValueInput("Center ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInCenter);
            FPinInCenter.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);
            FHost.CreateValueInput("Radius ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinInRadius);
            FPinInRadius.SetSubType(0.01, double.MaxValue, 0.01, 1, false, false, false);

            //create outputs
            FHost.CreateValueOutput("Value Output", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPinOutVertices);
            FPinOutVertices.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);
        }
Esempio n. 4
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Input ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPositionInput);
            FPositionInput.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);

            FHost.CreateValueInput("Front Upper Left ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV010Input);
            FV010Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Front Upper Right ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV110Input);
            FV110Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Front Lower Right ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV100Input);
            FV100Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Front Lower Left ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV000Input);
            FV000Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Back Upper Left ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV011Input);
            FV011Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Back Upper Right ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV111Input);
            FV111Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Back Lower Right ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV101Input);
            FV101Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Back Lower Left ", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FV001Input);
            FV001Input.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Vector Size", 1, null, TSliceMode.Single, TPinVisibility.True, out FVectorSizeInput);
            FVectorSizeInput.SetSubType(double.MinValue, double.MaxValue, 1, 1, false, false, true);

            //create outputs
            FHost.CreateValueOutput("Output", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FPositionOutput);
            FPositionOutput.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.5, false, false, false);
        }
Esempio n. 5
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs
            FHost.CreateValueInput("Input", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FInput);
            FInput.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);

            FHost.CreateValueInput("Radius", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FRadius);
            FRadius.SetSubType(double.MinValue, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Factor", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FFactor);
            FFactor.SetSubType(0, 1, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Spread Count", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FSpreadCount);
            FSpreadCount.SetSubType(0, int.MaxValue, 1, 1, false, false, true);

            //create outputs
            FHost.CreateValueOutput("Output", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FOutput);
            FOutput.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0, 0, 0, false, false, false);
        }
Esempio n. 6
0
        //this method is called by vvvv when the node is created
        public void SetPluginHost(IPluginHost Host)
        {
            //assign host
            FHost = Host;

            //create inputs:
            System.Diagnostics.Debug.WriteLine("Create Pins");
            //origin
            FHost.CreateValueInput("Origin ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FInitPositionsIn);
            System.Diagnostics.Debug.WriteLine("First Pin created");

            FInitPositionsIn.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);
            System.Diagnostics.Debug.WriteLine("subtype set");

            //direction
            FHost.CreateValueInput("Direction ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FVelDirectionIn);
            FVelDirectionIn.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);

            FHost.CreateValueInput("Direction Deviation ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FVelDeviationIn);
            FVelDeviationIn.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);

            //acceleration
            FHost.CreateValueInput("Acceleration ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FAccDirectionIn);
            FAccDirectionIn.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);

            FHost.CreateValueInput("Acceleration Deviation ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FAccDeviationIn);
            FAccDeviationIn.SetSubType3D(double.MinValue, double.MaxValue, 0.01, 0.5, 0.5, 0.5, false, false, false);

            //mass
            FHost.CreateValueInput("Mass", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FMassIn);
            FMassIn.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.5, false, false, false);

            FHost.CreateValueInput("Mass Deviation", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FMassDeviationIn);
            FMassDeviationIn.SetSubType(double.MinValue, double.MaxValue, 0.01, 0.5, false, false, false);

            //lifetime
            FHost.CreateValueInput("Lifetime", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FLifetimeIn);
            FLifetimeIn.SetSubType(0, double.MaxValue, 0.01, 1, false, false, false);

            FHost.CreateValueInput("Lifetime Deviation", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FLifetimeDeviationIn);
            FLifetimeDeviationIn.SetSubType(0, double.MaxValue, 0.01, 1, false, false, false);

            //force interaction
            FHost.CreateValueInput("Is Influenced", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FIsInfluencedIn);
            FIsInfluencedIn.SetSubType(0, 1, 1, 0, false, true, false);

            FHost.CreateValueInput("Influence Amount", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FInfluenceAmountIn);
            FInfluenceAmountIn.SetSubType(0, 1, 0.01, 0, false, false, false);

            FHost.CreateValueInput("Influence", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FInfluenceIn);
            FInfluenceIn.SetSubType(0, 1, 1, 0, false, true, false);

            //timebase
            FHost.CreateValueInput("Timestep", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FdtIn);
            FdtIn.SetSubType(double.MinValue, double.MaxValue, 0.001, 0.01, false, false, false);

            //create new particles
            FHost.CreateValueInput("Emit", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FEmitIn);
            FEmitIn.SetSubType(0, 1, 1, 0, false, true, false);


            //create outputs
            FHost.CreateValueOutput("Positions ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FPosOut);
            FPosOut.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueOutput("Heading ", 3, null, TSliceMode.Dynamic, TPinVisibility.True, out FHeadingOut);
            FHeadingOut.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueOutput("Age", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FAgeOut);
            FAgeOut.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, false);

            FHost.CreateValueOutput("Spread Counts", 1, null, TSliceMode.Dynamic, TPinVisibility.True, out FSpreadCountsOut);
            FSpreadCountsOut.SetSubType(double.MinValue, double.MaxValue, 0.01, 0, false, false, true);


            FParticleSystemsList = new ArrayList();
        }