SUIT_ViewModel.h \
SUIT_ViewWindow.h \
SUIT_ViewManager.h \
- SUIT_SelectionMgr.h
+ SUIT_SelectionMgr.h \
+ SUIT_Selector.h
RESOURCES_FILES = \
cascade.png \
SUIT_SelectionMgr::~SUIT_SelectionMgr()
{
+ mySelectors.setAutoDelete( true );
}
void SUIT_SelectionMgr::installSelector( SUIT_Selector* sel )
virtual void selected( SUIT_DataOwnerPtrList&, const QString& = QString::null ) const;
virtual void setSelected( const SUIT_DataOwnerPtrList&, const bool = false );
- virtual void installSelector( SUIT_Selector* );
- virtual void removeSelector( SUIT_Selector* );
-
void selectors( QPtrList<SUIT_Selector>& ) const;
void selectors( const QString&, QPtrList<SUIT_Selector>& ) const;
typedef QPtrListIterator<SUIT_Selector> SelectorListIterator;
+ virtual void installSelector( SUIT_Selector* );
+ virtual void removeSelector( SUIT_Selector* );
+
private:
void filterOwners( const SUIT_DataOwnerPtrList&, SUIT_DataOwnerPtrList& ) const;
#include "SUIT_SelectionMgr.h"
-SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr )
-: mySelMgr( selMgr ),
+SUIT_Selector::SUIT_Selector( SUIT_SelectionMgr* selMgr, QObject* parent ) :
+QObject( parent ),
+mySelMgr( selMgr ),
myBlock( false ),
myEnabled( true ),
myAutoBlock( true )
#include "SUIT.h"
#include <qvaluelist.h>
+#include <qobject.h>
class SUIT_SelectionMgr;
class SUIT_DataOwnerPtrList;
-class SUIT_EXPORT SUIT_Selector
+class SUIT_EXPORT SUIT_Selector : public QObject
{
+ Q_OBJECT
public:
- SUIT_Selector( SUIT_SelectionMgr* );
+ SUIT_Selector( SUIT_SelectionMgr*, QObject* = 0 );
virtual ~SUIT_Selector();
virtual QString type() const = 0;
{
static int _id = 0;
- myId = _id++;
+ myId = ++_id;
myRoot = new SUIT_DataObject();
myOperations.setAutoDelete( false );
#include <GLViewer_Context.h>
SalomeApp_GLSelector::SalomeApp_GLSelector( GLViewer_Viewer2d* viewer, SUIT_SelectionMgr* mgr )
-: QObject( 0 ),
-SUIT_Selector( mgr ),
-myViewer( viewer )
+: SUIT_Selector( mgr, viewer ),
+ myViewer( viewer )
{
if ( myViewer )
connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
#include "SalomeApp.h"
-#include <qobject.h>
-
#include <SUIT_Selector.h>
#include <GLViewer_Viewer2d.h>
-class SALOMEAPP_EXPORT SalomeApp_GLSelector : public QObject, public SUIT_Selector
+class SALOMEAPP_EXPORT SalomeApp_GLSelector : public SUIT_Selector
{
Q_OBJECT
#include <SUIT_DataObjectIterator.h>
SalomeApp_OBSelector::SalomeApp_OBSelector( OB_Browser* ob, SUIT_SelectionMgr* mgr )
-: QObject( 0 ),
-SUIT_Selector( mgr ),
-myBrowser( ob )
+: SUIT_Selector( mgr, ob ),
+ myBrowser( ob )
{
if ( myBrowser ) {
connect( myBrowser, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
#include <SUIT_Selector.h>
-#include <qobject.h>
-
class OB_Browser;
class SalomeApp_DataObject;
-class SALOMEAPP_EXPORT SalomeApp_OBSelector : public QObject, public SUIT_Selector
+class SALOMEAPP_EXPORT SalomeApp_OBSelector : public SUIT_Selector
{
Q_OBJECT
SalomeApp_OCCSelector::SalomeApp_OCCSelector( OCCViewer_Viewer* viewer, SUIT_SelectionMgr* mgr )
-: QObject( 0 ),
-SUIT_Selector( mgr ),
-myViewer( viewer )
+: SUIT_Selector( mgr, viewer ),
+ myViewer( viewer )
{
if ( myViewer )
connect( myViewer, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
#include <OCCViewer_ViewModel.h>
-#include <qobject.h>
-
class Handle_AIS_InteractiveObject;
-class SALOMEAPP_EXPORT SalomeApp_OCCSelector : public QObject, public SUIT_Selector
+class SALOMEAPP_EXPORT SalomeApp_OCCSelector : public SUIT_Selector
{
Q_OBJECT
SalomeApp_VTKSelector
::SalomeApp_VTKSelector( SVTK_Viewer* viewer,
SUIT_SelectionMgr* mgr ):
- QObject( 0 ),
- SUIT_Selector( mgr ),
+ SUIT_Selector( mgr, viewer ),
myViewer( viewer )
{
if ( myViewer )
#ifndef SALOMEAPP_VTKSELECTOR_H
#define SALOMEAPP_VTKSELECTOR_H
-#include <qobject.h>
-
#include <vtkSmartPointer.h>
#include <TColStd_IndexedMapOfInteger.hxx>
};
-class SALOMEAPP_EXPORT SalomeApp_VTKSelector : public QObject, public SUIT_Selector
+class SALOMEAPP_EXPORT SalomeApp_VTKSelector : public SUIT_Selector
{
Q_OBJECT;