Back to index

salome-gui  6.5.0
LightApp_VTKSelector.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef LIGHTAPP_VTKSELECTOR_H
00024 #define LIGHTAPP_VTKSELECTOR_H
00025 
00026 #include "SUIT_Selector.h"
00027 #include "LightApp.h"
00028 #include "LightApp_DataOwner.h"
00029 
00030 #include <QObject>
00031 
00032 class SUIT_Desktop;
00033 
00034 #ifndef DISABLE_VTKVIEWER
00035   #include <TColStd_IndexedMapOfInteger.hxx>
00036   #include "SVTK_Selection.h"
00037 #ifndef DISABLE_SALOMEOBJECT
00038   #include "SALOME_InteractiveObject.hxx"
00039 #endif
00040   class SALOME_Actor;
00041   class SVTK_ViewWindow;
00042   class SVTK_ViewModelBase;
00043 #endif
00044 
00048 class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
00049 {
00050  public:
00051    virtual ~LightApp_SVTKDataOwner() {};
00052 #ifndef DISABLE_VTKVIEWER
00053    #ifndef DISABLE_SALOMEOBJECT
00054     LightApp_SVTKDataOwner( const Handle(SALOME_InteractiveObject)&, SUIT_Desktop* );
00055    #else
00056     LightApp_SVTKDataOwner( const QString& );
00057    #endif
00058 
00060     const TColStd_IndexedMapOfInteger& GetIds() const;
00061 
00063     Selection_Mode GetMode() const;
00064 
00066     SALOME_Actor* GetActor() const;
00067 
00068  protected:
00069     mutable TColStd_IndexedMapOfInteger myIds;
00070 
00071     SVTK_ViewWindow* GetActiveViewWindow() const;
00072     SUIT_Desktop* myDesktop;
00073 #endif
00074 };
00075 
00076 
00081 class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector
00082 {
00083   Q_OBJECT;
00084 
00085 public:
00086   virtual ~LightApp_VTKSelector() {};
00087 #ifndef DISABLE_VTKVIEWER
00088   LightApp_VTKSelector( SVTK_ViewModelBase*, SUIT_SelectionMgr* );
00089 
00090   SVTK_ViewModelBase* viewer() const;
00091 
00092   virtual QString type() const;
00093 #else
00094   LightApp_VTKSelector( SUIT_SelectionMgr* );
00095 #endif
00096 
00097 private slots:
00098   void              onSelectionChanged();
00099 
00100 #ifndef DISABLE_VTKVIEWER
00101 protected:
00102   virtual void      getSelection( SUIT_DataOwnerPtrList& ) const;
00103   virtual void      setSelection( const SUIT_DataOwnerPtrList& );
00104 
00105 private:
00106   SVTK_ViewModelBase* myViewer;
00107 
00108 #endif
00109 };
00110 
00111 #endif