[vtkusers] points from polydata

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Mon Mar 17 09:38:59 EST 2003


Bruno,

reader[i]->GetOutput()->GetPoint(0); 		//first one
int last = reader[i]->GetOutput()->GetNumerOfPoints()
reader[i]->GetOutput()->GetPoint(--last);	//last one

reader[i]->GetOutput()->GetPoints()  gives you acces to the whole 
vtkPointSet class

---

I'll also recommend you to use UpdateWholeExtent with readers  (instead 
of Update)...

cheers,
mathieu

Bruno Travençolo wrote:
> Hello All,
> 
> I read a polydata from this file, that represents one line in the space:
> ---------------------------------------------------------------------------- 
> 
> # vtk DataFile Version 3.0
> A simple line formed by 1000 points
> ASCII
> DATASET POLYDATA
> POINTS 1000 float
> 247.0 218.0 145.0
> 246.9 218.4 145.2
> ..........
> 
> LINES 1 1001
> 1000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14..............
> ---------------------------------------------------------------------------- 
> 
> 
> and the commands that I used to read it was:
> 
>        reader[i]  = vtkPolyDataReader::New();
>        reader[i]->SetFileName(filename);
>        reader[i]->Update();
> 
> 
> Now I want to get the first point and the last point  from the point 
> list. Something like that:
> 
> float first[3],last[3]
> first = reader[i]->GetOutput()???????????
> last = reader[i]->GetOutput()???????????
> 
> 
> But I didn't find the proper command for that. How can I do this??
> 
> thanks,
> 
> Bruno.
> 
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
> 


-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/




More information about the vtkusers mailing list