Contains the data for contourplot data.
Inheritance: XYPlotValue
Ejemplo n.º 1
0
        public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z)
        {
            var plot = new ContourPlotValue();

            plot.AddPoints(X, Y, Z);
            return(plot);
        }
Ejemplo n.º 2
0
        public ContourPlotValue Function(MatrixValue Z, MatrixValue v)
        {
            var plot = new ContourPlotValue();

            plot.AddPoints(Z);
            plot.SetLevels(v);
            return(plot);
        }
Ejemplo n.º 3
0
        public ContourPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z, ScalarValue n)
        {
            var nn   = n.GetIntegerOrThrowException("n", Name);
            var plot = new ContourPlotValue();

            plot.AddPoints(X, Y, Z);
            plot.SetLevels(nn);
            return(plot);
        }
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var cp = new ContourPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                cp.Deserialize(ds);
                cp.ColorPalette = (ColorPalettes)ds.GetInt();
                cp.ShowLevel    = ds.GetBoolean();
                cp.Levels       = new double[ds.GetInt()];

                for (var i = 0; i < Levels.Length; i++)
                {
                    Levels[i] = ds.GetDouble();
                }

                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points <ContourPoint>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x = ds.GetDouble();
                        var y = ds.GetDouble();
                        var z = ds.GetDouble();

                        points.Add(new ContourPoint
                        {
                            X         = x,
                            Y         = y,
                            Magnitude = z
                        });
                    }

                    cp.AddSeries(points);
                }
            }

            return(cp);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var cp = new ContourPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                cp.Deserialize(ds);
                cp.ColorPalette = (ColorPalettes)ds.GetInt();
                cp.ShowLevel = ds.GetBoolean();
                cp.Levels = new double[ds.GetInt()];

                for (var i = 0; i < Levels.Length; i++)
                    Levels[i] = ds.GetDouble();

                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points<ContourPoint>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x = ds.GetDouble();
                        var y = ds.GetDouble();
                        var z = ds.GetDouble();

                        points.Add(new ContourPoint
                        {
                            X = x,
                            Y = y,
                            Magnitude = z
                        });
                    }

                    cp.AddSeries(points);
                }
            }

            return cp;
        }