public static void LayoutChildrenByName(ISIS.GME.Common.Interfaces.Model parent) { PositionTracker pt = new PositionTracker(); foreach (ISIS.GME.Common.Interfaces.FCO child in parent.AllChildren.OrderBy(child => child.Name)) { String s_Coord = pt.GetCoordinatesAndIncrement(child); SetCoordinates(child, s_Coord); } }
public static void LayoutComponent(CyPhy.Component c) { PositionTracker pt = new PositionTracker(); Dictionary<string, bool> d_IsPositioned = new Dictionary<string, bool>(); foreach (CyPhy.Connector conn in c.Children.ConnectorCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(conn); SetCoordinates(conn, s_Coord); d_IsPositioned[conn.ID] = true; } foreach (CyPhy.Port p in c.Children.PortCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.Parameter p in c.Children.ParameterCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.Property p in c.Children.PropertyCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.CustomFormula cf in c.Children.CustomFormulaCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(cf); SetCoordinates(cf, s_Coord); d_IsPositioned[cf.ID] = true; } foreach (CyPhy.Resource r in c.Children.ResourceCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(r); SetCoordinates(r, s_Coord); d_IsPositioned[r.ID] = true; } pt.NextLine(); pt.Increment(null); foreach (ISIS.GME.Common.Interfaces.FCO fco in c.AllChildren.Where(fco => fco is CyPhy.ModelicaModel || fco is CyPhy.CADModel || fco is CyPhy.ManufacturingModel)) { Boolean b; d_IsPositioned.TryGetValue(fco.ID, out b); if (!b) { String s_Coord = pt.GetCoordinatesAndIncrement(fco); SetCoordinates(fco, s_Coord); d_IsPositioned[fco.ID] = true; } pt.Increment(null); pt.Increment(null); } foreach (ISIS.GME.Common.Interfaces.FCO fco in c.AllChildren.Where(fco => fco is ISIS.GME.Common.Interfaces.Atom || fco is ISIS.GME.Common.Interfaces.Model || fco is ISIS.GME.Common.Interfaces.Reference || fco is ISIS.GME.Common.Interfaces.Set)) { Boolean b; d_IsPositioned.TryGetValue(fco.ID,out b); if ( !b ) { String s_Coord = pt.GetCoordinatesAndIncrement(fco); SetCoordinates(fco, s_Coord); d_IsPositioned[fco.ID] = true; } } /*foreach (KeyValuePair<String, ArrayList> kvp in d_ClassPrioritiesByAspect) { String s_CurrentAspect = kvp.Key; foreach (var t in kvp.Value) { } }*/ }
public static void LayoutChildrenByName(ISIS.GME.Common.Interfaces.Model parent) { PositionTracker pt = new PositionTracker(); foreach (ISIS.GME.Common.Interfaces.FCO child in parent.AllChildren.OrderBy(child => child.Name)) { String s_Coord = pt.GetCoordinatesAndIncrement(child); SetCoordinates(child, s_Coord); } }
public static void LayoutComponent(CyPhy.Component c) { PositionTracker pt = new PositionTracker(); Dictionary <string, bool> d_IsPositioned = new Dictionary <string, bool>(); foreach (CyPhy.Connector conn in c.Children.ConnectorCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(conn); SetCoordinates(conn, s_Coord); d_IsPositioned[conn.ID] = true; } foreach (CyPhy.Port p in c.Children.PortCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.Parameter p in c.Children.ParameterCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.Property p in c.Children.PropertyCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(p); SetCoordinates(p, s_Coord); d_IsPositioned[p.ID] = true; } foreach (CyPhy.CustomFormula cf in c.Children.CustomFormulaCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(cf); SetCoordinates(cf, s_Coord); d_IsPositioned[cf.ID] = true; } foreach (CyPhy.Resource r in c.Children.ResourceCollection) { String s_Coord = pt.GetCoordinatesAndIncrement(r); SetCoordinates(r, s_Coord); d_IsPositioned[r.ID] = true; } pt.NextLine(); pt.Increment(null); foreach (ISIS.GME.Common.Interfaces.FCO fco in c.AllChildren.Where(fco => fco is CyPhy.ModelicaModel || fco is CyPhy.CADModel || fco is CyPhy.ManufacturingModel)) { Boolean b; d_IsPositioned.TryGetValue(fco.ID, out b); if (!b) { String s_Coord = pt.GetCoordinatesAndIncrement(fco); SetCoordinates(fco, s_Coord); d_IsPositioned[fco.ID] = true; } pt.Increment(null); pt.Increment(null); } foreach (ISIS.GME.Common.Interfaces.FCO fco in c.AllChildren.Where(fco => fco is ISIS.GME.Common.Interfaces.Atom || fco is ISIS.GME.Common.Interfaces.Model || fco is ISIS.GME.Common.Interfaces.Reference || fco is ISIS.GME.Common.Interfaces.Set)) { Boolean b; d_IsPositioned.TryGetValue(fco.ID, out b); if (!b) { String s_Coord = pt.GetCoordinatesAndIncrement(fco); SetCoordinates(fco, s_Coord); d_IsPositioned[fco.ID] = true; } } /*foreach (KeyValuePair<String, ArrayList> kvp in d_ClassPrioritiesByAspect) * { * String s_CurrentAspect = kvp.Key; * foreach (var t in kvp.Value) * { * * } * }*/ }