[vtkusers] Some TextProperty items don't work with AxesActor
Bill Lorensen
bill.lorensen at gmail.com
Sun Dec 13 13:28:19 EST 2009
It worked for me.
On Sun, Dec 13, 2009 at 1:23 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list