Beispiel #1
0
        private List <Series> DrawSelectedMember(TS_part selectedPart, TS_contour selectedContour, TS_reinforcement selectedReinforcement)
        {
            OxyColor selectedColor = OxyColors.Magenta;

            List <Series> listaSerii = new List <Series>();

            if (selectedPart != null)
            {
                TS_contour contour    = selectedPart.Contour as TS_contour;
                LineSeries seria_part = new LineSeries();
                seria_part.Color           = selectedColor;
                seria_part.StrokeThickness = 2 * generalThickness;
                seria_part.LineStyle       = LineStyle.Dash;

                foreach (var side in contour.Sides)
                {
                    DataPoint point1 = new DataPoint(side.StartPoint.X, side.StartPoint.Y);
                    seria_part.Points.Add(point1);
                    DataPoint point2 = new DataPoint(side.EndPoint.X, side.EndPoint.Y);
                    seria_part.Points.Add(point2);
                }
                listaSerii.Add(seria_part);
            }

            if (selectedContour != null)
            {
                AreaSeries seria_cont = new AreaSeries();
                seria_cont.Color           = selectedColor;
                seria_cont.StrokeThickness = 2 * generalThickness;

                foreach (var side in selectedContour.Sides)
                {
                    DataPoint point1 = new DataPoint(side.StartPoint.X, side.StartPoint.Y);
                    seria_cont.Points.Add(point1);
                    DataPoint point2 = new DataPoint(side.EndPoint.X, side.EndPoint.Y);
                    seria_cont.Points.Add(point2);
                }
                listaSerii.Add(seria_cont);
            }

            // to poniżej na pewno do poprawy
            if (selectedReinforcement != null)
            {
                TS_reinforcement reo = selectedReinforcement;

                ScatterSeries seria_reo = new ScatterSeries();
                seria_reo.MarkerFill = selectedColor;
                seria_reo.MarkerType = MarkerType.Circle;

                foreach (var bar in reo.Bars)
                {
                    ScatterPoint point = new ScatterPoint(bar.Coordinates.X, bar.Coordinates.Y);
                    point.Size = bar.Diameter * 100;
                    seria_reo.Points.Add(point);
                }
                listaSerii.Add(seria_reo);
            }

            return(listaSerii);
        }
        public TabItemViewModel(TS_part part) {
		}