Container for 3D plots.
Inheritance: XYZPlotValue
Example #1
0
        public Plot3DValue Function(MatrixValue X, MatrixValue Y, MatrixValue Z)
        {
            var p3 = new Plot3DValue();

            p3.AddPoints(X, Y, Z);
            return(p3);
        }
Example #2
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 p3 = new Plot3DValue();

            using (var ds = Deserializer.Create(content))
            {
                p3.Deserialize(ds);
                p3.IsLogX = ds.GetBoolean();
                p3.IsLogY = ds.GetBoolean();
                p3.IsLogZ = ds.GetBoolean();
                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points <PointTriple>();
                    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 PointTriple
                        {
                            X = x,
                            Y = y,
                            Z = z
                        });
                    }

                    p3.AddSeries(points);
                }
            }

            return(p3);
        }
Example #3
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 p3 = new Plot3DValue();

            using (var ds = Deserializer.Create(content))
            {
                p3.Deserialize(ds);
                p3.IsLogX = ds.GetBoolean();
                p3.IsLogY = ds.GetBoolean();
                p3.IsLogZ = ds.GetBoolean();
                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points<PointTriple>();
                    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 PointTriple
                        {
                            X = x,
                            Y = y,
                            Z = z
                        });
                    }

                    p3.AddSeries(points);
                }
            }

            return p3;
        }