stl


//WCZYTANIE stl
reader = vtkSTLReader.New();
reader.SetFileName(@"D:\bottle.stl");
vtkPainterPolyDataMapper mapper= vtkPainterPolyDataMapper.New();
mapper.SetInputConnection(reader.GetOutputPort());
vtkActor actor=vtkActor.New();
actor.SetMapper(mapper);
vtkRenderWindow window=this.renderWindowControl1.RenderWindow;
vtkRenderer render=window.GetRenderers().GetFirstRenderer();
render.AddActor(actor);
}

private void button2_Click(object sender, EventArgs e)
{
//ZAPIS stl
vtkSTLWriter stlwriter = vtkSTLWriter.New();
stlwriter.SetInputConnection(reader.GetOutputPort());
stlwriter.SetFileName("D:/TEST.stl");
stlwriter.SetFileTypeToASCII();
stlwriter.Write();
//vtkPolyDataReader -odczyt vtk
//vtkPolyDataWriter zapis vtk
}

private void button3_Click(object sender, EventArgs e)
{

vtkConeSource conesource = vtkConeSource.New();
vtkTriangleFilter trinianglefilter = vtkTriangleFilter.New();
trinianglefilter.SetInputConnection(conesource.GetOutputPort());
vtkSTLWriter stlwriter = vtkSTLWriter.New();
stlwriter.SetFileName("D:/TEST.stl");
stlwriter.Write();


}

private void button4_Click(object sender, EventArgs e)
{ stl-vtk
reader = vtkSTLReader.New();
reader.SetFileName(@"D:\bottle.stl");
vtkPolyDataWriter writer =vtkPolyDataWriter.New();
writer.SetInputConnection(reader.GetOutputPort());
writer.SetFileName("D:/TEST.vtk");
writer.Write();

}

private void button5_Click(object sender, EventArgs e)
{ vtk-stl
vtkPolyDataReader render = vtkPolyDataReader.New();
reader.SetFileName("D:/TEST.vtk");
vtkTriangleFilter trinianglefilter = vtkTriangleFilter.New();
trinianglefilter.SetInputConnection(reader.GetOutputPort());
vtkSTLWriter writer = vtkSTLWriter.New();
writer.SetInputConnection(trinianglefilter.GetOutputPort());
writer.Write();
private void button6_Click(object sender, EventArgs e)
{
vtkRenderWindow reWin = this.renderWindowControl1.RenderWindow;
vtkRenderWindowInteractor iren = reWin.GetInteractor();
vtkInteractorStyleTrackballCamera irenstyle = vtkInteractorStyleTrackballCamera.New();
iren.SetInteractorStyle(irenstyle);

}

private void button7_Click(object sender, EventArgs e)
{
vtkRenderWindow reWin = this.renderWindowControl1.RenderWindow;
vtkRenderWindowInteractor iren = reWin.GetInteractor();
vtkInteractorStyleJoystickCamera irenstyle = vtkInteractorStyleJoystickCamera.New();
iren.SetInteractorStyle(irenstyle);
}

Wyszukiwarka

Podobne podstrony:
stl w03
Wykład 9 2 Programowanie w STL
stl
Cwiczenia w STL
STL Leksykon kieszonkowy stllk
c programowanie STL
stl introduction
Cwiczenia w STL
wykl08 stl
Wykład 9 1 Programowanie w STL (2)
stl index?t
stl
Wykład 8 Podstawy STL(1)
stl index
Programowanie w STL
STL w praktyceP sposobow?ektywnego wykorzystania stlpra

więcej podobnych podstron