[vtkusers] Question about using vtkGeometryFilter and vtkGlyph3D

David Doria daviddoria+vtk at gmail.com
Fri Aug 20 08:14:53 EDT 2010


On Thu, Aug 19, 2010 at 10:21 PM, Jong Youl Choi <yyalli at gmail.com> wrote:

> Hi all,
>
> I was trying to sub-select points in vtkPolyData by using
> vtkGeometryFilter and draw glyphs for those only selected points
> without success. A part of codes is as follows:
>
>        vtkPolyData *plot = vtkPolyData::New();
>        plot->SetPoints(points);
>        plot->SetVerts(polys);
>        plot->GetPointData()->SetScalars(scalars);
>
>        // vtkGeometryFilter
>        vtkGeometryFilter *subplot = vtkGeometryFilter::New();
>        subplot->SetInput(plot);
>        subplot->PointClippingOn();
>        subplot->SetPointMinimum(0);
>        subplot->SetPointMaximum(3);
>        subplot->Update();
>
>        // Glyph3D
>        vtkSphereSource *sphere = vtkSphereSource::New();
>        vtkGlyph3D *glyph = vtkGlyph3D::New();
>        glyph->SetInput(subplot->GetOutput());
>        glyph->SetSource(sphere->GetOutput());
>
> Using vtkGeometryFilter works if I don't use vtkGlyph3D. For example,
>
>        vtkPolyDataMapper *plotMapper = vtkPolyDataMapper::New();
>        plotMapper->SetInput(subplot->GetOutput());
>
>        vtkLODActor *plotActor  = vtkLODActor::New();
>        plotActor->SetMapper(plotMapper);
>
>        ren->AddActor(plotActor);
>
> I will appreciate any advice or comment.
>
> Thanks,
> Jong
>
>
Could you use something like this?
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/HighlightSelectedPoints
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Picking/HighlightSelectedPoints>
Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100820/a5577bb6/attachment.htm>


More information about the vtkusers mailing list