示例#1
0
        private void Plane()
        {
            // Create a plane
            vtkPlaneSource planeSource = vtkPlaneSource.New();

            planeSource.SetCenter(1.0, 0.0, 0.0);
            planeSource.SetNormal(1.0, 0.0, 1.0);
            planeSource.Update();

            // Visualize
            vtkPolyDataMapper mapper = vtkPolyDataMapper.New();

            mapper.SetInputConnection(planeSource.GetOutputPort());
            vtkActor actor = vtkActor.New();

            actor.SetMapper(mapper);
            actor.GetProperty().SetLineWidth(4);

            RenderAddActor(actor);
        }
示例#2
0
        private void Plane()
        {
            // Create a plane
            vtkPlaneSource planeSource = vtkPlaneSource.New();

            planeSource.SetCenter(1.0, 0.0, 0.0);
            planeSource.SetNormal(1.0, 0.0, 1.0);
            planeSource.Update();

            // Visualize
            vtkPolyDataMapper mapper = vtkPolyDataMapper.New();

            mapper.SetInputConnection(planeSource.GetOutputPort());
            vtkActor actor = vtkActor.New();

            actor.SetMapper(mapper);
            actor.GetProperty().SetLineWidth(4);
            vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;
            vtkRenderer     renderer     = renderWindow.GetRenderers().GetFirstRenderer();

            renderer.SetBackground(0.2, 0.3, 0.4);
            renderer.AddActor(actor);
            renderer.ResetCamera();
        }