Exemplo n.º 1
0
        /// <summary>
        /// Add a child component to this panel
        /// </summary>
        /// <param name="comp"></param>
        public virtual void Add(G3DComponent comp)
        {
            if (comp != null && !children.Contains(comp))
            {
                comp.Parent       = this;
                comp.Transparency = alpha;
                children.Add(comp);

                G3DPanel root = (G3DPanel)comp.RootParent;
                //InvokeComponentAddedEvent(this, comp);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Remove a child component from this panel if already added
        /// </summary>
        /// <param name="comp"></param>
        /// <returns></returns>
        public virtual bool Remove(G3DComponent comp)
        {
            bool removed = children.Remove(comp);

            if (removed)
            {
                comp.Parent = null;

                //InvokeComponentRemovedEvent(this, comp);
            }

            return(removed);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Get the parent right before reaching the root
 /// </summary>
 /// <param name="comp"></param>
 /// <returns></returns>
 protected virtual G3DPanel GetPreRootParent(G3DComponent comp)
 {
     if (comp.HasParent && ((G3DPanel)comp.Parent).HasParent)
     {
         return(GetPreRootParent((G3DComponent)comp.Parent));
     }
     else
     {
         if (comp is G3DPanel)
         {
             return((G3DPanel)comp);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Removes a 3D UI component from the rendering process.
 /// </summary>
 /// <param name="comp3d"></param>
 internal void Remove3DComponent(G3DComponent comp3d)
 {
     comp3Ds.Remove(comp3d);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Adds a 3D UI component to be rendered in the scene.
 /// </summary>
 /// <remarks>You should only add top-level components that do not have a parent component.</remarks>
 /// <param name="comp3d">A top-level G3DComponent object</param>
 internal void Add3DComponent(G3DComponent comp3d)
 {
     if (!comp3Ds.Contains(comp3d))
         comp3Ds.Add(comp3d);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Get the parent right before reaching the root
 /// </summary>
 /// <param name="comp"></param>
 /// <returns></returns>
 protected virtual G3DPanel GetPreRootParent(G3DComponent comp)
 {
     if (comp.HasParent && ((G3DPanel)comp.Parent).HasParent)
         return GetPreRootParent((G3DComponent)comp.Parent);
     else
     {
         if (comp is G3DPanel)
             return (G3DPanel)comp;
         else
             return null;
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Remove a child component from this panel if already added
        /// </summary>
        /// <param name="comp"></param>
        /// <returns></returns>
        public virtual bool Remove(G3DComponent comp)
        {
            bool removed = children.Remove(comp);
            if (removed)
            {
                comp.Parent = null;

                //InvokeComponentRemovedEvent(this, comp);
            }

            return removed;
        }
Exemplo n.º 8
0
        /// <summary>
        /// Add a child component to this panel
        /// </summary>
        /// <param name="comp"></param>
        public virtual void Add(G3DComponent comp)
        {
            if (comp != null && !children.Contains(comp))
            {
                comp.Parent = this;
                comp.Transparency = alpha;
                children.Add(comp);

                G3DPanel root = (G3DPanel)comp.RootParent;
                //InvokeComponentAddedEvent(this, comp);
            }
        }