<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Here is some sample code:</div><div><br></div><div>vtkDoubleArray *velocityArray = vtkDoubleArray::New();</div><div>velocityArray->SetName(var.c_str());</div><div>// NOTE: you want to set the number of components BEFORE setting the number of Tuples so memory is correctly allocated.</div><div><br></div><div>velocityArray->SetNumberOfComponents(3);</div><div>velocityArray->SetNumberOfTuples(nTuples);</div><div>    </div><div>polydata->GetPointData()->AddArray(velocityArray);</div><div><br></div><div>double dx, dy, dz;</div><div><br></div><div>Loop: velocityArray->SetTuple3(index, dx, dy, dz);</div><div><div>Where : 0<= index < nTuples</div></div><div><br></div><div>velocityArray->Delete();</div><div><br></div><div><br></div><div>The get would be:</div><div><br></div><div><div>double *velocity = velocityArray->GetTuple3(l);</div><div>        </div><div> </div></div><div><span style="font-size: 12px; ">Cheers,</span></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; font-size: 12px; border-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Allen</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Allen Sanderson</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">SCI Institute</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">University of Utah</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="http://www.sci.utah.edu">www.sci.utah.edu</a></font></p><br class="Apple-interchange-newline"></span></span><br class="Apple-interchange-newline"></span></span>
</div>

<br><div><div>On Mar 17, 2015, at 1:03 PM, Chiranjib Sur <<a href="mailto:sur.chiranjib@gmail.com">sur.chiranjib@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi All,<div>I want to assign values (3 component vector) to all in a polydata set. </div><div>I found the email thread where the solution for a one component scalar data is explained (<a href="http://vtk.1045678.n5.nabble.com/Get-Set-values-in-scalar-data-td3259506.html">http://vtk.1045678.n5.nabble.com/Get-Set-values-in-scalar-data-td3259506.html</a>)</div><div><br></div><div>Anybody can help explaining how to do this for a 3-component vector data type.</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Chiranjib Sur</div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">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">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers">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">http://public.kitware.com/mailman/listinfo/vtkusers</a><br></blockquote></div><br></body></html>