Пример #1
0
        public void RemoveActors()
        {
            Kitware.VTK.vtkRenderer ren =
                this.renderWindowControl1.RenderWindow.GetRenderers().GetFirstRenderer();
            ren.RemoveAllViewProps();

            ren.ResetCamera();
            this.renderWindowControl1.RenderWindow.Render();
        }
Пример #2
0
        public void AddActors()
        {
            Kitware.VTK.vtkConeSource source = new Kitware.VTK.vtkConeSource();
            source.SetResolution(30);

            Kitware.VTK.vtkMapper mapper = Kitware.VTK.vtkPolyDataMapper.New();
            mapper.SetInputConnection(source.GetOutputPort());

            Kitware.VTK.vtkActor actor = new Kitware.VTK.vtkActor();
            actor.SetMapper(mapper);

            Kitware.VTK.vtkTextActor textActor = new Kitware.VTK.vtkTextActor();
            textActor.SetInput(Kitware.VTK.vtkVersion.GetVTKSourceVersion());

            Kitware.VTK.vtkRenderer ren =
                this.renderWindowControl1.RenderWindow.GetRenderers().GetFirstRenderer();
            ren.AddActor(actor);
            ren.AddActor(textActor);

            ren.ResetCamera();
            this.renderWindowControl1.RenderWindow.Render();
        }