I want to subclass a vtkInteractorStyleImage to change mouse behavior on clics. I’m using Qt Creator, and I successfully tried vtkinteractorStyleImage and others.
Here my codes.
vtkinteractorstylevisor.h:
#define VTK_EXCLUDE_STRSTREAM_HEADERS
#ifndef VTKINTERACTORSTYLEVISOR_H
#define VTKINTERACTORSTYLEVISOR_H
#include <vtkInteractorStyleImage.h>
class VTK_RENDERING_EXPORT vtkInteractorStyleVisor : public vtkInteractorStyleImage
{
public:
static vtkInteractorStyleVisor* New();
vtkTypeMacro(vtkInteractorStyleVisor, vtkInteractorStyleImage)
virtual void OnLeftButtonDown();
protected:
vtkInteractorStyleVisor();
~vtkInteractorStyleVisor();
};
#endif // VTKINTERACTORSTYLEVISOR_H
vtkinteractorstyle.cpp
#include <vtkinteractorstylevisor.h>
#include <vtkObjectFactory.h>
vtkStandardNewMacro(vtkInteractorStyleVisor)
I want to start implementing left click behaviour, but compiling this I get this error:
vtkinteractorstylevisor.cpp:-1: error: undefined reference to `vtkInteractorStyleVisor::vtkInteractorStyleVisor()’
:-1: error: collect2: error: ld returned 1 exit status
Any suggestions? Thanks.
Ok, I got it.
I forgot to include the implementation of the constructor and the destructor in the .cpp file.
Thanks for the time reading this.