示例#1
0
        public frmStatus(GlobalDocument GD)
        {
            InitializeComponent();
            CenterToParent();

            _gd = GD;

            prevX = 0;
            PrevY = 0;
            curX  = 0;
            curY  = 0;

            SubscribeEvents();
        }
示例#2
0
文件: Engine.cs 项目: elpekozgun/OET
        public static void GenerateNodeLoads(GlobalDocument GD)
        {
            List <IEntity> tempEntity = new List <IEntity>();
            List <Dot>     dotlist    = new List <Dot>();


            tempEntity.AddRange(GD.Entities.FindAll(x => x.EntityType == eEntityType.dot));
            foreach (var entity in tempEntity)
            {
                var dot = (Dot)entity;
                foreach (var node in GD.Nodes.FindAll(x => x.Coord == new XYPT(dot.Points[0].X, dot.Points[0].Y)))
                {
                }
            }
        }
示例#3
0
        public frmGridSettings(GlobalDocument GD)
        {
            InitializeComponent();
            CenterToParent();

            _height = GD.GridHeight;
            _width  = GD.GridWidth;
            _size   = GD.GridSize;
            prevX   = 0;
            PrevY   = 0;
            curX    = 0;
            curY    = 0;
            a       = Convert.ToChar(CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator);
            SubscribeEvents();
        }
示例#4
0
文件: Engine.cs 项目: elpekozgun/OET
        public static void RefactorFrames(GlobalDocument GD)
        {
            var listofnodes = GD.Nodes;

            var temp = listofnodes.Where(x => x.Material == eMaterial.Steel).ToList();

            for (int j = 0; j < temp.Count; j++)
            {
                var test = GD.Frames.FindAll(x => x.Material == eMaterial.Steel && (x.EndNode == temp[j] || x.StartNode == temp[j]));
                //if (test.FindAll(x=>x.EndNode == temp[j]).Count >= 2 && test.FindAll(x => x.EndNode == temp[j]).Count < 3)
                if (test.FindAll(x => x.EndNode == temp[j]).Count == 2 && test.FindAll(x => x.StartNode == temp[j]).Count == 1)
                {
                    //var node = GD.Nodes.Find(x => x.Material== eMaterial.Steel && x == test[0].EndNode);
                    var node = test[0].EndNode;

                    node.Material   = eMaterial.Concrete;
                    node.RebarCount = 0;
                    node.RebarSize  = 0;

                    //listofnodes.Remove(test[0].EndNode);
                    //listofnodes.Add(node);

                    for (int i = 0; i < test.FindAll(x => x.EndNode == temp[j]).Count; i++)
                    {
                        IElement frame = GD.Frames.Find(x => x == test[i]);
                        if (node == frame.StartNode)
                        {
                            Concrete conc = new Concrete(node, frame.EndNode);
                            conc.Id = frame.Id;
                            GD.Frames.Remove(frame);
                            GD.Frames.Add(conc);
                        }
                        else
                        {
                            Concrete conc = new Concrete(frame.StartNode, node);
                            conc.Id = frame.Id;
                            GD.Frames.Remove(frame);
                            GD.Frames.Add(conc);
                        }
                    }
                }
            }
            //SortAndNumberNodeList(ref listofnodes);
            //GD.Clear();
            //GD.Nodes = listofnodes;
            //Engine.GenerateFramesByNodes(GD);
        }
示例#5
0
        public frmMesh(GlobalDocument GD)
        {
            InitializeComponent();
            CenterToParent();

            _meshSize  = GD.MeshSize;
            _horizon   = GD.Horizon;
            _nodeCount = GD.Nodes.Count;
            prevX      = 0;
            PrevY      = 0;
            curX       = 0;
            curY       = 0;
            a          = Convert.ToChar(CultureInfo.CurrentUICulture.NumberFormat.NumberDecimalSeparator);


            PrepareUI();
            SubscribeEvents();
        }
示例#6
0
文件: Engine.cs 项目: elpekozgun/OET
        public static void GenerateFramesByNodes(GlobalDocument GD)
        {
            Stopwatch st = new Stopwatch();

            st.Start();
            int id = 0;

            for (int i = 0; i < GD.Nodes.Count; i++)
            {
                for (int j = i + 1; j < GD.Nodes.Count; j++)
                {
                    if (i != j && GD.Nodes[i].Coord.DistTo(GD.Nodes[j].Coord) < GD.Horizon)
                    {
                        id++;
                        if (GD.Nodes[i].Material == eMaterial.Steel && GD.Nodes[j].Material == eMaterial.Steel &&
                            GD.Nodes[i].SegmentIDList.Intersect(GD.Nodes[j].SegmentIDList).Any())
                        {
                            if (GD.Nodes[i].Coord.DistTo(GD.Nodes[j].Coord) < Math.Sqrt(GD.MeshSize * GD.MeshSize * 2) + 0.1)
                            {
                                {
                                    var rebar = new Rebar(GD.Nodes[i], GD.Nodes[j], GD.Nodes[i].RebarCount, GD.Nodes[j].RebarSize);
                                    rebar.Id = id;
                                    GD.Frames.Add(rebar);
                                }
                            }
                        }
                        else if (GD.Nodes[i].AreaIDList.Intersect(GD.Nodes[j].AreaIDList).Any())
                        {
                            var concrete = new Concrete(GD.Nodes[i], GD.Nodes[j]);
                            concrete.Id = id;
                            GD.Frames.Add(concrete);
                        }
                    }
                    else if (Math.Abs(GD.Nodes[i].Coord.YY - GD.Nodes[j].Coord.YY) > GD.Horizon)
                    {
                        break;
                    }
                }
            }
            st.Stop();
            string time = (st.ElapsedMilliseconds / 1000).ToString();
        }
示例#7
0
文件: Engine.cs 项目: elpekozgun/OET
 public static List <Load> GenerateLoads(GlobalDocument GD)
 {
     throw new NotImplementedException();
 }
示例#8
0
文件: Engine.cs 项目: elpekozgun/OET
        public static void GenerateNodesByEntity(GlobalDocument GD)
        {
            float          threshold    = MeshSize / 1.95f;
            List <Node>    tempList     = new List <Node>();
            List <XYPT>    polyPoints   = new List <XYPT>();
            List <IEntity> tempEntity   = new List <IEntity>();
            List <Node>    steelnodes   = new List <Node>();
            List <int>     segmentCount = new List <int>();

            tempEntity.AddRange(GD.Entities);
            SortEntities(ref tempEntity);

            foreach (var entity in tempEntity)
            {
                // CONCRETE
                if (entity.EntityType == eEntityType.area)
                {
                    Area    area         = (Area)entity;
                    Polygon unmeshedPoly = new Polygon();

                    foreach (PointF point in area.Points)
                    {
                        unmeshedPoly.Points.Add(new XYPT(point.X, point.Y));
                    }

                    Polygon meshedPoly = MeshPolygonSequential(unmeshedPoly);

                    foreach (XYPT pt in meshedPoly.Points)
                    {
                        Node node = new Node((float)pt.XX, (float)pt.YY, eMaterial.Concrete);
                        node.AreaIDList.Add(area.ID);
                        node.Thickness = area.Thickness;
                        tempList.Add(node);
                    }
                }
                // STEEL
                else if (entity.EntityType == eEntityType.segment)
                {
                    List <Node> steels  = new List <Node>();
                    Segment     segment = (Segment)entity;
                    segmentCount.Add(segment.ID);
                    Line line = new Line();
                    foreach (PointF point in segment.Points)
                    {
                        line.Points.Add(new XYPT(point.X, point.Y));
                    }
                    line.SortPoints();

                    XYPT pdrop;
                    foreach (var pt in (tempList.FindAll(x => x.Coord.YY <= line.BoundingPoints[1].y)
                                        .FindAll(x => x.Coord.YY >= line.BoundingPoints[0].y)
                                        .FindAll(x => x.Coord.XX <= line.BoundingPoints[1].x)
                                        .FindAll(x => x.Coord.XX >= line.BoundingPoints[0].x)))
                    {
                        if (line.Pt2LinePt(line.Points[0], line.Points[1], pt.Coord, out pdrop) &&
                            pt.Coord.DistTo(pdrop) < threshold)
                        {
                            pt.Material   = eMaterial.Steel;
                            pt.RebarCount = segment.Count;
                            pt.RebarSize  = segment.Size;
                            pt.SegmentIDList.Add(segment.ID);
                            steels.Add(pt);
                            steelnodes.Add(pt);
                        }
                    }
                }
            }
            AdjustPoints2(tempList, steelnodes, segmentCount);
            SortAndNumberNodeList(ref tempList);

            GD.Nodes = tempList;
        }