<div><div class="gmail_quote">On Fri, Sep 17, 2010 at 10:57 AM, Benoist Laurent <span dir="ltr"><<a href="mailto:benoist@ibpc.fr">benoist@ibpc.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Hi all,<div><br></div><div>The example works very well.</div><div>However, when I try to put the code relative to the axes in a different fonction the application crashes.</div><div><br></div>
<div><div>void displayAxes(vtkRenderWindowInteractor *renderWindowInteractor)</div><div>{ </div><div> vtkSmartPointer<vtkAxesActor> axes = </div><div> vtkSmartPointer<vtkAxesActor>::New();</div><div>
<br></div><div> vtkSmartPointer<vtkOrientationMarkerWidget> widget = </div><div> vtkSmartPointer<vtkOrientationMarkerWidget>::New();</div><div> widget->SetOutlineColor( 0.9300, 0.5700, 0.1300 );</div>
<div> widget->SetOrientationMarker( axes );</div><div> widget->SetInteractor( renderWindowInteractor );</div><div> widget->SetViewport( 0.0, 0.0, 0.4, 0.4 );</div><div> widget->SetEnabled( 1 );</div>
<div> widget->InteractiveOn();</div><div>}</div></div><div><br></div><div>So I guess there's something I did not understand with the vtkSmartPointer and/or the vtkWidget.</div><div><br></div><div>An idea ?</div>
<div>Thanks,</div><div><br></div><div>Benoist</div><div></div></div></blockquote></div><br></div><div>Benoist,<div><br></div><div>Can you share a compilable piece of code? I'm definitely not a smart pointer expert, but I think the pointers defined in your displayAxes will go out of scope when you leave the function.</div>
<div><br>David</div></div>