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

0029740: Draw Harness - eliminate redundant casts to AIS_InteractiveObject

NCollecton_DoubleMap has been extended with two new methods Find1() and Find2()
performing lookup and returning found key withoout throwing an exception
(similar to NCollection_DataMap::Find()).

ViewerTest_DoubleMapOfInteractiveAndName has been redeclared to define
Handle(AIS_InteractiveObject) key instead of Handle(Standard_Transient).
This commit is contained in:
kgv
2018-07-23 21:12:13 +03:00
committed by bugmaster
parent a6df1715ed
commit 8f521168b4
21 changed files with 289 additions and 761 deletions

View File

@@ -231,11 +231,10 @@ static int tinspector (Draw_Interpretor& di, Standard_Integer theArgsNb, const c
anItemNamesToSelect.Append (TInspectorAPI_PluginParameters::ParametersToString (aShape));
}
// search prsentations with given name
if (GetMapOfAIS().IsBound2 (theArgs[anIt]))
Handle(AIS_InteractiveObject) anIO;
GetMapOfAIS().Find2 (theArgs[anIt], anIO);
if (!anIO.IsNull())
{
Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast
(GetMapOfAIS().Find2 (theArgs[anIt]));
if (!anIO.IsNull())
anObjectsToSelect.Append (anIO);
}
// give parameters as a container of names