- if ( view /*fix for 9320==>*/&& ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
- SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
- if ( prs ) {
- if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
- SOCC_Prs* occPrs = (SOCC_Prs*) prs;
- AIS_ListOfInteractive lst;
- occPrs->GetObjects( lst );
- if ( lst.Extent() ) {
- Handle(AIS_InteractiveObject) io = lst.First();
- if ( !io.IsNull() ) {
- int dm = io->DisplayMode();
- if ( dm == AIS_WireFrame )
- return "Wireframe";
- else if ( dm == AIS_Shaded )
- return "Shading";
- else { // return default display mode of AIS_InteractiveContext
- OCCViewer_Viewer* occViewer = (OCCViewer_Viewer*) SUIT_Session::session()->activeApplication()->desktop(
- )->activeWindow()->getViewManager()->getViewModel();
- Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
- dm = ic->DisplayMode();
- if ( dm == AIS_WireFrame )
- return "Wireframe";
- else if ( dm == AIS_Shaded )
- return "Shading";
- }
- }
- }
+#ifdef USE_VISUAL_PROP_MAP
+ QVariant v = visibleProperty( entry( index ), DISPLAY_MODE_PROP );
+ if ( v.canConvert( QVariant::Int ) ) {
+ int dm = v.toInt();
+ if ( viewType == OCCViewer_Viewer::Type() ) {
+ OCC_DISPLAY_MODE_TO_STRING( res, dm );
+ } else if ( viewType == SVTK_Viewer::Type() ) {
+ VTK_DISPLAY_MODE_TO_STRING( res, dm );
+ }
+ }
+
+ if ( res.isEmpty() ) {
+#endif
+ SALOME_View* view = GEOM_Displayer::GetActiveView();
+ if ( view /*fix for 9320==>*/&& ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
+ SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+ if ( prs ) {
+ if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
+ SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+ AIS_ListOfInteractive lst;
+ occPrs->GetObjects( lst );
+ if ( lst.Extent() ) {
+ Handle(AIS_InteractiveObject) io = lst.First();
+ if ( !io.IsNull() ) {
+ int dm = io->DisplayMode();
+ OCC_DISPLAY_MODE_TO_STRING( res, dm );
+ if ( res.isEmpty() ) { // return default display mode of AIS_InteractiveContext
+ OCCViewer_Viewer* occViewer = (OCCViewer_Viewer*)SUIT_Session::session()->activeApplication()->
+ desktop()->activeWindow()->getViewManager()->getViewModel();
+ Handle(AIS_InteractiveContext) ic = occViewer->getAISContext();
+ dm = ic->DisplayMode();
+ OCC_DISPLAY_MODE_TO_STRING( res, dm );
+ }
+ }
+ }
+ }
+ else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
+ SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+ vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+ if ( lst ) {
+ lst->InitTraversal();
+ vtkActor* actor = lst->GetNextActor();
+ if ( actor ) {
+ SALOME_Actor* salActor = dynamic_cast<SALOME_Actor*>( actor );
+ if ( salActor ) {
+ int dm = salActor->getDisplayMode();
+ VTK_DISPLAY_MODE_TO_STRING( res, dm );
+ } // if ( salome actor )
+ } // if ( actor )
+ } // if ( lst == vtkPrs->GetObjects() )
+ } // if VTK