mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0032207: Draw Harness, ViewerTest - explicitly close 3D Viewer windows at Tcl interpreter closure
This commit is contained in:
parent
114db5a5ce
commit
a604968547
@ -14694,6 +14694,26 @@ static int VSelBvhBuild (Draw_Interpretor& /*theDI*/, Standard_Integer theNbArgs
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ViewerTest_ExitProc
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static void ViewerTest_ExitProc (ClientData )
|
||||
{
|
||||
NCollection_List<TCollection_AsciiString> aViewList;
|
||||
for (NCollection_DoubleMap<TCollection_AsciiString, Handle(V3d_View)>::Iterator anIter (ViewerTest_myViews);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
aViewList.Append (anIter.Key1());
|
||||
}
|
||||
|
||||
for (NCollection_List<TCollection_AsciiString>::Iterator anIter (aViewList);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
ViewerTest::RemoveView (anIter.Value(), true);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ViewerCommands
|
||||
//purpose :
|
||||
@ -14701,6 +14721,15 @@ static int VSelBvhBuild (Draw_Interpretor& /*theDI*/, Standard_Integer theNbArgs
|
||||
|
||||
void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
static bool TheIsInitialized = false;
|
||||
if (TheIsInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TheIsInitialized = true;
|
||||
// define destruction callback to destroy views in a well-defined order
|
||||
Tcl_CreateExitHandler (ViewerTest_ExitProc, 0);
|
||||
|
||||
const char *group = "ZeViewer";
|
||||
theCommands.Add("vinit",
|
||||
|
Loading…
x
Reference in New Issue
Block a user