Hi folks,<br><br>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()
<br><br>Here is my code:<br><br>// Header file:<br><br>#include "vtkImageViewer2.h"<br><br>class MyViewer : public vtkImageViewer2<br>{<br> public:<br> static MyViewer *New();<br> vtkTypeRevisionMacro(MyViewer,vtkImageViewer2);
<br> void PrintSelf(ostream& os, vtkIndent indent);<br><br> <br> virtual void Render(void)<br> {}<br><br> protected:<br> MyViewer()<br> :vtkImageViewer2()<br> {}<br><br> ~MyViewer()
<br> {} <br> };<br><br><br>// Implementation file<br>vtkCxxRevisionMacro(MyViewer, "$Revision: 1.0 $");<br>vtkStandardNewMacro(MyViewer);<br><br>//----------------------------------------------------------------------------
<br><br>void MyViewer::PrintSelf(ostream& os, vtkIndent indent)<br>{<br> vtkImageViewer2::PrintSelf();<br><br>}<br><br><br>Any help would be appreciated.<br><br>Thanks,<br>Luca<br>