public bool CheckInputSize()
		{
			bool noInput = false;
			if (FInputPin.SliceCount == 0)
				noInput = true;
			else if (FInputPin[0] == null)
				noInput = true;

			if (noInput)
			{
				if (FInput.SliceCount == 0)
					return false;
				else
				{
					FInput.SliceCount = 0;
					return true;
				}
			}

			bool changed = false;
			if (FInput.SliceCount != FInputPin.SliceCount)
			{
				changed = true;

				//add
				for (int iAdd = FInput.SliceCount; iAdd < FInputPin.SliceCount; iAdd++)
				{
					CVImageInput add = new CVImageInput();
					if (FInputPin[iAdd] != null)
						add.Connect(FInputPin[iAdd]);
					FInput.Add(add);
				}

				//remove
				if (FInput.SliceCount != FInputPin.SliceCount)
				{
					for (int iDispose = FInputPin.SliceCount; iDispose < FInput.SliceCount; iDispose++)
					{
						FInput[iDispose].Dispose();
					}

					FInput.SliceCount = FInputPin.SliceCount;
				}
			}

			for (int i = 0; i < FInput.SliceCount; i++)
				if (!FInput[i].ConnectedTo(FInputPin[i]))
				{
					changed = true;
					FInput[i].Connect(FInputPin[i]);
				}

			return changed;
		}
예제 #2
0
        public bool CheckInputSize()
        {
            bool noInput = false;

            if (FInputPin.SliceCount == 0)
            {
                noInput = true;
            }
            else if (FInputPin[0] == null)
            {
                noInput = true;
            }

            if (noInput)
            {
                if (FInput.SliceCount == 0)
                {
                    return(false);
                }
                else
                {
                    FInput.SliceCount = 0;
                    return(true);
                }
            }

            bool changed = false;

            if (FInput.SliceCount != FInputPin.SliceCount)
            {
                changed = true;

                //add
                for (int iAdd = FInput.SliceCount; iAdd < FInputPin.SliceCount; iAdd++)
                {
                    CVImageInput add = new CVImageInput();
                    if (FInputPin[iAdd] != null)
                    {
                        add.Connect(FInputPin[iAdd]);
                    }
                    FInput.Add(add);
                }

                //remove
                if (FInput.SliceCount != FInputPin.SliceCount)
                {
                    for (int iDispose = FInputPin.SliceCount; iDispose < FInput.SliceCount; iDispose++)
                    {
                        FInput[iDispose].Dispose();
                    }

                    FInput.SliceCount = FInputPin.SliceCount;
                }
            }

            for (int i = 0; i < FInput.SliceCount; i++)
            {
                if (!FInput[i].ConnectedTo(FInputPin[i]))
                {
                    changed = true;
                    FInput[i].Connect(FInputPin[i]);
                }
            }

            return(changed);
        }