[vtkusers] How to use "IsTypeOf "?
    N Smethurst 
    nick.smethurst at free.fr
       
    Sun Oct 26 09:57:45 EST 2003
    
    
  
If you think you should have a specific type of object but your code isn't 
doing what you think it should, you could sprinkle code like
std::cout << "Class name = " << m_Picker->GetClassName() << std::endl;
whereever it would be useful to see if your object is what you think it is.  
Try something like
if (m_Picker->GetCellId()>=0)
     {
          std::cout << "Class name = " << m_Picker->GetClassName() 
                    << std::endl;
          if (m_Picker->IsTypeOf("vtkTriangle")==1)
               str.Format(_T("Triangle ID = %d"),m_Picker->GetCellId());
          if (m_Picker->IsTypeOf("vtkLine")==1) 
               str.Format(_T("Line ID = %d"),m_Picker->GetCellId());
          AfxMessageBox(str);
     }
then you can easily debug your code.
Are you sure you want to inherit from vtkInteractorStyleUser? I was under the 
impression that this class was specifically designed for passing it function 
pointers instead of needing to subclass.
For sending messages around, maybe you could create a class derived from 
vtkCommand?
Nic
    
    
More information about the vtkusers
mailing list