AW: [vtkusers] use vtkPolyData to define vector

Timo Frenzel rohlof at gmx.de
Fri Oct 15 11:34:02 EDT 2004


Perhaps, you have to Update your structure before reading point
informations:
 
 
vtkHedgeHog is using the Filter vtkPolyDataNormals.
To get normal informations copy the output of PolyDataNormals to a new
polydate structure and get the pointdata.
 
For example:
#include "vtkPolyData.h"
#include "vtkPointData.h"
#include "vtkPolyDataNormals.h"
 
vtkPolyDataNormals *normals = vtkPolyDataNormals::New(); //you are using the
output of normals in vtkHedgeHog
normals -> SetInput(yourstructure->GetOutput());
vtkPolyData    *pdata = vtkPolyData::New();
pdata = DeepCopy((vtkDataSet *)normals->GetOutput());
pdata -> Update();
float = p_normal[3]; //your normal vector
pdata -> GetPointData()->GetNormals()->GetTuple(pointid,p_normal); //pointid
is the ID of the chosen point
 
Hope this works, Timo Frenzel.
 

  _____  

Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag
von Longfei Cong
Gesendet: Freitag, 8. Oktober 2004 13:19
An: vtkusers at vtk.org
Betreff: [vtkusers] use vtkPolyData to define vector


Hi :
    I want to visual a surface with normal vector on it, i got that
vtkHedgeHog done this, but how can i denote the vector in vtkPolyData, for
vtkHedgeHog->SetInput  is vtkPolyData.
 
wish for your help!!!!!!!
longfei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041015/dda74151/attachment.htm>


More information about the vtkusers mailing list