private static HeightFieldGenerator ConvEnumToInstance(ConvolutionImplementation implementation) { HeightFieldGenerator heightFieldGenerator; switch (implementation) { case CONV_GPU_1D: { throw new NotImplementedException(); } case CONV_GPU_2D: { heightFieldGenerator = new Convolution2DFastHeightFieldGenerator(); } break; case CONV_CPU_1D: { throw new NotImplementedException(); } case CONV_CPU_2D: { heightFieldGenerator = new GPUConvolution2DFastHeightFieldGenerator(); } break; default: { throw new NotImplementedException(); } } return(heightFieldGenerator); }
public void SetConvolutionImplementation(ConvolutionImplementation implementation) { if (implementation == _convolutionImplementationChoice) { return; } _heightFieldGenerator = ConvEnumToInstance(_convolutionImplementationChoice); _heightFieldGenerator.Initialise(_extendedHeightField.heightFieldInfo, _particleContainer); }