構造体の配列をPoint3Dの配列に変換したい。 コードスニペットは以下の通りである:構造体の配列をPoint3Dの配列に変換するにはどうすればよいですか?
クラス {公共MeshGeometry3D Mesh3D //プロパティtanimlaniyor {GET {GetMesh3Dを返すMymesh()。 }}
public struct mystruct
{
public int m_i;
public int m_j;
public int m_k;
public mystruct(int i, int j, int k)
{
m_i = i;
m_j = j;
m_i = k;
}
}
private mystruct[] mypts =
{
new mystruct(20 , 7 , 7),
.
.
new mystruct(23 , 5 , 7)
};
public MeshGeometry3D GetMesh3D()
{
mesh.Positions.Add(mypts(1); *// The error is given at just this line.*
.
.
mesh.Positions.Add(mypts(50);
}
.
.
}
このコードは、エラーメッセージが「 'Mymesh.mystruct' to'System.Windows.Media.Media3D.Point3D」から変換できません生産している。
どのようにすることができます私はこのエラーを克服する?事前に
感謝。
Onderユルマズ