[vtkusers] Access style class member variables in a callback?

David Doria daviddoria+vtk at gmail.com
Thu Oct 22 11:51:10 EDT 2009


On Thu, Oct 22, 2009 at 10:44 AM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
>> Since this callback is not a member function of the style class, the
>> variable is not accessible. This should be very easy - as I'd imagine
>> the whole idea of this style is to get the StartPosition and
>> EndPosition of the selection?
>
> This is what the callData is for. This is how you get the rectangle bounds:
>
>  unsigned int* rect = reinterpret_cast<unsigned int*>(callData);
>  unsigned int pos1X = rect[0];
>  unsigned int pos1Y = rect[1];
>  unsigned int pos2X = rect[2];
>  unsigned int pos2Y = rect[3];
>
> Jeff
>

Thanks Jeff. Where should I have found this information about what was
passed as callData?

Thanks,

David



More information about the vtkusers mailing list