Beispiel #1
0
        // Memoizing constructor
        public static ClipRangeStrategy Create(double min, double max)
        {
            // TODO: This method may require synchronisation for the static instances
            Pair <double, double> key = new Pair <double, double>(min, max);

            if (instances.ContainsKey(key))
            {
                return(instances[key]);
            }
            ClipRangeStrategy instance = new ClipRangeStrategy(min, max);

            instances.Add(key, instance);
            return(instance);
        }
Beispiel #2
0
 private AbstractRangeStrategy MaxHeaveRangeStrategy(Grid2DDomain domain)
 {
     return(ClipRangeStrategy.Create(MinMaxHeave(domain), MaxMaxHeave(domain)));
 }
Beispiel #3
0
 private AbstractRangeStrategy DetachDepthRangeStrategy(Grid2DDomain domain)
 {
     return(ClipRangeStrategy.Create(MinDetachDepth(domain), MaxDetachDepth(domain)));
 }
Beispiel #4
0
        private AbstractRangeStrategy YRangeStrategy(Grid2DDomain domain)
        {
            double border = Border(domain);

            return(ClipRangeStrategy.Create(domain.Min.Y - border, domain.Max.Y + border));
        }
Beispiel #5
0
 private AbstractRangeStrategy ThrowRangeStrategy(Grid2DDomain domain)
 {
     return(ClipRangeStrategy.Create(0.0, 200.0));
 }
Beispiel #6
0
        private AbstractRangeStrategy RhoRangeStrategy(Grid2DDomain domain)
        {
            double diagonal = (domain.Max - domain.Min).Magnitude;

            return(ClipRangeStrategy.Create(-diagonal, diagonal));
        }