[vtkusers] Some TextProperty items don't work with AxesActor

David Doria daviddoria+vtk at gmail.com
Sun Dec 13 13:23:56 EST 2009


On Sun, Dec 13, 2009 at 12:58 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Looks like this composite actor does some automagic scaling unless you
> turn it off. Try adding:
>  axes->GetYAxisCaptionActor2D ()->GetTextActor()->SetTextScaleModeToNone();
>
> Bill

Even after SetTextScaleModeToNone(), SetFontSize (200) doesn't seem to
have any affect on the text size:

  vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
  axes->GetYAxisCaptionActor2D ()->GetTextActor()->SetTextScaleModeToNone();

  vtkSmartPointer<vtkTransform> transform =
      vtkSmartPointer<vtkTransform>::New();
  transform->Translate(1.0, 0.0, 0.0);

  // The axes are positioned with a user transform
  axes->SetUserTransform(transform);

  axes->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1,0,0);
  axes->SetXAxisLabelText("hello");
  axes->GetXAxisCaptionActor2D ()->GetCaptionTextProperty()->SetFontSize (200);

  renderer->AddActor(axes);

The "ScaleMode" idea is a good one - rather than specify the actual
font size it would be nice to specify the font size with respect to
the axis arrow heads or something like that.

Any further thoughts on any way to control the font size?

Thanks,

David



More information about the vtkusers mailing list