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

0032144: Draw Harness - add -silent option to command Close

- Extended command Close with an option -silent
- Extended command Close to handle */-ALL for closing ALL document
- Replaced catch {Close D} by Close D -silent in tests
This commit is contained in:
mkrylova 2021-03-02 17:22:07 +03:00 committed by bugmaster
parent d6e050ac44
commit 395d00e058
34 changed files with 152 additions and 106 deletions

@ -326,46 +326,84 @@ static Standard_Integer DDocStd_Close (Draw_Interpretor& theDI,
Standard_Integer theArgNb, Standard_Integer theArgNb,
const char** theArgVec) const char** theArgVec)
{ {
if (theArgNb != 2) bool toComplain = true;
NCollection_List<TCollection_AsciiString> aDocNames;
for (Standard_Integer anArgIt = 1; anArgIt < theArgNb; ++anArgIt)
{ {
theDI << "DDocStd_Close : Error\n"; const TCollection_AsciiString anArg (theArgVec[anArgIt]);
return 1; TCollection_AsciiString anArgCase (anArg);
anArgCase.LowerCase();
if (anArgCase == "*"
|| anArgCase == "-all"
|| anArgCase == "all")
{
for (NCollection_Map<Handle(Draw_Drawable3D)>::Iterator anIter (Draw::Drawables());
anIter.More(); anIter.Next())
{
if (Handle(DDocStd_DrawDocument) aDrawDocument = Handle(DDocStd_DrawDocument)::DownCast (anIter.Value()))
{
aDocNames.Append (aDrawDocument->Name());
}
}
if (aDocNames.IsEmpty())
{
return 0;
}
}
else if (anArgCase == "-silent")
{
toComplain = false;
}
else
{
aDocNames.Append (anArg);
}
} }
Handle(TDocStd_Document) aDoc; if (aDocNames.IsEmpty())
Standard_CString aDocName = theArgVec[1];
if (!DDocStd::GetDocument (aDocName, aDoc))
{ {
theDI << "Syntax error: wrong number of arguments";
return 1; return 1;
} }
TDF_Label aRoot = aDoc->GetData()->Root();
Handle(TPrsStd_AISViewer) aDocViewer;
if (TPrsStd_AISViewer::Find (aRoot, aDocViewer)
&& !aDocViewer->GetInteractiveContext().IsNull())
{
Handle(V3d_Viewer) aViewer = aDocViewer->GetInteractiveContext()->CurrentViewer();
V3d_ListOfView aViews;
for (V3d_ListOfViewIterator aViewIter (aDocViewer->GetInteractiveContext()->CurrentViewer()->DefinedViewIterator()); aViewIter.More(); aViewIter.Next())
{
aViews.Append (aViewIter.Value());
}
for (V3d_ListOfViewIterator aViewIter (aViews); aViewIter.More(); aViewIter.Next())
{
Handle(V3d_View) aView = aViewIter.Value();
ViewerTest::RemoveView (aView);
}
}
Handle(TDocStd_Application) aDocApp = DDocStd::GetApplication(); Handle(TDocStd_Application) aDocApp = DDocStd::GetApplication();
for (NCollection_List<TCollection_AsciiString>::Iterator aDocNameIter (aDocNames);
aDocApp->Close (aDoc); aDocNameIter.More(); aDocNameIter.Next())
if (Handle(Draw_Drawable3D) aDrawable = Draw::GetExisting (aDocName))
{ {
dout.RemoveDrawable (aDrawable); Standard_CString aDocName = aDocNameIter.Value().ToCString();
Handle(TDocStd_Document) aDoc;
if (DDocStd::GetDocument (aDocName, aDoc, toComplain))
{
TDF_Label aRoot = aDoc->GetData()->Root();
Handle(TPrsStd_AISViewer) aDocViewer;
if (TPrsStd_AISViewer::Find (aRoot, aDocViewer)
&& !aDocViewer->GetInteractiveContext().IsNull())
{
Handle(V3d_Viewer) aViewer = aDocViewer->GetInteractiveContext()->CurrentViewer();
V3d_ListOfView aViews;
for (V3d_ListOfViewIterator aViewIter (aDocViewer->GetInteractiveContext()->CurrentViewer()->DefinedViewIterator()); aViewIter.More(); aViewIter.Next())
{
aViews.Append (aViewIter.Value());
}
for (V3d_ListOfViewIterator aViewIter (aViews); aViewIter.More(); aViewIter.Next())
{
Handle(V3d_View) aView = aViewIter.Value();
ViewerTest::RemoveView (aView);
}
}
aDocApp->Close (aDoc);
}
else if (toComplain)
{
return 1;
}
if (Handle(Draw_Drawable3D) aDrawable = Draw::GetExisting (aDocName))
{
dout.RemoveDrawable (aDrawable);
}
Draw::Set (aDocName, Handle(Draw_Drawable3D)());
} }
Draw::Set (theArgVec[1], Handle(Draw_Drawable3D)());
return 0; return 0;
} }
@ -553,7 +591,12 @@ void DDocStd::ApplicationCommands(Draw_Interpretor& theCommands)
__FILE__, DDocStd_Save, g); __FILE__, DDocStd_Save, g);
theCommands.Add("Close", theCommands.Add("Close",
"Close DOC", "Close the specific document or all documents\n"
"Close DOC [-silent]"
"\n\t\t: Close the specific document."
"\n\t\t: -silent not raise an exception or print error message for an empty document \n"
"Close *"
"\n\t\t: Close all open documents.",
__FILE__, DDocStd_Close, g); __FILE__, DDocStd_Close, g);
theCommands.Add("IsInSession", theCommands.Add("IsInSession",

@ -18,6 +18,7 @@
#define _Draw_HeaderFile #define _Draw_HeaderFile
#include <Draw_Interpretor.hxx> #include <Draw_Interpretor.hxx>
#include <NCollection_Map.hxx>
#include <Quantity_ColorRGBA.hxx> #include <Quantity_ColorRGBA.hxx>
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
@ -78,6 +79,9 @@ public: //! @name Tcl variables management tools
//! Sets a TCL string variable //! Sets a TCL string variable
Standard_EXPORT static void Set (const Standard_CString Name, const Standard_CString val); Standard_EXPORT static void Set (const Standard_CString Name, const Standard_CString val);
//! Returns a map of Draw_Drawable3D variables.
Standard_EXPORT static const NCollection_Map<Handle(Draw_Drawable3D)>& Drawables();
public: //! @name argument parsing tools public: //! @name argument parsing tools
//! Converts numeric expression, that can involve DRAW //! Converts numeric expression, that can involve DRAW

@ -42,28 +42,29 @@ extern Draw_Viewer dout;
#include <OSD_Environment.hxx> #include <OSD_Environment.hxx>
#include <OSD_OpenFile.hxx> #include <OSD_OpenFile.hxx>
Standard_Boolean Draw_ParseFailed; Standard_Boolean Draw_ParseFailed = Standard_True;
static Standard_Boolean autodisp = Standard_True; static Standard_Boolean autodisp = Standard_True;
static Standard_Boolean repaint2d,repaint3d; static Standard_Boolean repaint2d = Standard_False, repaint3d = Standard_False;
//=============================================== //! Returns dictionary of variables
// dictionary of variables //! Variables are stored in a map Integer, Transient.
// Variables are stored in a map Integer, Transient //! The Integer Value is the content of the Tcl variable.
// The Integer Value is the content of the TCl variable static NCollection_Map<Handle(Draw_Drawable3D)>& Draw_changeDrawables()
//=============================================== {
static NCollection_Map<Handle(Draw_Drawable3D)> theVariables;
static NCollection_Map<Handle(Draw_Drawable3D)> theVariables; return theVariables;
}
//======================================================================= //=======================================================================
//function : FindVariable //function : FindVariable
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer p_id; static Standard_Integer p_id = 0;
static Standard_Integer p_X; static Standard_Integer p_X = 0;
static Standard_Integer p_Y; static Standard_Integer p_Y = 0;
static Standard_Integer p_b; static Standard_Integer p_b = 0;
static const char* p_Name = ""; static const char* p_Name = "";
//======================================================================= //=======================================================================
@ -234,15 +235,18 @@ static Standard_Integer erase(Draw_Interpretor& di, Standard_Integer n, const ch
} }
} }
} }
// sauvegarde des proteges visibles // sauvegarde des proteges visibles
Draw_SequenceOfDrawable3D prot; Draw_SequenceOfDrawable3D prot;
NCollection_Map<Handle(Draw_Drawable3D)>::Iterator aMapIt (theVariables); for (NCollection_Map<Handle(Draw_Drawable3D)>::Iterator aMapIt (Draw::Drawables()); aMapIt.More(); aMapIt.Next())
for (; aMapIt.More(); aMapIt.Next()) { {
const Handle(Draw_Drawable3D)& D = aMapIt.Key(); const Handle(Draw_Drawable3D)& D = aMapIt.Key();
if (!D.IsNull()) { if (!D.IsNull())
if (D->Protected() && D->Visible()) {
prot.Append(D); if (D->Protected() && D->Visible())
{
prot.Append(D);
}
} }
} }
@ -654,7 +658,10 @@ void Draw::Set(const Standard_CString name,
static char* tracevar(ClientData CD, Tcl_Interp*,const char* name,const char*, int) static char* tracevar(ClientData CD, Tcl_Interp*,const char* name,const char*, int)
{ {
// protect if the map was destroyed before the interpretor // protect if the map was destroyed before the interpretor
if (theVariables.IsEmpty()) return NULL; if (Draw::Drawables().IsEmpty())
{
return NULL;
}
Draw_Interpretor& aCommands = Draw::GetInterpretor(); Draw_Interpretor& aCommands = Draw::GetInterpretor();
@ -678,7 +685,7 @@ static char* tracevar(ClientData CD, Tcl_Interp*,const char* name,const char*, i
} }
Tcl_UntraceVar(aCommands.Interp(),name,TCL_TRACE_UNSETS | TCL_TRACE_WRITES, Tcl_UntraceVar(aCommands.Interp(),name,TCL_TRACE_UNSETS | TCL_TRACE_WRITES,
tracevar,CD); tracevar,CD);
theVariables.Remove(D); Draw_changeDrawables().Remove(D);
return NULL; return NULL;
} }
} }
@ -706,7 +713,7 @@ void Draw::Set(const Standard_CString name,
tracevar, NULL); tracevar, NULL);
Handle(Draw_Drawable3D) anOldD(reinterpret_cast<Draw_Drawable3D*>(aCD)); Handle(Draw_Drawable3D) anOldD(reinterpret_cast<Draw_Drawable3D*>(aCD));
if (!anOldD.IsNull()) { if (!anOldD.IsNull()) {
if (theVariables.Contains(anOldD) && anOldD->Protected()) { if (Draw::Drawables().Contains(anOldD) && anOldD->Protected()) {
std::cout << "variable is protected" << std::endl; std::cout << "variable is protected" << std::endl;
return; return;
} }
@ -716,7 +723,7 @@ void Draw::Set(const Standard_CString name,
Tcl_UnsetVar(aCommands.Interp(),name,0); Tcl_UnsetVar(aCommands.Interp(),name,0);
if (!D.IsNull()) { if (!D.IsNull()) {
theVariables.Add(D); Draw_changeDrawables().Add(D);
D->Name(Tcl_SetVar(aCommands.Interp(),name,name,0)); D->Name(Tcl_SetVar(aCommands.Interp(),name,name,0));
// set the trace function // set the trace function
@ -760,7 +767,7 @@ Handle(Draw_Drawable3D) Draw::getDrawable (Standard_CString& theName,
{ {
ClientData aCD = Tcl_VarTraceInfo (Draw::GetInterpretor().Interp(), theName, TCL_TRACE_UNSETS | TCL_TRACE_WRITES, tracevar, NULL); ClientData aCD = Tcl_VarTraceInfo (Draw::GetInterpretor().Interp(), theName, TCL_TRACE_UNSETS | TCL_TRACE_WRITES, tracevar, NULL);
Handle(Draw_Drawable3D) aDrawable = reinterpret_cast<Draw_Drawable3D*>(aCD); Handle(Draw_Drawable3D) aDrawable = reinterpret_cast<Draw_Drawable3D*>(aCD);
return theVariables.Contains (aDrawable) return Draw::Drawables().Contains (aDrawable)
? aDrawable ? aDrawable
: Handle(Draw_Drawable3D)(); : Handle(Draw_Drawable3D)();
} }
@ -1120,6 +1127,16 @@ void Draw::Set(const Standard_CString Name, const Standard_CString val)
// //
Tcl_SetVar(Draw::GetInterpretor().Interp(), pName, pVal, 0); Tcl_SetVar(Draw::GetInterpretor().Interp(), pName, pVal, 0);
} }
//=======================================================================
//function : Drawables
//purpose :
//=======================================================================
const NCollection_Map<Handle(Draw_Drawable3D)>& Draw::Drawables()
{
return Draw_changeDrawables();
}
//======================================================================= //=======================================================================
// Command management // Command management
// refresh the screen // refresh the screen

@ -22,7 +22,7 @@ puts ""
#set aTestName "OCC2269" #set aTestName "OCC2269"
#set WorkDirectory ${filedir} #set WorkDirectory ${filedir}
#set aFile $WorkDirectory/${aTestName}.${FileSuffix} #set aFile $WorkDirectory/${aTestName}.${FileSuffix}
#catch {Close D} #Close D -silent
set IsGood 1 set IsGood 1
Open [locate_data_file OCC2269.xml] DD Open [locate_data_file OCC2269.xml] DD

@ -12,7 +12,7 @@ puts "REQUIRED ALL: Cannot retrieve real member for RealArray attribute"
set BugNumber OCC29452 set BugNumber OCC29452
set file [locate_data_file bug29452.xml] set file [locate_data_file bug29452.xml]
catch {Close D} Close D -silent
set res [Open $file D] set res [Open $file D]
set real [GetReal D 0:1] set real [GetReal D 0:1]

@ -4,8 +4,7 @@ puts "============"
pload MODELING VISUALIZATION OCAF XDE pload MODELING VISUALIZATION OCAF XDE
catch { Close D } Close D D_Cope -silent
catch { Close D_Cope }
# create original # create original
box b 0 -20 -10 100 40 20 box b 0 -20 -10 100 40 20

@ -38,9 +38,7 @@ proc fileCreateAndCompare { thePathFrom theUtfPathTo theCpPathTo theNameFrom the
if { [GetName U 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read UTF-8 STEP" } if { [GetName U 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read UTF-8 STEP" }
if { [GetName ISO 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read $theCodePage STEP" } if { [GetName ISO 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read $theCodePage STEP" }
if { [GetName A 0:1:1:1] == "$theNameTo" } { puts "Error: broken test case" } if { [GetName A 0:1:1:1] == "$theNameTo" } { puts "Error: broken test case" }
catch { Close A } Close A U ISO -silent
catch { Close U }
catch { Close ISO }
} }
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
@ -73,10 +71,7 @@ set iso8859_8 [encoding convertfrom utf-8 "\xc2\xb1\xd7\xa4\xd7\x9e\xd7\x9c\xd7\
set iso8859_9 [encoding convertfrom utf-8 "\xc4\x9f\xc5\x9f\xc4\x9e\xc5\x9e\xc3\x86"] set iso8859_9 [encoding convertfrom utf-8 "\xc4\x9f\xc5\x9f\xc4\x9e\xc5\x9e\xc3\x86"]
box b 1 2 3 box b 1 2 3
catch { Close A } Close A T U CP -silent
catch { Close T }
catch { Close U }
catch { Close CP }
XNewDoc T XNewDoc T
XAddShape T b 0 XAddShape T b 0

@ -5,7 +5,7 @@ puts "================"
puts "" puts ""
pload OCAF pload OCAF
catch {Close D} Close D -silent
# Read File # Read File
ReadStep D [locate_data_file bug28454_directives.stp] ReadStep D [locate_data_file bug28454_directives.stp]

@ -31,10 +31,7 @@ set aTmpFileGb "${imagedir}/${casename}-tmp-gb.stp"
# 国标 # 国标
set aName [encoding convertfrom unicode "\xFD\x56\x07\x68"] set aName [encoding convertfrom unicode "\xFD\x56\x07\x68"]
box b 1 2 3 box b 1 2 3
catch { Close A } Close A T U G -silent
catch { Close T }
catch { Close U }
catch { Close G }
XNewDoc T XNewDoc T
XAddShape T b 0 XAddShape T b 0
XSetColor T b 1 0 0 XSetColor T b 1 0 0

@ -4,7 +4,7 @@ puts "# ====================================================================="
puts "" puts ""
pload OCAF pload OCAF
catch { Close D } Close D -silent
# Read file # Read file
ReadStep D [locate_data_file bug31000_InSensitive.stp] ReadStep D [locate_data_file bug31000_InSensitive.stp]

@ -38,9 +38,7 @@ proc fileCreateAndCompare { thePathFrom theUtfPathTo theCpPathTo theNameFrom the
if { [GetName U 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read UTF-8 STEP" } if { [GetName U 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read UTF-8 STEP" }
if { [GetName CP 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read $theCodePage STEP" } if { [GetName CP 0:1:1:1] != "$theNameTo" } { puts "Error: unable to read $theCodePage STEP" }
if { [GetName A 0:1:1:1] == "$theNameTo" } { puts "Error: broken test case" } if { [GetName A 0:1:1:1] == "$theNameTo" } { puts "Error: broken test case" }
catch { Close A } Close A U CP -silent
catch { Close U }
catch { Close CP }
} }
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
@ -73,10 +71,7 @@ set aBaltName [encoding convertfrom utf-8 "\x50\xc4\x81\x72\x62\x61\x75\x64\x65"
set aViettName [encoding convertfrom utf-8 "\u0054\u0068\u00ed \u006e\u0067\u0068\u0069\u1ec7\u006d"] set aViettName [encoding convertfrom utf-8 "\u0054\u0068\u00ed \u006e\u0067\u0068\u0069\u1ec7\u006d"]
box b 1 2 3 box b 1 2 3
catch { Close A } Close A T U CP -silent
catch { Close T }
catch { Close U }
catch { Close CP }
XNewDoc T XNewDoc T
XAddShape T b 0 XAddShape T b 0

@ -5,8 +5,7 @@ puts ""
pload OCAF pload OCAF
param write.step.schema AP242DIS param write.step.schema AP242DIS
catch { Close D_First } Close D_First D_Sec -silent
catch { Close D_Sec }
# Read file # Read file
set Path ${imagedir}/${casename}.stp set Path ${imagedir}/${casename}.stp

@ -31,10 +31,7 @@ set aTmpFileCP850 "${imagedir}/${casename}-tmp-cp850.stp"
# Überprüfung de codificação # Überprüfung de codificação
set aName [encoding convertfrom utf-8 "\xc3\x9c\x62\x65\x72\x70\x72\xc3\xbc\x66\x75\x6e\x67 \x64\x65 \x63\x6f\x64\x69\x66\x69\x63\x61\xc3\xa7\xc3\xa3\x6f"] set aName [encoding convertfrom utf-8 "\xc3\x9c\x62\x65\x72\x70\x72\xc3\xbc\x66\x75\x6e\x67 \x64\x65 \x63\x6f\x64\x69\x66\x69\x63\x61\xc3\xa7\xc3\xa3\x6f"]
catch { Close A } Close A T U C -silent
catch { Close T }
catch { Close U }
catch { Close C }
box b 1 2 3 box b 1 2 3
XNewDoc T XNewDoc T

@ -3,7 +3,7 @@ puts "0032049: Data Exchange - STEP file import problems"
puts "========================" puts "========================"
pload OCAF pload OCAF
catch { Close D } Close D -silent
# Read file # Read file
ReadStep D [locate_data_file bug32049_sp7_04dx_242.stp] ReadStep D [locate_data_file bug32049_sp7_04dx_242.stp]

@ -4,7 +4,7 @@ puts "============"
puts "" puts ""
pload XDE OCAF VISUALIZATION pload XDE OCAF VISUALIZATION
catch { Close D } Close D -silent
ReadStep D [locate_data_file bug25381_test_assembly_invisible.step] ReadStep D [locate_data_file bug25381_test_assembly_invisible.step]
XShow D XShow D
vaxo vaxo

@ -4,7 +4,7 @@ puts "=========="
puts "" puts ""
pload QAcommands VISUALIZATION DCAF pload QAcommands VISUALIZATION DCAF
catch { Close doc } Close Doc -silent
OCC28887 [locate_data_file bug23384-doc_subshapes.xbf] doc OCC28887 [locate_data_file bug23384-doc_subshapes.xbf] doc
vclear vclear

@ -59,7 +59,7 @@ proc checkarray {name array expected} {
pload TOPTEST pload TOPTEST
catch {Close D} Close D -silent
# Normal test execution # Normal test execution
if !$Create_Doc { if !$Create_Doc {

@ -1,4 +1,4 @@
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
# PBR requires OpenGL 3.0+ on macOS # PBR requires OpenGL 3.0+ on macOS
if { $::tcl_platform(os) == "Darwin" } { vcaps -core } if { $::tcl_platform(os) == "Darwin" } { vcaps -core }

@ -1,4 +1,4 @@
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
# PBR requires OpenGL 3.0+ on macOS # PBR requires OpenGL 3.0+ on macOS
if { $::tcl_platform(os) == "Darwin" } { vcaps -core } if { $::tcl_platform(os) == "Darwin" } { vcaps -core }

@ -3,7 +3,7 @@ puts "0030953: Data Exchange - implement export of mesh data into glTF 2.0 forma
puts "Test case exporting glTF model into glTF file." puts "Test case exporting glTF model into glTF file."
puts "========" puts "========"
catch { Close D1 } Close D1 -silent
ReadGltf D1 [locate_data_file bug30691_DamagedHelmet.gltf] ReadGltf D1 [locate_data_file bug30691_DamagedHelmet.gltf]
set aTmpGltfBase "${imagedir}/${casename}_tmp" set aTmpGltfBase "${imagedir}/${casename}_tmp"

@ -3,7 +3,7 @@ puts "0031703: Data Exchange, RWGltf_CafWriter - add option putting textures ins
puts "Test case exporting glTF model into GLB file." puts "Test case exporting glTF model into GLB file."
puts "========" puts "========"
catch { Close D1 } Close D1 -silent
ReadGltf D1 [locate_data_file bug30691_DamagedHelmet.gltf] ReadGltf D1 [locate_data_file bug30691_DamagedHelmet.gltf]
set aTmpGltfBase "${imagedir}/${casename}_tmp" set aTmpGltfBase "${imagedir}/${casename}_tmp"

@ -2,7 +2,7 @@ puts "========"
puts "0031816: Data Exchange - RWMesh_MaterialMap::CopyTexture() copies glb file instead of a texture inside it" puts "0031816: Data Exchange - RWMesh_MaterialMap::CopyTexture() copies glb file instead of a texture inside it"
puts "========" puts "========"
catch { Close D1 } Close D1 -silent
ReadGltf D1 [locate_data_file bug30691_Lantern.glb] ReadGltf D1 [locate_data_file bug30691_Lantern.glb]
set aTmpGltfBase "${imagedir}/${casename}_tmp" set aTmpGltfBase "${imagedir}/${casename}_tmp"

@ -3,7 +3,7 @@ puts "0031703: Data Exchange, RWGltf_CafWriter - add option putting textures ins
puts "Test case exporting glTF model into GLB file." puts "Test case exporting glTF model into GLB file."
puts "========" puts "========"
catch { Close D1 } Close D1 -silent
ReadGltf D1 [locate_data_file bug30691_Lantern.glb] ReadGltf D1 [locate_data_file bug30691_Lantern.glb]
set aTmpGltfBase "${imagedir}/${casename}_tmp" set aTmpGltfBase "${imagedir}/${casename}_tmp"

@ -1,4 +1,4 @@
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
# PBR requires OpenGL 3.0+ on macOS # PBR requires OpenGL 3.0+ on macOS
if { $::tcl_platform(os) == "Darwin" } { vcaps -core } if { $::tcl_platform(os) == "Darwin" } { vcaps -core }

@ -11,7 +11,7 @@ set aFile [locate_data_file OCC5023.cbf]
puts "Info: Restore the document" puts "Info: Restore the document"
if [info exists DD] { if [info exists DD] {
catch {Close DD}; unset DD Close DD -silent; unset DD
} }
dchrono h restart dchrono h restart

@ -11,7 +11,7 @@ set aFile [locate_data_file OCC5023.std]
puts "Info: Restore the document" puts "Info: Restore the document"
if [info exists DD] { if [info exists DD] {
catch {Close DD}; unset DD Close DD -silent; unset DD
} }
dchrono h restart dchrono h restart

@ -6,7 +6,7 @@ pload MODELING OCAF XDE
box b 10 10 10 box b 10 10 10
vclear vclear
vinit View1 vinit View1
catch { Close D } Close D -silent
NewDocument D BinXCAF NewDocument D BinXCAF
XAddShape D b XAddShape D b
XSetColor D b BLUE XSetColor D b BLUE

@ -8,7 +8,7 @@ pload XDE OCAF VISUALIZATION MODELING
# PBR doesn't work with Compatible Profile on macOS # PBR doesn't work with Compatible Profile on macOS
if { $::tcl_platform(os) == "Darwin" } { vcaps -core } if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
catch { Close D } Close D -silent
vclear vclear
vclose ALL vclose ALL

@ -19,7 +19,7 @@ vrenderparams -shadingModel PBR
vlight -clear vlight -clear
vlight -add ambient vlight -add ambient
catch { Close D } Close D -silent
ReadGltf D [locate_data_file bug31302_NormalTangentTest.gltf] ReadGltf D [locate_data_file bug31302_NormalTangentTest.gltf]
XDisplay -dispmode 1 D XDisplay -dispmode 1 D

@ -13,7 +13,7 @@ psphere s3 0.5
ttranslate s1 1 0 0 ttranslate s1 1 0 0
ttranslate s2 2 0 0 ttranslate s2 2 0 0
ttranslate s3 3 0 0 ttranslate s3 3 0 0
catch { Close D } Close D -silent
XNewDoc D XNewDoc D
set l0 [XAddShape D b 0] set l0 [XAddShape D b 0]
set l1 [XAddShape D s1 0] set l1 [XAddShape D s1 0]

@ -5,7 +5,7 @@ puts "========"
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
vclear vclear
vinit View1 vinit View1
vaxo vaxo

@ -3,7 +3,7 @@ puts "0031096: Visualization, TKOpenGl - support metallic-roughness texture mapp
puts "========" puts "========"
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
ReadGltf D [locate_data_file bug30691_DamagedHelmet.gltf] ReadGltf D [locate_data_file bug30691_DamagedHelmet.gltf]
vclear vclear

@ -3,7 +3,7 @@ puts "0031275: Visualization, TKOpenGl - handle normal-map texture with Path-Tra
puts "========" puts "========"
pload XDE OCAF MODELING VISUALIZATION pload XDE OCAF MODELING VISUALIZATION
catch { Close D } Close D -silent
ReadGltf D [locate_data_file bug31275_SphereWithNormalMap.glb] ReadGltf D [locate_data_file bug31275_SphereWithNormalMap.glb]
vclear vclear

@ -5,7 +5,7 @@ puts "========"
pload MODELING VISUALIZATION XDE OCAF pload MODELING VISUALIZATION XDE OCAF
if { $::tcl_platform(os) == "Darwin" } { vcaps -core } if { $::tcl_platform(os) == "Darwin" } { vcaps -core }
catch {Close D} Close D -silent
ReadGltf D [locate_data_file bug30691_Buggy.glb] ReadGltf D [locate_data_file bug30691_Buggy.glb]
vclear vclear
vinit View1 vinit View1