Hello,<br> <br>I'm very new to VTK. I went through few materials and I have successfully displayed a mesh (triangular grid), and scattered points using vtkUnstructuredGrid. Now I want to display line contours. I came to know that it can be done using vtkContourFilter class. I have written a small code. I guess it is correct. but Am not able to get the contours on the render window. Here is my code:<br><br>vtkPoints *pts = vtkPoints::New();<br>pts->SetData(scatter_data); // scatter_data is an instance of vtkDoubleArray with three components<br><br>unsigned int num_ids = scatter_data->GetNumberOfTuples();<br><br>vtkPolyVertex *poly = vtkPolyVertex::New();<br>poly->GetPointIds()->SetNumberOfIds(num_ids);<br><br>for ( unsigned int i = 0; i < num_ids; i++ )<br> poly->GetPointIds()->SetId(i,i);<br><br>vtkUnstructuredGrid *ugrid = vtkUnstructuredGrid::New();<br>ugrid->Allocate(1);<br>ugrid->InsertNextCell (poly->GetCellType(), poly->GetP
ointIds());<br>ugrid->SetPoints(pts);<br><br>vtkDelaunay2D *del = vtkDelaunay2D::New();<br>del->SetInput(ugrid);<br>del->SetTolerance(0.001);<br><br>vtkContourFilter *cf = vtkContourFilter::New();<br>cf->SetInputConnection(del->GetOutputPort());<br>cf->GenerateValues(10, -5, 20);<br><br>vtkPolyDataMapper *map = vtkPolyDataMapper::New();<br>map->SetInputConnection( cf->GetOutputPort() );<br>map->SetScalarRange(-5, 20);<br><br>vtkActor *act = vtkActor::New();<br>act->SetMapper(map);<br><br>// pRenderer is an instance of vtkRenderer which is declared and initialized in the main function.<br>pRenderer->AddActor(act);<br>pRenderer->ResetCamera();<br><br>THere is no syntax or compile time error shown. What may be wrong here..?? in cf->GenerateValues(), function what values need to be passed..?? <br><br>Thanks in advance.<br><br><br><div style="border-top:1px dashed #ccc; border-bottom:1px dashed #ccc; padding:5px;"><a href="http://mail.in.com
/mails/new_reg.php?utm_source=invite&utm_medium=outgoing" style="font:13px arial; color:#1E56A1; text-decoration:none;">Dear <b>vtkusers!</b> Get Yourself a cool, short <b>@in.com</b> Email ID now!</a></div>