Ejemplo n.º 1
0
        public void ReadFloorData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

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

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,No_,Name,StdFlrID,LevelB,Height FROM tblFloor";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Floor floor = new Floor();
                floor.ID       = reader.GetInt64(0);
                floor.No       = reader.GetInt64(1);
                floor.Name     = reader.GetString(2);
                floor.StdFlrID = reader.GetInt64(3);
                floor.LevelB   = reader.GetDouble(4);
                floor.Height   = reader.GetDouble(5);
                Floors.Add(floor);

                StoryModel storyModel = new StoryModel();
                storyModel.StdFlrID = floor.StdFlrID;
                storyModel.FloorID  = floor.ID;
                storyModel.No       = floor.No;
                storyModel.Height   = floor.Height;
                storyModel.Level    = floor.LevelB;
                StoryModels.Add(storyModel);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        public List <Surface> GetModel(int iStart = 0, int iEnd = 0)
        {
            if (iEnd == 0)
            {
                iEnd = Floors.Count;
            }

            ClearModel();

            List <Surface> DisplaySurfaces = new List <Surface>();

            for (int i = iStart; i < iEnd; i++)
            {
                Floor        floor        = Floors[i];
                StoryModel   storyModel   = GetStdStoryModel(floor.StdFlrID);
                FloorSurface floorSurface = new FloorSurface();

                floorSurface.ID       = floor.ID;
                floorSurface.StdFlrID = floor.StdFlrID;
                floorSurface.Height   = floor.Height;
                floorSurface.Level    = floor.LevelB;

                floorSurface.DisplaySurface.AddRange(storyModel.SetLevel(floor.LevelB + floor.Height, floor.Height));
                storyModel.FloorSurfaces.Add(floorSurface);

                DisplaySurfaces.AddRange(floorSurface.DisplaySurface);
            }
            return(DisplaySurfaces);
        }
Ejemplo n.º 4
0
        //List<Wall> Walls = new List<Wall>();

        #region StdFlr
        /// <summary>
        /// 读取标准层信息
        /// </summary>
        public void ReadStdFlrData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

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

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,No_,Height FROM tblStdFlr";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                StdFlr stdFlr = new StdFlr();
                stdFlr.ID     = reader.GetInt64(0);
                stdFlr.No     = reader.GetInt64(1);
                stdFlr.Height = reader.GetDouble(2);
                StdFlrs.Add(stdFlr);

                StoryModel storyModel = new StoryModel();
                storyModel.StdFlrID = stdFlr.ID;
                storyModel.FloorID  = -1;
                storyModel.No       = stdFlr.No;
                storyModel.Height   = stdFlr.Height;
                storyModel.Level    = 0;
                StdStoryModels.Add(storyModel);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 读取柱构件信息
        /// </summary>
        public void ReadColData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

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

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,SectID,JtID FROM tblColSeg";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Column column = new Column();
                column.ID       = reader.GetInt64(0);
                column.StdFlrID = reader.GetInt64(1);
                column.SectID   = reader.GetInt64(2);
                column.JtID     = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(column.StdFlrID);
                column.Jt      = storyModel.GetJoint(column.JtID);
                column.colSect = GetColSect(column.SectID);
                //column.Grid.Jt1 = column.Jt.Point;
                //column.Grid.Jt2 = new Point3d(column.Jt.Point.X, column.Jt.Point.Y, 0);
                column.ExtrudeDirection = new Vector3d(0, 0, -1 * storyModel.Height);

                column.GetSectPolyLineCurve();
                column.GetColumnSurface();

                storyModel.Columns.Add(column);
            }
        }
Ejemplo n.º 6
0
        /// <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);
            }
        }
Ejemplo n.º 7
0
        public void ReadGridtData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

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

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,Jt1ID,Jt2ID,AxisID FROM tblGrid";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Grid grid = new Grid();

                grid.ID       = reader.GetInt64(0);
                grid.StdFlrID = reader.GetInt64(1);
                grid.Jt1ID    = reader.GetInt64(2);
                grid.Jt2ID    = reader.GetInt64(3);

                StoryModel storyModel = GetStdStoryModel(grid.StdFlrID);
                grid.Jt1 = storyModel.GetJoint(grid.Jt1ID);
                grid.Jt2 = storyModel.GetJoint(grid.Jt2ID);

                storyModel.Grids.Add(grid);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 读取节点信息
        /// </summary>
        public void ReadJointData()
        {
            SQLiteConnection conn;
            SQLiteCommand    cmd;
            SQLiteDataReader reader;

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

            cmd             = conn.CreateCommand();
            cmd.CommandText = @"SELECT ID,StdFlrID,X,Y,HDiff FROM tblJoint";
            reader          = cmd.ExecuteReader();
            while (reader.Read())
            {
                Joint joint = new Joint();
                joint.ID       = reader.GetInt64(0);
                joint.StdFlrID = reader.GetInt64(1);

                StoryModel storyModel = GetStdStoryModel(joint.StdFlrID);
                double     fZ         = storyModel.Height;
                double     fX         = reader.GetDouble(2);
                double     fY         = reader.GetDouble(3);
                joint.Point = new Point3d(fX, fY, fZ);

                joint.HDiff = reader.GetDouble(4);

                storyModel.Joints.Add(joint);
            }
        }