Salome HOME
ca0ab04c8630650bd967e74cb56c9b06e210f791
[modules/visu.git] / src / VVTK / VVTK_ViewWindow.h
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
8 //
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #ifndef VVTK_VIEWWINDOW_H
21 #define VVTK_VIEWWINDOW_H
22
23 #ifdef WIN32
24 #pragma warning( disable:4251 )
25 #endif
26
27 #include "VVTK.h"
28 #include "SVTK_ViewWindow.h"
29
30 #include <string>
31
32 class VVTK_MainWindow1;
33 class VVTK_MainWindow2;
34 class SVTK_View;
35
36 //----------------------------------------------------------------------------
37 //! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one)
38 class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
39 {
40   Q_OBJECT;
41
42 public:
43   //! To construct the class
44   VVTK_ViewWindow(SUIT_Desktop* theDesktop);
45
46   //! Destroy
47   virtual
48   ~VVTK_ViewWindow();
49
50   //! To initialize
51   virtual
52   void
53   Initialize(SVTK_ViewModelBase* theModel);
54
55   //----------------------------------------------------------------------------
56   //! Get access to base SVTK_MainWindow
57   VVTK_MainWindow1* 
58   getMainWindow1();
59
60   //! Get access to segmented SVTK_MainWindow
61   VVTK_MainWindow2* 
62   getMainWindow2();
63
64   //----------------------------------------------------------------------------
65   //! Redefine SVTK_ViewWindow::AddActor method
66   /*!
67     This is an entry point for publication the presentation into the viewer.
68     Pointed actor published into the basic MainWindow. If the actor is
69     a Gauss Points one second actor is created from initial actor and 
70     is put into segemented MainWindow.
71   */
72   virtual
73   void
74   AddActor(VTKViewer_Actor* theActor,
75            bool theIsUpdate = false);
76
77   //! Redefine SVTK_ViewWindow::RemoveActor method
78   virtual
79   void
80   RemoveActor(VTKViewer_Actor* theActor,
81               bool theIsUpdate = false);
82
83   //! Redefine SVTK_ViewWindow::Repaint method
84   virtual
85   void
86   Repaint(bool theUpdateTrihedron = true);
87
88   //----------------------------------------------------------------------------
89   /*  interactive object management */
90   //! Redefine SVTK_ViewWindow::highlight method
91   virtual
92   void
93   highlight(const Handle(SALOME_InteractiveObject)& theIO, 
94             bool theIsHighlight = true, 
95             bool theIsUpdate = true);
96
97   //! Redefine SVTK_ViewWindow::unHighlightAll method
98   virtual
99   void
100   unHighlightAll();
101
102   //! Redefine SVTK_ViewWindow::setBackgroundColor method
103   virtual
104   void
105   setBackgroundColor( const QColor& );
106
107   //----------------------------------------------------------------------------
108 public slots:
109   //! Redefine SVTK_ViewWindow::onSelectionChanged method
110   virtual
111   void
112   onSelectionChanged();
113
114   //! Redefine SVTK_ViewWindow::onResetView method
115   virtual
116   void
117   onResetView();     
118
119   //! Redefine SVTK_ViewWindow::onFitAll method
120   virtual
121   void 
122   onFitAll();
123
124   //----------------------------------------------------------------------------
125 protected:
126   virtual 
127   bool
128   action( const int );
129
130   virtual QImage dumpView();
131
132   VVTK_MainWindow1* myMainWindow1; //!< The manage base view
133   SVTK_View* myView1; //!< The manage base view
134
135   VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
136   SVTK_View* myView2; //!< The manage segmented view
137 };
138
139 #ifdef WIN32
140 #pragma warning( default:4251 )
141 #endif
142
143 #endif