File tree 2 files changed +34
-1
lines changed 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -831,6 +831,24 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown ()
831
831
}
832
832
break ;
833
833
}
834
+
835
+ // Switch representation to wireframe (override default behavior)
836
+ case ' w' : case ' W' :
837
+ {
838
+ vtkSmartPointer<vtkActorCollection> ac = CurrentRenderer->GetActors ();
839
+ vtkCollectionSimpleIterator ait;
840
+ for (ac->InitTraversal (ait); vtkActor* actor = ac->GetNextActor (ait); )
841
+ {
842
+ for (actor->InitPathTraversal (); vtkAssemblyPath* path = actor->GetNextPath (); )
843
+ {
844
+ vtkSmartPointer<vtkActor> apart = reinterpret_cast <vtkActor*> (path->GetLastNode ()->GetViewProp ());
845
+ apart->GetProperty ()->SetRepresentationToWireframe ();
846
+ apart->GetProperty ()->SetLighting (false );
847
+ }
848
+ }
849
+ break ;
850
+ }
851
+
834
852
// Save a PNG snapshot with the current screen
835
853
case ' j' : case ' J' :
836
854
{
@@ -992,7 +1010,20 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown ()
992
1010
Interactor->Render ();
993
1011
}
994
1012
else
995
- Superclass::OnKeyDown ();
1013
+ {
1014
+ Superclass::OnKeyDown ();
1015
+ vtkSmartPointer<vtkActorCollection> ac = CurrentRenderer->GetActors ();
1016
+ vtkCollectionSimpleIterator ait;
1017
+ for (ac->InitTraversal (ait); vtkActor* actor = ac->GetNextActor (ait);)
1018
+ {
1019
+ for (actor->InitPathTraversal (); vtkAssemblyPath* path = actor->GetNextPath ();)
1020
+ {
1021
+ vtkSmartPointer<vtkActor> apart = reinterpret_cast <vtkActor*>(path->GetLastNode ()->GetViewProp ());
1022
+ apart->GetProperty ()->SetRepresentationToSurface ();
1023
+ apart->GetProperty ()->SetLighting (true );
1024
+ }
1025
+ }
1026
+ }
996
1027
break ;
997
1028
}
998
1029
Original file line number Diff line number Diff line change @@ -3238,6 +3238,7 @@ pcl::visualization::PCLVisualizer::setRepresentationToSurfaceForAllActors ()
3238
3238
while ((actor = actors->GetNextActor ()) != NULL )
3239
3239
{
3240
3240
actor->GetProperty ()->SetRepresentationToSurface ();
3241
+ actor->GetProperty ()->SetLighting (true );
3241
3242
}
3242
3243
}
3243
3244
}
@@ -3276,6 +3277,7 @@ pcl::visualization::PCLVisualizer::setRepresentationToWireframeForAllActors ()
3276
3277
while ((actor = actors->GetNextActor ()) != NULL )
3277
3278
{
3278
3279
actor->GetProperty ()->SetRepresentationToWireframe ();
3280
+ actor->GetProperty ()->SetLighting (false );
3279
3281
}
3280
3282
}
3281
3283
}
You can’t perform that action at this time.
0 commit comments