Beispiel #1
0
        //TODO RollRange for outside bounds
        public IMaterialProvider SliceSimple(int index, SimpleSliceMode sliceMode)
        {
            switch (sliceMode)
            {
            case SimpleSliceMode.Gradient:
                var materialSet1 = MaterialSetSequence[index];
                var materialSet2 = MaterialSetSequence[index + 1];

                return(new GradientMaterialProvider(new List <GradientMaterialStop>
                {
                    new GradientMaterialStop(materialSet1),
                    new GradientMaterialStop(materialSet2, 0)
                }));

            case SimpleSliceMode.Literal:
                var materialSet = MaterialSetSequence[index];

                return(new LiteralMaterialProvider(materialSet));

            default:
                throw new InvalidEnumArgumentException();
            }
        }
        //TODO RollRange for outside bounds
        //TODO redo this system.
        public IMaterialProvider SliceSimple(int index, SimpleSliceMode sliceMode)
        {
            switch (sliceMode)
            {
            case SimpleSliceMode.Gradient:
                var gradientStop1 = GradientStepData[index].MaterialSet;
                var gradientStop2 = GradientStepData[index + 1].MaterialSet;

                return(new GradientMaterialProvider(new List <GradientMaterialStop>
                {
                    new GradientMaterialStop(gradientStop1),
                    new GradientMaterialStop(gradientStop2, 0)
                }));

            case SimpleSliceMode.Literal:
                var gradientStop = GradientStepData[index].MaterialSet;

                return(new LiteralMaterialProvider(gradientStop));

            default:
                throw new InvalidEnumArgumentException();
            }
        }
Beispiel #3
0
 public IMaterialProvider SliceSimple(int index, SimpleSliceMode sliceMode)
 {
     return(this);
 }
 public IMaterialProvider SliceSimple(int index, SimpleSliceMode sliceMode)
 {
     throw new NotSupportedException(
               "SliceSimple cannot be used on a IDataAwareMaterialProvider.");
 }