<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<p>kitware-vtk@kulnet.kuleuven.ac.be wrote:
<blockquote TYPE=CITE>--- Forwarded by news2mail for "Stijn Goris"
<mepisto@hotmail.com> ---
<p>Hello,
<p>I want to know the number of points in the sphere bump with the function
<br>GetNumberOfPoints (vtkPolyData). but when I use puts [$pDatat
<br>GetNumberOfPoints] or puts [pDatat GetNumberOfPoints]. I get
0 as treturn.</blockquote>
Looks like an <b><i>update </i></b>problem -- Further your tcl<b><i> set</i></b>
and<b><i> puts </i></b>statements look wrong to me.
<p>I stuck your code (and modified it) in my visualiser and the following
worked:
<p>#####################################################################
<p><b>proc SphereNormals {object widget no1 dummy} {</b><b></b>
<p><b>vtkSphereSource bump</b>
<br><b> bump SetThetaResolution 10</b>
<br><b> bump SetPhiResolution 10</b>
<br><b> bump SetRadius 1.8</b>
<br><b> bump Update</b><b></b>
<p><b>puts " Output [bump GetOutput] Input to ppp"</b>
<br><b>puts " Polys [[bump GetOutput] GetPolys] "</b>
<br><b>puts " Points [[bump GetOutput] GetPoints] "</b>
<br><b>puts " Data [[[bump GetOutput] GetPolys] GetData] "</b>
<br><b>puts " Tuples [[[[bump GetOutput] GetPolys] GetData]
GetNumberOfTuples] "</b>
<br><b></b> <b></b>
<p><b>######### To Change a Point ##########</b>
<br><b>[[bump GetOutput] GetPoints] SetPoint 1 -2 -2 -2</b>
<br><b>####### If You Mant The Normals ######</b>
<br><b>vtkPolyDataNormals qqq</b>
<br><b> qqq SetInput [bump GetOutput]</b>
<br><b> qqq ComputePointNormalsOn</b>
<br><b> qqq Update</b>
<br><b>puts " PolyDataNormals Output [qqq GetOutput]"</b>
<br><b>puts " PolyDataNormals PointData [[qqq GetOutput] GetPointData]"</b>
<br><b>puts " PolyDataNormals Normals [[[qqq GetOutput] GetPointData] GetNormals]"</b>
<br><b>####### For Point Displaced ###########</b>
<br><b>puts " Normal at point [[[[qqq GetOutput] GetPointData] GetNormals]
GetNormal 1"</b><b></b>
<p><b>######## Lets Plot Them ####</b>
<br><b>vtkPolyDataMapper ppp</b>
<br><b>ppp SetInput [bump GetOutput]</b>
<br><b>#</b>
<br><b>vtkActor aaa</b>
<br><b> aaa SetMapper ppp</b>
<br><b> aaa SetProperty property(alloy)</b>
<br><b>#</b>
<br><b>Renderer($widget) AddActor aaa</b>
<br><b>#</b>
<br><b>Render .backdrop.drawing</b><b></b>
<p>}
<p>Best Of Luck
<p>Dave Davies</html>