[vtkusers] how can I scale a vtkActor2D?
leo at esit.com
Tue Nov 25 12:49:54 EST 2008
Thank you so much for your reply. I did try this->pvtkRenderer->Render()
after this->pvtkRenderer->AddActor(this->pvtkActor); It does not work.
my pvtkActor is a vtkActor2D:
In fact this->pvtkActor->GetPositionCoordinate()->SetValue(0.5, 0.5); will
move the actor to the center. But
this->pvtkActor->GetPosition2Coordinate()->SetValue(0.9, 0.9); will not
scale the actor.
I searched in the archive of vtkuser and could not fond the answer. I read
from the help that vtkActor2D->GetPosition2Coordinate()->SetValue sometims
will not work "Some 2D actor subclasses ignore the position2 variable ". But
I do not know why. Will a vtkXYPlotActor be better? I can change the size of
the font in the same program.Whould you please give me some more advices?
----- Original Message -----
From: "Peter F Bradshaw" <pfb at exadios.com>
To: "VTK Users" <vtkusers at vtk.org>
Sent: Tuesday, November 25, 2008 11:15 AM
Subject: Re: [vtkusers] how can I scale a vtkActor2D?
> Hi Liang Ma;
> Are you calling this->pvtkRenderer->Render() anywhere?
> On Mon, 24 Nov 2008, Liang Ma wrote:
>> Hi all,
>> I tried to scale a 2D actor but it doesn't work. I tried
>> GetPosition2Coordinate() function but it doesn't work. Also I tried to
>> zoom the camera. It does not work either.
>> Whould you give me some advices? Thanks.
>> Liang Ma
>> Here is the code:
>> vtkActor2D *pvtkActor;
>> this->pvtkActor->GetPositionCoordinate()->SetValue(0.5, 0.5); //
>> works, could move the actor to the center
>> this->pvtkActor->GetPosition2Coordinate()->SetValue(0.9, 0.9); // does
>> not work, no effect
>> this->pvtkActor->GetProperty()->SetColor(1, 0, 0);
>> the code for zoom:
>> this->pvtkCamera = this->pvtkRenderer->GetActiveCamera ();
>> this->pvtkCamera->Zoom(5); // zoom doesn't work
>> this->pvtkRenderer->SetActiveCamera (this->pvtkCamera) ;
> Peter F Bradshaw: http://www.exadios.com (public keys avaliable there).
> Personal site: http://personal.exadios.com
> "I love truth, and the way the government still uses it occasionally to
> keep us guessing." - Sam Kekovich.
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> Follow this link to subscribe/unsubscribe:
More information about the vtkusers