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