[vtkusers] Vtkplanewidget2 and multiple viewports

Doug Hoppes dhoppes at mbfbioscience.com
Wed Sep 21 09:32:54 EDT 2016


Hey all,

                I'm having an issue about showing the vtkimplicitplanewidget2.  I have two vtkviewports and the plane widget is only showing up in one of them.  If I use vtkactors, the actors show up in both viewport.  Any ideas?

Code:
-------------------
         m_sectionPlaneRepresentation = vtkImplicitPlaneRepresentation::New();

         m_sectionPlaneRepresentation->OutsideBoundsOff();
         m_sectionPlaneRepresentation->ScaleEnabledOff();
         m_sectionPlaneRepresentation->OutlineTranslationOff();
         m_sectionPlaneRepresentation->SetPlaceFactor(1.0);
         m_sectionPlaneRepresentation->GetPlaneProperty()->SetOpacity(0.1);
         m_sectionPlaneRepresentation->GetSelectedPlaneProperty()->SetOpacity(0.1);
         m_sectionPlaneRepresentation->GetNormalProperty()->SetOpacity(0);
         m_sectionPlaneRepresentation->GetSelectedNormalProperty()->SetOpacity(0);

         vtkSmartPointer< vtkImplicitPlaneWidget2 > planeWidget = vtkImplicitPlaneWidget2::New();
         planeWidget->SetRepresentation(m_sectionPlaneRepresentation);

         planeWidget->SetInteractor(m_pRenderer->GetRenderWindow()->GetInteractor());

         double center[3], bounds[6];
         m_atlasExport->GetOutput()->GetCenter(center);
         m_atlasExport->GetOutput()->GetBounds(bounds);
         m_sectionPlaneRepresentation->NormalToZAxisOn();
         m_sectionPlaneRepresentation->PlaceWidget(bounds);
         m_sectionPlaneRepresentation->SetOrigin(center);

         planeWidget->On();
-------------------
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160921/abc70fd9/attachment.html>


More information about the vtkusers mailing list