[IGSTK-Users] Problem (visible or not visible)

Patrick Cheng cheng at isis.georgetown.edu
Thu May 22 11:19:16 EDT 2008


Hi Daniel,

You can also check the validity of the transform. IGSTK View is checking 
the validity of transform to decide the visibility of the object. There 
are two methods you can use:

bool IsValidAtTime( timeToTestInMilliseconds )
or
bool IsValidNow();

Patrick

Daniel Gil wrote:
> Hi,  i have solved my problem. The solution is not very elegant, but 
> it's work.
>  
> the code is.
>  
>  
> double LastPos=0;
> int visible;
>  
>  
> for(unsigned int i=0; i<1000; i++)
>  {
> tracker->RequestUpdateStatus();
> TransformType transform;
> VectorType position;
>  
>  
>  
> coordSystemAObserver->Clear();
> trackerTool->RequestGetTransformToParent();
> if (coordSystemAObserver->GotTransform())
> {
> transform = coordSystemAObserver->GetTransform();
> position = transform.GetTranslation();
>  
> if (LastPos!=position[2])
> visible =1;
> else
> visible=0;
> LastPos=position[2];
> if (visible)
> printf ("%f %f %f %d\n",position[0],position[1],position[2], visible);
>  
> }
> }
>  
>  
> Julio Daniel
> 
> */Daniel Gil <daniel_taek at yahoo.com>/* wrote:
> 
>     Hi,
>      
>     my name is Julio Daniel Gil Cano. I just a question.  how to verify
>     if a tool is visible or not. I use the code of
>     igstkPolarisTrackerTest2.cxx but the the fonction GotTransform() is
>     always true. and i can't know when the tool is visible or not.
>      
>     Thanks.
>      
>     Julio Daniel
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> IGSTK-Users mailing list
> IGSTK-Users at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users



More information about the IGSTK-Users mailing list