private void curveControl_NearestPointChanged(object sender, CurveControl.NearestPointEventArgs e) { itemsView.SelectedIndex = e.PointIndex; }
private GeometryModel3D BuildYSliceGraphModel() { _ySliceCurveControl = new CurveControl { Width = ProjectedCurveSize, Height = ProjectedCurveSize, YMin = 0, YMax = _zRange, StrokeThickness = 5.0, ShowName = false }; var brush = new VisualBrush(_ySliceCurveControl); var material = new DiffuseMaterial(brush); var normal = new Vector3D(0, -1, 0); var mesh = new MeshGeometry3D { Positions = new Point3DCollection { new Point3D(0, -GraphOffset, 0), new Point3D(1, -GraphOffset, 0), new Point3D(0, -GraphOffset, 1), new Point3D(1, -GraphOffset, 1) }, Normals = new Vector3DCollection { normal, normal, normal, normal }, TriangleIndices = new Int32Collection { 0, 1, 3, 0, 3, 2 }, TextureCoordinates = new PointCollection { new Point(0, ProjectedCurveSize), new Point(ProjectedCurveSize, ProjectedCurveSize), new Point(0, 0), new Point(ProjectedCurveSize, 0), } }; _ySliceModel = new GeometryModel3D(mesh, material) { BackMaterial = material }; return _ySliceModel; }