mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- use shortcuts
Message::DefaultMessenger()->Send() have been replaced by shortcuts Message::Send().
This commit is contained in:
@@ -124,7 +124,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
if (!aFile.is_open()
|
||||
|| !aFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' is not found!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
{
|
||||
if (*aLen < 20)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' has broken glTF format!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' has broken glTF format");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
aBinBodyLen = int64_t(*aLen) - aBinBodyOffset;
|
||||
if (*aSceneFormat != 0)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' is written using unsupported Scene format!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is written using unsupported Scene format");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
{
|
||||
if (*aVer != 2)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' is written using unknown version " + int(*aVer) + "!", Message_Warning);
|
||||
Message::SendWarning (TCollection_AsciiString ("File '") + theFile + "' is written using unknown version " + int(*aVer));
|
||||
}
|
||||
|
||||
for (int aChunkIter = 0; !aFile.eof() && aChunkIter < 2; ++aChunkIter)
|
||||
@@ -182,7 +182,7 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
aFile.read (aChunkHeader2, sizeof(aChunkHeader2));
|
||||
if (!aFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' is written using unsupported format!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is written using unsupported format");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -246,12 +246,12 @@ Standard_Boolean RWGltf_CafReader::performMesh (const TCollection_AsciiString& t
|
||||
{
|
||||
if (aRes.Code() == rapidjson::kParseErrorDocumentEmpty)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' is empty!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' is empty");
|
||||
return false;
|
||||
}
|
||||
TCollection_AsciiString anErrDesc (RWGltf_GltfJsonParser::FormatParseError (aRes.Code()));
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + theFile + "' defines invalid JSON document!\n"
|
||||
+ anErrDesc + " [at offset " + (int )aRes.Offset() + "].", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + theFile + "' defines invalid JSON document!\n"
|
||||
+ anErrDesc + " [at offset " + (int )aRes.Offset() + "].");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@@ -351,7 +351,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
if (!aBinFile.is_open()
|
||||
|| !aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be created!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be created");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
|
||||
if (!aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
|
||||
if (!aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -468,7 +468,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
|
||||
if (!aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -509,7 +509,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
|
||||
if (!aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -538,7 +538,7 @@ bool RWGltf_CafWriter::writeBinData (const Handle(TDocStd_Document)& theDocument
|
||||
aBinFile.close();
|
||||
if (!aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -570,7 +570,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
if (!aGltfContentFile.is_open()
|
||||
|| !aGltfContentFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be created!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be created");
|
||||
return false;
|
||||
}
|
||||
if (myIsBinary)
|
||||
@@ -643,7 +643,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
aGltfContentFile.close();
|
||||
if (!aGltfContentFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -670,7 +670,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
if (!aBinFile.is_open()
|
||||
|| !aBinFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + myBinFileNameFull + "' cannot be opened!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + myBinFileNameFull + "' cannot be opened");
|
||||
return false;
|
||||
}
|
||||
char aBuffer[4096];
|
||||
@@ -689,13 +689,12 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
OSD_File (aBinFilePath).Remove();
|
||||
if (OSD_File (aBinFilePath).Exists())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("Unable to remove temporary glTF content file '")
|
||||
+ myBinFileNameFull + "'!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("Unable to remove temporary glTF content file '") + myBinFileNameFull + "'");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Message::DefaultMessenger()->Send ("glTF file content is too big for binary format!", Message_Fail);
|
||||
Message::SendFail ("glTF file content is too big for binary format");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -708,7 +707,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
aGltfContentFile.close();
|
||||
if (!aGltfContentFile.good())
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be written!", Message_Fail);
|
||||
Message::SendFail (TCollection_AsciiString ("File '") + aFileNameGltf + "' can not be written");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -720,7 +719,7 @@ bool RWGltf_CafWriter::writeJson (const Handle(TDocStd_Document)& theDocument,
|
||||
(void )theLabelFilter;
|
||||
(void )theFileInfo;
|
||||
(void )theProgress;
|
||||
Message::DefaultMessenger()->Send ("Error: glTF writer is unavailable - OCCT has been built without RapidJSON support [HAVE_RAPIDJSON undefined].", Message_Fail);
|
||||
Message::SendFail ("Error: glTF writer is unavailable - OCCT has been built without RapidJSON support [HAVE_RAPIDJSON undefined]");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
@@ -141,8 +141,7 @@ void RWGltf_GltfJsonParser::GltfElementMap::Init (const TCollection_AsciiString&
|
||||
const TCollection_AsciiString aKey (aChildIter->name.GetString());
|
||||
if (!myChildren.Bind (aKey, &aChildIter->value))
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("Invalid glTF syntax - key '")
|
||||
+ aKey + "' is already defined in '" + theRootName + "'.", Message_Warning);
|
||||
Message::SendWarning (TCollection_AsciiString ("Invalid glTF syntax - key '") + aKey + "' is already defined in '" + theRootName + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +168,7 @@ void RWGltf_GltfJsonParser::GltfElementMap::Init (const TCollection_AsciiString&
|
||||
void RWGltf_GltfJsonParser::reportGltfSyntaxProblem (const TCollection_AsciiString& theMsg,
|
||||
Message_Gravity theGravity)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (myErrorPrefix + theMsg, theGravity);
|
||||
Message::Send (myErrorPrefix + theMsg, theGravity);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -422,7 +421,7 @@ void RWGltf_GltfJsonParser::gltfBindMaterial (const Handle(RWGltf_MaterialMetall
|
||||
anAlphaMode = Graphic3d_AlphaMode_Opaque;
|
||||
if (aMatXde.BaseColor.Alpha() < 1.0f)
|
||||
{
|
||||
Message::DefaultMessenger()->Send ("glTF reader - material with non-zero Transparency specifies Opaque AlphaMode", Message_Warning);
|
||||
Message::SendWarning ("glTF reader - material with non-zero Transparency specifies Opaque AlphaMode");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -810,7 +809,7 @@ bool RWGltf_GltfJsonParser::gltfParseTexture (Handle(Image_Texture)& theTexture,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Message::DefaultMessenger()->Send ("glTF reader - embedded image has been skipped", Message_Warning);
|
||||
Message::SendWarning ("glTF reader - embedded image has been skipped");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1205,9 +1204,8 @@ bool RWGltf_GltfJsonParser::gltfParseSceneNode (TopoDS_Shape& theNodeShape,
|
||||
aMat4.GetValue (1, 0), aMat4.GetValue (1, 1), aMat4.GetValue (1, 2), aMat4.GetValue (1, 3),
|
||||
aMat4.GetValue (2, 0), aMat4.GetValue (2, 1), aMat4.GetValue (2, 2), aMat4.GetValue (2, 3));
|
||||
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString ("glTF reader, scene node '")
|
||||
+ theSceneNodeId + "' defines unsupported scaling "
|
||||
+ aScaleVec.x() + " " + aScaleVec.y() + " " + aScaleVec.z(), Message_Warning);
|
||||
Message::SendWarning (TCollection_AsciiString ("glTF reader, scene node '")
|
||||
+ theSceneNodeId + "' defines unsupported scaling " + aScaleVec.x() + " " + aScaleVec.y() + " " + aScaleVec.z());
|
||||
}
|
||||
else if (Abs (aScaleVec.x() - 1.0) > Precision::Confusion())
|
||||
{
|
||||
@@ -1428,8 +1426,7 @@ bool RWGltf_GltfJsonParser::gltfParsePrimArray (const Handle(RWGltf_GltfLatePrim
|
||||
}
|
||||
if (aMode != RWGltf_GltfPrimitiveMode_Triangles)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString() + "Primitive array within Mesh '"
|
||||
+ theMeshId + "' skipped due to unsupported mode.", Message_Warning);
|
||||
Message::SendWarning (TCollection_AsciiString() + "Primitive array within Mesh '" + theMeshId + "' skipped due to unsupported mode");
|
||||
return true;
|
||||
}
|
||||
theMeshData->SetPrimitiveMode (aMode);
|
||||
@@ -1935,7 +1932,7 @@ bool RWGltf_GltfJsonParser::Parse (const Handle(Message_ProgressIndicator)& theP
|
||||
}
|
||||
return true;
|
||||
#else
|
||||
Message::DefaultMessenger()->Send ("Error: glTF reader is unavailable - OCCT has been built without RapidJSON support [HAVE_RAPIDJSON undefined].", Message_Fail);
|
||||
Message::SendFail ("Error: glTF reader is unavailable - OCCT has been built without RapidJSON support [HAVE_RAPIDJSON undefined]");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWGltf_PrimitiveArrayReader, Standard_Transient)
|
||||
// =======================================================================
|
||||
void RWGltf_PrimitiveArrayReader::reportError (const TCollection_AsciiString& theText)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (myErrorPrefix + theText, Message_Fail);
|
||||
Message::SendFail (myErrorPrefix + theText);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -111,7 +111,7 @@ bool RWGltf_TriangulationReader::readBuffer (std::istream& theStream,
|
||||
{
|
||||
if (theMode != RWGltf_GltfPrimitiveMode_Triangles)
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString("Buffer '") + theName + "' skipped unsupported primitive array.", Message_Warning);
|
||||
Message::SendWarning (TCollection_AsciiString("Buffer '") + theName + "' skipped unsupported primitive array");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user