]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/SVTK/SVTK_ViewModel.h
Salome HOME
Merge from OCC_development_generic_2006
[modules/gui.git] / src / SVTK / SVTK_ViewModel.h
index 912e31f3da37fbac05dfb81390aeb6688e68ab63..5875d465e57aecb54e59b34d820ee5c37d246beb 100644 (file)
@@ -1,35 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
 #ifndef SVTK_VIEWMODEL_H
 #define SVTK_VIEWMODEL_H
 
 #include "SVTK.h"
-#include "VTKViewer_ViewModel.h"
+#include "SUIT_ViewModel.h"
+#include "SVTK_ViewModelBase.h"
 
 #include "SALOME_Prs.h"
 #include "SALOME_InteractiveObject.hxx"
 
 #include <qcolor.h>
 
-class SVTK_EXPORT SVTK_Viewer : public SUIT_ViewModel, public SALOME_View 
+class SVTK_ViewWindow;
+
+//! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View 
+class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View 
 {
   Q_OBJECT;
 
 public:
+  typedef SVTK_ViewWindow TViewWindow;
+  
+  //! Define string representation of the viewer type
   static QString Type() { return "VTKViewer"; }
 
   SVTK_Viewer();
   virtual ~SVTK_Viewer();
 
+  //! See #SUIT_ViewModel::createView
   virtual SUIT_ViewWindow* createView(SUIT_Desktop*);
 
-  virtual void             setViewManager(SUIT_ViewManager* theViewManager);
-  virtual void             contextMenuPopup( QPopupMenu* );
-  virtual QString          getType() const { return Type(); }
+  //! See #SUIT_ViewModel::createView
+  virtual void setViewManager(SUIT_ViewManager* theViewManager);
+
+  //! See #SUIT_ViewModel::contextMenuPopup
+  virtual void contextMenuPopup( QPopupMenu* );
 
+  //! See #SUIT_ViewModel::getType
+  virtual QString getType() const { return Type(); }
+
+  //! Get background color of the viewer
   QColor backgroundColor() const;
-  void   setBackgroundColor( const QColor& );
 
-  int    trihedronSize() const;
-  void   setTrihedronSize( const int );
+  //! Set background color to the viewer
+  void setBackgroundColor( const QColor& );
+
+  //! Get size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
+  int trihedronSize() const;
+
+  //! Set size of trihedron of the viewer (see #SVTK_Renderer::SetTrihedronSize)
+  void setTrihedronSize( const int );
 
 public:
   void enableSelection(bool isEnabled);
@@ -41,24 +78,30 @@ public:
   int  getSelectionCount() const;
 
   /* Reimplemented from SALOME_View */
-  void                           Display( const SALOME_VTKPrs* );
-  void                           Erase( const SALOME_VTKPrs*, const bool = false );
-  void                           EraseAll( const bool = false );
-  SALOME_Prs*                    CreatePrs( const char* entry = 0 );
-  virtual void                   BeforeDisplay( SALOME_Displayer* d );
-  virtual void                   AfterDisplay ( SALOME_Displayer* d );
-  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();
+
+  //! See #SALOME_View::Display( const SALOME_Prs* )
+  void Display( const SALOME_VTKPrs* ); 
+
+  //! See #SALOME_View::Erase( const SALOME_VTKPrs*, const bool = false )
+  void Erase( const SALOME_VTKPrs*, const bool = false );
+
+  //! See #SALOME_View::EraseAll( const bool = false )
+  void EraseAll( const bool = false );
+
+  //! See #SALOME_View::CreatePrs( const char* entry = 0 )
+  SALOME_Prs* CreatePrs( const char* entry = 0 );
+
+  //! See #SALOME_View::BeforeDisplay( SALOME_Displayer* d )
+  virtual void BeforeDisplay( SALOME_Displayer* d );
+
+  //! See #SALOME_View::AfterDisplay( SALOME_Displayer* d )
+  virtual void AfterDisplay( SALOME_Displayer* d );
+
+  //! See #SALOME_View::isVisible( const Handle(SALOME_InteractiveObject)& )
+  virtual bool isVisible( const Handle(SALOME_InteractiveObject)& );
+
+  //! See #SALOME_View::Repaint()
+  virtual void Repaint();
 
 protected slots:
   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);