Helllppp!

Gavin Tabor G.R.Tabor at exeter.ac.uk
Tue Mar 28 12:10:16 EST 2000


I've been staring at this for a lot of today. If someone could tell
me where I am going wrong, I would be eternally grateful. The code is
supposed to use a plane to sample an unstructured dataset and plot a 
set of contour lines on that plane. However it hangs at the following
line :

    contourActor->SetMapper(contourMapper);

and refuses to do anything more. I'm still using vtk2.4, btw.

Thanks for any help.

Gavin

====================================

Code :

    vtkPlaneSource *plane = vtkPlaneSource::New();
    plane->SetResolution(300,100);

    vtkTransform *transPlane = vtkTransform::New();
    transPlane->Scale(0.4,1.0,1.0);
    transPlane->Translate(0.5,0.00,0.05);

    vtkTransformPolyDataFilter *tpf = vtkTransformPolyDataFilter::New();
    tpf->SetInput(plane->GetOutput());
    tpf->SetTransform(transPlane);

    vtkOutlineFilter *outFilter = vtkOutlineFilter::New();
    outFilter->SetInput(tpf->GetOutput());

    // and display its outline

    Info << "\nSet up outline" << endl;

    vtkPolyDataMapper *planeMapper = vtkPolyDataMapper::New();
    planeMapper->SetInput(outFilter->GetOutput());

    vtkActor *planeActor = vtkActor::New();
    planeActor->SetMapper(planeMapper);
    planeActor->GetProperty()->SetColor(0,0,0);

    // probe the data using the cutting plane

    Info << "\nProbe data" << endl;

    vtkProbeFilter *probe = vtkProbeFilter::New();
    probe->SetInput(tpf->GetOutput());
    probe->SetSource(ugrid);

    Info << "\nSet up actors" << endl;

    // create the contour and display that.

    vtkContourFilter *contour = vtkContourFilter::New();
    contour->SetInput(probe->GetOutput());
    contour->GenerateValues(5,lower,upper);

    vtkPolyDataMapper *contourMapper = vtkPolyDataMapper::New();
    contourMapper->SetInput(contour->GetOutput());
    contourMapper->SetScalarRange(ugrid->GetScalarRange());
    //contourMapper->ScalarVisibilityOn();
    contourMapper->SetLookupTable(colours);

    vtkActor *contourActor = vtkActor::New();
    contourActor->SetMapper(contourMapper);

-- 

Dr. Gavin Tabor
School of Engineering and Computer Science
Department of Engineering
University of Exeter
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list