/// <summary> /// Shows the provided objects and "hangs" (halts code until user closes presenter window). /// </summary> /// <param name="tessellatedSolid">The tessellated solid.</param> public static void ShowAndHang(IEnumerable <PolygonalFace> faces, TVGL.Color color = null) { var window = new Window3DPlot(); var sysWindowsColor = color != null ? new System.Windows.Media.Color { A = color.A, B = color.B, G = color.G, R = color.R } : System.Windows.Media.Colors.Blue; window.view1.Children.Add(MakeModelVisual3DMultiColorFaces(faces, MaterialHelper.CreateMaterial(sysWindowsColor))); window.view1.FitView(window.view1.Camera.LookDirection, window.view1.Camera.UpDirection); window.ShowDialog(); }
/// <summary> /// Initializes a new instance of the <see cref="Window2DPlot" /> class. /// </summary> /// <param name="listOfSeriesOfPoints">The list of array of points.</param> /// <param name="title">The title.</param> /// <param name="plot2DType">Type of the plot2 d.</param> /// <param name="closeShape">if set to <c>true</c> [close shape].</param> /// <param name="marker">The marker.</param> public Window2DPlot(IList <List <double[]> > listOfSeriesOfPoints, string title, Plot2DType plot2DType, bool closeShape, MarkerType marker, IList <TVGL.Color> colors = null) : this(title) { for (var i = 0; i < listOfSeriesOfPoints.Count(); i++) { //Note: both methods below will accept null colors, so set to null by default TVGL.Color color = null; if (colors != null) { color = colors[i]; } if (plot2DType == Plot2DType.Line) { AddLineSeriesToModel(listOfSeriesOfPoints[i], closeShape, marker, color); } else { AddScatterSeriesToModel(listOfSeriesOfPoints[i], marker, color); } } InitializeComponent(); }
/// <summary> /// Adds the scatter series to model. /// </summary> /// <param name="points">The points.</param> /// <param name="marker">The marker.</param> private void AddScatterSeriesToModel(IList <double[]> points, MarkerType marker, TVGL.Color color = null) { var series = new LineSeries { MarkerType = marker, LineStyle = LineStyle.None }; //Add color to series if applicable if (color != null) { series.Color = OxyColor.FromRgb(color.R, color.G, color.B); } foreach (var point in points) { //point[0] == x, point[1] == y series.Points.Add(new DataPoint(point[0], point[1])); } Model.Series.Add(series); }
/// <summary> /// Adds the scatter series to model. /// </summary> /// <param name="points">The points.</param> /// <param name="marker">The marker.</param> private void AddScatterSeriesToModel(IList <Vertex> points, MarkerType marker, TVGL.Color color = null) { AddScatterSeriesToModel(PointsToDouble(points), marker, color); }
/// <summary> /// Adds the line series to model. /// </summary> /// <param name="points">The points.</param> /// <param name="closeShape">if set to <c>true</c> [close shape].</param> /// <param name="marker">The marker.</param> private void AddLineSeriesToModel(IList <Vertex> points, bool closeShape, MarkerType marker, TVGL.Color color = null) { AddLineSeriesToModel(PointsToDouble(points), closeShape, marker, color); }
/// <summary> /// Adds the scatter series to model. /// </summary> /// <param name="points">The points.</param> /// <param name="marker">The marker.</param> private void AddScatterSeriesToModel(IEnumerable <Vector2> points, MarkerType marker, TVGL.Color color = null) { AddScatterSeriesToModel(PointsToDouble(points), marker, color); }
/// <summary> /// Adds the line series to model. /// </summary> /// <param name="points">The points.</param> /// <param name="closeShape">if set to <c>true</c> [close shape].</param> /// <param name="marker">The marker.</param> private void AddLineSeriesToModel(IEnumerable <Vector2> points, bool closeShape, MarkerType marker, TVGL.Color color = null) { AddLineSeriesToModel(PointsToDouble(points), closeShape, marker, color); }