That is correct that you will need to create an interop wrapper for the 3D graph ActiveX control if you want to use the 3D graph in a Windows Forms project. However, data types like CNiReal64Vector are only in the C++ interfaces and are not in the ActiveX interface, hence you can use normal .NET data types and will not need to create the C++ data types. The interop wrapper will convert the .NET data types to the expected ActiveX data types and will pass those data types on to the ActiveX control. For example, here is a C# example that demonstrates how to plot a dual sine surface on the interop wrapper of the 3D graph:
const int size = 40;
double[] xData = new double[size];
double[] yData = new double[size];
double[,] z
Data = new double[size, size];
for (int i = 0; i < size; ++i)
xData[i] = yData[i] = ((i - 20.0) / 20.0) * Math.PI;
for (int i = 0; i < size; ++i)
{
for (int j = 0; j < size; ++j)
zData[j, i] = Math.Sin(xData[i]) * Math.Cos(yData[j]) + 2.0;
}
graph3D.Plot3DSurface(xData, yData, zData, Type.Missing);
- Elton