<html><head></head><body><div class="ydpbffb97d3yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div>Hi Lucy <br></div><div><br></div><div>Try this</div><div><br></div><div> <span>private void MarchingCubes()<br><div dir="ltr">{<br></div></span><div><span> marching cubes code ..... <br></span></div><div><span><br></span></div></div><div><span> renderer.ResetCamera();<br></span><div><span> <span>renderWindowControl1</span>.Invalidate();</span></div><div><span>}<br></span></div></div><div><br></div><div class="ydpbffb97d3signature"><div style="font-size:16px;font-family:Helvetica, Arial, sans-serif;"><div>Todd Martin, PhD.<br></div><div><i>Freelance Engineer/Software Architect.</i></div><br></div></div></div>
<div><br></div><div><br></div>
</div><div id="yahoo_quoted_2925665927" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Wednesday, 21 November 2018, 11:28:54 PM NZDT, Lucy <matusikova.lucia@gmail.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr">Hi, <br></div><div dir="ltr"><br></div><div dir="ltr">I created application in C#, that contains renderWindowControl, some<br></div><div dir="ltr">trackbars to set parameters for Marching cubes algorithm and button to<br></div><div dir="ltr">apply. <br></div><div dir="ltr">After running the app, window will appear, but nothing will be rendered and<br></div><div dir="ltr">after setting parameters, the original window closes, new opens and nothing<br></div><div dir="ltr">happens.<br></div><div dir="ltr"><br></div><div dir="ltr">How to render output from polyDataMapper?And how do i update renderwindow so<br></div><div dir="ltr">that it can view change (after setting parameters) in real time?<br></div><div dir="ltr"><br></div><div dir="ltr">---- code ----<br></div><div dir="ltr"> public Form1()<br></div><div dir="ltr"> {<br></div><div dir="ltr"> InitializeComponent();<br></div><div dir="ltr"> }<br></div><div dir="ltr"><br></div><div dir="ltr"> public void renderWindowControl1_Load(object sender, EventArgs e)<br></div><div dir="ltr"> {<br></div><div dir="ltr"> try<br></div><div dir="ltr"> {<br></div><div dir="ltr"> MarchingCubes();<br></div><div dir="ltr"> }<br></div><div dir="ltr"> catch (Exception ex)<br></div><div dir="ltr"> {<br></div><div dir="ltr"> MessageBox.Show(ex.Message, "Exception",<br></div><div dir="ltr">MessageBoxButtons.OK);<br></div><div dir="ltr"> }<br></div><div dir="ltr"> }<br></div><div dir="ltr"><br></div><div dir="ltr"> private void applyButton_Click(object sender, EventArgs e)<br></div><div dir="ltr"> {<br></div><div dir="ltr"> MarchingCubes();<br></div><div dir="ltr"> }<br></div><div dir="ltr"><br></div><div dir="ltr"> private void MarchingCubes()<br></div><div dir="ltr"> {<br></div><div dir="ltr"> marching cubes code ..... <br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"> vtkPolyDataMapper mapper = vtkPolyDataMapper.New();<br></div><div dir="ltr"> mapper.SetInputConnection(surface.GetOutputPort());<br></div><div dir="ltr"> mapper.ScalarVisibilityOff(); <br></div><div dir="ltr"> vtkActor actor = vtkActor.New();<br></div><div dir="ltr"> actor.SetMapper(mapper);<br></div><div dir="ltr"><br></div><div dir="ltr"> vtkRenderWindow renderWindow =<br></div><div dir="ltr">renderWindowControl1.RenderWindow;<br></div><div dir="ltr"> vtkRenderer renderer =<br></div><div dir="ltr">renderWindow.GetRenderers().GetFirstRenderer();<br></div><div dir="ltr"> renderer.SetBackground(0, 0, 0);<br></div><div dir="ltr"> renderer.AddActor(actor);<br></div><div dir="ltr"> }<br></div><div dir="ltr"><br></div><div dir="ltr">Thanks, <br></div><div dir="ltr">Lucy<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html</a><br></div><div dir="ltr">_______________________________________________<br></div><div dir="ltr">Powered by www.kitware.com<br></div><div dir="ltr"><br></div><div dir="ltr">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></div><div dir="ltr"><br></div><div dir="ltr">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></div><div dir="ltr"><br></div><div dir="ltr">Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br></div><div dir="ltr"><br></div><div dir="ltr">Follow this link to subscribe/unsubscribe:<br></div><div dir="ltr"><a href="https://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br></div></div>
</div>
</div></body></html>