<div dir="ltr">Hi Seb,<div>I tried the method you suggested. </div><div><br></div><div>The typical vtp structure is something like the following :</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><div><font face="monospace, monospace" color="#0000ff"><?xml version="1.0"?></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"><VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"> <PolyData></font></div></div><div><font face="monospace, monospace" color="#0000ff"> .....</font></div></blockquote><div><br></div><div>When I use the method you suggested, I can generate field data under <polydata> which looks like the following ;</div><div><font face="monospace, monospace"><br></font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="monospace, monospace" color="#0000ff"><?xml version="1.0"?></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"><VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"> <PolyData></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"> <FieldData></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"> <DataArray type="Float64" Name="MYString" NumberOfTuples="0" format="appended" RangeMin= .......... /></font></div></div><div><div><font face="monospace, monospace" color="#0000ff"> </FieldData></font></div></div></blockquote><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">I understand how I get this since, my polydata writer is set as the following :</font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace" color="#0000ff">vtkSmartPointer<vtkXMLPolyDataWriter> w = vtkSmartPointer<vtkXMLPolyDataWriter>::New();</font></div><div><font face="monospace, monospace" color="#0000ff">vtkSmartPointer<vtkPolyData> p = vtkSmartPointer<vtkPolyData>::New();</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff">vtkSmartPointer<vtkDoubleArray> s = vtkSmartPointer<vtkDoubleArray>::New();</font></div><div><font face="monospace, monospace" color="#0000ff">s->SetName ("MyString");</font></div><div><font face="monospace, monospace" color="#0000ff">...</font></div><div><font face="monospace, monospace" color="#0000ff">p->GetFieldData()->AddArray(s);</font></div><div><font face="monospace, monospace" color="#0000ff">...</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff">w-> SetInputData(p);</font></div><div><font face="monospace, monospace" color="#0000ff">w->Write();</font></div></blockquote><div><br></div><div><br></div><div><br></div><div>But what is want is the following (new lines marked in Red) and not related to the polydata at all.</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="monospace, monospace" color="#0000ff"><?xml version="1.0"?></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="monospace, monospace" color="#0000ff"><VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="monospace, monospace" color="#0000ff"> </font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><span style="font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000"><MyParameters></font></span></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div style="font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000"> <Parameter1>Integer Value </Parameter1></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div style="font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000"> <Parameter2>Double Value </Parameter2></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div style="font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000"> <Parameter3>String Value </Parameter3></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div style="font-size:12.8000001907349px"><font face="monospace, monospace" color="#ff0000"></MyParameters></font></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace" color="#0000ff"><br></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace" color="#0000ff"><PolyData></font></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace" color="#0000ff">......</font></div></blockquote></blockquote><div><br></div><div><br></div><div>What would be your suggestion about doing this ? I need to write my own writer class or can I use something which exists ?</div><div><br></div><div>Thanks in advance,</div><div>Chiranjib</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 8:59 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">polydata->GetFieldData()->AddArray( anyArrayYouWant )<div><br></div><div>anyArrayYouWant can be a String array with only one value that contain your XML text.<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 9:19 AM, Chiranjib Sur <span dir="ltr"><<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">HI Seb,<div>Thanks for your answer. My issue is to write the data into the vtp file along with other information like pointdata etc. I am able to generate the data but i have no clue how to write in the format I want to. I am using vtkPolyDataWeiter class to write the .vtp file but in between how can I insert few XML tags with some values ? </div><div><br></div><div>If you can point towards some examples which you are referring to as the fields data, that might help.</div><div><br></div><div>Thanks,</div><div>Chiranjib</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 8:43 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You can use fields data to store any random information regarding your dataset. <div><br></div><div>I'm not sure that's what you ask, but at least that's what it seems.</div><div><br></div><div>Seb</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Thu, Mar 19, 2015 at 8:06 AM, Chiranjib Sur <span dir="ltr"><<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hello Experts,<div><div><div>When I generate my polydata and write the information in a .vtp file, I want to write few addition information like the following in the same file along with the polydata information:</div><div><br></div><div><MyParameters></div><div> <Parameter1>Integer Value </Parameter1></div><div> <Parameter2>Double Value </Parameter2><br></div><div> <Parameter3>String Value </Parameter3><br></div><div></MyParameters><br></div><div><br></div><div>Is there any vtk class that will help me doing this ?</div><div><br></div><div>Thanks in advance,</div><div>Chiranjib</div></div></div></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>