void ICameraConsumer.Remove(Motion6D.Camera camera) { if (!cameras.Contains(camera)) { return; } foreach (object o in positions) { if (o is ICameraConsumer) { ICameraConsumer cc = o as ICameraConsumer; cc.Remove(camera); } } }
/// <summary> /// Removes visible object /// </summary> /// <param name="p">The visible object for removing</param> public virtual void RemoveVisible(IPosition p) { if (p == null) { return; } object obj = p.Parameters; if (obj is IVisibleCollection) { IVisibleCollection vc = obj as IVisibleCollection; int n = vc.Count; for (int i = 0; i < n; i++) { IPosition pp = vc[i]; if (visible.Contains(pp)) { visible.Remove(pp); object par = pp.Parameters; if (par is ICameraConsumer) { (par as ICameraConsumer).Remove(this); } } } } if (!visible.Contains(p)) { return; } visible.Remove(p); if (obj is ICameraConsumer) { ICameraConsumer cc = obj as ICameraConsumer; cc.Remove(this); } }