public int CalculateTotalStall() { int res = 0; for (int i = 0; i < this.list.Count; i++) { RowNode node = this.list[i]; if (node.name.Equals("CarStallRow")) { CarStallMeta meta = (CarStallMeta)node.metaItem; int multi = meta.IsDouble() ? 2 : 1; res += (int)(node.GetLineLength() / meta.GetClearLength()) * multi; } } this.totalCount = res; return(res); }
public int CalculateTotalStall() { RowNode node = endNode; int res = 0; while (node != null) { if (node.name.Equals("CarStallRow")) { CarStallMeta meta = (CarStallMeta)node.metaItem; int multi = meta.IsDouble() ? 2 : 1; res += (int)(node.GetLineLength() / meta.GetClearLength()) * multi; } //Rhino.RhinoApp.WriteLine(node.ToString()); node = node.prev; } this.totalStall = res; return(res); }
public override List <GeometryBase> Draw() { List <GeometryBase> list = new List <GeometryBase>(); CarStallMeta c = (CarStallMeta)metaItem; // MessageBox.Show(c.ToString()); double[] divideParam = middleLine.ToNurbsCurve().DivideByLength(c.GetClearLength(), false); foreach (double p in divideParam) { // adjust plane direction // z: zAxis, x: Vector3d y = zone.offsetDirection[baseLineID]; Vector3d x = Vector3d.CrossProduct(y, Vector3d.ZAxis); Plane plane = new Plane(middleLine.PointAt(p), x, y); plane.Rotate(c.GetDegree(), Vector3d.ZAxis); list.AddRange(c.Draw(plane, zone.offsetDirection[baseLineID])); } return(list); }
public CarStallRow(int baseLineID, Line referenceLine, CarStallMeta metaItem, Zone zone) : base(baseLineID, referenceLine, metaItem, zone) { requiredConnection = metaItem.RequiredConnection(); name = "CarStallRow"; }