[vtkusers] inheriting from a VTK class
Pankaj Daga
deluded.soul at gmail.com
Fri Jul 28 06:30:22 EDT 2006
Hi folks,
I have run into trouble trying to derive from a VTK class. I am trying to
override the render function of the vtkImageViewer2. Here is my code. Should
be pretty simple, but for some reason when I try to use it, it comes up with
a linker error...saying undefined reference to MyViewer::New()
Here is my code:
// Header file:
#include "vtkImageViewer2.h"
class MyViewer : public vtkImageViewer2
{
public:
static MyViewer *New();
vtkTypeRevisionMacro(MyViewer,vtkImageViewer2);
void PrintSelf(ostream& os, vtkIndent indent);
virtual void Render(void)
{}
protected:
MyViewer()
:vtkImageViewer2()
{}
~MyViewer()
{}
};
// Implementation file
vtkCxxRevisionMacro(MyViewer, "$Revision: 1.0 $");
vtkStandardNewMacro(MyViewer);
//----------------------------------------------------------------------------
void MyViewer::PrintSelf(ostream& os, vtkIndent indent)
{
vtkImageViewer2::PrintSelf();
}
Any help would be appreciated.
Thanks,
Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060728/a8313e17/attachment.htm>
More information about the vtkusers
mailing list