[vtkusers] fix position of vtkAxesActor

Jim Peterson jimcp at cox.net
Fri Sep 17 11:22:10 EDT 2010


I Am not sure if this is a factor based on the information provided, but 
it appears the vtkOrientationMarkerWidget expects the 
renderWindowInteractor to be connected to the RenderWindow before widget 
is connected to the RenderWindowInteractor.  At least that appears to be 
the controlling factor from my Java implementations.

in other words, Widget.SetInteractor() prior to 
RenderWindow.SetInteractor() or RenderWindowInteractor.SetRenderWindow() 
fails. Widget.SetInteractor() after either of the other functions works.

HTH,
Jim

Benoist Laurent 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
>
>
> Le 17 sept. 10 à 15:55, Nicolas Sarrasin a écrit :
>
>> Thanks very much!
>> It's exactly what I wanted.
>>
>> Le 16/09/2010 18:55, David Doria a écrit :
>>> On Thu, Sep 16, 2010 at 12:31 PM, Nicolas Sarrasin 
>>> <nsarrasin at phenix-systems.com <mailto:nsarrasin at phenix-systems.com>> 
>>> wrote:
>>>
>>>     Hi all,
>>>
>>>     How can i display 3Daxes in the bottom-right corner of my window ?
>>>     I want to fix the position in the screen, not in the space.
>>>
>>>     I can render those axes with vtkAxesActor but I don't know to to
>>>     fix its position.
>>>
>>>     Thanks by advance,
>>>
>>>     N. Sarrasin
>>>
>>>
>>> Try this: 
>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes
>>>
>>> David 
>>
>> _______________________________________________
>> Powered by www.kitware.com <http://www.kitware.com>
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: 
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   




More information about the vtkusers mailing list