Exemple #1
0
        public void Evaluate(int SpreadMax)
        {
            //int i = this.FShapesIn.SliceCount;
//			bool allconnected = true;
//			int maxslice = int.MinValue;
//			for (int i = 0; i < this.FShapesIn.SliceCount; i++)
//			{
//				if (((InputPin<AbstractRigidShapeDefinition>)this.FShapesIn[0]).PluginIO.IsConnected)
//				{
//					maxslice = this.FShapesIn[i].SliceCount > maxslice ? this.FShapesIn[i].SliceCount : maxslice;
//					if (this.FShapesIn[i].SliceCount == 0) { allconnected = false; }
//				}
//				else
//				{
//					allconnected = false;
//				}
//			}
            this.FShapesOut.SliceCount = FShapesIn.GetMaxSliceCount();

//			if (allconnected)
//			{
//				this.FShapesOut.SliceCount = maxslice;

            for (int i = 0; i < this.FShapesOut.SliceCount; i++)
            {
                List <AbstractRigidShapeDefinition> childs = new List <AbstractRigidShapeDefinition>();

                for (int j = 0; j < this.FShapesIn.SliceCount; j++)
                {
                    childs.Add(this.FShapesIn[j][i]);
                    //childs.Add(this.FShapes2[i]);
                }

                CompoundShapeDefinition def = new CompoundShapeDefinition(childs);
                this.FShapesOut[i] = def;
            }
//			}
//			else
//			{
//				this.FShapesOut.SliceCount = 0;
//			}
        }
Exemple #2
0
 /// <summary>
 /// Takes the max slice count of the input spreads, multiplies it with the slice count of the
 /// outer spread and assigns it to the output spread.
 /// </summary>
 /// <param name="outputSpread">The spread to set the slice count on.</param>
 /// <param name="inputSpreads">The spread of spreads to use for the slice count computation.</param>
 public static void SetSliceCountBy <T>(this ISpread <T> outputSpread, ISpread <ISpread <T> > inputSpreads)
 {
     outputSpread.SliceCount = inputSpreads.GetMaxSliceCount() * inputSpreads.SliceCount;
 }