[vtkusers] obtaining reference to calling class in	KeyPressInteractorStyle class
    Liam Kurmos 
    quantum.leaf at googlemail.com
       
    Tue Feb  9 14:34:40 EST 2010
    
    
  
Hi All,
I'm trying to implement key press detection.
I followed http://vtk.org/Wiki/VTK/Examples/Interaction/KeypressEvents
and made an external class KeyPressInteractorStyle.
I have no problem getting the OnKeyPress event to fire as per the
example, but I can't seem to get a reference to the calling class (i
want to change an isovalue on keypress).
I can't include the calling class (#include "vasFrame.h") as this
would create a cyclic dependency, so I tried making a forward
declaration of the class and using a function to pass the value.
class vasFrame;
class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera
{
  public:
    static KeyPressInteractorStyle* New();
    virtual void OnKeyPress();
    void passFrameRef(vasFrame* frame);
    vasFrame* frame;
};
But this class won't compile, complaining of a forward declaration to
incomplete struct vasFrame.
This is probably trivial and a straight forward c++ pattern but i
can't seem to get.
Can anyone tell me the normal vtk way to do this?
regards,
Liam
    
    
More information about the vtkusers
mailing list