/// <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); }
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; }
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; }