Ejemplo n.º 1
0
        private vtkActor CreateSphereActor(double radius)
        {
            Kitware.VTK.vtkActor a = new Kitware.VTK.vtkActor();

            vtkSphereSource sphereSource3D = new vtkSphereSource();

            sphereSource3D.SetCenter(0.0, 0.0, 0.0);
            sphereSource3D.SetRadius(radius);
            sphereSource3D.SetThetaResolution(10);
            sphereSource3D.SetPhiResolution(10);

            vtkPolyDataMapper sphereMapper3D = vtkPolyDataMapper.New();

            sphereMapper3D.SetInputConnection(sphereSource3D.GetOutputPort());
            a.SetMapper(sphereMapper3D);
            a.GetProperty().SetColor(0.95, 0.5, 0.3);
            a.GetProperty().SetOpacity(0.5);

            return(a);
        }
Ejemplo n.º 2
0
        public vtkActor GetActor()
        {
            using (var warp = vtkWarpScalar.New())
                using (var mapper = vtkPolyDataMapper.New())
                {
                    warp.SetInput(pointPoly);
                    warp.SetScaleFactor(1);

                    mapper.SetInput(warp.GetPolyDataOutput());
                    //mapper.SetInput(pointPoly);
                    mapper.SetLookupTable(lut);
                    mapper.SetScalarRange(0.0, depth);
                    var actor = new Kitware.VTK.vtkActor();
                    actor.SetMapper(mapper);
                    actor.GetProperty().SetPointSize(2);

                    return(actor);
                }
        }