1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030617: Coding - using reinterpret_cast instead of static_cast for downcast

Several reinterpret_cast have been replaced by static_cast when applicable.
This commit is contained in:
kgv
2020-08-28 15:18:43 +03:00
committed by bugmaster
parent d6c489212b
commit 7d47ebdbcd
5 changed files with 46 additions and 58 deletions

View File

@@ -415,8 +415,7 @@ const gp_Pnt* SelectMgr_SelectingVolumeManager::GetVertices() const
if (myActiveSelectionType == Polyline)
return NULL;
const SelectMgr_RectangularFrustum* aFr =
reinterpret_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
const SelectMgr_RectangularFrustum* aFr = static_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
return aFr->GetVertices();
}
@@ -429,8 +428,7 @@ gp_Pnt SelectMgr_SelectingVolumeManager::GetNearPickedPnt() const
if (myActiveSelectionType == Polyline)
return gp_Pnt();
const SelectMgr_RectangularFrustum* aFr =
reinterpret_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
const SelectMgr_RectangularFrustum* aFr = static_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
return aFr->GetNearPnt();
}
@@ -443,8 +441,7 @@ gp_Pnt SelectMgr_SelectingVolumeManager::GetFarPickedPnt() const
if (myActiveSelectionType == Polyline)
return gp_Pnt();
const SelectMgr_RectangularFrustum* aFr =
reinterpret_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
const SelectMgr_RectangularFrustum* aFr = static_cast<const SelectMgr_RectangularFrustum*> (mySelectingVolumes[myActiveSelectionType / 2].get());
return aFr->GetFarPnt();
}
@@ -462,7 +459,7 @@ void SelectMgr_SelectingVolumeManager::SetViewClipping (const Handle(Graphic3d_S
return;
const SelectMgr_SelectingVolumeManager* aWorldSelMgr = theWorldSelMgr != NULL ? theWorldSelMgr : this;
const SelectMgr_RectangularFrustum* aFrustum = reinterpret_cast<const SelectMgr_RectangularFrustum*>(aWorldSelMgr->mySelectingVolumes[Frustum].get());
const SelectMgr_RectangularFrustum* aFrustum = static_cast<const SelectMgr_RectangularFrustum*>(aWorldSelMgr->mySelectingVolumes[Frustum].get());
myViewClipRange.SetVoid();
if (!theViewPlanes.IsNull()
&& !theViewPlanes->IsEmpty())