[vtkusers] strange value for orientation and position of an actor

Vincent Daanen vincent.daanen at imag.fr
Wed Feb 11 03:25:50 EST 2004


Hi all,

I'm running the cxx example of vtkBoxWidget. My goal is to retrieve the 
orientation and position of the boxWidget relatively to the cone. Can
I set the cone actor to PickableOn() and it works fine.

The problem I run into is the following : we retrieve the position and 
orientation of the widget in vtkMyCallback ::Execute,
GetPosition() and GetOrientation() always return the same values. The 
code of vtkMyCallback ::Execute follows

virtual void Execute(vtkObject *caller, unsigned long, void*)
    {
      vtkTransform *t = vtkTransform::New();
      vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
      widget->GetTransform(t);
      widget->GetProp3D()->SetUserTransform(t);

      float *orient=t->GetOrientation();
      float *pos=t->GetPosition();
       
        std::cout<<"orientation : "<<orient[0]<<" "<<orient[1]<<" 
"<<orient[2]<<std::endl;
        std::cout<<"position : "<<pos[0]<<" "<<pos[1]<<" 
"<<pos[2]<<std::endl;
        std::cout<<std::endl;
    }

Can anybody help me ?
Thanks

Vince

-- 
Vincent Daanen, PhD
Research Engineer, Post-Doctoral Position
Laboratoire TIMC/IMAG (Univ. Joseph Fourier - CNRS UMR 5525)
Equipe GMCAO
Institut d'Ingénierie de l'Information de Santé (IN3S)
Faculté de Médecine - 38706 La Tronche cedex - France
Tel: +33 (0)4 56 52 00 54 - Fax: +33 (0)4 56 52 00 55
Vincent.Daanen at imag.fr

"Les problèmes ne peuvent être résolus par
ceux dont l'horizon se limite aux réalités 
quotidiennes, mais par ceux qui rêvent de 
choses qui n'ont jamais existées et qui se 
disent : Pourquoi Pas ?"

J-F Kennedy, 1963.





More information about the vtkusers mailing list