[vtkusers] how can I scale a vtkActor2D?

Paulo Henrique Junqueira Amorim paulojamorim at gmail.com
Tue Nov 25 12:05:34 EST 2008


Hi,

Only it does not solve, I'm with the same problem and I could not solve.


Regards,
Paulo Amorim



2008/11/25 Peter F Bradshaw <pfb at exadios.com>

> 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.
> >
> > Regards
> >
> > Liang Ma
> >
> > Here is the code:
> >
> >   vtkActor2D   *pvtkActor;
> >            ..........................
> >
>  this->pvtkActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
> >  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) ;
> >
> ///////////////////////////////////////////////////////////////////////////
> >
>
> Cheers
>
> --
> 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:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081125/78c75bd2/attachment.htm>


More information about the vtkusers mailing list