using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
namespace Infragistics.Models
{
// TODO add data model
// TODO add data source
}
このトピックでは、XamDataChart™ コントロールおよびその散布エリア シリーズおよび散布等高線シリーズ タイプで使用するデータおよびデータ モデルを提供します。
C# の場合:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
namespace Infragistics.Models
{
// TODO add data model
// TODO add data source
}
C# の場合:
public class ShapePoint3D
{
public double X { get; set; }
public double Y { get; set; }
public double Z { get; set; }
}
C# の場合:
public abstract class Surface3D : ObservableCollection<ShapePoint3D>
{
public Surface3D()
: this(11, 11)
{
}
public Surface3D(int xCount, int yCount)
: this(-100, 100, -100, 100, xCount, yCount)
{
}
public Surface3D(double xMin, double xMax,
double yMin, double yMax,
int xCount = 11, int yCount = 11)
{
XMin = xMin;
XMax = xMax;
YMin = xMin;
YMax = yMax;
XCount = xCount;
YCount = yCount;
Generate();
}
public double XMin { get; private set; }
public double XMax { get; private set; }
public double YMin { get; private set; }
public double YMax { get; private set; }
public double XCount { get; private set; }
public double YCount { get; private set; }
protected void Generate()
{
var xStep = (XMax - XMin) / (XCount - 1);
var yStep = (YMax - YMin) / (YCount - 1);
for (var x = XMin; x <= XMax; x += xStep)
{
for (var y = YMin; y <= YMax; y += yStep)
{
this.Add(new ShapePoint3D { X = x, Y = y, Z = this.Z(x, y) });
}
}
}
protected abstract new double Z(double x, double y);
}
public class CosXPlusCosY : Surface3D
{
protected override double Z(double x, double y)
{
return Math.Cos(x) + Math.Cos(y);
}
}