コード例 #1
0
ファイル: DPTunnel.cs プロジェクト: presscad/DrawTunnel
        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;
        }
コード例 #2
0
 public DPVertice this[int index]
 {
     get
     {
         DPVertice v = this.List[index] as DPVertice;
         return(v);
     }
 }
コード例 #3
0
ファイル: TypeConvert.cs プロジェクト: presscad/DrawTunnel
        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));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 public void SetByDBVertice(DPVertice vertice)
 {
     this.List.Add(vertice);
     this._handleValue = vertice.getHandleValue();
 }