1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0027258: Configuration - generate built-in replacement for mandatory resource files

Generation of header files from resource files was added to CMake and genproj procedures.

Message_MsgFile has been extended with new method ::LoadFromString()
for loading messages from embedded resources.
Message_MsgFile::LoadFromString() is now a preferred way
for loading message resources by application
as alternative to environment variables.

TObje/TObj.msg is now embedded into TObj_Application.cxx.
TObj_Application now loads its global messages
on instantiation of the first class instance.

UnitsAPI/Lexi_Expr.dat now completely embedded into Units_Lexicon.cxx.
UnitsAPI/Units.dat now embedded into Units_UnitsDictionary.cxx
but can be regenerated from resource file.
The definition of the following units have been removed:
benne à charbon, calorie (diététique).

Unused message files XSMessage/IGES.us and IGES.fr have been removed.
Related code IGESData.cxx has been removed as well.

XSMessage/XSTEP.us is now embedded into Interface_StaticStandards.cxx
and used for fallback initialization in case when file resources
defined by CSF_XSMessage environment variable are missing.

SHMessage/SHAPE.us is now embedded into ShapeExtend.cxx
and used for fallback initialization in case when file resources
defined by CSF_XHMessage environment variable are missing.
Duplicating code has been removed from ShapeProcess_OperLibrary.cxx.

Shaders/Declarations.glsl and Shaders/DeclarationsImpl.glsl
are now embedded into OpenGl_ShaderProgram.cxx.
CSF_ShadersDirectory is no more required for using OCCT 3D Viewer.

Ray-Tracing GLSL programs from Shaders are now embedded into OpenGl_View_Raytrace.cxx.
File resources are still used instead of embedded programs
when CSF_ShadersDirectory is defined, but this functionality
is intended for OCCT development.

Enumeration Graphic3d_ShaderProgram::ShaderName_Phong
demonstrating custom GLSL program usage has been removed.
This commit is contained in:
ski
2016-10-28 14:29:58 +03:00
committed by apn
parent 30f5e1a74b
commit ee5befae97
62 changed files with 5075 additions and 2137 deletions

View File

@@ -44,3 +44,4 @@ TObj_TReference.cxx
TObj_TReference.hxx
TObj_TXYZ.cxx
TObj_TXYZ.hxx
TObj_TObj_msg.pxx

View File

@@ -23,10 +23,13 @@
#include <TColStd_SequenceOfExtendedString.hxx>
#include <CDM_COutMessageDriver.hxx>
#include <Message_Msg.hxx>
#include <Message_MsgFile.hxx>
#include <Resource_Manager.hxx>
#include <stdio.h>
#include "TObj_TObj_msg.pxx"
IMPLEMENT_STANDARD_RTTIEXT(TObj_Application,TDocStd_Application)
//=======================================================================
@@ -47,6 +50,16 @@ Handle(TObj_Application) TObj_Application::GetInstance()
TObj_Application::TObj_Application () : myIsError(Standard_False)
{
if (!Message_MsgFile::HasMsg ("TObj_Appl_SUnknownFailure"))
{
// load messages into global map on first instantiation
Message_MsgFile::LoadFromString (TObj_TObj_msg, sizeof(TObj_TObj_msg) - 1);
if (!Message_MsgFile::HasMsg ("TObj_Appl_SUnknownFailure"))
{
Standard_ProgramError::Raise ("Critical Error - message resources for TObj_Application are invalid or undefined!");
}
}
myMessenger = new Message_Messenger;
myIsVerbose = Standard_False;
}

197
src/TObj/TObj_TObj_msg.pxx Normal file
View File

@@ -0,0 +1,197 @@
// This file has been automatically generated from resource file src/TObj/TObj.msg
static const char TObj_TObj_msg[] =
"!!!!!!!!!! ----- Messages file for TObj packages --------- !!!!!!!!!\n"
"! Syntax for keywords: NameOfPackage_NameOfClass_NameOfMessage\n"
"! where NameOfClass is optional or abbreviated\n"
"!!!!!!!!!! --------------------------------------------------- !!!!!!!!!\n"
"\n"
".TObj_DL_VoidItemId\n"
" Void ID attribute in XML file when loading the library %s\n"
"\n"
".TObj_DL_ZeroId\n"
" Non-positive or irrelevant (%d) ID attribute in XML file when loading the library %s\n"
"\n"
".TObj_DL_MissItemData\n"
" Missing LibraryData element with ID %d in XML file when loading the library %s\n"
"\n"
".TObj_DL_NoLibName\n"
" Cannot find the library \"%s\" with the type \"%s\"\n"
"\n"
".TObj_DL_TraceReadLib\n"
" Loading the library %s / %s, version %s, date %s\n"
"\n"
".TObj_DL_NoDocument\n"
" The document %s does not contain data libraries\n"
"\n"
".TObj_DL_AlrReadLib\n"
" The library \"%s\" for data type \"%s\" has already been loaded\n"
"\n"
".TObj_DL_AlrAddedReader\n"
" TObj_DataLibrary::AddReader: Warning: this Reader already added to a different DataLibrary\n"
"\n"
".TObj_DL_InvalidLibHeader\n"
" Invalid library header encountered in file %s\n"
"\n"
".TObj_DL_NotSupported\n"
" The data type \"%s\" not supported\n"
"\n"
".TObj_DL_EmptyDL\n"
" DataLibrary is empty, the file is not created\n"
"\n"
".TObj_DL_CannotCreateFile\n"
" Can't create the file for data library\n"
"\n"
".TObj_DL_ErrorClosingFile\n"
" Error closing the file for data library\n"
"\n"
".TObj_DL_DoubledTag\n"
" Duplicate tag %d found for element \"%s\" in library \"%s\", type \"%s\"\n"
"\n"
"!!! ---------------- TObj_Application ----------------\n"
"\n"
".TObj_Appl_SDriverFailure\n"
" Error saving document %s : driver failure. Check presence of resource files.\n"
"\n"
".TObj_Appl_SWriteFailure\n"
" Error saving document %s : write failure\n"
" \n"
".TObj_Appl_SFailure\n"
" Error saving document %s : general failure of persistence driver\n"
" \n"
".TObj_Appl_SDocIsNull\n"
" Error saving document %s : No document to save\n"
" \n"
".TObj_Appl_SNoObj\n"
" Error saving document %s : No objects written\n"
" \n"
".TObj_Appl_SInfoSectionError\n"
" Error saving document %s : Write info section failure\n"
"\n"
".TObj_Appl_SUnknownFailure\n"
" Error saving document %s : unknown failure\n"
"\n"
".TObj_Appl_RUnknownDocument\n"
" Error loading document %s : unknown document\n"
"\n"
".TObj_Appl_RAlreadyRetrieved\n"
" Error loading document %s : already retrieved\n"
"\n"
".TObj_Appl_RAlreadyRetrievedAndModified\n"
" Error loading document %s : already retrieved and modified\n"
"\n"
".TObj_Appl_RNoDriver\n"
" Error loading document %s : no appropriate driver was found\n"
"\n"
".TObj_Appl_ROpenError\n"
" Error loading document %s : cannot open file\n"
"\n"
".TObj_Appl_RNoVersion\n"
" Error loading document %s : no version\n"
"\n"
".TObj_Appl_RNoModel\n"
" Error loading document %s : no model\n"
"\n"
".TObj_Appl_RNoDocument\n"
" Error loading document %s : no document\n"
"\n"
".TObj_Appl_RFormatFailure\n"
" Error loading document %s : format failure\n"
"\n"
".TObj_Appl_RTypeNotFound\n"
" Error loading document %s : type not found in schema\n"
"\n"
".TObj_Appl_RBadFileFormat\n"
" Error loading document %s : unrecognized file format\n"
"\n"
".TObj_Appl_RMakeFailure\n"
" Error loading document %s : failure making document\n"
"\n"
".TObj_Appl_RPermissionDenied\n"
" Error loading document %s : permission denied\n"
"\n"
".TObj_Appl_RDriverFailure\n"
" Error loading document %s : driver failure\n"
"\n"
".TObj_Appl_RUnknownFail\n"
" Error loading document %s : unknown failure\n"
"\n"
".TObj_Appl_RException\n"
" Error loading document %s : the file is probably corrupted\n"
"\n"
".TObj_Appl_Exception\n"
" An exception was caught: %s\n"
"\n"
"!!! ---------------- TObj_Checker ----------------\n"
"\n"
".TObj_Ch_RefToNullObj\n"
" Referencing to NULL object: %s\n"
"\n"
".TObj_Ch_BackRefToNullObj\n"
" Back Referencing to NULL object: %s\n"
"\n"
".TObj_Ch_BackRefToDelObj\n"
" Back Referencing to deleted object: %s\n"
"\n"
".TObj_Ch_BackRefError\n"
" Back Reference Error: %s\n"
"\n"
".TObj_Ch_RefWithoutBack\n"
" Reference without back one: %s\n"
"\n"
".TObj_Ch_BackRefWithoutDirect\n"
" Back Reference without direct one: %s from: %s\n"
"\n"
".TObj_Ch_NoAttr\n"
" Has no attribute %s at label\n"
"\n"
".TObj_Ch_NotOcafObj\n"
" Object is not OCAF Object: %s\n"
"\n"
".TObj_Ch_ObjWithoutName\n"
" Object without name: %s entry %s\n"
"\n"
".TObj_Ch_NameNotUnique\n"
" Name: %s is not unique in the model %s\n"
"\n"
".TObj_Ch_NameNotRegistered\n"
" Name: %s is not registered in names map %s\n"
"\n"
".TObj_Ch_RegistrationError\n"
" Registration Error: name %s, target entry %s, entry %s\n"
"\n"
".TObj_Ch_ExtraName\n"
" Map of model contains the extra name : %s\n"
"\n"
".TObj_M_LoadDocument\n"
" +++++ Load document %s\n"
"\n"
".TObj_M_SaveDocument\n"
" +++++ Save document %s\n"
"\n"
".TObj_M_TimeLoading\n"
" +++++ Fin loading : \n"
"\n"
".TObj_M_TimeInit\n"
" +++++ Fin initializing new model : \n"
"\n"
".TObj_M_TimeSaving\n"
" +++++ Fin saving : \n"
"\n"
".TObj_M_WrongFile\n"
" File %s has wrong content\n"
"\n"
".TObj_M_NoWriteAccess\n"
" Cannot write the file %s, check permissions\n"
"\n"
".TObj_Any_FailCreateDir\n"
" Error creating the directory %s\n"
"\n"
".TObj_Any_NoFormatVersion\n"
" File %s has no format version, probably it is obsolete\n"
"\n"
".TObj_Any_WrongFormatVersion\n"
" File %s has unsupported format version; model is discarded\n"
"\n"
".TObj_Any_OldFormatVersion\n"
" Warning: Model version is updated; it will not be readable by previous versions of application\n";