Example #1
0
        /// <summary>
        /// create new points
        /// </summary>
        /// <param name="panel">panel hosting the scene graph</param>
        /// <param name="numPoints">number of points to create</param>
        public ILPoints(ILPanel panel, int numPoints)
            : base(panel, numPoints, 1)
        {
            m_fillColor = Color.Black;
            // colors
            ILColorEnumerator colors = new ILColorEnumerator();

            for (int i = 0; i < numPoints; i++)
            {
                m_vertices[i].Color = colors.NextColor();
            }
        }
        /// <summary>
        /// Add new X/Y 2D line graph(s), provide X and Y coordinates
        /// </summary>
        /// <param name="X">X coordinates. If this is a matrix, every column will produce an individual graph.</param>
        /// <param name="Y">Y coordinates. Same size than 'X'.</param>
        /// <returns>Array of newly created graph(s)</returns>
        public ILPlot2DGraph[] AddPlot2DGraph(ILBaseArray XData, ILBaseArray YData)
        {
            List <ILGraph>       graphs      = Add(XData, YData, GraphType.Plot2D);
            List <ILPlot2DGraph> ret         = new List <ILPlot2DGraph>();
            ILColorEnumerator    cenumerator = new ILColorEnumerator(Colormaps.Lines);

            foreach (ILGraph g in graphs)
            {
                ILPlot2DGraph plot2DGraph = (ILPlot2DGraph)g;
                ret.Add(plot2DGraph);
                plot2DGraph.Line.Color = cenumerator.NextColor();
            }
            return(ret.ToArray());
        }
Example #3
0
        /// <summary>
        /// create new lines composite shape
        /// </summary>
        /// <param name="panel">panel hosting the scene</param>
        /// <param name="X">X coords vector</param>
        /// <param name="Y">Y coords vector</param>
        /// <param name="Z">Z coords vector</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 mapping)
            : base(panel, 2, X, Y, Z, mapping)
        {
            m_fillColor           = Color.Blue;
            m_properties          = new ILLineProperties();
            m_properties.Color    = Color.Blue;
            m_properties.Changed += new EventHandler(m_properties_Changed);
            ILColorEnumerator colors = new ILColorEnumerator();

            for (int i = 0; i < m_vertCount; i++)
            {
                m_vertices[i].Color = colors.NextColor();
            }
        }
Example #4
0
        protected void createQuads(ILBaseArray data)
        {
            if (data == null || data.Length == 0)
            {
                Clear();
                m_quads = new ILQuad[0];
            }
            else
            {
                Clear();
                m_quads = new ILQuad[data.Length];
                ILColorEnumerator colors = new ILColorEnumerator();
                ILArray <float>   fData  = null;
                if (data is ILArray <float> )
                {
                    fData = (ILArray <float>)data;
                }
                else
                {
                    fData = ILMath.tosingle(data);
                }
                for (int i = 0; i < m_quads.Length; i++)
                {
                    m_quads[i] = new ILQuad(m_panel);
                    m_quads[i].Border.Visible = true;
                    m_quads[i].FillColor      = colors.NextColor();
                    ILPoint3Df pos = new ILPoint3Df();
                    pos.X = i - m_barWidth / 2;
                    pos.Y = 0;
                    pos.Z = -0.5f;
                    m_quads[i].Vertices[0].Position = pos;
                    pos.X += m_barWidth;
                    m_quads[i].Vertices[1].Position = pos;
                    pos.Y += fData.GetValue(i);
                    m_quads[i].Vertices[2].Position = pos;
                    pos.X -= m_barWidth;
                    m_quads[i].Vertices[3].Position = pos;
                    // label the bar
                    m_quads[i].Label.Text   = i.ToString();
                    m_quads[i].Label.Anchor = new PointF(.5f, -1);

                    // bars will be transparent, oldest fading to OpacityOldest
                    m_quads[i].Opacity = (byte)(m_oldestOpacity + i * (255 - m_oldestOpacity) / m_quads.Length);
                    // add the bar to the scene graph node (base)
                    Add(m_quads[i]);
                }
            }
        }
Example #5
0
        protected void createQuads(ILBaseArray data) {
            if (data == null || data.Length == 0) {
                Clear(); 
                m_quads = new ILQuad[0];
            } else {
                Clear(); 
                m_quads = new ILQuad[data.Length]; 
                ILColorEnumerator colors = new ILColorEnumerator(); 
                ILArray<float> fData = null; 
                if (data is ILArray<float>) {
                    fData = (ILArray<float>)data; 
                } else {
                    fData = ILMath.tosingle(data);
                }
                for (int i = 0; i < m_quads.Length; i++) {
                    m_quads[i] = new ILQuad(m_panel); 
                    m_quads[i].Border.Visible = true; 
                    m_quads[i].FillColor = colors.NextColor(); 
                    ILPoint3Df pos = new ILPoint3Df(); 
                    pos.X = i - m_barWidth / 2; 
                    pos.Y = 0; 
                    pos.Z = -0.5f; 
                    m_quads[i].Vertices[0].Position = pos; 
                    pos.X += m_barWidth; 
                    m_quads[i].Vertices[1].Position = pos; 
                    pos.Y += fData.GetValue(i); 
                    m_quads[i].Vertices[2].Position = pos; 
                    pos.X -= m_barWidth; 
                    m_quads[i].Vertices[3].Position = pos; 
                    // label the bar
                    m_quads[i].Label.Text = i.ToString(); 
                    m_quads[i].Label.Anchor = new PointF(.5f,-1);   

                    // bars will be transparent, oldest fading to OpacityOldest
                    m_quads[i].Opacity = (byte)(m_oldestOpacity + i * (255 - m_oldestOpacity) / m_quads.Length); 
                    // add the bar to the scene graph node (base)
                    Add(m_quads[i]); 
                }
            }
        }