[vtkusers] how to create vtkDataArrays of an unknown type?
Berk Geveci
berkgeveci at hotmail.com
Thu Jun 28 16:02:29 EDT 2001
>For example, how can I convert this
>type of code to the new convention:
>
>
>void vtkclass::create_tensors(vtkImageData* res)
>{
> vtkAttributeData* ad=vtkAttributeData::New();
> ad->SetDataType(res->GetScalarType());
> ...
> res->GetPointData()->SetTensors(ad);
>}
>
void vtkclass::create_tensors(vtkImageData* res)
{
vtkDataArray*
ad=vtkDataArray::CreateDataArray(res->GetScalarType());
ad->SetNumberOfComponents(9);
...
res->GetPointData()->SetTensors(ad);
}
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
More information about the vtkusers
mailing list