[vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget
Luis Vieira
luis.vieira at vektore.com
Wed Dec 28 10:29:41 EST 2016
Now I did other test, just taking of the of the code Ren1.ResetCamera() and Ren1.Render() and the exception is the following:
First-chance exception at 0x00007FFF82201433 (vtkRenderingCore-7.0.dll) in vKoreStructuralVectoringD.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
Unhandled exception at 0x00007FFF82201433 (vtkRenderingCore-7.0.dll) in vKoreStructuralVectoringD.exe: 0xC000041D: An unhandled exception was encountered during a user callback.
viewPortAxActor->GetXAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1);
viewPortAxActor->SetXAxisLabelText("E");
viewPortAxActor->GetXAxisCaptionActor2D()->SetWidth(0.05);
viewPortAxActor->GetXAxisCaptionActor2D()->SetHeight(0.05);
viewPortAxActor->GetYAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1);
viewPortAxActor->SetYAxisLabelText("N");
viewPortAxActor->GetYAxisCaptionActor2D()->SetWidth(0.05);
viewPortAxActor->GetYAxisCaptionActor2D()->SetHeight(0.05);
viewPortAxActor->GetZAxisCaptionActor2D()->GetCaptionTextProperty()->SetColor(1, 1, 1);
viewPortAxActor->SetZAxisLabelText("Up");
viewPortAxActor->GetZAxisCaptionActor2D()->SetWidth(0.05);
viewPortAxActor->GetZAxisCaptionActor2D()->SetHeight(0.05);
vtkSmartPointer<vtkOrientationMarkerWidget> viewPortOMWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
viewPortOMWidget->SetOrientationMarker(viewPortAxActor);
viewPortOMWidget->SetInteractor(mainViewPort->GetInteractor());
viewPortOMWidget->SetViewport(0.7, 0.0, 1.00, 0.3);
viewPortOMWidget->SetEnabled(1);
viewPortOMWidget->InteractiveOn();
//Ren1->ResetCamera();
//Ren1->Render();
//mainViewPort->GetRenderWindow()->GetInteractor()->Start();
Luis Vieira,
Consultant, Software Engineer
Vektore Exploration Consulting Corporation
ca.linkedin.com/in/joaoluisvieira
<mailto:luis.vieira at vektore.com> luis.vieira at vektore.com
<http://www.vektore.com/> www.vektore.com
From: Sankhesh Jhaveri [mailto:sankhesh.jhaveri at kitware.com]
Sent: December 28, 2016 8:16 AM
To: Luis Vieira <luis.vieira at vektore.com>; VTK Users <vtkusers at vtk.org>
Subject: Re: [vtkusers] QVTKWidget Camera vs vtkOrientationMarkerWidget
Hi Luis,
Try setting the interactor from the widget:
myWidget ->SetInteractor(myQVTKWidgetCAmera->GetInteractor());
On Tue, Dec 27, 2016, 5:56 PM Luis Vieira <luis.vieira at vektore.com <mailto:luis.vieira at vektore.com> > wrote:
Hello vtkusers,
Anybody knows how to use vtkOrientationMarkerWidget with QVTKWidget interactor? I have been trying to implement the VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/DisplayCoordinateAxes) and it worked smoothly. However, within my QVTKWidget Camera, and I caught the following exception:
ERROR: In C:\VTK\VTK-7.0.0\GUISupport\Qt\QVTKInteractor.cxx, line 147
QVTKInteractor (000000F46583D670): QVTKInteractor cannot control the event loop.
Following my vtkOrientationMarkerWidget snapshot:
vtkRenderWindow* renwin = vtkRenderWindow::New();
myQVTKWidgetCAmera->SetRenderWindow(renwin);
Ren1 = vtkRenderer::New();
myQVTKWidgetCAmera->GetRenderWindow()->AddRenderer(Ren1);
vtkAxesActor* myAxActor = vtkAxesActor::New();
vtkSmartPointer<vtkOrientationMarkerWidget> myWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
myWidget ->SetOrientationMarker(myAxActor);
myWidget ->SetInteractor(myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor());
myWidget ->SetViewport(0.7, 0.0, 1.00, 0.3);
myWidget ->SetEnabled(1);
myWidget ->InteractiveOn();
Ren1->ResetCamera();
Ren1->Render();
myQVTKWidgetCAmera->GetRenderWindow()->GetInteractor()->Start();
Thank you very much for any help,
Luis Vieira,
Consultant, Software Engineer
Vektore Exploration Consulting Corporation
ca.linkedin.com/in/ <http://ca.linkedin.com/in/> joaoluisvieira
luis.vieira at vektore.com <mailto:luis.vieira at vektore.com>
<http://www.vektore.com/> www.vektore.com
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware <http://www.kitware.com/> | (518) 881-4417
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161228/36742720/attachment.html>
More information about the vtkusers
mailing list