LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
- mySelectedObjects = aListIO;
if (aListIO.Extent() < 1) return;
return myScalarBarsMap;
}
-void
-VisuGUI
-::selectedObjects( SALOME_ListIO& theList ) const
-{
- theList = mySelectedObjects;
-}
-
LightApp_Displayer* VisuGUI::displayer()
{
if( !myDisplayer )
VISU::TViewToPrs3d&
getScalarBarsMap();
-
- void selectedObjects( SALOME_ListIO& theList ) const;
public slots:
virtual bool deactivateModule( SUIT_Study* );
private:
LightApp_Displayer* myDisplayer;
- SALOME_ListIO mySelectedObjects;
VISU::TViewToPrs3d myScalarBarsMap;
};
{
setFrameStyle( QFrame::NoFrame );
- connect( VISU::GetSelectionMgr( theModule ), SIGNAL( selectionChanged() ), SLOT( onSelectionChanged() ) );
+ LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(theModule);
+
+ connect( aSelectionMgr, SIGNAL( selectionChanged() ), SLOT( onSelectionChanged() ) );
QGridLayout* aMainLayout = new QGridLayout( this, 1, 1, 11, 6 );
connect( myAddButton, SIGNAL(clicked()), this, SLOT(onAdd()));
connect( myRemoveButton, SIGNAL(clicked()), this, SLOT(onRemove()));
+ // Save current selection (to be restored in destructor)
+ aSelectionMgr->selectedObjects(mySavedSelection);
+
onTypeChanged();
onSelectionChanged();
//---------------------------------------------------------------
VisuGUI_InputPane::~VisuGUI_InputPane()
{
- if( myFieldFilter )
+ LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
+
+ if (myFieldFilter)
{
- VISU::GetSelectionMgr( myModule )->removeFilter( myFieldFilter );
+ aSelectionMgr->removeFilter(myFieldFilter);
delete myFieldFilter;
}
+
+ // Restore initial selection
+ aSelectionMgr->setSelectedObjects(mySavedSelection);
}
#include "VISUConfig.hh"
+#include "SALOME_ListIO.hxx"
+
#include <qgroupbox.h>
class QCheckBox;
int myEntity;
VisuGUI_FieldFilter* myFieldFilter;
+ SALOME_ListIO mySavedSelection;
};
#endif
QApplication::restoreOverrideCursor();
}
delete aDlg;
- RestoreSelection(theModule);
}
}
if (!GetViewWindow<TViewer>(theModule))
return;
- TPrs3d_i* aPrs3d = CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>
+ //TPrs3d_i* aPrs3d =
+ CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>
(theModule,theTimeStampSObj,thePublishInStudyMode);
- RestoreSelection(theModule);
-
theModule->application()->putInfo(QObject::tr("INF_DONE"));
}
theSelectionMgr->setSelectedObjects(aNewListIO);
}
- //------------------------------------------------------------
- //! Restores selection after presentation creating and editing
- void
- RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d)
- {
- SALOME_ListIO aList;
- theModule->selectedObjects(aList);
-
- if( thePrs3d )
- {
- Handle(SALOME_InteractiveObject) anIO = thePrs3d->GetIO();
- aList.Append(anIO);
- }
-
- LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
- aSelectionMgr->setSelectedObjects(aList);
- }
-
/*!
* \brief Check, if "Delete" popup-menu can be put on current selection
*
void Remove(LightApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO);
- void RestoreSelection(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d = NULL);
-
bool IsRemovableSelected(const SalomeApp_Module* theModule);
void DeleteSObject(VisuGUI* theModule,