Exemplo n.º 1
0
 /// <summary>
 ///		Adds the given scene node to this nodes child list.
 /// </summary>
 /// <param name="child">Scene node to add as child.</param>
 public virtual void AddChild(SceneNode child)
 {
     if (_childList.Contains(child))
     {
         return;
     }
     _childList.Add(child);
     child.Parent = this;
     SceneGraph.AttachNode(child);
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Responsable for removing references of this object and deallocated
        ///     resources that have been allocated.
        /// </summary>
        public virtual void Dispose()
        {
            // Clear out references
            if (_parent != null)
            {
                _parent.RemoveChild(this);
            }
            _parent = null;
            SceneGraph.DetachNode(this);

            // Remove all the childrens references. (Don't tell them to dispose, that is done elsewhere).
            ClearChildren();

            // Remove all the script references.
            VirtualMachine.GlobalInstance.RemoveReferences(this);

            Statistics.StoreInt("Disposal Counted Scene Node Count", Statistics.ReadInt("Disposal Counted Scene Node Count") - 1);
        }
Exemplo n.º 3
0
 /// <summary>
 ///		Removes the given scene node from this nodes child list.
 /// </summary>
 /// <param name="child">Scene node to remove.</param>
 public virtual void RemoveChild(SceneNode child)
 {
     _childList.Remove(child);
     child.Parent = null;
     SceneGraph.DetachNode(child);
 }
 /// <summary>
 ///		Initializes a new instance of this window and fills it with the given scene graph.
 /// </summary>
 /// <param name="graph">Scene graph to fill window with.</param>
 public SceneGraphWindow(SceneGraph graph)
 {
     InitializeComponent();
     _sceneGraph = graph;
     SyncronizeData();
 }