[vtkusers] How to use vtkPointPlacer?
Romuald BERTRAND
beromuald at wanadoo.fr
Tue May 13 08:50:03 EDT 2008
Hi all,
For my work, I have to colorize some pixels on an image, and until now I use this algorithm:
vtkPoints* pts = vtkPoints::New();
vtkDataArray* scalars = vtkUnsignedCharArray::New();
scalars->SetNumberOfComponents(3);
//-----------------------
//for(.........
//I insert all of my points
//-----------------------
vtkDiskSource* src = vtkDiskSource::New();
src->SetRadialResolution(1);
src->SetCircumferentialResolution(15);
src->SetInnerRadius(0.0);
src->SetOuterRadius(1.0);
vtkPolyData* polyData = vtkPolyData::New();
polyData->SetPoints(pts);
polyData->GetPointData()->SetScalars(scalars);
vtkGlyph3D* glyph = vtkGlyph3D::New();
glyph->SetSourceConnection(src->GetOutputPort());
glyph->SetInput(polyData);
glyph->SetColorModeToColorByScalar();
glyph->SetScaleModeToDataScalingOff() ;
vtkPolyData* outPut = glyph->GetOutput();
vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
mapper->SetInput(outPut);
actorColorize = vtkActor::New();
actorColorize->SetMapper(mapper);
viewer->GetRenderer()->AddActor(actorColorize);
But this is not very smart, and this create disks, and I want to colorize just the pixels which are in my list.
After, I have found the "vtkPointPlacer" class, but I don't find any explanations to use this.
Can you help me please?
Thanks for answers,
Bye
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080513/01317fea/attachment.htm>
More information about the vtkusers
mailing list