Contains the data for surface and mesh plots.
Inheritance: XYZPlotValue
        /// <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 sp = new SurfacePlotValue();

            using (var ds = Deserializer.Create(content))
            {
                sp.Deserialize(ds);
                sp.IsMesh       = ds.GetBoolean();
                sp.ColorPalette = (ColorPalettes)ds.GetInt();
                sp.data.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();

                    data.Add(new Vertex
                    {
                        X = x,
                        Y = y,
                        Z = z
                    });
                }
            }

            return(sp);
        }
Exemple #2
0
 public SurfacePlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z)
 {
     var splot = new SurfacePlotValue();
     splot.IsSurf = true;
     splot.IsMesh = false;
     splot.AddPoints(X, Y, Z);
     return splot;
 }
Exemple #3
0
        public SurfacePlotValue Function(MatrixValue Z)
        {
            var splot = new SurfacePlotValue();

            splot.AddPoints(Z);
            splot.IsMesh = true;
            splot.IsSurf = false;
            return(splot);
        }
        /// <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 sp = new SurfacePlotValue();

            using (var ds = Deserializer.Create(content))
            {
                sp.Deserialize(ds);
                sp.IsMesh = ds.GetBoolean();
                sp.ColorPalette = (ColorPalettes)ds.GetInt();
                sp.data.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();

                    data.Add(new Vertex
                    {
                        X = x,
                        Y = y,
                        Z = z
                    });
                }
            }

            return sp;
        }