[vtkusers] vtkGlyph3D

Peter Schmitt pschmitt at gmail.com
Mon Jul 18 15:56:43 EDT 2005


vtkusers, 

I am having some goofy problems with vtkGlyph3D::SetInput(vtkDataSet*).

When I call  vtkGlyph3D::SetInput(mask->GetOutput()), I get the
following error on compile:
////////////////
// start snip
main.C: In function `int main(int, char**)':
main.C:208: no matching function for call to `vtkGlyph3D::SetInput(vtkPolyData*
   )'
/software/linux-sles8-ia32/vtk-nvgl-4.4.2-gcc-r1/include/vtk/vtkDataSetToPolyDataFilter.h:41:
candidates
   are: virtual void vtkDataSetToPolyDataFilter::SetInput(vtkDataSet*)
make: *** [main.o] Error 1
// stop snip
///////////////

However, I can compile & execute properly if I run the following
command instead:
vtkGlyph3D::SetInput((vtkDataSet*) mask->GetOutput())

Why do I have to manually set my mask as a vtkDataSet?  Is this a bug
in my program or vtk?  The vtkMaskPoints examples do not manually
declare a point mask as (vtkDataSet*)  I have included a small code
fragment at the end of this email.

Thanks,
Pete


// code snip follows:

    vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::New();
    //... set data

    /* Set up arrow source that will be used with glyph*/
    vtkArrowSource *arrow = vtkArrowSource::New();

    /* transform base vector */
    vtkTransform *scale = vtkTransform::New();

    /* apply the scaling */
    vtkTransformPolyDataFilter *trans = vtkTransformPolyDataFilter::New();
    trans->SetTransform(scale);
    trans->SetInput(arrow->GetOutput());

    /* limit number of vectors to be drawn via a mask */
    vtkMaskPoints *mask = vtkMaskPoints::New();
    mask->SetInput(ugrid);
    mask->SetOnRatio(75);
    mask->RandomModeOn();

    /* set the glyph using the objects we just set up */
    vtkGlyph3D *arrows = vtkGlyph3D::New();
    arrows->SetInput((vtkDataSet*) mask->GetOutput());    // <<<-----
runs properly
    //arrows->SetInput(mask->GetOutput());          //   <<< ----
gives me compile error
    arrows->SetSource(trans->GetOutput());
    arrows->SetScaleModeToDataScalingOff();
    arrows->SetColorModeToColorByVector();

--
Pete



More information about the vtkusers mailing list