RWObj_ReaderFile aFile (theFile);
if (aFile.File == NULL)
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: file '") + theFile + "' is not found!", Message_Fail);
+ Message::SendFail (TCollection_AsciiString ("Error: file '") + theFile + "' is not found");
return Standard_False;
}
const int64_t aFileLen = aFile.FileLen;
if (aFileLen <= 0L)
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: file '") + theFile + "' is empty!", Message_Fail);
+ Message::SendFail (TCollection_AsciiString ("Error: file '") + theFile + "' is empty");
return Standard_False;
}
}
if (myNbElemsBig != 0)
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: OBJ reader, ") + myNbElemsBig
- + " polygon(s) have been split into triangles.", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: OBJ reader, ") + myNbElemsBig + " polygon(s) have been split into triangles");
}
for (; aNbMiBPassed < aNbMiBTotal; ++aNbMiBPassed) { aPSentry.Next(); }
if (a3Indices[0] < myObjVerts.Lower() || a3Indices[0] > myObjVerts.Upper())
{
myToAbort = true;
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Error: invalid OBJ syntax at line ") + myNbLines
- + ": vertex index is out of range.", Message_Fail);
+ Message::SendFail (TCollection_AsciiString("Error: invalid OBJ syntax at line ") + myNbLines + ": vertex index is out of range");
return;
}
{
if (myObjVertsUV.IsEmpty())
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
- + ": UV index is specified but no UV nodes are defined.", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
+ + ": UV index is specified but no UV nodes are defined");
}
else if (a3Indices[1] < myObjVertsUV.Lower() || a3Indices[1] > myObjVertsUV.Upper())
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
- + ": UV index is out of range.", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
+ + ": UV index is out of range");
setNodeUV (anIndex,Graphic3d_Vec2 (0.0f, 0.0f));
}
else
{
if (myObjNorms.IsEmpty())
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
- + ": Normal index is specified but no Normals nodes are defined.", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
+ + ": Normal index is specified but no Normals nodes are defined");
}
else if (a3Indices[2] < myObjNorms.Lower() || a3Indices[2] > myObjNorms.Upper())
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
- + ": Normal index is out of range.", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines
+ + ": Normal index is out of range");
setNodeNormal (anIndex, Graphic3d_Vec3 (0.0f, 0.0f, 1.0f));
}
else
}
catch (Standard_Failure const& theFailure)
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString ("Error: exception raised during polygon split\n[")
- + theFailure.GetMessageString() + "]", Message_Warning);
+ Message::SendWarning (TCollection_AsciiString ("Error: exception raised during polygon split\n[") + theFailure.GetMessageString() + "]");
}
return triangulatePolygonFan (theIndices);
}
}
else if (!myMaterials.IsBound (aNewMat))
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: use of undefined OBJ material at line ")
- + myNbLines, Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: use of undefined OBJ material at line ") + myNbLines);
return;
}
if (myActiveSubMesh.Material.IsEqual (aNewMat))
TCollection_AsciiString aMatPath;
if (!RWObj_Tools::ReadName (theFileName, aMatPath))
{
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Warning: invalid OBJ syntax at line ")
- + myNbLines, Message_Warning);
+ Message::SendWarning (TCollection_AsciiString("Warning: invalid OBJ syntax at line ") + myNbLines);
return;
}
return true;
}
- Message::DefaultMessenger()->Send (TCollection_AsciiString("Error: OBJ file content does not fit into ")
- + Standard_Integer(myMemLimitBytes / (1024 * 1024)) + " MiB limit."
- + "\nMesh data will be truncated.", Message_Fail);
+ Message::SendFail (TCollection_AsciiString("Error: OBJ file content does not fit into ")
+ + Standard_Integer(myMemLimitBytes / (1024 * 1024)) + " MiB limit."
+ + "\nMesh data will be truncated.");
myToAbort = true;
return false;
}