<div dir="ltr"><div><div><div><div><div>Hi Sankhesh,<br></div>I am still struggling with this. By any chance do you have a code snippets which can. <br></div>The reason I want to create these cells because I want to use the <b>vtkSelectEnclosedPoints </b>class in my program by which I can mark points as to whether they are inside a closed surface. This is the reason I need to construct the closed surface out pof the vtk points I have created.<br><br></div>Any help will be really helpful at this stage to me.<br><br></div>Thanks,<br></div>Chiranjib<div><div><pre class="de1"><span class="sy1"></span></pre></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 12:06 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"><div><div><div><div>Sankhesh,<br></div>Thank you very much for your suggestion. Let me try it out. Amazon is showing the VTK books which are last updated on 2010. With the new versions of VTK, are you guys planning to have an updated version of the VTK books.<br><br></div>I will write back after trying your suggestions.<br><br></div>Thanks again,<br></div>Chiranjib<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 22, 2015 at 6:46 PM, Sankhesh Jhaveri <span dir="ltr"><<a href="mailto:sankhesh.jhaveri@kitware.com" target="_blank">sankhesh.jhaveri@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"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Chiranjib,<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">The code segment adds 'count' number of cells with one point per cell.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">This <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/IterateOverLines" target="_blank">example</a> creates a set of lines () with a bunch of points. That should give you some idea about the data structures.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Some basic concepts are explained here: <a href="http://www.vtk.org/Wiki/VTK/Tutorials" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials</a><br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Other than that, you can refer to the <a href="http://www.amazon.com/VTK-Users-Guide-Kitware/dp/1930934238/ref=as_sl_pc_tf_til?tag=kitinc-20&linkCode=w00&linkId=O634K4YN4IH7SJ6V&creativeASIN=1930934238" target="_blank">VTK User's guide</a> or the <a href="http://www.amazon.com/Visualization-Toolkit-Object-Oriented-Approach-Graphics/dp/193093419X/ref=as_sl_pc_tf_til?tag=kitinc-20&linkCode=w00&linkId=CZW6DJTGVZD3YQJP&creativeASIN=193093419X" target="_blank">VTK Textbook</a> for more details. <br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">You could also look at the <a href="http://www.vtk.org/doc/nightly/html/" target="_blank">API documentation</a>.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)"><br></div></div><div class="gmail_extra"><span><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span style="color:rgb(11,83,148)"><br></span></div><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Warm Regards,<br><br></span></span></div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Sankhesh Jhaveri<br>Research & Development Engineer</span></span><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Kitware, Inc.<br><b>Phone</b>: (518) 881 4417<br><b>Fax</b>: (518) 371 4573</span></span><br><b></b><br> </div></div></div></div></div></div></div></div>
<br></span><div class="gmail_quote"><span>On Tue, Jul 21, 2015 at 1:24 PM, Chiranjib Sur <span dir="ltr"><<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr"><div><div>Hi Sankesh,<br></div>Thanks for the pointers. If I change this to the following<span><br><br><br><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> for (vtkIdType i= 0; i < count; i++)</font></div></span><div><font face="monospace, monospace" color="#0000ff"> {<br></font><font face="monospace, monospace" color="#0000ff"> cell->InsertNextCell( i );</font><br></div><div><font face="monospace, monospace" color="#0000ff"><span style="white-space:pre-wrap"> </span>cell->InsertCellPoint(i);</font></div><div><font face="monospace, monospace" color="#0000ff"> }</font></div>will this mean the same what you are suggesting? In that case how the points are getting distributed ? I have been learning VTK by going through the examples. Indeed they are useful.<br><br></div><div>I would really appreciate, if you can point me towards some "description" of VTK cells / normals /Tcoords etc that will be very helpful to understand the underlying concepts easily.<br><br></div><div>Thanks,<br></div><div>Chiranjib<br></div></div></span><div><div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Tue, Jul 21, 2015 at 8:27 PM, Sankhesh Jhaveri <span dir="ltr"><<a href="mailto:sankhesh.jhaveri@kitware.com" target="_blank">sankhesh.jhaveri@kitware.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Hi Chiranjib,<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Your code calls InsertNextCell once and adds all points to that cell using InsertCellPoint. Thats why you just end up with one cell.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">You can add more cells by calling InsertNextCell as many times as the number of cells you want. You will have to distribute the points in the resultant cells accordingly.<br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small;color:rgb(11,83,148)">Take a look at examples here: <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx</a><br><br></div></div></span><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><span style="color:rgb(11,83,148)"><br></span></div><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Warm Regards,<br><br></span></span></div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Sankhesh Jhaveri<br>Research & Development Engineer</span></span></span><div><span style="color:rgb(11,83,148)"><span style="font-family:verdana,sans-serif">Kitware, Inc.<br><b>Phone</b>: <a href="tel:%28518%29%20881%204417" value="+15188814417" target="_blank">(518) 881 4417</a><br><b>Fax</b>: <a href="tel:%28518%29%20371%204573" value="+15183714573" target="_blank">(518) 371 4573</a></span></span><br><b></b><br> </div></div></div></div></div></div></div></div><div><div>
<br><div class="gmail_quote"><div><div>On Mon, Jul 20, 2015 at 5:48 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"><div>Hi VTK experts,</div><div>I am not an expert vtk programmers like many others in the forum. I have a confusion.</div><div><br></div><div>I am creating a set of vtk points (and eventually a vtkpolydata) and want to create vtkcells for the associated points. I was looking at the examples and trying to implement this way ( <a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/VisualizationAlgorithms/Cxx/TubesWithVaryingRadiusAndColors.cxx" target="_blank">http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/VisualizationAlgorithms/Cxx/TubesWithVaryingRadiusAndColors.cxx</a>)</div><div><br></div><div>What I am observing is that when I create vtkcells, I only create ONE cell. What is going wrong here and why not all vtkcells are created? </div><div><br></div><div>Any suggestions ?</div><div><br></div><div>Thanks in advance,</div><div>Chiranjib</div><div><br></div><div>Here is my code snippet</div><div><br></div><div><br></div><div><br></div><div><font face="monospace, monospace" color="#0000ff">// VTK points are defined here</font></div><div><font face="monospace, monospace" color="#0000ff"> </font></div><div><font face="monospace, monospace" color="#0000ff"> vtkSmartPointer<vtkPoints> newPoints = vtkSmartPointer<vtkPoints>::New();</font></div><div><font face="monospace, monospace" color="#0000ff"> </font></div><div><font face="monospace, monospace" color="#0000ff">// Set precision for the vtk points</font></div><div><font face="monospace, monospace" color="#0000ff"> newPoints->SetDataType( VTK_DOUBLE );</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> unsigned int count = 0;</font></div><div><font face="monospace, monospace" color="#0000ff"> double resolution = 0.1;</font></div><div><font face="monospace, monospace" color="#0000ff"> </font></div><div><font face="monospace, monospace" color="#0000ff">// Create the points for the entire volume</font></div><div><font face="monospace, monospace" color="#0000ff"> for (unsigned int j = 0; j<10; j++)</font></div><div><font face="monospace, monospace" color="#0000ff"> {</font></div><div><font face="monospace, monospace" color="#0000ff"> for (unsigned int i = 0; i<10; i++)</font></div><div><font face="monospace, monospace" color="#0000ff"> {</font></div><div><font face="monospace, monospace" color="#0000ff"> for (unsigned int k = 0; k<10; k++)</font></div><div><font face="monospace, monospace" color="#0000ff"> {</font></div><div><font face="monospace, monospace" color="#0000ff"> newPoints->InsertNextPoint( x0[0]+ resolution*i, x0[1]+ resolution*j, x0[2]+ resolution*k );</font></div><div><font face="monospace, monospace" color="#0000ff"> count++;</font></div><div><font face="monospace, monospace" color="#0000ff"> } </font></div><div><font face="monospace, monospace" color="#0000ff"> } </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">std::cout << "length of mycube = " << xl << ","<<yl<<","<<zl << std::endl;</font></div><div><font face="monospace, monospace" color="#0000ff">std::cout << "Number of points = " << count << std::endl;</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> // Insert vtk cell arrays</font></div><div><font face="monospace, monospace" color="#0000ff"> vtkSmartPointer<vtkCellArray> cell = vtkSmartPointer<vtkCellArray>::New();</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> cell->InsertNextCell( count);</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> for (vtkIdType i= 0; i < count; i++)</font></div><div><font face="monospace, monospace" color="#0000ff"> {</font></div><div><font face="monospace, monospace" color="#0000ff"><span style="white-space:pre-wrap"> </span> cell->InsertCellPoint(i);</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">// Define the polydata for the cube</font></div><div><font face="monospace, monospace" color="#0000ff"> vtkSmartPointer<vtkPolyData> np = vtkSmartPointer<vtkPolyData>::New();</font></div><div><font face="monospace, monospace" color="#0000ff"> np->SetPoints( newPoints );</font></div><div><font face="monospace, monospace" color="#0000ff"> np->SetLines( cell);</font></div><div><font face="monospace, monospace" color="#0000ff"><br></font></div><div><font face="monospace, monospace" color="#0000ff"> std::cout << "Number of cells "<< np->GetNumberOfCells() << ":" << count << std::endl;</font></div><div><br></div></div>
<br></div></div>_______________________________________________<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/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" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>