mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0026377: Passing Handle objects as arguments to functions as non-const reference to base type is dangerous
Operator of cast to non-const reference is declared deprecated to produce compiler warning if used (usually implicitly). OCCT code is updated to avoid that cast, occurring when function accepting non-const reference to handle is called with handle to derived type. For that, local variable of argument type is passed instead, and down-cast is used to get it to desired type after the call. A few occurrences of use of uninitialized variable are corrected.
This commit is contained in:
@@ -352,12 +352,13 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
|
||||
if (aPrs.IsNull())
|
||||
continue;
|
||||
|
||||
Handle(Prs3d_Presentation) aViewDepPrs;
|
||||
Handle(Graphic3d_Structure) aViewDepPrs;
|
||||
Handle(Prs3d_PresentationShadow) aShadowPrs = Handle(Prs3d_PresentationShadow)::DownCast (aPrs);
|
||||
if (!aShadowPrs.IsNull() && aView->IsComputed (aShadowPrs->ParentId(), aViewDepPrs))
|
||||
{
|
||||
aShadowPrs.Nullify();
|
||||
aShadowPrs = new Prs3d_PresentationShadow (myStructureManager, aViewDepPrs);
|
||||
aShadowPrs = new Prs3d_PresentationShadow (myStructureManager,
|
||||
Handle(Prs3d_Presentation)::DownCast (aViewDepPrs));
|
||||
aShadowPrs->SetZLayer (aViewDepPrs->CStructure()->ZLayer());
|
||||
aShadowPrs->SetClipPlanes (aViewDepPrs->GetClipPlanes());
|
||||
aShadowPrs->CStructure()->IsForHighlight = 1;
|
||||
|
Reference in New Issue
Block a user