[vtkusers] Normals

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Aug 9 13:58:12 EDT 2005


vtkDataArray to vtkFloatArray is  base class to derrived class 
conversion, which needs a cast.
Try,

CellNormals = vtkFloatArray::SafeDownCast(
   PolyDataNormals_orig->GetOutput()->GetCellData()->GetNormals());

Utkarsh.

Louis Desjardins wrote:
> Hi Experts,
> 
> I am trying to get the normals of my data set using the following code, 
> where CellNormals and PointNormals are of type vtkFloatArray
> 
> GeometryFilter->SetInput( UnstructuredGrid );
> PolyDataNormals_orig->SetInput( GeometryFilter->GetOutput() );
> CellNormals = 
> PolyDataNormals_orig->GetOutput()->GetCellData()->GetNormals();
> PointNormals = 
> PolyDataNormals_orig->GetOutput()->GetPointData()->GetNormals();
> 
> However I get the error:
> invalid conversion from `vtkDataArray*' to `vtkFloatArray*'
> 
> ?? Why do I get this? vtkFloatArray *is* a vtkDataArray.. so whats the 
> problem? Should I not be using vtkFloatArray? and of course vtkDataArray 
> is an abstract class..
> anwyyas i know htis is silly but your help is appreciated
> thanks
> 
> ld
> 
> 
> _______________________________________________
> 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