Пример #1
0
 public void Request(int startX, int startZ, int width, int height,
                     INumberConnection numberSampler, OutputSocket numberSamplerRequestSocket,
                     IColorConnection colorSampler = null, OutputSocket colorSamplerOutSocket = null)
 {
     _startX        = startX;
     _startZ        = startZ;
     _numberSampler = numberSampler;
     _numberSamplerRequestSocket = numberSamplerRequestSocket;
     _samplerColor = colorSampler;
     _colorSamplerRequestSocket = colorSamplerOutSocket;
     _values = new float[width, height];
     Width   = width;
     Height  = height;
 }
Пример #2
0
        public static float GetInputNumber(InputSocket socket, Request request)
        {
            if (socket.IsInDirectInputMode())
            {
                return(socket.GetDirectInputNumber());
            }
            if (!socket.IsConnected())
            {
                return(float.NaN);
            }
            INumberConnection sampler = socket.GetConnectedSocket().Parent as INumberConnection;

            if (sampler == null)
            {
                return(float.NaN);
            }
            return(sampler.GetNumber(socket.GetConnectedSocket(), request));
        }