[vtkusers] Need help loading image from memory

David Gobbi david.gobbi at gmail.com
Wed Jan 30 13:22:17 EST 2013


On Wed, Jan 30, 2013 at 11:05 AM, Hossein Nazem <hossein.nazem at gmail.com> wrote:
> dear joachim
> thanks a lot for your response but if i use this:
>
> vtkDataArray* da = vtkDataArray::New();
>
> then i have a compile error :
>
> error C2440: 'initializing' : cannot convert from 'vtkObject *' to
> 'vtkDataArray *'

You have to instantiate a concrete array type, e.g. vtkUnsignedShortArray.
The vtkDataArray class is an abstract class.  There is no New() method
defined for vtkDataArray::New().  The vtkDataArray class inherits the ::New()
method from vtkObject (vtkObject is a concrete class).  This is why
vtkDataArray::New() returns a vtkObject.

 - David



More information about the vtkusers mailing list