[vtkusers] Re: set certain point\'s scalar value!

Moti Freiman freiman at cs.huji.ac.il
Tue Sep 7 13:22:00 EDT 2004


Hi!
you need to find the point id, with the function:  
vtkPolyData::FindPoint(), which find the id of point represented by its 
coordinates.
after that you need to use: 

Polydata->GetPointData()->GetScalars()->SetComponenet (pointid, component, new_value)
to replace the scalar value of the point.
may it will be useful to see the vtk documentation of the functions mentioned above.

-- 
Moti Freiman.
Medical Image Processing and Computer-Assisted Surgery Laboratory.
School of Computer Science and Engineering.
The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel 
Phone: +(972)-2-658-5371 (laboratory) 
E-mail: freiman at cs.huji.ac.il
WWW site: http://www.cs.huji.ac.il/~freiman  


>------------------------------
>
>Message: 3
>Date: Tue,  7 Sep 2004 23:18:10 +0800 (BEIST)
>From: xujf <xujf at sjtu.edu.cn>
>Subject: [vtkusers] set certain point\'s scalar value!
>To: vtkusers at vtk.org
>Message-ID: <20040907151810.035E611058B5 at sjtu.edu.cn>
>Content-Type: text/plain; charset="gb2312"
>
>hello,vtk users:
>    There is a Point A(x,y,z) in Polydata,and  I want to set the scalar value of this point. How to realize the function.
>    I used Polydata->GetPointData()->SetScalars(faceColors); however this set all points\\\' scalar values of the ploydata,not certain point. 
>
>Best Regards!
>xujf 
>
>  
>






More information about the vtkusers mailing list