<div dir="ltr">I recompiled VTK in debug mode and the vtkOrientationMarkerWidget segfaults in line 350 of vtkOrientationMarkerWidget.cxx (see screenshot).<div><br></div><div>I'm using VTK 6.2 from Git, Qt5, GCC 4.9, C++14. The current code that is causing the segfault is:</div><div><pre style="color:rgb(0,0,0);font-size:medium">VTKViewer<span style="color:rgb(128,0,128)">::</span>VTKViewer<span style="color:rgb(128,128,48)">(</span>QWidget <span style="color:rgb(128,128,48)">*</span>parent<span style="color:rgb(128,128,48)">)</span> <span style="color:rgb(128,0,128)">:</span> QWidget<span style="color:rgb(128,128,48)">(</span>parent<span style="color:rgb(128,128,48)">)</span>
<span style="color:rgb(128,0,128)">{</span>
  QVTKWidget <span style="color:rgb(128,128,48)">*</span>qvtkwidget <span style="color:rgb(128,128,48)">=</span> <span style="color:rgb(128,0,0);font-weight:bold">new</span> QVTKWidget<span style="color:rgb(128,0,128)">;</span>
  qvtkwidget<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>setSizePolicy<span style="color:rgb(128,128,48)">(</span>QSizePolicy<span style="color:rgb(128,0,128)">::</span>MinimumExpanding<span style="color:rgb(128,128,48)">,</span>
                            QSizePolicy<span style="color:rgb(128,0,128)">::</span>MinimumExpanding<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>

  <span style="color:rgb(128,0,0);font-weight:bold">auto</span> renderer <span style="color:rgb(128,128,48)">=</span> vtkSmartPointer<span style="color:rgb(128,0,128)"><</span>vtkRenderer<span style="color:rgb(128,0,128)">></span><span style="color:rgb(128,0,128)">::</span>New<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>

  vtkRenderWindow <span style="color:rgb(128,128,48)">*</span>renderWindow <span style="color:rgb(128,128,48)">=</span> qvtkwidget<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>GetRenderWindow<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  renderWindow<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>AddRenderer<span style="color:rgb(128,128,48)">(</span>renderer<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>

  <span style="color:rgb(128,0,0);font-weight:bold">auto</span> axes <span style="color:rgb(128,128,48)">=</span> vtkSmartPointer<span style="color:rgb(128,0,128)"><</span>vtkAxesActor<span style="color:rgb(128,0,128)">></span><span style="color:rgb(128,0,128)">::</span>New<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  axes<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetXAxisLabelText<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">x</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  axes<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetYAxisLabelText<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">y</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  axes<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetZAxisLabelText<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(0,0,230)">z</span><span style="color:rgb(128,0,0)">"</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>

  <span style="color:rgb(128,0,0);font-weight:bold">auto</span> orientationMarker <span style="color:rgb(128,128,48)">=</span> vtkSmartPointer<span style="color:rgb(128,0,128)"><</span>vtkOrientationMarkerWidget<span style="color:rgb(128,0,128)">></span><span style="color:rgb(128,0,128)">::</span>New<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  orientationMarker<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetInteractor<span style="color:rgb(128,128,48)">(</span>qvtkwidget<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>GetInteractor<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  orientationMarker<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetOrientationMarker<span style="color:rgb(128,128,48)">(</span>axes<span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
  orientationMarker<span style="color:rgb(128,128,48)">-</span><span style="color:rgb(128,128,48)">></span>SetEnabled<span style="color:rgb(128,128,48)">(</span><span style="color:rgb(0,140,0)">1</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span>
<span style="color:rgb(128,0,128)">}</span></pre></div><div>Could you please tell me why this implementation is failing?</div><div><br></div><div>Appreciate any help,</div><div>Júlio.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-19 14:50 GMT-08:00 Júlio Hoffimann <span dir="ltr"><<a href="mailto:julio.hoffimann@gmail.com" target="_blank">julio.hoffimann@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Can anyone confirm QVTKWidget is not intended to be used as a local variable (see code bellow)?<div><br></div><div>I'm getting a runtime error whenever the mouse cursor moves over the QVTKWidget window.</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">-Júlio</font></span><span class=""><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br>
> VTKViewer::VTKViewer(QWidget *parent) : QWidget(parent)<br>
> {<br>
>     QVTKWidget *qvtkwidget = new QVTKWidget;<br>
><br>
>     auto axes = vtkSmartPointer<vtkAxesActor>::New();<br>
>     axes->SetXAxisLabelText("x");<br>
>     axes->SetYAxisLabelText("y");<br>
>     axes->SetZAxisLabelText("z");<br>
><br>
>     auto orientationMarker =<br>
> vtkSmartPointer<vtkOrientationMarkerWidget>::New();<br>
>     orientationMarker->SetInteractor(qvtkwidget->GetInteractor());<br>
>     orientationMarker->SetOrientationMarker(axes);<br>
>     orientationMarker->SetEnabled(1);<br>
><br>
>     // sphere<br>
>     auto sphereSource = vtkSmartPointer<vtkSphereSource>::New();<br>
>     sphereSource->SetCenter(8, 8, 8);<br>
>     sphereSource->SetRadius(5.0);<br>
>     auto mapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br>
>     mapper->SetInputConnection(sphereSource->GetOutputPort());<br>
>     auto actor = vtkSmartPointer<vtkActor>::New();<br>
>     actor->SetMapper(mapper);<br>
><br>
>     auto renderer = vtkSmartPointer<vtkRenderer>::New();<br>
>     renderer->AddActor(axes);<br>
>     renderer->AddActor(actor);<br>
><br>
>     vtkRenderWindow *renderWindow = qvtkwidget->GetRenderWindow();<br>
>     renderWindow->AddRenderer(renderer);<br>
> }<span style="color:rgb(34,34,34)"> </span></div></div></blockquote></div></div></div></div></blockquote></div></div></span></div></div>
</blockquote></div><br></div>