]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
To provide possibility to customize the package
authorapo <apo@opencascade.com>
Tue, 16 Aug 2005 13:24:19 +0000 (13:24 +0000)
committerapo <apo@opencascade.com>
Tue, 16 Aug 2005 13:24:19 +0000 (13:24 +0000)
src/SVTK/Makefile.in
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewModelBase.h [new file with mode: 0644]
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h

index 7a5f2ad6a2730825106fcca58d532fdc0ad9ad8e..f197eaff116d6052f7fe33a5455b65df3dd666e0 100755 (executable)
@@ -27,7 +27,8 @@ EXPORT_HEADERS= SVTK.h \
                SVTK_RenderWindowInteractor.h \
                SVTK_Selector.h \
                SVTK_Selection.h \
-               SVTK_SelectionEvent.h
+               SVTK_SelectionEvent.h \
+               SVTK_ViewModelBase.h
 
 # Libraries targets
 LIB = libSVTK.la
@@ -52,7 +53,8 @@ LIB_MOC =     SVTK_RenderWindowInteractor.h \
                SVTK_View.h \
                SVTK_ViewWindow.h \
                SVTK_ViewModel.h \
-               SVTK_ViewManager.h
+               SVTK_ViewManager.h \
+               SVTK_ViewModelBase.h
 
 LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_Exception.idl \
index 603e59ca11d5bc0f3a924aab7495ac1e970f6728..1eef62e4cc633bc80c87a59aa5112aad3bfe4f63 100644 (file)
@@ -16,6 +16,8 @@
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_RenderWindow.h"
 
+#include "VTKViewer_ViewModel.h"
+
 #include "ToolsGUI.h"
 
 #include "SALOME_Actor.h"
@@ -433,11 +435,3 @@ SVTK_Viewer
        if(SVTK_RenderWindow* aRW = aView->getView())
          aRW->update();
 }
-
-void 
-SVTK_Viewer
-::onSelectionChanged()
-{
-  emit selectionChanged();
-}
-
index 912e31f3da37fbac05dfb81390aeb6688e68ab63..24b6a30064a0ed36ed72e436f61f52879c61db52 100644 (file)
@@ -2,6 +2,8 @@
 #define SVTK_VIEWMODEL_H
 
 #include "SVTK.h"
+#include "SVTK_ViewModelBase.h"
+
 #include "VTKViewer_ViewModel.h"
 
 #include "SALOME_Prs.h"
 
 #include <qcolor.h>
 
-class SVTK_EXPORT SVTK_Viewer : public SUIT_ViewModel, public SALOME_View 
+class SVTK_ViewWindow;
+
+class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View 
 {
   Q_OBJECT;
 
 public:
+  typedef SVTK_ViewWindow TViewWindow;
   static QString Type() { return "VTKViewer"; }
 
   SVTK_Viewer();
@@ -50,16 +55,6 @@ public:
   virtual bool                   isVisible( const Handle(SALOME_InteractiveObject)& );
   virtual void                   Repaint();
 
-  //implemented in SOCC, but were not found in VTKVIEwer_ViewFrame, so not implemented here..
-  //?virtual void                LocalSelection( const SALOME_OCCPrs*, const int );
-  //?virtual void                GlobalSelection( const bool = false ) const;
-
-public slots:
-  void onSelectionChanged();
-
- signals:
-  void selectionChanged();
-
 protected slots:
   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
diff --git a/src/SVTK/SVTK_ViewModelBase.h b/src/SVTK/SVTK_ViewModelBase.h
new file mode 100644 (file)
index 0000000..abe805c
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef SVTK_SELECTIONCHANGED_H
+#define SVTK_SELECTIONCHANGED_H
+
+#include <qobject.h>
+
+#include "SVTK.h"
+#include "SUIT_ViewModel.h"
+
+class SVTK_EXPORT SVTK_ViewModelBase: public SUIT_ViewModel
+{
+  Q_OBJECT;
+
+public slots:
+  void onSelectionChanged()
+  {
+    emit selectionChanged();
+  }
+
+ signals:
+  void selectionChanged();
+};
+
+#endif
index 34870b38d770a6c9ac7a75167cf5e055587ecafd..d23fe6ddddaa8588fa48bcfe777c4ada0c5066df 100755 (executable)
@@ -26,7 +26,7 @@
 
 //#include "SVTK_View.h"
 #include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
+#include "SVTK_ViewModelBase.h"
 #include "SVTK_RenderWindowInteractor.h"
 #include "SVTK_InteractorStyle.h"
 
 //----------------------------------------------------------------------------
 SVTK_ViewWindow
 ::SVTK_ViewWindow( SUIT_Desktop* theDesktop, 
-                  SVTK_Viewer* theModel)
+                  SVTK_ViewModelBase* theModel)
   : SUIT_ViewWindow( theDesktop )
 {
-  myModel = theModel;
   mySelector = new SVTK_SelectorDef();
   connect(this,SIGNAL(selectionChanged()),theModel,SLOT(onSelectionChanged()));
 
index 86f666251250b3628e4cee2aad41e600b3d4de30..461a34e433fcad8fe45b3b16bd9fb0f319b6b8d1 100755 (executable)
@@ -18,7 +18,7 @@ class SUIT_Desktop;
 class VTKViewer_Actor;
 class VTKViewer_Trihedron;
 
-class SVTK_Viewer;
+class SVTK_ViewModelBase;
 class SVTK_Selector;
 
 //class SVTK_View;
@@ -33,7 +33,7 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   Q_OBJECT
 
 public:
-  SVTK_ViewWindow( SUIT_Desktop*, SVTK_Viewer* );
+  SVTK_ViewWindow( SUIT_Desktop*, SVTK_ViewModelBase* );
   virtual ~SVTK_ViewWindow();
   
   void setBackgroundColor( const QColor& );
@@ -148,7 +148,6 @@ private:
   //void MoveActor( VTKViewer_Actor* theActor );
 
 private:  
-  SVTK_Viewer* myModel;
   SVTK_Selector* mySelector;
 
   SVTK_View* myView;