/// <summary> /// Create tables for line elements /// </summary> /// <param name="cn"></param> /// <param name="obj"></param> private void store(OleDbConnection cn, ItemList <LineElement> obj) { Dictionary <FrameSection, FrameSection> frameSectionCache = new Dictionary <FrameSection, FrameSection>(); foreach (LineElement i in obj) { if (i != null) { store(cn, i); LineProps props = i.Properties; if (props != null && props is StraightFrameProps) { FrameSection sec = ((StraightFrameProps)props).Section; if (!frameSectionCache.ContainsKey(sec)) { frameSectionCache.Add(sec, sec); } } } } foreach (FrameSection fs in frameSectionCache.Keys) { if (fs != null) { store(cn, fs); } } }
private void store(OleDbConnection cn, LineElement obj) { Joint i = obj.I; Joint j = obj.J; string sql = "INSERT INTO [Connectivity - Frame] (Frame, JointI, JointJ, IsCurved, Length, CentroidX, CentroidY, CentroidZ) " + "VALUES (" + obj.Id + ", " + i.Id + ", " + j.Id + ",\"No\", " + obj.Length + ", " + (i.X + j.X) / 2.0F + ", " + (i.Y + j.Y) / 2.0F + ", " + (i.Z + j.Z) / 2.0F + ");"; new OleDbCommand(sql, cn).ExecuteNonQuery(); LineProps props = obj.Properties; List <Section> exported = new List <Section>(); if (props is StraightFrameProps) { FrameSection sec = ((StraightFrameProps)props).Section; sql = "INSERT INTO [Frame Section Assignments] (Frame, SectionType, AutoSelect, AnalSect, DesignSect, MatProp) " + "VALUES (" + obj.Id + ", \"" + secShape(sec.Shape) + "\", \"N.A.\", \"" + sec.Name + "\", \"" + sec.Name + "\", \"Default\");"; new OleDbCommand(sql, cn).ExecuteNonQuery(); store(cn, sec.ConcreteProperties, sec, exported); } AssignedLoads loads = obj.Loads; if (loads != null) { store(cn, obj.Id, loads); } }
public FigureFactory() { figureType = new FigureType(); var c = new Color(); c = Color.FromRgb(255, 255, 255); fillProps = new FillProps(c); lineProps = new LineProps(1, Colors.Black); }
public static IEnumerable <string> LinePaths(string path = null) => LineProps .Concat(EntryPaths(nameof(Line.Entries))) .Select(p => path == null ? p : $"{path}.{p}");