[vtkusers] Exception when using vtkOrientationMarkerWidget in a vtkMFCWindow

Jesse Kinross-Smith Jesse.Kinross-Smith at bentley.com
Tue Mar 20 10:33:41 EDT 2018


Long shot, but wondering if anyone has any clue here.
I've got a whole lot of rendering working nicely in a vtkMFCWindow and thought I'd try adding an orientation widget to show axes.

I found some sample code which does this with a vtkOrientationMarkerWidget, but I tried it with our vtkMFCWindow and it's causing an exception almost straight away.

This is the code I'm using, which is almost identical to the sample code at:
  https://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes

vtkSmartPointer<vtkAxesActor> axes = vtkSmartPointer<vtkAxesActor>::New();
vtkSmartPointer<vtkOrientationMarkerWidget> widget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
widget->SetOutlineColor(0.9300, 0.5700, 0.1300);
widget->SetOrientationMarker(axes);
widget->SetCurrentRenderer(m_vtkRenderer);
widget->SetInteractor(m_vtkRenderer->GetRenderWindow()->GetInteractor());
widget->SetViewport(0.0, 0.0, 0.4, 0.4);
widget->SetEnabled(1);
widget->InteractiveOn();

It actually displays both the model and the orientation axes briefly, then displays the following exception:
  0xC000041D: An unhandled exception was encountered during a user callback.

Call Stack:
> vtkMFCWindow::OnPaint() Line 169     C++
CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2459        C++
CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2093      C++
AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 265           C++
AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 418              C++

Anyone got any ideas?

--
Jesse Kinross-Smith
Senior Software Engineer - BSW
Bentley Systems, Fremantle

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180320/53981ee8/attachment.html>


More information about the vtkusers mailing list