[vtkusers] vtkAxisActor2D with date/time labels?

David Doria daviddoria+vtk at gmail.com
Fri Feb 19 08:17:54 EST 2010


On Fri, Feb 19, 2010 at 4:34 AM, Carsten Ehbrecht <pingwin.newsgroup at gmx.org
> wrote:

> Hi,
>
> i would like to use the vtkAxisActor2D with date/time labels. I haven't
> found out how i can set such labels. Is this possible with vtk?
>
> I'm using a 3D model with x,y-axis as geo-coordinates and z-axis as time. I
> would like to display the time range of z-axis with something like the
> vtkAxisActor2D.
>
> Cheers,
> Carsten
>
>
I've never used this class, but it looks to me like you specify two double
values (the start and end value) and it interpolates doubles in between for
the rest of the ticks. Hence, you could not make the labels something like
"4:00am". You would have to subclass the vtkAxisActor2D. It looks like in
the BuildAxis function, there is a section with a comment:

  // Build the labels

that does something like this:

val = this->AdjustedRange[0] + i * interval;
sprintf(string, this->LabelFormat, val);

it is here that you could set the labels to a string of your choice.

Good luck!

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100219/0e06c172/attachment.htm>


More information about the vtkusers mailing list