]> SALOME platform Git repositories - modules/visu.git/blob - src/VVTK/VVTK_ViewWindow.h
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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 <qimage.h>
31
32 #include <string>
33
34 class VVTK_MainWindow1;
35 class VVTK_MainWindow2;
36 class SVTK_View;
37
38 //----------------------------------------------------------------------------
39 //! Customize the SVTK_ViewWindow in order to manage two SVTK_View (base and segmented one)
40 class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
41 {
42   Q_OBJECT;
43
44 public:
45   //! To construct the class
46   VVTK_ViewWindow(SUIT_Desktop* theDesktop);
47
48   //! Destroy
49   virtual
50   ~VVTK_ViewWindow();
51
52   //! To initialize
53   virtual
54   void
55   Initialize(SVTK_ViewModelBase* theModel);
56
57   //----------------------------------------------------------------------------
58   //! Get access to base SVTK_MainWindow
59   VVTK_MainWindow1* 
60   getMainWindow1();
61
62   //! Get access to segmented SVTK_MainWindow
63   VVTK_MainWindow2* 
64   getMainWindow2();
65
66   //----------------------------------------------------------------------------
67   //! Redefine SVTK_ViewWindow::AddActor method
68   /*!
69     This is an entry point for publication the presentation into the viewer.
70     Pointed actor published into the basic MainWindow. If the actor is
71     a Gauss Points one second actor is created from initial actor and 
72     is put into segemented MainWindow.
73   */
74   virtual
75   void
76   AddActor(VTKViewer_Actor* theActor,
77            bool theIsUpdate = false);
78
79   //! Redefine SVTK_ViewWindow::RemoveActor method
80   virtual
81   void
82   RemoveActor(VTKViewer_Actor* theActor,
83               bool theIsUpdate = false);
84
85   //! Redefine SVTK_ViewWindow::Repaint method
86   virtual
87   void
88   Repaint(bool theUpdateTrihedron = true);
89
90   //----------------------------------------------------------------------------
91   /*  interactive object management */
92   //! Redefine SVTK_ViewWindow::highlight method
93   virtual
94   void
95   highlight(const Handle(SALOME_InteractiveObject)& theIO, 
96             bool theIsHighlight = true, 
97             bool theIsUpdate = true);
98
99   //! Redefine SVTK_ViewWindow::unHighlightAll method
100   virtual
101   void
102   unHighlightAll();
103
104   //! Redefine SVTK_ViewWindow::setBackgroundColor method
105   virtual
106   void
107   setBackgroundColor( const QColor& );
108
109   //----------------------------------------------------------------------------
110
111   //! Refresh dump images of the viewers
112   virtual
113   void RefreshDumpImage();
114   
115 public slots:
116   //! Redefine SVTK_ViewWindow::onSelectionChanged method
117   virtual
118   void
119   onSelectionChanged();
120
121   //! Redefine SVTK_ViewWindow::onResetView method
122   virtual
123   void
124   onResetView();     
125
126   //! Redefine SVTK_ViewWindow::onFitAll method
127   virtual
128   void 
129   onFitAll();
130
131   //----------------------------------------------------------------------------
132 protected:
133   virtual 
134   bool
135   action( const int );
136
137   virtual QImage dumpView();
138
139   VVTK_MainWindow1* myMainWindow1; //!< The manage base view
140   SVTK_View* myView1; //!< The manage base view
141
142   VVTK_MainWindow2* myMainWindow2; //!< The manage segmented view
143   SVTK_View* myView2; //!< The manage segmented view
144
145 private:
146   QImage myDumpImage;
147 };
148
149 #ifdef WIN32
150 #pragma warning( default:4251 )
151 #endif
152
153 #endif