+ Added internal Parent reference / made assignments to it when operations occur

This commit is contained in:
Michael L Smith 2016-02-23 18:02:24 -08:00
parent a4613ea79d
commit 8506459939
9 changed files with 16 additions and 0 deletions

View File

@ -262,6 +262,11 @@ namespace OSCADSharp
return this.ToString() == other.ToString();
}
/// <summary>
/// The parent of this object in its OSCADObject tree
/// </summary>
internal OSCADObject Parent { get; set; }
/// <summary>
/// Internal collection of children for this object
/// </summary>

View File

@ -20,6 +20,10 @@ namespace OSCADSharp.Scripting
{
this.outerStatement = outerStatement;
this.children = children.ToList();
foreach (var child in children)
{
child.Parent = this;
}
}
public override string ToString()

View File

@ -33,6 +33,7 @@ namespace OSCADSharp.Transforms
this.Opacity = opacity;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()

View File

@ -35,6 +35,7 @@ namespace OSCADSharp.Transforms
this.Height = height;
this.children.Add(obj);
obj.Parent = this;
}
public override OSCADObject Clone()

View File

@ -32,6 +32,7 @@ namespace OSCADSharp.Transforms
this.Normal = normal;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()

View File

@ -30,6 +30,7 @@ namespace OSCADSharp.Transforms
this.Size = size;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()

View File

@ -30,6 +30,7 @@ namespace OSCADSharp.Transforms
this.Angle = angle;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()

View File

@ -30,6 +30,7 @@ namespace OSCADSharp.Transforms
this.ScaleFactor = scale;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()

View File

@ -27,6 +27,7 @@ namespace OSCADSharp.Transforms
this.Vector = vector;
this.children.Add(obj);
obj.Parent = this;
}
public override string ToString()