[vtkusers] Re: Trouble getting curvatures from vtkCurvatures

Goodwin Lawlor goodwin.lawlor at ucd.ie
Fri Jan 12 10:21:16 EST 2007


Mark Gooding wrote:
> On 12/01/07, Goodwin Lawlor <goodwin.lawlor at ucd.ie> wrote:
> 
>> vtkCurvatures uses doubles
> 
> cheers!
> 
> I couldn't see any reference to the output type in the documentation.
> Is there anyway I can check that in the future (eg for other filters)
> without resorting to the source code?

No, if you didn't know you'd have to resort to looking at the source 
code... you could submit a bug report, requesting the documentation to 
be updated.

Alternatively, you could code something like:

vtkDataArray *array = 
myCurvatures->GetOutput()->GetPointData()->GetScalars();

switch (array->GetDataType())
   {
   case VTK_FLOAT:
     vtkFloatArray *myCurvatures = vtkFloatArray::SafeDownCast(array);
     break;
   case VTK_DOUBLE:
     vtkDoubleArray *myCurvatures = vtkDoubleArray::SafeDownCast(array);
     break;
   }



hth,

Goodwin




More information about the vtkusers mailing list