[vtkusers] [vtkusers]
    D.M.P.Davies 
    dmpd at onetel.net.uk
       
    Thu Jun 20 19:29:54 EDT 2002
    
    
  
kitware-vtk at kulnet.kuleuven.ac.be wrote:
> ---  Forwarded by news2mail for "Stijn Goris" <mepisto at hotmail.com> ---
>
> Hello,
>
> I want to know the number of points in the sphere bump with the function
> GetNumberOfPoints (vtkPolyData). but when I use  puts [$pDatat
> GetNumberOfPoints] or  puts [pDatat GetNumberOfPoints]. I get 0 as treturn.
Looks like an update problem -- Further your tcl set and puts statements look wrong to me.
I stuck your code (and modified it) in my visualiser and the following worked:
#####################################################################
proc SphereNormals  {object widget no1 dummy}  {
vtkSphereSource bump
    bump SetThetaResolution 10
    bump SetPhiResolution 10
    bump SetRadius 1.8
    bump Update
puts  " Output [bump GetOutput] Input to ppp"
puts  " Polys [[bump GetOutput] GetPolys] "
puts  " Points  [[bump GetOutput] GetPoints] "
puts  " Data [[[bump GetOutput] GetPolys] GetData] "
puts  " Tuples  [[[[bump GetOutput] GetPolys] GetData] GetNumberOfTuples] "
######### To Change a Point ##########
[[bump GetOutput] GetPoints] SetPoint  1 -2 -2 -2
#######  If You Mant The Normals  ######
vtkPolyDataNormals qqq
 qqq SetInput [bump GetOutput]
 qqq  ComputePointNormalsOn
  qqq Update
puts " PolyDataNormals Output [qqq GetOutput]"
puts " PolyDataNormals PointData [[qqq GetOutput] GetPointData]"
puts " PolyDataNormals Normals [[[qqq GetOutput] GetPointData] GetNormals]"
#######  For Point Displaced ###########
puts " Normal at point  [[[[qqq GetOutput] GetPointData] GetNormals] GetNormal 1"
######## Lets Plot Them ####
vtkPolyDataMapper ppp
ppp SetInput [bump GetOutput]
#
vtkActor  aaa
 aaa SetMapper  ppp
 aaa SetProperty property(alloy)
#
Renderer($widget) AddActor aaa
#
Render .backdrop.drawing
}
Best Of Luck
Dave Davies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020621/6b144446/attachment.htm>
    
    
More information about the vtkusers
mailing list