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

0032540: RWGltf_CafReader - optional "scene" parameter encoded as mandatory

First scene is now loaded when default one is undefined.
This commit is contained in:
kgv
2021-09-09 21:59:18 +03:00
committed by smoskvin
parent 8dcb81ac82
commit 8a17a8bb45
6 changed files with 71 additions and 3 deletions

View File

@@ -187,6 +187,7 @@ static Standard_Integer ReadGltf (Draw_Interpretor& theDI,
Standard_Boolean toSkipLateDataLoading = Standard_False;
Standard_Boolean toKeepLateData = Standard_True;
Standard_Boolean toPrintDebugInfo = Standard_False;
Standard_Boolean toLoadAllScenes = Standard_False;
Standard_Boolean isNoDoc = (TCollection_AsciiString(theArgVec[0]) == "readgltf");
for (Standard_Integer anArgIter = 1; anArgIter < theNbArgs; ++anArgIter)
{
@@ -246,6 +247,15 @@ static Standard_Integer ReadGltf (Draw_Interpretor& theDI,
++anArgIter;
}
}
else if (anArgCase == "-allscenes")
{
toLoadAllScenes = Standard_True;
if (anArgIter + 1 < theNbArgs
&& Draw::ParseOnOff (theArgVec[anArgIter + 1], toLoadAllScenes))
{
++anArgIter;
}
}
else if (anArgCase == "-toprintinfo"
|| anArgCase == "-toprintdebuginfo")
{
@@ -322,6 +332,7 @@ static Standard_Integer ReadGltf (Draw_Interpretor& theDI,
aReader.SetToSkipLateDataLoading (toSkipLateDataLoading);
aReader.SetToKeepLateData (toKeepLateData);
aReader.SetToPrintDebugMessages (toPrintDebugInfo);
aReader.SetLoadAllScenes (toLoadAllScenes);
if (toListExternalFiles)
{
aReader.ProbeHeader (aFilePath);
@@ -2032,6 +2043,7 @@ void XSDRAWSTLVRML::InitCommands (Draw_Interpretor& theCommands)
"\n\t\t: (false by default)"
"\n\t\t: -keepLate data is loaded into itself with preservation of information"
"\n\t\t: about deferred storage to load/unload this data later.",
"\n\t\t: -allScenes load all scenes defined in the document instead of default one (false by default)"
"\n\t\t: -toPrintDebugInfo print additional debug information during data reading"
__FILE__, ReadGltf, g);
theCommands.Add ("readgltf",