/// <summary> /// Initialize the graph components /// </summary> public SurfaceGraph() { InitializeComponent(); //Create the panel on the GUI _panel = ILPanel.Create(); //Create the color map for the graph _cm = new ILColormap(_colormapType); //Create the colorbar for the graph _cb = new ILColorBar(_cm); //Add the panel and colorbar on the GUI tableLayoutPanel.Controls.Add(_panel, 0, 0); _panel.Dock = DockStyle.Fill; _panel.Controls.Add(_cb); _cameraView = new ViewPoint(); //plot the waveform with built-in data Plot(stdWfm.Waterfall); this.CubeGridVisible = false; this.AxesLineVisible = true; this.CubeColor = Color.White; this.BackGroundColor = Color.White; this.WireframeVisible = false; this.XAxisTitle = "X"; this.YAxisTitle = "Y"; this.ZAxisTitle = "Z"; this.ColormapType = Colormaps.Hsv; this.isColorbarHorizontal = true; this.DigitsOfColorbar = 5; this.BackColorOfColorBar = Color.Transparent; this.Position = new Point(5, 5); this.WidthofColorBar = 120; this.HeightofColorBar = 45; checkBox_showCB.Checked = true; _cameraView.phi = (float)45.0; _cameraView.rho = (float)89.9; _cameraView.distance = (float)362; InteractiveMode = InteractiveModes.None; ColorBarUpdate(); UpdatePointOfView(); }
/// <summary> /// Update the colorbar of the surface graph /// </summary> private void ColorBarUpdate() { _panel.Controls.Remove(_cb); _cm = new ILColormap(_colormapType); _cm.Data = ILMath.tosingle(_displayData); _panel.Colormap = _cm; _cb = new ILColorBar(_cm); _cb.Orientation = isHorizontal?TextOrientation.Horizontal:TextOrientation.Vertical; _cb.Precision = _colorbarDigits; _cb.BorderStyle = _borderStyleOfColorbar; _cb.Visible = _colorbarVisible; _cb.BackColor = _backColor; _cb.Width = _widthOfColorbar; _cb.Height = _heightOfColorbar; _cb.Location = _position; _panel.Controls.Add(_cb); AutoScaleColorRange(); }