]> SALOME platform Git repositories - modules/gui.git/blob - src/Prs/SALOME_Prs.cxx
Salome HOME
0022817: EDF GUI: [Regression] Help Browser is not closed when we close SALOME
[modules/gui.git] / src / Prs / SALOME_Prs.cxx
1 // Copyright (C) 2007-2014  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, or (at your option) any later version.
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
23 // File:        SALOME_Prs.cxx
24 // Author:      Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
25
26 #include "SALOME_Prs.h"
27
28 /*!
29   Constructor
30 */
31 SALOME_Prs::SALOME_Prs(const char* e) : myIsClippable(true)
32 {
33   myEntry = std::string( e ? e : "" );
34 }
35
36 /*!
37   Get entry
38 */
39 const char* SALOME_Prs::GetEntry() const
40 {
41   return myEntry.c_str();
42 }
43
44 /*!
45   Dispatches display operation to proper Display() method of SALOME_View
46 */
47 void SALOME_OCCPrs::DisplayIn( SALOME_View* v ) const
48 {
49   if ( v ) v->Display( this );
50 }
51
52 /*!
53   Dispatches display operation to proper Erase() method of SALOME_View
54 */
55 void SALOME_OCCPrs::EraseIn( SALOME_View* v, const bool forced ) const
56 {
57   if ( v ) v->Erase( this, forced );
58 }
59
60 /*!
61   Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
62 */
63 void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
64 {
65   d->BeforeDisplay( v, this );
66 }
67
68 /*!
69   Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
70 */
71 void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
72 {
73   d->AfterDisplay( v, this );
74 }
75
76 /*!
77   Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
78 */
79 void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
80 {
81   d->BeforeErase( v, this );
82 }
83
84 /*!
85   Dispatches display operation to proper AfterErase() method of SALOME_Displayer
86 */
87 void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
88 {
89   d->AfterErase( v, this );
90 }
91
92 /*!
93   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
94 */
95 void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const
96 {
97   if ( v ) v->LocalSelection( this, mode );
98 }
99
100 /*!
101    Dispatches update operation to proper Update() method of SALOME_Displayer
102 */
103 void SALOME_OCCPrs::Update( SALOME_Displayer* d )
104 {
105   if ( d ) d->Update( this );
106 }
107
108 /*!
109   Dispatches display operation to proper Display() method of SALOME_View
110 */
111 void SALOME_VTKPrs::DisplayIn( SALOME_View* v ) const
112 {
113   if ( v ) v->Display( this );
114 }
115
116 /*!
117   Dispatches display operation to proper Erase() method of SALOME_View
118 */
119 void SALOME_VTKPrs::EraseIn( SALOME_View* v, const bool forced ) const
120 {
121   if ( v ) v->Erase( this, forced );
122 }
123
124 /*!
125   Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
126 */
127 void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
128 {
129   d->BeforeDisplay( v, this );
130 }
131
132 /*!
133   Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
134 */
135 void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
136 {
137   d->AfterDisplay( v, this );
138 }
139
140 /*!
141   Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
142 */
143 void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
144 {
145   d->BeforeErase( v, this );
146 }
147
148 /*!
149   Dispatches display operation to proper AfterErase() method of SALOME_Displayer
150 */
151 void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
152 {
153   d->AfterErase( v, this );
154 }
155
156 /*!
157   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
158 */
159 void SALOME_VTKPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const
160 {
161   if ( v ) v->LocalSelection( this, mode );
162 }
163
164 /*!
165   Dispatches update operation to proper Update() method of SALOME_Displayer
166 */
167 void SALOME_VTKPrs::Update( SALOME_Displayer* d )
168 {
169   if ( d ) d->Update( this );
170 }
171
172 /*!
173   Dispatches display operation to proper Display() method of SALOME_View
174 */
175 void SALOME_Prs2d::DisplayIn( SALOME_View* v ) const
176 {
177   if ( v ) v->Display( this );
178 }
179
180 /*!
181   Dispatches display operation to proper Erase() method of SALOME_View
182 */
183 void SALOME_Prs2d::EraseIn( SALOME_View* v, const bool forced ) const
184 {
185   if ( v ) v->Erase( this, forced );
186 }
187
188 /*!
189   Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
190 */
191 void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
192 {
193   d->BeforeDisplay( v, this );
194 }
195
196 /*!
197   Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
198 */
199 void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
200 {
201   d->AfterDisplay( v, this );
202 }
203
204 /*!
205   Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
206 */
207 void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
208 {
209   d->BeforeErase( v, this );
210 }
211
212 /*!
213   Dispatches display operation to proper AfterErase() method of SALOME_Displayer
214 */
215 void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
216 {
217   d->AfterErase( v, this );
218 }
219
220 /*!
221   Dispatches operation to proper LocalSelectionIn() method of SALOME_View
222 */
223 void SALOME_Prs2d::LocalSelectionIn( SALOME_View* v, const int mode ) const
224 {
225   if ( v ) v->LocalSelection( this, mode );
226 }
227
228 /*!
229   Dispatches update operation to proper Update() method of SALOME_Displayer
230 */
231 void SALOME_Prs2d::Update( SALOME_Displayer* d )
232 {
233   if ( d ) d->Update( this );
234 }
235
236 /*!
237   Gives control to SALOME_Prs object, so that it could perform double dispatch
238 */
239 void SALOME_View::Display( SALOME_Displayer* d, const SALOME_Prs* prs )
240 {
241   prs->DisplayIn( this );
242   if ( d ) d->UpdateVisibility( this, prs, true );
243 }
244
245 /*!
246   Gives control to SALOME_Prs object, so that it could perform double dispatch
247 */
248 void SALOME_View::Erase( SALOME_Displayer* d, const SALOME_Prs* prs, const bool forced )
249 {
250   prs->EraseIn( this, forced );
251   if ( d ) d->UpdateVisibility( this, prs, false );
252 }
253
254 /*!
255   Gives control to SALOME_Prs object, so that it could perform double dispatch
256 */
257 void SALOME_View::LocalSelection( const SALOME_Prs* prs, const int mode )
258 {
259   prs->LocalSelectionIn( this, mode );
260 }
261
262 /*!
263   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
264 */
265 void SALOME_View::Display( const SALOME_OCCPrs* )
266 {
267 //  MESSAGE( "SALOME_View::Display( const SALOME_OCCPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
268 }
269
270 /*!
271   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
272 */
273 void SALOME_View::Display( const SALOME_VTKPrs* )
274 {
275 //  MESSAGE( "SALOME_View::Display( const SALOME_VTKPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
276 }
277
278 /*!
279   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
280 */
281 void SALOME_View::Display( const SALOME_Prs2d* )
282 {
283 //  MESSAGE( "SALOME_View::Display( const SALOME_Prs2d& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
284 }
285
286 /*!
287   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
288 */
289 void SALOME_View::Erase( const SALOME_OCCPrs*, const bool )
290 {
291 //  MESSAGE( "SALOME_View::Erase( const SALOME_OCCPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." );
292 }
293
294 /*!
295   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
296 */
297 void SALOME_View::Erase( const SALOME_VTKPrs*, const bool )
298 {
299 //  MESSAGE( "SALOME_View::Erase( const SALOME_VTKPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." );
300 }
301
302 /*!
303   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
304 */
305 void SALOME_View::Erase( const SALOME_Prs2d*, const bool )
306 {
307 //  MESSAGE( "SALOME_View::Erase( const SALOME_Prs2d& ) called! Probably, presentation is being erased in uncompatible viewframe." );
308 }
309
310 /*!
311   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
312 */
313 void SALOME_View::EraseAll( SALOME_Displayer* d, const bool )
314 {
315 //  MESSAGE( "SALOME_View::EraseAll() called!" );
316   if ( d ) d->UpdateVisibility( this, 0, false );
317 }
318
319 /*!
320   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
321 */
322 void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int )
323 {
324 //  MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called!
325 //   Probably, selection is being activated in uncompatible viewframe." );
326 }
327
328 /*!
329   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
330 */
331 void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int )
332 {
333 //  MESSAGE( "SALOME_View::LocalSelection( const SALOME_VTKPrs* ) called!
334 //   Probably, selection is being activated in uncompatible viewframe." );
335 }
336
337 /*!
338   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
339 */
340 void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int )
341 {
342 //  MESSAGE( "SALOME_View::LocalSelection( const SALOME_Prs2d* ) called!
343 //   Probably, selection is being activated in uncompatible viewframe." );
344 }
345
346 /*!
347   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
348 */
349 void SALOME_View::GlobalSelection( const bool ) const
350 {
351 //  MESSAGE( "SALOME_View::GlobalSelection() called!
352 //   Probably, selection is being activated in uncompatible viewframe." );
353 }
354
355 void SALOME_View::BeforeDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
356 {
357   p->BeforeDisplayIn( d, this );
358 }
359
360 void SALOME_View::AfterDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
361 {
362   p->AfterDisplayIn( d, this );
363 }
364
365 void SALOME_View::BeforeErase( SALOME_Displayer* d, const SALOME_Prs* p )
366 {
367   p->BeforeEraseIn( d, this );
368 }
369
370 void SALOME_View::AfterErase ( SALOME_Displayer* d, const SALOME_Prs* p )
371 {
372   p->AfterEraseIn( d, this );
373 }
374
375 /*!
376   Gives control to SALOME_Prs object, so that it could perform double dispatch
377 */
378 void SALOME_Displayer::UpdatePrs( SALOME_Prs* prs )
379 {
380   prs->Update( this );
381 }
382
383 /*!
384   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
385 */
386 void SALOME_Displayer::Update( SALOME_OCCPrs* )
387 {
388 //  MESSAGE( "SALOME_Displayer::Update( SALOME_OCCPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." );
389 }
390
391 /*!
392   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
393 */
394 void SALOME_Displayer::Update( SALOME_VTKPrs* )
395 {
396 //  MESSAGE( "SALOME_Displayer::Update( SALOME_VTKPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." );
397 }
398
399 /*!
400   Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
401 */
402 void SALOME_Displayer::Update( SALOME_Prs2d* )
403 {
404 //  MESSAGE( "SALOME_Displayer::Update( SALOME_Prs2d* ) called! Probably, presentation is being updated in uncompatible viewframe." );
405 }
406
407 /*!
408   Virtual method, should be reimplemented in successors, by default does nothing.
409 */
410 void SALOME_Displayer::UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool )
411 {
412 }