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