[vtkusers] Highest point in vtkPolyData

henrikw at hgu.mrc.ac.uk henrikw at hgu.mrc.ac.uk
Tue May 9 06:10:30 EDT 2006


Hi Paul,

sorry about that, I wonder if I was the only one to parse it like that...

There are lots of ways you could do this:

1) Exhaustive search:

whereismyoil = vtkPolyData()

# get some polyData

tp = vtkPoints()
tp = whereismyoil.GetPoints()

num = tp.GetNumberOfPoints()

for i in range(0, num, 1):
    # is the ith point higher than my last point?

# place some text at the highest point, probably need to offset it a bit

Of course if the data is already sorted in a meaningful way then the highest
point may be the first or last point in the list.

2) Place some text in the scene somewhere and manually move it in actor mode, or
a bit better use the bounding values and place the text in conjunction with
those values (vtkActor.GetBounds()).

3) If you know roughly where it is you could try a FindPoint().

4) Use a picker and draw the text close to the cell you picked.


hope that helped,

Henrik


> Hi
> 
> LOL Stupid me. What I meant was. Is there an easy way to find the x,y,z of
> the high point of the polydata without iterating thru all the points so I
> can then place my text there.
> 
> Thanks Paul Tait
> 
> 
> 
> Hi Paul,
> 
> You could try vtkVectorText
> 
> http://www.vtk.org/doc/release/4.2/html/classvtkVectorText.html
> 
> or vtkTextSource
> 
> http://www.vtk.org/doc/release/4.2/html/classvtkTextSource.html
> 
> bye
> 
> Henrik
> 
> 
> > I've got some vtkPolyData representing the top surface of oil 
> > reservoirs and I'd like to add text to their highest point. Is there 
> > an easy way to do this ?
> > 
> > Thanks Paul Tait
> > 
> > --
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.1.392 / Virus Database: 268.5.3/331 - Release Date: 3/05/2006
> >  
> > 
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> > 
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 5/05/2006
>  
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.5.5/334 - Release Date: 8/05/2006
>  
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 






More information about the vtkusers mailing list