SourceForge has been redesigned. Learn more.
Close

How to use GetScalarPointer?

Help
Jerry
2007-09-04
2013-04-25
  • Jerry

    Jerry - 2007-09-04

    I'm new to both VTK and C#, and I want to use the GetScalarPointer() function, which returns an IntPtr.  Is this possible, and if so, what do I assign the return value to so I can use it?  If someone could post a code snippet it would be much appreciated.

    Thanks,
    Jerry

     
    • Andrew Dolgert

      Andrew Dolgert - 2007-09-05

      Hi Jerry,

      GetScalarPointer returns a pointer to int in C++. As you say, the wrappers convert this to an IntPtr, but it is nothing like an int*, despite the name. It's just the C# type for data types you can't do anything with.

      It might be possible to cast the IntPtr to an unsafe int* in C#. I didn't do anything special for such pointers in the wrappers because the DataSet allows you to access its contents without using the bare pointer, and VTK provides this access specifically for wrappers to use. It's slower, but it may be the price to pay.

      Drew

       

Log in to post a comment.