Exemple #1
0
        public void Add(SpectrumBand <T> band)
        {
            bands.Add(band);

            bounds.GetOrCreateValue(band.GetStart(), v => new SpectrumBound <T>(v)).AddBandStart(band);
            bounds.GetOrCreateValue(band.GetEnd(), v => new SpectrumBound <T>(v)).AddBandEnd(band);

            is_ready = false;
        }
Exemple #2
0
        public void Remove(SpectrumBand <T> band)
        {
            if (bands.Remove(band))
            {
                int start = bounds.IndexOfKey(band.GetStart());
                if (bounds.IsIndexValid(start))
                {
                    bounds.Values[start].RemoveBandStart(band);
                }

                int end = bounds.IndexOfKey(band.GetEnd());
                if (bounds.IsIndexValid(end))
                {
                    bounds.Values[end].RemoveBandEnd(band);
                }

                is_ready = false;
            }
        }