SalomeApp_DataSubOwner.h \
SalomeApp_Selection.h \
SalomeApp_Filter.h \
- SalomeApp_TypeFilter.h
+ SalomeApp_TypeFilter.h \
+ SalomeApp_OBFilter.h
# .po files to transform in .qm
PO_FILES = SalomeApp_images.po \
SalomeApp_ModuleDlg.cxx \
SalomeApp_Selection.cxx \
SalomeApp_Filter.cxx \
- SalomeApp_TypeFilter.cxx
+ SalomeApp_TypeFilter.cxx \
+ SalomeApp_OBFilter.cxx
LIB_MOC = SalomeApp_Application.h \
SalomeApp_DataModel.h \
#include "SalomeApp_EventFilter.h"
#include "SalomeApp_WidgetContainer.h"
#include "SalomeApp_ModuleDlg.h"
+#include "SalomeApp_OBFilter.h"
#include <LogWindow.h>
if ( flag == WT_ObjectBrowser )
{
OB_Browser* ob = new OB_Browser( desktop() );
+ ob->setFilter( new SalomeApp_OBFilter(selectionMgr()) );
ob->setCaption( tr( "OBJECT_BROWSER" ) );
ob->resize( OBJECT_BROWSER_WIDTH, ob->height() );
--- /dev/null
+#include "SalomeApp_OBFilter.h"
+
+#include "SalomeApp_SelectionMgr.h"
+#include "SalomeApp_DataObject.h"
+#include "SalomeApp_DataOwner.h"
+
+SalomeApp_OBFilter::SalomeApp_OBFilter( SalomeApp_SelectionMgr* theSelMgr )
+{
+ mySelMgr = theSelMgr;
+}
+
+SalomeApp_OBFilter::~SalomeApp_OBFilter()
+{
+}
+
+bool SalomeApp_OBFilter::isOk( const SUIT_DataObject* theDataObj ) const
+{
+ const SalomeApp_DataObject* obj = dynamic_cast<const SalomeApp_DataObject*>( theDataObj );
+ if ( obj )
+ return mySelMgr->isOk( new SalomeApp_DataOwner( obj->entry() ) );
+
+ return false;
+}
+
--- /dev/null
+#ifndef SALOMEAPP_OBFILTER_H
+#define SALOMEAPP_OBFILTER_H
+
+#include "SalomeApp.h"
+#include "OB_Filter.h"
+
+class SalomeApp_SelectionMgr;
+
+class SALOMEAPP_EXPORT SalomeApp_OBFilter: public OB_Filter
+{
+public:
+ SalomeApp_OBFilter( SalomeApp_SelectionMgr* theSelMgr );
+ ~SalomeApp_OBFilter();
+
+ virtual bool isOk( const SUIT_DataObject* ) const;
+
+private:
+ SalomeApp_SelectionMgr* mySelMgr;
+
+};
+
+#endif