<div dir="ltr">Hi,<div><br></div><div>I created an vtkinteractor subclass. This is the header:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"vtkInteractionStyleModule.h"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">//</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">For</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">export</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">macro</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">#include</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"vtkInteractorStyleImage.h"</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">class</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">DcmInteractorStyle</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">public</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkInteractorStyleImage</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">public</span><span style="color:rgb(0,0,0)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">static</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">DcmInteractorStyle</span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">vtkTypeRevisionMacro</span><span style="color:rgb(0,0,0)">(</span>DcmInteractorStyle<span style="color:rgb(0,0,0)">,</span><span style="color:rgb(192,192,192)"> </span>vtkInteractorStyleImage<span style="color:rgb(0,0,0)">)</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">virtual</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">OnLeftButtonDown</span><span style="color:rgb(0,0,0)">();</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">};</span></pre></div><div><br></div><div>I just want to override mouse events.</div><div>I'm following the example:</div><div><a href="http://www.vtk.org/Wiki/VTK/Tutorials/InteractorStyleSubclass">http://www.vtk.org/Wiki/VTK/Tutorials/InteractorStyleSubclass</a><br></div><div><br></div><div>It doesn't show .cpp contents, so I went inside mine with:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,128)">vtkStandardNewMacro</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(128,0,128)">vtkInteractorStyleImage</span><span style="color:rgb(0,0,0)">);</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,128,0)">void</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">DcmInteractorStyle</span><span style="color:rgb(0,0,0)">::</span><span style="font-style:italic;color:rgb(0,0,0)">OnLeftButtonDown</span><span style="color:rgb(0,0,0)">()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><font color="#808000">// here my code</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre></div><div><br></div><div><br></div><div>But the compiler (with CMakeLists.txt) says:</div><div>ui_qt.lib(viewerwidget.cpp.obj):-1: error: LNK2019: unresolved external symbol "public: static class DcmInteractorStyle * __cdecl DcmInteractorStyle::New(void)" (?New@DcmInteractorStyle@@SAPAV1@XZ) referenced in function "public: static class vtkSmartPointer<class DcmInteractorStyle> __cdecl vtkSmartPointer<class DcmInteractorStyle>::New(void)" (?New@?$vtkSmartPointer@VDcmInteractorStyle@@@@SA?AV1@XZ)<br></div><div><br></div><div>At CMake mail list someone told me it was because I don't have the New() method defined (what about the macro then?).</div><div><br></div><div>My constructor won't do anything different, just the same as the superclass.</div><div>I tried:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(128,0,128)">DcmInteractorStyle</span><span style="color:rgb(0,0,0)">*</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">DcmInteractorStyle</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">()</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,0)">:</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">vtkInteractorStyleImage</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">New</span><span style="color:rgb(0,0,0)">()</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">}</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,0,0)">It gives me:</span></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">error: C2550: 'DcmInteractorStyle::New' : constructor initializer lists are only allowed on constructor definitions<br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">Any help, please?</font></pre></div></div>