[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] integrate a vtkOrientationMarkerWidget into
From:       HamidG <listboss () gmail ! com>
Date:       2011-11-29 3:20:55
Message-ID: 1322536855519-5031014.post () n5 ! nabble ! com
[Download RAW message or body]


John Platt-3 wrote
> 
> Hi,
> 
> This is the essence of what I do in a QVTKWidget derived class ...
> 
> m_vtkRenderer = vtkRenderer::New();
> vtkRenderWindow* renWin = GetRenderWindow();
> renWin->AddRenderer( m_vtkRenderer );
> 
> m_vtkAxesWidget = vtkOrientationMarkerWidget::New();
> 
> 

Thanks John, this helped. My problem was that I was using vtkSmartPointer
for vtkOrientationMarkerWidget
and it was going out of scope (I shouldn't just copy and paste Example code
to my code!
well me and the OP made the same mistake by combining the two examples we
found for axes display and qtvtkwidget).

I made _vtkAxesWidget a class member.

     _vtkAxesWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
    vtkRenderWindowInteractor *iren =
ren1->GetRenderWindow()->GetInteractor();
    _vtkAxesWidget->SetDefaultRenderer(ren1);
    _vtkAxesWidget->SetInteractor(iren);

    _vtkAxes = vtkSmartPointer<vtkAxesActor>::New();
    _vtkAxesWidget->SetOrientationMarker(_vtkAxes);

    _vtkAxesWidget->SetOutlineColor( 0.9300, 0.5700, 0.1300 );
    _vtkAxesWidget->SetViewport( 0.0, 0.0, 0.34, 0.34 );
    _vtkAxesWidget->SetEnabled(1);
    _vtkAxesWidget->InteractiveOn();

--
View this message in context: \
http://vtk.1045678.n5.nabble.com/integrate-a-vtkOrientationMarkerWidget-into-a-QVtkWidget-tp2843764p5031014.html
 Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic