public ILSubfigure() { m_isInitializing = true; // setup trace listener string logfile = System.Configuration.ConfigurationManager.AppSettings["logfile"]; if (!String.IsNullOrEmpty(logfile)) { File.Delete(logfile); DefaultTraceListener defTraceListener = new DefaultTraceListener(); Trace.Listeners.Add(defTraceListener); defTraceListener.LogFileName = logfile; Trace.WriteLine(String.Format("{0} - ILSubfigure.ctor()", DateTime.Now)); } this.Size = new Size(500, 400); m_panel = ILPanel.Create(getDefaultDeviceType()); m_panel.DrawInactive = true; if (Trace.IndentLevel > 0) { Trace.TraceInformation("{0} - ILSubfigure.ctor() - panel created {1}", DateTime.Now, m_panel.GraphicDeviceType); } m_colorbar = new ILColorBar(m_panel.Colormap); m_colorbar.RegisterRangeSource(m_panel.Graphs.Limits); m_panel.ColormapChanged += new EventHandler(m_panel_ColormapChanged); m_title = new ILBorderFitLabel(); m_panel.Graphs.CollectionChanged += new ILGraphCollectionChangedEvent(Graphs_CollectionChanged); SetDefaults(); m_panel.Invalidate(); m_isInitializing = false; }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); ILLitSurface litSurf = new ILLitSurface(m_panel, Computation.CreateData(600, 600) , new ILColormap(Colormaps.ILNumerics)); m_panel.Graphs.AddPlot(litSurf); m_panel.Lights[0].Position = new ILPoint3Df(150, 90, 550); m_panel.AspectRatio = AspectRatioMode.MaintainRatios; m_panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.Maximum; m_panel.Axes.Visible = false; }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); ILArray <double> data = ILMath.rand(5, 7); ILBarGraph3D bars = new ILBarGraph3D(m_panel, data); m_panel.Graphs.AddPlot(bars); bars.SetLabels(m_panel, "X-Label", "Y-Label", "", new string[] { "Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7" }, new string[] { "Row 1", "Row 2", "Row 3", "Row 4", "Row 5" }); m_panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.StrictOptimal; m_panel.AspectRatio = AspectRatioMode.StretchToFill; }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); ILArray <double> B = ILSpecialData.sinc(40, 50) + 1; ILSurfaceGraph sgr = m_panel.Graphs.AddSurfGraph(B); ILImageSCGraph igr = m_panel.Graphs.AddImageSCGraph(B); igr.ZPosition = float.NegativeInfinity; sgr.Opacity = 0.8f; sgr.Wireframe.Visible = false; sgr.Shading = ShadingStyles.Interpolate; m_panel.Axes.XAxis.Label.Text = "\\Omega, a \\bfgreek \\resetLetter"; }
/// <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(); }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); m_vectorField = new ILVectorField2D(m_panel, ILVectorField2D.Computation.CreateTestData(10, 15, 0), new ILNumerics.Drawing.Misc.ILColormap(Colormaps.ILNumerics), null, null); m_panel.Graphs.AddPlot(m_vectorField); m_timer = new Timer(); m_timer.Tick += new EventHandler(m_timer_Tick); m_timer.Interval = 100; m_timer.Start(); }
private void Form1_Load(object sender, EventArgs e) { Color Specular = Color.FromArgb(255, 255, 255); Color Ambient = Color.FromArgb(90, 90, 90); Color Diffuse = Color.FromArgb(160, 160, 160); label1.Text = String.Format(@" Sphere: =========== Specular: White Color: White Shininess: 96"); label2.Text = String.Format(@" Panel.Lights[0]: ============ Ambient: {0} Diffuse: {1} Specular: {2}", Ambient, "s.b.", Specular); this.Size = new Size(450, 300); //byte[] values = new byte[] {5,20,100}; Color[] colors = new Color[3] { Color.LightGray, Color.Black, Color.Blue }; for (int i = 0; i < 3; i++) { ILPanel panel = ILPanel.Create(); tableLayoutPanel1.Controls.Add(panel, i, 1); panel.Dock = DockStyle.Fill; //panel.Lights[0].Diffuse = colors[i]; ILSceneGraph scene = panel.Graphs.AddSceneGraph(); ILLitSphere sphere = new ILLitSphere(panel, new ILPoint3Df(), 1f, Color.Green, 3); sphere.Label.Text = ""; sphere.Label.Anchor = new PointF(1, 0); // sphere.Material.Specular = Color.White; // sphere.Material.Shininess = 96; sphere.Label.Text = String.Format(@"\itLight.Diffuse: {0}", colors[i]); sphere.Label.Orientation = TextOrientation.Vertical; scene.AddNode(sphere); //panel.Axes.XAxis.Label. panel.BackgroundFilled = false; panel.AspectRatio = AspectRatioMode.MaintainRatios; panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.StrictOptimal; } }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); ILArray <double> data = ILMath.randn(1, 100); m_bars = new ILBarGraph2D(m_panel, data); m_bars.BarWidth = 0.001f; m_panel.Graphs.AddPlot(m_bars); m_panel.Legend.Visible = true; m_timer = new Timer(); m_timer.Tick += new EventHandler(m_timer_Tick); m_timer.Interval = 100; m_timer.Start(); m_lastTickCount = Environment.TickCount; }
private void Form1_Load(object sender, EventArgs e) { m_panel = ILPanel.Create(); Controls.Add(m_panel); m_sink = new SinkExtBoxes(m_panel, 20, 300); // add the plot directly to the panel m_panel.Graphs.AddPlot(m_sink); // tune the update interval m_sink.Interval = 0; // ILLitSink implements IILPanelConfigurator. // Therefore most settings of ILPanel are configured // by the plot, but it is still possible to override them here m_panel.Lights[0].Position = new ILPoint3Df(40, -10, 50.5); m_panel.Lights[1].Position = new ILPoint3Df(00, -00, -50.5); m_panel.Lights[1].Diffuse = Color.Black; m_panel.Lights[1].Ambient = Color.FromArgb(55, 10, 0); m_panel.Lights[1].Enabled = true; this.Size = new Size(Screen.PrimaryScreen.Bounds.Width, (int)(Screen.PrimaryScreen.Bounds.Width / 3.7931034482758620689655172413793)); m_panel.DefaultView.SetDeg(-10, 30, 20); m_panel.Projection = Projection.Perspective; }
// in Form_Load the panel and all shapes should be created // and initialized. private void Form1_Load(object sender, EventArgs e) { // the ILPanel is created ... m_panel = ILPanel.Create(); // and added to the Controls collection of the form Controls.Add(m_panel); // a scene graph will hold our shapes ILSceneGraph scene = m_panel.Graphs.AddSceneGraph(); // data for the shapes are best created in the Computation // helper - keeping the GUI code clean ILCell data = Computation.CreatePendulaWeight(); // setup the first polygon. For creation we do // not specify vertex data yet. This will be done // later in the UpdateShapes function m_poly1 = new ILLitPolygon(m_panel, data[0].Dimensions[1]); m_poly1.Border.Width = 2; m_poly1.Border.Color = Color.Gray; m_poly1.Opacity = 180; m_poly1.CustomCenter = new ILPoint3Df(0, 0, 1); m_poly1.Label.Text = ""; // and add it to the scene. We create an individual node // for the weight' shapes. ILSceneGraphInnerNode weightNode = new ILSceneGraphInnerNode(m_panel); scene.AddNode(weightNode); weightNode.Add(m_poly1); // setup the 2nd polygon. The same size is here used as // for the first polygon. m_poly2 = new ILLitPolygon(m_panel, data[0].Dimensions[1]); m_poly2.Border.Width = 2; m_poly2.Border.Color = Color.Gray; m_poly2.Opacity = 180; m_poly2.Label.Text = ""; m_poly2.CustomCenter = new ILPoint3Df(0, 0, 1); weightNode.Add(m_poly2); // the same for the quads: only give the number // of vertices needed. Data are updated later m_quads = new ILLitQuads(m_panel, data[0].Dimensions[1] * 2); m_quads.FillColor = Color.Red; m_quads.Opacity = 180; m_quads.Label.Text = ""; m_quads.CustomCenter = new ILPoint3Df(0, 0, 1); // add the quads to the scene weightNode.Add(m_quads); // create the scale below the pendula weight ILCell lData = Computation.CreateScale(); ILArray <double> vert = lData[0] as ILArray <double>; ILArray <double> maps = lData[1] as ILArray <double>; m_lines = new ILLines(m_panel, vert[0.0, null], vert[1.0, null], vert[2.0, null], maps); m_lines.Label.Text = ""; m_lines.Properties.Color = Color.Black; m_lines.Shading = ShadingStyles.Flat; // the scale lines we put directly in the root node // (no need to create an extra inner node for them) scene.AddNode(m_lines); // initialize the shapes UpdateShapes(data); // Experiment with these panel settings! They get clear than! //m_panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.StrictOptimal; // default: Optimal //m_panel.AutoZoomContent = false; // (default: true) m_panel.AspectRatio = AspectRatioMode.MaintainRatios; //m_panel.Projection = Projection.Perspective; m_panel.InteractiveMode = InteractiveModes.Rotating; // setup the timer control m_timer = new Timer(); m_timer.Interval = 40; m_timer.Tick += new EventHandler(m_timer_Tick); m_timer.Start(); }
public Form1() { InitializeComponent(); this.Size = new Size(622, 570); // create the first panel m_panel1 = ILPanel.Create(); m_tableLayout.Controls.Add(m_panel1, 0, 0); // create triangles 3D shape, we will reuse it for all panels later ILLitTriangles triangles = Computation.LoadSTL( m_panel1 , ""); // path to your STL (ASCII) text file here ... // use vertices colors triangles.Shading = ShadingStyles.Interpolate; // some tuning for light triangles.Material.Specular = Color.Gray; triangles.Label.Text = ""; // setup 3 panels m_panel1.Graphs.AddSceneGraph().AddNode(triangles); m_panel1.Dock = DockStyle.Fill; m_panel1.Lights[1].Enabled = true; m_panel1.Lights[1].Position = new ILPoint3Df(-100, 0, 10); m_panel1.Lights[1].Diffuse = Color.Blue; m_panel1.Lights[0].Ambient = Color.FromArgb(30, 30, 30); m_panel1.Lights[1].Ambient = Color.Black; m_panel1.AspectRatio = AspectRatioMode.MaintainRatios; m_panel1.DefaultView.SetDeg(285, 105, 700); m_panel1.Projection = Projection.Perspective; m_panel1.BackColorCube = Color.LightGray; // front view m_panel2 = ILPanel.Create(); m_tableLayout.Controls.Add(m_panel2, 1, 0); m_panel2.Dock = DockStyle.Fill; m_panel2.Graphs.AddSceneGraph().AddNode(triangles); m_panel2.PlotBoxScreenRect = new RectangleF(0.25f, 0.2f, 0.7f, 0.8f); m_panel2.DefaultView.SetDeg(90, 90, 300); m_panel2.Axes.YAxis.Visible = false; m_panel2.Axes.ZAxis.Label.Text = "Z - Axis"; m_panel2.Lights[0].Ambient = Color.Gray; m_panel2.Lights[0].Diffuse = Color.Green; m_panel2.Lights[0].Specular = Color.White; m_panel2.Lights[0].Position = new ILPoint3Df(90, 12, 22); // top view m_panel3 = ILPanel.Create(); m_tableLayout.Controls.Add(m_panel3, 1, 1); m_panel3.Dock = DockStyle.Fill; m_panel3.Graphs.AddSceneGraph().AddNode(triangles); m_panel3.PlotBoxScreenRect = new RectangleF(0.25f, 0f, 0.7f, 0.75f); m_panel3.Axes.XAxis.Label.Text = "X - Axis"; m_panel3.Axes.YAxis.Label.Text = "Y - Axis II"; m_panel3.Lights[0].Ambient = Color.FromArgb(250, 50, 50); m_panel3.Lights[0].Diffuse = Color.Yellow; m_panel3.Lights[0].Specular = Color.Gray; m_panel3.Lights[0].Position = new ILPoint3Df(50, 12, 22); m_panel3.Lights[1].Enabled = true; m_panel3.Lights[1].Position = new ILPoint3Df(25, 42, 32); m_panel3.Lights[1].Ambient = Color.Yellow; // info Label label = new Label(); m_tableLayout.Controls.Add(label, 0, 1); label.Font = new Font("Sans Serif", 11, FontStyle.Bold); label.Text = @"ILNumerics.Drawing.ILPanel example: Based on a TableLayoutControl, 3 ILPanel controls are arranged in a tablular sense. The properties 'PlotCubeScreenRect' is used on the panels in the right column. Setting this rectangle allows for exact pixel alignment of multiple panels. Note also, each panel has its own default view (rotation) and colormap assigned to it. However, they all three do share the same ILLitTriangles composite shape."; label.Dock = DockStyle.Fill; }
public Form1() { InitializeComponent(); m_panel = ILPanel.Create(); this.Controls.Add(m_panel); }