Lucy
2018-11-21 10:28:47 UTC
Hi,
I created application in C#, that contains renderWindowControl, some
trackbars to set parameters for Marching cubes algorithm and button to
apply.
After running the app, window will appear, but nothing will be rendered and
after setting parameters, the original window closes, new opens and nothing
happens.
How to render output from polyDataMapper?And how do i update renderwindow so
that it can view change (after setting parameters) in real time?
---- code ----
public Form1()
{
InitializeComponent();
}
public void renderWindowControl1_Load(object sender, EventArgs e)
{
try
{
MarchingCubes();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception",
MessageBoxButtons.OK);
}
}
private void applyButton_Click(object sender, EventArgs e)
{
MarchingCubes();
}
private void MarchingCubes()
{
marching cubes code .....
vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
mapper.SetInputConnection(surface.GetOutputPort());
mapper.ScalarVisibilityOff();
vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
vtkRenderWindow renderWindow =
renderWindowControl1.RenderWindow;
vtkRenderer renderer =
renderWindow.GetRenderers().GetFirstRenderer();
renderer.SetBackground(0, 0, 0);
renderer.AddActor(actor);
}
Thanks,
Lucy
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
I created application in C#, that contains renderWindowControl, some
trackbars to set parameters for Marching cubes algorithm and button to
apply.
After running the app, window will appear, but nothing will be rendered and
after setting parameters, the original window closes, new opens and nothing
happens.
How to render output from polyDataMapper?And how do i update renderwindow so
that it can view change (after setting parameters) in real time?
---- code ----
public Form1()
{
InitializeComponent();
}
public void renderWindowControl1_Load(object sender, EventArgs e)
{
try
{
MarchingCubes();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Exception",
MessageBoxButtons.OK);
}
}
private void applyButton_Click(object sender, EventArgs e)
{
MarchingCubes();
}
private void MarchingCubes()
{
marching cubes code .....
vtkPolyDataMapper mapper = vtkPolyDataMapper.New();
mapper.SetInputConnection(surface.GetOutputPort());
mapper.ScalarVisibilityOff();
vtkActor actor = vtkActor.New();
actor.SetMapper(mapper);
vtkRenderWindow renderWindow =
renderWindowControl1.RenderWindow;
vtkRenderer renderer =
renderWindow.GetRenderers().GetFirstRenderer();
renderer.SetBackground(0, 0, 0);
renderer.AddActor(actor);
}
Thanks,
Lucy
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers