[vtkusers] How to use vtkPointPlacer?

Romuald BERTRAND beromuald at wanadoo.fr
Wed May 14 03:33:39 EDT 2008


Nobody can help me?
 
 
 

> Message du 13/05/08 14:50
> De : "Romuald BERTRAND" 
> A : vtkusers at public.kitware.com
> Copie à : 
> Objet : [vtkusers] How to use vtkPointPlacer?
> 
> 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/20080514/45518100/attachment.htm>


More information about the vtkusers mailing list