mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024023: Revamp the OCCT Handle -- downcast (automatic)
Automatic update by command "occt_upgrade . -downcast" C-style cast of Handle to that of derived type (now illegal) is replaced by call to DownCast() Const reference local variables of Handle type initialized by result of DownCast are replaced by normal variables.
This commit is contained in:
@@ -213,7 +213,7 @@ void AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& theListOfI
|
||||
for (TColStd_MapIteratorOfMapOfTransient aDispMapIter (aDispMap); aDispMapIter.More(); aDispMapIter.Next())
|
||||
{
|
||||
const Handle(Standard_Transient)& aTransient = aDispMapIter.Key();
|
||||
anObj = *((Handle(AIS_InteractiveObject)* )&aTransient);
|
||||
anObj = Handle(AIS_InteractiveObject)::DownCast (aTransient);
|
||||
theListOfIO.Append (anObj);
|
||||
}
|
||||
}
|
||||
@@ -2821,15 +2821,13 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
|
||||
{
|
||||
if (theAssembly->IsInstance ("AIS_MultipleConnectedInteractive"))
|
||||
{
|
||||
const Handle(AIS_MultipleConnectedInteractive)& theObj =
|
||||
Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly);
|
||||
Handle(AIS_MultipleConnectedInteractive) theObj (Handle(AIS_MultipleConnectedInteractive)::DownCast (theAssembly));
|
||||
theObj->Disconnect (theObjToDisconnect);
|
||||
mgrSelector->Remove (theObjToDisconnect);
|
||||
}
|
||||
else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect.IsNull())
|
||||
{
|
||||
const Handle(AIS_ConnectedInteractive)& theObj =
|
||||
Handle(AIS_ConnectedInteractive)::DownCast (theAssembly);
|
||||
Handle(AIS_ConnectedInteractive) theObj (Handle(AIS_ConnectedInteractive)::DownCast (theAssembly));
|
||||
theObj->Disconnect();
|
||||
mgrSelector->Remove (theObj);
|
||||
}
|
||||
@@ -2855,8 +2853,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
|
||||
AIS_MapOfObjectOwners anObjectOwnerMap;
|
||||
for (aSelection->Init(); aSelection->More(); aSelection->Next())
|
||||
{
|
||||
const Handle(AIS_InteractiveObject)& anObj =
|
||||
Handle(AIS_InteractiveObject)::DownCast (aSelection->Value());
|
||||
Handle(AIS_InteractiveObject) anObj (Handle(AIS_InteractiveObject)::DownCast (aSelection->Value()));
|
||||
if (!anObj.IsNull())
|
||||
{
|
||||
if (anObj->IsInfinite())
|
||||
@@ -2868,8 +2865,7 @@ void AIS_InteractiveContext::FitSelected (const Handle(V3d_View)& theView,
|
||||
}
|
||||
else
|
||||
{
|
||||
const Handle(SelectMgr_EntityOwner)& anOwner =
|
||||
Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value());
|
||||
Handle(SelectMgr_EntityOwner) anOwner (Handle(SelectMgr_EntityOwner)::DownCast (aSelection->Value()));
|
||||
if (anOwner.IsNull())
|
||||
continue;
|
||||
|
||||
|
Reference in New Issue
Block a user