<div dir="ltr">I wasn't sure at first based on your comment, but I don't think vtkPointDataToCellData is meant to create Cells.<div>And if you don't create any cell, then you won't be able to see anything.</div><div>You can create a single polyverts with all the points ids.</div><div><br></div><div>vtkCellArray verts = new vtkCellArray();</div><div>verts.InsertNextCell( points.GetNumberOfPoints() );</div><div>for(int i=0; i < points.GetNumberOfPoints(); i++) {</div><div>    verts.InsertNextPoint(i);</div><div>}</div><div><br></div><div>polyDataWithCells.SetVerts(verts)<br></div><div><br></div><div>The code above, should create the expected cells. Just be aware that it was written in a mail with uncertainty regarding the method names and class names.</div><div>But that should be enough to get you started with an appropriate IDE.</div><div><br></div><div>Seb</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 22, 2015 at 6:35 AM, Gerrick Bivins <span dir="ltr"><<a href="mailto:Gerrick.Bivins@halliburton.com" target="_blank">Gerrick.Bivins@halliburton.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The vtp file seems invalid. It looks like the cells aren’t defined.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Even if the polydata is just points, I think you still have to define the<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">“Verts” cell array of the polydata.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><img width="1429" height="781" src="cid:image001.jpg@01D0F509.4A5AF490"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Gerrick<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> vtkusers [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>]
<b>On Behalf Of </b>James Labiak<br>
<b>Sent:</b> Monday, September 21, 2015 8:05 PM<br>
<b>To:</b> Sebastien Jourdain<br>
<b>Cc:</b> vtkusers<br>
<b>Subject:</b> [EXTERNAL] Re: [vtkusers] Java vtkPointToCellData<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt">Hi Sebastien,<br>
I made the change, but it still seems not to be running the filter. Attached is a java file and a .vtp data file to see what's happening. Also below is the code.<br>
Thanks,<br>
Jim<br>
<br>
package com.profiles;<br>
<br>
import vtk.*;<br>
<br>
public class PlotSomePolyDataFromFileRead {<br>
<br>
    public static void main(String[] args) {<br>
        try {<br>
            new PlotSomePolyDataFromFileRead();<br>
        } catch (Exception ex_new_PlotSomePolyDataFromFileRead) {<br>
            System.out.println("[main] Exception at new PlotSomePolyDataFromFileRead()");<br>
            ex_new_PlotSomePolyDataFromFileRead.printStackTrace();<br>
        }<br>
    }<br>
<br>
    // Load VTK libraries<br>
    static {<br>
        if (!vtkNativeLibrary.LoadAllNativeLibraries()) {<br>
            {<br>
                for (vtkNativeLibrary lib : vtkNativeLibrary.values()) {<br>
                    if (!lib.IsLoaded())<br>
                        System.out<br>
                                .println(lib.GetLibraryName() + " not loaded");<br>
                }<br>
                System.out.println("Make sure the search path is correct: ");<br>
                System.out.println(System.getProperty("java.library.path"));<br>
            }<br>
            vtkNativeLibrary.DisableOutputWindow(null);<br>
        }<br>
    }<br>
<br>
    private PlotSomePolyDataFromFileRead() {<br>
<br>
        // Read the polyData from the data file<br>
        vtkXMLPolyDataReader xmlReader = new vtkXMLPolyDataReader();<br>
        xmlReader.SetFileName("C:\\vtk123\\test_data.vtp");<br>
        xmlReader.Update();<br>
<br>
        // Use the filter vtkPointDataToCellData to create the<br>
        // cells from the point data that's in the vtkPolyData from the reader<br>
        // *The vtkPolyData from the reader intentionally only includes vtkPoints<br>
        // and their scalars (that's the given data from the application output)<br>
        vtkPointDataToCellData polyDataCreateCells = new vtkPointDataToCellData();<br>
        polyDataCreateCells.SetInputConnection(xmlReader.GetOutputPort());<br>
        polyDataCreateCells.PassPointDataOn();<br>
        polyDataCreateCells.Update();<br>
<br>
        // In order to check if the vtkPointDataToCellData filter worked:<br>
        // Create new polyData, retrieve polyData (with cells now) from<br>
        // polyDataCreateCells filter, check values during debug operation<br>
        vtkPolyData polyDataWithCells = new vtkPolyData();<br>
        polyDataWithCells = polyDataCreateCells.GetPolyDataOutput();<br>
        // At this point, polyDataWithCells has (when I run it)<br>
        // point data but not cell data, nor scalar data <br>
        // and it should have all 3<br>
<br>
        vtkPolyDataMapper polyMapper = new vtkPolyDataMapper();<br>
        polyMapper.SetInputData(polyDataCreateCells.GetPolyDataOutput());<br>
        polyMapper.Update();<br>
<br>
        vtkActor polyActor = new vtkActor();<br>
        polyActor.SetMapper(polyMapper);<br>
        polyActor.GetProperty().SetColor(1.0, 1.0, 1.0);<br>
        <br>
        vtkRenderer renderer = new vtkRenderer();<br>
        renderer.AddActor(polyActor);<br>
        renderer.SetBackground(0.0, 0.0, 0.0);<br>
<br>
        vtkRenderWindow renderWindow = new vtkRenderWindow();<br>
        renderWindow.AddRenderer(renderer);<br>
        renderWindow.SetSize(800, 800);<br>
<br>
        vtkRenderWindowInteractor renderWindowInteractor = new vtkRenderWindowInteractor();<br>
        renderWindowInteractor.SetRenderWindow(renderWindow);<br>
        <br>
        renderWindow.Render();<br>
        renderWindowInteractor.Start();<br>
    }<br>
}<br>
<br>
</span><u></u><u></u></p>
<div>
<p class="MsoNormal">On 9/21/2015 10:38 AM, Sebastien Jourdain wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Try that <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">vtkPointDataToCellData polyDataCreateCells = new vtkPointDataToCellData();<br>
polyDataCreateCells.SetInputData(polyData);<br>
polyDataCreateCells.PassPointDataOn();<br>
polyDataCreateCells.Update();  // <==== For the execution of the filter<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
// Create new polyData, retrieve completed polyData from polyDataCreateCells<br>
vtkPolyData polyDataComplete = polyDataCreateCells.GetPolyDataOutput(); // No need to create a polydata just get a ref from the filter<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Sep 21, 2015 at 8:20 AM, James Labiak <<a href="mailto:jim@jslengineeringsoftware.com" target="_blank">jim@jslengineeringsoftware.com</a>> wrote:<u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt">Hello all,<br>
I created a pipeline that seems to make sense to me, but always my polyDataComplete is empty. Any ideas why this code doesn't work? The only vtkPointToCellData example on the web that I can find uses blow.vtk, which doesn't exist on my 6.0.0 installation anywhere.
 The polyData variable gets correctly populated with the points and their scalars below.<br>
<br>
        // Create a new, empty polyData<br>
        polyData = new vtkPolyData();<br>
                <br>
        // populate the polyData points<br>
        polyData.SetPoints(points);<br>
<br>
        // populate the polyData scalars<br>
        polyData.GetPointData().SetScalars(colorsScalars);<br>
<br>
        vtkPointDataToCellData polyDataCreateCells = new vtkPointDataToCellData();<br>
        polyDataCreateCells.SetInputData(polyData);<br>
        polyDataCreateCells.PassPointDataOn();<br>
<br>
        // Create new polyData, retrieve completed polyData from polyDataCreateCells<br>
        vtkPolyData polyDataComplete = new vtkPolyData();<br>
        polyDataComplete = polyDataCreateCells.GetPolyDataOutput();<br>
<br>
        vtkPolyDataMapper polyMapper = new vtkPolyDataMapper();<br>
        polyMapper.SetInputData(polyDataComplete);<br>
        polyMapper.ScalarVisibilityOn();<br>
        polyMapper.SetScalarRange(scalarMin, scalarMax);<br>
        polyMapper.Update();<br>
        <br>
        vtkActor polyActor = new vtkActor();<br>
        polyActor.SetMapper(polyMapper);<br>
        polyActor.GetProperty().SetColor(1.0, 1.0, 1.0);<br>
<br>
// ...Usual render stuff...<br>
<br>
Thanks,<br>
Jim</span><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<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><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</blockquote>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>

<hr>This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.<br>
</div>

</blockquote></div><br></div>