1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: SALOME_Prs.cxx
24 // Author: Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
26 #include "SALOME_Prs.h"
31 SALOME_Prs::SALOME_Prs(const char* e) : myIsClippable(true)
33 myEntry = std::string( e ? e : "" );
39 const char* SALOME_Prs::GetEntry() const
41 return myEntry.c_str();
45 Dispatches display operation to proper Display() method of SALOME_View
47 void SALOME_OCCPrs::DisplayIn( SALOME_View* v ) const
49 if ( v ) v->Display( this );
53 Dispatches display operation to proper Erase() method of SALOME_View
55 void SALOME_OCCPrs::EraseIn( SALOME_View* v, const bool forced ) const
57 if ( v ) v->Erase( this, forced );
61 Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
63 void SALOME_OCCPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
65 d->BeforeDisplay( v, this );
69 Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
71 void SALOME_OCCPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
73 d->AfterDisplay( v, this );
77 Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
79 void SALOME_OCCPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
81 d->BeforeErase( v, this );
85 Dispatches display operation to proper AfterErase() method of SALOME_Displayer
87 void SALOME_OCCPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
89 d->AfterErase( v, this );
93 Dispatches operation to proper LocalSelectionIn() method of SALOME_View
95 void SALOME_OCCPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const
97 if ( v ) v->LocalSelection( this, mode );
101 Dispatches update operation to proper Update() method of SALOME_Displayer
103 void SALOME_OCCPrs::Update( SALOME_Displayer* d )
105 if ( d ) d->Update( this );
109 Dispatches display operation to proper Display() method of SALOME_View
111 void SALOME_VTKPrs::DisplayIn( SALOME_View* v ) const
113 if ( v ) v->Display( this );
117 Dispatches display operation to proper Erase() method of SALOME_View
119 void SALOME_VTKPrs::EraseIn( SALOME_View* v, const bool forced ) const
121 if ( v ) v->Erase( this, forced );
125 Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
127 void SALOME_VTKPrs::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
129 d->BeforeDisplay( v, this );
133 Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
135 void SALOME_VTKPrs::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
137 d->AfterDisplay( v, this );
141 Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
143 void SALOME_VTKPrs::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
145 d->BeforeErase( v, this );
149 Dispatches display operation to proper AfterErase() method of SALOME_Displayer
151 void SALOME_VTKPrs::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
153 d->AfterErase( v, this );
157 Dispatches operation to proper LocalSelectionIn() method of SALOME_View
159 void SALOME_VTKPrs::LocalSelectionIn( SALOME_View* v, const int mode ) const
161 if ( v ) v->LocalSelection( this, mode );
165 Dispatches update operation to proper Update() method of SALOME_Displayer
167 void SALOME_VTKPrs::Update( SALOME_Displayer* d )
169 if ( d ) d->Update( this );
173 Dispatches display operation to proper Display() method of SALOME_View
175 void SALOME_Prs2d::DisplayIn( SALOME_View* v ) const
177 if ( v ) v->Display( this );
181 Dispatches display operation to proper Erase() method of SALOME_View
183 void SALOME_Prs2d::EraseIn( SALOME_View* v, const bool forced ) const
185 if ( v ) v->Erase( this, forced );
189 Dispatches display operation to proper BeforeDisplay() method of SALOME_Displayer
191 void SALOME_Prs2d::BeforeDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
193 d->BeforeDisplay( v, this );
197 Dispatches display operation to proper AfterDisplay() method of SALOME_Displayer
199 void SALOME_Prs2d::AfterDisplayIn( SALOME_Displayer* d, SALOME_View* v ) const
201 d->AfterDisplay( v, this );
205 Dispatches display operation to proper BeforeErase() method of SALOME_Displayer
207 void SALOME_Prs2d::BeforeEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
209 d->BeforeErase( v, this );
213 Dispatches display operation to proper AfterErase() method of SALOME_Displayer
215 void SALOME_Prs2d::AfterEraseIn( SALOME_Displayer* d, SALOME_View* v ) const
217 d->AfterErase( v, this );
221 Dispatches operation to proper LocalSelectionIn() method of SALOME_View
223 void SALOME_Prs2d::LocalSelectionIn( SALOME_View* v, const int mode ) const
225 if ( v ) v->LocalSelection( this, mode );
229 Dispatches update operation to proper Update() method of SALOME_Displayer
231 void SALOME_Prs2d::Update( SALOME_Displayer* d )
233 if ( d ) d->Update( this );
237 Gives control to SALOME_Prs object, so that it could perform double dispatch
239 void SALOME_View::Display( SALOME_Displayer* d, const SALOME_Prs* prs )
241 prs->DisplayIn( this );
242 if ( d ) d->UpdateVisibility( this, prs, true );
246 Gives control to SALOME_Prs object, so that it could perform double dispatch
248 void SALOME_View::Erase( SALOME_Displayer* d, const SALOME_Prs* prs, const bool forced )
250 prs->EraseIn( this, forced );
251 if ( d ) d->UpdateVisibility( this, prs, false );
255 Gives control to SALOME_Prs object, so that it could perform double dispatch
257 void SALOME_View::LocalSelection( const SALOME_Prs* prs, const int mode )
259 prs->LocalSelectionIn( this, mode );
263 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
265 void SALOME_View::Display( const SALOME_OCCPrs* )
267 // MESSAGE( "SALOME_View::Display( const SALOME_OCCPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
271 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
273 void SALOME_View::Display( const SALOME_VTKPrs* )
275 // MESSAGE( "SALOME_View::Display( const SALOME_VTKPrs& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
279 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
281 void SALOME_View::Display( const SALOME_Prs2d* )
283 // MESSAGE( "SALOME_View::Display( const SALOME_Prs2d& ) called! Probably, presentation is being displayed in uncompatible viewframe." );
287 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
289 void SALOME_View::Erase( const SALOME_OCCPrs*, const bool )
291 // MESSAGE( "SALOME_View::Erase( const SALOME_OCCPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." );
295 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
297 void SALOME_View::Erase( const SALOME_VTKPrs*, const bool )
299 // MESSAGE( "SALOME_View::Erase( const SALOME_VTKPrs& ) called! Probably, presentation is being erased in uncompatible viewframe." );
303 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
305 void SALOME_View::Erase( const SALOME_Prs2d*, const bool )
307 // MESSAGE( "SALOME_View::Erase( const SALOME_Prs2d& ) called! Probably, presentation is being erased in uncompatible viewframe." );
311 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
313 void SALOME_View::EraseAll( SALOME_Displayer* d, const bool )
315 // MESSAGE( "SALOME_View::EraseAll() called!" );
316 if ( d ) d->UpdateVisibility( this, 0, false );
320 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
322 void SALOME_View::LocalSelection( const SALOME_OCCPrs*, const int )
324 // MESSAGE( "SALOME_View::LocalSelection( const SALOME_OCCPrs* ) called!
325 // Probably, selection is being activated in uncompatible viewframe." );
329 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
331 void SALOME_View::LocalSelection( const SALOME_VTKPrs*, const int )
333 // MESSAGE( "SALOME_View::LocalSelection( const SALOME_VTKPrs* ) called!
334 // Probably, selection is being activated in uncompatible viewframe." );
338 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
340 void SALOME_View::LocalSelection( const SALOME_Prs2d*, const int )
342 // MESSAGE( "SALOME_View::LocalSelection( const SALOME_Prs2d* ) called!
343 // Probably, selection is being activated in uncompatible viewframe." );
347 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
349 void SALOME_View::GlobalSelection( const bool ) const
351 // MESSAGE( "SALOME_View::GlobalSelection() called!
352 // Probably, selection is being activated in uncompatible viewframe." );
355 void SALOME_View::BeforeDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
357 p->BeforeDisplayIn( d, this );
360 void SALOME_View::AfterDisplay( SALOME_Displayer* d, const SALOME_Prs* p )
362 p->AfterDisplayIn( d, this );
365 void SALOME_View::BeforeErase( SALOME_Displayer* d, const SALOME_Prs* p )
367 p->BeforeEraseIn( d, this );
370 void SALOME_View::AfterErase ( SALOME_Displayer* d, const SALOME_Prs* p )
372 p->AfterEraseIn( d, this );
376 Gives control to SALOME_Prs object, so that it could perform double dispatch
378 void SALOME_Displayer::UpdatePrs( SALOME_Prs* prs )
384 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
386 void SALOME_Displayer::Update( SALOME_OCCPrs* )
388 // MESSAGE( "SALOME_Displayer::Update( SALOME_OCCPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." );
392 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
394 void SALOME_Displayer::Update( SALOME_VTKPrs* )
396 // MESSAGE( "SALOME_Displayer::Update( SALOME_VTKPrs* ) called! Probably, presentation is being updated in uncompatible viewframe." );
400 Virtual method, should be reimplemented in successors, by default issues a warning and does nothing.
402 void SALOME_Displayer::Update( SALOME_Prs2d* )
404 // MESSAGE( "SALOME_Displayer::Update( SALOME_Prs2d* ) called! Probably, presentation is being updated in uncompatible viewframe." );
408 Virtual method, should be reimplemented in successors, by default does nothing.
410 void SALOME_Displayer::UpdateVisibility( SALOME_View*, const SALOME_Prs*, bool )