[vtkusers] TCL to C++, need HELP

Amy Squillacote amy.squillacote at kitware.com
Fri Feb 2 08:48:19 EST 2007


Hi Rio,

The line of Tcl code in question would look like the following in C++. 
You actually need a few of lines of C++ code because 
iren->GetEventPosition() returns a vector of length 2, and you need 3 
values to pass to the picker.

int pos[2];
iren->GetEventPosition(pos);
picker->Pick(pos[0], pos[1], 0, ren1);

- Amy

Rio wrote:
> Hi, everyone,
>  
> I am new to Tcl programming, a task require me to write a mouse 
> selection function. I have the code in tcl, and need to translate to 
> C++. Finished part of the work, but still not sure about the callbacl 
> function, the code is in tcl:
>  
> int Controller::cbLBR() //
> {
> // global MouseMotion
>  
>   if (int MouseMotion == 0) {
>     eval picker Pick [iren GetEventPosition] 0 ren1
>   }
>   // Do the default things for the trackball style
>   style OnLeftButtonUp 
>   }
>  
> Really dunt know how to convert : *eval picker Pick [iren 
> GetEventPosition] 0 ren1*
> to C++. . .
> Anyone can help? any suggestions?
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
>   



More information about the vtkusers mailing list