<div dir="ltr">Sorry last sentence is was incomplete:<br><br>Save your grid and you will have both arrays saved in the vtk file output for sure - and you will see that data1 is tagged as the SCALAR array.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b>Joachim Pouderoux</b><font size="2">, <font size="1">PhD</font></font><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>Technical Expert - Scientific Computing Team</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-04-04 16:05 GMT-04:00 Joachim Pouderoux <span dir="ltr"><<a href="mailto:joachim.pouderoux@kitware.com" target="_blank">joachim.pouderoux@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Houssen,<br><br></div>PointData (as CellData) is basically a set of arrays where some of them can be flagged as "the normal array", "the texture coordinates array", or even "the default scalar array".<br></div>Only one of the arrays of the PointData can be tagged a the scalar array but it does not mean you cannot have more than one array that could be considered as a scalar array.<br></div>Those flags are used by some VTK filters/algorithms to determine on which array to operate by default there are other mechanism (ie. SetArrayToProcess) to specify the<br></div>array(s) to be used by a filter. See <a href="http://www.vtk.org/doc/nightly/html/classvtkDataSetAttributes.html" target="_blank">vtkDataSetAttributes </a>for more info on this mechanism.<br><br></div>As Bill said, try this:<span class=""><br><br><span style="font-family:monospace,monospace">  vtkSmartPointer<vtkIntArray> data1 = vtkSmartPointer<vtkIntArray>::</span><span style="font-family:monospace,monospace"><wbr>New(); data1->SetName("data1");<br>  vtkSmartPointer<vtkIntArray> data2 = vtkSmartPointer<vtkIntArray>::</span></span><span style="font-family:monospace,monospace"><wbr>New(); data2->SetName("data2");<span class=""><br>  for (...) {data1->SetValue(idx, d1[i]); data2->SetValue(idx, d2[idx]) }<br></span>  uGrid->GetPointdata()-><wbr>AddArray(data1);<br>  uGrid->GetPointdata()-><wbr>AddArray(data2);<br>  uGrid->GetPointdata()-><wbr>SetScalars(data1); // specify that data1 is the array flagged as the scalar array</span><br><br></div>Save your grid and you will have both arrays saved but only "data1" in the vtk file output for sure.<br><br></div>Best,<br>
</div><div class="gmail_extra"><br clear="all"><div><div class="m_-6355296055774881354gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b>Joachim Pouderoux</b><font size="2">, <font size="1">PhD</font></font><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font size="1"><i>Technical Expert - Scientific Computing Team</i></font><br><b><font size="1"><a href="http://www.kitware.fr" target="_blank">Kitware SAS</a></font></b><br></blockquote>
</div></div></div></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">2017-04-02 13:12 GMT-04:00 houssen <span dir="ltr"><<a href="mailto:houssen@ipgp.fr" target="_blank">houssen@ipgp.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">May use a lookup table ? Not familiar with that but seems it's not what I need ?!...<br>
<br>
Somebody knows how to get back to this broken link ttp://<a href="http://article.gmane.org/gmane.comp.lib.vtk.user/6761/match=points+scalar+color" rel="noreferrer" target="_blank">article.gmane.org/gmane.<wbr>comp.lib.vtk.user/6761/match=p<wbr>oints+scalar+color</a> I got from <a href="http://public.kitware.com/pipermail/vtkusers/2003-August/019748.html" rel="noreferrer" target="_blank">http://public.kitware.com/pipe<wbr>rmail/vtkusers/2003-August/019<wbr>748.html</a><div class="m_-6355296055774881354HOEnZb"><div class="m_-6355296055774881354h5"><br>
<br>
Le 2017-04-02 18:39, houssen a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
KO ! Does not work (realize I tried this before !) => I only get<br>
data1 OR data2 (never both of them) in the written .vtu file...<br>
It is possible to make this work or to create a N-sized-vector.<br>
<br>
BTW, data1 is "pressure", data2 is "velocity" (that is data 1 and 2<br>
are not related to each other)<br>
<br>
Franck<br>
<br>
Le 2017-04-02 18:24, Bill Lorensen a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try<br>
uGrid->GetPointdata()->AddArra<wbr>y(data2);<br>
<br>
<br>
On Sun, Apr 2, 2017 at 12:01 PM, houssen <<a href="mailto:houssen@ipgp.fr" target="_blank">houssen@ipgp.fr</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
How to set several scalars to vtkPoint ?<br>
<br>
Seems vtkDataPoint scratchs the previous scalar array ?!<br>
<br>
vtkSmartPointer<vtkIntArray> data1 = vtkSmartPointer<vtkIntArray>::<wbr>New();<br>
data1->SetName("data1");<br>
vtkSmartPointer<vtkIntArray> data2 = vtkSmartPointer<vtkIntArray>::<wbr>New();<br>
data2->SetName("data2");<br>
for (...) {data1->SetValue(idx, d1[i]); data2->SetValue(idx, d2[idx]) }<br>
uGrid->GetPointdata()->SetScal<wbr>ars(data1); // OK<br>
uGrid->GetPointdata()->SetScal<wbr>ars(data2); // data2 scratch data1 ?!<br>
<br>
uGrid->GetPointdata()->SetActi<wbr>veScalar("data1") does not do what I need :<br>
seems that it activate data1 back but "scratch" data2 back.<br>
<br>
uGrid is a vtkUnstructuredGrid : the final goal is to write the grid to a<br>
file (with vtkWriter). In this file, I'd like to have BOTH data1 and data2<br>
for points.<br>
I only get either one or the other... How to get both ?<br>
<br>
Also tried to create a N-sized-vector (N=2 or 4) to associate to the<br>
vtkPoint : does not work as it seems vector dimension MUST be 3. I somebody<br>
knows a solution to attach a N-sized-vector to a vtkPoint, it could solve my<br>
problem<br>
<br>
Franck<br>
<br>
PS : found nothing relevant on the web, targetting VTK-7.<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtk-developers</a><br>
<br>
</blockquote></blockquote></blockquote>
<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>