private void DisposeSecondRenderWindow()
        {
            if (this.SecondRenderer != null)
            {
                this.SecondRenderer.SetRenderWindow(null);
            }

            if (this.SecondRenderWindowInteractor != null)
            {
                this.SecondRenderWindowInteractor.Dispose();
                this.SecondRenderWindowInteractor = null;
            }

            if (this.SecondRenderWindow != null)
            {
                this.SecondRenderWindow.Dispose();
                this.SecondRenderWindow = null;
            }

            if (this.SecondRenderer != null)
            {
                this.SecondRenderer.Dispose();
                this.SecondRenderer = null;
            }
        }
        private Kitware.VTK.vtkRenderWindow AddConeSourceToSecondRenderWindow()
        {
            this.SecondRenderer               = Kitware.VTK.vtkRenderer.New();
            this.SecondRenderWindow           = Kitware.VTK.vtkRenderWindow.New();
            this.SecondRenderWindowInteractor = Kitware.VTK.vtkRenderWindowInteractor.New();

            this.SecondRenderWindow.AddRenderer(this.SecondRenderer);
            this.SecondRenderWindow.SetSize(400, 300);
            this.SecondRenderWindow.SetInteractor(this.SecondRenderWindowInteractor);

            AddConeSourceToRenderWindow(this.SecondRenderWindow);

            this.SecondRenderWindow.Render();

            return(this.SecondRenderWindow);
        }
        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 DisposeSecondRenderWindow()
        {
            if (this.SecondRenderer != null)
              {
            this.SecondRenderer.SetRenderWindow(null);
              }

              if (this.SecondRenderWindowInteractor != null)
              {
            this.SecondRenderWindowInteractor.Dispose();
            this.SecondRenderWindowInteractor = null;
              }

              if (this.SecondRenderWindow != null)
              {
            this.SecondRenderWindow.Dispose();
            this.SecondRenderWindow = null;
              }

              if (this.SecondRenderer != null)
              {
            this.SecondRenderer.Dispose();
            this.SecondRenderer = null;
              }
        }
        private Kitware.VTK.vtkRenderWindow AddConeSourceToSecondRenderWindow()
        {
            this.SecondRenderer = Kitware.VTK.vtkRenderer.New();
              this.SecondRenderWindow = Kitware.VTK.vtkRenderWindow.New();
              this.SecondRenderWindowInteractor = Kitware.VTK.vtkRenderWindowInteractor.New();

              this.SecondRenderWindow.AddRenderer(this.SecondRenderer);
              this.SecondRenderWindow.SetSize(400, 300);
              this.SecondRenderWindow.SetInteractor(this.SecondRenderWindowInteractor);

              AddConeSourceToRenderWindow(this.SecondRenderWindow);

              this.SecondRenderWindow.Render();

              return this.SecondRenderWindow;
        }