<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi James<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Glad you got that part working.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It sounds like you want to do something like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/SurfaceFromUnorganizedPoints">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/SurfaceFromUnorganizedPoints</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Gerrick<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></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"> James Labiak [mailto:jim@jslengineeringsoftware.com]
<br>
<b>Sent:</b> Friday, September 25, 2015 8:55 AM<br>
<b>To:</b> Sebastien Jourdain; Gerrick Bivins<br>
<b>Cc:</b> vtkusers<br>
<b>Subject:</b> Re: [EXTERNAL] Re: [vtkusers] Java vtkPointToCellData<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt">I got the verts to work and can plot the points, but am struggling to create a surface through the points. Any recommendations on an approach? The geometry is similar to: cut a
 rectangle through a sphere and slide the piece out; the sphere faces that remain are similar to my geometry (just small deviations), but I am focusing on simply trying to create one surface on one face.</span><o:p></o:p></p>
<div>
<p class="MsoNormal">On 9/22/2015 9:36 AM, Sebastien Jourdain wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">I wasn't sure at first based on your comment, but I don't think vtkPointDataToCellData is meant to create Cells.
<o:p></o:p></p>
<div>
<p class="MsoNormal">And if you don't create any cell, then you won't be able to see anything.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">You can create a single polyverts with all the points ids.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">vtkCellArray verts = new vtkCellArray();<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">verts.InsertNextCell( points.GetNumberOfPoints() );<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">for(int i=0; i < points.GetNumberOfPoints(); i++) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">    verts.InsertNextPoint(i);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">polyDataWithCells.SetVerts(verts)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">But that should be enough to get you started with an appropriate IDE.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Seb<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, Sep 22, 2015 at 6:35 AM, Gerrick Bivins <<a href="mailto:Gerrick.Bivins@halliburton.com" target="_blank">Gerrick.Bivins@halliburton.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">“Verts” cell array of the polydata.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><img border="0" width="1429" height="781" id="_x0000_i1025" src="cid:image001.jpg@01D0F772.31EC5A50"><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Gerrick</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;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>
}</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On 9/21/2015 10:38 AM, Sebastien Jourdain wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Try that
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">vtkPointDataToCellData polyDataCreateCells = new vtkPointDataToCellData();<br>
polyDataCreateCells.SetInputData(polyData);<br>
polyDataCreateCells.PassPointDataOn();<br>
polyDataCreateCells.Update();  // <==== For the execution of the filter<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Sep 21, 2015 at 8:20 AM, James Labiak <<a href="mailto:jim@jslengineeringsoftware.com">jim@jslengineeringsoftware.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;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">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><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</blockquote>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>-- <o:p></o:p></pre>
<pre>James Labiak<o:p></o:p></pre>
<pre>JSL Engineering and Software<o:p></o:p></pre>
<pre>Mobile: 231-638-3725<o:p></o:p></pre>
<pre>email: <a href="mailto:jim@jslengineeringsoftware.com">jim@jslengineeringsoftware.com</a><o:p></o:p></pre>
</div>
</body>
</html>