<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thank you for this.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>That really makes the search space smaller. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Elden<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Sankhesh Jhaveri [mailto:sankhesh.jhaveri@kitware.com] <br><b>Sent:</b> Sunday, 31 July, 2016 06:23<br><b>To:</b> Magnus Elden <magnus_elden@hotmail.com><br><b>Cc:</b> vtkusers@vtk.org<br><b>Subject:</b> Re: [vtkusers] Access violation only when using VTK through Unreal Engine 4.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#0B5394'>Magnus,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#0B5394'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#0B5394'>The error "No override found" means that VTK's object factory mechanism could not instantiate the right OpenGL class (vtkOpenGLRayCastImageDisplayHelper, in this case) for the super class used (vtkRayCastImageDisplayHelper, in this case). <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#0B5394'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#0B5394'>Check to see that UE4 is creating the right OpenGL context and if there are any GLEW errors when instantiating the render window.<o:p></o:p></span></p></div><div><p class=MsoNormal><br clear=all><o:p></o:p></p><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Verdana",sans-serif;color:#0B5394'>Sankhesh</span></b><o:p></o:p></p><div><p class=MsoNormal><br><br> <o:p></o:p></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Fri, Jul 29, 2016 at 10:53 AM, Magnus Elden <<a href="mailto:magnus_elden@hotmail.com" target="_blank">magnus_elden@hotmail.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Access violation - code c0000005 (first/second chance not available)<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!vtkFixedPointVolumeRayCastMapper::vtkFixedPointVolumeRayCastMapper()<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!vtkFixedPointVolumeRayCastMapper::New()<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!vtkSmartVolumeMapper::vtkSmartVolumeMapper()<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!vtkSmartVolumeMapper::New()<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!vtkSmartPointer<vtkSmartVolumeMapper>::New() [c:\users\noobsdesroobs\documents\unreal projects\vivetest\thirdparty\vtk\include\vtk-7.0\vtksmartpointer.h:117]<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>UE4Editor_ViveTest_3713!AVTKVolumeActor::Render() [c:\users\noobsdesroobs\documents\unreal projects\vivetest\source\vivetest\vtkvolumeactor.cpp:118]<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>This is the error I get when I execute this code:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:green'>// Process each file on the command line</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkImageData</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>> imageData =</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkImageData</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>>::New();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkXMLImageDataReader</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>> reader =</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkXMLImageDataReader</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>>::New();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> reader</span><span style='font-size:9.5pt;font-family:Consolas;color:teal'>-></span><span style='font-size:9.5pt;font-family:Consolas;color:black'>SetFileName(path.c_str());</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> reader</span><span style='font-size:9.5pt;font-family:Consolas;color:teal'>-></span><span style='font-size:9.5pt;font-family:Consolas;color:black'>Update();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> reader</span><span style='font-size:9.5pt;font-family:Consolas;color:teal'>-></span><span style='font-size:9.5pt;font-family:Consolas;color:black'>GetOutput()->Register(reader);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> imageData</span><span style='font-size:9.5pt;font-family:Consolas;color:teal'>-></span><span style='font-size:9.5pt;font-family:Consolas;color:black'>ShallowCopy(reader</span><span style='font-size:9.5pt;font-family:Consolas;color:teal'>-></span><span style='font-size:9.5pt;font-family:Consolas;color:black'>GetOutput());</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartVolumeMapper</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>> volumeMapper = </span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartPointer</span><span style='font-size:9.5pt;font-family:Consolas;color:black'><</span><span style='font-size:9.5pt;font-family:Consolas;color:#2B91AF'>vtkSmartVolumeMapper</span><span style='font-size:9.5pt;font-family:Consolas;color:black'>>::New();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'>It fails at the last line.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'>What makes me wonder why I get the error above is that it works when I am using this code in a standalone project just fine and that the New() static function has been used and did not crash.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'>I built the library from the VTK 7.0 source using VC14 and then included it as normal in my UE4 project. However, the UE4 project crashes with this error being printed to terminal:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><a href="http://puu.sh/qiF7t/25c8fc6a4d.png" target="_blank">http://puu.sh/qiF7t/25c8fc6a4d.png</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'>I have no idea why it is talking about the source file and I have no idea why it works outside the UE4 environment and not inside. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'>Naturally, that should mean that the problem lies with UE4, but I have used other libraries just fine and I managed to run the code above if I removed the last line. I also know why such an exception is thrown, but I don’t see why it is thrown when the include path, lib path and lib files are all the same. <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'>Thank you for your help.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'>Yours,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'>Magnus Elden<o:p></o:p></p></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>