Example #1
0
        private void TestAddActorsToRenderWindow(vtkRenderWindow renWin)
        {
            vtkConeSource vtkConeSource = new vtkConeSource();
            vtkMapper     vtkMapper     = vtkPolyDataMapper.New();

            vtkMapper.SetInputConnection(vtkConeSource.GetOutputPort());
            vtkActor vtkActor = new vtkActor();

            vtkActor.SetMapper(vtkMapper);
            vtkRenderer firstRenderer = renWin.GetRenderers().GetFirstRenderer();

            firstRenderer.AddActor(vtkActor);
            vtkTextActor vtkTextActor = new vtkTextActor();

            vtkTextActor.SetInput(vtkVersion.GetVTKSourceVersion());
            firstRenderer.AddActor(vtkTextActor);
        }
        private void AddConeSourceToRenderWindow(Kitware.VTK.vtkRenderWindow renWin)
        {
            Kitware.VTK.vtkConeSource source = new Kitware.VTK.vtkConeSource();

            Kitware.VTK.vtkMapper mapper = new Kitware.VTK.vtkOpenGLPolyDataMapper();
            mapper.SetInputConnection(source.GetOutputPort());

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

            Kitware.VTK.vtkRenderer ren = null; //new Kitware.VTK.vtkOpenGLRenderer();
            ren = renWin.GetRenderers().GetFirstRenderer();
            ren.AddActor(actor);

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

            //int n = renWin.GetRenderers().GetNumberOfItems();
            //System.Diagnostics.Debug.WriteLine(n);
            //System.Diagnostics.Debug.WriteLine(
            //  Kitware.mummy.Runtime.Methods.Print(false)
            //  );
        }
        private void AddConeSourceToRenderWindow(Kitware.VTK.vtkRenderWindow renWin)
        {
            Kitware.VTK.vtkConeSource source = new Kitware.VTK.vtkConeSource();

              Kitware.VTK.vtkMapper mapper = new Kitware.VTK.vtkOpenGLPolyDataMapper();
              mapper.SetInputConnection(source.GetOutputPort());

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

              Kitware.VTK.vtkRenderer ren = null; //new Kitware.VTK.vtkOpenGLRenderer();
              ren = renWin.GetRenderers().GetFirstRenderer();
              ren.AddActor(actor);

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

              //int n = renWin.GetRenderers().GetNumberOfItems();
              //System.Diagnostics.Debug.WriteLine(n);
              //System.Diagnostics.Debug.WriteLine(
              //  Kitware.mummy.Runtime.Methods.Print(false)
              //  );
        }