コード例 #1
0
ファイル: Model.cs プロジェクト: Haiezan/Workshop
        public void ReadWallData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

            conn = new SQLiteConnection(@"Data Source = " + Path);
            conn.Open();

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,SectID,GridID FROM tblWallSeg";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Wall wall = new Wall();
                wall.ID       = reader.GetInt64(0);
                wall.StdFlrID = reader.GetInt64(1);
                wall.SectID   = reader.GetInt64(2);
                wall.GridID   = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(wall.StdFlrID);

                wall.Grid             = storyModel.GetGrid(wall.GridID);
                wall.wallSect         = GetWallSect(wall.SectID);
                wall.ExtrudeDirection = new Vector3d(0, 0, -1 * storyModel.Height);

                wall.GetSectPolyLineCurve();
                wall.GetWallSurface();

                storyModel.Walls.Add(wall);
            }
        }
コード例 #2
0
ファイル: Model.cs プロジェクト: Haiezan/Workshop
        /// <summary>
        /// 读取梁构件信息
        /// </summary>
        public void ReadBeamdata()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

            conn = new SQLiteConnection(@"Data Source = " + Path);
            conn.Open();

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,SectID,GridID FROM tblBeamSeg";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Beam beam = new Beam();
                beam.ID       = reader.GetInt64(0);
                beam.StdFlrID = reader.GetInt64(1);
                beam.SectID   = reader.GetInt64(2);
                beam.GridID   = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(beam.StdFlrID);
                beam.Grid     = storyModel.GetGrid(beam.GridID);
                beam.beamSect = GetBeamSect(beam.SectID);

                beam.GetSectPolyLineCurve();
                beam.GetBeamSurface();

                storyModel.Beams.Add(beam);
            }
        }