SalomeApp_NameDlg.h \
SalomeApp_ImportOperation.h \
SalomeApp_DataSubOwner.h \
- SalomeApp_Selection.h
+ SalomeApp_Selection.h \
+ SalomeApp_Filter.h \
+ SalomeApp_TypeFilter.h
# .po files to transform in .qm
PO_FILES = SalomeApp_images.po \
SalomeApp_ImportOperation.cxx \
SalomeApp_DataSubOwner.cxx \
SalomeApp_ModuleDlg.cxx \
- SalomeApp_Selection.cxx
+ SalomeApp_Selection.cxx \
+ SalomeApp_Filter.cxx \
+ SalomeApp_TypeFilter.cxx
LIB_MOC = SalomeApp_Application.h \
SalomeApp_DataModel.h \
CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS)
-LIBS+= -L$(GUI_ROOT_DIR)/lib/salome -lsuit -lstd -lCAM -lObjBrowser -L$(KERNEL_ROOT_DIR)/lib/salome -lOpUtil -lSALOMELocalTrace $(CAS_KERNEL) -lPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole -lLogWindow
+LIBS+= -L$(GUI_ROOT_DIR)/lib/salome -lsuit -lstd -lCAM -lObjBrowser -L$(KERNEL_ROOT_DIR)/lib/salome -lOpUtil -lSALOMELocalTrace $(CAS_KERNEL) -lPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole
@CONCLUDE@
--- /dev/null
+#include "SalomeApp_Filter.h"
+
+SalomeApp_Filter::SalomeApp_Filter( SalomeApp_Study* study )
+{
+ myStudy = study;
+}
+
+SalomeApp_Filter::~SalomeApp_Filter()
+{
+}
+
+SalomeApp_Study* SalomeApp_Filter::getStudy() const
+{
+ return myStudy;
+}
--- /dev/null
+#ifndef SALOMEAPP_FILTER_H
+#define SALOMEAPP_FILTER_H
+
+#include "SalomeApp.h"
+#include "SUIT_SelectionFilter.h"
+
+class SalomeApp_Study;
+
+class SALOMEAPP_EXPORT SalomeApp_Filter: public SUIT_SelectionFilter
+{
+public:
+ SalomeApp_Filter(SalomeApp_Study* study);
+ ~SalomeApp_Filter();
+
+protected:
+ SalomeApp_Study* getStudy() const;
+
+private:
+ SalomeApp_Study* myStudy;
+};
+
+#endif
--- /dev/null
+#include "SalomeApp_TypeFilter.h"
+
+#include "SalomeApp_DataOwner.h"
+#include "SalomeApp_Study.h"
+
+#include <SALOMEDS_SObject.hxx>
+
+SalomeApp_TypeFilter::SalomeApp_TypeFilter( SalomeApp_Study* study, const QString& kind )
+ : SalomeApp_Filter( study )
+{
+ myKind = kind;
+}
+
+SalomeApp_TypeFilter::~SalomeApp_TypeFilter()
+{
+}
+
+bool SalomeApp_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const
+{
+ const SalomeApp_DataOwner* owner = dynamic_cast<const SalomeApp_DataOwner*> ( sOwner );
+
+ SalomeApp_Study* aDoc = getStudy();
+ if (owner && aDoc && aDoc->studyDS())
+ {
+ _PTR(Study) aStudy = aDoc->studyDS();
+ QString entry = owner->entry();
+
+ _PTR(SObject) aSObj( aStudy->FindObjectID( entry.latin1() ) );
+ if (aSObj)
+ {
+ _PTR(SComponent) aComponent(aSObj->GetFatherComponent());
+ if ( aComponent && (aComponent->ComponentDataType() == myKind) )
+ return true;
+ }
+ }
+
+ return false;
+}
--- /dev/null
+#ifndef SALOMEAPP_TYPEFILTER_H
+#define SALOMEAPP_TYPEFILTER_H
+
+#include <qstring.h>
+
+#include "SalomeApp_Filter.h"
+
+class SALOMEAPP_EXPORT SalomeApp_TypeFilter: public SalomeApp_Filter
+{
+public:
+ SalomeApp_TypeFilter( SalomeApp_Study* study, const QString& kind );
+ ~SalomeApp_TypeFilter();
+
+ virtual bool isOk( const SUIT_DataOwner* ) const;
+
+private:
+ QString myKind;
+};
+
+#endif