[vtkusers] fix position of vtkAxesActor

David Doria daviddoria+vtk at gmail.com
Fri Sep 17 10:54:16 EDT 2010


On Fri, Sep 17, 2010 at 10:57 AM, Benoist Laurent <benoist at ibpc.fr> wrote:

> Hi all,
>
> The example works very well.
> However, when I try to put the code relative to the axes in a different
> fonction the application crashes.
>
> void displayAxes(vtkRenderWindowInteractor *renderWindowInteractor)
> {
>     vtkSmartPointer<vtkAxesActor> axes =
>         vtkSmartPointer<vtkAxesActor>::New();
>
>     vtkSmartPointer<vtkOrientationMarkerWidget> widget =
>         vtkSmartPointer<vtkOrientationMarkerWidget>::New();
>     widget->SetOutlineColor( 0.9300, 0.5700, 0.1300 );
>     widget->SetOrientationMarker( axes );
>     widget->SetInteractor( renderWindowInteractor );
>     widget->SetViewport( 0.0, 0.0, 0.4, 0.4 );
>     widget->SetEnabled( 1 );
>     widget->InteractiveOn();
> }
>
> So I guess there's something I did not understand with the vtkSmartPointer
> and/or the vtkWidget.
>
> An idea ?
> Thanks,
>
> Benoist
>

Benoist,

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.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100917/1e7e8887/attachment.htm>


More information about the vtkusers mailing list