/// <summary> /// create composite shape /// </summary> /// <param name="panel">hosting panel</param> /// <param name="verticesPerShape">number of vertices per shape</param> /// <param name="X">x coordinates vector </param> /// <param name="Y">y coordinates vector </param> /// <param name="Z">z coordinates vector </param> /// <param name="colors">matrix with <see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/> /// rows, 3 columns for (R,G,B) or 4 columns for /// (A,R,G,B) for every vertex specified by X,Y,Z. Elements must range from 0..255. If colors /// has 3 columns only, alpha values of 255 are used as default.</param> /// <param name="mapping">Mapping of shapes, composes shapes out of vertices. Matrix having /// <see cref="ILNumerics.Drawing.Shapes.ILShape<T>.VerticesPerShape"/> rows. /// Every element in a column specifies the index of a vertex according to its position in X,Y,Z. /// The <see cref="ILNumerics.Drawing.Shapes.ILShape<T>.VerticesPerShape"/> elements in a column therefore /// compose a single shape. Vertices may get used arbitrary times (or not at all). All elements must be /// positive integer values in range 0...[<see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>-1].</param> public ILCompositeShape(ILPanel panel, int verticesPerShape, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray colors, ILBaseArray mapping) : base(panel, X.Length, verticesPerShape) { Update(X, Y, Z, mapping, colors); Opacity = 255; m_shading = ShadingStyles.Interpolate; }
/// <summary> /// create composite shape /// </summary> /// <param name="panel">scene hosting the scene</param> /// <param name="numVertices">number of overall vertices for the shape</param> /// <param name="verticesPerShape">Number of vertices per shape</param> public ILCompositeShape(ILPanel panel, int numVertices, int verticesPerShape) : base(panel, numVertices, verticesPerShape) { Opacity = 255; m_shapeIndices = ILMath.toint32( ILMath.counter(0.0, 1.0, VerticesPerShape, numVertices / VerticesPerShape)); }
/// <summary> /// create a label for rendering /// </summary> public ILLabel(ILPanel panel) : base(panel, new Font(FontFamily.GenericSansSerif, 10.0f), Color.DarkBlue) { m_align = LabelAlign.Center; m_padding = 3; m_visible = true; }
public ILSceneGraphInnerNode(ILPanel panel) : base(panel) { m_centers = ILArray <float> .empty(0, 3); m_childs = new List <ILSceneGraphNode>(); }
/// <summary> /// set axes labels and tick labels at once /// </summary> /// <param name="panel">panel hosting the plot</param> /// <param name="xlabel">label text for x axis</param> /// <param name="ylabel">label text for y axis</param> /// <param name="zlabel">label text for z axis</param> /// <param name="xtickLabels">collection of strings for columns labels (x-direction)</param> /// <param name="ytickLabels">collection of strings for row labels (x-direction)</param> public void SetLabels(ILPanel panel , string xlabel, string ylabel, string zlabel , ICollection <string> xtickLabels , ICollection <string> ytickLabels ) { panel.Axes[0].LabeledTicks.Clear(); int counter = 0; if (xtickLabels != null) { foreach (string s in xtickLabels) { panel.Axes[0].LabeledTicks.Add(m_boxes[0, counter].Center.X, s); counter++; } } panel.Axes[1].LabeledTicks.Clear(); counter = 0; if (ytickLabels != null) { foreach (string s in ytickLabels) { panel.Axes[1].LabeledTicks.Add(m_boxes[counter, 0].Center.Y, s); counter++; } } panel.Axes[0].Label.Text = xlabel; panel.Axes[1].Label.Text = ylabel; panel.Axes[2].Label.Text = zlabel; }
private static string GetLegendLabel(ILLegend source, ILPanel panel) { if (panel.Scene.Find<ILLegend>().Count() == 1) return ILLegend.LegendTag; return BuildDefaultName(panel, source, ILLegend.LegendTag); }
/// <summary> /// create new lit surface, provide data for X,Y and Z coordinates /// </summary> /// <param name="panel">the panel hosting the scene</param> /// <param name="X">X coordinates matrix, same size as Z or null</param> /// <param name="Y">Y coordinates matrix, same size as Z or null</param> /// <param name="Z">Z data matrix, at least 2 rows, 2 columns</param> /// <param name="colormap">colormap used for auto coloring the surface</param> public ILLitSurface(ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILColormap colormap) : base(panel) { if (Z == null || Z.Dimensions[0] < 2 || Z.Dimensions[1] < 2) { throw new ArgumentException("invalid parameter size: Z"); } if (X == null || !X.Dimensions.IsSameSize(Z.Dimensions)) { throw new ArgumentException("invalid parameter size: X"); } if (Y == null || !Y.Dimensions.IsSameSize(Z.Dimensions)) { throw new ArgumentException("invalid parameter size: Y"); } m_quads = new ILLitQuads(panel, Z.Dimensions.NumberOfElements); m_quads.Label.Text = ""; m_quads.Shading = ShadingStyles.Interpolate; Add(m_quads); m_colorMap = colormap; ZValues = Z; XValues = X; YValues = Y; Invalidate(); }
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; }
/// <summary> /// construct ILAxis object. This contructor is not to be called directly. /// </summary> /// <param name="name">type of the axis: XAxis,YAxis,ZAxis</param> /// <param name="clippingView">Clipping data to be registered into the axis.</param> /// <param name="layoutData">additional layout data, does currently only contain the camera [depricated]</param> /// <param name="panel">panel hosting the scene</param> /// <remarks>ILAxis objects are created GL-device dependend by use of a device dependend ILPanel instance's /// member ILPanel.CreateAxis(). This acts like a factory pattern. The specific axis derivate will be /// created by the derived ILPanel object (ILDXPanel or ILOGLPanel).</remarks> public ILAxis(AxisNames name, ILClippingData clippingView, ILLayoutData layoutData, ILPanel panel) { m_panel = panel; m_axisName = name; m_labeledTicks = new ILTickCollection(panel, m_axisName); m_layoutData = layoutData; m_labelProvider = null; m_labeledTicks.Changed += new AxisChangedEventHandler(m_labeledTicks_Changed); m_unLabeledTicks = new List <UnlabeledTick>(10); m_grid = new ILLineProperties(); m_grid.Style = LineStyle.Dashed; m_grid.Changed += new EventHandler(m_grid_Changed); m_clipping = clippingView; m_axisType = AxisType.Linear; m_nearLines = new ILLineProperties(); m_nearLines.Color = Color.DarkBlue; m_nearLines.Width = 1; m_nearLines.Antialiasing = true; m_nearLines.Changed += new EventHandler(m_grid_Changed); m_farLines = new ILLineProperties(); m_farLines.Color = Color.DarkBlue; m_farLines.Width = 1; m_farLines.Antialiasing = true; m_farLines.Changed += new EventHandler(m_grid_Changed); m_label = new ILLabel(panel); m_label.Changed += new EventHandler(m_label_Changed); m_clipping.Changed += new ILClippingDataChangedEvent(m_clipping_Changed); m_invalidated = true; }
public void ConfigurePanel(ILPanel panel) { panel.Axes.XAxis.Visible = false; panel.InteractiveMode = InteractiveModes.ZoomRectangle; panel.Axes.YAxis.FarLines.Visible = false; panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.Optimal; }
public static void SetupLineStyle(ILLineProperties wireprops) { if (wireprops.Style == LineStyle.Solid) { GL.Disable(EnableCap.LineStipple); } else { int stipFactr = 1; short stipple; if (wireprops.Style != LineStyle.UserPattern) { stipple = ILPanel.StippleFromLineStyle( wireprops.Style, ref stipFactr); } else { stipple = wireprops.Pattern; stipFactr = (int)wireprops.PatternScale; } GL.Enable(EnableCap.LineStipple); GL.LineStipple(stipFactr, stipple); } if (wireprops.Antialiasing && wireprops.Width > 1) { GL.Enable(EnableCap.LineSmooth); } else { GL.Disable(EnableCap.LineSmooth); } GL.LineWidth(wireprops.Width); GL.Color3(wireprops.Color); }
private static string GetPlotCubeScaleGroupLabel(ILPlotCubeScaleGroup source, ILPanel panel) { if (panel.Scene.Find<ILPlotCubeScaleGroup>().Count() == 1) return "ScaleGroup"; return BuildDefaultName(panel, source, "ScaleGroup"); }
/// <summary> /// create a label for rendering /// </summary> public ILWorldLabel(ILPanel panel) : base(panel, new Font(FontFamily.GenericSansSerif, 10.0f) , Color.DarkBlue, CoordSystem.World3D) { m_align = LabelAlign.Center; m_padding = 3; }
public void ConfigurePanel(ILPanel panel) { panel.InteractiveMode = InteractiveModes.ZoomRectangle; panel.AspectRatio = AspectRatioMode.StretchToFill; panel.PlotBoxScreenSizeMode = PlotBoxScreenSizeMode.StrictOptimal; panel.ClipViewData = false; panel.DefaultView.Set(0f, 0f, panel.DefaultView.Distance); }
public static ILPanelEditor AttachTo(ILPanel ilPanel, IPanelEditor editor = null) { var editorInstance = new ILPanelEditor(ilPanel, editor); editorInstance.Update(); return editorInstance; }
/// <summary> /// create lines composite shape /// </summary> /// <param name="panel">hosting panel</param> /// <param name="X">x coordinates vector </param> /// <param name="Y">y coordinates vector </param> /// <param name="Z">z coordinates vector </param> /// <param name="colors">matrix with <see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/> /// rows, 3 columns for (R,G,B) or 4 columns for /// (A,R,G,B) for every vertex specified by X,Y,Z. Elements must range from 0..255. If colors /// has 3 columns only, alpha values of 255 are used as default.</param> /// <param name="mapping">Mapping of shapes, composes shapes out of vertices. Matrix having /// 2 rows. Every element in a column specifies the index of a vertex according to its position in X,Y,Z. /// The 2 elements in a column therefore compose a single line. Vertices may get used arbitrary times /// (or not at all). All elements must be positive integer values in range /// 0...[<see cref="ILNumerics.Drawing.Shapes.ILShape.VertexCount"/>-1].</param> public ILLines(ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray colors, ILBaseArray mapping) : base(panel, 2, X, Y, Z, colors, mapping) { m_fillColor = Color.Blue; m_properties = new ILLineProperties(); m_properties.Color = Color.Blue; m_properties.Changed += new EventHandler(m_properties_Changed); }
/// <summary> /// Create new lines composite shapes, prepare memory for vertices only /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="numVertices">number of overall vertices in the shape</param> public ILLines(ILPanel panel, int numVertices) : base(panel, numVertices, 2) { m_fillColor = Color.Blue; m_properties = new ILLineProperties(); m_properties.Color = Color.Blue; m_properties.Changed += new EventHandler(m_properties_Changed); }
/// <summary> /// create new bordered shape, provide initial vertex data /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="X">X coordinates, vector of length 'VertexCount'</param> /// <param name="Y">Y coordinates, vector of length 'VertexCount'</param> /// <param name="Z">Z coordinates, vector of length 'VertexCount'</param> public ILBorderedShape(ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z) : this(panel, (X != null && X.IsVector) ? X.Length : (Y != null && Y.IsVector) ? Y.Length : (Z != null && Z.IsVector) ? Z.Length : 0) { Update(X, Y, Z); }
/// <summary> /// create a new marker property instance /// </summary> public ILMarker(ILPanel panel) { m_panel = panel; m_shape = MarkerStyle.None; m_markerSize = 10; m_visible = false; m_color = Color.DarkBlue; }
internal ILTexMarkerShape (ILPanel panel, string expression) :base (panel) { m_expression = expression; m_interpreter = new ILSimpleTexInterpreter(); m_font = new Font(FontFamily.GenericSansSerif,10.0f); m_maxLabelsDrawn = 50; m_valueFormat = "f"; m_renderer = panel.TextRendererManager.GetDefault(CoordSystem.World3D); }
/// <summary> /// construct new surface graph, provide all 3 coordinates /// </summary> /// <param name="panel">panel this graph is to be hosted in</param> /// <param name="X">X coordinates</param> /// <param name="Y">Y coordinates</param> /// <param name="Z">Z coordinates</param> /// <param name="C">Color values</param> /// <param name="clippingContainer"></param> public ILSurfaceGraph (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray C, ILClippingData clippingContainer) : base (panel, X,Y,Z,C, clippingContainer) { m_graphType = GraphType.Surf; m_wireLines.Width = 1; m_wireLines.Antialiasing = false; m_wireLines.Color = System.Drawing.Color.Blue; m_opacity = 0.84f; }
public ILShapeLabel(ILPanel panel, CoordSystem coordSystem) : base(panel, null, Color.Black) { m_panel = panel; m_coordSystem = CoordSystem.Screen; m_anchor = new PointF(.5f, .5f); // TickLabelAlign.center | TickLabelAlign.vertCenter; m_renderer.CacheCleared -= new EventHandler(m_renderer_CacheCleared); m_renderer = panel.TextRendererManager.GetDefault(coordSystem); m_renderer.CacheCleared += new EventHandler(m_renderer_CacheCleared); }
/// <summary> /// create a new 3D Bar Graph plot, provide data matrix /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="data">data matrix, at least 2x2 entries</param> public ILBarGraph3D(ILPanel panel, ILBaseArray data) : base(panel) { if (data == null) { throw new ILArgumentException("data argument must not be null!"); } create(data, Colormaps.ILNumerics); }
/// <summary> /// create composite shape /// </summary> /// <param name="panel">hosting panel</param> /// <param name="verticesPerShape">number of vertices per shape</param> /// <param name="X">x coordinates vector </param> /// <param name="Y">y coordinates vector </param> /// <param name="Z">z coordinates vector </param> /// <remarks>The constructor creates a new composite shape out of all vertices specified in X,Y and Z. /// Every vertex is only used once. Every shape uses /// <see cref="ILNumerics.Drawing.Shapes.ILShape<T>.VerticesPerShape"/> vertices one after another.</remarks> public ILCompositeShape(ILPanel panel, int verticesPerShape, ILBaseArray X, ILBaseArray Y, ILBaseArray Z) : base(panel, X.Length, verticesPerShape) { Update(X, Y, Z); m_shapeIndices = ILMath.toint32( ILMath.counter(0.0, 1.0, VerticesPerShape, m_vertCount / VerticesPerShape)); Opacity = 255; m_shading = ShadingStyles.Flat; }
private static void InitPanel(ILPanel panel, NeuralNetwork ann) { panel.Scene.Remove(panel.Scene.First <ILPlotCube>()); int xmin = (int)ann.Instance.Samples[0].Variables[0]; int xmax = (int)ann.Instance.Samples[ann.Instance.NumSamples - 1].Variables[0]; int ymin = (int)ann.Instance.Samples[0].Variables[1]; int ymax = (int)ann.Instance.Samples[ann.Instance.NumSamples - 1].Variables[0]; ILArray <double> positions = ILMath.zeros <double>(3, ann.Instance.NumSamples); int index = 0; foreach (var sample in ann.Instance.Samples) { positions[0, index] = sample.Variables[0]; positions[1, index] = sample.Variables[1]; positions[2, index] = sample.Value; index++; } ILPlotCube cube = new ILPlotCube(twoDMode: false) { // rotate plot cube Rotation = Matrix4.Rotation(new Vector3(-1, 1, .1f), 0.4f), // perspective projection Projection = Projection.Perspective, Children = { new ILSurface((x, y) => 0, xmin, xmax, 50, ymin, ymax, 50, (x, y) => x * y, colormap: Colormaps.Autumn) { UseLighting = true }, new ILSurface((x, y) => (float)Convert(ann.Instance.OriginalFunction.ValueAt,x, y), xmin, xmax, 50, ymin, ymax, 50, (x, y) => x * y, colormap: Colormaps.Hsv) { UseLighting = true }, // add line plot, provide data as rows new ILPoints { Positions = ILMath.tosingle(positions), Color = Color.Red } } }; panel.Scene.Add(cube); panel.Scene.First <ILPlotCube>().Rotation = Matrix4.Rotation(Vector3.UnitX, .8f) * Matrix4.Rotation(Vector3.UnitZ, .6f); panel.Refresh(); }
public ILImageSCGraph (ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z,ILBaseArray C, ILClippingData clippingContainer) : base (panel, X,Y,Z,C, clippingContainer) { m_cols = m_sourceArray.Dimensions[1]+1; m_rows = m_sourceArray.Dimensions[0]+1; m_Vertcount = m_rows * m_cols; // defaults m_zPosition = float.NegativeInfinity; }
public ILShape(ILPanel panel, int numberVertices, int verticesPerShape) : base(panel) { m_numVerticesPerShape = verticesPerShape; m_renderer = panel.GetCreationFactory().CreateVertexRenderer(typeof(VertexType), this); Resize(numberVertices); VertexType a = new VertexType(); m_vertexStoresColor = a.StoresColor; }
/// <summary> /// construct new surface graph, provide all 3 coordinates /// </summary> /// <param name="panel">panel this graph is to be hosted in</param> /// <param name="X">X coordinates</param> /// <param name="Y">Y coordinates</param> /// <param name="Z">Z coordinates</param> /// <param name="C">Color values</param> /// <param name="clippingContainer"></param> public ILSurfaceGraph(ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray C, ILClippingData clippingContainer) : base(panel, X, Y, Z, C, clippingContainer) { m_graphType = GraphType.Surf; m_wireLines.Width = 1; m_wireLines.Antialiasing = false; m_wireLines.Color = System.Drawing.Color.Blue; m_opacity = 0.84f; }
/// <summary> /// (internal) create new scene graph /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="clipping">clipping data object, usually member of the panel</param> internal ILSceneGraph(ILPanel panel, ILClippingData clipping) : base(panel, clipping) { m_root = new ILSceneGraphRoot(panel); m_root.Invalidated += new EventHandler(m_root_Invalidated); m_root.SizeChanged += new EventHandler(m_root_SizeChanged); m_root.NodeAdded += new SceneGraphNodeHandler(m_root_NodeAdded); m_root.NodeRemoved += new SceneGraphNodeHandler(m_root_NodeRemoved); m_graphType = GraphType.SceneGraph; }
internal ILTexMarkerShape(ILPanel panel, string expression) : base(panel) { m_expression = expression; m_interpreter = new ILSimpleTexInterpreter(); m_font = new Font(FontFamily.GenericSansSerif, 10.0f); m_maxLabelsDrawn = 50; m_valueFormat = "f"; m_renderer = panel.TextRendererManager.GetDefault(CoordSystem.World3D); }
public static void FillTrainChoices(ILPanel panel, Label currentIteration, Label totalError, TextBox rules, ComboBox backpropagationType, TextBox eta, TextBox desiredError, NeuralNetwork ann) { InitPanel(panel, ann); totalError.Text = ann.TotalError.ToString(CultureInfo.InvariantCulture); rules.Text = RulesDefault.ToString(CultureInfo.InvariantCulture); currentIteration.Text = ann.Iter.ToString(CultureInfo.InvariantCulture); FillTypeChoices(backpropagationType); eta.Text = EtaDefault.ToString(CultureInfo.InvariantCulture); desiredError.Text = DesiredErrorDefault.ToString(CultureInfo.InvariantCulture); }
public ILImageSCGraph(ILPanel panel, ILBaseArray X, ILBaseArray Y, ILBaseArray Z, ILBaseArray C, ILClippingData clippingContainer) : base(panel, X, Y, Z, C, clippingContainer) { m_cols = m_sourceArray.Dimensions[1] + 1; m_rows = m_sourceArray.Dimensions[0] + 1; m_Vertcount = m_rows * m_cols; // defaults m_zPosition = float.NegativeInfinity; }
internal static ILBitmapMarkerShape Create(ILPanel panel, Bitmap bitmap) { switch (panel.GraphicDeviceType) { case GraphicDeviceType.OpenGL: return(new ILOGLBitmapMarkerShape(panel, bitmap)); default: throw new NotImplementedException("Bitmap markers are not implemented yet for this graphics device type!"); } }
/// <summary> /// create manager instance, device dependent /// </summary> /// <param name="panel">The hosting panel, giving access to his manager instance</param> /// <param name="assemblies">assemblies to query for matching ILRenderer types</param> /// <remarks>While creating ILRendererManager instances, the given assemblies will be queried for /// available classes matching the device. Corresponding types are than provided by calling the /// GetRenderer() method.</remarks> public ILRendererManager (ILPanel panel, Assembly[] assemblies) { m_graphicsDevice = panel.GraphicDeviceType; m_panel = panel; m_rendererCollection = new Dictionary<string,string>(); m_rendererCache = new Dictionary<string,IILTextRenderer>(); foreach (Assembly ass in assemblies) { AddAssemblyTypes(ass); } if (m_rendererCollection.Count == 0) throw new InvalidOperationException("No valid ILRenderer found!"); }
public ILLitBorderedShape(ILPanel panel, int numVertices) : base(panel, numVertices) { if (!VertexDefinition.StoresNormals) { throw new ILInvalidOperationException("The generic vertex type does not support ligthing operations. Choose a vertext type which is able to store individual normal vectors!"); } m_autoNormals = true; m_material = new ILMaterial(); m_mustCalcNormals = true; }
/// <summary> /// Create new instance of ILLegend, depending on graphics device type /// </summary> /// <param name="panel">panel hosting this legend</param> /// <returns>newly created ILLegend object</returns> public static ILLegend Create(ILPanel panel) { if (panel is ILOGLPanel) { return(new ILOGLLegend(panel)); } else { throw new NotImplementedException("Currently only legends for OpenGL are supported"); } }
/// <summary> /// [internal] constructor - do not use this! Use ILPanel.Graphs.Add...() instead! /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="XData">x data array</param> /// <param name="YData">y data array</param> /// <param name="clippingContainer">hosting panels clipping data</param> public ILPlot2DGraph(ILPanel panel, ILBaseArray XData, ILBaseArray YData, ILClippingData clippingContainer) : base(panel, clippingContainer) { if (!XData.IsVector) { throw new ILArgumentException("Plot2D: supplied data must be a real vector!"); } if (!YData.IsVector) { throw new ILArgumentException("Plot2D: XData and YData must be real vectors!"); } if (YData.Length != XData.Length) { throw new ILArgumentException("Plot2D: XData and YData must have the same length!"); } int pos = 0; ILArray <float> dataX, dataY; C4bV3f vert = new C4bV3f(); if (XData is ILArray <float> ) { dataX = (ILArray <float>)XData; } else { dataX = ILMath.tosingle(XData); } if (YData is ILArray <float> ) { dataY = (ILArray <float>)YData; } else { dataY = ILMath.tosingle(YData); } m_vertices = new C4bV3f[dataX.Length + 1]; m_vertexCount = m_vertices.Length; m_startID = m_vertexCount - 1; m_updateCount = 0; m_properties = new ILLineProperties(); m_properties.Color = Color.DarkBlue; m_properties.Changed += new EventHandler(m_properties_Changed); foreach (float val in dataX.Values) { vert.Position = new ILPoint3Df(val, dataY.GetValue(pos), 0); vert.Color = m_properties.Color; m_vertices[pos++] = vert; } m_marker = new ILMarker(panel); m_marker.Changed += new EventHandler(m_marker_Changed); m_graphType = GraphType.Plot2D; updateClipping(); }
private static string GetLinePlotLabelFromLegend(ILLinePlot source, ILPanel panel) { int index = GetNodeIndex(panel, source); var legend = panel.Scene.First<ILLegend>(); if (legend != null) { // Get text from ILLegendItem at the index if (legend.Items.Children.Count() > index) return String.Format("{0} ('{1}')", ILLinePlot.LinePlotTag, legend.Items.Find<ILLegendItem>().ElementAt(index).Text); } return null; }
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 ILPanelEditor(ILPanel ilPanel, IPanelEditor editor = null) { this.ilPanel = ilPanel; this.editor = editor ?? new PanelEditorForm(this); this.editor.PropertyChanged += (o, args) => { OnPropertyChanged(args.PropertyName); ilPanel.Configure(); ilPanel.Refresh(); }; ilPanel.Scene.Add(this); }
public ILZoomAction(ILPoint3Df MinCornerStart, ILPoint3Df MinCornerEnd, ILPoint3Df MaxCornerStart, ILPoint3Df MaxCornerEnd, ILActionRamp ramp, ILPanel panel) : base () { m_MaxCornerEnd = ILPoint3Df.Max(MinCornerEnd,MaxCornerEnd); m_MaxCornerStart = ILPoint3Df.Max(MinCornerStart,MaxCornerStart); m_MinCornerEnd = ILPoint3Df.Min(MinCornerEnd,MaxCornerEnd); m_MinCornerStart = ILPoint3Df.Min(MinCornerStart,MaxCornerStart); m_ramp = ramp; m_panel = panel; }
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"; }
public ILShapeLabel(ILPanel panel) : base(panel, null, Color.Black) { m_panel = panel; m_coordSystem = CoordSystem.Screen; m_anchor = new PointF(.5f,.5f); // TickLabelAlign.center | TickLabelAlign.vertCenter; m_fringeOffsets = new int[,]{ { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, { 1, 0 }, { 1, 1 }}; m_fringeOffsets = m_fringeOffsets.T; }
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) { 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; }
public ILMainFormSimple() { InitializeComponent(); // setup source combo box // fill couple of interesting sources toolStripCmbSource.Items.Add("id0b426"); toolStripCmbSource.Items.Add("if920ce"); toolStripCmbSource.Items.Add("id8c59a"); toolStripCmbSource.Items.Add("icd3109"); toolStripCmbSource.Items.Add("i3748c4"); toolStripCmbSource.Items.Add("ib5b26c"); toolStripCmbSource.Items.Add("i8951b3"); toolStripCmbSource.Items.Add("i794c2c"); toolStripCmbSource.Items.Add("i461339"); toolStripCmbSource.Items.Add("i9b1f80"); toolStripCmbSource.Items.Add("ia3fcd0"); toolStripCmbSource.Items.Add("i57d081"); toolStripCmbSource.Items.Add("i77c8ac"); toolStripCmbSource.Items.Add("i9481ea"); toolStripCmbSource.Items.Add("i5a1dc1"); toolStripCmbSource.Items.Add("i24bd56"); toolStripCmbSource.Items.Add("example"); panel1 = new ILPanel(); Controls.Add(panel1); // wire up UI controls this.toolStripCmbSource.KeyDown += (s, arg) => { if (arg.KeyCode == Keys.Enter) { OnSourceChanged(this.toolStripCmbSource.Text); } }; this.toolStripBtnConsoleVisible.Click += (s, arg) => { if (this.ShellVisibleChanged != null) { this.ShellVisibleChanged(this, new ShellVisibleChangedEventArgs() { Visible = this.toolStripBtnConsoleVisible.Checked }); }; }; Show(); }
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; }
public ILOGLWorldRenderer (ILPanel panel) { m_textureManager = panel.TextureManager; m_textureManager.TextureCacheCleared += new EventHandler(m_textureManager_TextureCacheCleared); }
public void ConfigurePanel(ILPanel panel) { panel.InteractiveMode = InteractiveModes.Rotating; panel.DefaultView.Set(5.8f, 1.17f, panel.DefaultView.Distance); }
internal ILOGLPlot2DGraph ( ILPanel panel, ILBaseArray sourceArray, ILClippingData clippingContainer) : base(panel, sourceArray,clippingContainer) { }
internal ILOGLPlot2DGraph ( ILPanel panel, ILBaseArray xData, ILBaseArray yData, ILClippingData clippingContainer) : base(panel, xData, yData, clippingContainer) { }
/// <summary> /// create new lit 3D box /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="min">minimum coordinates defining the box' dimensions (x,y,z)</param> /// <param name="max">minimum coordinates defining the box' dimensions (x,y,z)</param> /// <param name="fillColor">overall color for the box</param> /// <param name="topColor">color used to color the top edges of the box</param> public ILLitBox3D(ILPanel panel, ILPoint3Df min, ILPoint3Df max, Color fillColor, Color topColor) : base(panel) { m_lineProperties = new ILLineProperties(); m_lineProperties.Changed += new EventHandler(m_lineProperties_Changed); m_valLabel = new ILWorldLabel(panel); m_valLabel.Text = ""; // (max * 1000).Z.ToString("F3"); ILPoint3Df mi = ILPoint3Df.Min(min, max); ILPoint3Df ma = ILPoint3Df.Max(min, max); m_valLabel.PositionMax = new ILPoint3Df(ma.X,mi.Y,ma.Z); m_valLabel.PositionMin = new ILPoint3Df(mi.X, ma.Y, ma.Z); ; m_topLabel = new ILShapeLabel(panel); m_topLabel.Color = Color.Blue; //m_topLabel.Font = new Font("Arial", 10, FontStyle.Bold); string tval = max.Z.ToString("F2"); m_topLabel.Text = String.Format("{0}",tval); m_topLabel.Anchor = new PointF(0.5f, 1); m_topColor = topColor; #region setup quads m_quads = new ILLitQuad[6]; // front ILLitQuad quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, min.Z); quad.Vertices[1].Position = new ILPoint3Df(min.X, min.Y, max.Z); quad.Vertices[2].Position = new ILPoint3Df(max.X, min.Y, max.Z); quad.Vertices[3].Position = new ILPoint3Df(max.X, min.Y, min.Z); m_quads[QuadIndices.front] = quad; // right quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(max.X, min.Y, min.Z); quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, max.Z); quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, max.Z); quad.Vertices[3].Position = new ILPoint3Df(max.X, max.Y, min.Z); m_quads[QuadIndices.right] = quad; // back quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(max.X, max.Y, min.Z); quad.Vertices[1].Position = new ILPoint3Df(max.X, max.Y, max.Z); quad.Vertices[2].Position = new ILPoint3Df(min.X, max.Y, max.Z); quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, min.Z); m_quads[QuadIndices.back] = quad; // left quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(min.X, max.Y, min.Z); quad.Vertices[1].Position = new ILPoint3Df(min.X, max.Y, max.Z); quad.Vertices[2].Position = new ILPoint3Df(min.X, min.Y, max.Z); quad.Vertices[3].Position = new ILPoint3Df(min.X, min.Y, min.Z); m_quads[QuadIndices.left] = quad; // top quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, max.Z); quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, max.Z); quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, max.Z); quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, max.Z); m_quads[QuadIndices.top] = quad; // bottom quad = new ILLitQuad(m_panel); quad.Vertices[0].Position = new ILPoint3Df(min.X, min.Y, min.Z); quad.Vertices[1].Position = new ILPoint3Df(max.X, min.Y, min.Z); quad.Vertices[2].Position = new ILPoint3Df(max.X, max.Y, min.Z); quad.Vertices[3].Position = new ILPoint3Df(min.X, max.Y, min.Z); m_quads[QuadIndices.bottom] = quad; #endregion EventingSuspend(); foreach (ILLitQuad s in m_quads) { s.Label.Text = ""; s.Shading = ShadingStyles.Interpolate; s.Opacity = m_opacity; s.Border.Color = Color.Gray; s.Border.Width = 1; s.Border.Visible = true; s.Border.Antialiasing = false; Add(s); } EventingResume(); m_fillColor = fillColor; updateColors(); }
/// <summary> /// set axes labels and tick labels at once /// </summary> /// <param name="panel">panel hosting the plot</param> /// <param name="xlabel">label text for x axis</param> /// <param name="ylabel">label text for y axis</param> /// <param name="zlabel">label text for z axis</param> /// <param name="xtickLabels">collection of strings for columns labels (x-direction)</param> /// <param name="ytickLabels">collection of strings for row labels (x-direction)</param> public void SetLabels(ILPanel panel , string xlabel, string ylabel, string zlabel , ICollection<string> xtickLabels , ICollection<string> ytickLabels ) { panel.Axes[0].LabeledTicks.Clear(); int counter = 0; if (xtickLabels != null) foreach (string s in xtickLabels) { panel.Axes[0].LabeledTicks.Add(m_boxes[0, counter].Center.X, s); counter++; } panel.Axes[1].LabeledTicks.Clear(); counter = 0; if (ytickLabels != null) foreach (string s in ytickLabels) { panel.Axes[1].LabeledTicks.Add(m_boxes[counter, 0].Center.Y, s); counter++; } panel.Axes[0].Label.Text = xlabel; panel.Axes[1].Label.Text = ylabel; panel.Axes[2].Label.Text = zlabel; }
/// <summary> /// create a new 3D Bar Graph plot, provide data matrix /// </summary> /// <param name="panel">panel hosting the scene</param> /// <param name="data">data matrix, at least 2x2 entries</param> public ILBarGraph3D(ILPanel panel, ILBaseArray data) : base(panel) { if (data == null) throw new ILArgumentException("data argument must not be null!"); create(data, Colormaps.ILNumerics); }
/// <summary> /// create a new shaped leaf /// </summary> /// <param name="panel"></param> public ILSceneGraphShapedLeaf(ILPanel panel) : base(panel) { }
/// <summary> /// configure default view of panel, called when adding the plot to the panel /// </summary> /// <param name="panel">panel hosting the plot</param> public void ConfigurePanel(ILPanel panel) { panel.BackgroundFilled = false; panel.ClipViewData = false; panel.Axes.LinesVisible = false; panel.Projection = Projection.Perspective; panel.DefaultView.SetDeg(-35, 55, 250); // configure light panel.Lights[0].Enabled = true; panel.Lights[0].Position = new ILPoint3Df(0, 0, 250); panel.BackgroundFilled = false; panel.BackColor = Color.White; panel.Axes.GridVisible = false; panel.Axes.LinesVisible = false; // configure X axis panel.Axes[0].LabeledTicks.Mode = TickMode.Manual; panel.Axes[0].LabeledTicks.Color = Color.Black; panel.Axes[0].LabeledTicks.Clear(); panel.Axes[1].NearLines.Visible = false; panel.Axes[1].FarLines.Visible = false; panel.Axes[1].Label.Color = Color.Black; panel.Axes[2].NearLines.Visible = false; panel.Axes[2].FarLines.Visible = false; panel.Axes[2].Grid.Visible = true; panel.Axes[2].Grid.Color = Color.DarkGray; panel.Axes[2].Grid.Antialiasing = true; panel.Axes[2].Label.Color = Color.Black; panel.Axes[2].LabeledTicks.Color = Color.Black; panel.Axes[0].NearLines.Visible = false; panel.Axes[0].FarLines.Visible = false; panel.Axes[0].Label.Color = Color.Black; // configure Y axis panel.Axes[1].LabeledTicks.Mode = TickMode.Manual; panel.Axes[1].LabeledTicks.Color = Color.Black; }
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; }