<div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div><span>Hi Bill,</span></div><div id="yui_3_16_0_1_1431173603378_56071"><span></span><br></div><div id="yui_3_16_0_1_1431173603378_55708" dir="ltr"><span id="yui_3_16_0_1_1431173603378_55707">I edited my post shortly after I wrote it because I was able to get the vtkPolyData object from my actor.</span></div><div id="yui_3_16_0_1_1431173603378_55704" dir="ltr"><span></span><br></div><div id="yui_3_16_0_1_1431173603378_55706" dir="ltr"><span id="yui_3_16_0_1_1431173603378_55705">However I could not find the SetInput() method for the writer, so I tried SetInputData. This crashes the Java virtual machine.</span></div><div id="yui_3_16_0_1_1431173603378_55339" dir="ltr"><span></span><br></div><div id="yui_3_16_0_1_1431173603378_55701" dir="ltr"><span id="yui_3_16_0_1_1431173603378_55700">I will try to understand your C++ code sample, but Java is very different, and it seems that not all C++ methods are exposed to Java.</span></div><div id="yui_3_16_0_1_1431173603378_55702" dir="ltr"><span></span><br></div><div id="yui_3_16_0_1_1431173603378_55703" dir="ltr"><span>Thanks for the help.</span></div><div id="yui_3_16_0_1_1431173603378_55709" dir="ltr"><span>Kent</span></div> <br><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Saturday, May 9, 2015 12:07 PM, Bill Lorensen [via VTK] <<a href="/user/SendEmail.jtp?type=node&node=5731861&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv4014349576"><div>
Here is what I do in C++:
<br clear="none">vtkSmartPointer<vtkActorCollection> actors =
<br clear="none"> vtkSmartPointer<vtkActorCollection>::New();
<br clear="none"> actors = renderer->GetActors();
<br clear="none"> actors->InitTraversal();
<br clear="none"> for (vtkIdType a = 0; a < actors->GetNumberOfItems(); ++a)
<br clear="none"> {
<br clear="none"> vtkActor * actor = actors->GetNextActor();
<br clear="none"> vtkPolyData *pd = vtkPolyData::SafeDownCast(actor->GetMapper()->GetInput());
<br clear="none"> vtkSmartPointer<vtkCleanPolyData> clean =
<br clear="none"> vtkSmartPointer<vtkCleanPolyData>::New();
<br clear="none"> clean->SetInputData(pd);
<br clear="none"> vtkSmartPointer<vtkPolyDataNormals> normals =
<br clear="none"> vtkSmartPointer<vtkPolyDataNormals>::New();
<br clear="none"> normals->SetInputConnection(clean->GetOutputPort());
<br clear="none"> normals->Update();
<br clear="none"> vtkPolyDataMapper *mapper =
<br clear="none">vtkPolyDataMapper::SafeDownCast(actor->GetMapper());
<br clear="none"> mapper->SetInputData(normals->GetOutput());
<br clear="none"> }
<br clear="none"><br clear="none"><br clear="none">On Sat, May 9, 2015 at 2:48 PM, kent myers via vtkusers
<br clear="none"><<a href="" rel="nofollow" shape="rect" target="_top" link="external">[hidden email]</a>> wrote:
<div class="yiv4014349576shrinkable-quote"><div class='shrinkable-quote'><br clear="none">> I am trying to export a vtkPolyData object to a vtp file using
<br clear="none">> vtkXMLPolyDataWriter. The online VTK documentation says to use the
<br clear="none">> writer.SetInput() method that takes a vtkPolyData object.
<br clear="none">>
<br clear="none">> I am having some problems with this strategy:
<br clear="none">> 1. I can get the vtkMapper object from my vtkActor, but the vtkMapper object
<br clear="none">> has no GetInput() method to retrieve a vtkPolyData object (or any other
<br clear="none">> method)
<br clear="none">> 2. vtkXMLPolyDataWriter has no SetInput() method (or any other method) to
<br clear="none">> pass the vtkPolyData object even if I could get the vtkPolyData object.
<br clear="none">>
<br clear="none">> Has anyone successfully exported vtkPolyData from a Java application? If so,
<br clear="none">> how?
<br clear="none">>
<br clear="none">>
<br clear="none">>
<br clear="none">>
<br clear="none">>
<br clear="none">> --
<br clear="none">> View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Get-vtkPolyData-from-vtkMapper-in-vtkActor-using-Java-API-tp5731859.html" target="_blank" rel="nofollow" shape="rect" link="external">http://vtk.1045678.n5.nabble.com/Get-vtkPolyData-from-vtkMapper-in-vtkActor-using-Java-API-tp5731859.html</a><br clear="none">> Sent from the VTK - Users mailing list archive at Nabble.com.
<br clear="none">> _______________________________________________
<br clear="none">> Powered by www.kitware.com
<br clear="none">>
<br clear="none">> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="nofollow" shape="rect" link="external">http://www.kitware.com/opensource/opensource.html</a><br clear="none">>
<br clear="none">> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" rel="nofollow" shape="rect" link="external">http://www.vtk.org/Wiki/VTK_FAQ</a><br clear="none">>
<br clear="none">> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank" rel="nofollow" shape="rect" link="external">http://markmail.org/search/?q=vtkusers</a><br clear="none">>
<br clear="none">> Follow this link to subscribe/unsubscribe:
<br clear="none">> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank" rel="nofollow" shape="rect" link="external">http://public.kitware.com/mailman/listinfo/vtkusers</a></div></div><br clear="none"><br clear="none">--
<br clear="none">Unpaid intern in BillsBasement at noware dot com
<div class="yiv4014349576yqt2538392849" id="yiv4014349576yqtfd58567"><br clear="none">_______________________________________________
<br clear="none">Powered by www.kitware.com
<br clear="none"><br clear="none">Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="nofollow" shape="rect" link="external">http://www.kitware.com/opensource/opensource.html</a><br clear="none"><br clear="none">Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" rel="nofollow" shape="rect" link="external">http://www.vtk.org/Wiki/VTK_FAQ</a><br clear="none"><br clear="none">Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank" rel="nofollow" shape="rect" link="external">http://markmail.org/search/?q=vtkusers</a><br clear="none"><br clear="none">Follow this link to subscribe/unsubscribe:
<br clear="none"><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank" rel="nofollow" shape="rect" link="external">http://public.kitware.com/mailman/listinfo/vtkusers</a></div><br clear="none">
<br clear="none">
<br clear="none">
<hr size="1" color="#cccccc" noshade="">
<div style="font: 12px/normal tahoma, geneva, helvetica, arial, sans-serif; color: rgb(68, 68, 68); font-size-adjust: none; font-stretch: normal;">
<div style="font-weight: bold;">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://vtk.1045678.n5.nabble.com/Get-vtkPolyData-from-vtkMapper-in-vtkActor-using-Java-API-tp5731859p5731860.html" target="_blank" rel="nofollow" shape="rect" link="external">http://vtk.1045678.n5.nabble.com/Get-vtkPolyData-from-vtkMapper-in-vtkActor-using-Java-API-tp5731859p5731860.html</a>
</div>
<div style="font: 11px/1.5em tahoma, geneva, helvetica, arial, sans-serif; color: rgb(102, 102, 102); margin-top: 0.4em; font-size-adjust: none; font-stretch: normal;">
To unsubscribe from Get vtkPolyData from vtkMapper in vtkActor using Java API, <a href="" target="_blank" rel="nofollow" shape="rect" link="external">click here</a>.<br clear="none">
<a style="font: 9px/normal serif; font-size-adjust: none; font-stretch: normal;" href="http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" target="_blank" rel="nofollow" shape="rect" link="external">NAML</a><div class="yiv4014349576yqt2538392849" id="yiv4014349576yqtfd47226">
</div></div></div></div><br><br></div> </div> </div> </div></div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Write-vtkPolyData-to-vtp-file-using-Java-API-tp5731859p5731861.html">Re: Get vtkPolyData from vtkMapper in vtkActor using Java API</a><br/>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK - Users mailing list archive</a> at Nabble.com.<br/>