<html>
<body>
Hi David,<br><br>
The points in your data set need to be connected together in order to be
able to create contours. Try running either the vtkDelaunay2D or
vtkDelaunay3D filter on your data set before you try to contour it. Also,
you data needs to have scalar values so that it has values from which to
compute contours.<br><br>
- Amy<br><br>
At 12:22 AM 4/20/2004, david&nbsp; michell wrote:<br><br>
<blockquote type=cite class=cite cite>&nbsp; Hi everyone,<br>
Iam curretnly trying to figure out to use contour filters.<br>
I have written something ,but when I execute it all i get is a popup
window saying &quot;no data to contour&quot;.<br>
I dont know what is wrong, I have attached the code, please help me
out.<br>
What Iam trying to do is create a unstructured grid of random points and
then draw a contour. I dont know what mistake I have done.<br>
Thank you,<br>
David Michell<br><br>
main()<br>
{<br>
double data[1500];<br>
for (int i=0;i&lt;1500;i++)<br>
{<br>
data[i*3+0]=rand()/126345.23;<br>
data[i*3+1]=rand()/346345.33;<br>
data[i*3+2]=rand()/456345.34;<br>
}<br><br>
vtkIdType *type;<br>
type=new vtkIdType[500];<br>
for(int counter=0;counter&lt;500;counter++)<br>
{<br>
type[counter]=counter;<br>
}<br><br>
vtkCellArray *cellarray=vtkCellArray::New();<br>
cellarray-&gt;Allocate(cellarray-&gt;EstimateSize(500,1));<br>
cellarray-&gt;InsertNextCell(500);<br>
cellarray-&gt;ReplaceCell(0,500,type);<br><br>
int celltype[500];<br>
memset(celltype,1,sizeof(int)*500);<br><br>
vtkDoubleArray *pointset=vtkDoubleArray::New();<br>
pointset-&gt;SetNumberOfComponents(3);<br>
pointset-&gt;SetNumberOfTuples(500);<br>
pointset-&gt;SetArray(data,1500,1);<br><br>
vtkPoints *points=vtkPoints::New();<br>
points-&gt;Allocate(1500);<br>
points-&gt;SetData(pointset);<br><br>
vtkUnstructuredGrid *grid=vtkUnstructuredGrid::New();<br>
grid-&gt;Allocate(1500);<br>
grid-&gt;SetPoints(points);<br>
grid-&gt;SetCells(celltype,cellarray);<br><br>
vtkCountourFilter *contour=vtkContourFilter::New();<br>
countour-&gt;SetInput(grid);<br>
contour-&gt;GenerateValues(13,0.0,0.42);<br><br>
//code for mapper ,actor renderer, render window and interactor goes
here<br>
}<br><br>
<br><br>
<br><br>
<br><br>
<a href="http://clients.rediff.com/signature/track_sig.asp"><img src="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" alt="[]"></a>&nbsp;</blockquote></body>
</html>