示例#1
0
 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);
         }
     }
 }
示例#2
0
 void ICameraConsumer.Add(Motion6D.Camera camera)
 {
     if (cameras.Contains(camera))
     {
         return;
     }
     cameras.Add(camera);
     foreach (object o in positions)
     {
         if (o is ICameraConsumer)
         {
             ICameraConsumer cc = o as ICameraConsumer;
             cc.Add(camera);
         }
     }
 }
示例#3
0
        /// <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);
            }
        }