public void SetFromDBObject(DBTunnel dbtunnel) { if (dbtunnel.Type == "T_SquareTunnel") { this.Type = "方形巷道"; } else if (dbtunnel.Type == "T_CylinderTunnel") { this.Type = "柱形巷道"; } this.Name = dbtunnel.Name; this.HandleValue = dbtunnel.HandleValue; this.TagData = dbtunnel.TagData; this.Location = dbtunnel.Location; this.Segment = dbtunnel.Segment; this.Colors = dbtunnel.Colors; for (int i = 0; i < dbtunnel.BasePoints.Count; i++) { DPVertice dp = new DPVertice(); dp.SetFromDBVertice(dbtunnel.BasePoints[i]); _verticeCollection.SetByDBVertice(dp); } this.DisplayTag = dbtunnel.DisplayTag; }
public DPVertice this[int index] { get { DPVertice v = this.List[index] as DPVertice; return(v); } }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, System.Type destinationType) { if (destinationType == typeof(string) && value is DPVertice) { DPVertice so = (DPVertice)value; return(so.X + ", " + so.Y + ", " + so.Z); } return(base.ConvertTo(context, culture, value, destinationType)); }
public List <DBVertice> GetVertices() { List <DBVertice> vertices = new List <DBVertice>(); int i = 0; foreach (var v in this.List) { DPVertice dpv = v as DPVertice; DBVertice dbv = new DBVertice(dpv.X, dpv.Y, dpv.Z); dbv.NodeHandleValue = dpv.NodeHandleValue; dbv.Index = i; dbv.NodeHandleValue = dpv.NodeHandleValue; vertices.Add(dbv); i++; } return(vertices); }
public void SetByDBVertice(DPVertice vertice) { this.List.Add(vertice); this._handleValue = vertice.getHandleValue(); }