From bb1693ddb15abcaf10d4e104cefdeb93ecbfd8dc Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 31 Oct 2016 09:36:47 +0300 Subject: [PATCH] Annotation manager's implementation to: - update annotations visible state int text tree widget according to active view - store annotation visible attribute current visible state of the annotation's entry in the current view - store/restore annotation visualized in view as study visual state --- src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx | 183 +++++++++++++++++++++----- src/GEOMGUI/GEOMGUI_AnnotationMgr.h | 24 +++- src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx | 32 ++++- src/GEOMGUI/GEOMGUI_TextTreeWdg.h | 4 +- src/GEOMGUI/GEOM_Displayer.cxx | 17 ++- src/GEOMGUI/GeometryGUI.cxx | 27 +++- src/GEOMGUI/GeometryGUI.h | 4 +- 7 files changed, 246 insertions(+), 45 deletions(-) mode change 100644 => 100755 src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx mode change 100644 => 100755 src/GEOMGUI/GEOMGUI_AnnotationMgr.h diff --git a/src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx b/src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx old mode 100644 new mode 100755 index db534b4cf..4c37abb47 --- a/src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx +++ b/src/GEOMGUI/GEOMGUI_AnnotationMgr.cxx @@ -97,27 +97,13 @@ SALOME_Prs* GEOMGUI_AnnotationMgr::CreatePresentation( const GEOMGUI_AnnotationA return aPrs; } -//void GEOMGUI_AnnotationMgr::DisplayPresentation( SALOME_Prs* thePresentation ) -//{ - -//} - -/*void GEOMGUI_AnnotationMgr::erasePresentation( SALOME_Prs* thePresentation ) -{ - -}*/ - -bool GEOMGUI_AnnotationMgr::IsDisplayed( const QString& theEntry, const int theIndex ) +bool GEOMGUI_AnnotationMgr::IsDisplayed( const QString& theEntry, const int theIndex, SALOME_View* theView ) const { - SalomeApp_Application* anApp = getApplication(); - SUIT_ViewWindow* anActiveWindow = anApp->desktop()->activeWindow(); - SALOME_View* aView = dynamic_cast(anActiveWindow->getViewManager()->getViewModel()); - - if ( !myVisualized.contains( aView ) ) + SALOME_View* aView = viewOrActiveView( theView ); + if ( !aView || !myVisualized.contains( aView ) ) return false; EntryToAnnotations anEntryToAnnotation = myVisualized[aView]; - if ( !anEntryToAnnotation.contains( theEntry ) ) return false; @@ -128,19 +114,25 @@ bool GEOMGUI_AnnotationMgr::IsDisplayed( const QString& theEntry, const int theI return true; } -void GEOMGUI_AnnotationMgr::Display( const QString& theEntry, const int theIndex ) +//======================================================================= +// function : GEOMGUI_AnnotationMgr::Display +// purpose : Displays annotation shape presentation in view. It creates an annotation presentation +// and stores it in an internal container +//======================================================================= +void GEOMGUI_AnnotationMgr::Display( const QString& theEntry, const int theIndex, SALOME_View* theView ) { if ( IsDisplayed( theEntry, theIndex ) ) return; - SalomeApp_Application* anApp = getApplication(); - SUIT_ViewWindow* anActiveWindow = anApp->desktop()->activeWindow(); - SALOME_View* aView = dynamic_cast(anActiveWindow->getViewManager()->getViewModel()); + SALOME_View* aView = viewOrActiveView( theView ); + if ( !aView ) + return; GEOMGUI_AnnotationAttrs::Properties aProperty; GEOM::GEOM_Object_ptr anObject; getObject( theEntry, theIndex, anObject, aProperty ); + // display presentation in the viewer SALOME_Prs* aPrs = CreatePresentation( aProperty, anObject ); aView->Display( getDisplayer(), aPrs ); getDisplayer()->UpdateViewer(); @@ -149,26 +141,28 @@ void GEOMGUI_AnnotationMgr::Display( const QString& theEntry, const int theIndex if ( myVisualized.contains( aView ) ) anEntryToMap = myVisualized[aView]; + // store displayed parameters to an internal container AnnotationToPrs anAnnotationToPrsMap; if ( anEntryToMap.contains( theEntry ) ) anAnnotationToPrsMap = anEntryToMap[theEntry]; anAnnotationToPrsMap[theIndex] = aPrs; - anEntryToMap[theEntry] = anAnnotationToPrsMap; myVisualized[aView] = anEntryToMap; + + // change persistent for the entry: set visible state in true for indices which presentations are shown + storeVisibleState( theEntry, theView ); } -void GEOMGUI_AnnotationMgr::Erase( const QString& theEntry, const int theIndex ) +void GEOMGUI_AnnotationMgr::Erase( const QString& theEntry, const int theIndex, SALOME_View* theView ) { - SalomeApp_Application* anApp = getApplication(); - SUIT_ViewWindow* anActiveWindow = anApp->desktop()->activeWindow(); - SALOME_View* aView = dynamic_cast(anActiveWindow->getViewManager()->getViewModel()); + SALOME_View* aView = viewOrActiveView( theView ); + if ( !aView ) + return; if ( !myVisualized.contains( aView ) ) return; EntryToAnnotations anEntryToAnnotation = myVisualized[aView]; - if ( !anEntryToAnnotation.contains( theEntry ) ) return; @@ -176,13 +170,108 @@ void GEOMGUI_AnnotationMgr::Erase( const QString& theEntry, const int theIndex ) if ( !anAnnotationToPrs.contains( theIndex ) ) return; + + // erase presentation from the viewer SALOME_Prs* aPrs = anAnnotationToPrs[theIndex]; aView->Erase( getDisplayer(), aPrs ); getDisplayer()->UpdateViewer(); + // remove displayed parameters from an internal container anAnnotationToPrs.remove( theIndex ); anEntryToAnnotation[theEntry] = anAnnotationToPrs; + if (anAnnotationToPrs.isEmpty()) { + anEntryToAnnotation.remove( theEntry ); + } + else { + anEntryToAnnotation[theEntry] = anAnnotationToPrs; + } myVisualized[aView] = anEntryToAnnotation; + + // change persistent for the entry: set visible state in true for indices which presentations are shown + storeVisibleState( theEntry, theView ); +} + +void GEOMGUI_AnnotationMgr::DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView ) +{ + SalomeApp_Study* aStudy = dynamic_cast( getApplication()->activeStudy() ); + _PTR(SObject) aSObj = aStudy->studyDS()->FindObjectID( theEntry.toStdString() ); + const Handle(GEOMGUI_AnnotationAttrs) aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + if ( !aShapeAnnotations.IsNull() ) { + const int aCount = aShapeAnnotations->GetNbAnnotation(); + for ( int anIndex = 0; anIndex < aCount; ++anIndex ) + { + if ( aShapeAnnotations->GetIsVisible( anIndex ) ) + Display( theEntry, anIndex, theView ); + } + } +} + +void GEOMGUI_AnnotationMgr::EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView ) +{ + if ( !myVisualized.contains( theView ) ) + return; + + EntryToAnnotations anEntryToAnnotation = myVisualized[theView]; + if ( !anEntryToAnnotation.contains( theEntry ) ) + return; + AnnotationToPrs anAnnotationToPrs = anEntryToAnnotation[theEntry]; + + SalomeApp_Study* aStudy = dynamic_cast( getApplication()->activeStudy() ); + _PTR(SObject) aSObj = aStudy->studyDS()->FindObjectID( theEntry.toStdString() ); + const Handle(GEOMGUI_AnnotationAttrs) aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + + const int aCount = aShapeAnnotations->GetNbAnnotation(); + for ( int anIndex = 0; anIndex < aCount; ++anIndex ) + { + if ( !anAnnotationToPrs.contains( anIndex ) ) + continue; + + // erase presentation from the viewer + SALOME_Prs* aPrs = anAnnotationToPrs[anIndex]; + theView->Erase( getDisplayer(), aPrs ); + } + getDisplayer()->UpdateViewer(); + anEntryToAnnotation.remove( theEntry ); + myVisualized[theView] = anEntryToAnnotation; +} + +void GEOMGUI_AnnotationMgr::RemoveView( SALOME_View* theView ) +{ + if ( !theView && myVisualized.contains( theView ) ) + myVisualized.remove( theView ); +} + +QString GEOMGUI_AnnotationMgr::getDisplayedIndicesInfo( const QString& theEntry, SALOME_View* theView ) const +{ + QString aDisplayedIndices; + + SalomeApp_Study* aStudy = dynamic_cast( getApplication()->activeStudy() ); + _PTR(SObject) aSObj = aStudy->studyDS()->FindObjectID( theEntry.toStdString() ); + const Handle(GEOMGUI_AnnotationAttrs) aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + if ( !aShapeAnnotations.IsNull() ) + { + const int aCount = aShapeAnnotations->GetNbAnnotation(); + QStringList anIndices; + for ( int anIndex = 0; anIndex < aCount; ++anIndex ) + { + if (IsDisplayed( theEntry, anIndex, theView ) ) + anIndices.append( QString::number(anIndex) ); + } + aDisplayedIndices = anIndices.join(";"); + } + return aDisplayedIndices; +} + +void GEOMGUI_AnnotationMgr::setDisplayedIndicesInfo( const QString& theEntry, SALOME_View* theView, + const QString theIndicesInfo ) +{ + if ( theIndicesInfo.isEmpty() ) + return; + + QStringList anIndices = theIndicesInfo.split( ";" ); + for ( int i = 0, aCount = anIndices.size(); i < aCount; i++ ) { + Display( theEntry, anIndices[i], theView ); + } } GEOM_Displayer* GEOMGUI_AnnotationMgr::getDisplayer() const @@ -191,6 +280,15 @@ GEOM_Displayer* GEOMGUI_AnnotationMgr::getDisplayer() const return dynamic_cast( aModule->displayer() ); } +SALOME_View* GEOMGUI_AnnotationMgr::viewOrActiveView(SALOME_View* theView) const +{ + if ( !theView ) { + SalomeApp_Application* anApp = getApplication(); + SUIT_ViewWindow* anActiveWindow = anApp->desktop()->activeWindow(); + theView = dynamic_cast(anActiveWindow->getViewManager()->getViewModel()); + } +} + void GEOMGUI_AnnotationMgr::getObject( const QString& theEntry, const int theIndex, GEOM::GEOM_Object_ptr& theObject, GEOMGUI_AnnotationAttrs::Properties& theProperty ) @@ -198,9 +296,34 @@ void GEOMGUI_AnnotationMgr::getObject( const QString& theEntry, const int theInd SalomeApp_Study* aStudy = dynamic_cast( getApplication()->activeStudy() ); _PTR(SObject) aSObj = aStudy->studyDS()->FindObjectID( theEntry.toStdString() ); const Handle(GEOMGUI_AnnotationAttrs) aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + if ( !aShapeAnnotations.IsNull() ) { + aShapeAnnotations->GetProperties( theIndex, theProperty ); - aShapeAnnotations->GetProperties( theIndex, theProperty ); - - theObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject(aSObj) ); + theObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject(aSObj) ); + } } +void GEOMGUI_AnnotationMgr::storeVisibleState( const QString& theEntry, SALOME_View* theView ) +{ + SALOME_View* aView = viewOrActiveView( theView ); + if ( !aView || !myVisualized.contains( aView ) ) + return; + + EntryToAnnotations anEntryToAnnotation = myVisualized[aView]; + AnnotationToPrs anAnnotationToPrs; + if ( anEntryToAnnotation.contains( theEntry ) ) + anAnnotationToPrs = anEntryToAnnotation[theEntry]; + + + SalomeApp_Study* aStudy = dynamic_cast( getApplication()->activeStudy() ); + _PTR(SObject) aSObj = aStudy->studyDS()->FindObjectID( theEntry.toStdString() ); + const Handle(GEOMGUI_AnnotationAttrs) aShapeAnnotations = GEOMGUI_AnnotationAttrs::FindAttributes( aSObj ); + if ( !aShapeAnnotations.IsNull() ) { + const int aCount = aShapeAnnotations->GetNbAnnotation(); + for ( int anIndex = 0; anIndex < aCount; ++anIndex ) + { + bool aVisible = anAnnotationToPrs.contains( anIndex ); + aShapeAnnotations->SetIsVisible( anIndex, aVisible ); + } + } +} diff --git a/src/GEOMGUI/GEOMGUI_AnnotationMgr.h b/src/GEOMGUI/GEOMGUI_AnnotationMgr.h old mode 100644 new mode 100755 index 07dc55217..459b395f3 --- a/src/GEOMGUI/GEOMGUI_AnnotationMgr.h +++ b/src/GEOMGUI/GEOMGUI_AnnotationMgr.h @@ -47,25 +47,35 @@ public: GEOMGUI_AnnotationMgr( SalomeApp_Application* theApplication ); ~GEOMGUI_AnnotationMgr() {} - SALOME_Prs* CreatePresentation(const GEOMGUI_AnnotationAttrs::Properties& theProperty, - GEOM::GEOM_Object_ptr theObject); + SALOME_Prs* CreatePresentation( const GEOMGUI_AnnotationAttrs::Properties& theProperty, + GEOM::GEOM_Object_ptr theObject ); - //void DisplayPresentation(SALOME_Prs* thePresentation); - //void erasePresentation(SALOME_Prs* thePresentation); + bool IsDisplayed( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 ) const; + void Display( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 ); + void Erase( const QString& theEntry, const int theIndex, SALOME_View* theView = 0 ); - bool IsDisplayed(const QString& theEntry, const int theIndex); - void Display(const QString& theEntry, const int theIndex); - void Erase(const QString& theEntry, const int theIndex); + void DisplayVisibleAnnotations( const QString& theEntry, SALOME_View* theView ); + void EraseVisibleAnnotations( const QString& theEntry, SALOME_View* theView ); + + void RemoveView( SALOME_View* theView); + + QString getDisplayedIndicesInfo( const QString& theEntry, SALOME_View* theView ) const; + + void setDisplayedIndicesInfo( const QString& theEntry, SALOME_View* theView, const QString theIndicesInfo ); protected: SalomeApp_Application* getApplication() const { return myApplication; } GEOM_Displayer* getDisplayer() const; + SALOME_View* viewOrActiveView(SALOME_View* theView) const; + void getObject( const QString& theEntry, const int theIndex, GEOM::GEOM_Object_ptr& anObject, GEOMGUI_AnnotationAttrs::Properties& aProperty ); + void storeVisibleState( const QString& theEntry, SALOME_View* theView ); + private: SalomeApp_Application* myApplication; diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx index c802d52f1..4eb3457d0 100644 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx @@ -199,7 +199,7 @@ GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app ) this, SLOT( showContextMenu(const QPoint&) ) ); connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ), - this, SLOT( updateVisibilityColumn( QString, Qtx::VisibilityState ) ) ); + this, SLOT( onUpdateVisibilityColumn( QString, Qtx::VisibilityState ) ) ); connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) ); GeometryGUI* aGeomGUI = dynamic_cast( app->module( "Geometry" ) ); @@ -459,10 +459,10 @@ QTreeWidgetItem* GEOMGUI_TextTreeWdg::itemFromEntry( const BranchType& theBranch } //================================================================================= -// function : updateVisibilityColumn +// function : onUpdateVisibilityColumn // purpose : Update visible state of icons of entry items. //================================================================================= -void GEOMGUI_TextTreeWdg::updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState ) +void GEOMGUI_TextTreeWdg::onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState ) { // dimension property branch updateVisibilityColumn( DimensionShape, theEntry, theState ); @@ -619,6 +619,32 @@ void GEOMGUI_TextTreeWdg::setShapeItemVisibility( const BranchType& theBranchTyp // function : setShapeItemVisibility // purpose : //================================================================================= +void GEOMGUI_TextTreeWdg::updateVisibility( SALOME_View* theView ) +{ + //QList aDimensionObjEntries = getObjects( DimensionShape ).keys(); + BranchType aBranchType = AnnotationShape; + + QList anAnnotationObjEntries = getObjects( aBranchType ).keys(); + + QTreeWidgetItem* anItem; + foreach ( QString anEntry, getObjects( aBranchType ).keys() ) + { + anItem = itemFromEntry( aBranchType, anEntry ); + + int aDimIndex = idFromItem( anItem ); + QSharedPointer aProp = getVisualProperty( aBranchType, myStudy, + anEntry.toStdString() ); + bool isItemVisible = aProp->GetIsVisible( aDimIndex ); + anItem->setIcon( 1, isItemVisible ? myVisibleIcon : myInvisibleIcon ); + + redisplay( anEntry ); + } +} + +//================================================================================= +// function : setShapeItemVisibility +// purpose : +//================================================================================= bool GEOMGUI_TextTreeWdg::setShapeItemVisibility( QSharedPointer& theProps, QTreeWidgetItem* theWidgetItem, const bool theVisibility ) diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.h b/src/GEOMGUI/GEOMGUI_TextTreeWdg.h index 99830c8ef..1eb3aa7e3 100644 --- a/src/GEOMGUI/GEOMGUI_TextTreeWdg.h +++ b/src/GEOMGUI/GEOMGUI_TextTreeWdg.h @@ -66,6 +66,8 @@ public: const QString& theEntry, QTreeWidgetItem* theWidgetItem, const bool theVisibility ); + void updateVisibility( SALOME_View* theView ); + protected: void createActions(); void redisplay( QString theEntry ); @@ -78,7 +80,7 @@ public slots: private slots: void onItemClicked(QTreeWidgetItem*, int ); - void updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState ); + void onUpdateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState ); void setVisibility( QTreeWidgetItem* theItem, bool visibility ); void showContextMenu( const QPoint& pos ); diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index bbc48f06d..4e8c747aa 100755 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -47,6 +47,7 @@ #include #include +#include #include @@ -1373,6 +1374,7 @@ void GEOM_Displayer::updateShapeAnnotations( const Handle(SALOME_InteractiveObje const gp_Ax3& theShapeLCS ) { return; + /* SalomeApp_Study* aStudy = getStudy(); if ( !aStudy ) { @@ -1460,7 +1462,7 @@ void GEOM_Displayer::updateShapeAnnotations( const Handle(SALOME_InteractiveObje for ( aIterateIO.Initialize( aListOfIO ); aIterateIO.More(); aIterateIO.Next() ) { anOccPrs->AddObject( aIterateIO.Value() ); - } + }*/ } //================================================================= @@ -2157,6 +2159,12 @@ void GEOM_Displayer::BeforeDisplay( SALOME_View* v, const SALOME_OCCPrs* ) void GEOM_Displayer::AfterDisplay( SALOME_View* v, const SALOME_OCCPrs* p ) { UpdateColorScale(false,false); + // visualize annotations for displayed presentation + SUIT_Session* session = SUIT_Session::session(); + SalomeApp_Application* anApp = dynamic_cast( session->activeApplication() ); + GeometryGUI* aModule = dynamic_cast( anApp->activeModule() ); + if ( aModule ) + aModule->GetAnnotationMgr()->DisplayVisibleAnnotations(QString(p->GetEntry()), v); } void GEOM_Displayer::BeforeErase( SALOME_View* v, const SALOME_OCCPrs* p ) @@ -2169,6 +2177,13 @@ void GEOM_Displayer::AfterErase( SALOME_View* v, const SALOME_OCCPrs* p ) { LightApp_Displayer::AfterErase( v, p ); UpdateColorScale(false,false); + + // hide annotations for erased presentation + SUIT_Session* session = SUIT_Session::session(); + SalomeApp_Application* anApp = dynamic_cast( session->activeApplication() ); + GeometryGUI* aModule = dynamic_cast( anApp->activeModule() ); + if ( aModule ) + aModule->GetAnnotationMgr()->EraseVisibleAnnotations(QString(p->GetEntry()), v); } //================================================================= diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index f6e1a5b3f..a1f8677dd 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -1972,6 +1972,12 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win ) action( GEOMOp::OpEditField )->setEnabled( ViewOCC ); // Edit Field action( GEOMOp::OpMultiTransform )->setEnabled( ViewOCC ); // MENU BLOCKS - MULTI-TRANSFORMATION + + if ( ViewOCC ) + { + SUIT_ViewModel* vmodel = win->getViewManager()->getViewModel(); + myTextTreeWdg->updateVisibility(dynamic_cast(vmodel)); + } } void GeometryGUI::windows( QMap& mappa ) const @@ -2055,6 +2061,7 @@ void GeometryGUI::onViewManagerRemoved( SUIT_ViewManager* vm ) break; } } + GetAnnotationMgr()->RemoveView(dynamic_cast(viewer)); } //================================================================================ @@ -2904,6 +2911,9 @@ void GeometryGUI::storeVisualParameters (int savePoint) for (it = lst.begin(); it != lst.end(); it++) { SUIT_ViewManager* vman = *it; QString vType = vman->getType(); + SUIT_ViewModel* vmodel = vman->getViewModel(); + SALOME_View* aView = dynamic_cast(vmodel); + int aMgrId = vman->getGlobalId(); // saving VTK actors properties QVector views = vman->getViews(); @@ -3025,6 +3035,13 @@ void GeometryGUI::storeVisualParameters (int savePoint) param = occParam + GEOM::propertyName( GEOM::IsosWidth ); ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::IsosWidth )).toString().toStdString()); } + + std::string anAnnotationInfo = GetAnnotationMgr()->getDisplayedIndicesInfo(entry.c_str(), aView).toStdString(); + if (!anAnnotationInfo.empty()) { + param = occParam + "AttributeParameter"; + ip->setParameter(entry, param.toStdString(), anAnnotationInfo); + } + } // object iterator } // for (views) } // for (viewManagers) @@ -3189,7 +3206,10 @@ void GeometryGUI::restoreVisualParameters (int savePoint) aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::LineWidth ), val.toInt()); } else if (paramNameStr == GEOM::propertyName( GEOM::IsosWidth )) { aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::IsosWidth ), val.toInt()); + } else if (paramNameStr == "AttributeParameter") { + aListOfMap[viewIndex].insert( "AttributeParameter", val); } + } // for names/parameters iterator QList lst = getApp()->viewManagers(); @@ -3201,7 +3221,12 @@ void GeometryGUI::restoreVisualParameters (int savePoint) if (aListOfMap[index].value(GEOM::propertyName( GEOM::Visibility )) == 1) { SUIT_ViewManager* vman = lst.at(index); SUIT_ViewModel* vmodel = vman->getViewModel(); - displayer()->Display(entry, true, dynamic_cast(vmodel)); + SALOME_View* aView = dynamic_cast(vmodel); + displayer()->Display(entry, true, aView); + + PropMap aProps = aListOfMap[index]; + if ( aProps.contains( "AttributeParameter" ) ) + GetAnnotationMgr()->setDisplayedIndicesInfo( entry, aView, aProps["AttributeParameter"].toString() ); } } } // for entries iterator diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index d02125436..b736f666b 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -233,8 +233,8 @@ private: GEOMGUI_CreationInfoWdg* myCreationInfoWdg; - GEOMGUI_TextTreeWdg* myTextTreeWdg; - GEOMGUI_AnnotationMgr* myAnnotationMgr; + GEOMGUI_TextTreeWdg* myTextTreeWdg; + GEOMGUI_AnnotationMgr* myAnnotationMgr; SALOME_ListIO myTopLevelIOList; -- 2.39.2