[vtkusers] enumeration labels

N Smethurst nick.smethurst at free.fr
Mon Jun 30 16:14:34 EDT 2003


You're probably better off using a 2D actor that is positioned using world 
coordinates. The quality of the font is also better than the follower's.

Here's a bit of code in my app:

    axisLabelProperty = vtkTextProperty::New();
    axisLabelProperty->SetFontSize(12);
    axisLabelProperty->SetJustificationToCentered();
    axisLabelProperty->SetVerticalJustificationToCentered();
    axisLabelProperty->SetLineSpacing(0.8);
    axisLabelProperty->SetColor(0.0, 0.0, 0.0);

    axisLabelMapper = vtkTextMapper::New();
    axisLabelMapper->SetTextProperty(axisLabelProperty);
    axisLabelActor = vtkActor2D::New();
    axisLabelActor->SetMapper(axisLabelMapper);
    axisLabelActor->GetPositionCoordinate()->SetCoordinateSystemToWorld();
    axisLabelActor->GetPositionCoordinate()->SetValue(x, y, z);
    axisLabelMapper->SetInput("my label");


Le Lundi 30 Juin 2003 17:14, Gary M. Stump a écrit :
> I'm trying to label enumerations (ex. red, green, purple, blue, ...) on
> a 3D plot.  The labels are to always face the camera and stay the same
> size.  I have tried vtkFollower, but cannot keep a constant size. I have
> tried vtkLabeledDataMapper but cannot figure out how to label strings.
> Can anyone help me out?  Thanks   --Gary
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq> Follow this link to
> subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list