[vtkusers] Help!A question about contouring a delaunay2D?

victor zhang ygis at hotmail.com
Fri Apr 5 20:30:17 EST 2002


Dear users:
   I used the below code to contour a delaunay2D:
    
   this->points=vtkPoints::New();
    for(int i=0;i<100;i++) 
    {
     
this->points->InsertPoint(i,this->math->Random(0,1),this->math->Random(0,1),0.0);

      }

    this->profile=vtkPolyData::New();
    this->profile->SetPoints(points);
        
    this->del=vtkDelaunay2D::New();
    this->del->SetInput(profile);
    this->del->BoundingTriangulationOn();
    this->del->SetTolerance(0.00001);
    this->del->SetAlpha(0.1);
    this->del->Update();

    this->shrink=vtkShrinkPolyData::New();
    shrink->SetInput(del->GetOutput());
  
    this->contours=vtkContourFilter::New();
    contours->SetInput(shrink->GetOutput());
    float range[1];
    range[0]=0.0;range[1]=10;
    contours->GenerateValues(5,range);
    
    this->Contourmap=vtkPolyDataMapper::New();
    Contourmap->SetInput(contours->GetOutput());
    Contourmap->SetScalarRange(0.0,1.2);

     this->dgx=vtkActor::New();
     dgx->SetMapper(Contourmap);


  But the vtkContourfilter reported:"no data to contour". How can I use the 
vtkCountourFilter to do it?
  Thanks any help!
 
victor 

_________________________________________________________________
免费下载 MSN Explorer:http://explorer.msn.com/lccn/intl.asp。




More information about the vtkusers mailing list