<div dir="ltr">Hi Allen,<div>I restructured the point data part of my algorithm and thins are working as expected. Thanks for your suggestions.</div><div><br></div><div>Thanks,</div><div>Chiranjib</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 11:07 PM, 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 Allen,<div>Thanks for your reply. I now understand the philosophy behind the insert tuple thing. </div><div>One the other hand, to reply your questions (if I understood it correctly), I can do the get/set operation with scalars (single component) easily and correctly, which means my polydata points are created properly. What exactly you mean by "down stream".</div><div><br></div><div>I am new to this field and may be I am missing the terminologies. To reiterate, my problem is to assign same vector properties to my poly points but with different values (separated by offset).</div><div><br></div><div>Thanks again in advance for your help.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Chiranjib</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 9:49 PM, Allen Sanderson <span dir="ltr"><<a href="mailto:allen@sci.utah.edu" target="_blank">allen@sci.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">You do not need to do an insert next tuple as memory has already been allocated with the call to <span style="font-family:monospace,monospace">SetNumberOfTuples.</span><div><font face="monospace, monospace"><br></font></div><div>Right off I do see anything wrong with your approach. I would check the obvious does your polydata have points?? What happens to it down stream??</div><div><br></div><div><br></div><div><div><span style="border-collapse:separate;font-size:12px;border-spacing:0px"><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;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><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;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>Cheers,</div><div><br></div><div>Allen </div><div><br></div></span><br></span><br></span>
</div><div><div>
<br><div><div>On Mar 18, 2015, at 12:55 PM, Chiranjib Sur <<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">HI Allen,<div>Thanks for the pointer. I am having some issues with this. before explaining the issues let me state the problem I am trying to solve in bit more dtails.</div><div><br></div><div>I have a poly data which corresponds to to different set, i.e. the combined poly data I am dealing with correspond to two different section of the geometrical object. And I know the offset of the data set which differentiates object A from Object B from the polydata. </div><div><br></div><div>Now when I am trying to set value like velocity with 3 component, I am facing the issues. Although I do the following, the properties are getting assigned randomly. Here is the snippet of my code :</div><div><br></div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace, monospace">vtkSmartPointer<vtkDoubleArray> velocity = vtkSmartPointer<vtkDoubleArray>::New();</font></div><div><font face="monospace, monospace">velocity->SetName ("Velocity");</font></div><div><font face="monospace, monospace">velocity->SetNumberOfComponents(3);</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">velocity->SetNumberOfTuples( polydata->GetNumberOfPoints());</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">polydata->GetPointData()->AddArray( velocity );</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">   for (long long i = offset; i < polydata->GetNumberOfPoints(); ++i)      // offset determines the position of the polydata I want to start with instead of starting at == 0)</font></div><div><font face="monospace, monospace">   {</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap"> </span>   velocity->SetTuple3( i,  _Vx, _Vy, _Vz );            //_Vx,_Vy,_Vz are double and declared elsewhere</font></div><div><font face="monospace, monospace">   //      velocity->InsertNextTuple3(  _Vx, _Vy, _Vz );       // Instead of using SetTuple3, I can use InsertNextTuple3 or InsertTuple3 too.</font></div><div><font face="monospace, monospace">   }</font></div></blockquote><div><br></div><div>Am I doing anything wrong here ?</div><div><br></div><div>Thanks much,</div><div>Chiranjib</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 17, 2015 at 6:55 PM, Allen Sanderson <span dir="ltr"><<a href="mailto:allen@sci.utah.edu" target="_blank">allen@sci.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><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>Where : 0<= index < nTuples</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><span style="border-collapse:separate;font-size:12px;border-spacing:0px"><span style="border-collapse:separate;font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="margin:0px"><br></div><div style="margin:0px">Allen</div><div style="margin:0px"><br></div><div style="margin:0px"><br></div><div style="margin:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Allen Sanderson</font></div><div style="margin:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">SCI Institute</font></div><div style="margin:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">University of Utah</font></div><div style="margin:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica"><a href="http://www.sci.utah.edu/" target="_blank">www.sci.utah.edu</a></font></div><br></span></span><br></span></span>
</div>

<br><div><div><div><div>On Mar 17, 2015, at 1:03 PM, Chiranjib Sur <<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div><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" target="_blank">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></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></blockquote></div><br></div></blockquote></div><br></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></blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>