0026477: Porting PRODUCTS and OCCT QT samples for OCCT 7.0.0
[occt.git] / src / PrsMgr / PrsMgr_PresentationManager.cxx
CommitLineData
b311480e 1// Copyright (c) 1998-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
679ecdee 15
42cf5bc1 16#include <Geom_Transformation.hxx>
679ecdee 17#include <Graphic3d_GraphicDriver.hxx>
42cf5bc1 18#include <Graphic3d_StructureManager.hxx>
19#include <Prs3d_Presentation.hxx>
679ecdee 20#include <Prs3d_PresentationShadow.hxx>
42cf5bc1 21#include <Prs3d_ShadingAspect.hxx>
22#include <PrsMgr_ModedPresentation.hxx>
7fd59977 23#include <PrsMgr_PresentableObject.hxx>
24#include <PrsMgr_Presentation.hxx>
42cf5bc1 25#include <PrsMgr_PresentationManager.hxx>
7fd59977 26#include <PrsMgr_Presentations.hxx>
42cf5bc1 27#include <Standard_NoSuchObject.hxx>
28#include <Standard_Type.hxx>
7fd59977 29#include <TColStd_ListIteratorOfListOfTransient.hxx>
679ecdee 30#include <V3d_View.hxx>
679ecdee 31#include <Visual3d_Layer.hxx>
42cf5bc1 32#include <Visual3d_View.hxx>
33#include <Visual3d_ViewManager.hxx>
679ecdee 34
35// =======================================================================
36// function : PrsMgr_PresentationManager
37// purpose :
38// =======================================================================
a1954302 39PrsMgr_PresentationManager::PrsMgr_PresentationManager (const Handle(Visual3d_ViewManager)& theStructureManager)
679ecdee 40: myStructureManager (theStructureManager),
a1954302 41 myImmediateModeOn (0),
42 mySelectionColor (Quantity_NOC_GRAY99)
679ecdee 43{
44 //
45}
7fd59977 46
679ecdee 47// =======================================================================
48// function : Display
49// purpose :
50// =======================================================================
51void PrsMgr_PresentationManager::Display (const Handle(PrsMgr_PresentableObject)& thePrsObj,
52 const Standard_Integer theMode)
7fd59977 53{
0717ddc1 54 if (thePrsObj->HasOwnPresentations())
679ecdee 55 {
a1954302 56 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode, Standard_True);
0717ddc1 57 if (aPrs->MustBeUpdated())
58 {
59 Update (thePrsObj, theMode);
60 }
61
62 if (myImmediateModeOn > 0)
63 {
64 AddToImmediateList (aPrs->Presentation());
65 }
66 else
67 {
68 aPrs->Display();
69 }
7fd59977 70 }
7fd59977 71 else
679ecdee 72 {
0717ddc1 73 thePrsObj->Compute (this, Handle(Prs3d_Presentation)(), theMode);
74 }
75
76 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
77 {
78 Display (anIter.Value(), theMode);
679ecdee 79 }
7fd59977 80}
81
679ecdee 82// =======================================================================
83// function : Erase
84// purpose :
85// =======================================================================
86void PrsMgr_PresentationManager::Erase (const Handle(PrsMgr_PresentableObject)& thePrsObj,
87 const Standard_Integer theMode)
7fd59977 88{
0717ddc1 89 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
90 {
91 Erase (anIter.Value(), theMode);
92 }
93
a1954302 94 PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
95 for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
eef7fc64 96 {
a1954302 97 const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
98 const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
99 if (theMode == aPrsList (aPrsIter).Mode()
100 && this == aPrsMgr)
101 {
102 if (!aModedPrs.Presentation().IsNull())
103 {
104 aModedPrs.Presentation()->Erase();
105 }
106 aPrsList.Remove (aPrsIter);
107 return;
108 }
eef7fc64 109 }
7fd59977 110}
111
679ecdee 112// =======================================================================
113// function : Clear
114// purpose :
115// =======================================================================
116void PrsMgr_PresentationManager::Clear (const Handle(PrsMgr_PresentableObject)& thePrsObj,
117 const Standard_Integer theMode)
7fd59977 118{
0717ddc1 119 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
120 {
121 Clear (anIter.Value(), theMode);
122 }
123
a1954302 124 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
125 if (!aPrs.IsNull())
679ecdee 126 {
a1954302 127 aPrs->Clear();
679ecdee 128 }
7fd59977 129}
130
679ecdee 131// =======================================================================
132// function : SetVisibility
133// purpose :
134// =======================================================================
0717ddc1 135void PrsMgr_PresentationManager::SetVisibility (const Handle(PrsMgr_PresentableObject)& thePrsObj,
eb4320f2 136 const Standard_Integer theMode,
137 const Standard_Boolean theValue)
138{
0717ddc1 139 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
140 {
141 SetVisibility (anIter.Value(), theMode, theValue);
142 }
143 if (!thePrsObj->HasOwnPresentations())
144 {
145 return;
146 }
147
148 Presentation (thePrsObj, theMode)->SetVisible (theValue);
eb4320f2 149}
7fd59977 150
679ecdee 151// =======================================================================
152// function : Highlight
153// purpose :
154// =======================================================================
155void PrsMgr_PresentationManager::Highlight (const Handle(PrsMgr_PresentableObject)& thePrsObj,
156 const Standard_Integer theMode)
7fd59977 157{
0717ddc1 158 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
159 {
160 Highlight (anIter.Value(), theMode);
161 }
162 if (!thePrsObj->HasOwnPresentations())
163 {
164 return;
165 }
166
a1954302 167 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode, Standard_True);
679ecdee 168 if (aPrs->MustBeUpdated())
169 {
170 Update (thePrsObj, theMode);
7fd59977 171 }
7fd59977 172
679ecdee 173 if (myImmediateModeOn > 0)
174 {
175 Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs->Presentation());
a1954302 176 aShadow->Highlight (Aspect_TOHM_COLOR, mySelectionColor);
679ecdee 177 AddToImmediateList (aShadow);
178 }
179 else
180 {
a1954302 181 aPrs->Highlight (Aspect_TOHM_COLOR, mySelectionColor);
679ecdee 182 }
7fd59977 183}
184
679ecdee 185// =======================================================================
186// function : Unhighlight
187// purpose :
188// =======================================================================
189void PrsMgr_PresentationManager::Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObj,
190 const Standard_Integer theMode)
7fd59977 191{
0717ddc1 192 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
193 {
194 Unhighlight (anIter.Value(), theMode);
195 }
196
a1954302 197 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
198 if (!aPrs.IsNull())
679ecdee 199 {
a1954302 200 aPrs->Unhighlight();
7fd59977 201 }
202}
203
679ecdee 204// =======================================================================
205// function : SetDisplayPriority
206// purpose :
207// =======================================================================
208void PrsMgr_PresentationManager::SetDisplayPriority (const Handle(PrsMgr_PresentableObject)& thePrsObj,
209 const Standard_Integer theMode,
210 const Standard_Integer theNewPrior) const
211{
0717ddc1 212 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
213 {
214 SetDisplayPriority (anIter.Value(), theMode, theNewPrior);
215 }
216
a1954302 217 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
218 if (!aPrs.IsNull())
679ecdee 219 {
a1954302 220 aPrs->SetDisplayPriority (theNewPrior);
679ecdee 221 }
222}
7fd59977 223
679ecdee 224// =======================================================================
225// function : DisplayPriority
226// purpose :
227// =======================================================================
228Standard_Integer PrsMgr_PresentationManager::DisplayPriority (const Handle(PrsMgr_PresentableObject)& thePrsObj,
229 const Standard_Integer theMode) const
7fd59977 230{
0717ddc1 231 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
232 {
233 Standard_Integer aPriority = DisplayPriority (anIter.Value(), theMode);
234 if (aPriority != 0)
235 {
236 return aPriority;
237 }
238 }
239
a1954302 240 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
241 return !aPrs.IsNull()
242 ? aPrs->DisplayPriority()
243 : 0;
7fd59977 244}
245
679ecdee 246// =======================================================================
247// function : IsDisplayed
248// purpose :
249// =======================================================================
250Standard_Boolean PrsMgr_PresentationManager::IsDisplayed (const Handle(PrsMgr_PresentableObject)& thePrsObj,
251 const Standard_Integer theMode) const
7fd59977 252{
0717ddc1 253 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
254 {
255 if (IsDisplayed (anIter.Value(), theMode))
256 {
257 return Standard_True;
258 }
259 }
260
a1954302 261 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
262 return !aPrs.IsNull()
263 && aPrs->IsDisplayed();
7fd59977 264}
265
679ecdee 266// =======================================================================
267// function : IsHighlighted
268// purpose :
269// =======================================================================
270Standard_Boolean PrsMgr_PresentationManager::IsHighlighted (const Handle(PrsMgr_PresentableObject)& thePrsObj,
271 const Standard_Integer theMode) const
272{
0717ddc1 273 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
274 {
275 if (IsHighlighted (anIter.Value(), theMode))
276 {
277 return Standard_True;
278 }
279 }
280
a1954302 281 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
282 return !aPrs.IsNull()
283 && aPrs->IsHighlighted();
679ecdee 284}
7fd59977 285
679ecdee 286// =======================================================================
287// function : Update
288// purpose :
289// =======================================================================
290void PrsMgr_PresentationManager::Update (const Handle(PrsMgr_PresentableObject)& thePrsObj,
291 const Standard_Integer theMode) const
292{
0717ddc1 293 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
294 {
295 Update (anIter.Value(), theMode);
296 }
7fd59977 297
679ecdee 298 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
299 if (!aPrs.IsNull())
300 {
301 aPrs->Clear();
302 thePrsObj->Fill (this, aPrs, theMode);
303 aPrs->SetUpdateStatus (Standard_False);
304 }
305}
7fd59977 306
679ecdee 307// =======================================================================
308// function : BeginImmediateDraw
309// purpose :
310// =======================================================================
311void PrsMgr_PresentationManager::BeginImmediateDraw()
312{
313 if (++myImmediateModeOn > 1)
314 {
315 return;
7fd59977 316 }
679ecdee 317
318 ClearImmediateDraw();
7fd59977 319}
679ecdee 320
321// =======================================================================
322// function : ClearImmediateDraw
323// purpose :
324// =======================================================================
325void PrsMgr_PresentationManager::ClearImmediateDraw()
326{
327 if (myImmediateView.IsNull())
328 {
329 myImmediateList.Clear();
330 return;
331 }
332
333 for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
334 {
335 myImmediateView->View()->EraseImmediate (anIter.Value());
336 }
337
7fd59977 338 myImmediateList.Clear();
679ecdee 339 myImmediateView.Nullify();
7fd59977 340}
341
679ecdee 342// =======================================================================
343// function : EndImmediateDraw
344// purpose :
345// =======================================================================
346void PrsMgr_PresentationManager::EndImmediateDraw (const Handle(V3d_View)& theView)
347{
348 if (--myImmediateModeOn > 0)
349 {
350 return;
351 }
352
353 for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
354 {
355 theView->View()->DisplayImmediate (anIter.Value(), Standard_True);
356 }
357 if (!myImmediateList.IsEmpty())
358 {
359 myImmediateView = theView;
360 }
361}
7fd59977 362
679ecdee 363// =======================================================================
364// function : AddToImmediateList
365// purpose :
366//=======================================================================
367void PrsMgr_PresentationManager::AddToImmediateList (const Handle(Prs3d_Presentation)& thePrs)
368{
369 if (myImmediateModeOn < 1)
370 {
371 return;
372 }
373
374 for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
375 {
376 if (anIter.Value() == thePrs)
377 {
378 return;
7fd59977 379 }
679ecdee 380 }
381
382 myImmediateList.Append (thePrs);
383}
384
385// =======================================================================
386// function : HasPresentation
387// purpose :
388// =======================================================================
389Standard_Boolean PrsMgr_PresentationManager::HasPresentation (const Handle(PrsMgr_PresentableObject)& thePrsObj,
390 const Standard_Integer theMode) const
391{
0717ddc1 392 if (!thePrsObj->HasOwnPresentations())
393 return Standard_False;
394
679ecdee 395 const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
396 for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
397 {
398 const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
399 const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
400 if (theMode == aModedPrs.Mode()
401 && this == aPrsMgr)
402 {
403 return Standard_True;
7fd59977 404 }
405 }
679ecdee 406 return Standard_False;
7fd59977 407}
408
679ecdee 409// =======================================================================
410// function : Presentation
411// purpose :
412// =======================================================================
413Handle(PrsMgr_Presentation) PrsMgr_PresentationManager::Presentation (const Handle(PrsMgr_PresentableObject)& thePrsObj,
a1954302 414 const Standard_Integer theMode,
a272ed94 415 const Standard_Boolean theToCreate,
416 const Handle(PrsMgr_PresentableObject)& theSelObj) const
679ecdee 417{
418 const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
679ecdee 419 for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
420 {
421 const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
422 const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
423 if (theMode == aModedPrs.Mode()
424 && this == aPrsMgr)
425 {
426 return aModedPrs.Presentation();
427 }
428 }
7fd59977 429
a1954302 430 if (!theToCreate)
431 {
432 return Handle(PrsMgr_Presentation)();
433 }
7fd59977 434
af324faa 435 Handle(PrsMgr_Presentation) aPrs = new PrsMgr_Presentation (this, thePrsObj);
a1954302 436 aPrs->SetZLayer (thePrsObj->ZLayer());
a272ed94 437 aPrs->Presentation()->CStructure()->ViewAffinity = myStructureManager->ObjectAffinity (!theSelObj.IsNull() ? theSelObj : thePrsObj);
679ecdee 438 thePrsObj->Presentations().Append (PrsMgr_ModedPresentation (aPrs, theMode));
439 thePrsObj->Fill (this, aPrs, theMode);
7fd59977 440
679ecdee 441 // set layer index accordingly to object's presentations
679ecdee 442 aPrs->SetUpdateStatus (Standard_False);
a1954302 443 return aPrs;
679ecdee 444}
7fd59977 445
679ecdee 446// =======================================================================
447// function : RemovePresentation
448// purpose :
449// =======================================================================
a1954302 450Standard_Boolean PrsMgr_PresentationManager::RemovePresentation (const Handle(PrsMgr_PresentableObject)& thePrsObj,
451 const Standard_Integer theMode)
7fd59977 452{
679ecdee 453 PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
454 for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
455 {
a1954302 456 const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
457 const Handle(PrsMgr_PresentationManager)& aPrsMgr = aModedPrs.Presentation()->PresentationManager();
458 if (theMode == aPrsList (aPrsIter).Mode()
459 && this == aPrsMgr)
679ecdee 460 {
461 aPrsList.Remove (aPrsIter);
a1954302 462 return Standard_True;
679ecdee 463 }
464 }
a1954302 465 return Standard_False;
679ecdee 466}
7fd59977 467
679ecdee 468// =======================================================================
469// function : SetZLayer
470// purpose :
471// =======================================================================
472void PrsMgr_PresentationManager::SetZLayer (const Handle(PrsMgr_PresentableObject)& thePrsObj,
473 const Standard_Integer theLayerId)
474{
0717ddc1 475 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
476 {
477 SetZLayer (anIter.Value(), theLayerId);
478 }
479 if (!thePrsObj->HasOwnPresentations())
480 {
481 return;
482 }
a1954302 483
484 thePrsObj->SetZLayer (theLayerId);
679ecdee 485}
7fd59977 486
679ecdee 487// =======================================================================
488// function : GetZLayer
489// purpose :
490// =======================================================================
491Standard_Integer PrsMgr_PresentationManager::GetZLayer (const Handle(PrsMgr_PresentableObject)& thePrsObj) const
492{
a1954302 493 return thePrsObj->ZLayer();
679ecdee 494}
7fd59977 495
679ecdee 496// =======================================================================
497// function : Connect
498// purpose :
499// =======================================================================
500void PrsMgr_PresentationManager::Connect (const Handle(PrsMgr_PresentableObject)& thePrsObject,
501 const Handle(PrsMgr_PresentableObject)& theOtherObject,
502 const Standard_Integer theMode,
503 const Standard_Integer theOtherMode)
504{
a1954302 505 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObject, theMode, Standard_True);
506 Handle(PrsMgr_Presentation) aPrsOther = Presentation (theOtherObject, theOtherMode, Standard_True);
507 aPrs->Connect (aPrsOther);
7fd59977 508}
509
679ecdee 510// =======================================================================
511// function : Transform
512// purpose :
513// =======================================================================
514void PrsMgr_PresentationManager::Transform (const Handle(PrsMgr_PresentableObject)& thePrsObj,
515 const Handle(Geom_Transformation)& theTransformation,
516 const Standard_Integer theMode)
517{
af324faa 518 Presentation (thePrsObj, theMode)->Transform (theTransformation);
679ecdee 519}
7fd59977 520
7fd59977 521
679ecdee 522// =======================================================================
523// function : Color
524// purpose :
525// =======================================================================
526void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)& thePrsObj,
527 const Quantity_NameOfColor theColor,
a272ed94 528 const Standard_Integer theMode,
529 const Handle(PrsMgr_PresentableObject)& theSelObj)
7fd59977 530{
0717ddc1 531 for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
532 {
533 Color (anIter.Value(), theColor, theMode);
534 }
535 if (!thePrsObj->HasOwnPresentations())
536 {
537 return;
538 }
539
a272ed94 540 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode, Standard_True, theSelObj);
679ecdee 541 if (aPrs->MustBeUpdated())
542 {
543 Update (thePrsObj, theMode);
544 }
59f45b7c 545
679ecdee 546 if (myImmediateModeOn > 0)
547 {
548 Handle(Prs3d_PresentationShadow) aShadow = new Prs3d_PresentationShadow (myStructureManager, aPrs->Presentation());
a1954302 549 aShadow->Highlight (Aspect_TOHM_COLOR, theColor);
679ecdee 550 AddToImmediateList (aShadow);
551 }
552 else
553 {
a1954302 554 aPrs->Highlight (Aspect_TOHM_COLOR, theColor);
679ecdee 555 }
556}
557
558// =======================================================================
559// function : BoundBox
560// purpose :
561// =======================================================================
a1954302 562void PrsMgr_PresentationManager::BoundBox (const Handle(PrsMgr_PresentableObject)& thePrsObj,
679ecdee 563 const Standard_Integer theMode)
59f45b7c 564{
a1954302 565 Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode, Standard_True);
566 if (aPrs->MustBeUpdated())
679ecdee 567 {
a1954302 568 Update (thePrsObj, theMode);
59f45b7c 569 }
a1954302 570 aPrs->Highlight (Aspect_TOHM_BOUNDBOX, mySelectionColor);
59f45b7c 571}
572
679ecdee 573// =======================================================================
574// function : SetShadingAspect
575// purpose :
576// =======================================================================
577void PrsMgr_PresentationManager::SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObject,
578 const Quantity_NameOfColor theColor,
579 const Graphic3d_NameOfMaterial theMaterial,
580 const Standard_Integer theMode)
581{
582 Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
583 anAspect->SetColor (theColor);
584 anAspect->SetMaterial (theMaterial);
585 SetShadingAspect (thePrsObject, anAspect, theMode);
586}
59f45b7c 587
679ecdee 588// =======================================================================
589// function : SetShadingAspect
590// purpose :
591// =======================================================================
a1954302 592void PrsMgr_PresentationManager::SetShadingAspect (const Handle(PrsMgr_PresentableObject)& thePrsObj,
679ecdee 593 const Handle(Prs3d_ShadingAspect)& theShadingAspect,
594 const Standard_Integer theMode)
59f45b7c 595{
a1954302 596 const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
597 if (!aPrs.IsNull())
59f45b7c 598 {
a1954302 599 aPrs->SetShadingAspect (theShadingAspect);
59f45b7c 600 }
679ecdee 601}