1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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

@@ -32,17 +32,7 @@ $(ASSETDIR)/XSMessage: $(ASSETDIR)
-mkdir -p $(ASSETDIR)/XSMessage
cp -f -r $(OCCT_ROOT)/src/XSMessage/*.* $(ASSETDIR)/XSMessage
$(ASSETDIR)/TObj: $(ASSETDIR)
-mkdir -p $(ASSETDIR)
-mkdir -p $(ASSETDIR)/TObj
cp -f -r $(OCCT_ROOT)/src/TObj/*.msg $(ASSETDIR)/TObj
$(ASSETDIR)/UnitsAPI: $(ASSETDIR)
-mkdir -p $(ASSETDIR)
-mkdir -p $(ASSETDIR)/UnitsAPI
cp -f -r $(OCCT_ROOT)/src/UnitsAPI/*.dat $(ASSETDIR)/UnitsAPI
pre_all: $(ASSETDIR)/Shaders $(ASSETDIR)/SHMessage $(ASSETDIR)/XSMessage $(ASSETDIR)/TObj $(ASSETDIR)/UnitsAPI
pre_all: $(ASSETDIR)/Shaders $(ASSETDIR)/SHMessage $(ASSETDIR)/XSMessage
jniall: pre_all all

View File

@@ -110,9 +110,6 @@ OcctJni_Viewer::OcctJni_Viewer()
// prepare necessary environment
TCollection_AsciiString aResRoot = "/data/data/com.opencascade.jnisample/files";
setResourceEnv ("CSF_TObjMessage", aResRoot + "/TObj", "TObj.msg", Standard_False);
setResourceEnv ("CSF_UnitsLexicon", aResRoot + "/UnitsAPI", "Lexi_Expr.dat", Standard_True);
setResourceEnv ("CSF_UnitsDefinition", aResRoot + "/UnitsAPI", "Units.dat", Standard_True);
setResourceEnv ("CSF_ShadersDirectory", aResRoot + "/Shaders", "Declarations.glsl", Standard_False);
setResourceEnv ("CSF_XSMessage", aResRoot + "/XSMessage", "XSTEP.us", Standard_False);
setResourceEnv ("CSF_SHMessage", aResRoot + "/XSMessage", "SHAPE.us", Standard_False);
@@ -120,9 +117,6 @@ OcctJni_Viewer::OcctJni_Viewer()
// make sure OCCT loads the dictionary
//UnitsAPI::SetLocalSystem (UnitsAPI_SI);
// load messages for TObj
Message_MsgFile::LoadFromEnv ("CSF_TObjMessage", "TObj", "msg");
}
// =======================================================================