[vtkusers] fix position of vtkAxesActor

Benoist Laurent benoist at ibpc.fr
Fri Sep 17 10:57:32 EDT 2010


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 
>> > 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
>
> 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

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


More information about the vtkusers mailing list