I am writing an output module to visualize my data on another program.
If you inspect the code, i add point coordinates to a string and then add this string as a TextNode to another element. Problem is number of points can be more than 500000
Is there a better way to write a lot of text to xml or is this OK?
XMLElement points = doc.CreateElement("VTK", "DataArray");
string str = "";
for (int i = 0; i < sim.NumberOfParticles; i++)
{
str += sim.pPosX[i].ToString() + " " + sim.pPosY[i] + " " + sim.pPosZ[i] + "\n"
}
XmlText coordinates = doc.CreateTextNode(str);
points.AppendChild(coordinates);