Ejemplo n.º 1
0
        public GeoNode(GeoParent Parent) : base(EnsureParentGetRoot(Parent))
        {
            this.BuiltTransform = Transform.Identity;
            this.Local          = TransformI.Identity;
            this.LocalCached    = TransformI.Identity;

            this.Outer = (Root == Parent) ? this : (GeoNode)Parent;
            this.Depth = this.Outer == this ? 0u : (this.Outer.Depth + 1u);

            if (0 == this.Root.Num++)
            {
                this.Next = this;
            }
            else
            {
                this.Next           = this.Root.Last.Next;
                this.Root.Last.Next = this;
            }
            this.Root.Last = this;

            if (0 == (this.ChildIndex = Parent.NumImmediate++))
            {
                this.Sibling = this;
            }
            else
            {
                this.Sibling             = Parent.LastChild.Sibling;
                Parent.LastChild.Sibling = this;
            }
            Parent.LastChild = this;

            this.ID = this.Root.IDCounter++;
            this.ExplicitlyDirty = 0 != Depth;
        }
Ejemplo n.º 2
0
 private static GeoRoot EnsureParentGetRoot(GeoParent Parent)
 {
     if (null == Parent)
     {
         throw new ArgumentNullException("Parent");
     }
     if (Parent != Parent.Root && !(Parent is GeoNode))
     {
         throw new ArgumentException("Parent must be either a GeoRoot or GeoNode!", "Parent");
     }
     if (null == Parent.Root)
     {
         throw new ArgumentException("Parent does not reference a valid root", "Parent");
     }
     return(Parent.Root);
 }
Ejemplo n.º 3
0
 public Enumerator(GeoParent Parent)
 {
     Remaining = null == Parent ? 0u : Parent.NumImmediate;
     Active    = (Remaining == 0) ? null : Parent.LastChild;
 }
Ejemplo n.º 4
0
 private ImmediateCollection(GeoParent This)
 {
     this.This = This;
 }
Ejemplo n.º 5
0
 public bool Equals(GeoParent other)
 {
     return(This == other);
 }
Ejemplo n.º 6
0
 private DeepCollection(GeoParent This)
 {
     this.This = This;
 }