[vtkusers] Question about using vtkGeometryFilter and vtkGlyph3D

Jong Youl Choi yyalli at gmail.com
Mon Aug 23 13:42:54 EDT 2010


Hi David,

Thank you for your information. Yes, that's exactly what I want to do.
Anyway, I have solved my problem by using vtkCleanPolyData as follows:

vtkSmartPointer<vtkCleanPolyData> cleanPolyData =
vtkSmartPointer<vtkCleanPolyData>::New();
	cleanPolyData->SetInputConnection(subplot->GetOutputPort());
	cleanPolyData->Update();

It looks like vtkGeometryFilter doesn't remove points of original
PolyData after filtering. vtkCleanPolyData does the job.

Anyway, thank you again for your advice.

Thanks,
Jong

On Fri, Aug 20, 2010 at 8:14 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> 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
> Thanks,
>
> David



-- 
Jong Youl Choi
Dept. of Computer Science
Indiana University at Bloomington
Homepage: http://www.cs.indiana.edu/~jychoi



More information about the vtkusers mailing list