示例#1
0
        public override void Init()
        {
            try
            {
                base.Init();
                FacilityClass fac = this._facClassReg.FacilityType;
                if (fac == null)
                {
                    return;
                }
                DFDataConfig.Class.FieldInfo fi = fac.GetFieldInfoBySystemName("Height");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._height = Fac.GetDouble(this._rowInfo, index);
                    }
                }
                fi = fac.GetFieldInfoBySystemName("SurfHeight");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._surfH = Fac.GetDouble(this._rowInfo, index);
                    }
                }
                bool bHaveTopHeight = false;
                fi = fac.GetFieldInfoBySystemName("TopHeight");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._topH     = Fac.GetDouble(this._rowInfo, index);
                        bHaveTopHeight = true;
                    }
                }
                bool bHaveBottomHeight = false;
                fi = fac.GetFieldInfoBySystemName("BottomHeight");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._bottomH     = Fac.GetDouble(this._rowInfo, index);
                        bHaveBottomHeight = true;
                    }
                }
                if (!bHaveTopHeight && bHaveBottomHeight)
                {
                    this._topH = this.SurfH;
                }

                fi = fac.GetFieldInfoBySystemName("Direction");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._angleZ = Fac.GetDouble(this._rowInfo, index);
                    }
                }
                fi = fac.GetFieldInfoBySystemName("Additional");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._fusu = Fac.GetString(this._rowInfo, index);
                    }
                }
                fi = fac.GetFieldInfoBySystemName("Pitch");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._pitch = Fac.GetDouble(this._rowInfo, index);
                    }
                }
                fi = fac.GetFieldInfoBySystemName("Yaw");
                if (fi != null)
                {
                    int index = this._rowInfo.FieldIndex(fi.Name);
                    if (index != -1)
                    {
                        this._yaw = Fac.GetDouble(this._rowInfo, index);
                    }
                }
                if (this._style != null)
                {
                    if (this._style.Name.Contains("井") || this._style.Name.Contains("篦"))
                    {
                        this._IsWell  = true;
                        this._IsValve = false;
                        // 重新设置模型点Z坐标
                        if (base._geoGroup[1] != null && (base._geoGroup[1] as IPoint) != null)
                        {
                            IPoint pointValue = base._geoGroup[1] as IPoint;
                            if (this._topH != null && this._bottomH != null)
                            {
                                pointValue.Z = (this._topH + this._bottomH) / 2.0;
                            }
                            base._geoGroup[1] = pointValue;
                            base.SetValue("Shape", base._geoGroup[1]);
                        }
                    }
                    if (!this._IsWell && this._style.Name.Contains("阀"))
                    {
                        this._IsValve = true;
                        this._IsWell  = false;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }