Je veux convertir un tableau de struct en tableau de Point3D. L'extrait de code est le suivant:Comment puis-je convertir d'un tableau de struct en tableau de Point3D?
classe Mymesh { MeshGeometry3D publics Mesh3D // Propriétés tanimlaniyor {get {return GetMesh3D(); }}
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);
}
.
.
}
Ce code est produit le message d'erreur « Impossible de convertir 'Mymesh.mystruct' to'System.Windows.Media.Media3D.Point3D ».
Comment Je corriger cette erreur?
Merci à l'avance.
Onder YILMAZ