From: ski Date: Fri, 28 Oct 2016 11:29:58 +0000 (+0300) Subject: 0027258: Configuration - generate built-in replacement for mandatory resource files X-Git-Tag: V7_1_0_beta~49 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=ee5befae97566611223b30bcb6f803c2d2e6b314 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. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index eb97189a13..6c2510ee1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,9 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE} set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}") +# Regeneration of OCCT resource files +set (BUILD_RESOURCES OFF CACHE BOOL "${BUILD_RESOURCES_DESCR}") + # single-configuration generator set (SINGLE_GENERATOR OFF) if (CMAKE_BUILD_TYPE) @@ -285,6 +288,9 @@ if (NOT DEFINED INSTALL_DIR_CMAKE) endif() endif() +# include occt macros +OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_resources") + # install LICENSE_LGPL_21.txt and OCCT_LGPL_EXCEPTION.txt files if ("${INSTALL_DIR_LAYOUT}" STREQUAL "Unix") OCCT_INSTALL_FILE_OR_DIR ("LICENSE_LGPL_21.txt" "${INSTALL_DIR_DOC}") diff --git a/adm/RESOURCES b/adm/RESOURCES index a16bc80ec1..3d6c59e7aa 100644 --- a/adm/RESOURCES +++ b/adm/RESOURCES @@ -6,6 +6,5 @@ Shaders XSMessage XSTEPResource XmlOcafResource -UnitsAPI/Lexi_Expr.dat UnitsAPI/Units.dat TObj/TObj.msg \ No newline at end of file diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake index 7a3bd0bc6c..1381625eb1 100644 --- a/adm/cmake/occt_macros.cmake +++ b/adm/cmake/occt_macros.cmake @@ -257,6 +257,8 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO foreach (FILE_INDEX RANGE ${ALL_FILES_NB}) list (GET OCCT_ALL_FILE_NAMES ${FILE_INDEX} OCCT_FILE_NAME) + string (REGEX REPLACE "[^:]+:+" "" OCCT_FILE_NAME "${OCCT_FILE_NAME}") + if ("${OCCT_FILE_IN_DIR_NAME}" STREQUAL "${OCCT_FILE_NAME}") set (OCCT_FILE_IN_DIR_STATUS ON) @@ -296,6 +298,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE}) get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME) + set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"") configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY) endforeach() diff --git a/adm/cmake/occt_resources.cmake b/adm/cmake/occt_resources.cmake new file mode 100644 index 0000000000..70fa0bf224 --- /dev/null +++ b/adm/cmake/occt_resources.cmake @@ -0,0 +1,78 @@ +# OCCT resource files generation + +macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource) + set (RESOURCE_FILES) + set (isResDirectory FALSE) + if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}") + file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES) + set (CurrentResource_Directory "${CurrentResource}") + set (isResDirectory TRUE) + else() + get_filename_component (CurrentResource_Name "${CurrentResource}" NAME) + list (APPEND RESOURCE_FILES "res:::${CurrentResource_Name}") + get_filename_component (CurrentResource_Directory "${CurrentResource}" DIRECTORY) + endif() + + # Add current toolkit into RESOURCE_TOOLKITS array to copy it to the BUILD directory + list (APPEND RESOURCE_TOOLKITS "${CurrentResource_Directory}") + list (REMOVE_DUPLICATES RESOURCE_TOOLKITS) + + if (BUILD_RESOURCES) + foreach (RESOURCE_FILE ${RESOURCE_FILES}) + string (REGEX MATCH "^[^:]+:::" IS_RESOURCE "${RESOURCE_FILE}") + if (IS_RESOURCE) + string (REGEX REPLACE "[^:]+:+" "" RESOURCE_FILE "${RESOURCE_FILE}") + + get_filename_component (CurrentResource_FileName "${RESOURCE_FILE}" NAME) + string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}") + set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx") + + set (toProcessResFile TRUE) + if (isResDirectory) + list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex) + if ("${aResIndex}" STREQUAL "-1") + set (toProcessResFile FALSE) + endif() + endif() + + if (toProcessResFile) + message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}") + + # generate content for header file + set (OCCT_HEADER_FILE_CONTENT) + string (APPEND OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n") + + # read resource file + file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST) + + string (APPEND OCCT_HEADER_FILE_CONTENT "static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =") + foreach (line IN LISTS RESOURCE_FILE_LINES_LIST) + string (REPLACE "\"" "\\\"" line "${line}") + string (APPEND OCCT_HEADER_FILE_CONTENT "\n \"${line}\\n\"") + endforeach() + string (APPEND OCCT_HEADER_FILE_CONTENT ";") + + # Save generated content to header file + set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}") + if (EXISTS "${HEADER_FILE}") + file (REMOVE "${HEADER_FILE}") + endif() + configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF) + endif() + endif() + endforeach() + endif() +endmacro() + + +FILE_TO_LIST ("adm/RESOURCES" RESOURCES) +foreach (CurrentResource ${RESOURCES}) + get_filename_component (CurrentResource_FileName "${CurrentResource}" NAME) + if ("${CurrentResource_FileName}" STREQUAL TObj.msg OR + "${CurrentResource_FileName}" STREQUAL Units.dat OR + "${CurrentResource}" STREQUAL XSMessage OR + "${CurrentResource}" STREQUAL SHMessage OR + "${CurrentResource}" STREQUAL Shaders) + OCCT_GENERATE_CONTENT_ONLY ("${CurrentResource}") + endif() +endforeach() diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake index 568fb97e0f..bf578f87e5 100644 --- a/adm/cmake/vardescr.cmake +++ b/adm/cmake/vardescr.cmake @@ -18,6 +18,8 @@ set (BUILD_YACCLEX_DESCR ExprIntrp functionality are generated automatically with Flex/Bison. Checking this options leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files") +set (BUILD_RESOURCES_DESCR "Enables regeneration of OCCT resource files") + set (BUILD_WITH_DEBUG_DESCR "Enables extended messages of many OCCT algorithms, usually printed to cout. These include messages on internal errors and special cases encountered, timing etc. diff --git a/adm/genproj.tcl b/adm/genproj.tcl index 14d4b46864..18203f810b 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -108,6 +108,152 @@ proc osutils:findSrcSubPath {theSubPath} { return "$::THE_CASROOT/src/$theSubPath" } +# Auxiliary tool comparing content of two files line-by-line. +proc osutils:isEqualContent { theContent1 theContent2 } { + set aLen1 [llength $theContent1] + set aLen2 [llength $theContent2] + if { $aLen1 != $aLen2 } { + return false + } + + for {set aLineIter 0} {$aLineIter < $aLen1} {incr aLineIter} { + set aLine1 [lindex $theContent1 $aLineIter] + set aLine2 [lindex $theContent2 $aLineIter] + if { $aLine1 != $aLine2 } { + return false + } + } + return true +} + +# Auxiliary function for writing new file content only if it has been actually changed +# (e.g. to preserve file timestamp on no change). +# Useful for automatically (re)generated files. +proc osutils:writeTextFile { theFile theContent {theEol lf} } { + if {[file exists "${theFile}"]} { + set aFileOld [open "${theFile}" rb] + fconfigure $aFileOld -translation crlf + set aLineListOld [split [read $aFileOld] "\n"] + close $aFileOld + + # append empty line for proper comparison (which will be implicitly added by last puts below) + set aContent $theContent + lappend aContent "" + if { [osutils:isEqualContent $aLineListOld $aContent] == true } { + return false + } + + file delete -force "${theFile}" + } + + set anOutFile [open "$theFile" "w"] + fconfigure $anOutFile -translation $theEol + foreach aLine ${theContent} { + puts $anOutFile "${aLine}" + } + close $anOutFile + return true +} + +# Function re-generating header files for specified text resource +proc genResources { theResource } { + global path + + set aResFileList {} + set aResourceAbsPath [file normalize "${path}/src/${theResource}"] + set aResourceDirectory "" + set isResDirectory false + + if {[file isdirectory "${aResourceAbsPath}"]} { + if {[file exists "${aResourceAbsPath}/FILES"]} { + set aFilesFile [open "${aResourceAbsPath}/FILES" rb] + set aResFileList [split [read $aFilesFile] "\n"] + close $aFilesFile + } + set aResFileList [lsearch -inline -all -not -exact $aResFileList ""] + set aResourceDirectory "${theResource}" + set isResDirectory true + } else { + set aResourceName [file tail "${theResource}"] + lappend aResFileList "res:::${aResourceName}" + set aResourceDirectory [file dirname "${theResource}"] + } + + foreach aResFileIter ${aResFileList} { + if {![regexp {^[^:]+:::(.+)} "${aResFileIter}" dump aResFileIter]} { + continue + } + + set aResFileName [file tail "${aResFileIter}"] + regsub -all {\.} "${aResFileName}" {_} aResFileName + set aHeaderFileName "${aResourceDirectory}_${aResFileName}.pxx" + if { $isResDirectory == true && [lsearch $aResFileList $aHeaderFileName] == -1 } { + continue + } + + # generate + set aContent {} + lappend aContent "// This file has been automatically generated from resource file src/${aResourceDirectory}/${aResFileIter}" + lappend aContent "" + + # generate necessary structures + set aLineList {} + if {[file exists "${path}/src/${aResourceDirectory}/${aResFileIter}"]} { + set anInputFile [open "${path}/src/${aResourceDirectory}/${aResFileIter}" rb] + fconfigure $anInputFile -translation crlf + set aLineList [split [read $anInputFile] "\n"] + close $anInputFile + } + + # drop empty trailing line + set anEndOfFile "" + if { [lindex $aLineList end] == "" } { + set aLineList [lreplace $aLineList end end] + set anEndOfFile "\\n" + } + + lappend aContent "static const char ${aResourceDirectory}_${aResFileName}\[\] =" + set aNbLines [llength $aLineList] + set aLastLine [expr $aNbLines - 1] + for {set aLineIter 0} {$aLineIter < $aNbLines} {incr aLineIter} { + set aLine [lindex $aLineList $aLineIter] + regsub -all {\"} "${aLine}" {\\"} aLine + if { $aLineIter == $aLastLine } { + lappend aContent " \"${aLine}${anEndOfFile}\";" + } else { + lappend aContent " \"${aLine}\\n\"" + } + } + + # Save generated content to header file + set aHeaderFilePath "${path}/src/${aResourceDirectory}/${aHeaderFileName}" + if { [osutils:writeTextFile $aHeaderFilePath $aContent] == true } { + puts "Generating header file from resource file: ${path}/src/${aResourceDirectory}/${aResFileIter}" + } else { + #puts "Header file from resource ${path}/src/${aResourceDirectory}/${aResFileIter} is up-to-date" + } + } +} + +# Function re-generating header files for all text resources +proc genAllResources {} { + global path + set aCasRoot [file normalize $path] + if {![file exists "$aCasRoot/adm/RESOURCES"]} { + puts "OCCT directory is not defined correctly: $aCasRoot" + return + } + + set aFileResources [open "$aCasRoot/adm/RESOURCES" rb] + set anAdmResources [split [read $aFileResources] "\r\n"] + close $aFileResources + set anAdmResources [lsearch -inline -all -not -exact $anAdmResources ""] + + foreach line $anAdmResources { + genResources "${line}" + } +} + # Wrapper-function to generate VS project files proc genproj {theIDE args} { set aSupportedIDEs { "vc7" "vc8" "vc9" "vc10" "vc11" "vc12" "vc14" "cbp" "xcd" } @@ -193,6 +339,7 @@ proc genproj {theIDE args} { OS:MKPRC "$anAdmPath" "$theIDE" "$aLibType" "$aPlatform" "$aCmpl" genprojbat "$theIDE" $aPlatform + genAllResources } proc genprojbat {theIDE thePlatform} { @@ -676,7 +823,7 @@ proc osutils:collectinc {theModules theIncPath} { foreach aHeaderFile [concat [glob -nocomplain -dir $aCasRoot/src/$anUnit "*.\[hgl\]xx"] $aHFiles] { set aHeaderFileName [file tail $aHeaderFile] - regsub -all -- {@OCCT_HEADER_FILE@} $aHeaderTmpl "$aFromBuildIncToSrcPath/$anUnit/$aHeaderFileName" aShortCutHeaderFileContent + regsub -all -- {@OCCT_HEADER_FILE_CONTENT@} $aHeaderTmpl "#include \"$aFromBuildIncToSrcPath/$anUnit/$aHeaderFileName\"" aShortCutHeaderFileContent if {[file exists "$theIncPath/$aHeaderFileName"] && [file readable "$theIncPath/$aHeaderFileName"]} { set fp [open "$theIncPath/$aHeaderFileName" r] diff --git a/adm/templates/env.bat b/adm/templates/env.bat index 5ac65bcfe3..a8413147d3 100644 --- a/adm/templates/env.bat +++ b/adm/templates/env.bat @@ -137,8 +137,6 @@ set "CSF_PluginDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_XCAFDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_TObjDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_StandardLiteDefaults=%CSF_OCCTResourcePath%\StdResource" -set "CSF_UnitsLexicon=%CSF_OCCTResourcePath%\UnitsAPI\Lexi_Expr.dat" -set "CSF_UnitsDefinition=%CSF_OCCTResourcePath%\UnitsAPI\Units.dat" set "CSF_IGESDefaults=%CSF_OCCTResourcePath%\XSTEPResource" set "CSF_STEPDefaults=%CSF_OCCTResourcePath%\XSTEPResource" set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource" diff --git a/adm/templates/env.bat.in b/adm/templates/env.bat.in index 0820cdb8a0..c7990ea691 100644 --- a/adm/templates/env.bat.in +++ b/adm/templates/env.bat.in @@ -58,8 +58,6 @@ set "CSF_PluginDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_XCAFDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_TObjDefaults=%CSF_OCCTResourcePath%\StdResource" set "CSF_StandardLiteDefaults=%CSF_OCCTResourcePath%\StdResource" -set "CSF_UnitsLexicon=%CSF_OCCTResourcePath%\UnitsAPI\Lexi_Expr.dat" -set "CSF_UnitsDefinition=%CSF_OCCTResourcePath%\UnitsAPI\Units.dat" set "CSF_IGESDefaults=%CSF_OCCTResourcePath%\XSTEPResource" set "CSF_STEPDefaults=%CSF_OCCTResourcePath%\XSTEPResource" set "CSF_XmlOcafResource=%CSF_OCCTResourcePath%\XmlOcafResource" diff --git a/adm/templates/env.sh b/adm/templates/env.sh index 94e395c048..4298dec0b6 100644 --- a/adm/templates/env.sh +++ b/adm/templates/env.sh @@ -217,8 +217,6 @@ export CSF_PluginDefaults="${CASROOT}/src/StdResource" export CSF_XCAFDefaults="${CASROOT}/src/StdResource" export CSF_TObjDefaults="${CASROOT}/src/StdResource" export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource" -export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat" -export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat" export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource" export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource" export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource" diff --git a/adm/templates/env.sh.in b/adm/templates/env.sh.in index fb000d725f..613b32c3e1 100644 --- a/adm/templates/env.sh.in +++ b/adm/templates/env.sh.in @@ -114,8 +114,6 @@ export CSF_PluginDefaults="${CSF_OCCTResourcePath}/StdResource" export CSF_XCAFDefaults="${CSF_OCCTResourcePath}/StdResource" export CSF_TObjDefaults="${CSF_OCCTResourcePath}/StdResource" export CSF_StandardLiteDefaults="${CSF_OCCTResourcePath}/StdResource" -export CSF_UnitsLexicon="${CSF_OCCTResourcePath}/UnitsAPI/Lexi_Expr.dat" -export CSF_UnitsDefinition="${CSF_OCCTResourcePath}/UnitsAPI/Units.dat" export CSF_IGESDefaults="${CSF_OCCTResourcePath}/XSTEPResource" export CSF_STEPDefaults="${CSF_OCCTResourcePath}/XSTEPResource" export CSF_XmlOcafResource="${CSF_OCCTResourcePath}/XmlOcafResource" diff --git a/adm/templates/header.in b/adm/templates/header.in index f32e82fd4d..80c75f9cb8 100644 --- a/adm/templates/header.in +++ b/adm/templates/header.in @@ -1 +1 @@ -#include "@OCCT_HEADER_FILE@" +@OCCT_HEADER_FILE_CONTENT@ diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index 5e7f0f1d7c..9720f2f4a2 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -251,6 +251,7 @@ Porting of user applications from an earlier OCCT version to version 6.9.0 requi 3D Viewer now uses GLSL programs for managing frame buffer and stereoscopic output. For proper initialization, application should configure **CSF_ShadersDirectory** environment variable pointing to a folder with GLSL resources - files from folder **CASROOT**/src/Shaders. +*Note that **CSF_ShadersDirectory** become optional since OCCT 7.1.0 release*. @subsection upgrade_690_selection Changes in Selection @@ -1077,14 +1078,27 @@ The following obsolete features have been removed: Text resolution can be managed by rendering parameter *Graphic3d_RenderingParams::Resolution*, returned by *V3d_View::ChangeRenderingParams()*. * Methods PrsMgr_PresentationManager::BoundBox, PrsMgr_PresentationManager::Hilight and SelectMgr_EntityOwner::Hilight were removed as not used. Corresponding method in custom implementations of SelectMgr_EntityOwner can be removed safely. PrsMgr_PresentationManager::Color with corresponding style must be used instead of removed presentation manager's methods. +* Class *NCollection_QuickSort* has been removed. + The code that used the tools provided by that class should be corrected manually. + The recommended approach is to use sorting algorithms provided by STL. @subsection upgrade_occt710_correction_of_TObj_Model Correction in TObj_Model class Methods *TObj_Model::SaveAs* and *TObj_Model::Load* receive *TCollection_ExtendedString* filename arguments instead of char*. This shows that the filename may be not-ASCII explicitly. Also it makes OCAF API related to this functionality more conform. +@subsection upgrade_710_env Removed environment variables -@subsection upgrade_occt710_sorttools Removal of NCollection_QuickSort class +The following environment variables are now either become optional or have been removed: -Class *NCollection_QuickSort* has been removed. -The code that used the tools provided by that class should be corrected manually. -The recommended approach is to use sorting algorithms provided by STL. +* *CSF_UnitsLexicon* and *CSF_UnitsDefinition* are no more used. + Units definition (UnitsAPI/*Lexi_Expr.dat* and UnitsAPI/*Units.dat*) is now embedded into source code. +* *CSF_XSMessage* and *CSF_XHMessage* are now optional. + English messages (XSMessage/*XSTEP.us* and SHMessage/*SHAPE.us*) are now embedded into source code + and automatically loaded when environment variables are not set. +* *CSF_ShadersDirectory*. + Mandatory GLSL resources are now embedded into source code. + +Internally, embedded resource files are represented by .pxx (private) header files, +automatically (re)generated by *genproj* tool or by CMake with *BUILD_RESOURCES* option turned ON. +Since embedded resources are stored in OCCT git repository, they should be regenerated after modification of original text file before pushing patch for integration. +But since this option modifies source code, *BUILD_RESOURCES* option is disabled by default to avoid conflict with out-of-source build concept. diff --git a/dox/overview/overview.md b/dox/overview/overview.md index 2d5c3ff2ab..a6cb88379e 100644 --- a/dox/overview/overview.md +++ b/dox/overview/overview.md @@ -346,10 +346,9 @@ The scripts are located in the OCCT root folder. * **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception; * **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occured in Boolean operations will be saved; * **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping; - * **CSF_ShadersDirectory** defines the directory for GLSL programs (required for 3D viewer to work); - * **CSF_UnitsDefinition** and **CSF_UnitsLexicon** should define paths to resource files Lexi_Expr.dat and Units.dat, respectively (required for support of measurement units); - * **CSF_SHMessage** defines the path to the messages file for *ShapeHealing*; - * **CSF_XSMessage** defines the path to the messages file for **STEP** and **IGES** translators; + * **CSF_ShadersDirectory** (optional) defines the directory for GLSL programs for Ray Tracing renderer (embedded resources are used when variable is undefined); + * **CSF_SHMessage** (optional) defines the path to the messages file for *ShapeHealing*; + * **CSF_XSMessage** (optional) defines the path to the messages file for **STEP** and **IGES** translators; * **CSF_StandardDefaults**, **CSF_StandardLiteDefaults*, **CSF_XCAFDefaults**, and **CSF_PluginDefaults** define paths to directory where configuration files for OCAF persistence are located (required for open/save operations with OCAF documents); * **CSF_IGESDefaults** and **CSF_STEPDefaults** (optional) define paths to directory where resource files of **IGES** and **STEP** translators are located; * **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar. diff --git a/samples/java/jniviewer/jni/Android.mk b/samples/java/jniviewer/jni/Android.mk index c944ec8910..83547a22f8 100644 --- a/samples/java/jniviewer/jni/Android.mk +++ b/samples/java/jniviewer/jni/Android.mk @@ -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 diff --git a/samples/java/jniviewer/jni/OcctJni_Viewer.cxx b/samples/java/jniviewer/jni/OcctJni_Viewer.cxx index 5dd6c0483a..130203470a 100644 --- a/samples/java/jniviewer/jni/OcctJni_Viewer.cxx +++ b/samples/java/jniviewer/jni/OcctJni_Viewer.cxx @@ -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"); } // ======================================================================= diff --git a/src/Graphic3d/Graphic3d_ShaderProgram.cxx b/src/Graphic3d/Graphic3d_ShaderProgram.cxx index cd87a0d51b..ea8c479560 100755 --- a/src/Graphic3d/Graphic3d_ShaderProgram.cxx +++ b/src/Graphic3d/Graphic3d_ShaderProgram.cxx @@ -13,16 +13,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include -#include +#include #include #include -#include #include #include #include #include +#include IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ShaderProgram,Standard_Transient) @@ -31,7 +30,6 @@ namespace static volatile Standard_Integer THE_PROGRAM_OBJECT_COUNTER = 0; } - // ======================================================================= // function : ShadersFolder // purpose : @@ -57,9 +55,6 @@ const TCollection_AsciiString& Graphic3d_ShaderProgram::ShadersFolder() if (THE_SHADERS_FOLDER.IsEmpty()) { - std::cerr << "Both environment variables CSF_ShadersDirectory and CASROOT are undefined!\n" - << "At least one should be defined to use standard GLSL programs.\n"; - Standard_Failure::Raise ("CSF_ShadersDirectory and CASROOT are undefined"); return THE_SHADERS_FOLDER; } @@ -88,63 +83,15 @@ Graphic3d_ShaderProgram::Graphic3d_ShaderProgram() + TCollection_AsciiString (Standard_Atomic_Increment (&THE_PROGRAM_OBJECT_COUNTER)); } -// ======================================================================= -// function : Graphic3d_ShaderProgram -// purpose : -// ======================================================================= -Graphic3d_ShaderProgram::Graphic3d_ShaderProgram (const Graphic3d_ShaderProgram::ShaderName theName) -{ - const TCollection_AsciiString& aShadersRoot = Graphic3d_ShaderProgram::ShadersFolder(); - switch (theName) - { - case ShaderName_Phong: - { - myID = TCollection_AsciiString ("Graphic3d_ShaderProgram_Phong"); - const TCollection_AsciiString aSrcVert = aShadersRoot + "/PhongShading.vs"; - const TCollection_AsciiString aSrcFrag = aShadersRoot + "/PhongShading.fs"; - - if (!aSrcVert.IsEmpty() - && !OSD_File (aSrcVert).Exists()) - { - Standard_Failure::Raise ("Graphic3d_ShaderProgram, PhongShading.vs is not found"); - return; - } - if (!aSrcFrag.IsEmpty() - && !OSD_File (aSrcFrag).Exists()) - { - Standard_Failure::Raise ("Graphic3d_ShaderProgram, PhongShading.fs is not found"); - return; - } - - AttachShader (Graphic3d_ShaderObject::CreateFromFile (Graphic3d_TOS_VERTEX, aSrcVert)); - AttachShader (Graphic3d_ShaderObject::CreateFromFile (Graphic3d_TOS_FRAGMENT, aSrcFrag)); - break; - } - case ShaderName_UNKNOWN: - default: - { - Standard_Failure::Raise ("Graphic3d_ShaderProgram, unknown program name"); - break; - } - } -} - // ======================================================================= // function : ~Graphic3d_ShaderProgram // purpose : Releases resources of program object // ======================================================================= Graphic3d_ShaderProgram::~Graphic3d_ShaderProgram() { - Destroy(); + // } -// ======================================================================= -// function : Destroy -// purpose : Releases resources of program object -// ======================================================================= -void Graphic3d_ShaderProgram::Destroy() const -{ } - // ======================================================================= // function : IsDone // purpose : Checks if the program object is valid or not diff --git a/src/Graphic3d/Graphic3d_ShaderProgram.hxx b/src/Graphic3d/Graphic3d_ShaderProgram.hxx index 907f5ff048..5118e177ff 100755 --- a/src/Graphic3d/Graphic3d_ShaderProgram.hxx +++ b/src/Graphic3d/Graphic3d_ShaderProgram.hxx @@ -35,30 +35,14 @@ typedef NCollection_Sequence Graphic3d_Shader class Graphic3d_ShaderProgram : public Standard_Transient { -public: - - //! The list of built-in GLSL programs - enum ShaderName - { - ShaderName_UNKNOWN, //!< undefined program - ShaderName_Phong //!< per-pixel lighting (Phong shading) - }; - public: //! Creates new empty program object. Standard_EXPORT Graphic3d_ShaderProgram(); - //! Creates program object from pre-defined shaders. - //! Raises Standard_Failure exception if shader resources are unavailable. - Standard_EXPORT Graphic3d_ShaderProgram (const Graphic3d_ShaderProgram::ShaderName theName); - //! Releases resources of program object. Standard_EXPORT virtual ~Graphic3d_ShaderProgram(); - //! Releases resources of program object. - Standard_EXPORT void Destroy() const; - //! Checks if the program object is valid or not. Standard_EXPORT virtual Standard_Boolean IsDone() const; diff --git a/src/IGESData/IGESData.cxx b/src/IGESData/IGESData.cxx index aaa6813b5e..60f87c97e6 100644 --- a/src/IGESData/IGESData.cxx +++ b/src/IGESData/IGESData.cxx @@ -11,12 +11,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -// Integration to ensure SCCS base integrity -//#58 rln 28.12.98 changing default values for Global Section -//pdn 11.01.99 including for compilation on NT -//gka 19.01.99 changing date parameters and number of IGES version, adding parameter(ApllicationProtocol) -//#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000 and YYYYMMDD.HHMMSS after Y2000) - #include #include #include @@ -131,10 +125,6 @@ static Handle(IGESData_DefaultSpecific) speci; Interface_Static::Init ("XSTEP","write.iges.offset.mode",'&',"eval On"); Interface_Static::Init ("XSTEP","write.iges.offset.mode",'&',"eval Off"); Interface_Static::SetIVal ("write.iges.offset.mode",0); - // Message File for IGES - // ----------------- - - Message_MsgFile::LoadFromEnv ("CSF_XSMessage","IGES"); // Creating the Global Section //---------------------------- diff --git a/src/Interface/Interface_StaticStandards.cxx b/src/Interface/Interface_StaticStandards.cxx index 3229e183c9..ebba1c2bf1 100644 --- a/src/Interface/Interface_StaticStandards.cxx +++ b/src/Interface/Interface_StaticStandards.cxx @@ -11,16 +11,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//#74 rln 10.03.99 S4135: new parameters, values and default values -// gka 10.04.99 S4136: eliminate parameter 'lastpreci' -//S4181 pdn 23.04.99: adding new parameter handling writing of elementary surfaces #include + #include #include -//tatouage de la librairie #include + #include +#include "../XSMessage/XSMessage_XSTEP_us.pxx" static int deja = 0; @@ -88,33 +87,16 @@ void Interface_Static::Standards () // (0 pour dire : pas codee) //:S4136 Interface_Static::Init("std" ,"lastpreci", 'r',"0."); - -// **** MESSAGERIE DE BASE **** - -// Chargement "manuel" au cas ou les fichiers, env, etc sont KO - - Message_MsgFile::AddMsg ("XSTEP_1","Beginning of IGES file memory loading."); - Message_MsgFile::AddMsg ("XSTEP_2","File opening error"); - Message_MsgFile::AddMsg ("XSTEP_3","Reason : No such file or directory"); - Message_MsgFile::AddMsg ("XSTEP_4","Reason : Not enough space"); - Message_MsgFile::AddMsg ("XSTEP_5","Reason : Permission denied"); - Message_MsgFile::AddMsg ("XSTEP_6","Reason : Too many open files"); - Message_MsgFile::AddMsg ("XSTEP_7","Reason : Undetermined"); - Message_MsgFile::AddMsg ("XSTEP_8","End of loading IGES file to memory (Elapsed time : %s)."); - - Message_MsgFile::AddMsg ("XSTEP_11","Internal error during the file header reading. The process continues"); - Message_MsgFile::AddMsg ("XSTEP_13","Internal error during the reading of the entity %d"); - Message_MsgFile::AddMsg ("XSTEP_14","Internal error during the reading of the entity %d (parameter %d)"); - Message_MsgFile::AddMsg ("XSTEP_15","Total number of loaded entities : %d."); - Message_MsgFile::AddMsg ("XSTEP_16","Beginning of the model loading"); - Message_MsgFile::AddMsg ("XSTEP_17","End of the model loading"); - Message_MsgFile::AddMsg ("XSTEP_21","Number of ignored Null Entities : %d"); - Message_MsgFile::AddMsg ("XSTEP_22","Entity %s : unknown"); - Message_MsgFile::AddMsg ("XSTEP_23","Entity %s, Type %s : recovered"); - Message_MsgFile::AddMsg ("XSTEP_24","Report : %d unknown entities"); - Message_MsgFile::AddMsg ("XSTEP_25","Number of fail in memory loading : %d."); - Message_MsgFile::AddMsg ("XSTEP_26","Number of warning in memory loading : %d."); - -// Chargement du vrai fichier langue - Message_MsgFile::LoadFromEnv ("CSF_XSMessage","XSTEP"); + // load messages if needed + if (!Message_MsgFile::HasMsg ("XSTEP_1")) + { + if (!Message_MsgFile::LoadFromEnv ("CSF_XSMessage", "XSTEP")) + { + Message_MsgFile::LoadFromString (XSMessage_XSTEP_us, sizeof(XSMessage_XSTEP_us) - 1); + } + if (!Message_MsgFile::HasMsg ("XSTEP_1")) + { + Standard_ProgramError::Raise ("Critical Error - message resources for Interface_Static are invalid or undefined!"); + } + } } diff --git a/src/Message/Message_MsgFile.cxx b/src/Message/Message_MsgFile.cxx index 48320b8897..123822d3d9 100644 --- a/src/Message/Message_MsgFile.cxx +++ b/src/Message/Message_MsgFile.cxx @@ -271,35 +271,67 @@ Standard_Boolean Message_MsgFile::LoadFile (const Standard_CString theFileName) //======================================================================= //function : LoadFromEnv -//purpose : +//purpose : //======================================================================= -void Message_MsgFile::LoadFromEnv - (const Standard_CString envname, - const Standard_CString filename, - const Standard_CString ext) +Standard_Boolean Message_MsgFile::LoadFromEnv (const Standard_CString theEnvName, + const Standard_CString theFileName, + const Standard_CString theLangExt) { - Standard_CString extname = ext; - TCollection_AsciiString extstr; - if (!extname || extname[0] == '\0') { - OSD_Environment extenv("CSF_LANGUAGE"); - extstr = extenv.Value(); - extname = extstr.ToCString(); + TCollection_AsciiString aLangExt (theLangExt != NULL ? theLangExt : ""); + if (aLangExt.IsEmpty()) + { + OSD_Environment aLangEnv ("CSF_LANGUAGE"); + aLangExt = aLangEnv.Value(); + if (aLangExt.IsEmpty()) + { + aLangExt = "us"; + } } - if (!extname || extname[0] == '\0') extname = "us"; - - TCollection_AsciiString filestr(filename); - if (envname && envname[0] != '\0') { - OSD_Environment envenv(envname); - TCollection_AsciiString envstr = envenv.Value(); - if (envstr.Length() > 0) { - if (envstr.Value(envstr.Length()) != '/') filestr.Insert (1,'/'); - filestr.Insert (1,envstr.ToCString()); + + TCollection_AsciiString aFilePath (theFileName); + if (theEnvName != NULL + && theEnvName[0] != '\0') + { + OSD_Environment aNameEnv (theEnvName); + TCollection_AsciiString aNameEnvStr = aNameEnv.Value(); + if (!aNameEnvStr.IsEmpty()) + { + if (aNameEnvStr.Value (aNameEnvStr.Length()) != '/') + { + aFilePath.Insert (1, '/'); + } + aFilePath.Insert (1, aNameEnvStr); } } - if (extname[0] != '.') filestr.AssignCat ('.'); - filestr.AssignCat (extname); - Message_MsgFile::LoadFile (filestr.ToCString()); + if (aLangExt.Value (1) != '.') + { + aFilePath.AssignCat ('.'); + } + aFilePath.AssignCat (aLangExt); + + return Message_MsgFile::LoadFile (aFilePath.ToCString()); +} + +//======================================================================= +//function : LoadFromString +//purpose : +//======================================================================= +Standard_Boolean Message_MsgFile::LoadFromString (const Standard_CString theContent, + const Standard_Integer theLength) +{ + Standard_Integer aStringSize = theLength >= 0 ? theLength : (Standard_Integer )strlen (theContent); + NCollection_Buffer aBuffer (NCollection_BaseAllocator::CommonBaseAllocator()); + if (aStringSize <= 0 || !aBuffer.Allocate (aStringSize + 2)) + { + return Standard_False; + } + + memcpy (aBuffer.ChangeData(), theContent, aStringSize); + aBuffer.ChangeData()[aStringSize + 0] = '\0'; + aBuffer.ChangeData()[aStringSize + 1] = '\0'; + char* anMsgBuffer = reinterpret_cast(aBuffer.ChangeData()); + return ::loadFile (anMsgBuffer); } //======================================================================= diff --git a/src/Message/Message_MsgFile.hxx b/src/Message/Message_MsgFile.hxx index 8ec538c7fb..37fafa27c0 100644 --- a/src/Message/Message_MsgFile.hxx +++ b/src/Message/Message_MsgFile.hxx @@ -25,7 +25,6 @@ class TCollection_AsciiString; class TCollection_ExtendedString; - //! A tool providing facility to load definitions of message strings from //! resource file(s). //! @@ -67,14 +66,25 @@ public: //! are replaced with the new ones. Standard_EXPORT static Standard_Boolean LoadFile (const Standard_CString theFName); - //! Loads the messages from the file with name (without extension) - //! given by environment variable. - //! Extension of the file name is given separately. If its not - //! defined, it is taken: + //! Loads the messages from the file with name (without extension) given by environment variable. + //! Extension of the file name is given separately. If its not defined, it is taken: //! - by default from environment CSF_LANGUAGE, //! - if not defined either, as "us". - Standard_EXPORT static void LoadFromEnv (const Standard_CString envname, const Standard_CString filename, const Standard_CString ext = ""); - + //! @name theEnvName environment variable name + //! @name theFileName file name without language suffix + //! @name theLangExt language file name extension + //! @return TRUE on success + Standard_EXPORT static Standard_Boolean LoadFromEnv (const Standard_CString theEnvName, + const Standard_CString theFileName, + const Standard_CString theLangExt = ""); + + //! Loads the messages from the given text buffer. + //! @param theContent string containing the messages + //! @param theLength length of the buffer; + //! when -1 specified - theContent will be considered as NULL-terminated string + Standard_EXPORT static Standard_Boolean LoadFromString (const Standard_CString theContent, + const Standard_Integer theLength = -1); + //! Adds new message to the map. Parameter gives //! the key of the message, defines the message itself. //! If there already was defined the message identified by the diff --git a/src/OpenGl/OpenGl_ShaderProgram.cxx b/src/OpenGl/OpenGl_ShaderProgram.cxx index 6f501d1676..126b1e0981 100755 --- a/src/OpenGl/OpenGl_ShaderProgram.cxx +++ b/src/OpenGl/OpenGl_ShaderProgram.cxx @@ -28,6 +28,9 @@ #include +#include "../Shaders/Shaders_DeclarationsImpl_glsl.pxx" +#include "../Shaders/Shaders_Declarations_glsl.pxx" + #ifdef _WIN32 #include // for alloca() #endif @@ -146,33 +149,13 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize (const Handle(OpenGl_Context)& return Standard_False; } - OSD_File aDeclFile (Graphic3d_ShaderProgram::ShadersFolder() + "/Declarations.glsl"); - OSD_File aDeclImplFile (Graphic3d_ShaderProgram::ShadersFolder() + "/DeclarationsImpl.glsl"); - if (!aDeclFile.Exists() - || !aDeclImplFile.Exists()) - { - const TCollection_ExtendedString aMsg = "Error! Failed to load OCCT shader declarations file"; - theCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION, - GL_DEBUG_TYPE_ERROR, - 0, - GL_DEBUG_SEVERITY_HIGH, - aMsg); - return Standard_False; - } - TCollection_AsciiString aHeader = !myProxy.IsNull() && !myProxy->Header().IsEmpty() ? (myProxy->Header() + "\n") : TCollection_AsciiString(); - TCollection_AsciiString aDeclarations; - aDeclFile.Open (OSD_ReadOnly, OSD_Protection()); - aDeclFile.Read (aDeclarations, (int)aDeclFile.Size()); - aDeclFile.Close(); + TCollection_AsciiString aDeclarations = Shaders_Declarations_glsl; + TCollection_AsciiString aDeclImpl = Shaders_DeclarationsImpl_glsl; - TCollection_AsciiString aDeclImpl; - aDeclImplFile.Open (OSD_ReadOnly, OSD_Protection()); - aDeclImplFile.Read (aDeclImpl, (int)aDeclImplFile.Size()); - aDeclImplFile.Close(); aDeclarations += aDeclImpl; for (Graphic3d_ShaderObjectList::Iterator anIter (theShaders); diff --git a/src/OpenGl/OpenGl_View.hxx b/src/OpenGl/OpenGl_View.hxx index 6ccf454073..fbbe8cf1f2 100644 --- a/src/OpenGl/OpenGl_View.hxx +++ b/src/OpenGl/OpenGl_View.hxx @@ -659,7 +659,10 @@ protected: //! @name data types related to ray-tracing TCollection_AsciiString Source() const; //! Loads shader source from specified files. - Standard_Boolean Load (const TCollection_AsciiString* theFileNames, const TCollection_AsciiString& thePrefix = EMPTY_PREFIX); + Standard_Boolean LoadFromFiles (const TCollection_AsciiString* theFileNames, const TCollection_AsciiString& thePrefix = EMPTY_PREFIX); + + //! Loads shader source from specified strings. + Standard_Boolean LoadFromStrings (const TCollection_AsciiString* theStrings, const TCollection_AsciiString& thePrefix = EMPTY_PREFIX); private: diff --git a/src/OpenGl/OpenGl_View_Raytrace.cxx b/src/OpenGl/OpenGl_View_Raytrace.cxx index a7f64e28ab..fa43fb360d 100644 --- a/src/OpenGl/OpenGl_View_Raytrace.cxx +++ b/src/OpenGl/OpenGl_View_Raytrace.cxx @@ -22,6 +22,13 @@ #include #include +#include "../Shaders/Shaders_RaytraceBase_vs.pxx" +#include "../Shaders/Shaders_RaytraceBase_fs.pxx" +#include "../Shaders/Shaders_PathtraceBase_fs.pxx" +#include "../Shaders/Shaders_RaytraceRender_fs.pxx" +#include "../Shaders/Shaders_RaytraceSmooth_fs.pxx" +#include "../Shaders/Shaders_Display_fs.pxx" + using namespace OpenGl_Raytrace; //! Use this macro to output ray-tracing debug info @@ -1011,14 +1018,16 @@ TCollection_AsciiString OpenGl_View::ShaderSource::Source() const } // ======================================================================= -// function : Load +// function : LoadFromFiles // purpose : Loads shader source from specified files // ======================================================================= -Standard_Boolean OpenGl_View::ShaderSource::Load (const TCollection_AsciiString* theFileNames, - const TCollection_AsciiString& thePrefix) +Standard_Boolean OpenGl_View::ShaderSource::LoadFromFiles (const TCollection_AsciiString* theFileNames, + const TCollection_AsciiString& thePrefix) { myError.Clear(); mySource.Clear(); + myPrefix = thePrefix; + TCollection_AsciiString aMissingFiles; for (Standard_Integer anIndex = 0; !theFileNames[anIndex].IsEmpty(); ++anIndex) { @@ -1051,7 +1060,6 @@ Standard_Boolean OpenGl_View::ShaderSource::Load (const TCollection_AsciiString* aFile.Close(); } - myPrefix = thePrefix; if (!aMissingFiles.IsEmpty()) { myError = TCollection_AsciiString("Shader files ") + aMissingFiles + " are missing or inaccessible"; @@ -1060,6 +1068,28 @@ Standard_Boolean OpenGl_View::ShaderSource::Load (const TCollection_AsciiString* return Standard_True; } +// ======================================================================= +// function : LoadFromStrings +// purpose : +// ======================================================================= +Standard_Boolean OpenGl_View::ShaderSource::LoadFromStrings (const TCollection_AsciiString* theStrings, + const TCollection_AsciiString& thePrefix) +{ + myError.Clear(); + mySource.Clear(); + myPrefix = thePrefix; + + for (Standard_Integer anIndex = 0; !theStrings[anIndex].IsEmpty(); ++anIndex) + { + TCollection_AsciiString aSource = theStrings[anIndex]; + if (!aSource.IsEmpty()) + { + mySource += TCollection_AsciiString ("\n") + aSource; + } + } + return Standard_True; +} + // ======================================================================= // function : generateShaderPrefix // purpose : Generates shader prefix based on current ray-tracing options @@ -1411,13 +1441,7 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context myRaytraceParameters.NbBounces = myRenderParams.RaytracingDepth; - const TCollection_AsciiString aFolder = Graphic3d_ShaderProgram::ShadersFolder(); - - if (aFolder.IsEmpty()) - { - return safeFailBack ("Failed to locate shaders directory", theGlContext); - } - + const TCollection_AsciiString aShaderFolder = Graphic3d_ShaderProgram::ShadersFolder(); if (myIsRaytraceDataValid) { myRaytraceParameters.StackSize = Max (THE_DEFAULT_STACK_SIZE, @@ -1432,21 +1456,40 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context ShaderSource aBasicVertShaderSrc; { - TCollection_AsciiString aFiles[] = { aFolder + "/RaytraceBase.vs", "" }; - if (!aBasicVertShaderSrc.Load (aFiles)) + if (!aShaderFolder.IsEmpty()) { - return safeFailBack (aBasicVertShaderSrc.ErrorDescription(), theGlContext); + const TCollection_AsciiString aFiles[] = { aShaderFolder + "/RaytraceBase.vs", "" }; + if (!aBasicVertShaderSrc.LoadFromFiles (aFiles)) + { + return safeFailBack (aBasicVertShaderSrc.ErrorDescription(), theGlContext); + } + } + else + { + const TCollection_AsciiString aSrcShaders[] = { Shaders_RaytraceBase_vs, "" }; + aBasicVertShaderSrc.LoadFromStrings (aSrcShaders); } } { - TCollection_AsciiString aFiles[] = { aFolder + "/RaytraceBase.fs", - aFolder + "/PathtraceBase.fs", - aFolder + "/RaytraceRender.fs", - "" }; - if (!myRaytraceShaderSource.Load (aFiles, aPrefixString)) + if (!aShaderFolder.IsEmpty()) + { + const TCollection_AsciiString aFiles[] = { aShaderFolder + "/RaytraceBase.fs", + aShaderFolder + "/PathtraceBase.fs", + aShaderFolder + "/RaytraceRender.fs", + "" }; + if (!myRaytraceShaderSource.LoadFromFiles (aFiles, aPrefixString)) + { + return safeFailBack (myRaytraceShaderSource.ErrorDescription(), theGlContext); + } + } + else { - return safeFailBack (myRaytraceShaderSource.ErrorDescription(), theGlContext); + const TCollection_AsciiString aSrcShaders[] = { Shaders_RaytraceBase_fs, + Shaders_PathtraceBase_fs, + Shaders_RaytraceRender_fs, + "" }; + myRaytraceShaderSource.LoadFromStrings (aSrcShaders, aPrefixString); } Handle(OpenGl_ShaderObject) aBasicVertShader = initShader (GL_VERTEX_SHADER, aBasicVertShaderSrc, theGlContext); @@ -1470,12 +1513,18 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context } { - TCollection_AsciiString aFiles[] = { aFolder + "/RaytraceBase.fs", - aFolder + "/RaytraceSmooth.fs", - "" }; - if (!myPostFSAAShaderSource.Load (aFiles, aPrefixString)) + if (!aShaderFolder.IsEmpty()) + { + const TCollection_AsciiString aFiles[] = { aShaderFolder + "/RaytraceBase.fs", aShaderFolder + "/RaytraceSmooth.fs", "" }; + if (!myPostFSAAShaderSource.LoadFromFiles (aFiles, aPrefixString)) + { + return safeFailBack (myPostFSAAShaderSource.ErrorDescription(), theGlContext); + } + } + else { - return safeFailBack (myPostFSAAShaderSource.ErrorDescription(), theGlContext); + const TCollection_AsciiString aSrcShaders[] = { Shaders_RaytraceBase_fs, Shaders_RaytraceSmooth_fs, "" }; + myPostFSAAShaderSource.LoadFromStrings (aSrcShaders, aPrefixString); } Handle(OpenGl_ShaderObject) aBasicVertShader = initShader (GL_VERTEX_SHADER, aBasicVertShaderSrc, theGlContext); @@ -1499,10 +1548,18 @@ Standard_Boolean OpenGl_View::initRaytraceResources (const Handle(OpenGl_Context } { - TCollection_AsciiString aFiles[] = { aFolder + "/Display.fs", "" }; - if (!myOutImageShaderSource.Load (aFiles, aPrefixString)) + if (!aShaderFolder.IsEmpty()) + { + const TCollection_AsciiString aFiles[] = { aShaderFolder + "/Display.fs", "" }; + if (!myOutImageShaderSource.LoadFromFiles (aFiles, aPrefixString)) + { + return safeFailBack (myOutImageShaderSource.ErrorDescription(), theGlContext); + } + } + else { - return safeFailBack (myOutImageShaderSource.ErrorDescription(), theGlContext); + const TCollection_AsciiString aSrcShaders[] = { Shaders_Display_fs, "" }; + myOutImageShaderSource.LoadFromStrings (aSrcShaders, aPrefixString); } Handle(OpenGl_ShaderObject) aBasicVertShader = initShader (GL_VERTEX_SHADER, aBasicVertShaderSrc, theGlContext); diff --git a/src/SHMessage/FILES b/src/SHMessage/FILES index c2e796828e..d3fcbe42bd 100755 --- a/src/SHMessage/FILES +++ b/src/SHMessage/FILES @@ -1,2 +1,3 @@ msgfile:::SHAPE.fr msgfile:::SHAPE.us +SHMessage_SHAPE_us.pxx diff --git a/src/SHMessage/SHMessage_SHAPE_us.pxx b/src/SHMessage/SHMessage_SHAPE_us.pxx new file mode 100644 index 0000000000..d688889886 --- /dev/null +++ b/src/SHMessage/SHMessage_SHAPE_us.pxx @@ -0,0 +1,270 @@ +// This file has been automatically generated from resource file src/SHMessage/SHAPE.us + +static const char SHMessage_SHAPE_us[] = + "\n" + "! Message file for Shape Healing\n" + "\n" + "\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for shape names\n" + "!\n" + ".Name.Shape.MSG0\n" + "!\n" + ".Name.Vertex.MSG0\n" + "!\n" + ".Name.Edge.MSG0\n" + "!\n" + ".Name.Wire.MSG0\n" + "!\n" + ".Name.Face.MSG0\n" + "!\n" + ".Name.Shell.MSG0\n" + "!\n" + ".Name.Solid.MSG0\n" + "!\n" + ".Name.CompSolid.MSG0\n" + "!\n" + ".Name.Compound.MSG0\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for sequence of operators\n" + "! \n" + ".SP.Sequence.Info.Seq\n" + "Info: Shape Processing: Sequence of operators: %s\n" + "!\n" + ".SP.Sequence.Info.Operator\n" + "Info: Shape Processing: Operator %d/%d: %s\n" + "!\n" + ".SP.Sequence.Error.NoOp\n" + "Error: Shape Processing: Operator %s is not found\n" + "!\n" + ".SP.Sequence.Error.Except\n" + "Error: Shape Processing: Operator %s failed with exception %s\n" + "!\n" + ".SP.Sequence.Warn.NoSeq\n" + "Warning: Shape Processing: Sequence not defined for %s, nothing to do\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for printing results of shape processing\n" + "! \n" + ".PrResult.Print.MSG50\n" + " Shells:\n" + "!\n" + ".PrResult.Print.MSG55\n" + " Faces:\n" + "!\n" + ".PrResult.Print.MSG100\n" + "Mapping:\n" + "!\n" + ".PrResult.Print.MSG110\n" + " Result is Shell : %d\n" + "!\n" + ".PrResult.Print.MSG115\n" + " Result is Face : %d\n" + "!\n" + ".PrResult.Print.MSG150\n" + " No Result : %d\n" + "!\n" + ".PrResult.Print.MSG200\n" + "Preparation ratio:\n" + "!\n" + ".PrResult.Print.MSG205\n" + " Shells: %d per cent\n" + "!\n" + ".PrResult.Print.MSG210\n" + " Faces : %d per cent\n" + "!\n" + "! ==============================================================================\n" + "! Messages for Shape Healing\n" + "! \n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Wire\n" + "! \n" + ".FixWire.FixDegenerated.MSG0\n" + "Degenerated edge(s) detected\n" + "!\n" + ".FixWire.FixDegenerated.MSG5\n" + "Degenerated edge %d detected\n" + "!\n" + ".FixWire.FixCurve3d.Removed\n" + "Incomplete edge (with no pcurves or 3d curve) removed\n" + "!\n" + ".FixAdvWire.FixSmall.MSG0\n" + "Small edge(s) removed\n" + "! \n" + ".FixAdvWire.FixSmall.MSG5\n" + "Edge %d was small, removed\n" + "! \n" + ".FixAdvWire.FixIntersection.MSG0\n" + "Self-intersection corrected\n" + "!\n" + ".FixAdvWire.FixIntersection.MSG5\n" + "Edge was self-intersecting, corrected\n" + "!\n" + ".FixAdvWire.FixIntersection.MSG10\n" + "Edges were intersecting, corrected\n" + "!\n" + ".FixAdvWire.FixLacking.MSG0\n" + "Lacking edge(s) inserted\n" + "!\n" + ".FixAdvWire.FixLacking.MSG5\n" + "Lacking edge %d inserted\n" + "!\n" + ".FixAdvWire..MSG0\n" + "!\n" + ".FixAdvWire..MSG5\n" + "!\n" + ".FixAdvWire..MSG10\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Face\n" + "!\n" + ".FixAdvFace.FixMissingSeam.MSG0\n" + "Missing seam-edge added\n" + "!\n" + ".FixAdvFace.FixSmallAreaWire.MSG0\n" + "Null area wire detected, wire skipped\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG0\n" + "Face created with natural bounds\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG5\n" + "Wire on face was reversed\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG11\n" + "Cannot orient wire\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Wireframe\n" + "! \n" + ".FixWireframe.FixSmallEdges.MSG0\n" + "Small edge removed\n" + "!\n" + ".FixWireframe.FixSmallEdges.MSG1\n" + "Small wire removed\n" + "!\n" + ".FixWireframe.FixSmallEdges.MSG2\n" + "Small face removed\n" + "!\n" + ".FixWireframe.FixFixWireGaps.MSG0\n" + "Gaps in a wire fixed\n" + "!\n" + "!\n" + ".Fix.SplitCommonVertex.MSG0\n" + "Wires with common vertex fixed\n" + "!\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG20\n" + "Impossible to orient faces in shell, several shells created\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG30\n" + "Improperly connected shell split into parts\n" + "!\n" + ".FixAdvSolid.FixShell.MSG10\n" + "Solid cannot be created from an open shell\n" + "!\n" + ".FixAdvSolid.FixOrientation.MSG20\n" + "Orientation of shell(s) in solid was corrected\n" + "!\n" + ".FixAdvSolid.FixOrientation.MSG30\n" + "Improperly connected solid split into several parts\n" + "!\n" + ".FixAdvFace.FixLoopWire.MSG0\n" + "Wire was splitted on several wires\n" + "!\n" + ".FixAdvFace..MSG5\n" + "!\n" + ".FixAdvFace..MSG10\n" + "!\n" + ".FixEdge.SameParameter.MSG0\n" + "Not same parameter edge fixed\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_FixSmallFace\n" + "!\n" + ".FixAdvFace.FixSpotFace.MSG0\n" + "Spot face removed\n" + "!\n" + ".FixAdvFace.FixStripFace.MSG0\n" + "Strip face removed\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_FixSmallSolid\n" + "!\n" + ".ShapeFix.FixSmallSolid.MSG0\n" + "Small solid removed\n" + "!\n" + ".ShapeFix.FixSmallSolid.MSG1\n" + "Small solid merged with other\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Shell\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG0\n" + "Faces were incorrectly oriented in the shell, corrected\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG5\n" + "Faces were incorrectly oriented in the shell, not corrected\n" + "!\n" + ".FixAdvShell.FixClosedFlag.MSG0\n" + "Shell has incorrect flag isClosed\n" + "!\n" + ".FixAdvShell..MSG5\n" + "!\n" + ".FixAdvShell..MSG10\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeUpgrade\n" + "!\n" + ".ShapeDivide.FaceDivide.MSG0\n" + "Face divided\n" + "!\n" + ".ShapeDivide.WireDivide.MSG0\n" + "Wire divided\n" + "!\n" + ".ShapeDivide.EdgeDivide.MSG0\n" + "Edge divided\n" + "!\n" + ".ShapeDivide.FaceConvertToBezier.MSG0\n" + "Face converted to Bezier\n" + "!\n" + ".ShapeDivide.WireConvertToBezier.MSG0\n" + "Wire converted to Bezier\n" + "!\n" + ".ShapeDivide.EdgeConvertToBezier.MSG0\n" + "Edge converted to Bezier\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeCustom\n" + "!\n" + ".BSplineRestriction.NewSurface.MSG0\n" + "Face converted to BSpline\n" + "!\n" + ".BSplineRestriction.NewSurface.MSG1\n" + "BSpline Face re-approximated\n" + "!\n" + ".BSplineRestriction.NewCurve.MSG0\n" + "Edge converted to BSpline\n" + "!\n" + ".BSplineRestriction.NewCurve.MSG1\n" + "BSpline Edge re-approximated\n" + "!\n" + "!\n" + ".ConvertToBSpline.NewSurface.MSG0\n" + "Face converted to BSpline\n" + "!\n" + ".ConvertToBSpline.NewCurve.MSG0\n" + "Edge converted to BSpline\n" + "!\n" + "!\n" + ".ConvertToRevolution.NewSurface.MSG0\n" + "Face converted to surface of revolution\n" + "!\n" + "!\n" + ".DirectModification.NewSurface.MSG0\n" + "Direction of Face of revolution corrected\n" + "!\n" + "!\n" + ".SweptToElementary.NewSurface.MSG0\n" + "Swept Face converted to elementary\n" + "!\n"; diff --git a/src/Shaders/FILES b/src/Shaders/FILES index b31d1990ac..ebccc1e40b 100644 --- a/src/Shaders/FILES +++ b/src/Shaders/FILES @@ -2,3 +2,17 @@ srcinc:::Declarations.glsl srcinc:::DeclarationsImpl.glsl srcinc:::PhongShading.fs srcinc:::PhongShading.vs +srcinc:::Display.fs +srcinc:::RaytraceBase.fs +srcinc:::RaytraceRender.fs +srcinc:::PathtraceBase.fs +srcinc:::RaytraceBase.vs +srcinc:::RaytraceSmooth.fs +Shaders_Declarations_glsl.pxx +Shaders_DeclarationsImpl_glsl.pxx +Shaders_Display_fs.pxx +Shaders_RaytraceBase_fs.pxx +Shaders_RaytraceRender_fs.pxx +Shaders_PathtraceBase_fs.pxx +Shaders_RaytraceBase_vs.pxx +Shaders_RaytraceSmooth_fs.pxx diff --git a/src/Shaders/RaytraceBase.fs b/src/Shaders/RaytraceBase.fs index d5f9a80063..8eb42b324f 100644 --- a/src/Shaders/RaytraceBase.fs +++ b/src/Shaders/RaytraceBase.fs @@ -195,7 +195,7 @@ uint RandInt() // ======================================================================= // function : RandFloat -// purpose : Generates a random float in [0, 1) range +// purpose : Generates a random float in 0 <= x < 1 range // ======================================================================= float RandFloat() { diff --git a/src/Shaders/RaytraceRender.fs b/src/Shaders/RaytraceRender.fs index e2e493ffce..d852cf2dbd 100644 --- a/src/Shaders/RaytraceRender.fs +++ b/src/Shaders/RaytraceRender.fs @@ -111,4 +111,4 @@ void main (void) OutColor = clamp (Radiance (aRay, aInvDirect), 0.f, 1.f); #endif // PATH_TRACING -} \ No newline at end of file +} diff --git a/src/Shaders/RaytraceSmooth.fs b/src/Shaders/RaytraceSmooth.fs index 9b3f2413bb..16f4b4d2bb 100644 --- a/src/Shaders/RaytraceSmooth.fs +++ b/src/Shaders/RaytraceSmooth.fs @@ -77,4 +77,4 @@ void main (void) OutColor = aColor; #endif -} \ No newline at end of file +} diff --git a/src/Shaders/Shaders_DeclarationsImpl_glsl.pxx b/src/Shaders/Shaders_DeclarationsImpl_glsl.pxx new file mode 100644 index 0000000000..1d1c832086 --- /dev/null +++ b/src/Shaders/Shaders_DeclarationsImpl_glsl.pxx @@ -0,0 +1,61 @@ +// This file has been automatically generated from resource file src/Shaders/DeclarationsImpl.glsl + +static const char Shaders_DeclarationsImpl_glsl[] = + "// Created on: 2013-10-10\n" + "// Created by: Denis BOGOLEPOV\n" + "// Copyright (c) 2013-2014 OPEN CASCADE SAS\n" + "//\n" + "// This file is part of Open CASCADE Technology software library.\n" + "//\n" + "// This library is free software; you can redistribute it and/or modify it under\n" + "// the terms of the GNU Lesser General Public License version 2.1 as published\n" + "// by the Free Software Foundation, with special exception defined in the file\n" + "// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT\n" + "// distribution for complete text of the license and disclaimer of any warranty.\n" + "//\n" + "// Alternatively, this file may be used under the terms of Open CASCADE\n" + "// commercial license or contractual agreement.\n" + "\n" + "// This file includes implementation of common functions and properties accessors\n" + "\n" + "// arrays of light sources\n" + "uniform THE_PREC_ENUM ivec2 occLightSourcesTypes[THE_MAX_LIGHTS]; //!< packed light sources types\n" + "uniform vec4 occLightSources[THE_MAX_LIGHTS * 4]; //!< packed light sources parameters\n" + "\n" + "// light source properties accessors\n" + "int occLight_Type (in int theId) { return occLightSourcesTypes[theId].x; }\n" + "int occLight_IsHeadlight (in int theId) { return occLightSourcesTypes[theId].y; }\n" + "vec4 occLight_Diffuse (in int theId) { return occLightSources[theId * 4 + 0]; }\n" + "vec4 occLight_Specular (in int theId) { return occLightSources[theId * 4 + 0]; }\n" + "vec4 occLight_Position (in int theId) { return occLightSources[theId * 4 + 1]; }\n" + "vec4 occLight_SpotDirection (in int theId) { return occLightSources[theId * 4 + 2]; }\n" + "float occLight_ConstAttenuation (in int theId) { return occLightSources[theId * 4 + 3].x; }\n" + "float occLight_LinearAttenuation (in int theId) { return occLightSources[theId * 4 + 3].y; }\n" + "float occLight_SpotCutOff (in int theId) { return occLightSources[theId * 4 + 3].z; }\n" + "float occLight_SpotExponent (in int theId) { return occLightSources[theId * 4 + 3].w; }\n" + "\n" + "// material state\n" + "uniform vec4 occFrontMaterial[5];\n" + "uniform vec4 occBackMaterial[5];\n" + "\n" + "// front material properties accessors\n" + "vec4 occFrontMaterial_Ambient(void) { return occFrontMaterial[0]; }\n" + "vec4 occFrontMaterial_Diffuse(void) { return occFrontMaterial[1]; }\n" + "vec4 occFrontMaterial_Specular(void) { return occFrontMaterial[2]; }\n" + "vec4 occFrontMaterial_Emission(void) { return occFrontMaterial[3]; }\n" + "float occFrontMaterial_Shininess(void) { return occFrontMaterial[4].x; }\n" + "float occFrontMaterial_Transparency(void) { return occFrontMaterial[4].y; }\n" + "\n" + "// back material properties accessors\n" + "vec4 occBackMaterial_Ambient(void) { return occBackMaterial[0]; }\n" + "vec4 occBackMaterial_Diffuse(void) { return occBackMaterial[1]; }\n" + "vec4 occBackMaterial_Specular(void) { return occBackMaterial[2]; }\n" + "vec4 occBackMaterial_Emission(void) { return occBackMaterial[3]; }\n" + "float occBackMaterial_Shininess(void) { return occBackMaterial[4].x; }\n" + "float occBackMaterial_Transparency(void) { return occBackMaterial[4].y; }\n" + "\n" + "// 2D texture coordinates transformation\n" + "vec2 occTextureTrsf_Translation(void) { return occTexTrsf2d[0].xy; }\n" + "vec2 occTextureTrsf_Scale(void) { return occTexTrsf2d[0].zw; }\n" + "float occTextureTrsf_RotationSin(void) { return occTexTrsf2d[1].x; }\n" + "float occTextureTrsf_RotationCos(void) { return occTexTrsf2d[1].y; }\n"; diff --git a/src/Shaders/Shaders_Declarations_glsl.pxx b/src/Shaders/Shaders_Declarations_glsl.pxx new file mode 100644 index 0000000000..da738498f8 --- /dev/null +++ b/src/Shaders/Shaders_Declarations_glsl.pxx @@ -0,0 +1,118 @@ +// This file has been automatically generated from resource file src/Shaders/Declarations.glsl + +static const char Shaders_Declarations_glsl[] = + "// Created on: 2013-10-10\n" + "// Created by: Denis BOGOLEPOV\n" + "// Copyright (c) 2013-2014 OPEN CASCADE SAS\n" + "//\n" + "// This file is part of Open CASCADE Technology software library.\n" + "//\n" + "// This library is free software; you can redistribute it and/or modify it under\n" + "// the terms of the GNU Lesser General Public License version 2.1 as published\n" + "// by the Free Software Foundation, with special exception defined in the file\n" + "// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT\n" + "// distribution for complete text of the license and disclaimer of any warranty.\n" + "//\n" + "// Alternatively, this file may be used under the terms of Open CASCADE\n" + "// commercial license or contractual agreement.\n" + "\n" + "// This files includes definition of common uniform variables in OCCT GLSL programs\n" + "\n" + "#define THE_MAX_LIGHTS 8\n" + "#define THE_MAX_CLIP_PLANES 8\n" + "\n" + "// compatibility macros\n" + "#if (__VERSION__ >= 130)\n" + " #define THE_ATTRIBUTE in\n" + " #define THE_SHADER_IN in\n" + " #define THE_SHADER_OUT out\n" + " #define THE_OUT out\n" + " #define occTexture2D texture\n" + "#else\n" + " #define THE_ATTRIBUTE attribute\n" + " #define THE_SHADER_IN varying\n" + " #define THE_SHADER_OUT varying\n" + " #define THE_OUT\n" + " #define occTexture2D texture2D\n" + "#endif\n" + "\n" + "#ifdef GL_ES\n" + " #define THE_PREC_ENUM lowp // enumerations should fit into lowp range\n" + "#else\n" + " #define THE_PREC_ENUM\n" + "#endif\n" + "\n" + "// Vertex attributes\n" + "#ifdef VERTEX_SHADER\n" + " THE_ATTRIBUTE vec4 occVertex;\n" + " THE_ATTRIBUTE vec3 occNormal;\n" + " THE_ATTRIBUTE vec4 occTexCoord;\n" + " THE_ATTRIBUTE vec4 occVertColor;\n" + "#elif (__VERSION__ >= 130)\n" + " out vec4 occFragColor;\n" + "#else\n" + " #define occFragColor gl_FragColor\n" + "#endif\n" + "\n" + "// Matrix state\n" + "uniform mat4 occWorldViewMatrix; //!< World-view matrix\n" + "uniform mat4 occProjectionMatrix; //!< Projection matrix\n" + "uniform mat4 occModelWorldMatrix; //!< Model-world matrix\n" + "\n" + "uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix\n" + "uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix\n" + "uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix\n" + "\n" + "uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix\n" + "uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix\n" + "uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix\n" + "\n" + "uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix\n" + "uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix\n" + "uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix\n" + "\n" + "// light type enumeration\n" + "const int OccLightType_Direct = 1; //!< directional light source\n" + "const int OccLightType_Point = 2; //!< isotropic point light source\n" + "const int OccLightType_Spot = 3; //!< spot light source\n" + "\n" + "// Light sources\n" + "uniform vec4 occLightAmbient; //!< Cumulative ambient color\n" + "uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources\n" + "int occLight_Type (in int theId); //!< Type of light source\n" + "int occLight_IsHeadlight (in int theId); //!< Is light a headlight?\n" + "vec4 occLight_Diffuse (in int theId); //!< Diffuse intensity for specified light source\n" + "vec4 occLight_Specular (in int theId); //!< Specular intensity (currently - equals to diffuse intencity)\n" + "vec4 occLight_Position (in int theId); //!< Position of specified light source\n" + "vec4 occLight_SpotDirection (in int theId); //!< Direction of specified spot light source\n" + "float occLight_ConstAttenuation (in int theId); //!< Const attenuation factor of positional light source\n" + "float occLight_LinearAttenuation (in int theId); //!< Linear attenuation factor of positional light source\n" + "float occLight_SpotCutOff (in int theId); //!< Maximum spread angle of the spot light (in radians)\n" + "float occLight_SpotExponent (in int theId); //!< Attenuation of the spot light intensity (from 0 to 1)\n" + "\n" + "// Front material properties accessors\n" + "vec4 occFrontMaterial_Emission(void); //!< Emission color\n" + "vec4 occFrontMaterial_Ambient(void); //!< Ambient reflection\n" + "vec4 occFrontMaterial_Diffuse(void); //!< Diffuse reflection\n" + "vec4 occFrontMaterial_Specular(void); //!< Specular reflection\n" + "float occFrontMaterial_Shininess(void); //!< Specular exponent\n" + "float occFrontMaterial_Transparency(void); //!< Transparency coefficient\n" + "\n" + "// Back material properties accessors\n" + "vec4 occBackMaterial_Emission(void); //!< Emission color\n" + "vec4 occBackMaterial_Ambient(void); //!< Ambient reflection\n" + "vec4 occBackMaterial_Diffuse(void); //!< Diffuse reflection\n" + "vec4 occBackMaterial_Specular(void); //!< Specular reflection\n" + "float occBackMaterial_Shininess(void); //!< Specular exponent\n" + "float occBackMaterial_Transparency(void); //!< Transparency coefficient\n" + "\n" + "uniform vec4 occColor; //!< color value (in case of disabled lighting)\n" + "uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?\n" + "uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?\n" + "uniform sampler2D occActiveSampler; //!< Current active sampler\n" + "uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters\n" + "uniform float occPointSize; //!< point size\n" + "\n" + "//! Parameters of clipping planes\n" + "uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];\n" + "uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes\n"; diff --git a/src/Shaders/Shaders_Display_fs.pxx b/src/Shaders/Shaders_Display_fs.pxx new file mode 100644 index 0000000000..2685179e4a --- /dev/null +++ b/src/Shaders/Shaders_Display_fs.pxx @@ -0,0 +1,117 @@ +// This file has been automatically generated from resource file src/Shaders/Display.fs + +static const char Shaders_Display_fs[] = + "#ifdef ADAPTIVE_SAMPLING\n" + "\n" + " #extension GL_ARB_shader_image_load_store : require\n" + "\n" + " //! OpenGL image used for accumulating rendering result.\n" + " volatile restrict layout(size1x32) uniform image2D uRenderImage;\n" + "\n" + " //! OpenGL image storing variance of sampled pixels blocks.\n" + " volatile restrict layout(size1x32) uniform iimage2D uVarianceImage;\n" + "\n" + "#else // ADAPTIVE_SAMPLING\n" + "\n" + " //! Input image.\n" + " uniform sampler2D uInputTexture;\n" + "\n" + " //! Ray tracing depth image.\n" + " uniform sampler2D uDepthTexture;\n" + "\n" + "#endif // ADAPTIVE_SAMPLING\n" + "\n" + "//! Number of accumulated frames.\n" + "uniform int uAccumFrames;\n" + "\n" + "//! Is debug mode enabled for importance screen sampling.\n" + "uniform int uDebugAdaptive;\n" + "\n" + "//! Output pixel color.\n" + "out vec4 OutColor;\n" + "\n" + "//! RGB weight factors to calculate luminance.\n" + "#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)\n" + "\n" + "//! Scale factor used to quantize visual error.\n" + "#define SCALE_FACTOR 1.0e6f\n" + "\n" + "// =======================================================================\n" + "// function : main\n" + "// purpose :\n" + "// =======================================================================\n" + "void main (void)\n" + "{\n" + "#ifndef ADAPTIVE_SAMPLING\n" + "\n" + " vec4 aColor = texelFetch (uInputTexture, ivec2 (gl_FragCoord.xy), 0);\n" + "\n" + "#ifdef PATH_TRACING\n" + " float aDepth = aColor.w; // path tracing uses averaged depth\n" + "#else\n" + " float aDepth = texelFetch (uDepthTexture, ivec2 (gl_FragCoord.xy), 0).r;\n" + "#endif\n" + "\n" + " gl_FragDepth = aDepth;\n" + "\n" + "#else // ADAPTIVE_SAMPLING\n" + "\n" + " ivec2 aPixel = ivec2 (gl_FragCoord.xy);\n" + "\n" + " vec4 aColor = vec4 (0.0);\n" + "\n" + " // fetch accumulated color and total number of samples\n" + " aColor.x = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,\n" + " 2 * aPixel.y + 0)).x;\n" + " aColor.y = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,\n" + " 2 * aPixel.y + 0)).x;\n" + " aColor.z = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,\n" + " 2 * aPixel.y + 1)).x;\n" + " aColor.w = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,\n" + " 2 * aPixel.y + 1)).x;\n" + "\n" + " // calculate normalization factor\n" + " float aSampleWeight = 1.f / max (1.0, aColor.w);\n" + "\n" + " // calculate averaged depth value\n" + " gl_FragDepth = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,\n" + " 2 * aPixel.y + 1)).x * aSampleWeight;\n" + "\n" + " // calculate averaged radiance for all samples and even samples only\n" + " float aHalfRad = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,\n" + " 2 * aPixel.y + 0)).x * aSampleWeight * 2.f;\n" + "\n" + " float aAverRad = dot (aColor.rgb, LUMA) * aSampleWeight;\n" + "\n" + " // apply our 'tone mapping' operator (gamma correction and clamping)\n" + " aHalfRad = min (1.f, sqrt (aHalfRad));\n" + " aAverRad = min (1.f, sqrt (aAverRad));\n" + "\n" + " // calculate visual error\n" + " float anError = (aAverRad - aHalfRad) * (aAverRad - aHalfRad);\n" + "\n" + " // accumulate visual error to current block\n" + " imageAtomicAdd (uVarianceImage, ivec2 (aPixel / vec2 (BLOCK_SIZE)), int (anError * SCALE_FACTOR));\n" + "\n" + " if (uDebugAdaptive == 0) // normal rendering\n" + " {\n" + " aColor = vec4 (aColor.rgb * aSampleWeight, 1.0);\n" + " }\n" + " else // showing number of samples\n" + " {\n" + " aColor = vec4 (0.5f * aColor.rgb * aSampleWeight + vec3 (0.f, aColor.w / uAccumFrames * 0.35f, 0.f), 1.0);\n" + " }\n" + "\n" + "#endif // ADAPTIVE_SAMPLING\n" + "\n" + "#ifdef PATH_TRACING\n" + "\n" + " // apply gamma correction (we use gamma = 2)\n" + " OutColor = vec4 (sqrt (aColor.rgb), 0.f);\n" + "\n" + "#else // not PATH_TRACING\n" + "\n" + " OutColor = aColor;\n" + "\n" + "#endif\n" + "}\n"; diff --git a/src/Shaders/Shaders_PathtraceBase_fs.pxx b/src/Shaders/Shaders_PathtraceBase_fs.pxx new file mode 100644 index 0000000000..f75b065d50 --- /dev/null +++ b/src/Shaders/Shaders_PathtraceBase_fs.pxx @@ -0,0 +1,782 @@ +// This file has been automatically generated from resource file src/Shaders/PathtraceBase.fs + +static const char Shaders_PathtraceBase_fs[] = + "#ifdef PATH_TRACING\n" + "\n" + "///////////////////////////////////////////////////////////////////////////////////////\n" + "// Specific data types\n" + "\n" + "//! Describes local space at the hit point (visualization space).\n" + "struct SLocalSpace\n" + "{\n" + " //! Local X axis.\n" + " vec3 AxisX;\n" + "\n" + " //! Local Y axis.\n" + " vec3 AxisY;\n" + "\n" + " //! Local Z axis.\n" + " vec3 AxisZ;\n" + "};\n" + "\n" + "//! Describes material properties (BSDF).\n" + "struct SMaterial\n" + "{\n" + " //! Weight of the Lambertian BRDF.\n" + " vec4 Kd;\n" + "\n" + " //! Weight of the reflection BRDF.\n" + " vec3 Kr;\n" + "\n" + " //! Weight of the transmission BTDF.\n" + " vec3 Kt;\n" + "\n" + " //! Weight of the Blinn BRDF (and roughness).\n" + " vec4 Ks;\n" + "\n" + " //! Fresnel coefficients.\n" + " vec3 Fresnel;\n" + "\n" + " //! Absorption color and intensity of the media.\n" + " vec4 Absorption;\n" + "};\n" + "\n" + "///////////////////////////////////////////////////////////////////////////////////////\n" + "// Support subroutines\n" + "\n" + "//=======================================================================\n" + "// function : LocalSpace\n" + "// purpose : Generates local space for the given normal\n" + "//=======================================================================\n" + "SLocalSpace LocalSpace (in vec3 theNormal)\n" + "{\n" + " vec3 anAxisX = cross (vec3 (0.f, 1.f, 0.f), theNormal);\n" + " vec3 anAxisY = cross (vec3 (1.f, 0.f, 0.f), theNormal);\n" + "\n" + " float aSqrLenX = dot (anAxisX, anAxisX);\n" + " float aSqrLenY = dot (anAxisY, anAxisY);\n" + "\n" + " if (aSqrLenX > aSqrLenY)\n" + " {\n" + " anAxisX *= inversesqrt (aSqrLenX);\n" + " anAxisY = cross (anAxisX, theNormal);\n" + " }\n" + " else\n" + " {\n" + " anAxisY *= inversesqrt (aSqrLenY);\n" + " anAxisX = cross (anAxisY, theNormal);\n" + " }\n" + "\n" + " return SLocalSpace (anAxisX, anAxisY, theNormal);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : toLocalSpace\n" + "// purpose : Transforms the vector to local space from world space\n" + "//=======================================================================\n" + "vec3 toLocalSpace (in vec3 theVector, in SLocalSpace theSpace)\n" + "{\n" + " return vec3 (dot (theVector, theSpace.AxisX),\n" + " dot (theVector, theSpace.AxisY),\n" + " dot (theVector, theSpace.AxisZ));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : fromLocalSpace\n" + "// purpose : Transforms the vector from local space to world space\n" + "//=======================================================================\n" + "vec3 fromLocalSpace (in vec3 theVector, in SLocalSpace theSpace)\n" + "{\n" + " return theVector.x * theSpace.AxisX +\n" + " theVector.y * theSpace.AxisY +\n" + " theVector.z * theSpace.AxisZ;\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : convolve\n" + "// purpose : Performs a linear convolution of the vector components\n" + "//=======================================================================\n" + "float convolve (in vec3 theVector, in vec3 theFactor)\n" + "{\n" + " return dot (theVector, theFactor) * (1.f / max (theFactor.x + theFactor.y + theFactor.z, 1e-15f));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : sphericalDirection\n" + "// purpose : Constructs vector from spherical coordinates\n" + "//=======================================================================\n" + "vec3 sphericalDirection (in float theCosTheta, in float thePhi)\n" + "{\n" + " float aSinTheta = sqrt (1.f - theCosTheta * theCosTheta);\n" + "\n" + " return vec3 (aSinTheta * cos (thePhi),\n" + " aSinTheta * sin (thePhi),\n" + " theCosTheta);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : fresnelSchlick\n" + "// purpose : Computes the Fresnel reflection formula using\n" + "// Schlick's approximation.\n" + "//=======================================================================\n" + "vec3 fresnelSchlick (in float theCosI, in vec3 theSpecularColor)\n" + "{\n" + " return theSpecularColor + (UNIT - theSpecularColor) * pow (1.f - theCosI, 5.f);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : fresnelDielectric\n" + "// purpose : Computes the Fresnel reflection formula for dielectric in\n" + "// case of circularly polarized light (Based on PBRT code).\n" + "//=======================================================================\n" + "float fresnelDielectric (in float theCosI,\n" + " in float theCosT,\n" + " in float theEtaI,\n" + " in float theEtaT)\n" + "{\n" + " float aParl = (theEtaT * theCosI - theEtaI * theCosT) /\n" + " (theEtaT * theCosI + theEtaI * theCosT);\n" + "\n" + " float aPerp = (theEtaI * theCosI - theEtaT * theCosT) /\n" + " (theEtaI * theCosI + theEtaT * theCosT);\n" + "\n" + " return (aParl * aParl + aPerp * aPerp) * 0.5f;\n" + "}\n" + "\n" + "#define ENVIRONMENT_IOR 1.f\n" + "\n" + "//=======================================================================\n" + "// function : fresnelDielectric\n" + "// purpose : Computes the Fresnel reflection formula for dielectric in\n" + "// case of circularly polarized light (based on PBRT code)\n" + "//=======================================================================\n" + "float fresnelDielectric (in float theCosI, in float theIndex)\n" + "{\n" + " float anEtaI = theCosI > 0.f ? 1.f : theIndex;\n" + " float anEtaT = theCosI > 0.f ? theIndex : 1.f;\n" + "\n" + " float aSinT = (anEtaI / anEtaT) * sqrt (1.f - theCosI * theCosI);\n" + "\n" + " if (aSinT >= 1.f)\n" + " {\n" + " return 1.f;\n" + " }\n" + "\n" + " float aCosT = sqrt (1.f - aSinT * aSinT);\n" + "\n" + " return fresnelDielectric (abs (theCosI), aCosT, anEtaI, anEtaT);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : fresnelConductor\n" + "// purpose : Computes the Fresnel reflection formula for conductor in case\n" + "// of circularly polarized light (based on PBRT source code)\n" + "//=======================================================================\n" + "float fresnelConductor (in float theCosI, in float theEta, in float theK)\n" + "{\n" + " float aTmp = 2.f * theEta * theCosI;\n" + "\n" + " float aTmp1 = theEta * theEta + theK * theK;\n" + "\n" + " float aSPerp = (aTmp1 - aTmp + theCosI * theCosI) /\n" + " (aTmp1 + aTmp + theCosI * theCosI);\n" + "\n" + " float aTmp2 = aTmp1 * theCosI * theCosI;\n" + "\n" + " float aSParl = (aTmp2 - aTmp + 1.f) /\n" + " (aTmp2 + aTmp + 1.f);\n" + "\n" + " return (aSPerp + aSParl) * 0.5f;\n" + "}\n" + "\n" + "#define FRESNEL_SCHLICK -0.5f\n" + "#define FRESNEL_CONSTANT -1.5f\n" + "#define FRESNEL_CONDUCTOR -2.5f\n" + "#define FRESNEL_DIELECTRIC -3.5f\n" + "\n" + "//=======================================================================\n" + "// function : fresnelMedia\n" + "// purpose : Computes the Fresnel reflection formula for general medium\n" + "// in case of circularly polarized light.\n" + "//=======================================================================\n" + "vec3 fresnelMedia (in float theCosI, in vec3 theFresnelCoeffs)\n" + "{\n" + " if (theFresnelCoeffs.x > FRESNEL_SCHLICK)\n" + " {\n" + " return fresnelSchlick (abs (theCosI), theFresnelCoeffs);\n" + " }\n" + "\n" + " if (theFresnelCoeffs.x > FRESNEL_CONSTANT)\n" + " {\n" + " return vec3 (theFresnelCoeffs.z);\n" + " }\n" + "\n" + " if (theFresnelCoeffs.x > FRESNEL_CONDUCTOR)\n" + " {\n" + " return vec3 (fresnelConductor (abs (theCosI), theFresnelCoeffs.y, theFresnelCoeffs.z));\n" + " }\n" + "\n" + " return vec3 (fresnelDielectric (theCosI, theFresnelCoeffs.y));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : transmitted\n" + "// purpose : Computes transmitted direction in tangent space\n" + "// (in case of TIR returned result is undefined!)\n" + "//=======================================================================\n" + "void transmitted (in float theIndex, in vec3 theIncident, out vec3 theTransmit)\n" + "{\n" + " // Compute relative index of refraction\n" + " float anEta = (theIncident.z > 0.f) ? 1.f / theIndex : theIndex;\n" + "\n" + " // Handle total internal reflection for transmission\n" + " float aSinT2 = anEta * anEta * (1.f - theIncident.z * theIncident.z);\n" + "\n" + " // Compute transmitted ray direction\n" + " float aCosT = sqrt (1.f - min (aSinT2, 1.f)) * (theIncident.z > 0.f ? -1.f : 1.f);\n" + "\n" + " theTransmit = normalize (vec3 (-anEta * theIncident.x,\n" + " -anEta * theIncident.y,\n" + " aCosT));\n" + "}\n" + "\n" + "//////////////////////////////////////////////////////////////////////////////////////////////\n" + "// Handlers and samplers for materials\n" + "//////////////////////////////////////////////////////////////////////////////////////////////\n" + "\n" + "//=======================================================================\n" + "// function : handleLambertianReflection\n" + "// purpose : Handles Lambertian BRDF, with cos(N, PSI)\n" + "//=======================================================================\n" + "float handleLambertianReflection (in vec3 theInput, in vec3 theOutput)\n" + "{\n" + " return max (0.f, theInput.z) * (1.f / M_PI);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : handleBlinnReflection\n" + "// purpose : Handles Blinn glossy BRDF, with cos(N, PSI)\n" + "//=======================================================================\n" + "vec3 handleBlinnReflection (in vec3 theInput, in vec3 theOutput, in vec3 theFresnelCoeffs, in float theExponent)\n" + "{\n" + " vec3 aWeight = ZERO;\n" + "\n" + " // Compute half-angle vector\n" + " vec3 aHalf = theInput + theOutput;\n" + "\n" + " if (aHalf.z < 0.f)\n" + " aHalf = -aHalf;\n" + "\n" + " float aLength = dot (aHalf, aHalf);\n" + "\n" + " if (aLength <= 0.f)\n" + " return ZERO;\n" + "\n" + " aHalf *= inversesqrt (aLength);\n" + "\n" + " // Compute Fresnel reflectance\n" + " float aCosDelta = dot (theOutput, aHalf);\n" + "\n" + " vec3 aFresnel = fresnelMedia (aCosDelta, theFresnelCoeffs);\n" + "\n" + " // Compute fraction of microfacets that reflect light\n" + " float aCosThetaH = max (0.f, aHalf.z);\n" + "\n" + " float aFraction = (theExponent + 2.f) * (M_PI / 2.f) * pow (aCosThetaH, theExponent);\n" + "\n" + " // Compute geometry attenuation term (already includes cos)\n" + " float aCosThetaI = max (0.f, theInput.z);\n" + " float aCosThetaO = max (0.f, theOutput.z);\n" + "\n" + " float aGeom = min (1.f, 2.f * aCosThetaH / max (0.f, aCosDelta) * min (aCosThetaO, aCosThetaI));\n" + "\n" + " return aCosThetaO < 1.0e-3f ? ZERO :\n" + " aFraction * aGeom / (4.f * aCosThetaO) * aFresnel;\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : handleMaterial\n" + "// purpose : Returns BSDF value for specified material, with cos(N, PSI)\n" + "//=======================================================================\n" + "vec3 handleMaterial (in SMaterial theMaterial, in vec3 theInput, in vec3 theOutput)\n" + "{\n" + " return theMaterial.Kd.rgb * handleLambertianReflection (theInput, theOutput) +\n" + " theMaterial.Ks.rgb * handleBlinnReflection (theInput, theOutput, theMaterial.Fresnel, theMaterial.Ks.w);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : sampleLambertianReflection\n" + "// purpose : Samples Lambertian BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)\n" + "//=======================================================================\n" + "void sampleLambertianReflection (in vec3 theOutput, out vec3 theInput)\n" + "{\n" + " float aKsi1 = RandFloat();\n" + " float aKsi2 = RandFloat();\n" + "\n" + " float aTemp = sqrt (aKsi2);\n" + "\n" + " theInput = vec3 (aTemp * cos (2.f * M_PI * aKsi1),\n" + " aTemp * sin (2.f * M_PI * aKsi1),\n" + " sqrt (1.f - aKsi2));\n" + "\n" + " theInput.z = mix (-theInput.z, theInput.z, step (0.f, theOutput.z));\n" + "}\n" + "\n" + "// Types of bounces\n" + "#define NON_SPECULAR_BOUNCE 0\n" + "#define SPEC_REFLECT_BOUNCE 1\n" + "#define SPEC_REFRACT_BOUNCE 2\n" + "\n" + "#define IS_NON_SPEC_BOUNCE(theBounce) (theBounce == 0)\n" + "#define IS_ANY_SPEC_BOUNCE(theBounce) (theBounce != 0)\n" + "#define IS_REFL_SPEC_BOUNCE(theBounce) (theBounce == 1)\n" + "#define IS_REFR_SPEC_BOUNCE(theBounce) (theBounce == 2)\n" + "\n" + "//=======================================================================\n" + "// function : sampleSpecularTransmission\n" + "// purpose : Samples specular BTDF, W = BRDF * cos(N, PSI) / PDF(PSI)\n" + "//=======================================================================\n" + "vec3 sampleSpecularTransmission (in vec3 theOutput, out vec3 theInput,\n" + " out int theBounce, in vec3 theWeight, in vec3 theFresnelCoeffs)\n" + "{\n" + " vec3 aFresnel = fresnelMedia (theOutput.z, theFresnelCoeffs);\n" + "\n" + " float aProbability = convolve (aFresnel, theWeight);\n" + "\n" + " // Check if transmission takes place\n" + " theBounce = RandFloat() <= aProbability ?\n" + " SPEC_REFLECT_BOUNCE : SPEC_REFRACT_BOUNCE;\n" + "\n" + " // Sample input direction\n" + " if (theBounce == SPEC_REFLECT_BOUNCE)\n" + " {\n" + " theInput = vec3 (-theOutput.x,\n" + " -theOutput.y,\n" + " theOutput.z);\n" + "\n" + " theWeight = aFresnel * (1.f / aProbability);\n" + " }\n" + " else\n" + " {\n" + " transmitted (theFresnelCoeffs.y, theOutput, theInput);\n" + "\n" + " theWeight = (UNIT - aFresnel) * (1.f / (1.f - aProbability));\n" + " }\n" + "\n" + " return theWeight;\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : sampleSpecularReflection\n" + "// purpose : Samples specular BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)\n" + "//=======================================================================\n" + "vec3 sampleSpecularReflection (in vec3 theOutput, out vec3 theInput, in vec3 theFresnelCoeffs)\n" + "{\n" + " // Sample input direction\n" + " theInput = vec3 (-theOutput.x,\n" + " -theOutput.y,\n" + " theOutput.z);\n" + "\n" + " return fresnelMedia (theOutput.z, theFresnelCoeffs);\n" + "}\n" + "\n" + "#define MIN_COS 1.0e-20f\n" + "\n" + "//=======================================================================\n" + "// function : sampleBlinnReflection\n" + "// purpose : Samples Blinn BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)\n" + "// The BRDF is a product of three main terms, D, G, and F,\n" + "// which is then divided by two cosine terms. Here we perform\n" + "// importance sample the D part of the Blinn model; trying to\n" + "// develop a sampling procedure that accounted for all of the\n" + "// terms would be complex, and it is the D term that accounts\n" + "// for most of the variation.\n" + "//=======================================================================\n" + "vec3 sampleBlinnReflection (in vec3 theOutput, out vec3 theInput, in vec3 theFresnelCoeffs, in float theExponent)\n" + "{\n" + " vec3 aWeight = ZERO;\n" + "\n" + " // Generate two random variables\n" + " float aKsi1 = RandFloat();\n" + " float aKsi2 = RandFloat();\n" + "\n" + " // Compute sampled half-angle vector for Blinn distribution\n" + " float aCosThetaH = pow (aKsi1, 1.f / (theExponent + 1.f));\n" + "\n" + " vec3 aHalf = sphericalDirection (aCosThetaH, aKsi2 * 2.f * M_PI);\n" + "\n" + " if (aHalf.z < 0)\n" + " {\n" + " aHalf = -aHalf;\n" + " }\n" + "\n" + " // Compute incident direction by reflecting about half-vector\n" + " float aCosDelta = dot (theOutput, aHalf);\n" + "\n" + " vec3 anInput = 2.f * aCosDelta * aHalf - theOutput;\n" + "\n" + " if (theOutput.z * anInput.z <= 0.f)\n" + " {\n" + " return ZERO;\n" + " }\n" + "\n" + " theInput = anInput;\n" + "\n" + " // Compute Fresnel reflectance\n" + " vec3 aFresnel = fresnelMedia (aCosDelta, theFresnelCoeffs);\n" + "\n" + " // Compute geometry attenuation term\n" + " float aCosThetaI = max (MIN_COS, theInput.z);\n" + " float aCosThetaO = max (MIN_COS, theOutput.z);\n" + "\n" + " float aGeom = min (max (MIN_COS, aCosDelta), 2.f * aCosThetaH * min (aCosThetaO, aCosThetaI));\n" + "\n" + " // Compute weight of the ray sample\n" + " return aFresnel * ((theExponent + 2.f) / (theExponent + 1.f) * aGeom / aCosThetaO);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : sampleMaterial\n" + "// purpose : Samples specified composite material (BSDF)\n" + "//=======================================================================\n" + "void sampleMaterial (in SMaterial theMaterial,\n" + " in vec3 theOutput,\n" + " out vec3 theInput,\n" + " inout vec3 theWeight,\n" + " inout int theBounce)\n" + "{\n" + " // Compute the probability of ray reflection\n" + " float aPd = convolve (theMaterial.Kd.rgb, theWeight);\n" + " float aPs = convolve (theMaterial.Ks.rgb, theWeight);\n" + " float aPr = convolve (theMaterial.Kr.rgb, theWeight);\n" + " float aPt = convolve (theMaterial.Kt.rgb, theWeight);\n" + "\n" + " float aReflection = aPd + aPs + aPr + aPt;\n" + "\n" + " // Choose BSDF component to sample\n" + " float aKsi = aReflection * RandFloat();\n" + "\n" + " theBounce = NON_SPECULAR_BOUNCE;\n" + "\n" + " if (aKsi < aPd) // diffuse reflection\n" + " {\n" + " sampleLambertianReflection (theOutput, theInput);\n" + "\n" + " theWeight *= theMaterial.Kd.rgb * (aReflection / aPd);\n" + " }\n" + " else if (aKsi < aPd + aPs) // glossy reflection\n" + " {\n" + " theWeight *= theMaterial.Ks.rgb * (aReflection / aPs) *\n" + " sampleBlinnReflection (theOutput, theInput, theMaterial.Fresnel, theMaterial.Ks.w);\n" + " }\n" + " else if (aKsi < aPd + aPs + aPr) // specular reflection\n" + " {\n" + " theWeight *= theMaterial.Kr.rgb * (aReflection / aPr) *\n" + " sampleSpecularReflection (theOutput, theInput, theMaterial.Fresnel);\n" + "\n" + " theBounce = SPEC_REFLECT_BOUNCE; // specular bounce\n" + " }\n" + " else // specular transmission\n" + " {\n" + " theWeight *= theMaterial.Kt.rgb * (aReflection / aPt) *\n" + " sampleSpecularTransmission (theOutput, theInput, theBounce, theWeight, theMaterial.Fresnel);\n" + " }\n" + "\n" + " // path termination for extra small weights\n" + " theWeight = mix (theWeight, ZERO, float (aReflection < 1e-3f));\n" + "}\n" + "\n" + "//////////////////////////////////////////////////////////////////////////////////////////////\n" + "// Handlers and samplers for light sources\n" + "//////////////////////////////////////////////////////////////////////////////////////////////\n" + "\n" + "//=======================================================================\n" + "// function : handlePointLight\n" + "// purpose :\n" + "//=======================================================================\n" + "float handlePointLight (in vec3 theInput, in vec3 theToLight, in float theRadius, in float theDistance)\n" + "{\n" + " float aDistance = dot (theToLight, theToLight);\n" + "\n" + " float aCosMax = inversesqrt (1.f + theRadius * theRadius / aDistance);\n" + "\n" + " return float (aDistance < theDistance * theDistance) *\n" + " step (aCosMax, dot (theToLight, theInput) * inversesqrt (aDistance));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : handleDirectLight\n" + "// purpose :\n" + "//=======================================================================\n" + "float handleDirectLight (in vec3 theInput, in vec3 theToLight, in float theCosMax)\n" + "{\n" + " return step (theCosMax, dot (theInput, theToLight));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : sampleLight\n" + "// purpose : General sampling function for directional and point lights\n" + "//=======================================================================\n" + "vec3 sampleLight (in vec3 theToLight, inout float theDistance, in bool isInfinite, in float theSmoothness, inout float thePDF)\n" + "{\n" + " SLocalSpace aSpace = LocalSpace (theToLight * (1.f / theDistance));\n" + "\n" + " // for point lights smoothness defines radius\n" + " float aCosMax = isInfinite ? theSmoothness :\n" + " inversesqrt (1.f + theSmoothness * theSmoothness / (theDistance * theDistance));\n" + "\n" + " float aKsi1 = RandFloat();\n" + " float aKsi2 = RandFloat();\n" + "\n" + " float aTmp = 1.f - aKsi2 * (1.f - aCosMax);\n" + "\n" + " vec3 anInput = vec3 (cos (2.f * M_PI * aKsi1),\n" + " sin (2.f * M_PI * aKsi1),\n" + " aTmp);\n" + "\n" + " anInput.xy *= sqrt (1.f - aTmp * aTmp);\n" + "\n" + " thePDF *= (aCosMax < 1.f) ? 1.f / (2.f * M_PI) / (1.f - aCosMax) : 1.f;\n" + "\n" + " return normalize (fromLocalSpace (anInput, aSpace));\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : Latlong\n" + "// purpose : Converts world direction to environment texture coordinates\n" + "// =======================================================================\n" + "vec2 Latlong (in vec3 thePoint)\n" + "{\n" + " float aPsi = acos (-thePoint.z);\n" + "\n" + " float aPhi = atan (thePoint.y, thePoint.x) + M_PI;\n" + "\n" + " return vec2 (aPhi * 0.1591549f,\n" + " aPsi * 0.3183098f);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function: intersectLight\n" + "// purpose : Checks intersections with light sources\n" + "// =======================================================================\n" + "vec3 intersectLight (in SRay theRay, in bool isViewRay, in int theBounce, in float theDistance)\n" + "{\n" + " vec3 aRadiance = ZERO;\n" + "\n" + " if ((isViewRay || IS_REFR_SPEC_BOUNCE(theBounce)) && uSphereMapForBack == 0)\n" + " {\n" + " aRadiance = BackgroundColor().xyz;\n" + " }\n" + " else\n" + " {\n" + " aRadiance = FetchEnvironment (Latlong (theRay.Direct)).xyz;\n" + " }\n" + "\n" + " // Apply gamma correction (gamma is 2)\n" + " aRadiance = aRadiance * aRadiance * float (theDistance == MAXFLOAT);\n" + "\n" + " for (int aLightIdx = 0; aLightIdx < uLightCount && (isViewRay || IS_ANY_SPEC_BOUNCE(theBounce)); ++aLightIdx)\n" + " {\n" + " vec4 aLight = texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));\n" + " vec4 aParam = texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));\n" + "\n" + " if (aLight.w != 0.f) // point light source\n" + " {\n" + " aRadiance += aParam.rgb * handlePointLight (\n" + " theRay.Direct, aLight.xyz - theRay.Origin, aParam.w /* radius */, theDistance);\n" + " }\n" + " else if (theDistance == MAXFLOAT) // directional light source\n" + " {\n" + " aRadiance += aParam.rgb * handleDirectLight (theRay.Direct, aLight.xyz, aParam.w /* angle cosine */);\n" + " }\n" + " }\n" + "\n" + " return aRadiance;\n" + "}\n" + "\n" + "#define MIN_THROUGHPUT vec3 (0.02f)\n" + "#define MIN_CONTRIBUTION vec3 (0.01f)\n" + "\n" + "#define MATERIAL_KD(index) (18 * index + 11)\n" + "#define MATERIAL_KR(index) (18 * index + 12)\n" + "#define MATERIAL_KT(index) (18 * index + 13)\n" + "#define MATERIAL_KS(index) (18 * index + 14)\n" + "#define MATERIAL_LE(index) (18 * index + 15)\n" + "#define MATERIAL_FRESNEL(index) (18 * index + 16)\n" + "#define MATERIAL_ABSORPT(index) (18 * index + 17)\n" + "\n" + "// Enables expiremental russian roulette sampling\n" + "#define RUSSIAN_ROULETTE\n" + "\n" + "//=======================================================================\n" + "// function : PathTrace\n" + "// purpose : Calculates radiance along the given ray\n" + "//=======================================================================\n" + "vec4 PathTrace (in SRay theRay, in vec3 theInverse)\n" + "{\n" + " float aRaytraceDepth = MAXFLOAT;\n" + "\n" + " vec3 aRadiance = ZERO;\n" + " vec3 aThroughput = UNIT;\n" + "\n" + " int aBounce = 0; // type of previous hit point\n" + " int aTrsfId = 0; // offset of object transform\n" + "\n" + " bool isInMedium = false;\n" + "\n" + " for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)\n" + " {\n" + " SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);\n" + "\n" + " ivec4 aTriIndex = SceneNearestHit (theRay, theInverse, aHit, aTrsfId);\n" + "\n" + " // check implicit path\n" + " vec3 aLe = intersectLight (theRay,\n" + " aDepth == 0 /* is view ray */, aBounce, aHit.Time);\n" + "\n" + " if (any (greaterThan (aLe, ZERO)) || aTriIndex.x == -1)\n" + " {\n" + " aRadiance += aThroughput * aLe; break; // terminate path\n" + " }\n" + "\n" + " vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTrsfId + 0).xyz;\n" + " vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTrsfId + 1).xyz;\n" + " vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTrsfId + 2).xyz;\n" + "\n" + " // compute geometrical normal\n" + " aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),\n" + " dot (aInvTransf1, aHit.Normal),\n" + " dot (aInvTransf2, aHit.Normal)));\n" + "\n" + " theRay.Origin += theRay.Direct * aHit.Time; // get new intersection point\n" + "\n" + " // Evaluate depth on first hit\n" + " if (aDepth == 0)\n" + " {\n" + " vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);\n" + "\n" + " float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);\n" + " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;\n" + " }\n" + "\n" + " // fetch material (BSDF)\n" + " SMaterial aMaterial = SMaterial (\n" + " vec4 (texelFetch (uRaytraceMaterialTexture, MATERIAL_KD (aTriIndex.w))),\n" + " vec3 (texelFetch (uRaytraceMaterialTexture, MATERIAL_KR (aTriIndex.w))),\n" + " vec3 (texelFetch (uRaytraceMaterialTexture, MATERIAL_KT (aTriIndex.w))),\n" + " vec4 (texelFetch (uRaytraceMaterialTexture, MATERIAL_KS (aTriIndex.w))),\n" + " vec3 (texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL (aTriIndex.w))),\n" + " vec4 (texelFetch (uRaytraceMaterialTexture, MATERIAL_ABSORPT (aTriIndex.w))));\n" + "\n" + "#ifdef USE_TEXTURES\n" + " if (aMaterial.Kd.w >= 0.f)\n" + " {\n" + " vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);\n" + "\n" + " vec4 aTrsfRow1 = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));\n" + " vec4 aTrsfRow2 = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));\n" + "\n" + " aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),\n" + " dot (aTrsfRow2, aTexCoord));\n" + "\n" + " vec3 aTexColor = textureLod (\n" + " sampler2D (uTextureSamplers[int (aMaterial.Kd.w)]), aTexCoord.st, 0.f).rgb;\n" + "\n" + " aMaterial.Kd.rgb *= aTexColor * aTexColor; // de-gamma correction (for gamma = 2)\n" + " }\n" + "#endif\n" + "\n" + " // compute smooth normal\n" + " vec3 aNormal = SmoothNormal (aHit.UV, aTriIndex);\n" + "\n" + " aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),\n" + " dot (aInvTransf1, aNormal),\n" + " dot (aInvTransf2, aNormal)));\n" + "\n" + " SLocalSpace aSpace = LocalSpace (aNormal);\n" + "\n" + " // account for self-emission (not stored in the material)\n" + " aRadiance += aThroughput * texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_LE (aTriIndex.w)).rgb;\n" + "\n" + " if (uLightCount > 0 && convolve (aMaterial.Kd.rgb + aMaterial.Ks.rgb, aThroughput) > 0.f)\n" + " {\n" + " int aLightIdx = min (int (floor (RandFloat() * uLightCount)), uLightCount - 1);\n" + "\n" + " vec4 aLight = texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));\n" + " vec4 aParam = texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));\n" + "\n" + " // 'w' component is 0 for infinite light and 1 for point light\n" + " aLight.xyz -= mix (ZERO, theRay.Origin, aLight.w);\n" + "\n" + " float aPDF = 1.f / uLightCount, aDistance = length (aLight.xyz);\n" + "\n" + " aLight.xyz = sampleLight (aLight.xyz, aDistance,\n" + " aLight.w == 0.f /* is infinite */, aParam.w /* max cos or radius */, aPDF);\n" + "\n" + " vec3 aContrib = (1.f / aPDF) * aParam.rgb /* Le */ * handleMaterial (\n" + " aMaterial, toLocalSpace (aLight.xyz, aSpace), toLocalSpace (-theRay.Direct, aSpace));\n" + "\n" + " if (any (greaterThan (aContrib, MIN_CONTRIBUTION))) // first check if light source is important\n" + " {\n" + " SRay aShadow = SRay (theRay.Origin + aLight.xyz * uSceneEpsilon, aLight.xyz);\n" + "\n" + " aShadow.Origin += aHit.Normal * mix (\n" + " -uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, aLight.xyz)));\n" + "\n" + " float aVisibility = SceneAnyHit (aShadow,\n" + " InverseDirection (aLight.xyz), aLight.w == 0.f ? MAXFLOAT : aDistance);\n" + "\n" + " aRadiance += aVisibility * aThroughput * aContrib;\n" + " }\n" + " }\n" + "\n" + " vec3 anInput;\n" + "\n" + " sampleMaterial (aMaterial,\n" + " toLocalSpace (-theRay.Direct, aSpace), anInput, aThroughput, aBounce);\n" + "\n" + " if (isInMedium)\n" + " {\n" + " aThroughput *= exp (-aHit.Time *\n" + " aMaterial.Absorption.w * (UNIT - aMaterial.Absorption.rgb));\n" + " }\n" + "\n" + " isInMedium = IS_REFR_SPEC_BOUNCE(aBounce) ? !isInMedium : isInMedium;\n" + "\n" + "#ifndef RUSSIAN_ROULETTE\n" + " if (all (lessThan (aThroughput, MIN_THROUGHPUT)))\n" + " {\n" + " aDepth = INVALID_BOUNCES; // terminate path\n" + " }\n" + "#else\n" + " float aSurvive = aDepth < 3 ? 1.f : min (dot (LUMA, aThroughput), 0.95f);\n" + "\n" + " if (RandFloat() > aSurvive)\n" + " {\n" + " aDepth = INVALID_BOUNCES; // terminate path\n" + " }\n" + "\n" + " aThroughput /= aSurvive;\n" + "#endif\n" + "\n" + " anInput = normalize (fromLocalSpace (anInput, aSpace));\n" + "\n" + " theRay = SRay (theRay.Origin + anInput * uSceneEpsilon +\n" + " aHit.Normal * mix (-uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, anInput))), anInput);\n" + "\n" + " theInverse = InverseDirection (anInput);\n" + " }\n" + "\n" + " gl_FragDepth = aRaytraceDepth;\n" + "\n" + " return vec4 (aRadiance, aRaytraceDepth);\n" + "}\n" + "\n" + "#endif\n"; diff --git a/src/Shaders/Shaders_RaytraceBase_fs.pxx b/src/Shaders/Shaders_RaytraceBase_fs.pxx new file mode 100644 index 0000000000..a1578f72a1 --- /dev/null +++ b/src/Shaders/Shaders_RaytraceBase_fs.pxx @@ -0,0 +1,1085 @@ +// This file has been automatically generated from resource file src/Shaders/RaytraceBase.fs + +static const char Shaders_RaytraceBase_fs[] = + "#ifdef ADAPTIVE_SAMPLING\n" + " #extension GL_ARB_shader_image_load_store : require\n" + " #extension GL_NV_shader_atomic_float : require\n" + "#endif\n" + "\n" + "#ifdef USE_TEXTURES\n" + " #extension GL_ARB_bindless_texture : require\n" + "#endif\n" + "\n" + "//! Normalized pixel coordinates.\n" + "in vec2 vPixel;\n" + "\n" + "//! Sub-pixel offset in X direction for FSAA.\n" + "uniform float uOffsetX = 0.f;\n" + "//! Sub-pixel offset in Y direction for FSAA.\n" + "uniform float uOffsetY = 0.f;\n" + "\n" + "//! Origin of viewing ray in left-top corner.\n" + "uniform vec3 uOriginLT;\n" + "//! Origin of viewing ray in left-bottom corner.\n" + "uniform vec3 uOriginLB;\n" + "//! Origin of viewing ray in right-top corner.\n" + "uniform vec3 uOriginRT;\n" + "//! Origin of viewing ray in right-bottom corner.\n" + "uniform vec3 uOriginRB;\n" + "\n" + "//! Width of the rendering window.\n" + "uniform int uWinSizeX;\n" + "//! Height of the rendering window.\n" + "uniform int uWinSizeY;\n" + "\n" + "//! Direction of viewing ray in left-top corner.\n" + "uniform vec3 uDirectLT;\n" + "//! Direction of viewing ray in left-bottom corner.\n" + "uniform vec3 uDirectLB;\n" + "//! Direction of viewing ray in right-top corner.\n" + "uniform vec3 uDirectRT;\n" + "//! Direction of viewing ray in right-bottom corner.\n" + "uniform vec3 uDirectRB;\n" + "\n" + "//! Inverse model-view-projection matrix.\n" + "uniform mat4 uUnviewMat;\n" + "\n" + "//! Model-view-projection matrix.\n" + "uniform mat4 uViewMat;\n" + "\n" + "//! Texture buffer of data records of bottom-level BVH nodes.\n" + "uniform isamplerBuffer uSceneNodeInfoTexture;\n" + "//! Texture buffer of minimum points of bottom-level BVH nodes.\n" + "uniform samplerBuffer uSceneMinPointTexture;\n" + "//! Texture buffer of maximum points of bottom-level BVH nodes.\n" + "uniform samplerBuffer uSceneMaxPointTexture;\n" + "//! Texture buffer of transformations of high-level BVH nodes.\n" + "uniform samplerBuffer uSceneTransformTexture;\n" + "\n" + "//! Texture buffer of vertex coords.\n" + "uniform samplerBuffer uGeometryVertexTexture;\n" + "//! Texture buffer of vertex normals.\n" + "uniform samplerBuffer uGeometryNormalTexture;\n" + "#ifdef USE_TEXTURES\n" + " //! Texture buffer of per-vertex UV-coordinates.\n" + " uniform samplerBuffer uGeometryTexCrdTexture;\n" + "#endif\n" + "//! Texture buffer of triangle indices.\n" + "uniform isamplerBuffer uGeometryTriangTexture;\n" + "\n" + "//! Texture buffer of material properties.\n" + "uniform samplerBuffer uRaytraceMaterialTexture;\n" + "//! Texture buffer of light source properties.\n" + "uniform samplerBuffer uRaytraceLightSrcTexture;\n" + "//! Environment map texture.\n" + "uniform sampler2D uEnvironmentMapTexture;\n" + "\n" + "//! Total number of light sources.\n" + "uniform int uLightCount;\n" + "//! Intensity of global ambient light.\n" + "uniform vec4 uGlobalAmbient;\n" + "\n" + "//! Enables/disables hard shadows.\n" + "uniform int uShadowsEnabled;\n" + "//! Enables/disables specular reflections.\n" + "uniform int uReflectEnabled;\n" + "//! Enables/disables spherical environment map.\n" + "uniform int uSphereMapEnabled;\n" + "//! Enables/disables environment map background.\n" + "uniform int uSphereMapForBack;\n" + "\n" + "//! Radius of bounding sphere of the scene.\n" + "uniform float uSceneRadius;\n" + "//! Scene epsilon to prevent self-intersections.\n" + "uniform float uSceneEpsilon;\n" + "\n" + "#ifdef USE_TEXTURES\n" + " //! Unique 64-bit handles of OpenGL textures.\n" + " uniform uvec2 uTextureSamplers[MAX_TEX_NUMBER];\n" + "#endif\n" + "\n" + "#ifdef ADAPTIVE_SAMPLING\n" + " //! OpenGL image used for accumulating rendering result.\n" + " volatile restrict layout(size1x32) uniform image2D uRenderImage;\n" + "\n" + " //! OpenGL image storing offsets of sampled pixels blocks.\n" + " coherent restrict layout(size2x32) uniform iimage2D uOffsetImage;\n" + "#endif\n" + "\n" + "//! Top color of gradient background.\n" + "uniform vec4 uBackColorTop = vec4 (0.0);\n" + "//! Bottom color of gradient background.\n" + "uniform vec4 uBackColorBot = vec4 (0.0);\n" + "\n" + "/////////////////////////////////////////////////////////////////////////////////////////\n" + "// Specific data types\n" + "\n" + "//! Stores ray parameters.\n" + "struct SRay\n" + "{\n" + " vec3 Origin;\n" + "\n" + " vec3 Direct;\n" + "};\n" + "\n" + "//! Stores intersection parameters.\n" + "struct SIntersect\n" + "{\n" + " float Time;\n" + "\n" + " vec2 UV;\n" + "\n" + " vec3 Normal;\n" + "};\n" + "\n" + "/////////////////////////////////////////////////////////////////////////////////////////\n" + "// Some useful constants\n" + "\n" + "#define MAXFLOAT 1e15f\n" + "\n" + "#define SMALL vec3 (exp2 (-80.0f))\n" + "\n" + "#define ZERO vec3 (0.0f, 0.0f, 0.0f)\n" + "#define UNIT vec3 (1.0f, 1.0f, 1.0f)\n" + "\n" + "#define AXIS_X vec3 (1.0f, 0.0f, 0.0f)\n" + "#define AXIS_Y vec3 (0.0f, 1.0f, 0.0f)\n" + "#define AXIS_Z vec3 (0.0f, 0.0f, 1.0f)\n" + "\n" + "#define M_PI 3.14159265f\n" + "\n" + "#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)\n" + "\n" + "// =======================================================================\n" + "// function : MatrixRowMultiplyDir\n" + "// purpose : Multiplies a vector by matrix\n" + "// =======================================================================\n" + "vec3 MatrixRowMultiplyDir (in vec3 v,\n" + " in vec4 m0,\n" + " in vec4 m1,\n" + " in vec4 m2)\n" + "{\n" + " return vec3 (dot (m0.xyz, v),\n" + " dot (m1.xyz, v),\n" + " dot (m2.xyz, v));\n" + "}\n" + "\n" + "//! 32-bit state of random number generator.\n" + "uint RandState;\n" + "\n" + "// =======================================================================\n" + "// function : SeedRand\n" + "// purpose : Applies hash function by Thomas Wang to randomize seeds\n" + "// (see http://www.burtleburtle.net/bob/hash/integer.html)\n" + "// =======================================================================\n" + "void SeedRand (in int theSeed, in int theSizeX, in int theRadius)\n" + "{\n" + " RandState = uint (int (gl_FragCoord.y) / theRadius * theSizeX + int (gl_FragCoord.x) / theRadius + theSeed);\n" + "\n" + " RandState = (RandState + 0x479ab41du) + (RandState << 8);\n" + " RandState = (RandState ^ 0xe4aa10ceu) ^ (RandState >> 5);\n" + " RandState = (RandState + 0x9942f0a6u) - (RandState << 14);\n" + " RandState = (RandState ^ 0x5aedd67du) ^ (RandState >> 3);\n" + " RandState = (RandState + 0x17bea992u) + (RandState << 7);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : RandInt\n" + "// purpose : Generates integer using Xorshift algorithm by G. Marsaglia\n" + "// =======================================================================\n" + "uint RandInt()\n" + "{\n" + " RandState ^= (RandState << 13);\n" + " RandState ^= (RandState >> 17);\n" + " RandState ^= (RandState << 5);\n" + "\n" + " return RandState;\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : RandFloat\n" + "// purpose : Generates a random float in 0 <= x < 1 range\n" + "// =======================================================================\n" + "float RandFloat()\n" + "{\n" + " return float (RandInt()) * (1.f / 4294967296.f);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : MatrixColMultiplyPnt\n" + "// purpose : Multiplies a vector by matrix\n" + "// =======================================================================\n" + "vec3 MatrixColMultiplyPnt (in vec3 v,\n" + " in vec4 m0,\n" + " in vec4 m1,\n" + " in vec4 m2,\n" + " in vec4 m3)\n" + "{\n" + " return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z + m3.x,\n" + " m0.y * v.x + m1.y * v.y + m2.y * v.z + m3.y,\n" + " m0.z * v.x + m1.z * v.y + m2.z * v.z + m3.z);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : MatrixColMultiplyDir\n" + "// purpose : Multiplies a vector by matrix\n" + "// =======================================================================\n" + "vec3 MatrixColMultiplyDir (in vec3 v,\n" + " in vec4 m0,\n" + " in vec4 m1,\n" + " in vec4 m2)\n" + "{\n" + " return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z,\n" + " m0.y * v.x + m1.y * v.y + m2.y * v.z,\n" + " m0.z * v.x + m1.z * v.y + m2.z * v.z);\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : InverseDirection\n" + "// purpose : Returns safely inverted direction of the given one\n" + "//=======================================================================\n" + "vec3 InverseDirection (in vec3 theInput)\n" + "{\n" + " vec3 anInverse = 1.f / max (abs (theInput), SMALL);\n" + "\n" + " return mix (-anInverse, anInverse, step (ZERO, theInput));\n" + "}\n" + "\n" + "//=======================================================================\n" + "// function : BackgroundColor\n" + "// purpose : Returns color of gradient background\n" + "//=======================================================================\n" + "vec4 BackgroundColor()\n" + "{\n" + "#ifdef ADAPTIVE_SAMPLING\n" + "\n" + " ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);\n" + "\n" + " ivec2 aTileXY = imageLoad (uOffsetImage, ivec2 (aFragCoord.x / BLOCK_SIZE,\n" + " aFragCoord.y / BLOCK_SIZE)).xy;\n" + "\n" + " aTileXY.y += aFragCoord.y % min (uWinSizeY - aTileXY.y, BLOCK_SIZE);\n" + "\n" + " return mix (uBackColorBot, uBackColorTop, float (aTileXY.y) / uWinSizeY);\n" + "\n" + "#else\n" + "\n" + " return mix (uBackColorBot, uBackColorTop, vPixel.y);\n" + "\n" + "#endif\n" + "}\n" + "\n" + "/////////////////////////////////////////////////////////////////////////////////////////\n" + "// Functions for compute ray-object intersection\n" + "\n" + "// =======================================================================\n" + "// function : GenerateRay\n" + "// purpose :\n" + "// =======================================================================\n" + "SRay GenerateRay (in vec2 thePixel)\n" + "{\n" + " vec3 aP0 = mix (uOriginLB, uOriginRB, thePixel.x);\n" + " vec3 aP1 = mix (uOriginLT, uOriginRT, thePixel.x);\n" + "\n" + " vec3 aD0 = mix (uDirectLB, uDirectRB, thePixel.x);\n" + " vec3 aD1 = mix (uDirectLT, uDirectRT, thePixel.x);\n" + "\n" + " vec3 aDirection = normalize (mix (aD0, aD1, thePixel.y));\n" + "\n" + " return SRay (mix (aP0, aP1, thePixel.y), aDirection);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : IntersectSphere\n" + "// purpose : Computes ray-sphere intersection\n" + "// =======================================================================\n" + "float IntersectSphere (in SRay theRay, in float theRadius)\n" + "{\n" + " float aDdotD = dot (theRay.Direct, theRay.Direct);\n" + " float aDdotO = dot (theRay.Direct, theRay.Origin);\n" + " float aOdotO = dot (theRay.Origin, theRay.Origin);\n" + "\n" + " float aD = aDdotO * aDdotO - aDdotD * (aOdotO - theRadius * theRadius);\n" + "\n" + " if (aD > 0.0f)\n" + " {\n" + " float aTime = (sqrt (aD) - aDdotO) * (1.0f / aDdotD);\n" + " \n" + " return aTime > 0.0f ? aTime : MAXFLOAT;\n" + " }\n" + "\n" + " return MAXFLOAT;\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : IntersectTriangle\n" + "// purpose : Computes ray-triangle intersection (branchless version)\n" + "// =======================================================================\n" + "void IntersectTriangle (in SRay theRay,\n" + " in vec3 thePnt0,\n" + " in vec3 thePnt1,\n" + " in vec3 thePnt2,\n" + " out vec3 theUVT,\n" + " out vec3 theNorm)\n" + "{\n" + " vec3 aToTrg = thePnt0 - theRay.Origin;\n" + "\n" + " vec3 aEdge0 = thePnt1 - thePnt0;\n" + " vec3 aEdge1 = thePnt0 - thePnt2;\n" + "\n" + " theNorm = cross (aEdge1, aEdge0);\n" + "\n" + " vec3 theVect = cross (theRay.Direct, aToTrg);\n" + "\n" + " theUVT = vec3 (dot (theNorm, aToTrg),\n" + " dot (theVect, aEdge1),\n" + " dot (theVect, aEdge0)) * (1.f / dot (theNorm, theRay.Direct));\n" + "\n" + " theUVT.x = any (lessThan (theUVT, ZERO)) || (theUVT.y + theUVT.z) > 1.f ? MAXFLOAT : theUVT.x;\n" + "}\n" + "\n" + "#define EMPTY_ROOT ivec4(0)\n" + "\n" + "//! Utility structure containing information about\n" + "//! currently traversing sub-tree of scene's BVH.\n" + "struct SSubTree\n" + "{\n" + " //! Transformed ray.\n" + " SRay TrsfRay;\n" + "\n" + " //! Inversed ray direction.\n" + " vec3 Inverse;\n" + "\n" + " //! Parameters of sub-root node.\n" + " ivec4 SubData;\n" + "};\n" + "\n" + "#define MATERIAL_AMBN(index) (18 * index + 0)\n" + "#define MATERIAL_DIFF(index) (18 * index + 1)\n" + "#define MATERIAL_SPEC(index) (18 * index + 2)\n" + "#define MATERIAL_EMIS(index) (18 * index + 3)\n" + "#define MATERIAL_REFL(index) (18 * index + 4)\n" + "#define MATERIAL_REFR(index) (18 * index + 5)\n" + "#define MATERIAL_TRAN(index) (18 * index + 6)\n" + "#define MATERIAL_TRS1(index) (18 * index + 7)\n" + "#define MATERIAL_TRS2(index) (18 * index + 8)\n" + "#define MATERIAL_TRS3(index) (18 * index + 9)\n" + "\n" + "#define TRS_OFFSET(treelet) treelet.SubData.x\n" + "#define BVH_OFFSET(treelet) treelet.SubData.y\n" + "#define VRT_OFFSET(treelet) treelet.SubData.z\n" + "#define TRG_OFFSET(treelet) treelet.SubData.w\n" + "\n" + "//! Identifies the absence of intersection.\n" + "#define INALID_HIT ivec4 (-1)\n" + "\n" + "//! Global stack shared between traversal functions.\n" + "int Stack[STACK_SIZE];\n" + "\n" + "// =======================================================================\n" + "// function : pop\n" + "// purpose :\n" + "// =======================================================================\n" + "int pop (inout int theHead)\n" + "{\n" + " int aData = Stack[theHead];\n" + "\n" + " int aMask = aData >> 26;\n" + " int aNode = aMask & 0x3;\n" + "\n" + " aMask >>= 2;\n" + "\n" + " if ((aMask & 0x3) == aNode)\n" + " {\n" + " --theHead;\n" + " }\n" + " else\n" + " {\n" + " aMask |= (aMask << 2) & 0x30;\n" + "\n" + " Stack[theHead] = (aData & 0x03FFFFFF) | (aMask << 26);\n" + " }\n" + "\n" + " return (aData & 0x03FFFFFF) + aNode;\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : SceneNearestHit\n" + "// purpose : Finds intersection with nearest scene triangle\n" + "// =======================================================================\n" + "ivec4 SceneNearestHit (in SRay theRay, in vec3 theInverse, inout SIntersect theHit, out int theTrsfId)\n" + "{\n" + " ivec4 aTriIndex = INALID_HIT;\n" + "\n" + " int aNode = 0; // node to traverse\n" + " int aHead = -1; // pointer of stack\n" + " int aStop = -1; // BVH level switch\n" + "\n" + " SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + "\n" + " for (bool toContinue = true; toContinue; /* none */)\n" + " {\n" + " ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);\n" + "\n" + " if (aData.x == 0) // if inner node\n" + " {\n" + " aData.y += BVH_OFFSET (aSubTree);\n" + "\n" + " vec4 aHitTimes = vec4 (MAXFLOAT,\n" + " MAXFLOAT,\n" + " MAXFLOAT,\n" + " MAXFLOAT);\n" + "\n" + " vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;\n" + "\n" + " vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + "\n" + " vec3 aTimeMax = max (aNodeMin0, aNodeMax0);\n" + " vec3 aTimeMin = min (aNodeMin0, aNodeMax0);\n" + "\n" + " float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.x = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f);\n" + "\n" + " aTimeMax = max (aNodeMin1, aNodeMax1);\n" + " aTimeMin = min (aNodeMin1, aNodeMax1);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.y = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f);\n" + "\n" + " aTimeMax = max (aNodeMin2, aNodeMax2);\n" + " aTimeMin = min (aNodeMin2, aNodeMax2);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.z = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 1);\n" + "\n" + " aTimeMax = max (aNodeMin3, aNodeMax3);\n" + " aTimeMin = min (aNodeMin3, aNodeMax3);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.w = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 2);\n" + "\n" + " ivec4 aChildren = ivec4 (0, 1, 2, 3);\n" + "\n" + " aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;\n" + " aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;\n" + " aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;\n" + " aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;\n" + " aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;\n" + " aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;\n" + " aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;\n" + " aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;\n" + " aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;\n" + " aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;\n" + "\n" + " if (aHitTimes.x != MAXFLOAT)\n" + " {\n" + " int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2\n" + " | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);\n" + "\n" + " if (aHitTimes.y != MAXFLOAT)\n" + " Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;\n" + "\n" + " aNode = aData.y + aChildren.x;\n" + " }\n" + " else\n" + " {\n" + " toContinue = (aHead >= 0);\n" + "\n" + " if (aHead == aStop) // go to top-level BVH\n" + " {\n" + " aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + " }\n" + "\n" + " if (aHead >= 0)\n" + " aNode = pop (aHead);\n" + " }\n" + " }\n" + " else if (aData.x < 0) // leaf node (contains triangles)\n" + " {\n" + " vec3 aNormal;\n" + " vec3 aTimeUV;\n" + "\n" + " for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)\n" + " {\n" + " ivec4 aTriangle = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));\n" + "\n" + " vec3 aPoint0 = texelFetch (uGeometryVertexTexture, aTriangle.x += VRT_OFFSET (aSubTree)).xyz;\n" + " vec3 aPoint1 = texelFetch (uGeometryVertexTexture, aTriangle.y += VRT_OFFSET (aSubTree)).xyz;\n" + " vec3 aPoint2 = texelFetch (uGeometryVertexTexture, aTriangle.z += VRT_OFFSET (aSubTree)).xyz;\n" + "\n" + " IntersectTriangle (aSubTree.TrsfRay, aPoint0, aPoint1, aPoint2, aTimeUV, aNormal);\n" + "\n" + " if (aTimeUV.x < theHit.Time)\n" + " {\n" + " aTriIndex = aTriangle;\n" + "\n" + " theTrsfId = TRS_OFFSET (aSubTree);\n" + "\n" + " theHit = SIntersect (aTimeUV.x, aTimeUV.yz, aNormal);\n" + " }\n" + " }\n" + "\n" + " toContinue = (aHead >= 0);\n" + "\n" + " if (aHead == aStop) // go to top-level BVH\n" + " {\n" + " aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + " }\n" + "\n" + " if (aHead >= 0)\n" + " aNode = pop (aHead);\n" + " }\n" + " else if (aData.x > 0) // switch node\n" + " {\n" + " aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root\n" + "\n" + " vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);\n" + " vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);\n" + " vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);\n" + " vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);\n" + "\n" + " aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,\n" + " aInvTransf0,\n" + " aInvTransf1,\n" + " aInvTransf2);\n" + "\n" + " aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) /\n" + " max (abs (aSubTree.TrsfRay.Direct), SMALL);\n" + "\n" + " aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,\n" + " aInvTransf0,\n" + " aInvTransf1,\n" + " aInvTransf2,\n" + " aInvTransf3);\n" + "\n" + " aNode = BVH_OFFSET (aSubTree); // go to sub-root node\n" + "\n" + " aStop = aHead; // store current stack pointer\n" + " }\n" + " }\n" + "\n" + " return aTriIndex;\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : SceneAnyHit\n" + "// purpose : Finds intersection with any scene triangle\n" + "// =======================================================================\n" + "float SceneAnyHit (in SRay theRay, in vec3 theInverse, in float theDistance)\n" + "{\n" + " float aFactor = 1.f;\n" + "\n" + " int aNode = 0; // node to traverse\n" + " int aHead = -1; // pointer of stack\n" + " int aStop = -1; // BVH level switch\n" + "\n" + " SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + "\n" + " for (bool toContinue = true; toContinue; /* none */)\n" + " {\n" + " ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);\n" + "\n" + " if (aData.x == 0) // if inner node\n" + " {\n" + " aData.y += BVH_OFFSET (aSubTree);\n" + "\n" + " vec4 aHitTimes = vec4 (MAXFLOAT,\n" + " MAXFLOAT,\n" + " MAXFLOAT,\n" + " MAXFLOAT);\n" + "\n" + " vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;\n" + "\n" + " vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + " vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;\n" + "\n" + " vec3 aTimeMax = max (aNodeMin0, aNodeMax0);\n" + " vec3 aTimeMin = min (aNodeMin0, aNodeMax0);\n" + "\n" + " float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.x = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f);\n" + "\n" + " aTimeMax = max (aNodeMin1, aNodeMax1);\n" + " aTimeMin = min (aNodeMin1, aNodeMax1);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.y = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f);\n" + "\n" + " aTimeMax = max (aNodeMin2, aNodeMax2);\n" + " aTimeMin = min (aNodeMin2, aNodeMax2);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.z = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 1);\n" + "\n" + " aTimeMax = max (aNodeMin3, aNodeMax3);\n" + " aTimeMin = min (aNodeMin3, aNodeMax3);\n" + "\n" + " aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n" + " aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n" + "\n" + " aHitTimes.w = mix (MAXFLOAT, aTimeEnter,\n" + " aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 2);\n" + "\n" + " ivec4 aChildren = ivec4 (0, 1, 2, 3);\n" + "\n" + " aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;\n" + " aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;\n" + " aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;\n" + " aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;\n" + " aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;\n" + " aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;\n" + " aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;\n" + " aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;\n" + " aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;\n" + " aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;\n" + "\n" + " if (aHitTimes.x != MAXFLOAT)\n" + " {\n" + " int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2\n" + " | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);\n" + "\n" + " if (aHitTimes.y != MAXFLOAT)\n" + " Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;\n" + "\n" + " aNode = aData.y + aChildren.x;\n" + " }\n" + " else\n" + " {\n" + " toContinue = (aHead >= 0);\n" + "\n" + " if (aHead == aStop) // go to top-level BVH\n" + " {\n" + " aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + " }\n" + "\n" + " if (aHead >= 0)\n" + " aNode = pop (aHead);\n" + " }\n" + " }\n" + " else if (aData.x < 0) // leaf node\n" + " {\n" + " vec3 aNormal;\n" + " vec3 aTimeUV;\n" + "\n" + " for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)\n" + " {\n" + " ivec4 aTriangle = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));\n" + "\n" + " vec3 aPoint0 = texelFetch (uGeometryVertexTexture, aTriangle.x += VRT_OFFSET (aSubTree)).xyz;\n" + " vec3 aPoint1 = texelFetch (uGeometryVertexTexture, aTriangle.y += VRT_OFFSET (aSubTree)).xyz;\n" + " vec3 aPoint2 = texelFetch (uGeometryVertexTexture, aTriangle.z += VRT_OFFSET (aSubTree)).xyz;\n" + "\n" + " IntersectTriangle (aSubTree.TrsfRay, aPoint0, aPoint1, aPoint2, aTimeUV, aNormal);\n" + "\n" + "#ifdef TRANSPARENT_SHADOWS\n" + " if (aTimeUV.x < theDistance)\n" + " {\n" + " aFactor *= 1.f - texelFetch (uRaytraceMaterialTexture, MATERIAL_TRAN (aTriangle.w)).x;\n" + " }\n" + "#else\n" + " if (aTimeUV.x < theDistance)\n" + " {\n" + " aFactor = 0.f;\n" + " }\n" + "#endif\n" + " }\n" + "\n" + " toContinue = (aHead >= 0) && (aFactor > 0.1f);\n" + "\n" + " if (aHead == aStop) // go to top-level BVH\n" + " {\n" + " aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);\n" + " }\n" + "\n" + " if (aHead >= 0)\n" + " aNode = pop (aHead);\n" + " }\n" + " else if (aData.x > 0) // switch node\n" + " {\n" + " aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root\n" + "\n" + " vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);\n" + " vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);\n" + " vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);\n" + " vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);\n" + "\n" + " aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,\n" + " aInvTransf0,\n" + " aInvTransf1,\n" + " aInvTransf2);\n" + "\n" + " aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,\n" + " aInvTransf0,\n" + " aInvTransf1,\n" + " aInvTransf2,\n" + " aInvTransf3);\n" + "\n" + " aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) / max (abs (aSubTree.TrsfRay.Direct), SMALL);\n" + "\n" + " aNode = BVH_OFFSET (aSubTree); // go to sub-root node\n" + "\n" + " aStop = aHead; // store current stack pointer\n" + " }\n" + " }\n" + "\n" + " return aFactor;\n" + "}\n" + "\n" + "#define PI 3.1415926f\n" + "\n" + "// =======================================================================\n" + "// function : Latlong\n" + "// purpose : Converts world direction to environment texture coordinates\n" + "// =======================================================================\n" + "vec2 Latlong (in vec3 thePoint, in float theRadius)\n" + "{\n" + " float aPsi = acos (-thePoint.z / theRadius);\n" + "\n" + " float aPhi = atan (thePoint.y, thePoint.x) + PI;\n" + "\n" + " return vec2 (aPhi * 0.1591549f,\n" + " aPsi * 0.3183098f);\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : SmoothNormal\n" + "// purpose : Interpolates normal across the triangle\n" + "// =======================================================================\n" + "vec3 SmoothNormal (in vec2 theUV, in ivec4 theTriangle)\n" + "{\n" + " vec3 aNormal0 = texelFetch (uGeometryNormalTexture, theTriangle.x).xyz;\n" + " vec3 aNormal1 = texelFetch (uGeometryNormalTexture, theTriangle.y).xyz;\n" + " vec3 aNormal2 = texelFetch (uGeometryNormalTexture, theTriangle.z).xyz;\n" + "\n" + " return normalize (aNormal1 * theUV.x +\n" + " aNormal2 * theUV.y +\n" + " aNormal0 * (1.0f - theUV.x - theUV.y));\n" + "}\n" + "\n" + "#define POLYGON_OFFSET_UNIT 0.f\n" + "#define POLYGON_OFFSET_FACTOR 1.f\n" + "#define POLYGON_OFFSET_SCALE 0.006f\n" + "\n" + "// =======================================================================\n" + "// function : PolygonOffset\n" + "// purpose : Computes OpenGL polygon offset\n" + "// =======================================================================\n" + "float PolygonOffset (in vec3 theNormal, in vec3 thePoint)\n" + "{\n" + " vec4 aProjectedNorm = vec4 (theNormal, -dot (theNormal, thePoint)) * uUnviewMat;\n" + "\n" + " float aPolygonOffset = POLYGON_OFFSET_UNIT;\n" + "\n" + " if (aProjectedNorm.z * aProjectedNorm.z > 1e-20f)\n" + " {\n" + " aProjectedNorm.xy *= 1.f / aProjectedNorm.z;\n" + "\n" + " aPolygonOffset += POLYGON_OFFSET_FACTOR * max (abs (aProjectedNorm.x),\n" + " abs (aProjectedNorm.y));\n" + " }\n" + "\n" + " return aPolygonOffset;\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : SmoothUV\n" + "// purpose : Interpolates UV coordinates across the triangle\n" + "// =======================================================================\n" + "#ifdef USE_TEXTURES\n" + "vec2 SmoothUV (in vec2 theUV, in ivec4 theTriangle)\n" + "{\n" + " vec2 aTexCrd0 = texelFetch (uGeometryTexCrdTexture, theTriangle.x).st;\n" + " vec2 aTexCrd1 = texelFetch (uGeometryTexCrdTexture, theTriangle.y).st;\n" + " vec2 aTexCrd2 = texelFetch (uGeometryTexCrdTexture, theTriangle.z).st;\n" + "\n" + " return aTexCrd1 * theUV.x +\n" + " aTexCrd2 * theUV.y +\n" + " aTexCrd0 * (1.0f - theUV.x - theUV.y);\n" + "}\n" + "#endif\n" + "\n" + "// =======================================================================\n" + "// function : FetchEnvironment\n" + "// purpose :\n" + "// =======================================================================\n" + "vec4 FetchEnvironment (in vec2 theTexCoord)\n" + "{\n" + " return mix (vec4 (0.0f, 0.0f, 0.0f, 1.0f),\n" + " textureLod (uEnvironmentMapTexture, theTexCoord, 0.0f), float (uSphereMapEnabled));\n" + "}\n" + "\n" + "// =======================================================================\n" + "// function : Refract\n" + "// purpose : Computes refraction ray (also handles TIR)\n" + "// =======================================================================\n" + "#ifndef PATH_TRACING\n" + "vec3 Refract (in vec3 theInput,\n" + " in vec3 theNormal,\n" + " in float theRefractIndex,\n" + " in float theInvRefractIndex)\n" + "{\n" + " float aNdotI = dot (theInput, theNormal);\n" + "\n" + " float anIndex = aNdotI < 0.0f\n" + " ? theInvRefractIndex\n" + " : theRefractIndex;\n" + "\n" + " float aSquare = anIndex * anIndex * (1.0f - aNdotI * aNdotI);\n" + "\n" + " if (aSquare > 1.0f)\n" + " {\n" + " return reflect (theInput, theNormal);\n" + " }\n" + "\n" + " float aNdotT = sqrt (1.0f - aSquare);\n" + "\n" + " return normalize (anIndex * theInput -\n" + " (anIndex * aNdotI + (aNdotI < 0.0f ? aNdotT : -aNdotT)) * theNormal);\n" + "}\n" + "#endif\n" + "\n" + "#define MIN_SLOPE 0.0001f\n" + "#define EPS_SCALE 8.0000f\n" + "\n" + "#define THRESHOLD vec3 (0.1f)\n" + "\n" + "#define INVALID_BOUNCES 1000\n" + "\n" + "#define LIGHT_POS(index) (2 * index + 1)\n" + "#define LIGHT_PWR(index) (2 * index + 0)\n" + "\n" + "// =======================================================================\n" + "// function : Radiance\n" + "// purpose : Computes color along the given ray\n" + "// =======================================================================\n" + "#ifndef PATH_TRACING\n" + "vec4 Radiance (in SRay theRay, in vec3 theInverse)\n" + "{\n" + " vec3 aResult = vec3 (0.0f);\n" + " vec4 aWeight = vec4 (1.0f);\n" + "\n" + " int aTrsfId;\n" + "\n" + " float aRaytraceDepth = MAXFLOAT;\n" + "\n" + " for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)\n" + " {\n" + " SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);\n" + "\n" + " ivec4 aTriIndex = SceneNearestHit (theRay, theInverse, aHit, aTrsfId);\n" + "\n" + " if (aTriIndex.x == -1)\n" + " {\n" + " vec4 aColor = vec4 (0.0);\n" + "\n" + " if (bool(uSphereMapForBack) || aWeight.w == 0.0f /* reflection */)\n" + " {\n" + " float aTime = IntersectSphere (theRay, uSceneRadius);\n" + "\n" + " aColor = FetchEnvironment (Latlong (\n" + " theRay.Direct * aTime + theRay.Origin, uSceneRadius));\n" + " }\n" + " else\n" + " {\n" + " aColor = BackgroundColor();\n" + " }\n" + "\n" + " aResult += aWeight.xyz * aColor.xyz; aWeight.w *= aColor.w;\n" + "\n" + " break; // terminate path\n" + " }\n" + "\n" + " vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTrsfId + 0).xyz;\n" + " vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTrsfId + 1).xyz;\n" + " vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTrsfId + 2).xyz;\n" + "\n" + " aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),\n" + " dot (aInvTransf1, aHit.Normal),\n" + " dot (aInvTransf2, aHit.Normal)));\n" + "\n" + " theRay.Origin += theRay.Direct * aHit.Time; // intersection point\n" + "\n" + " // Evaluate depth on first hit\n" + " if (aDepth == 0)\n" + " {\n" + " vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);\n" + "\n" + " float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);\n" + " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;\n" + " }\n" + "\n" + " vec3 aNormal = SmoothNormal (aHit.UV, aTriIndex);\n" + "\n" + " aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),\n" + " dot (aInvTransf1, aNormal),\n" + " dot (aInvTransf2, aNormal)));\n" + "\n" + " vec3 aAmbient = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_AMBN (aTriIndex.w)).rgb;\n" + " vec4 aDiffuse = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_DIFF (aTriIndex.w));\n" + " vec4 aSpecular = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_SPEC (aTriIndex.w));\n" + " vec4 aOpacity = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_TRAN (aTriIndex.w));\n" + "\n" + "#ifdef USE_TEXTURES\n" + " if (aDiffuse.w >= 0.f)\n" + " {\n" + " vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);\n" + "\n" + " vec4 aTrsfRow1 = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));\n" + " vec4 aTrsfRow2 = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));\n" + "\n" + " aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),\n" + " dot (aTrsfRow2, aTexCoord));\n" + "\n" + " vec3 aTexColor = textureLod (\n" + " sampler2D (uTextureSamplers[int(aDiffuse.w)]), aTexCoord.st, 0.f).rgb;\n" + "\n" + " aDiffuse.rgb *= aTexColor;\n" + " aAmbient.rgb *= aTexColor;\n" + " }\n" + "#endif\n" + "\n" + " vec3 aEmission = texelFetch (\n" + " uRaytraceMaterialTexture, MATERIAL_EMIS (aTriIndex.w)).rgb;\n" + "\n" + " float aGeomFactor = dot (aNormal, theRay.Direct);\n" + "\n" + " aResult.xyz += aWeight.xyz * aOpacity.x * (\n" + " uGlobalAmbient.xyz * aAmbient * max (abs (aGeomFactor), 0.5f) + aEmission);\n" + "\n" + " vec3 aSidedNormal = mix (aNormal, -aNormal, step (0.0f, aGeomFactor));\n" + "\n" + " for (int aLightIdx = 0; aLightIdx < uLightCount; ++aLightIdx)\n" + " {\n" + " vec4 aLight = texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));\n" + "\n" + " float aDistance = MAXFLOAT;\n" + "\n" + " if (aLight.w != 0.0f) // point light source\n" + " {\n" + " aDistance = length (aLight.xyz -= theRay.Origin);\n" + "\n" + " aLight.xyz *= 1.0f / aDistance;\n" + " }\n" + "\n" + " float aLdotN = dot (aLight.xyz, aSidedNormal);\n" + "\n" + " if (aLdotN > 0.0f) // first check if light source is important\n" + " {\n" + " float aVisibility = 1.0f;\n" + "\n" + " if (bool(uShadowsEnabled))\n" + " {\n" + " SRay aShadow = SRay (theRay.Origin, aLight.xyz);\n" + "\n" + " aShadow.Origin += uSceneEpsilon * (aLight.xyz +\n" + " mix (-aHit.Normal, aHit.Normal, step (0.0f, dot (aHit.Normal, aLight.xyz))));\n" + "\n" + " vec3 aInverse = 1.0f / max (abs (aLight.xyz), SMALL);\n" + "\n" + " aVisibility = SceneAnyHit (\n" + " aShadow, mix (-aInverse, aInverse, step (ZERO, aLight.xyz)), aDistance);\n" + " }\n" + "\n" + " if (aVisibility > 0.0f)\n" + " {\n" + " vec3 aIntensity = vec3 (texelFetch (\n" + " uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx)));\n" + "\n" + " float aRdotV = dot (reflect (aLight.xyz, aSidedNormal), theRay.Direct);\n" + "\n" + " aResult.xyz += aWeight.xyz * (aOpacity.x * aVisibility) * aIntensity *\n" + " (aDiffuse.xyz * aLdotN + aSpecular.xyz * pow (max (0.f, aRdotV), aSpecular.w));\n" + " }\n" + " }\n" + " }\n" + "\n" + " if (aOpacity.x != 1.0f)\n" + " {\n" + " aWeight *= aOpacity.y;\n" + "\n" + " if (aOpacity.z != 1.0f)\n" + " {\n" + " theRay.Direct = Refract (theRay.Direct, aNormal, aOpacity.z, aOpacity.w);\n" + " }\n" + " }\n" + " else\n" + " {\n" + " aWeight *= bool(uReflectEnabled) ?\n" + " texelFetch (uRaytraceMaterialTexture, MATERIAL_REFL (aTriIndex.w)) : vec4 (0.0f);\n" + "\n" + " vec3 aReflect = reflect (theRay.Direct, aNormal);\n" + "\n" + " if (dot (aReflect, aHit.Normal) * dot (theRay.Direct, aHit.Normal) > 0.0f)\n" + " {\n" + " aReflect = reflect (theRay.Direct, aHit.Normal);\n" + " }\n" + "\n" + " theRay.Direct = aReflect;\n" + " }\n" + "\n" + " if (all (lessThanEqual (aWeight.xyz, THRESHOLD)))\n" + " {\n" + " aDepth = INVALID_BOUNCES;\n" + " }\n" + " else if (aOpacity.x == 1.0f || aOpacity.z != 1.0f) // if no simple transparency\n" + " {\n" + " theRay.Origin += aHit.Normal * mix (\n" + " -uSceneEpsilon, uSceneEpsilon, step (0.0f, dot (aHit.Normal, theRay.Direct)));\n" + "\n" + " theInverse = 1.0f / max (abs (theRay.Direct), SMALL);\n" + "\n" + " theInverse = mix (-theInverse, theInverse, step (ZERO, theRay.Direct));\n" + " }\n" + "\n" + " theRay.Origin += theRay.Direct * uSceneEpsilon;\n" + " }\n" + "\n" + " gl_FragDepth = aRaytraceDepth;\n" + "\n" + " return vec4 (aResult.x,\n" + " aResult.y,\n" + " aResult.z,\n" + " aWeight.w);\n" + "}\n" + "#endif\n"; diff --git a/src/Shaders/Shaders_RaytraceBase_vs.pxx b/src/Shaders/Shaders_RaytraceBase_vs.pxx new file mode 100644 index 0000000000..b016b0276a --- /dev/null +++ b/src/Shaders/Shaders_RaytraceBase_vs.pxx @@ -0,0 +1,15 @@ +// This file has been automatically generated from resource file src/Shaders/RaytraceBase.vs + +static const char Shaders_RaytraceBase_vs[] = + "in vec4 occVertex;\n" + "\n" + "//! Normalized pixel coordinates.\n" + "out vec2 vPixel;\n" + "\n" + "void main (void)\n" + "{\n" + " vPixel = vec2 ((occVertex.x + 1.f) * 0.5f,\n" + " (occVertex.y + 1.f) * 0.5f);\n" + "\n" + " gl_Position = occVertex;\n" + "}\n"; diff --git a/src/Shaders/Shaders_RaytraceRender_fs.pxx b/src/Shaders/Shaders_RaytraceRender_fs.pxx new file mode 100644 index 0000000000..db81a3ff38 --- /dev/null +++ b/src/Shaders/Shaders_RaytraceRender_fs.pxx @@ -0,0 +1,117 @@ +// This file has been automatically generated from resource file src/Shaders/RaytraceRender.fs + +static const char Shaders_RaytraceRender_fs[] = + "out vec4 OutColor;\n" + "\n" + "// Seed for random number generator (generated on CPU).\n" + "uniform int uFrameRndSeed;\n" + "\n" + "//! Enables/disables using of single RNG seed for 16x16 image\n" + "//! blocks. Increases performance up to 4x, but the noise has\n" + "//! become structured. Can be used fo final rendering.\n" + "uniform int uBlockedRngEnabled;\n" + "\n" + "#ifndef ADAPTIVE_SAMPLING\n" + " //! Weight of current frame related to accumulated samples.\n" + " uniform float uSampleWeight;\n" + "\n" + " //! Input accumulated image.\n" + " uniform sampler2D uAccumTexture;\n" + "#endif\n" + "\n" + "//! Maximum radiance that can be added to the pixel. Decreases noise\n" + "//! level, but introduces some bias.\n" + "#define MAX_RADIANCE vec3 (25.f)\n" + "\n" + "// =======================================================================\n" + "// function : main\n" + "// purpose :\n" + "// =======================================================================\n" + "void main (void)\n" + "{\n" + " SeedRand (uFrameRndSeed, uWinSizeX, uBlockedRngEnabled == 0 ? 1 : 16);\n" + "\n" + "#ifndef PATH_TRACING\n" + "\n" + " SRay aRay = GenerateRay (vPixel);\n" + "\n" + "#else\n" + "\n" + " ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);\n" + "\n" + "#ifdef ADAPTIVE_SAMPLING\n" + "\n" + " ivec2 aTileXY = imageLoad (uOffsetImage, ivec2 (aFragCoord.x / BLOCK_SIZE,\n" + " aFragCoord.y / BLOCK_SIZE)).xy;\n" + "\n" + " ivec2 aRealBlockSize = ivec2 (min (uWinSizeX - aTileXY.x, BLOCK_SIZE),\n" + " min (uWinSizeY - aTileXY.y, BLOCK_SIZE));\n" + "\n" + " aFragCoord.x = aTileXY.x + (aFragCoord.x % aRealBlockSize.x);\n" + " aFragCoord.y = aTileXY.y + (aFragCoord.y % aRealBlockSize.y);\n" + "\n" + "#endif // ADAPTIVE_SAMPLING\n" + "\n" + " vec2 aPnt = vec2 (aFragCoord.x + RandFloat(),\n" + " aFragCoord.y + RandFloat());\n" + "\n" + " SRay aRay = GenerateRay (aPnt / vec2 (uWinSizeX, uWinSizeY));\n" + "\n" + "#endif // PATH_TRACING\n" + "\n" + " vec3 aInvDirect = InverseDirection (aRay.Direct);\n" + "\n" + "#ifdef PATH_TRACING\n" + "\n" + " vec4 aColor = PathTrace (aRay, aInvDirect);\n" + "\n" + " if (any (isnan (aColor.rgb)))\n" + " {\n" + " aColor.rgb = ZERO;\n" + " }\n" + "\n" + " aColor.rgb = min (aColor.rgb, MAX_RADIANCE);\n" + "\n" + "#ifdef ADAPTIVE_SAMPLING\n" + "\n" + " // accumulate RGB color and depth\n" + " imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 0,\n" + " 2 * aFragCoord.y + 0), aColor.r);\n" + " imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 1,\n" + " 2 * aFragCoord.y + 0), aColor.g);\n" + " imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 1,\n" + " 2 * aFragCoord.y + 1), aColor.b);\n" + " imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 2,\n" + " 2 * aFragCoord.y + 1), aColor.w);\n" + "\n" + " // accumulate number of samples\n" + " float aNbSamples = imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 0,\n" + " 2 * aFragCoord.y + 1), 1.0);\n" + "\n" + " if (int (aNbSamples) % 2 == 0) // accumulate luminance for even samples only\n" + " {\n" + " imageAtomicAdd (uRenderImage, ivec2 (3 * aFragCoord.x + 2,\n" + " 2 * aFragCoord.y + 0), dot (LUMA, aColor.rgb));\n" + " }\n" + "\n" + " discard; // fragment should not be written to frame buffer\n" + "\n" + "#else\n" + "\n" + " if (uSampleWeight >= 1.f)\n" + " {\n" + " OutColor = aColor;\n" + " }\n" + " else\n" + " {\n" + " OutColor = mix (texture2D (uAccumTexture, vPixel), aColor, uSampleWeight);\n" + " }\n" + "\n" + "#endif // ADAPTIVE_SAMPLING\n" + "\n" + "#else\n" + "\n" + " OutColor = clamp (Radiance (aRay, aInvDirect), 0.f, 1.f);\n" + "\n" + "#endif // PATH_TRACING\n" + "}\n"; diff --git a/src/Shaders/Shaders_RaytraceSmooth_fs.pxx b/src/Shaders/Shaders_RaytraceSmooth_fs.pxx new file mode 100644 index 0000000000..d263f0fa4b --- /dev/null +++ b/src/Shaders/Shaders_RaytraceSmooth_fs.pxx @@ -0,0 +1,83 @@ +// This file has been automatically generated from resource file src/Shaders/RaytraceSmooth.fs + +static const char Shaders_RaytraceSmooth_fs[] = + "//! Input ray-traced image.\n" + "uniform sampler2D uFSAAInputTexture;\n" + "\n" + "//! Number of accumulated FSAA samples.\n" + "uniform int uSamples;\n" + "\n" + "//! Output pixel color.\n" + "out vec4 OutColor;\n" + "\n" + "#define LUM_DIFFERENCE 0.085f\n" + "\n" + "// =======================================================================\n" + "// function : main\n" + "// purpose :\n" + "// =======================================================================\n" + "void main (void)\n" + "{\n" + "#ifndef PATH_TRACING\n" + "\n" + " int aPixelX = int (gl_FragCoord.x);\n" + " int aPixelY = int (gl_FragCoord.y);\n" + "\n" + " // Adjust FLIPTRI pattern used for adaptive FSAA\n" + " float anOffsetX = mix (uOffsetX, -uOffsetX, float (aPixelX % 2));\n" + " float anOffsetY = mix (uOffsetY, -uOffsetY, float (aPixelY % 2));\n" + "\n" + " vec4 aClr0 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 0), 0);\n" + " vec4 aClr1 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY - 1), 0);\n" + " vec4 aClr2 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 1), 0);\n" + "\n" + " vec4 aClr3 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 0), 0);\n" + " vec4 aClr4 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY - 1), 0);\n" + " vec4 aClr5 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 1), 0);\n" + "\n" + " vec4 aClr6 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 0), 0);\n" + " vec4 aClr7 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY - 1), 0);\n" + " vec4 aClr8 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 1), 0);\n" + "\n" + " float aLum = dot (LUMA, aClr0.xyz);\n" + "\n" + " bool aRender = abs (aClr1.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr2.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr3.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr4.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr5.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr6.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr7.w - aClr0.w) > LUM_DIFFERENCE ||\n" + " abs (aClr8.w - aClr0.w) > LUM_DIFFERENCE;\n" + "\n" + " if (!aRender)\n" + " {\n" + " aRender = abs (dot (LUMA, aClr1.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr2.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr3.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr4.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr5.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr6.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr7.xyz) - aLum) > LUM_DIFFERENCE ||\n" + " abs (dot (LUMA, aClr8.xyz) - aLum) > LUM_DIFFERENCE;\n" + " }\n" + "\n" + " vec4 aColor = aClr0;\n" + "\n" + " if (aRender)\n" + " {\n" + " SRay aRay = GenerateRay (vPixel + vec2 (anOffsetX, anOffsetY));\n" + "\n" + " vec3 aInvDirect = 1.f / max (abs (aRay.Direct), SMALL);\n" + "\n" + " aInvDirect = vec3 (aRay.Direct.x < 0.f ? -aInvDirect.x : aInvDirect.x,\n" + " aRay.Direct.y < 0.f ? -aInvDirect.y : aInvDirect.y,\n" + " aRay.Direct.z < 0.f ? -aInvDirect.z : aInvDirect.z);\n" + "\n" + " aColor = mix (aClr0, clamp (Radiance (aRay, aInvDirect), 0.f, 1.f), 1.f / uSamples);\n" + " }\n" + "\n" + " OutColor = aColor;\n" + "\n" + "#endif\n" + "}\n"; diff --git a/src/ShapeExtend/ShapeExtend.cxx b/src/ShapeExtend/ShapeExtend.cxx index 617749712f..60cafd6ad9 100644 --- a/src/ShapeExtend/ShapeExtend.cxx +++ b/src/ShapeExtend/ShapeExtend.cxx @@ -14,9 +14,13 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include -#include +#include +#include + +#include "../SHMessage/SHMessage_SHAPE_us.pxx" //======================================================================= //function : Init @@ -30,7 +34,17 @@ void ShapeExtend::Init() init = Standard_True; // load Message File for Shape Healing - Message_MsgFile::LoadFromEnv ("CSF_SHMessage", "SHAPE"); + if (!Message_MsgFile::HasMsg ("ShapeFix.FixSmallSolid.MSG0")) + { + if (!Message_MsgFile::LoadFromEnv ("CSF_SHMessage", "SHAPE")) + { + Message_MsgFile::LoadFromString (SHMessage_SHAPE_us, sizeof(SHMessage_SHAPE_us) - 1); + } + if (!Message_MsgFile::HasMsg ("ShapeFix.FixSmallSolid.MSG0")) + { + Standard_ProgramError::Raise ("Critical Error - message resources for ShapeExtend are invalid or undefined!"); + } + } } //======================================================================= diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx index 1387b55842..3778c29230 100644 --- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx +++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx @@ -872,9 +872,6 @@ void ShapeProcess_OperLibrary::Init () done = Standard_True; ShapeExtend::Init(); - - // load message file for Shape Processing - Message_MsgFile::LoadFromEnv ("CSF_SHMessage", "SHAPE"); ShapeProcess::RegisterOperator ( "DirectFaces", new ShapeProcess_UOperator ( directfaces ) ); ShapeProcess::RegisterOperator ( "SameParameter", new ShapeProcess_UOperator ( sameparam ) ); diff --git a/src/TObj/FILES b/src/TObj/FILES index fa51a748a7..7203231057 100755 --- a/src/TObj/FILES +++ b/src/TObj/FILES @@ -44,3 +44,4 @@ TObj_TReference.cxx TObj_TReference.hxx TObj_TXYZ.cxx TObj_TXYZ.hxx +TObj_TObj_msg.pxx diff --git a/src/TObj/TObj_Application.cxx b/src/TObj/TObj_Application.cxx index cb6391e9e0..7b0fd73225 100644 --- a/src/TObj/TObj_Application.cxx +++ b/src/TObj/TObj_Application.cxx @@ -23,10 +23,13 @@ #include #include #include +#include #include #include +#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; } diff --git a/src/TObj/TObj_TObj_msg.pxx b/src/TObj/TObj_TObj_msg.pxx new file mode 100644 index 0000000000..bdda06ea5c --- /dev/null +++ b/src/TObj/TObj_TObj_msg.pxx @@ -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"; diff --git a/src/TObjDRAW/TObjDRAW.cxx b/src/TObjDRAW/TObjDRAW.cxx index 5f1d9dbc00..873eabe6f0 100644 --- a/src/TObjDRAW/TObjDRAW.cxx +++ b/src/TObjDRAW/TObjDRAW.cxx @@ -462,9 +462,6 @@ void TObjDRAW::Init(Draw_Interpretor& di) static Standard_Boolean initactor = Standard_False; if (initactor) return; initactor = Standard_True; - // load TObjOcaf base data model messages - Message_MsgFile::Load( ::getenv( "CSF_TObjResources" ), "TObj.msg" ); - //===================================== // General commands //===================================== diff --git a/src/Units/Units.cxx b/src/Units/Units.cxx index 58ca07a439..dda3338d51 100644 --- a/src/Units/Units.cxx +++ b/src/Units/Units.cxx @@ -83,17 +83,12 @@ Handle(Units_UnitsDictionary) Units::DictionaryOfUnits(const Standard_Boolean am // cout<<"Allocation du dictionnaire"<Creates(unitsfile.ToCString()); + unitsdictionary->Creates(); } else if(amode) { // cout<<"Creation du dictionnaire"<Creates(unitsfile.ToCString()); - } - else if(!unitsdictionary->UpToDate()) - { -// cout<<"Creation du dictionnaire"<Creates(unitsfile.ToCString()); + unitsdictionary->Creates(); } return unitsdictionary; } @@ -178,11 +173,7 @@ Handle(Units_Lexicon) Units::LexiconUnits(const Standard_Boolean amode) // cout<<"Allocation du lexique d'unites"<Creates(lexiconfile.ToCString(),unitsfile.ToCString(),amode); - } - else if(!lexiconunits->UpToDate()) { -// cout<<"Creation du lexique d'unites"<Creates(lexiconfile.ToCString(),unitsfile.ToCString(),amode); + lexiconunits->Creates(amode); } return lexiconunits; } @@ -199,11 +190,7 @@ Handle(Units_Lexicon) Units::LexiconFormula() // cout<<"Allocation du lexique d'expression"<Creates(lexiconfile.ToCString()); - } - else if(!lexiconformula->UpToDate()) { -// cout<<"Creation du lexique d'expression"<Creates(lexiconfile.ToCString()); + lexiconformula->Creates(); } return lexiconformula; } diff --git a/src/Units/Units_Lexicon.cxx b/src/Units/Units_Lexicon.cxx index 156598dc71..aa99d04616 100644 --- a/src/Units/Units_Lexicon.cxx +++ b/src/Units/Units_Lexicon.cxx @@ -16,8 +16,6 @@ #include -#include -#include #include #include #include @@ -25,11 +23,75 @@ IMPLEMENT_STANDARD_RTTIEXT(Units_Lexicon,MMgt_TShared) -#ifdef _MSC_VER -# include -#else -#include -#endif // _MSC_VER +namespace +{ + + //! Lexicon item + struct LexiconItem + { + char Prefix[10]; //!< prefix or symbol (e.g. "k" for kilo) + char Operation[2]; //!< operation + double Value; //!< numeric parameter (e.g. multiplier) + }; + + //! Lexicon table. + //! + //! Original table (UnitsAPI/Lexi_Expr.dat) used symbols from extended ASCII, + //! which should not be used within UTF-8 text. + //! + //! This table preserves these codes for compatibility. + //! UTF-8 items might be uncommented after updating UnitsAPI/Units.dat + //! and analysis of further consequences. + static const LexiconItem THE_LEXICON[] = + { + // scope + { "(", "S", 0.0 }, + { ")", "S", 0.0 }, + // operators + { "+", "O", 0.0 }, + { "-", "O", 0.0 }, + { "*", "O", 0.0 }, + { ".", "O", 0.0 }, + { "/", "O", 0.0 }, + { "**", "O", 0.0 }, + // ^2, power of two + { "\xB2", "P", 2.0 }, // ISO 8859-1/ISO Latin-1 (extended ASCII) + //{ "\xC2\xB2", "P", 2.0 }, // UTF-8 + { "p2", "P", 2.0 }, + { "sq.", "P", 2.0 }, + // ^3, power of three + { "\xB3", "P", 3.0 }, // ISO 8859-1/ISO Latin-1 (extended ASCII) + //{ "\xC2\xB3", "P", 3.0 }, // UTF-8 + { "cu.", "P", 3.0 }, + // multipliers + { "y", "M", 1.E-24 }, // yocto + { "z", "M", 1.E-21 }, // zepto + { "a", "M", 1.E-18 }, // atto + { "f", "M", 1.E-15 }, // femto + { "p", "M", 1.E-12 }, // pico + { "n", "M", 1.E-09 }, // nano + { "\xB5", "M", 1.E-06 }, // micro, ISO 8859-1/ISO Latin-1 (extended ASCII) + //{ "\xC2\xB5", "M", 1.E-06 }, // micro, UTF-8 + { "m", "M", 1.E-03 }, // milli + { "c", "M", 1.E-02 }, // centi + { "d", "M", 1.E-01 }, // deci + { "da", "M", 1.E+01 }, // deca + { "h", "M", 1.E+02 }, // hecto + { "k", "M", 1.E+03 }, // kilo + { "M", "M", 1.E+06 }, // mega + { "G", "M", 1.E+09 }, // giga + { "T", "M", 1.E+12 }, // tera + { "P", "M", 1.E+15 }, // peta + { "E", "M", 1.E+18 }, // exa + { "Z", "M", 1.E+21 }, // zetta + { "Y", "M", 1.E+24 }, // yotta + // Pi constant + { "\xB6", "", M_PI }, // Pilcrow sign, ISO 8859-1/ISO Latin-1 (extended ASCII) + //{ "\xCF\x80", "", M_PI }, // UTF-8 + { "Pi", "", M_PI }, + }; + +} //======================================================================= //function : Units_Lexicon @@ -46,98 +108,26 @@ Units_Lexicon::Units_Lexicon() //purpose : //======================================================================= -static inline bool strrightadjust (char *str) +void Units_Lexicon::Creates() { - for (size_t len = strlen(str); len > 0 && IsSpace (str[len-1]); len--) - str[len-1] = '\0'; - return str[0] != '\0'; -} - -void Units_Lexicon::Creates(const Standard_CString afilename) -{ - std::ifstream file; - OSD_OpenStream (file, afilename, std::ios::in); - if(!file) { -#ifdef OCCT_DEBUG - cout<<"unable to open "<IsEmpty()) { - token = new Units_Token(chain,oper,value); - thesequenceoftokens->Prepend(token); + const Standard_Integer aNbLexiItems = sizeof(THE_LEXICON) / sizeof(LexiconItem); + for (Standard_Integer anItemIter = 0; anItemIter < aNbLexiItems; ++anItemIter) + { + const LexiconItem& anItem = THE_LEXICON[anItemIter]; + if (thesequenceoftokens->IsEmpty()) + { + Handle(Units_Token) aToken = new Units_Token (anItem.Prefix, anItem.Operation, anItem.Value); + thesequenceoftokens->Prepend (aToken); } - else { - AddToken(chain,oper,value); + else + { + AddToken (anItem.Prefix, anItem.Operation, anItem.Value); } } - file.close(); } - -//======================================================================= -//function : UpToDate -//purpose : -//======================================================================= - -Standard_Boolean Units_Lexicon::UpToDate() const -{ - TCollection_AsciiString aPath = FileName(); - Standard_Time aTime = OSD_FileStatCTime (aPath.ToCString()); - return aTime != 0 - && aTime <= thetime; -} - - -//======================================================================= -//function : FileName -//purpose : -//======================================================================= - -TCollection_AsciiString Units_Lexicon::FileName() const -{ - return thefilename->String(); -} - - //======================================================================= //function : AddToken //purpose : diff --git a/src/Units/Units_Lexicon.hxx b/src/Units/Units_Lexicon.hxx index fb98d6292d..24b7f871e6 100644 --- a/src/Units/Units_Lexicon.hxx +++ b/src/Units/Units_Lexicon.hxx @@ -48,19 +48,11 @@ public: //! Reads the file to create a sequence of tokens //! stored in . - Standard_EXPORT void Creates (const Standard_CString afilename); + Standard_EXPORT void Creates (); //! Returns the first item of the sequence of tokens. Handle(Units_TokensSequence) Sequence() const; - - //! Returns in a AsciiString from TCollection the name of the file. - Standard_EXPORT TCollection_AsciiString FileName() const; - - //! Returns true if the file has not changed since the - //! creation of the Lexicon object. Returns false - //! otherwise. - Standard_EXPORT virtual Standard_Boolean UpToDate() const; - + //! Adds to the lexicon a new token with , , //! as arguments. If there is already a token //! with the field equal to , the @@ -82,9 +74,6 @@ protected: private: - - Handle(TCollection_HAsciiString) thefilename; - Standard_Time thetime; Handle(Units_TokensSequence) thesequenceoftokens; diff --git a/src/Units/Units_UnitsDictionary.cxx b/src/Units/Units_UnitsDictionary.cxx index a9d974f46d..7d5f5d2ec6 100644 --- a/src/Units/Units_UnitsDictionary.cxx +++ b/src/Units/Units_UnitsDictionary.cxx @@ -37,6 +37,8 @@ #include #include +#include "../UnitsAPI/UnitsAPI_Units_dat.pxx" + #include IMPLEMENT_STANDARD_RTTIEXT(Units_UnitsDictionary,MMgt_TShared) @@ -53,14 +55,51 @@ Units_UnitsDictionary::Units_UnitsDictionary() //purpose : //======================================================================= -static inline bool strrightadjust (char *str) +namespace { - for (size_t len = strlen(str); len > 0 && IsSpace (str[len-1]); len--) - str[len-1] = '\0'; - return str[0] != '\0'; + + //! Auxiliary method removing trailing spaces. + static bool strrightadjust (char *str) + { + for (size_t len = strlen(str); len > 0 && IsSpace (str[len-1]); len--) + { + str[len-1] = '\0'; + } + return str[0] != '\0'; + } + + //! Auxiliary method for iterating string line-by-line. + static const char* readLine (TCollection_AsciiString& theLine, + const char* theString) + { + theLine.Clear(); + if (theString == NULL) + { + return NULL; + } + + for (const char* aCharIter = theString;; ++aCharIter) + { + if (*aCharIter == '\0') + { + return NULL; + } + + if (*aCharIter == '\n') + { + const Standard_Integer aLineLen = Standard_Integer(aCharIter - theString); + if (aLineLen != 0) + { + theLine = TCollection_AsciiString (theString, aLineLen); + } + return aCharIter + 1; + } + } + } + } -void Units_UnitsDictionary::Creates(const Standard_CString afilename) +void Units_UnitsDictionary::Creates() { Standard_Boolean ismove; Standard_Integer i, j, k, charnumber, unitscomputed; @@ -71,36 +110,23 @@ void Units_UnitsDictionary::Creates(const Standard_CString afilename) Handle(Units_ShiftedUnit) shiftedunit; Handle(Units_Quantity) quantity; - std::ifstream file; - OSD_OpenStream (file, afilename, std::ios::in); - if(!file) { -#ifdef OCCT_DEBUG - cout<<"unable to open "<Sequence(); - for(int ii=1; ii<=tmpSeq->Length(); ii++) { - token = tmpSeq->Value(ii); - cout<<"i="<Word().ToCString()<<" " - <Mean().ToCString()<<" "<Value()<String().ToCString()); - return aTime != 0 - && aTime == thetime; -} - //======================================================================= //function : ActiveUnit //purpose : diff --git a/src/Units/Units_UnitsDictionary.hxx b/src/Units/Units_UnitsDictionary.hxx index 40d1358206..da21e78b96 100644 --- a/src/Units/Units_UnitsDictionary.hxx +++ b/src/Units/Units_UnitsDictionary.hxx @@ -48,17 +48,12 @@ public: //! Returns a UnitsDictionary object which contains the //! sequence of all the units you want to consider, //! physical quantity by physical quantity. - Standard_EXPORT void Creates (const Standard_CString afilename); + Standard_EXPORT void Creates (); //! Returns the head of the sequence of physical //! quantities. - Handle(Units_QuantitiesSequence) Sequence() const; - - //! Returns true if there has been no modification of the - //! file Units.dat since the creation of the dictionary - //! object, false otherwise. - Standard_EXPORT Standard_Boolean UpToDate() const; - + Handle(Units_QuantitiesSequence) Sequence() const; + //! Returns for the active unit. Standard_EXPORT TCollection_AsciiString ActiveUnit (const Standard_CString aquantity) const; @@ -85,8 +80,6 @@ protected: private: - Handle(TCollection_HAsciiString) thefilename; - Standard_Time thetime; Handle(Units_QuantitiesSequence) thequantitiessequence; diff --git a/src/Units/Units_UnitsLexicon.cxx b/src/Units/Units_UnitsLexicon.cxx index 50cb2e4862..3017785069 100644 --- a/src/Units/Units_UnitsLexicon.cxx +++ b/src/Units/Units_UnitsLexicon.cxx @@ -38,49 +38,12 @@ Units_UnitsLexicon::Units_UnitsLexicon() : Units_Lexicon() //purpose : //======================================================================= -void Units_UnitsLexicon::Creates(const Standard_CString afilename1, - const Standard_CString afilename2, - const Standard_Boolean amode) +void Units_UnitsLexicon::Creates(const Standard_Boolean amode) { Handle(Units_UnitsDictionary) unitsdictionary; - thefilename = new TCollection_HAsciiString(afilename2); - Standard_Time aTime2 = OSD_FileStatCTime (afilename2); - if (aTime2 != 0) - { - thetime = aTime2; - } - - Units_Lexicon::Creates(afilename1); + Units_Lexicon::Creates(); if(amode)unitsdictionary = Units::DictionaryOfUnits(amode); } - -//======================================================================= -//function : UpToDate -//purpose : -//======================================================================= - -Standard_Boolean Units_UnitsLexicon::UpToDate() const -{ - TCollection_AsciiString aPath = FileName2(); - if (!Units_Lexicon::UpToDate()) - { - return Standard_False; - } - - Standard_Time aTime = OSD_FileStatCTime (aPath.ToCString()); - return aTime != 0 - && aTime <= thetime; -} - -//======================================================================= -//function : FileName2 -//purpose : -//======================================================================= - -TCollection_AsciiString Units_UnitsLexicon::FileName2() const -{ - return thefilename->String(); -} diff --git a/src/Units/Units_UnitsLexicon.hxx b/src/Units/Units_UnitsLexicon.hxx index ceaddee5e3..fefa4576f3 100644 --- a/src/Units/Units_UnitsLexicon.hxx +++ b/src/Units/Units_UnitsLexicon.hxx @@ -40,23 +40,14 @@ class Units_UnitsLexicon : public Units_Lexicon public: - //! Returns an empty instance of UnitsLexicon Standard_EXPORT Units_UnitsLexicon(); //! Reads the files and to //! create a sequence of tokens stored in //! . - Standard_EXPORT void Creates (const Standard_CString afilename1, const Standard_CString afilename2, const Standard_Boolean amode = Standard_True); - - //! Returns in a AsciiString from TCollection the name of the file. - Standard_EXPORT TCollection_AsciiString FileName2() const; - - //! Returns true if the file has not changed since the - //! creation of the Lexicon object. Returns false - //! otherwise. - Standard_EXPORT virtual Standard_Boolean UpToDate() const Standard_OVERRIDE; - + Standard_EXPORT void Creates (const Standard_Boolean amode = Standard_True); + //! Useful for debugging. virtual void Dump() const Standard_OVERRIDE; @@ -69,14 +60,9 @@ protected: - private: - Handle(TCollection_HAsciiString) thefilename; - Standard_Time thetime; - - }; diff --git a/src/UnitsAPI/FILES b/src/UnitsAPI/FILES index d8577571ef..b17a136111 100755 --- a/src/UnitsAPI/FILES +++ b/src/UnitsAPI/FILES @@ -1,8 +1,8 @@ CurrentUnits -Lexi_Expr.dat MDTVBaseUnits MDTVCurrentUnits Units.dat UnitsAPI.cxx UnitsAPI.hxx UnitsAPI_SystemUnits.hxx +UnitsAPI_Units_dat.pxx diff --git a/src/UnitsAPI/Lexi_Expr.dat b/src/UnitsAPI/Lexi_Expr.dat deleted file mode 100755 index 6c50ceb9f6..0000000000 --- a/src/UnitsAPI/Lexi_Expr.dat +++ /dev/null @@ -1,38 +0,0 @@ -( S -) S - -+ O -- O -* O -. O -/ O -** O - -² P 2 -p2 P 2 -sq. P 2 -³ P 3 -cu. P 3 -y M 1.E-24 -z M 1.E-21 -a M 1.E-18 -f M 1.E-15 -p M 1.E-12 -n M 1.E-09 -µ M 1.E-06 -m M 1.E-03 -c M 1.E-02 -d M 1.E-01 -da M 1.E+01 -h M 1.E+02 -k M 1.E+03 -M M 1.E+06 -G M 1.E+09 -T M 1.E+12 -P M 1.E+15 -E M 1.E+18 -Z M 1.E+21 -Y M 1.E+24 - -¶ 3.14159265358979323846 -Pi 3.14159265358979323846 diff --git a/src/UnitsAPI/Units.dat b/src/UnitsAPI/Units.dat index f797fdf710..a9a1a54fa9 100755 --- a/src/UnitsAPI/Units.dat +++ b/src/UnitsAPI/Units.dat @@ -10,7 +10,7 @@ percent % MASS 1 0 0 0 0 0 0 0 0 .................................................................................................................................... gram g .001 -carat métrique ct .2 g +metric carat ct .2 g quintal q 100 kg tonne t 1000 kg @@ -21,7 +21,6 @@ apothecaries'ounce oz_apoth(U.K.) ounce oz 437.5 gr pound lb 16 oz cental cental 100 lb -benne à charbon benne_à_charbon 100 lb short hundredweight sh.cwt 100 lb hundredweight cwt 112 lb short ton sh.ton 2000 lb @@ -31,11 +30,11 @@ ton ton LENGTH 0 1 0 0 0 0 0 0 0 .................................................................................................................................... meter m -angström Å 1.E-10 m +angstrom \xC5 1.E-10 m angstrom brasse brasse 1.8288 m arpent (Quebec) arpent_longueur 58.47131 m -micron µ 10000 Å +micron \xB5 10000 \xC5 micron mille mille 1852 m @@ -63,29 +62,29 @@ minute of time min hour h 60 min day j 24 h year y 365.25 j -année sidérale année_sidérale 3.155815E+07 s -année tropique a_trop 3.155693E+07 s +sidereal year a_side 3.155815E+07 s +tropical year a_trop 3.155693E+07 s .................................................................................................................................... M L T I K N J P S ELECTRIC CURRENT 0 0 0 1 0 0 0 0 0 .................................................................................................................................... ampere A biot Bi 10 A -gilbert gilbert (10/4*¶) A +gilbert gilbert (10/4*\xB6) A .................................................................................................................................... M L T I K N J P S THERMODYNAMIC TEMPERATURE 0 0 0 0 1 0 0 0 0 .................................................................................................................................... -Kelvin degree of temperature °K +Kelvin degree of temperature \260K deg.K -Celsius degree of temperature °C [273.15] °K +Celsius degree of temperature \260C [273.15] \260K deg.C -Rankine degree of temperature °R (5/9) °K +Rankine degree of temperature \260R (5/9) \260K deg.R -Fahrenheit degree of temperature °F [(1379/3)] °R +Fahrenheit degree of temperature \260F [(1379/3)] \260R deg.F .................................................................................................................................... M L T I K N J P S @@ -106,44 +105,44 @@ radian rad second of angle " minute of angle ' 60 " -degre of angle ° 60 ' +degre of angle \xB0 60 ' deg -right angle L 90 ° -revolution tr 360 ° - (2*¶) rad +right angle L 90 \xB0 +revolution tr 360 \xB0 + (2*\xB6) rad grade gra 54 ' .................................................................................................................................... M L T I K N J P S SOLID ANGLE 0 0 0 0 0 0 0 0 1 .................................................................................................................................... steradian sr -spat sp (4*¶) sr +spat sp (4*\xB6) sr .................................................................................................................................... M L T I K N J P S AREA 0 2 0 0 0 0 0 0 0 .................................................................................................................................... -barn b 1.E-28 m² -are a 100 m² -arpent (Quebec) arpent_superficie 3418.894 m² +barn b 1.E-28 m\xB2 +are a 100 m\xB2 +arpent (Quebec) arpent_superficie 3418.894 m\xB2 acre acre 4840 sq.yd. .................................................................................................................................... M L T I K N J P S VOLUME 0 3 0 0 0 0 0 0 0 .................................................................................................................................... -liter l .001 m³ -stere of wood st 1 m³ +liter l .001 m\xB3 +stere of wood st 1 m\xB3 liquid pint (U.S.) liq.pt. 28.87429 cu.in. liquid quart (U.S.) liq.quart(U.S.) 2 liq.pt. dry quart (U.S.) dry_quart(U.S.) 67.1989 cu.in. gallon (U.S.) gal(U.S.) 4 liq.quart(U.S.) bushel (U.S.) bu(U.S.) 1.244430 cu.ft. -fluid ounce (U.S.) fl.oz(U.S.) 29.5729 cm³ +fluid ounce (U.S.) fl.oz(U.S.) 29.5729 cm\xB3 baril (U.S.) baril(U.S.) 42 gal(U.S.) -barrel (U.S.) barrel(U.S.) .158987 m³ +barrel (U.S.) barrel(U.S.) .158987 m\xB3 -baril (mesure sèche) (U.S.) bbl .115627 m³ +dry barrel (U.S.) bbl .115627 m\xB3 pint (U.K.) pt. 34.67636 cu.in. pt @@ -151,10 +150,10 @@ pint (U.K.) pt. quart (U.K.) quart(U.K.) 2 pt. gallon (U.K.) gal(U.K.) 4 quart(U.K.) bushel (U.K.) bu(U.K.) 1.284315 cu.ft. -fluid ounce (U.K.) fl.oz(U.K.) 28.4122 cm³ +fluid ounce (U.K.) fl.oz(U.K.) 28.4122 cm\xB3 baril (U.K.) baril(U.K.) 36 gal(U.K.) -board foot board_foot 2.36E-03 m³ +board foot board_foot 2.36E-03 m\xB3 registered ton regis.ton 100 cu.ft. shipping ton shipp.ton 40 cu.ft. tonneau tonneau 1 regis.ton @@ -180,7 +179,7 @@ noeud noeud M L T I K N J P S ACCELERATION 0 1 -2 0 0 0 0 0 0 .................................................................................................................................... -gal Gal .01 m/s² +gal Gal .01 m/s\xB2 .................................................................................................................................... M L T I K N J P S FREQUENCY 0 0 -1 0 0 0 0 0 0 @@ -253,21 +252,21 @@ barye barye millimeter of water mm_CE 9.80665 Pa millimeter of mercury mm_Hg 133.322 Pa pieze pz 1000 Pa -inch of water in.H²O 249.089 Pa -foot of water ft.H²O 2989 Pa +inch of water in.H\xB2O 249.089 Pa +foot of water ft.H\xB2O 2989 Pa inch of mercury in.Hg 3386.39 Pa pound force per square inch psi 0.0689476 bar .................................................................................................................................... M L T I K N J P S DYNAMIC VISCOSITY 1 -1 -1 0 0 0 0 0 0 .................................................................................................................................... -poise Po 1 gf/cm².s +poise Po 1 gf/cm\xB2.s poiseuille Pl 10 Po .................................................................................................................................... M L T I K N J P S KINETIC VISCOSITY 0 2 -1 0 0 0 0 0 0 .................................................................................................................................... -stoke St .00001 m²/s +stoke St .00001 m\xB2/s .................................................................................................................................... M L T I K N J P S TENSION SUPERFICIELLE 1 0 -2 0 0 0 0 0 0 @@ -284,9 +283,8 @@ ENERGY 1 2 -2 0 joule J electron-volt eV 1.59E-19 J erg erg 1.E-07 J -calorie (diététique) cal_di 4.1855 J -calorie (internationale) ou calorie IT cal 4.1868 J -calorie 15 °C cal_15 4.1855 J +calorie (International) IT cal 4.1868 J +calorie (15 celsius degrees) cal_15 4.1855 J calorie (thermochimie) calorie(thermochimie) 4.184 J thermie th 1000000 cal @@ -294,8 +292,8 @@ horse-power-hour HP-h british thermal unit (International Table) Btu 1055.056 J british thermal unit (moyenne) Btu_a 1055.87 J british thermal unit (thermochimie) Btu_c 1054.35 J -british thermal unit (à 39°F) Btu_39 1059.67 J -british thermal unit (à 60°F) Btu_60 1054.68 J +british thermal unit (Btu-39F) Btu_39 1059.67 J +british thermal unit (Btu-60F) Btu_60 1054.68 J .................................................................................................................................... M L T I K N J P S POWER 1 2 -3 0 0 0 0 0 0 @@ -353,8 +351,8 @@ lumen Lu M L T I K N J P S LUMINANCE 0 -2 0 0 0 0 1 0 0 .................................................................................................................................... -stilb sb 1.E+04 cd/m² -apostilb asb 0.318 cd/m² +stilb sb 1.E+04 cd/m\xB2 +apostilb asb 0.318 cd/m\xB2 .................................................................................................................................... M L T I K N J P S EXITANCE 0 -2 0 0 0 0 1 0 1 @@ -374,7 +372,7 @@ LUMINOUS EFFICACITY -1 -2 3 0 ELECTRIC CHARGE 0 0 1 1 0 0 0 0 0 .................................................................................................................................... coulomb C -ampère-heure Ah 3.6E+03 C +ampere-hour Ah 3.6E+03 C franklin Fr 333.563E-12 C .................................................................................................................................... M L T I K N J P S @@ -389,7 +387,7 @@ farad F M L T I K N J P S MAGNETIC FIELD 0 -1 0 1 0 0 0 0 0 .................................................................................................................................... -oersted oersted (1000/4*¶) A/m +oersted oersted (1000/4*\xB6) A/m .................................................................................................................................... M L T I K N J P S MAGNETIC FLUX 1 2 -2 -1 0 0 0 0 0 diff --git a/src/UnitsAPI/UnitsAPI.cxx b/src/UnitsAPI/UnitsAPI.cxx index 8b00c3a88d..6adb509960 100644 --- a/src/UnitsAPI/UnitsAPI.cxx +++ b/src/UnitsAPI/UnitsAPI.cxx @@ -38,36 +38,6 @@ static UnitsAPI_SystemUnits currentSystem = UnitsAPI_DEFAULT; void UnitsAPI::CheckLoading (const UnitsAPI_SystemUnits aSystemUnits) { if( currentSystem != aSystemUnits || CurrentUnits.IsNull()) { - OSD_Environment env1("CSF_UnitsLexicon"); - TCollection_AsciiString slexiconfile(env1.Value()); - if( slexiconfile.Length() > 0 ) - Units::LexiconFile(slexiconfile.ToCString()); - else { - OSD_Environment CasRootEnv("CASROOT"); - TCollection_AsciiString CasRootString(CasRootEnv.Value()); - if (CasRootString.Length() > 0 ) { - CasRootString += "/src/UnitsAPI/Lexi_Expr.dat" ; - Units::LexiconFile(CasRootString.ToCString()); - } - else { - Standard_NoSuchObject::Raise("environment variable CSF_UnitsLexicon undefined"); - } - } - OSD_Environment env2("CSF_UnitsDefinition"); - TCollection_AsciiString sunitsfile(env2.Value()); - if( sunitsfile.Length() > 0 ) - Units::UnitsFile(sunitsfile.ToCString()); - else { - OSD_Environment CasRootEnv("CASROOT"); - TCollection_AsciiString CasRootString(CasRootEnv.Value()); - if (CasRootString.Length() > 0 ) { - CasRootString += "/src/UnitsAPI/Units.dat"; - Units::UnitsFile(CasRootString.ToCString()); - } - else { - Standard_NoSuchObject::Raise("environment variable CSF_UnitsDefinition undefined"); - } - } switch (aSystemUnits) { case UnitsAPI_DEFAULT : if( !CurrentUnits.IsNull() ) break; diff --git a/src/UnitsAPI/UnitsAPI_Units_dat.pxx b/src/UnitsAPI/UnitsAPI_Units_dat.pxx new file mode 100644 index 0000000000..629ed8220a --- /dev/null +++ b/src/UnitsAPI/UnitsAPI_Units_dat.pxx @@ -0,0 +1,484 @@ +// This file has been automatically generated from resource file src/UnitsAPI/Units.dat + +static const char UnitsAPI_Units_dat[] = + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "DIMENSIONLESS 0 0 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "no unit K 1.\n" + "percent % 0.01 K\n" + "\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MASS 1 0 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "gram g .001\n" + "metric carat ct .2 g\n" + "quintal q 100 kg\n" + "tonne t 1000 kg\n" + "\n" + "grain gr .06479891 g\n" + "apothecaries'dram (U.S.) dram_ap 3.88793E-03 kg\n" + "apothecaries'ounce oz_apoth(U.K.) 3.11035E-02 kg\n" + " oz_ap(U.S.)\n" + "ounce oz 437.5 gr\n" + "pound lb 16 oz\n" + "cental cental 100 lb\n" + "short hundredweight sh.cwt 100 lb\n" + "hundredweight cwt 112 lb\n" + "short ton sh.ton 2000 lb\n" + "ton ton 2240 lb\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LENGTH 0 1 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "meter m\n" + "angstrom \xC5 1.E-10 m\n" + " angstrom\n" + "brasse brasse 1.8288 m\n" + "arpent (Quebec) arpent_longueur 58.47131 m\n" + "micron \xB5 10000 \xC5\n" + " micron\n" + "\n" + "mille mille 1852 m\n" + "light year Al 9.46053E+15 m\n" + "\n" + "inch in. 0.0254 m\n" + " in\n" + "caliber caliber 1 in.\n" + "foot ft. 12 in\n" + " ft\n" + "\n" + "yard yd. 3 ft.\n" + " yd\n" + "\n" + "statute mile stat.mile 1760 yd.\n" + "nautical mile naut.mile 1852 m\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "TIME 0 0 1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "second of time s\n" + "minute of time min 60 s\n" + " mn\n" + "\n" + "hour h 60 min\n" + "day j 24 h\n" + "year y 365.25 j\n" + "sidereal year a_side 3.155815E+07 s\n" + "tropical year a_trop 3.155693E+07 s\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC CURRENT 0 0 0 1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "ampere A \n" + "biot Bi 10 A \n" + "gilbert gilbert (10/4*\xB6) A\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "THERMODYNAMIC TEMPERATURE 0 0 0 0 1 0 0 0 0\n" + "....................................................................................................................................\n" + "Kelvin degree of temperature \260K\n" + " deg.K\n" + "\n" + "Celsius degree of temperature \260C [273.15] \260K\n" + " deg.C\n" + "\n" + "Rankine degree of temperature \260R (5/9) \260K\n" + " deg.R\n" + "\n" + "Fahrenheit degree of temperature \260F [(1379/3)] \260R\n" + " deg.F\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "AMOUNT OF SUBSTANCE 0 0 0 0 0 1 0 0 0\n" + "....................................................................................................................................\n" + "mole mol\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LUMINOUS INTENSITY 0 0 0 0 0 0 1 0 0\n" + "....................................................................................................................................\n" + "candela cd\n" + "bougie nouvelle bougie_nouvelle 1 cd\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "PLANE ANGLE 0 0 0 0 0 0 0 1 0\n" + "....................................................................................................................................\n" + "radian rad\n" + "second of angle \"\n" + "minute of angle ' 60 \"\n" + "\n" + "degre of angle \xB0 60 '\n" + " deg\n" + "\n" + "right angle L 90 \xB0\n" + "revolution tr 360 \xB0\n" + " (2*\xB6) rad\n" + "grade gra 54 '\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "SOLID ANGLE 0 0 0 0 0 0 0 0 1\n" + "....................................................................................................................................\n" + "steradian sr\n" + "spat sp (4*\xB6) sr\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "AREA 0 2 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "barn b 1.E-28 m\xB2\n" + "are a 100 m\xB2\n" + "arpent (Quebec) arpent_superficie 3418.894 m\xB2\n" + "acre acre 4840 sq.yd. \n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "VOLUME 0 3 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "liter l .001 m\xB3\n" + "stere of wood st 1 m\xB3\n" + "\n" + "liquid pint (U.S.) liq.pt. 28.87429 cu.in.\n" + "liquid quart (U.S.) liq.quart(U.S.) 2 liq.pt.\n" + "dry quart (U.S.) dry_quart(U.S.) 67.1989 cu.in.\n" + "gallon (U.S.) gal(U.S.) 4 liq.quart(U.S.) \n" + "bushel (U.S.) bu(U.S.) 1.244430 cu.ft.\n" + "fluid ounce (U.S.) fl.oz(U.S.) 29.5729 cm\xB3\n" + "baril (U.S.) baril(U.S.) 42 gal(U.S.)\n" + "barrel (U.S.) barrel(U.S.) .158987 m\xB3\n" + "\n" + "dry barrel (U.S.) bbl .115627 m\xB3\n" + "\n" + "pint (U.K.) pt. 34.67636 cu.in.\n" + " pt\n" + "\n" + "quart (U.K.) quart(U.K.) 2 pt.\n" + "gallon (U.K.) gal(U.K.) 4 quart(U.K.)\n" + "bushel (U.K.) bu(U.K.) 1.284315 cu.ft.\n" + "fluid ounce (U.K.) fl.oz(U.K.) 28.4122 cm\xB3\n" + "baril (U.K.) baril(U.K.) 36 gal(U.K.)\n" + "\n" + "board foot board_foot 2.36E-03 m\xB3\n" + "registered ton regis.ton 100 cu.ft.\n" + "shipping ton shipp.ton 40 cu.ft.\n" + "tonneau tonneau 1 regis.ton\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "INERTIA 0 4 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "\n" + "\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ANGULAR SPEED 0 0 -1 0 0 0 0 1 0\n" + "....................................................................................................................................\n" + "revolution per minute r.p.m. 1 tr/min\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "SPEED 0 1 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "knot(U.K.) kn 1 naut.mile/h\n" + "mile per hour m.p.h. 1 stat.mile/h\n" + "noeud noeud 1 mille/h\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ACCELERATION 0 1 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "gal Gal .01 m/s\xB2\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "FREQUENCY 0 0 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "hertz Hz \n" + "baud baud 1 Hz\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ACTIVITY (OF A RADIONUCLEIDE) 0 0 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "becquerel Be\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "VOLUMIC MASS 1 -3 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MASS FLOW 1 0 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "VOLUME FLOW 0 3 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "CONSUMPTION 0 2 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "litre aux 100 kilometers l/100km\n" + "mile per gallon (U.S.) m.p.g.(U.S.) 235.2 l/100km\n" + "mile per gallon (U.K.) m.p.g.(U.K.) 282.5 l/100km\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "QUANTITY OF MOVEMENT 1 1 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "KINETIC MOMENT 1 2 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOMENT OF INERTIA 1 2 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "FORCE 1 1 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "newton N\n" + "dyne dyn 1.E-05 N\n" + "gram-force gf .00980665 N\n" + "poundal pdl 0.138255 N\n" + "pound-force lbf 4.44822 N\n" + "sthene sn 1000 N\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOMENT OF A FORCE 1 2 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LINEIC FORCE 1 0 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "PRESSURE 1 -1 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "pascal Pa\n" + "athmosphere atm 101325 Pa\n" + "athmosphere technique at 98066.5 Pa\n" + "bar bar 100000 Pa\n" + "barye barye 0.1 Pa\n" + "millimeter of water mm_CE 9.80665 Pa\n" + "millimeter of mercury mm_Hg 133.322 Pa\n" + "pieze pz 1000 Pa\n" + "inch of water in.H\xB2O 249.089 Pa\n" + "foot of water ft.H\xB2O 2989 Pa\n" + "inch of mercury in.Hg 3386.39 Pa\n" + "pound force per square inch psi 0.0689476 bar\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "DYNAMIC VISCOSITY 1 -1 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "poise Po 1 gf/cm\xB2.s\n" + "poiseuille Pl 10 Po\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "KINETIC VISCOSITY 0 2 -1 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "stoke St .00001 m\xB2/s\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "TENSION SUPERFICIELLE 1 0 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC POTENTIAL 1 2 -3 -1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "volt V\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ENERGY 1 2 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "joule J\n" + "electron-volt eV 1.59E-19 J\n" + "erg erg 1.E-07 J\n" + "calorie (International) IT cal 4.1868 J\n" + "calorie (15 celsius degrees) cal_15 4.1855 J\n" + "calorie (thermochimie) calorie(thermochimie) 4.184 J\n" + "thermie th 1000000 cal\n" + "\n" + "horse-power-hour HP-h 2684500 J\n" + "british thermal unit (International Table) Btu 1055.056 J\n" + "british thermal unit (moyenne) Btu_a 1055.87 J\n" + "british thermal unit (thermochimie) Btu_c 1054.35 J\n" + "british thermal unit (Btu-39F) Btu_39 1059.67 J\n" + "british thermal unit (Btu-60F) Btu_60 1054.68 J\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "POWER 1 2 -3 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "watt W\n" + "cheval-vapeur ch 735.5 W\n" + "poncelet poncelet 100 kgfm/s\n" + "var var 1 V.A \n" + "\n" + "horse-power HP 1.025 ch\n" + "ton of refrigeration ton_of_ref. 3516 W\n" + "british commercial ton of refrigeration brit.comm.ton_of_ref. 3883 W\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LINEIC POWER 1 1 -3 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "SURFACIC POWER 1 0 -3 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "VOLUMIC POWER 1 -1 -3 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "COEFFICIENT OF LINEAR INFLATION 0 0 0 0 -1 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "THERMICAL CONDUCTIVITY 1 1 -3 0 -1 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "THERMICAL CONVECTIVITY 1 0 -3 0 -1 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "THERMICAL MASSIC CAPACITY 0 2 -2 0 -1 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ENTROPY 1 2 -2 0 -1 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ENTHALPY 1 2 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LUMINOUS FLUX 0 0 0 0 0 0 1 0 1\n" + "....................................................................................................................................\n" + "lumen Lu\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LUMINANCE 0 -2 0 0 0 0 1 0 0\n" + "....................................................................................................................................\n" + "stilb sb 1.E+04 cd/m\xB2\n" + "apostilb asb 0.318 cd/m\xB2\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "EXITANCE 0 -2 0 0 0 0 1 0 1\n" + "....................................................................................................................................\n" + "lux lx \n" + "phot ph 1.E+04 lx\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LUMINOUS EXPOSITION 0 -2 1 0 0 0 1 0 1\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "LUMINOUS EFFICACITY -1 -2 3 0 0 0 1 0 1\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC CHARGE 0 0 1 1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "coulomb C\n" + "ampere-hour Ah 3.6E+03 C\n" + "franklin Fr 333.563E-12 C\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC FIELD 1 1 -3 -1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC CAPACITANCE -1 -2 4 2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "farad F\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MAGNETIC FIELD 0 -1 0 1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "oersted oersted (1000/4*\xB6) A/m\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MAGNETIC FLUX 1 2 -2 -1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MAGNETIC FLUX DENSITY 1 0 -2 -1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "tesla T\n" + "gauss Gs 1.E-04 T\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "FLUX OF MAGNETIC INDUCTION 1 2 -2 -1 0 0 0 0 0\n" + "....................................................................................................................................\n" + "weber Wb\n" + "maxwell Mx 1.E-08 Wb\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "INDUCTANCE 1 2 -2 -2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "henry H\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "RELUCTANCE -1 -2 2 2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC RESISTANCE 1 2 -3 -2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "ohm O\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ELECTRIC CONDUCTANCE -1 -2 3 2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "siemens S \n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "RESISTIVITY 1 3 -3 -2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "CONDUCTIVITY -1 -3 3 2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOLAR MASS 1 0 0 0 0 -1 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOLAR VOLUME 0 3 0 0 0 -1 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "CONCENTRATION 1 -3 0 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOLAR CONCENTRATION 0 -3 0 0 0 1 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "MOLARITY -1 0 0 0 0 1 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ACCOUSTIC INTENSITY 0 1 0 -2 0 0 0 0 0\n" + "....................................................................................................................................\n" + "bel B\n" + "neper Np 0.869 B\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ABSORBED DOSE 0 2 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "gray Gr\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "DOSE EQUIVALENT 0 2 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "sievert Si\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ROTATION ACCELERATION 0 0 -2 0 0 0 0 1 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "TRANSLATION STIFFNESS 1 0 -2 0 0 0 0 0 0\n" + "....................................................................................................................................\n" + "....................................................................................................................................\n" + " M L T I K N J P S\n" + "ROTATION STIFFNESS 1 2 -2 0 0 0 0 -1 0\n" + "....................................................................................................................................\n"; diff --git a/src/ViewerTest/ViewerTest_OpenGlCommands.cxx b/src/ViewerTest/ViewerTest_OpenGlCommands.cxx index d520f9959e..ff480030ab 100644 --- a/src/ViewerTest/ViewerTest_OpenGlCommands.cxx +++ b/src/ViewerTest/ViewerTest_OpenGlCommands.cxx @@ -552,14 +552,40 @@ static Standard_Integer VShaderProg (Draw_Interpretor& /*theDI*/, } TCollection_AsciiString aLastArg (theArgVec[theArgNb - 1]); - aLastArg.UpperCase(); - const Standard_Boolean toTurnOff = aLastArg == "OFF"; + aLastArg.LowerCase(); + const Standard_Boolean toTurnOff = aLastArg == "off"; Standard_Integer anArgsNb = theArgNb - 1; Handle(Graphic3d_ShaderProgram) aProgram; if (!toTurnOff - && aLastArg == "PHONG") + && aLastArg == "phong") { - aProgram = new Graphic3d_ShaderProgram (Graphic3d_ShaderProgram::ShaderName_Phong); + const TCollection_AsciiString& aShadersRoot = Graphic3d_ShaderProgram::ShadersFolder(); + if (aShadersRoot.IsEmpty()) + { + std::cerr << "Both environment variables CSF_ShadersDirectory and CASROOT are undefined!\n" + << "At least one should be defined to load Phong program.\n"; + return 1; + } + + const TCollection_AsciiString aSrcVert = aShadersRoot + "/PhongShading.vs"; + const TCollection_AsciiString aSrcFrag = aShadersRoot + "/PhongShading.fs"; + + if (!aSrcVert.IsEmpty() + && !OSD_File (aSrcVert).Exists()) + { + std::cerr << "Error: PhongShading.vs is not found\n"; + return 1; + } + if (!aSrcFrag.IsEmpty() + && !OSD_File (aSrcFrag).Exists()) + { + std::cerr << "Error: PhongShading.fs is not found\n"; + return 1; + } + + aProgram = new Graphic3d_ShaderProgram(); + aProgram->AttachShader (Graphic3d_ShaderObject::CreateFromFile (Graphic3d_TOS_VERTEX, aSrcVert)); + aProgram->AttachShader (Graphic3d_ShaderObject::CreateFromFile (Graphic3d_TOS_FRAGMENT, aSrcFrag)); } if (!toTurnOff && aProgram.IsNull()) diff --git a/src/XSMessage/FILES b/src/XSMessage/FILES index da4d8eaaef..774685fa9b 100755 --- a/src/XSMessage/FILES +++ b/src/XSMessage/FILES @@ -1,4 +1,3 @@ -msgfile:::IGES.fr -msgfile:::IGES.us msgfile:::XSTEP.fr msgfile:::XSTEP.us +XSMessage_XSTEP_us.pxx diff --git a/src/XSMessage/IGES.fr b/src/XSMessage/IGES.fr deleted file mode 100755 index d6919bd903..0000000000 --- a/src/XSMessage/IGES.fr +++ /dev/null @@ -1,766 +0,0 @@ -!PHASE CHARGEMENT -! les messages generaux sont factorises dans le fichier general pour XSTEP -.9 -Debut de la lecture du fichier IGES. -! -.10 -Fin de la lecture du fichier IGES. -! -.12 -L'Entete et le Contenu du fichier IGES sont charges. -! -.18 -Erreur de syntaxe dans le fichier IGES à la ligne %d de la section %s. -! -.19 -Erreur de syntaxe dans le fichier IGES à la ligne %d de la section %s (numero de ligne peut etre incorrecte). -! -.20 -Il n'y a pas de Terminate Section, veuillez verifier la fin du fichier. Le processus continue. -! -.27 -Entite %s : Directory Entry : Il n'y pas de parametre. Le processus continue. -! -.28 -Entite %s : Directory Entry : Le parametre 1 (Type de l'entite) est invalide. -! -.29 -Entite %s, Type %d : Directory Entry : Le champ 4 (Line Font Pattern) est invalide (Pointeur non nul ou Entier entre 0 et 5 attendu). -! -.30 -Entite %s, Type %d : Directory Entry : Le champ 5 (Level) est invalide (Pointeur ou Entier non nul attendu). -! -.31 -Entite %s, Type %d : Directory Entry : Le champ 6 (View) est invalide (Pointeur ou Entier non nul attendu). -! -.32 -Entite %s, Type %d : Directory Entry : Le champ 7 (Transformation Matrix) est invalide (Pointeur non nul ou Entier Zero attendu). -! -.33 -Entite %s, Type %d : Directory Entry : Le champ 8 (Label Display Associativity) est invalide (Pointeur non nul ou Entier Zero attendu). -! -.34 -Entite %s, Type %d : Directory Entry : Le champ 13 (Color Number) est invalide (Pointeur non nul ou Entier entre 0 et 8 attendu). -! -.35 -L'entite %s est nulle. -! -.36 -L'entite %s est inconnue. -! -.37 -Entite %s, Type %d : La liste d'associativites est invalide. -! -.38 -Entite %s, Type %d : La liste de proprietes est invalide. -!PHASE ANALYSE -.39 -Global Section : Nombre de parametres invalides (%d ou %d parametres attendus). -! -.40 -Global Section (Parametres 1 et 2) : Parameter Delimiter Character et Record Delimiter Character doivent etre differents. -! -.41 -Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Virgule pris par defaut. -! -.42 -Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Point Virgule pris par defaut. -! -.43 -Global Section (Parametre 8) : Le parametre Single Precision Magnitude est invalide (Entier Positif attendu). Valeur 38 prise pas defaut. -! -.44 -Global Section (Parametre 9) : Le parametre Single Precision Significance est invalide (Entier Positif attendu). Valeur 6 prise pas defaut. -! -.45 -Global Section (Parametre 10) : Le parametre Double Precision Magnitude est invalide (Entier Positif attendu). Valeur 308 prise pas defaut. -! -.46 -Global Section (Parametre 11) : Le parametre Double Precision Significance est invalide (Entier Positif attendu). Valeur 15 prise pas defaut. -! -.47 -Global Section (Parametre 13) : Le parametre Model Space Scale est invalide (Positif attendu). Valeur 1.0 prise pas defaut. -! -.48 -.Global Section (Parametre 14) : Le parametre Unit Flag est invalide (Entier entre 1 et 11 attendu). Valeur 2 prise pas defaut : Millimeters. -! -.49 -Global Section (Parametre 15) : Le parametre Unit Name n'est pas traite.Valeur 2 prise pas defaut : Millimeters. -! -.50 -Global Section (Parametre 15) : Le parametre Unit Name n'est pas defini, ignore. -! -.51 -Global Section (Parametre 14 et 15) : Le parametre Unit Flag ne correspond pas au parametre Unit Name : Unit Name ignore. -! -.52 -Global Section i)(Parametre 19) : Le parametre Minimum Resolution est invalide (Reel Positif attendu). Valeur 0.0 prise pas defaut. -! -.53 -Global Section (Parametre 23) : Le parametre Version Flag est invalide (Entier entre 1 et 11 attendu). Valeur 3 prise pas defaut : Version 2.0. -! -.54 -Global Section (Parametre 24) : Le parametre Drafting Standard Flag est invalide (Entier entre 0 et 7 attendu). Valeur 0 prise pas defaut : No standard. -! -.55 -Global Section (Parametre 25) : Le parametre Last change Date n'est pas defini. -! -.56 -Global Section (Parametre 18) : Le parametre Date n'est pas defini. -! -.57 -Global Section (Parametre %d) : Format de date invalide. -! -.58 -Directory Entry (Champ 1) : Le champ Entity Type Number est invalide -! -.59 -Directory Entry (Champ 3) : Le champ Structure est indefini. -! -.60 -Directory Entry (Champ 4) : Le champ Line Font Pattern est invalide (Pointeur ou Entier entre 0 et 5 attendu). Valeur 0 prise par defaut. -! -.61 -Directory Entry (Champ 5) : Le champ Level est invalide (Pointeur ou Entier attendu). Valeur 0 prise par defaut. -! -.62 -Directory Entry (Champ 6) : Le champ View est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut. -! -.63 -Directory Entry (Champ 7): Le champ Transformation Matrix est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut. -! -.64 -Directory Entry (Champ 8): Le champ Label Display Entity est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut. -! -.65 -Directory Entry (Field 9) : Le champ Blank Status est invalide (Entier attendu : 0 ou 1). -! -.66 -Directory Entry (Champ 9) : Le champ Subordinate Entity Switch est invalide (Entier entre 0 et 3 attendu). -! -.67 -Directory Entry (Champ 9) : Le champ Entity Use Flag est invalide (Entier entre 0 et 6 attendu). -! -.68 -Directory Entry (Champ 9) : Le champ Hierarchy est invalide (Entier entre 0 et 2 attendu). -! -.69 -Directory Entry (Champ 12) : Le champ Line Weight Number n'est pas defini. -! -.70 -Directory Entry (Champ 13) : Le champ Color Number est invalide (Pointeur ou Entier entre 0 et 8 attendu). -! -.71 -Directory Entry (Champ 15) : Le champ Form Number est invalide. -! -.72 -Directory Entry (Champ 19): Le champ Entity Subscript Number est invalide (Entier attendu). -!Type 116 -.73 -Parameter Data : Le parametre %d (Coordinate of Point) est invalide (Reel attendu). -!Type 116 -.74 -Parameter Data : Le parametre %d (Display Symbol) est invalide (Entite Subfigure Definition, Type 308 attendue). -!Type 100 -.75 -Parameter Data : Le parametre 1 ( ZT displacement of Arc) est invalide (Reel attendu). -!Type 100 -.76 -Parameter Data : Le parametre %d (Arc Center ) est invalide (Reel attendu). -!Type 100 -.77 -Parameter Data : Le parametre %d (Start Point) est invalide (Reel attendu). -!Type 100 -.78 -Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu). -!Type 102 -.79 -Parameter Data : Le parametre 1 (Number of Entities) est invalide :%d (Entier Positif attendu). -!Type 102 -.80 -Parameter Data : Certains pointeurs de liste d'entites sont nuls ou negatifs : ignores (Entites Point, Connect Point ou Paramerterized Curve attendues). -!Type 104 -.81 -Parameter Data : Le parametre %d (Conic Coefficient) est invalide (Reel attendu). -!Type 104 -.82 -Parameter Data : Le parametre 7 (Coordinate of Plane) est invalide (Reel attendu). -!Type 104 -.83 -Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu). -!Type 104 -.84 -Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu). -!Type 106 -.85 -Parameter Data : Le parametre 1 (Interpretation Flag) est invalide (Entier attendu : %d). -!Type 106 -.86 -Parameter Data : Le parametre 2 (Number of n-tuples) est invalide (Entier Positif attendu). -!Type 106 -.87 -Parameter Data : Le parametre 3 (Common Z Displacement) est invalide (Reel attendu). -!Type 106 -.88 -Parameter Data : Tous les parametres Data Point ne sont pas de type Reel. -!Type 110 -.89 -Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu). -!Type 110 -.90 -Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu). -!Type 112 -.91 -Parameter Data : Le parametre 1 (Spline Type) est invalide (Entier entre 1 et 6 attendu). -!Type 112 -.92 -Parameter Data : Le parametre 2 (Degree of Continuity) est invalide (Entier attendu). -!Type 112 -.93 -Parameter Data : Le parametre 3 (Number of Dimensions) est invalide (Entier attendu : 2 ou 3). -!Type 112 -.94 -Parameter Data : Le parametre 4 (Number of Segments) est invalide (Entier Positif attendu). -!Type 112 -.95 -Parameter Data : Tous les parametres Break Point ne sont pas de type Reel. -!Type 112 -.96 -Parameter Data : L'entite est plane mais les parametres BZ, CZ. DZ ne sont pas nuls -!Type 126 -.97 -Parameter Data : Le parametre %d (Upper Index of Sum) est invalide (Entier Positif attendu). -!Type 126 -.98 -Parameter Data : Le parametre %d (Degree of Basis Functions) est invalide (Entier attendu) : Valeur 0 prise par defaut. -!Type 126 -.99 -Parameter Data : Le parametre %d (Planar/Non Planar Flag) est invalide (Booleen attendu). -!Type 126 -.100 -Parameter Data : Le parametre %d (Open/Closed Flag) est invalide (Booleen attendu). -!Type 126 -.101 -Parameter Data : Le parametre %d (Rational/Polynomial Flag) est invalide (Booleen attendu). -!Type 126 -.102 -Parameter Data : Le parametre %d (NonPeriodic/Periodic Flag) est invalide (Booleen attendu). -!Type 126 -.103 -Parameter Data : Tous les parametres Knot Sequence ne sont pas de type Reel. -!Type 126 -.104 -Parameter Data : Tous les parametres Weight ne sont pas de type Reel Positif. -!Type 126 -.105 -Parameter Data : Le parametre %d (Control Point) est invalide (Reel attendu). -!Type 126 -.106 -Parameter Data : Le parametre %d (Starting Value) est invalide (Reel attendu). -!Type 126 -.107 -Parameter Data : Le parametre %d (Ending Value) est invalide (Reel attendu). -!Type 126 -.108 -Parameter Data : Le parametre %d (Unit Normal) est invalide (Reel attendu). -!Type 126 -.109 -Parameter Data : Le parametre %d (Unit Normal) n'est pas defini pour une courbe plane. -!Type 130 -.110 -Parameter Data : Le parametre 1 (Curve Entity to be offset) est invalide (Entite Curve attendue). -!Type 130 -.111 -Parameter Data : Le parametre 2 (Offset Distance Flag) est invalide (Entier entre 1 et 3 attendu). -!Type 130 -.112 -Parameter Data : Le parametre 3 (Curve Entity whose coordinate describes the offset) est invalide (Entite Curve attendue). -!Type 130 -.113 -Parameter Data : Le parametre 4 (Particular Coordinate) est invalide (Entier attendu). -!Type 130 -.114 -Parameter Data : Le parametre 5 (Tapered Offset Type Flag) est invalide (Entier attendu). -!Type 130 -.115 -Parameter Data : Le parametre 6 (First Offset distance) est invalide (Reel attendu). -!Type 130 -.116 -Parameter Data : Le parametre 7 (Arc Length of Fisrt Offset Distance) est invalide (Reel attendu). -!Type 130 -.117 -Parameter Data : Le parametre 8 (Second Offset Distance) est invalide (Reel attendu). -!Type 130 -.118 -Parameter Data : Le parametre 9 (Arc Length of Second Offset Distance) est invalide (Reel attendu). -!Type 130 -.119 -Parameter Data : Le parametre 13 (Offset Curve Starting Parameter Value) est invalide (Reel attendu). -!Type 130 -.120 -Parameter Data : Le parametre 14 (Offset Curve Ending Parameter Value) est invalide (Reel attendu). -!Type 130 -.121 -Parameter Data : Le parametre %d (Unit Vector Normal to plane) est invalide (Reel attendu). -!Type 130 -.122 -Parameter Data : Le parametre 1 (Type of Bounded Surface Representation) est invalide (Entier attendu : 0 ou 1 ). -!Type 141 -.123 -Parameter Data : Le parametre 2 (Trimming Curves Representation) est invalide (Entier entre 0 et 3 attendu). -!Type 141 -.124 -Parameter Data : Le parametre 3 (Untrimmed Surface) est invalide (Entite Untrimmed Surface attendue). -!Type 141 -.125 -Parameter Data : Surface %d non parametrique (parametre 3). -!Type 141 -.126 -Parameter Data : Le parametre 4 (Number of Curves est invalide (Positif attendu). -!Type 141 -.127 -Parameter Data : Le parametre 5 (Model Space Curve) est invalide (Entite Curve attendue). -!Type 141 -.128 -Parameter Data : Le parametre 6 (Orientation Flag) est invalide (Entier attendu : 1 ou 2). -!Type 141 -.129 -Parameter Data : Le parametre 7 (Number of Associated Parameter Space Curves) est invalide (Entier attendu : 0). -!Type 141 -.130 -Parameter Data : Certains pointeurs de la liste d'entites Parameter Space Curve sont nuls ou negatifs : ignores (Entites Curve attendues). -!Type 142 -.131 -Parameter Data : Le parametre 2 (Surface on which the curve lies) est invalide (Entite Surface attendue). -!Type 142 -.132 -Parameter Data : Le parametre 3 (Curve 2D) est invalide (Entite Curve attendue). -!Type 142 -.133 -Parameter Data : Le parametre 4 (Curve 3D) est invalide (Entite Curve attendue). -!Type 142 -.134 -Parameter Data : Les pointeurs sur les courbes 2D et sont nuls (parameter 3 et 4) (Entites Curve attendues). -!Type 108 -.135 -Parameter Data : Le parametre %d (Coefficient Of Plane) est invalide (Reel attendu). -!Type 108 -.136 -Parameter Data : Le parametre 5 (Closed Curve) est invalide (Entite Curve attendue). -!Type 108 -.137 -Parameter Data : Le parametre 5 est invalide (Pointeur nul attendu lorsque le champ Form Number est 0). -!Type 108 -.138 -Parameter Data : Le parametre 9 (DisplaySymbol Size) est invalide (Reel attendu). -!Type 108 -.139 -Parameter Data : Le parametre %d (Coordinate of Display Symbol) est invalide (Reel attendu). -!Type 114 -.140 -Parameter Data : Le parametre 1 (Spline Boundary Type) est invalide (Entier entre 1 et 6 attendu). -!Type 114 -.141 -Parameter Data : Le parametre 3 (Number of U Segments) est invalide (Entier Positif attendu). -!Type 114 -.142 -Parameter Data : Le parametre 4 (Number of V Segments) est invalide (Entier Positif attendu). -!Type 114 -.143 -Parameter Data : Tous les parametres Breakpoint in U ne sont de type Reel. -!Type 114 -.144 -Parameter Data : Tous les parametres Breakpoint in V ne sont pas de type Reel. -!Type 114 -.145 -Parameter Data : Tous les parametres %s Coefficient of Patch ne sont pas de type Reels. -!Type 114 -.146 -Parameter Data : Le parametre %d (Last Z Coefficient of Patch) est invalide (Reel attendu). -!Type 114 -.147 -Parameter Data : Le nombre de parametres %c Coefficient of Patch est invalide (Entier attendu : 16). -!Type 118 -.148 -Parameter Data : Le parametre 1 (First Curve) est invalide (Entite Curve attendue). -!Type 118 -.149 -Parameter Data : Le parametre 2 (Second Curve) est invalide (Entite Curve attendue). -!Type 118 -.150 -Parameter Data : Le parametre 3 (Direction Flag) est invalide (Entier 0 ou 1 attendu). -!Type 118 -.151 -Parameter Data : Le parametre 4 (Developable Surface Flag) est invalide (Entier 0 ou 1 attendu). -!Type 120 -.152 -Parameter Data : Le parametre 1 (Axis of Revolution) est invalide (Entite attendue). -!Type 120 -.153 -Parameter Data : Le parametre 2 (Generatrix Entity) est invalide (Entite attendue). -!Type 120 -.154 -Parameter Data : Le parametre 3 (Start Angle) est invalide (Reel attendu). -!Type 120 -.155 -Parameter Data : Le parametre 4 (Terminate Angle est invalide (Reel attendu). -!Type 122 -.156 -Parameter Data : Le parametre 1 (Generatrix Entity) est invalide (Entite Curve attendue). -!Type 122 -.157 -Parameter Data : Le parametre %d (Coordinate of the Terminate Point) est invalide (Reel attendu). -!Type 128 -.158 -Parameter Data : Valeur supplementaire invalide (Reel attendu). -!Type 128 -.159 -Parameter Data : Valeur Reelle supplementaire : ignore. -!Type 128 -.160 -Parameter Data : Invalid Number of First Knots sequence (Nombre attendu : %d). -!Type 128 -.161 -Parameter Data : Invalid Number of Second Knots Sequence (Nombre attendu : %d). -!Type 140 -.162 -Parameter Data : Le parametre %d (Coordinate of Offset Indicator) est invalide (Reel attendu). -!Type 140 -.163 -Parameter Data : Le parametre 4 (Offset Distance) est invalide (Reel attendu). -!Type 140 -.164 -Parameter Data : Le parametre 5 (Surface Entity to be offset) est invalide (Entite Surface attendue). -!Type 143 -.165 -Parameter Data : Le parametre 1 (Bounded Surface Representation Type) est invalide (Entier 0 ou 1 attendu). -!Type 143 -.166 -Parameter Data : Le parametre 2(Surface Entity to be Bounded) est invalide (Entite Surface attendue). -!Type 143 -.167 -Parameter Data : Le parametre 3 (Number of Boundary Entities) est invalide (Entier Positif attendu). -!Type 143 -.168 -Parameter Data : Le parametre %d (Boundary Entity) est invalide (Entite Boundary, Type 141 attendue). -!Type 144 -.169 -Parameter Data : Le parametre 1 (Surface to be trimmed) est invalide (Entite Surface attendue). -!Type 144 -.170 -Parameter Data : Le parametre 2 (Outer Boundary Type) est invalide (Entier 0 ou 1 attendu). -!Type 144 -.171 -Parameter Data : Le parametre 3 ( Number of Inner Boundary Closed Curves) est invalide (Entier Positif attendu). -!Type 144 -.172 -Parameter Data : Le parametre 4 (Outer Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue). -!Type 144 -.173 -Parameter Data : Le parametre %d (Inner Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue). -!Type 190 -.174 -Parameter Data : Le parametre 1 (Point on the Surface) est invalide (Entite Point, Type 116 attendue). -!Type 190 -.175 -Parameter Data : Le parametre 2 (Surface Normal Direction) est invalide (Entite Direction attendue). -!Type 190 -.176 -Parameter Data : Le parametre 3 (Reference Direction) est invalide (Entite Direction attendue). -!Type 190 -.177 -Parameter Data : Le parametre 3 est invalide (Pointeur nul attendu lorsque le champ Form Number est 1). -!Type 186 -.178 -Parameter Data : Le parametre 1 (Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue). -!Type 186 -.179 -Parameter Data : Le parametre %d (Void Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue). -!Type 186 -.180 -Parameter Data : Le parametre %d (Orientation Flag) est invalide (Booleen attendu). -!Type 186 -.181 -Parameter Data : Le parametre 3 (Number of Void Shells) est invalide (Entier Positif attendu). -!Type 502 -.182 -Parameter Data : Le parametre 1 (Number of Vertex Tuples) est invalide (Entier Positif attendu). -!Type 502 -.183 -Parameter Data : Le parametre % (Coordinate of Vertex) est invalide (Reel attendu). -!Type 504 -.184 -Parameter Data : Le parametre 1 (Number of Edge Tuples) est invalide (Entier Positif attendu). -!Type 504 -.185 -Parameter Data : Le parametre 2 (Model Space Curve) est invalide (Entite Curve attendue). -!Type 504 -.186 -Parameter Data : Le parametre %d (Start Vertex Index) est invalide (Entier attendu). -!Type 504 -.187 -Parameter Data : Le parametre %d (Terminate Vertex Index) est invalide (Entier attendu). -!Type 504 -.188 -Parameter Data : Le parametre %d (Start Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue). -!Type 504 -.189 -Parameter Data : Le parametre %d (Terminate Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).!T -!Type 508 -.190 -Parameter Data : Le parametre %d (Edge Type) est invalide (Entier 0 ou 1 attendu). -!Type 508 -.191 -Parameter Data : Le parametre %d (List Index) est invalide (Entier attendu). -!Type 508 -.192 -Parameter Data : Le parametre %d (Number of Parameter Curves) est invalide (Entier Positif attendu). -!Type 508 -.193 -Parameter Data : Le parametre % Vertex or Edge List Entity) est invalide (Entite Vertex List ou Edge List Entity, Type 502 ou 504 attendue). -!Type 508 -.194 -Parameter Data : Le parametre % (Parameter Space Curve) est invalide (Entite Curve attendue). -!Type 508 -.195 -Parameter Data : Le parametre %d (Isoparametric Flag) est invalide (Booleen attendu). -!Type 510 -.196 -Parameter Data : Le parametre 1 (Surface) est invalide (Entite Surface attendue). -!Type 510 -.197 -Parameter Data : Le parametre 2 (Number of Loops) est invalide (Entier Positif attendu). -!Type 510 -.198 -Parameter Data : Le parametre 3 (Outer Loop flag) est invalide (Booleen attendu). -!Type 510 -.199 -Parameter Data : Le parametre %d (Loop of the Face) est invalide (Entite Loop, Type 508 attendue). -!Type 514 -.200 -Parameter Data : Le parametre 1 (Number of Faces) est invalide (Entier Positif attendu). -!Type 514 -.201 -Parameter Data : Le parametre 2 (Face) est invalide (Entite Face, Type 510 attendue). -!Type 402, Form 1 ou 7 -.202 -Form %d : Parameter Data : Le parametre 1 (Number of Entries) est invalide (Entier attendu). -!Type 402, Form 1 ou 7 -.203 -Form %d : Parameter Data : Certains pointeurs de la liste d'entites sont nuls ou negatifs : ignores (Entites attendues). -!Type 402 -.204 -Form 9 : Parameter Data : Le parametre 1 (Number of Parent Entity) est invalide (Entier attendu : 1). -!Type 402 -.205 -Form 9 : Parameter Data : Le parametre 2 (Number of children) est invalide (Entier Positif attendu). -!Type 402 -.206 -Form 9 : Parameter Data : Le parametre 3 (Parent Entity) est invalide (Entite attendue). -!Type 402 -.207 -Form 9 : Parameter Data : Certains pointeurs de la liste d'entites filles sont nuls ou negatifs (Entites attendues). -!Type 308 -.208 -Parameter Data : Le parametre 1 (Depth of Subfigure) est invalide (Entier attendu). -!Type 308 -.209 -Parameter Data : Le parametre 2 (Subfigure Name) est invalide (Chaine au format Hollerith attendue). -!Type 308 -.210 -Parameter Data : Le parametre 3 (Number of Entities) est invalide (Entie Positif attendu). -!Type 308 -.211 -Parameter Data : Certains pointeurs de la liste d'entites associees sont nuls ou negatifs : ignores (Entites attendues). -!Type 408 -.212 -Parameter Data : Le parametre 1 (Subfigure definition entity) est invalide (Entite Subfigure Definition Entity, Type 308 attendue). -!Type 408 -.213 -Parameter Data : Le parametre %d (Translation data) est invalide (Reel attendu). -!Type 408 -.214 -Parameter Data : Le parametre 5 (Scale Factor) est invalide (Reel attendu). Valeur 1.0 prise par defaut. -!Type 124 -.215 -Parameter Data : Tous les elements de la matrice ne sont pas de type Reel. -! -.216 -Reference nulle. -! -.217 -Entite nulle. -! -.218 -Type incorrect. -! -.219 -Pointeur negatif. -!RAJOUT -.220 -Le nombre d'associativites est invalide (Entier attendu). -! -.221 -Le nombre de proprietes est invalide (Entier attendu). -!PHASE TRANSFERT -.222 -Entite %s, Type %d : L'entite pointe sur un objet invalide : Arret de la conversion de l'entite. -! -.223 -Entite %s, Type %d : L'Edge resultant n'est pas Same Parameter. -! -.224 -Entite %s, Type %d : Erreur logicielle : Arret de la conversion de l'entite. -! -.225 -Entite %s, Type %d : L'entite est vide. -! -.226 -Entite %s, Type %d : Directory Entry (Parametre 7) : L'entite Transformation Matrix pointe sur un objet invalide. -! -.227 -Entite %s, Type %d : Les entites Type 116 ou 132 ne peuvent pas se suivre dans une entite Type 102. -! -.228 -Entite %s, Type %d : Reference à une entite de type %d illegal. -! -.229 -Entite %s, Type %d : La courbe a ete inversee. -! -.230 -Entite %s, Type %d : La courbe etait legerement deconnectee.: repare. -! -.231 -Entite %s, Type %d : La courbe etait trop deconnectee.: reparation impossible. -! -.232 -Entite %s, Type %d :L'entite n'est pas fermee. -! -.233 -Entite %s, Type %d : Erreur logicielle : Courbe 2D invalide, recalculee à partir de la courbe 3D. -! -.234 -Entite %s, Type %d : Erreur logicielle : Courbe 3D invalide, recalculee à partir de la courbe 2D. -! -.235 -Entite %s, Type %d : Erreur logicielle : Courbe 2D et 3D invalides. -! -.236 -Entite %s, Type %d : L'entite s'auto-intersectait, repare. -! -.237 -Entite %s, Type %d : Parameter Data : Le parametre 2 (Offset distance flag) different de 1 n'est pas implemente. -! -.238 -Entite %s, Type %d : La longeur de la courbe est incorrecte par rapport au parametre 14 (Offset curve ending) de l'entite %s Type %d. -! -.239 -Entite %s, Type %d :La courbe B-Spline de continuite C0 ne peut pas etre divisee en courbes C1. Le resultat est nul. -! -.240 -Entite %s, Type %d : La courbe B-Spline de continuite C0 a ete divisee en courbes C1. -! -.241 -Entity %s, Type %d : Parameter Data : Le parametre 1 (Type of bounded surface representation = 0) n'est pas implementee. -! -.242 -Entite %s, Type %d : Entite non implementee. -! -.243 -Entite %s, Type %d : Parameter Data : (Parametres 1 à 6) Les coefficients ne satisfont pas l'equation de la conique. -! -.244 -Entite %s, Type %d : Parameter Data (Parametres 8 à 11) : Les coordonnees de debut et de fin de l'arc sont les memes. -! -.245 -Entite %s, Type %d : La transformation ne sera pas appliquee à l'objet 2D. -! -.246 -Entite %s, Type %d : Parameter Data : Le parametre 4 (Number of segments) est inferieur à 1. -! -.247 -Entite %s, Type %d :L'equation polynomiale est incorrecte. -! -.248 -Entite %s, Type %d :Erreur durant la creation des points de contrôle. -! -.249 -Entite %s, Type %d : Parameter Data :Le parametre 1 (Spline Type > 3 ) n'est pas implemente. -! -.250 -Entite %s, Type %d : Le resultat n'est pas garanti C0. -! -.251 -Entite %s, Type %d : Parameter Data : Le parametre 2 (Degree of basis functions) est inferieur à 0 ou superieur au degre maximum. -! -.252 -Entite %s, Type %d : Parameter Data : Nombre de points incorrect (2 ou plus attendus). -! -.253 -Entite %s, Type %d : Erreur de conversion : %sStarting multiplicity > %s degree + 1. -! -.254 -Entite %s, Type %d : Erreur de conversion : %sEnding multiplicity > %s degree + 1. -! -.255 -Entite %s, Type %d : %sMultiplicity of knot %d > %s degree, repare. -! -.256 -Entite %s, Type %d : Sum of %smultiplicities is not equal to the sum (number of poles + %sdegree + 1). -! -.257 -Entite %s, Type %d : Tous les poids ne sont pas positifs. -! -.258 -Entite %s, Type %d : L'entite est polynomiale. -! -.259 -Entite %s, Type %d : Le point de depart et d'arrivee de la ligne%s sont les memes. -! -.260 -Entite %s, Type %d, Form %d : le vecteur est ignore. -! -.261 -Entite %s, Type %d : La surface resultante est continue C0. -! -.262 -Entity %s, Type %d : La surface de base est continue C0 et elle est convertie en shell. Seule la premiere face du shell est decalee. -! -.263 -Entite %s, Type %d : L'entite pointe sur un objet invalide, ignore. -! -.264 -Entite %s, Type %d : L'entite n'a pas pu etre transferee, ignore. -! -.265 -Entite %s, Type %d : L'entite n'est pas coplanaire à l'entite %s, Type %d. -! -.266 -Entite %s, Type %d : Parameter Data : Le parametre 3 ou 4 (Number of U ou V segments) est inferieur à 1. -! -.267 -Entite %s, Type %d : Parameter Data : Le parametre 3 ou 4 (Degree of first or second basis functions) est inferieur à 0 ou superieur au degre maximum. -! -.268 -Entite %s, Type %d : Parameter Data : Le nombre de coordonnees XYZ des points de contrôle (selon la direction %s) est inferieur à 2. -! -.269 -Entite %s, Type %d :Erreur de construction des points de contrôle. Le resultat est nul. -! -.270 -Entite %s, Type %d : Erreur logicielle lors de la conversion du Vertex numero %d. -! -.271 -Entite %s, Type %d : Le resultat de la conversion de l'entite n'est pas implemente. -! -.272 -Debut de la phase "Analyse" du fichier IGES %s. -! -.273 -Fin de la phase "Analyse" du fichier IGES %s (Temps ecoule : %s). -! -.274 -Debut de la phase "Transfert" du fichier IGES %s. -! -.275 -Fin de la phase "Transfert" du fichier IGES %s (Temps ecoule : %s). diff --git a/src/XSMessage/IGES.us b/src/XSMessage/IGES.us deleted file mode 100755 index 4e1924f3d7..0000000000 --- a/src/XSMessage/IGES.us +++ /dev/null @@ -1,767 +0,0 @@ -!LOADING PHASE -! general messages have been factorised in XSTEP general file -.9 -Beginning of the IGES file reading. -! -.10 -End of the IGES file reading. -! -.12 -Header and Content of IGES file are loaded. -! -.18 -Syntax error in the IGES file at line %d of the section %s. -! -.19 -Syntax error in the IGES file at line %d of the section %s (line number may be incorrect). -! -.20 -There is no Terminate Section, please check the end of the IGES file. The process continues. -! -.27 -Entity %s : Directory Entry : there is no parameter. The process continues. -! -.28 -Entity %s : Directory Entry : The parameter 1 (Type de l'entité) is incorrect. -! -.29 -Entity %s, Type %d : Directory Entry : The Field 4 (Line Font Pattern) is incorrect (Not null pointer or Integer between 0 and 5 is expected). incorrect (not null pointer or integer between 0 and 5 is expected). -! -.30 -Entity %s, Type %d : Directory Entry : The Field 5 (Level) is incorrect (Not null pointer or not null Integer is expected). -! -.31 -Entity %s, Type %d : Directory Entry : The Field 6 (View) is incorrect (Not null pointer or Integer Zero is expected). -! -.32 -Entity %s, Type %d : Directory Entry : The Field 7 (Transformation Matrix) is incorrect (Not null pointer or Integer Zero is expected). -! -.33 -Entity %s, Type %d : Directory Entry : The Field 8 (Label Display Associativity) is incorrect (Not null pointer or Integer Zero is expected). -! -.34 -Entity %s, Type %d : Directory Entry : The Field 13 (Color Number) is incorrect (Not null pointer or Integer between 0 and 8 is expected). -! -.35 -Null Entity %s. -! -.36 -Unknown Entity %s. -! -.37 -Entity %s, Type %d : The Associativity list is incorrect. -! -.38 -Entity %s, Type %d : The Property list is incorrect. -! ANALYSIS PHASE -.39 -Global Section : Incorrect number of parameters (%d or %d parameters are expected). -! -.40 -Global Section (Parameters 1 and 2) : Parameter Delimiter Character and Record Delimiter Character must be different. -! -.41 -Global Section (Parameter 2) : The Parameter Delimiter Character is incorrect. Default character Coma is taken. -! -.42 -Global Section (Parameter 2) : The Character Record Delimiter parameter is incorrect. Default character Semicolon is taken. -! -.43 -Global Section (Parameter 8) : The Single Precision Magnitude parameter is incorrect (Expected Positive Integer). Default value 38 is taken. -! -.44 -Global Section (Parameter 9) : The Single Precision Significance parameter is incorrect (Expected Positive Integer). Default value 6 is taken. -! -.45 -Global Section (Parameter 10) : The Double Precision Magnitude parameter is incorrect (Expected Positive Integer). Default value 308 is taken. -! -.46 -Global Section (Parameter 11) : The Double Precision Significance parameter is incorrect (Expected Positive Integer). Default value 15 is taken. -! -.47 -Global Section (Parameter 13) : the Model Space Scale parameter is incorrect (Expected Positive). Default value 1.0 is taken. -! -.48 -Global Section (Parameter 14) : The Unit Flag parameter is incorrect (Integer between 1 et 11 is expected). Default value 2 is taken : Millimeters. -! -.49 -Global Section (Parameter 15): The Unit Name parameter is not recognized. Default value 2 is taken : Millimeters.srl -! -.50 -Global Section (Parameter 15) : The Unit Name parameter is undefined, ignored -! -.51 -Global Section (Parameter 14 and 15) : The Unit Flag parameter doesn't correspond to the Unit Name parameter : Unit Name ignored. -! -.52 -Global Section (Parameter 19) : The (Expected Positive Real). Default value 0.0 is taken. -! -.53 -Global Section (Parameter 23) : The Version Flag parameter is incorrect (Integer between 1 et 11 is expected. Default value 3 is taken : Version 2.0. -! -.54 -Global Section (Parameter 24) : The Drafting Standard Flag parameter is incorrect (Integer beetween 0 et 7). Default value 3 is taken : No standard.Global Section (Parameter 25) : Last change Date parameter is undefined. -! -.55 -Global Section (Parameter 25) : Last change Date parameter is undefined. -! -.56 -Global Section (Parameter %d) : The Date parameter is undefined. -! -.57 -Global Section (Parameter %d) : Incorrect Date Format. -! -.58 -Entity %d : Directory Entry (Field 1) : The Entity Type Number field is incorrect (Expected Integer : %d). -! -.59 -Entity %d, Type %d : Directory Entry (Field 3) : The Structure field is undefined. -! -.60 -Entity %d, Type %d : Directory Entry (Field 4) : The Line Font Pattern field is incorrect (Pointer or Integer beteween 0 and 5 is expected). Default value 0 is taken. -! -.61 -Entity %d, Type %d : Directory Entry (Field 5) : The Level field is incorrect (Pointer or Integer are expected). Default value 0 is taken. -! -.62 -Entity %d, Type %d : Directory Entry (Field 6) : The View field is incorrect (Pointer or Zero are expected). Default value 0 is taken. -! -.63 -Entity %d, Type %d : Directory Entry (Field 7): The Transformation Matrix field is incorrect (Pointer or Zero are expected). Default value 0 is taken. -! -.64 -Entity %d, Type %d : Directory Entry (Field 8): The Label Display Entity field is incorrect (Pointer or Zero are expected). Default value 0 is taken. -! -.65 -Entity %d, Type %d : Directory Entry (Champ 9) : The Blank Status field is incorrect (Expected Integer : 0 or 1). -! -.66 -Entity %d, Type %d : Directory Entry (Field 9) : The Subordinate Entity Switch field is incorrect (Integer between 0 and 3 is expected). -! -.67 -Entity %d, Type %d : Directory Entry (Field 9) : The Entity Use Flag is incorrect (Integer between 0 and 6 is expected). -! -.68 -Entity %d, Type %d : Directory Entry (Field 9) : The Hierarchy field is Incorrect (Integer between 0 and 2 is expected). -! -.69 -Entity %d, Type %d : Directory Entry (Field 12) : The Line Weight Number is undefined. -! -.70 -Entity %d, Type %d : Directory Entry (Field 13) : The Color Number field is incorrect (Pointer or Integer between 0 and 8 is expected). -! -.71 -Entity %d, Type %d : Directory Entry (Field 15) : The Form Number field is incorrect. -! -.72 -Entity %d, Type %d : Directory Entry (Field 19): The Entity Subscript Number field is incorrect (Integer is expected). -!Type 116 -.73 -Parameter Data : The parameter %d (Coordinate of Point) is incorrect (Expected Real). -!Type 116 -.74 -Parameter Data : The parameter %d (Display Symbol) is incorrect (Subfigure Definition Entity, Type 308 is expected). -!Type 100 -.75 -Parameter Data : The parameter 1 (ZT displacement of Arc) is incorrect (Expected Real). -!Type 100 -.76 -Parameter Data : The parameter %d (Arc Center) is incorrect (Expected Real). -!Type 100 -.77 -Parameter Data : The parameter %d (Start Point) is incorrect (Expected Real). -!Type 100 -.78 -Parameter Data : The parameter %d (Terminate Point) is incorrect (Expected Real). -!Type 102 -.79 -Parameter Data : The parameter 1 (Number of Entities) is incorrect : %d (Expected Positive Integer). -!Type 102 -.80 -Parameter Data : Some pointers of the Entity list are null or negative : ignored (Point, Connect Point or Parameterized Curve Entities are expected).Entity %d, Type 104, Form %d : Parameter Data : The parameter %d (Conic Coefficient) is incorrect (Expected Real). -!Type 104 -.81 -Parameter Data : The parameter %d (Conic Coefficient) is incorrect (Expected Real). -!Type 104 -.82 -Parameter Data : The parameter 7 (Coordinate of Plane) is incorrect (Expected Real). -!Type 104 -.83 -Parameter Data : The parameter %d (Starting Point) is incorrect (Expected Real). -!Type 104 -.84 -Parameter Data : The parameter %d (Terminate Point) is incorrect (Expected Real). -!Type 106 -.85 -Parameter Data : The parameter 1 (Interpretation Flag) is incorrect (Expected Integer : %d). -!Type 106 -.86 -Parameter Data : The parameter 2 (Number of n-tuples) is incorrect (Expected Positive Integer). -!Type 106 -.87 -Parameter Data : The parameter 3 (Common Z Displacement) is incorrect (Expected Real). -!Type 106 -.88 -Parameter Data : All Data Point parameters are not of Real type. -!Type 110 -.89 -Parameter Data : The parameter %d (Starting Point) is incorrect (Expected Real). -!Type 110 -.90 -Parameter Data : The parameter %d (Terminate Point) is incorrect (Expected Real). -!Type 112 -.91 -Parameter Data : The parameter 1 (Spline Type) is incorrect (Integer between 1 and 6 is expected). -!Type 112 -.92 -Parameter Data (Parameter 2) : The parameter 2 (Degree of Continuity) is incorrect (Expected Integer). -!Type 112 -.93 -Parameter Data : The parameter 3 (Number of Dimensions) is incorrect (Expected Integer : 2 or 3). -!Type 112 -.94 -Parameter Data : The parameter 4 (Number of Segments) is incorrect (Expected Positive Integer). -!Type 112 -.95 -Parameter Data : All Break Point parameters are not of Real type. -!Type 112 -.96 -Parameter Data : The entity is planar but the parameters BZ, CZ. DZ are not null. -!Type 126 -.97 -Parameter Data : The parameter %d (Upper Index of Sum) is incorrect (Expected Positive Integer). -!Type 126 -.98 -Parameter Data : The parameter %d (Degree of Basis Functions) is incorrect (Expected Integer) : Default value 0 is taken. -!Type 126 -.99 -Parameter Data : The parameter %d (Planar/Non Planar Flag) is incorrect (Expected Boolean). -!Type 126 -.100 -Parameter Data : The parameter %d (Open/Closed Flag) is incorrect (Expected Boolean). -!Type 126 -.101 -Parameter Data : The parameter %d (Rational/Polynomial Flag) is incorrect (Expected Boolean). -!Type 126 -.102 -Parameter Data : The parameter %d (NonPeriodic/Periodic Flag) is incorrect (Expected Boolean). -!Type 126 -.103 -Parameter Data : All Knot Sequence parameters are not of Real type. -!Type 126 -.104 -Parameter Data : All Weight parameters are not of Positive Real type. -!Type 126 -.105 -Parameter Data : The parameter %d (Control Point) is incorrect (Expected Real). -!Type 126 -.106 -Parameter Data : The parameter %d (Starting Value) is incorrect (Expected Real). -!Type 126 -.107 -Parameter Data : The parameter %d (Ending Value) is incorrect (Expected Real). -!Type 126 -.108 -Parameter Data : The parameter %d (Unit Normal) is incorrect (Expected Real). -!Type 126 -.109 -Parameter Data : The parameter %d (Unit Normal) is undefined for a planar curve. -!Type 130 -.110 -Parameter Data : The parameter 1 (Curve Entity to be offset) is incorrect (Curve Entity is expected). -!Type 130 -.111 -Parameter Data : The parameter 2 (Offset Distance Flag) is incorrect (Integer between 1 and 3 is expected). -!Type 130 -.112 -Parameter Data : The parameter 3 (Curve Entity whose coordinate describes the offset) is incorrect (Curve Entity is expected). -!Type 130 -.113 -Parameter Data : The parameter 4 (Particular Coordinate) is incorrect (Expected Integer). -!Type 130 -.114 -Parameter Data : The parameter 5 (Tapered Offset Type Flag) is incorrect (Expected Integer).ppp -!Type 130 -.115 -Parameter Data : The parameter 6 (First Offset distance) is incorrect (Expected Real). -!Type 130 -.116 -Parameter Data : The parameter 7 (Arc Length of First Offset Distance) is incorrect (Expected Real). -!Type 130 -.117 -Parameter Data : The parameter 8 (Second Offset Distance) is incorrect (Expected Real). -!Type 130 -.118 -Parameter Data : The parameter 9 (Arc Length of Second Offset Distance) is incorrect (Expected Real). -!Type 130 -.119 -Parameter Data : The parameter 13 (Offset Curve Starting Parameter Value) is incorrect (Expected Real). -!Type 130 -.120 -Parameter Data : The parameter 14 (Offset Curve Ending Parameter Value) is incorrect (Expected Real). -!Type 130 -.121 -Parameter Data : The parameter %d (Unit Vector Normal to plane) is incorrect (Expected Real). -!Type 141 -.122 -Parameter Data : The parameter 1 (Type of Bounded Surface Representation) is incorrect (Expected Integer : 0 or 1). -!Type 141 -.123 -Parameter Data : The parameter 2 (Trimming Curves Representation) is incorrect (Integer between 0 and 3 is expected). -!Type 141 -.124 -Parameter Data : The parameter 3 (Untrimmed Surface) is incorrect (Untrimmed Surface Entity is expected). -!Type 141 -.125 -Parameter Data : Not parametric Surface %d (parameter 3). -!Type 141 -.126 -Parameter Data : The parameter 4 (Number of Curves) is incorrect (Expected positive). -!Type 141 -.127 -Parameter Data : The parameter 5 (Model Space Curve) is incorrect (Curve Entity is expected). -!Type 141 -.128 -Parameter Data (Parameter 6) : The Orientation Flag parameter is incorrect (Expected Integer : 1 or 2). -!Type 141 -.129 -Parameter Data : The parameter 7 (Number of Associated Parameter Space Curves) is incorrect (Expected Integer : 0). -!Type 141 -.130 -Parameter Data : Some pointers of the Parameter Space Curve list are null or negative : ignored (Curve Entities are expected). -!Type 142 -.131 -Parameter Data : The parameter 2 (Surface on which the curve lies) is incorrect (Surface Entity is expected). -!Type 142 -.132 -Parameter Data : Le parameter 3 (Curve 2D) is incorrect (Curve Entity is expected). -!Type 142 -.133 -Parameter Data : Le parameter 4 (Curve 3D) is incorrect (Curve Entity is expected). -!Type 142 -.134 -Parameter Data : The pointers of Curve 2D and 3D are null (parameter 3 and 4) (Curve Entities are expected). -!Type 108 -.135 -Parameter Data : The parameter %d (Coefficient Of Plane) is incorrect (Expected Real). -!Type 108 -.136 -Parameter Data : Le parameter 5 (Closed Curve) is incorrect (Curve Entity is expected). -!Type 108 -.137 -Parameter Data : The parameter 5 (Expected Null pointer when the Form Number field is 0). -!Type 108 -.138 -Parameter Data : The parameter 9 (Display Symbol Size) is incorrect (Expected Real). -!Type 108 -.139 -Parameter Data : The parameter %d (Coordinate of Display Symbol) is incorrect (Expected Real). -!Type 114 -.140 -Parameter Data : The parameter 1 (Spline Boundary Type) is incorrect (Integer between 1 and 6 is expected). -!Type 114 -.141 -Parameter Data : The parameter 3 (Number of U Segments) is incorrect (Expected Positive Integer). -!Type 114 -.142 -Parameter Data : Le parameter 4 (Number of V Segments) is incorrect (Expected Positive Integer). -!Type 114 -.143 -Parameter Data : All Breakpoint in U parameters are not of Real type. -!Type 114 -.144 -Parameter Data : All Breakpoint in V parameters are not of Real type. -!Type 114 -.145 -Parameter Data : All %s Coefficient of Patch parameter(s) are not of Real type. -!Type 114 -.146 -Parameter Data : The parameter %d (Last Z Coefficient of Patch) is incorrect (Expected Real). -!Type 114 -.147 -Parameter Data : The %s Coefficient of Patch parameters are incorrect (Expected Integer : 16). -!Type 118 -.148 -Parameter Data : Le parameter 1 (First Curve) is incorrect (Curve Entity is expected). -!Type 118 -.149 -EParameter Data : Le parameter 2 (Second Curve) is incorrect (Curve Entity is expected). -!Type 118 -.150 -Parameter Data : The parameter 3 (Direction Flag) is incorrect (Integer 0 or 1 is expected). -!Type 118 -.151 -Parameter Data : The parameter 4 (Developable Surface Flag) is incorrect (Integer 0 or 1 is expected). -!Type 120 -.152 -Parameter Data : The parameter 1 (Axis of Revolution) is incorrect (Expected entity). -!Type 120 -.153 -Parameter Data : The parameter 2 (Generatrix Entity) is incorrect (Expected Entity). -!Type 120 -.154 -Parameter Data : The parameter 3 (Start Angle) is incorrect (Expected Real). -!Type 120 -.155 -Parameter Data : The parameter 4 (Terminate Angle) is incorrect (Expected Real) -!Type 122 -.156 -Parameter Data : The parameter 1 (Generatrix Entity) is incorrect (Expected Curve Entity). -!Type 122 -.157 -Parameter Data : The parameter %d (Coordinate of the Terminate Point) is incorrect (Expected Real). -!Type 128 -.158 -Parameter Data : Incorrect Additional value (Expected Real). -!Type 128 -.159 -Parameter Data : Additional Real value : ignored. -!Type 128 -.160 -Parameter Data : Invalid Number of First Knots sequence (Expected number : %d). -!Type 128 -.161 -Parameter Data : Invalid Number of Second Knots sequence (Expected number : %d). -!Type 140 -.162 -Parameter Data : The parameter %d (Coordinate of Offset Indicator) is incorrect (Expected Real). -!Type 140 -.163 -Parameter Data : The parameter 4 (Offset Distance) is incorrect (Expected Real). -!Type 140 -.164 -Parameter Data : The parameter 5 (Surface Entity to be offset) is incorrect (Expected Surface Entity). -!Type 143 -.165 -Parameter Data : The parameter 1 (Bounded Surface Representation Type) is incorrect (Integer 0 or 1 is expected). -!Type 143 -.166 -Parameter Data : Le parameter 2 (Surface Entity to be Bounded) is incorrect (Surfacey Entity is expected). -!Type 143 -.167 -Parameter Data : The parameter 3 (Number of Boundary Entities) is incorrect (Expected Positive Integer). -!Type 143 -.168 -Parameter Data : The parameter %d (Boudary Entity) is incorrect (Boundary Entity, Type 141 is expected). -!Type 144 -.169 -Parameter Data : The parameter 1 (Surface to be trimmed) is incorrect (Surface Entity is expected). -!Type 144 -.170 -Parameter Data : The parameter 2 (Outer Boundary Type) is incorrect (Integer 0 or 1 is expected). -!Type 144 -.171 -Parameter Data : The parameter 3 (Number of Inner Boundary Closed Curves) is incorrect (Expected Positive Integer). -!Type 144 -.172 -Parameter Data : The parameter 4 (Outer Boundary) is incorrect (Curve on a Parametric Surface Entity, Type 142 is expected). -!Type 144 -.173 -Parameter Data : The parameter %d (Inner Boundary) is incorrect (Curve on a Parametric Surface Entity, Type 142 is expected). -!Type 190 -.174 -Parameter Data : The parameter 1 (Point on the Surface) is incorrect (Point Entity, Type 116 is expected). -!Type 190 -.175 -Parameter Data : The parameter 2 ( Surface Normal Direction) is incorrect (Direction Entity is expected). -!Type 190 -.176 -Parameter Data : The parameter 3 (Reference Direction) is incorrect (Direction Entity is expected). -!Type 190 -.177 -Parameter Data : The parameter 3 (Null pointer is expected when the Form Number field is 1). -!Type 186 -.178 -Parameter Data : The parameter 1 (Shell) is incorrect (Closed Shell Entity, Type 514, Form 1 is expected). -!Type 186 -.179 -Parameter Data : The parameter %d (Void Shell) is incorrect (Closed Shell Entity, Type 514, Form 1 is expected). -!Type 186 -.180 -Parameter Data : The parameter %d (Orientation Flag) is incorrect (Expected Boolean). -!Type 186 -.181 -Parameter Data : The parameter 3 (Number of Void Shells) is incorrect (Expected Positive Integer) -!Type 502 -.182 -Parameter Data : The parameter 1 (Number of Vertex Tuples) is incorrect (Expected Positive Integer). -!Type 502 -.183 -Parameter Data : The parameter %d (Coordinate of Vertex) is incorrect (Expected Real). -!Type 504 -.184 -Parameter Data : The parameter 1 (Number of Edge Tuples) is incorrect (Expected Positive Integer). -!Type 504 -.185 -Parameter Data : The parameter 2 (Model Space Curve) is incorrect (Curve Entity is expected). -!Type 504 -.186 -Parameter Data : The parameter %d (Start Vertex Index) is incorrect (Expected Integer). -!Type 504 -.187 -Parameter Data : The parameter %d (Terminate Vertex Index) is incorrect (Expected Integer). -!Type 504 -.188 -Entity %d, Type 504 : Parameter Data : The parameter %d (Start Vertex List Entity) is incorrect (Vertex List Entity, Type 502 is expected). -!Type 504 -.189 -Entity %d, Type 504 : Parameter Data : The parameter %d (Terminate Vertex List Entity) is incorrect (Vertex List Entity, Type 502 is expected). -!Type 508 -.190 -Parameter Da ta : The parameter %d (Edge Type) is incorrect (Integer 0 or 1 is expected). -!Type 508 -.191 -Parameter Data : The parameter %d (List Index) is incorrect (Expected Integer). -!Type 508 -.192 -Parameter Data : The parameter %d (Number of Parameter Curves) is incorrect (Expected Positive Integer). -!Type 508 -.193 -Parameter Data : The parameter %d (Vertex or Edge List Entity) is incorrect (Vertex List or Edge List Entity, Type 502 or 504 is expected). -!Type 508 -.194 -Parameter Data : The parameter %d (Parameter Space Curve) is incorrect (Curve Entity is expected). -!Type 508 -.195 -Parameter Data : The parameter %d (Isoparametric Flag) is incorrect (Expected Boolean). -!Type 510 -.196 -Parameter Data : The parameter 1 (Surface) is incorrect (Surface Entity is expected). -!Type 510 -.197 -Parameter Data : The parameter 2 (Number of Loops) is incorrect (Expected Positive Integer). -!Type 510 -.198 -Parameter Data : The parameter 3 (Outer Loop flag) is incorrect (Expected Boolean). -!Type 510 -.199 -Parameter Data : The parameter %d (Loop of the Face) is incorrect (Loop Entity, Type 508 is expected). -!Type 514 -.200 -Parameter Data : The parameter 1 (Number of Faces) is incorrect (Expected Positive Integer). -!Type 514 -.201 -Parameter Data : The parameter 2 (Face) is incorrect (Face Entity, Type 510 is expected). -!Type 402, Form 1 or 7 -.202 -Form %d : Parameter Data : The parameter 1 (Number of Entries) is incorrect (Expected Integer). -!Type 402, Form 1 or 7 -.203 -Form %d : Parameter Data : Some pointers of the Entity list are nul or negative : ignored (Entities are expected). -!Type 402 -.204 -Form 9 : Parameter Data : The parameter 1 (Number of Parent Entity) is incorrect (Expected Integer : 1). -!Type 402 -.205 -Form 9 : Parameter Data : The parameter 2 (Number of Children) is incorrect (Expected Positive Integer). -!Type 402 -.206 -Form 9 : Parameter Data : The parameter 3 (Parent Entity) is incorrect (Entity expected). -!Type 402 -.207 -Form 9 : Parameter Data : Some pointers of the Child Entity List are null or negative : ignored (Entities are expected). -!Type 308 -.208 -Parameter Data : The parameter 1 (Depth of Subfigure) is incorrect (Expected Integer). -!Type 308 -.209 -Parameter Data : The parameter 2 (Subfigure Name) is incorrect : %s (Expected String in hollerith Form). -!Type 308 -.210 -Parameter Data : The parameter 3 (Number of Entities) is incorrect (Expected Positive Integer). -!Type 308 -.211 -Parameter Data : Some pointers of the Associated Entity List are null or negative : ignored (Entities are expected). -!Type 408 -.212 -Parameter Data : The parameter 1 (Subfigure definition entity) is incorrect (Subfigure definition entity, Type 308 expected). -!Type 408 -.213 -Parameter Data : The parameter %d (Translation data) is incorrect (Expected Real). -!Type 408 -.214 -Parameter Data : The parameter 5 (Scale Factor) is incorrect (Expected Real). Default value 1.0 is taken. -!Type 124 -.215 -Parameter Data : All parameters are not of Real type. -! -.216 -Null reference. -! -.217 -Null entity. -! -.218 -Incorrect Type. -! -.219 -Negative pointer. -!ADDED MESSAGES -.220 -Number of associativities is incorrect (Expected integer). -! -.221 -Number of properties is incorrect (Expected integer). - -!TRANSLATION PHASE -.222 -Entity %s, Type %d : The entity points to an invalid object : Halt of the entity translation. -! -.223 -Entity %s, Type %d : The resulting edge is not Same Parameter. -! -.224 -Entity %s, Type %d : Software error : Halt of the translation entity. -! -.225 -Entity %s, Type %d : Entity is empty. -! -.226 -Entity %s, Type %d : Directory Entry (Parameter 7) : Transformation Matrix entity points to an invalid object. -! -.227 -Entity %s, Type %d : Entities Type 116 or 132 cannot appear consecutively in the Entity Type 102. -! -.228 -Entity %s, Type %d : Reference to illegal entity type %d. -! -.229 -Entity %s, Type %d : The curve has been reversed. -! -.230 -Entity %s, Type %d : The curve was lightly disconnected : repaired. -! -.231 -Entity %s, Type %d : The curve was too much disconnected : impossible reparation. -! -.232 -Entity %s, Type %d : The Entity is not closed -! -.233 -Entity %s, Type %d : Software error : Invalid 2D curve, recomputed from 3D curve. -! -.234 -Entity %s, Type %d : Software error : Invalid 3D curve, recomputed from 2D curve. -! -.235 -Entity %s, Type %d : Software error : Invalid 2D and 3D curves. -! -.236 -Entity %s, Type %d : The entity was self-intersecting, repaired. -! -.237 -Entity %s, Type %d : Parameter Data : The parameter 2 (Offset distance flag) different from 1 is not implemented. -! -.238 -Entity %s, Type %d : Incorrect curve length with regard to parameter 14 (Offset curve ending) of the entity %s Type %d. -! -.239 -Entity %s, Type %d : B-Spline curve of continuity C0 cannot be splitted into C1 curves. Result is null.! -! -.240 -Entity %s, Type %d : B-Spline curve of continuity C0 was splitted into C1 curves. -! -.241 -Entity %s, Type %d : Parameter Data : The parameter 1 (Type of bounded surface representation = 0) is not implemented. -! -.242 -Entity %s, Type %d : Not implemented entity. -! -.243 -Entity %s, Type %d :Parameter Data : (Parametesr 1 to 6) The coefficients don't satisfy the conic equation. -! -.244 -Entity %s, Type %d : Parameter Data (Parameters 8 to 11) : Start and terminate coordinates of the arc are the same. -! -.245 -Entity %s, Type %d : Transformation will not be applied to 2D object. -! -.246 -Entity %s, Type %d : Parameter Data : The parameter 4 (Number of segments) is less than 1. -! -.247 -Entity %s, Type %d : Polynomial equation is not correct. -! -.248 -Entity %s, Type %d : Error during creation of control points. -! -.249 -Entity %s, Type %s : Parameter Data : The parameter 1 (Spline type > 3) is not implemented. -! -.250 -Entity %s, Type %d : The result is not guaranteed to be C0. -! -.251 -Entity %s, Type %d : Parameter Data : The parameter 2 (Degree of basis functions) is less than 0 or greater than maximum degree. -! -.252 -Entity %s, Type %d : Parameter Data : Incorrect number of points (2 or more are expected). -! -.253 -Entity %s, Type %d : Translation error : %sStarting multiplicity > %s degree + 1. -! -.254 -Entity %s, Type %d : Translation error : %s Ending multiplicity > %s degree + 1. -! -.255 -Entity %s, Type %d : %sMultiplicity of knot %d > %s degree, repaired -! -.256 -Entity %s, Type %d : Sum of %smultiplicities is not equal to the sum (number of poles + %sdegree + 1). -! -.257 -Entity %s, Type %d : All weights are not positive. -! -.258 -Entity %s, Type %d : The entity is polynomial. -! -.259 -Entity %s, Type %d : Start point and Terminate point of the %sline are the same. -! -.260 -Entity %s, Type %d, Form %d : The vector is ignored. -! -.261 -Entity %s, Type %d : Resulting surface is C0-continuous. -! -.262 -Entity %s, Type %d : Basis surface is C0 continious and is translated to the shell. Only the first face in the shell is offset. -! -.263 -Entity %s, Type %d : The entity points to an invalid object, ignored. -! -.264 -Entity %s, Type %d : The entity could not be translated, ignored. -! -.265 -Entity %s, Type %d : The entity is not coplanar to the entity %s, Type %d. -! -.266 -Entity %s, Type %d : Parameter Data : The parameter 3 or 4 (Number of U or V segments) is less than 1. -! -.267 -Entity %s, Type %d : Parameter Data : The parameter 3 or 4 (Degree of first or second basis functions) is less than 0 or greater than maximum degree. -! -.268 -Entity %s, Type %d : Parameter Data : Number of XYZ coordinates of control points (%s direction) is less than 2. -! -.269 -Entity %s, Type %d : Control points construction error. Result is null. -! -.270 -Entity %s, Type %d : Software error during translation of the Vertex number %d. -! -.271 -Entity %s, Type %d : Translation result of the entity is not implemented. -! -.272 -Beginning of the "Analysis" phase of the IGES file %s. -! -.273 -End of the "Analysis" phase of the IGES file %s (Elapsed time : %s).. -! -.274 -Beginning of the "Translation" phase of the IGES file %s. -! -.275 -End of the "Translation" phase of the IGES file %s (Elapsed time : %s).. diff --git a/src/XSMessage/XSMessage_XSTEP_us.pxx b/src/XSMessage/XSMessage_XSTEP_us.pxx new file mode 100644 index 0000000000..2d5bef6dbe --- /dev/null +++ b/src/XSMessage/XSMessage_XSTEP_us.pxx @@ -0,0 +1,1026 @@ +// This file has been automatically generated from resource file src/XSMessage/XSTEP.us + +static const char XSMessage_XSTEP_us[] = + "!LOADING PHASE\n" + ".XSTEP_1\n" + "Beginning of IGES file memory loading.\n" + "!\n" + ".XSTEP_2\n" + "IGES file opening error.\n" + "!\n" + ".XSTEP_3\n" + "Reason : No such file or directory.\n" + "!\n" + ".XSTEP_4\n" + "Reason : Not enough space.\n" + "!\n" + ".XSTEP_5\n" + "Reason : Permission denied.\n" + "!\n" + ".XSTEP_6\n" + "Reason : Too many open files.\n" + "!\n" + ".XSTEP_7\n" + "Reason : No determined.\n" + "!\n" + ".XSTEP_8\n" + "End of loading IGES file to memory (Elapsed time : %s).\n" + "\n" + "!\n" + ".XSTEP_9\n" + "Beginning of IGES file reading.\n" + "!\n" + ".XSTEP_10\n" + "End of IGES file reading.\n" + "!\n" + ".XSTEP_11\n" + "Internal error during file header reading. Process continues.\n" + "!\n" + ".XSTEP_12\n" + "Header and content of IGES file are loaded.\n" + "!\n" + ".XSTEP_13\n" + "Internal error during reading of entity %d.\n" + "!\n" + ".XSTEP_14\n" + "Internal error during reading of entity %d (parameter %d).\n" + "!\n" + ".XSTEP_15\n" + "Total number of loaded entities %d.\n" + "!\n" + ".XSTEP_16\n" + "Beginning of model loading.\n" + "!\n" + ".XSTEP_17\n" + "End of model loading.\n" + "!\n" + ".XSTEP_18\n" + "Syntax error in IGES file at line %d in section %s.\n" + "!\n" + ".XSTEP_19\n" + "Syntax error in IGES file at line %d in section %s (line number may be incorrect).\n" + "!\n" + ".XSTEP_20\n" + "There is no Terminate Section, please check end of IGES file. Process continues.\n" + "!\n" + ".XSTEP_21\n" + "Number of ignored Null Entities : %d.\n" + "!\n" + ".XSTEP_22\n" + " Unknown entity %s.\n" + "!\n" + ".XSTEP_23\n" + " Recovered entity %s.\n" + "!\n" + ".XSTEP_24\n" + "Report : %d unknown entities.\n" + "!\n" + ".XSTEP_25\n" + "Number of fails in memory loading : %d.\n" + "!\n" + ".XSTEP_26\n" + "Number of warnings in memory loading : %d.\n" + "!\n" + ".XSTEP_27\n" + " Directory Entry : there is no parameter. Process continues.\n" + "!\n" + ".XSTEP_28\n" + " Directory Entry : parameter 1 (entity type) is incorrect.\n" + "!\n" + ".XSTEP_29\n" + " Directory Entry : Field 4 (Line Font Pattern) is incorrect (Non null pointer or Integer between 0 and 5 was expected).\n" + "!\n" + ".XSTEP_30\n" + " Directory Entry : Field 5 (Level) isincorrect (Not null pointer or not null Integer was expected).\n" + "!\n" + ".XSTEP_31\n" + " Directory Entry : Field 6 (View) is incorrect (Not null pointer or Integer Zero was expected).\n" + "!\n" + ".XSTEP_32\n" + " Directory Entry : Field 7 (Transformation Matrix) is incorrect (Not null pointer or Integer Zero was expected).\n" + "!\n" + ".XSTEP_33\n" + " Directory Entry : Field 8 (Label Display Associativity) is incorrect (Not null pointer or Integer Zero was expected).\n" + "!\n" + ".XSTEP_34\n" + " Directory Entry : Field 13 (Color Number) is incorrect (Not null pointer or Integer between 0 and 8 was expected).\n" + "!\n" + ".XSTEP_35\n" + " Null entity %s.\n" + "!\n" + ".XSTEP_36\n" + " Unknown entity %s.\n" + "!\n" + ".XSTEP_37\n" + " Associativity list is incorrect.\n" + "!\n" + ".XSTEP_38\n" + " Property list is incorrect.\n" + "! ANALYSIS PHASE\n" + ".XSTEP_39\n" + "Global Section : Incorrect number of parameters (%d or %d parameters were expected).\n" + "!\n" + ".XSTEP_40\n" + "Global Section (Parameters 1 and 2) : Parameter Delimiter Character and Record Delimiter Character must not have the same value.\n" + "!\n" + ".XSTEP_41\n" + "Global Section (Parameter 2) : Parameter Delimiter Character is incorrect. Default character comma taken.\n" + "!\n" + ".XSTEP_42\n" + "Global Section (Parameter 2) : Character Record Delimiter parameter is incorrect. Default character Semicolon taken.\n" + "!\n" + ".XSTEP_43\n" + "Global Section (Parameter 8) : Single Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 38 taken.\n" + "!\n" + ".XSTEP_44\n" + "Global Section (Parameter 9) : Single Precision Significance parameter is incorrect (Expected positive Integer). Default value 6 taken.\n" + "!\n" + ".XSTEP_45\n" + "Global Section (Parameter 10) : Double Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 308 taken.\n" + "!\n" + ".XSTEP_46\n" + "Global Section (Parameter 11) : Double Precision Significance parameter is incorrect (Expected positive Integer). Default value 15 taken.\n" + "!\n" + ".XSTEP_47\n" + "Global Section (Parameter 13) : Model Space Scale parameter is incorrect (Expected positive Real). Default value 1.0 taken.\n" + "!\n" + ".XSTEP_48\n" + "Global Section (Parameter 14) : Unit Flag parameter is incorrect (Integer between 1 et 11 was expected). Default value 2 taken : Millimeters.\n" + "!\n" + ".XSTEP_49\n" + "Global Section (Parameter 15): Unit Name parameter is not recognized. Default value 2 taken : Millimeters.srl\n" + "!\n" + ".XSTEP_50\n" + "Global Section (Parameter 15) : Unit Name parameter is undefined : Unit Name ignored.\n" + "!\n" + ".XSTEP_51\n" + "Global Section (Parameter 14 and 15) : Unit Flag parameter does not correspond to Unit Name parameter : Unit Name ignored.\n" + "!\n" + ".XSTEP_52\n" + "Global Section (Parameter 19) : (Expected positive Real). Default value 0.0 taken.\n" + "!\n" + ".XSTEP_53\n" + "Global Section (Parameter 23) : Version Flag parameter is incorrect (Integer between 1 et 11 was expected. Default value 3 taken : Version 2.0.\n" + "!\n" + ".XSTEP_54\n" + "Global Section (Parameter 24) : Drafting Standard Flag parameter is incorrect (Integer between 0 et 7). Default value 3 taken : No standard.Global Section (Parameter 25) : Last change Date parameter was undefined.\n" + "!\n" + ".XSTEP_55\n" + "Global Section (Parameter 25) : Last Change Date parameter is undefined.\n" + "!\n" + ".XSTEP_56\n" + "Global Section (Parameter %d) : Date parameter is undefined.\n" + "!\n" + ".XSTEP_57\n" + "Global Section (Parameter %d) : Incorrect Date Format.\n" + "!\n" + ".XSTEP_58\n" + " Directory Entry (Field 1) : entity type number field is incorrect (Expected Integer : %d).\n" + "!\n" + ".XSTEP_59\n" + " Directory Entry (Field 3) : Structure field is undefined.\n" + "!\n" + ".XSTEP_60\n" + " Directory Entry (Field 4) : Line Font Pattern field is incorrect (Pointer or Integer between 0 and 5 was expected). Default value 0 taken.\n" + "!\n" + ".XSTEP_61\n" + " Directory Entry (Field 5) : Level field is incorrect (Pointer or Integer were expected). Default value 0 taken.\n" + "!\n" + ".XSTEP_62\n" + " Directory Entry (Field 6) : View field is incorrect (Pointer or Zero were expected). Default value 0 taken.\n" + "!\n" + ".XSTEP_63\n" + " Directory Entry (Field 7): Transformation Matrix field is incorrect (Pointer or Zero were expected). Default value 0 taken.\n" + "!\n" + ".XSTEP_64\n" + " Directory Entry (Field 8): Label Display entity field is incorrect (Pointer or Zero were expected). Default value 0 taken.\n" + "!\n" + ".XSTEP_65\n" + " Directory Entry (Field 9) : Blank Status field is incorrect (Expected Integer : 0 or 1). \n" + "!\n" + ".XSTEP_66\n" + " Directory Entry (Field 9) : Subordinate entity Switch field is incorrect (Integer between 0 and 3 was expected). \n" + "!\n" + ".XSTEP_67\n" + " Directory Entry (Field 9) : entity Use Flag is incorrect (Integer between 0 and 6 was expected). \n" + "!\n" + ".XSTEP_68\n" + " Directory Entry (Field 9) : Hierarchy field is incorrect (Integer between 0 and 2 was expected). \n" + "!\n" + ".XSTEP_69\n" + " Directory Entry (Field 12) : Line Weight Number is undefined.\n" + "!\n" + ".XSTEP_70\n" + " Directory Entry (Field 13) : Color Number field is incorrect (Pointer or Integer between 0 and 8 was expected).\n" + "!\n" + ".XSTEP_71\n" + " Directory Entry (Field 15) : Form Number field is incorrect.\n" + "!\n" + ".XSTEP_72\n" + " Directory Entry (Field 19): entity Subscript Number field is incorrect (Integer was expected).\n" + "!Type 116\n" + ".XSTEP_73\n" + "Parameter Data : parameter %d (Coordinate of Point) is incorrect (Real was expected).\n" + "!Type 116\n" + ".XSTEP_74\n" + "Parameter Data : parameter %d (Display Symbol) is incorrect (Subfigure Definition entity, Type 308 was expected).\n" + "!Type 100\n" + ".XSTEP_75\n" + "Parameter Data : parameter 1 (ZT displacement of Arc) is incorrect (Real was expected).\n" + "!Type 100\n" + ".XSTEP_76\n" + "Parameter Data : parameter %d (Arc Center) is incorrect (Real was expected).\n" + "!Type 100\n" + ".XSTEP_77\n" + "Parameter Data : parameter %d (Start Point) is incorrect (Real was expected).\n" + "!Type 100\n" + ".XSTEP_78\n" + "Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).\n" + "!Type 102\n" + ".XSTEP_79\n" + "Parameter Data : parameter 1 (Number of Entities) is incorrect : %d (Expected positive Integer).\n" + "!Type 102\n" + ".XSTEP_80\n" + "Parameter Data : Some pointers in entity list are null or negative : ignored (Point, Connect Point or Parameterized Curve Entities were expected).\n" + "!Type 104\n" + ".XSTEP_81\n" + "Parameter Data : parameter %d (Conic Coefficient) is incorrect (Real was expected).\n" + "!Type 104\n" + ".XSTEP_82\n" + "Parameter Data : parameter 7 (Coordinate of Plane) is incorrect (Real was expected).\n" + "!Type 104\n" + ".XSTEP_83\n" + "Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).\n" + "!Type 104\n" + ".XSTEP_84\n" + "Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).\n" + "!Type 106\n" + ".XSTEP_85\n" + "Parameter Data : parameter 1 (Interpretation Flag) is incorrect (Expected Integer : %d).\n" + "!Type 106\n" + ".XSTEP_86\n" + "Parameter Data : parameter 2 (Number of n-tuples) is incorrect (Expected positive Integer).\n" + "!Type 106\n" + ".XSTEP_87\n" + "Parameter Data : parameter 3 (Common Z Displacement) is incorrect (Real was expected).\n" + "!Type 106\n" + ".XSTEP_88\n" + "Parameter Data : not all Data Point parameters are of Real type.\n" + "!Type 110\n" + ".XSTEP_89\n" + "Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).\n" + "!Type 110\n" + ".XSTEP_90\n" + "Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).\n" + "!Type 112\n" + ".XSTEP_91\n" + "Parameter Data : parameter 1 (Spline Type) is incorrect (Integer between 1 and 6 was expected).\n" + "!Type 112\n" + ".XSTEP_92\n" + "Parameter Data (Parameter 2) : parameter 2 (Degree of Continuity) is incorrect (Expected Integer).\n" + "!Type 112\n" + ".XSTEP_93\n" + "Parameter Data : parameter 3 (Number of Dimensions) is incorrect (Expected Integer : 2 or 3).\n" + "!Type 112\n" + ".XSTEP_94\n" + "Parameter Data : parameter 4 (Number of Segments) is incorrect (Expected positive Integer).\n" + "!Type 112\n" + ".XSTEP_95\n" + "Parameter Data : not all Break Point parameters are of Real type.\n" + "!Type 112\n" + ".XSTEP_96\n" + "Parameter Data : entity is planar but parameters BZ, CZ. DZ are not null.\n" + "!Type 126\n" + ".XSTEP_97\n" + "Parameter Data : parameter %d (Upper Index of Sum) is incorrect (Expected positive Integer).\n" + "!Type 126\n" + ".XSTEP_98\n" + "Parameter Data : parameter %d (Degree of Basis Functions) is incorrect (Expected Integer) : Default value 0 taken.\n" + "!Type 126\n" + ".XSTEP_99\n" + "Parameter Data : parameter %d (Planar/Non Planar Flag) is incorrect (Expected Boolean).\n" + "!Type 126\n" + ".XSTEP_100\n" + "Parameter Data : parameter %d (Open/Closed Flag) is incorrect (Expected Boolean).\n" + "!Type 126\n" + ".XSTEP_101\n" + "Parameter Data : parameter %d (Rational/Polynomial Flag) is incorrect (Expected Boolean).\n" + "!Type 126\n" + ".XSTEP_102\n" + "Parameter Data : parameter %d (NonPeriodic/Periodic Flag) is incorrect (Expected Boolean).\n" + "!Type 126\n" + ".XSTEP_103\n" + "Parameter Data : not all Knot Sequence parameters are of Real type.\n" + "!Type 126\n" + ".XSTEP_104\n" + "Parameter Data : not all Weight parameters are of positive Real type.\n" + "!Type 126\n" + ".XSTEP_105\n" + "Parameter Data : parameter %d (Control Point) is incorrect (Real was expected).\n" + "!Type 126\n" + ".XSTEP_106\n" + "Parameter Data : parameter %d (Starting Value) is incorrect (Real was expected).\n" + "!Type 126\n" + ".XSTEP_107\n" + "Parameter Data : parameter %d (Ending Value) is incorrect (Real was expected).\n" + "!Type 126\n" + ".XSTEP_108\n" + "Parameter Data : parameter %d (Unit Normal) is incorrect (Real was expected).\n" + "!Type 126\n" + ".XSTEP_109\n" + "Parameter Data : parameter %d (Unit Normal) is undefined for a planar curve.\n" + "!Type 130\n" + ".XSTEP_110\n" + "Parameter Data : parameter 1 (Curve entity to be offset) is incorrect (Curve entity was expected).\n" + "!Type 130\n" + ".XSTEP_111\n" + "Parameter Data : parameter 2 (Offset Distance Flag) is incorrect (Integer between 1 and 3 was expected).\n" + "!Type 130\n" + ".XSTEP_112\n" + "Parameter Data : parameter 3 (Curve entity whose coordinate describes offset) is incorrect (Curve entity was expected).\n" + "!Type 130\n" + ".XSTEP_113\n" + "Parameter Data : parameter 4 (Particular Coordinate) is incorrect (Expected Integer).\n" + "!Type 130\n" + ".XSTEP_114\n" + "Parameter Data : parameter 5 (Tapered Offset Type Flag) is incorrect (Expected Integer).\n" + "!Type 130\n" + ".XSTEP_115\n" + "Parameter Data : parameter 6 (First Offset distance) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_116\n" + "Parameter Data : parameter 7 (Arc Length of First Offset Distance) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_117\n" + "Parameter Data : parameter 8 (Second Offset Distance) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_118\n" + "Parameter Data : parameter 9 (Arc Length of Second Offset Distance) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_119\n" + "Parameter Data : parameter 13 (Offset Curve Starting Parameter Value) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_120\n" + "Parameter Data : parameter 14 (Offset Curve Ending Parameter Value) is incorrect (Real was expected).\n" + "!Type 130\n" + ".XSTEP_121\n" + "Parameter Data : parameter %d (Unit Vector Normal to plane) is incorrect (Real was expected).\n" + "!Type 141\n" + ".XSTEP_122\n" + "Parameter Data : parameter 1 (Type of Bounded Surface Representation) is incorrect (Expected Integer : 0 or 1).\n" + "!Type 141\n" + ".XSTEP_123\n" + "Parameter Data : parameter 2 (Trimming Curves Representation) is incorrect (Integer between 0 and 3 was expected).\n" + "!Type 141\n" + ".XSTEP_124\n" + "Parameter Data : parameter 3 (Untrimmed Surface) is incorrect (Untrimmed Surface entity was expected).\n" + "!Type 141\n" + ".XSTEP_125\n" + "Parameter Data : Not parametric Surface %d (parameter 3).\n" + "!Type 141\n" + ".XSTEP_126\n" + "Parameter Data : parameter 4 (Number of Curves) is incorrect (Expected positive).\n" + "!Type 141\n" + ".XSTEP_127\n" + "Parameter Data : parameter 5 (Model Space Curve) is incorrect (Curve entity was expected).\n" + "!Type 141\n" + ".XSTEP_128\n" + "Parameter Data (Parameter 6) : Orientation Flag parameter is incorrect (Expected Integer : 1 or 2).\n" + "!Type 141\n" + ".XSTEP_129\n" + "Parameter Data : parameter 7 (Number of Associated Parameter Space Curves) is incorrect (Expected Integer : 0).\n" + "!Type 141\n" + ".XSTEP_130\n" + "Parameter Data : Some pointers in Parameter Space Curve list are null or negative : ignored (Curve Entities were expected).\n" + "!Type 142\n" + ".XSTEP_131\n" + "Parameter Data : parameter 2 (Surface on which the curve lies) is incorrect (Surface entity was expected).\n" + "!Type 142\n" + ".XSTEP_132\n" + "Parameter Data : parameter 3 (Curve 2D) is incorrect (Curve entity was expected).\n" + "!Type 142\n" + ".XSTEP_133\n" + "Parameter Data : parameter 4 (Curve 3D) is incorrect (Curve entity was expected).\n" + "!Type 142\n" + ".XSTEP_134\n" + "Parameter Data : pointers of Curve 2D and 3D are null (parameter 3 and 4) (Curve Entities were expected).\n" + "!Type 108\n" + ".XSTEP_135\n" + "Parameter Data : parameter %d (Coefficient Of Plane) is incorrect (Real was expected).\n" + "!Type 108\n" + ".XSTEP_136\n" + "Parameter Data : parameter 5 (Closed Curve) is incorrect (Curve entity was expected).\n" + "!Type 108\n" + ".XSTEP_137\n" + "Parameter Data : parameter 5 (Null pointer in Form Number 0 was Expected).\n" + "!Type 108\n" + ".XSTEP_138\n" + "Parameter Data : parameter 9 (Display Symbol Size) is incorrect (Real was expected).\n" + "!Type 108\n" + ".XSTEP_139\n" + "Parameter Data : parameter %d (Coordinate of Display Symbol) is incorrect (Real was expected).\n" + "!Type 114\n" + ".XSTEP_140\n" + "Parameter Data : parameter 1 (Spline Boundary Type) is incorrect (Integer between 1 and 6 was expected).\n" + "!Type 114\n" + ".XSTEP_141\n" + "Parameter Data : parameter 3 (Number of U Segments) is incorrect (Expected positive Integer).\n" + "!Type 114\n" + ".XSTEP_142\n" + "Parameter Data : parameter 4 (Number of V Segments) is incorrect (Expected positive Integer).\n" + "!Type 114\n" + ".XSTEP_143\n" + "Parameter Data : not all Breakpoints in U parameters are of Real type.\n" + "!Type 114\n" + ".XSTEP_144\n" + "Parameter Data : not all Breakpoints in V parameters are of Real type.\n" + "!Type 114\n" + ".XSTEP_145\n" + "Parameter Data : not all %s Coefficient of Patch parameter(s) are of Real type.\n" + "!Type 114\n" + ".XSTEP_146\n" + "Parameter Data : parameter %d (Last Z Coefficient of Patch) is incorrect.\n" + "!Type 114\n" + ".XSTEP_147\n" + "Parameter Data : %s Coefficient of Patch parameters are incorrect (Expected Integer : 16).\n" + "!Type 118\n" + ".XSTEP_148\n" + "Parameter Data : parameter 1 (First Curve) is incorrect.\n" + "!Type 118\n" + ".XSTEP_149\n" + "EParameter Data : parameter 2 (Second Curve) is incorrect.\n" + "!Type 118\n" + ".XSTEP_150\n" + "Parameter Data : parameter 3 (Direction Flag) is incorrect (Integer 0 or 1 was expected).\n" + "!Type 118\n" + ".XSTEP_151\n" + "Parameter Data : parameter 4 (Developable Surface Flag) is incorrect (Integer 0 or 1 was expected).\n" + "!Type 120\n" + ".XSTEP_152\n" + "Parameter Data : parameter 1 (Axis of Revolution) is incorrect.\n" + "!Type 120\n" + ".XSTEP_153\n" + "Parameter Data : parameter 2 (Generatrix entity) is incorrect.\n" + "!Type 120\n" + ".XSTEP_154\n" + "Parameter Data : parameter 3 (Start Angle) is incorrect.\n" + "!Type 120\n" + ".XSTEP_155\n" + "Parameter Data : parameter 4 (Terminate Angle) is incorrect.\n" + "!Type 122\n" + ".XSTEP_156\n" + "Parameter Data : parameter 1 (Generatrix entity) is incorrect.\n" + "!Type 122\n" + ".XSTEP_157\n" + "Parameter Data : parameter %d (Coordinate of Terminate Point) is incorrect.\n" + "!Type 128\n" + ".XSTEP_158\n" + "Parameter Data : Incorrect Additional value.\n" + "!Type 128\n" + ".XSTEP_159\n" + "Parameter Data : Additional Real value : ignored.\n" + "!Type 128\n" + ".XSTEP_160\n" + "Parameter Data : Invalid Number in First Knots sequence.\n" + "!Type 128\n" + ".XSTEP_161\n" + "Parameter Data : Invalid Number in Second Knots sequence.\n" + "!Type 140\n" + ".XSTEP_162\n" + "Parameter Data : parameter %d (Coordinate of Offset Indicator) is incorrect.\n" + "!Type 140\n" + ".XSTEP_163\n" + "Parameter Data : parameter 4 (Offset Distance) is incorrect.\n" + "!Type 140\n" + ".XSTEP_164\n" + "Parameter Data : parameter 5 (Surface entity to be offset) is incorrect.\n" + "!Type 143\n" + ".XSTEP_165\n" + "Parameter Data : parameter 1 (Bounded Surface Representation type) is incorrect (Integer 0 or 1 was expected).\n" + "!Type 143\n" + ".XSTEP_166\n" + "Parameter Data : parameter 2 (Surface entity to be bounded) is incorrect.\n" + "!Type 143\n" + ".XSTEP_167\n" + "Parameter Data : parameter 3 (Number of Boundary entities) is incorrect.\n" + "!Type 143\n" + ".XSTEP_168\n" + "Parameter Data : parameter %d (Boudary entity) is incorrect.\n" + "!Type 144\n" + ".XSTEP_169\n" + "Parameter Data : parameter 1 (Surface to be trimmed) is incorrect.\n" + "!Type 144\n" + ".XSTEP_170\n" + "Parameter Data : parameter 2 (Outer Boundary type) is incorrect (Integer 0 or 1 was expected).\n" + "!Type 144\n" + ".XSTEP_171\n" + "Parameter Data : parameter 3 (Number of Inner Boundary Closed Curves) is incorrect (Expected positive Integer).\n" + "!Type 144\n" + ".XSTEP_172\n" + "Parameter Data : parameter 4 (Outer Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).\n" + "!Type 144\n" + ".XSTEP_173\n" + "Parameter Data : parameter %d (Inner Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).\n" + "!Type 190\n" + ".XSTEP_174\n" + "Parameter Data : parameter 1 (Point on Surface) is incorrect (Point entity, Type 116 was expected).\n" + "!Type 190\n" + ".XSTEP_175\n" + "Parameter Data : parameter 2 ( Surface Normal Direction) is incorrect (Direction entity was expected).\n" + "!Type 190\n" + ".XSTEP_176\n" + "Parameter Data : parameter 3 (Reference Direction) is incorrect (Direction entity was expected).\n" + "!Type 190\n" + ".XSTEP_177\n" + "Parameter Data : parameter 3 (Null pointer was expected when Form Number field is 1).\n" + "!Type 186\n" + ".XSTEP_178\n" + "Parameter Data : parameter 1 (Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).\n" + "!Type 186\n" + ".XSTEP_179\n" + "Parameter Data : parameter %d (Void Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).\n" + "!Type 186\n" + ".XSTEP_180\n" + "Parameter Data : parameter %d (Orientation Flag) is incorrect (Expected Boolean).\n" + "!Type 186\n" + ".XSTEP_181\n" + "Parameter Data : parameter 3 (Number of Void Shells) is incorrect (Expected positive Integer)\n" + "!Type 502\n" + ".XSTEP_182\n" + "Parameter Data : parameter 1 (Number of Vertex Tuples) is incorrect (Expected positive Integer).\n" + "!Type 502\n" + ".XSTEP_183\n" + "Parameter Data : parameter %d (Coordinate of Vertex) is incorrect (Real was expected).\n" + "!Type 504\n" + ".XSTEP_184\n" + "Parameter Data : parameter 1 (Number of Edge Tuples) is incorrect (Expected positive Integer).\n" + "!Type 504\n" + ".XSTEP_185\n" + "Parameter Data : parameter 2 (Model Space Curve) is incorrect (Curve entity was expected).\n" + "!Type 504\n" + ".XSTEP_186\n" + "Parameter Data : parameter %d (Start Vertex Index) is incorrect (Expected Integer).\n" + "!Type 504\n" + ".XSTEP_187\n" + "Parameter Data : parameter %d (Terminate Vertex Index) is incorrect (Expected Integer).\n" + "!Type 504\n" + ".XSTEP_188\n" + " Parameter Data : parameter %d (Start Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).\n" + "!Type 504\n" + ".XSTEP_189\n" + " Parameter Data : parameter %d (Terminate Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).\n" + "!Type 508\n" + ".XSTEP_190\n" + "Parameter Da ta : parameter %d (Edge Type) is incorrect (Integer 0 or 1 was expected).\n" + "!Type 508\n" + ".XSTEP_191\n" + "Parameter Data : parameter %d (List Index) is incorrect (Expected Integer).\n" + "!Type 508\n" + ".XSTEP_192\n" + "Parameter Data : parameter %d (Number of Parameter Curves) is incorrect (Expected positive Integer).\n" + "!Type 508\n" + ".XSTEP_193\n" + "Parameter Data : parameter %d (Vertex or Edge List entity) is incorrect (Vertex List or Edge List entity, Type 502 or 504 was expected).\n" + "!Type 508\n" + ".XSTEP_194\n" + "Parameter Data : parameter %d (Parameter Space Curve) is incorrect (Curve entity was expected).\n" + "!Type 508\n" + ".XSTEP_195\n" + "Parameter Data : parameter %d (Isoparametric Flag) is incorrect (Expected Boolean).\n" + "!Type 510\n" + ".XSTEP_196\n" + "Parameter Data : parameter 1 (Surface) is incorrect.\n" + "!Type 510\n" + ".XSTEP_197\n" + "Parameter Data : parameter 2 (Number of Loops) is incorrect (Expected positive Integer).\n" + "!Type 510\n" + ".XSTEP_198\n" + "Parameter Data : parameter 3 (Outer Loop flag) is incorrect (Expected Boolean).\n" + "!Type 510\n" + ".XSTEP_199\n" + "Parameter Data : parameter %d (Loop of the Face) is incorrect (Loop entity, Type 508 was expected).\n" + "!Type 514\n" + ".XSTEP_200\n" + "Parameter Data : parameter 1 (Number of Faces) is incorrect (Expected positive Integer).\n" + "!Type 514\n" + ".XSTEP_201\n" + "Parameter Data : parameter 2 (Face) is incorrect (Face entity, Type 510 was expected).\n" + "!Type 402, Form 1 or 7\n" + ".XSTEP_202\n" + "Form %d : Parameter Data : parameter 1 (Number of Entries) is incorrect (expected positive integer).\n" + "!Type 402, Form 1 or 7\n" + ".XSTEP_203\n" + "Form %d : Parameter Data : some pointers of entity list are null or negative : ignored (Entities were expected).\n" + "!Type 402\n" + ".XSTEP_204\n" + "Form 9 : Parameter Data : parameter 1 (Number of Parent entity) is incorrect (Expected Integer : 1).\n" + "!Type 402\n" + ".XSTEP_205\n" + "Form 9 : Parameter Data : parameter 2 (Number of Children) is incorrect (expected positive integer).\n" + "!Type 402\n" + ".XSTEP_206\n" + "Form 9 : Parameter Data : parameter 3 (Parent entity) is incorrect (entity expected).\n" + "!Type 402\n" + ".XSTEP_207\n" + "Form 9 : Parameter Data : some pointers in Child Entity List are null or negative : ignored (Entities were expected).\n" + "!Type 308\n" + ".XSTEP_208\n" + "Parameter Data : parameter 1 (Depth of Subfigure) is incorrect (Expected Integer).\n" + "!Type 308\n" + ".XSTEP_209\n" + "Parameter Data : parameter 2 (Subfigure Name) is incorrect : %s (Expected String in hollerith Form).\n" + "!Type 308\n" + ".XSTEP_210\n" + "Parameter Data : parameter 3 (Number of Entities) is incorrect (Expected positive Integer).\n" + "!Type 308\n" + ".XSTEP_211\n" + "Parameter Data : Some pointers of Associated entity List are null or negative : ignored (Entities were expected).\n" + "!Type 408\n" + ".XSTEP_212\n" + "Parameter Data : parameter 1 (Subfigure definition entity) is incorrect (Subfigure definition entity, Type 308 expected).\n" + "!Type 408\n" + ".XSTEP_213\n" + "Parameter Data : parameter %d (Translation data) is incorrect (Real was expected).\n" + "!Type 408\n" + ".XSTEP_214\n" + "Parameter Data : parameter 5 (Scale Factor) is incorrect (Real was expected). Default value 1.0 taken.\n" + "!Type 124\n" + ".XSTEP_215\n" + "Parameter Data : not all parameters are of Real type.\n" + "!\n" + "!ADDED MESSAGES\n" + ".XSTEP_246\n" + " Parameter Data : parameter 4 (Number of segments) is less than 1.\n" + "!\n" + "!\n" + "! DCE 6/11/98 Add in Load phase\n" + "!\n" + ".XSTEP_276\n" + "Parameter Data : Parameter 1 (Curve creation mode) is invalid (integer expected).\n" + "!\n" + ".XSTEP_277\n" + "Parameter Data : Parameter 5 (Representation preference) is invalid (integer expected).\n" + "!\n" + ".XSTEP_278\n" + "Exception during loading entity %s\n" + "!\n" + "!\n" + "!\n" + "! ===================================================================\n" + "!\n" + "!\n" + "!\n" + "! New translation messages ( S3767 )\n" + "!\n" + ".IGES_1000\n" + " Entity %s has not been loaded into memory\n" + "!\n" + ".IGES_1001\n" + " Form %d : Not an implemented entity type : cannot transfer.\n" + "!\n" + ".IGES_1005\n" + " Software error : impossible entity transfer.\n" + "!\n" + "!.IGES_1006 same as 1015\n" + "! exception raising during transfer.\n" + "!\n" + ".IGES_1010\n" + " Resulting TopoDS_Shape has not same 2D and 3D parametrization.\n" + "!\n" + ".IGES_1015\n" + " Software error : transfer interrupted !\n" + "\n" + ".IGES_1020\n" + " Parameter data : pointer %d in associated entity list is null or negative and ignored.\n" + "!\n" + ".IGES_1025\n" + " Transfer error on IGES entity %d : entity skipped.\n" + "!\n" + ".IGES_1030\n" + " Form %d: problems during translation some items in the group.\n" + "!\n" + ".IGES_1035\n" + " Transformation matrix is invalid : not applied.\n" + "!\n" + ".IGES_1036\n" + " Software error : entity skipped.\n" + "!\n" + ".IGES_1040\n" + " Parameter data : pointer %d in entity list is null or has an invalid type and ignored.\n" + "!\n" + ".IGES_1045\n" + " Two consecutives entities are identical (rank %d): only one is transferred.\n" + "!\n" + ".IGES_1050\n" + " %dD curve of rank %d was reversed.\n" + "!\n" + ".IGES_1051\n" + " All %dD curves before rank %d were reversed.\n" + "!\n" + ".IGES_1055\n" + " %dD curves of rank %d were slightly disconnected : repaired.\n" + "!\n" + ".IGES_1060\n" + " %dD curves of rank %d were too disconnected : entity skipped.\n" + "!\n" + ".IGES_1061\n" + " Surface is translated to TopoDS_Shell : entity skipped.\n" + "!\n" + ".IGES_1062\n" + " CurveOnSurface on Composite Surface case not implemented : 3D representation returned.\n" + "!\n" + ".IGES_1066\n" + " Transfer error on surface where curve lies.\n" + "!\n" + ".IGES_1070\n" + " Representations in file are inconsistent : recomputated from %dD.\n" + "!\n" + ".IGES_1090\n" + " Curve was slightly self-intersecting : repaired.\n" + "!\n" + ".IGES_1095\n" + " 3D and 2D curve representations are invalid : entity skipped.\n" + "!\n" + ".IGES_1100\n" + " Parameter data : value of parameter 2 (Offset Distance Flag) is not 1 : case not implemented.\n" + "!\n" + ".IGES_1105\n" + " Ending parameter is beyond end of curve : entity skipped.\n" + "!\n" + ".IGES_1110\n" + " Transfer error on basic curve : entity skipped.\n" + "!\n" + ".IGES_1115\n" + " With C0 continuity can not be splitted into Geom_BSplineCurve C1 lower than Precision::Confusion().\n" + "!\n" + ".IGES_1120\n" + " With C0 continuity was splitted into C1 continuity Geom_BSplineCurve.\n" + "!\n" + ".IGES_1125\n" + " Parameter data : parameter 1 (Type of Bounded Surface Representation = 0) : case not implemented. \n" + "!\n" + ".IGES_1130\n" + " Boundary on Composite Surface : case not implemented.\n" + "!\n" + ".IGES_1135\n" + " %dD curve representation is not defined : computed from %dD curve representation.\n" + "! 2D curve representation is not defined : computed from 3D curve representation.\n" + "!\n" + ".IGES_1140\n" + " Error during 3D curve transfer : recomputed from 2D.\n" + "!\n" + ".IGES_1145\n" + " Error during %dD curve transfer : recomputed from %dD.\n" + "! error during 2D curve transfer : recomputed from 3D.\n" + "!\n" + ".IGES_1150\n" + " %s too disconnected :recomputed from %dD.\n" + "! 2D TopoDS_Wire too disconnected :recomputed from 3D.\n" + "!\n" + ".IGES_1155\n" + " Parameter data : (parameter 1 to 6) coefficients do not satisfy a conic equation.\n" + "!\n" + ".IGES_1156\n" + " %s %s transfer failed : entity skipped.\n" + "! (type IGES) (DE:Number) transfer failed : entity skipped.\n" + "!\n" + ".IGES_1160\n" + " Parameter data (Parameters 8 to 11) : start and terminate coordinates of arc are the same : entity not trimmed.\n" + "!\n" + ".IGES_1165 \n" + " Transformation is not planar : not applied.\n" + "!\n" + ".IGES_1170\n" + " Polynomial equation is incorrect.\n" + "!\n" + ".IGES_1175\n" + " Error during creation of control points.\n" + "!\n" + ".IGES_1180\n" + " Parameter data : parameter 1 (Spline Type >3) : case not implemented.\n" + "!\n" + ".IGES_1190\n" + " Parameter data : parameter 2 (Degree of basis functions) is lower than 0 or greater than max degree : transfer interrupted.\n" + "!\n" + ".IGES_1195\n" + " Parameter data : incorrect number of control points (2 or more are required).\n" + "!\n" + ".IGES_1200\n" + " %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.\n" + "!\n" + ".IGES_1201\n" + " %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.\n" + "!\n" + ".IGES_1210\n" + " Sum of %s multiplicities is not equal to sum (number of poles + %s degree +1).\n" + "!\n" + ".IGES_1215\n" + " Parameter data : some weight parameters are not of positive real type : entity skipped.\n" + "!\n" + ".IGES_1220\n" + " Rational BSpline %s is in fact polynomial.\n" + "!\n" + ".IGES_1221\n" + " Surface is made periodic.\n" + "!\n" + ".IGES_1225\n" + " Start and terminate points are the same.\n" + "!\n" + "! 1230 is the same as 1195\n" + "!\n" + ".IGES_1235\n" + " Curve is too small to be transferred : entity skipped.\n" + "!\n" + ".IGES_1240\n" + " Vector is not for this form : ignored. \n" + "!\n" + ".IGES_1250\n" + " Resulting Geom_Surface is C0-continuous.\n" + "!\n" + ".IGES_1255\n" + " Ruling failed : entity skipped.\n" + "!\n" + ".IGES_1265\n" + " Basis surface is not C0-continuous : offset surface construction impossible.\n" + "!\n" + ".IGES_1266\n" + " Basis surface is C0-continuous and cannot be corrected to C1-continuous.\n" + "!\n" + ".IGES_1267\n" + " Basis surface is C0-continuous but was corrected to C1-continuous.\n" + "!\n" + ".IGES_1270\n" + " Basis surface is C0-continuous and is transferred into a TopoDS_Shell. Only first face was offseted.\n" + "!\n" + ".IGES_1275\n" + " Model Space Representation 0 case not implemented : result is a basis surface.\n" + "!\n" + ".IGES_1280\n" + " Invalid direction : entity skipped.constituent\n" + "!\n" + ".IGES_1285\n" + " Parameter data : pointer %d of child entity list is null or negative : skipped.\n" + "!\n" + ".IGES_1295\n" + " Hole %d and plane are not coplanar.\n" + "!\n" + ".IGES_1300\n" + " Bounding curve is invalid : plane is not trimmed.\n" + "!\n" + ".IGES_1305\n" + " Parameter data : parameter 3 or 4 (number of segments) is less than one.\n" + "!\n" + ".IGES_1306\n" + " Improper type for underlying curve number %d.\n" + " \n" + ".IGES_1310\n" + " Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.\n" + "!\n" + ".IGES_1325\n" + " Resulting geometry not C0-continuous : TopoDS_Edge %d cannot be constructed.\n" + "!\n" + ".IGES_1345\n" + " Parameter data : parameter %d (parameter space curve) is incorrect.\n" + "!\n" + ".IGES_1360\n" + " TopoDS_Shell is not closed.\n" + "!\n" + ".IGES_1365\n" + " Incorrect edge number %d.\n" + "!\n" + ".IGES_1370\n" + " Missing seam-edge was added\n" + "!\n" + ".IGES_1371\n" + " TopoDS_Face was created with natural bounds\n" + "!\n" + ".IGES_1372\n" + " One or more TopoDS_Wire(s) on TopoDS_Face was reversed\n" + "!\n" + ".IGES_1373\n" + " Knots are not in ascending order\n" + "!\n" + ".IGES_1374\n" + " Difference between weights is too big.\n" + "!\n" + "!\n" + "!\n" + "!\n" + "! Trace File messages \n" + ".IGES_2000\n" + "Diagnostics for IGES file read : %s\n" + "!\n" + ".IGES_2005\n" + "Trace level : %d\n" + "\n" + "!\n" + ".IGES_2010\n" + "Beginning of IGES file check.\n" + "!\n" + ".IGES_2015\n" + "Number of warnings in check : %d.\n" + "!\n" + ".IGES_2020\n" + "Number of fails in check : %d\n" + "!\n" + ".IGES_2025\n" + "End of file check(Elapsed time : %s).\n" + "!\n" + ".IGES_2030\n" + "Beginning of IGES data translation.\n" + "!\n" + ".IGES_2031\n" + "File has not been loaded.\n" + "\n" + "!\n" + ".IGES_2032\n" + "IGES entity %d does not exist.\n" + "\n" + "!\n" + ".IGES_2035\n" + "read.precision.mode : %d\n" + "!\n" + ".IGES_2040\n" + "read.precision.val : %f\n" + "!\n" + ".IGES_2045\n" + "read.iges.bspline.continuity : %d\n" + "!\n" + ".IGES_2050\n" + "read.surfacecurve.mode : %d\n" + "\n" + "!\n" + ".IGES_2055\n" + "Number of warnings in transfer : %d.\n" + "!\n" + ".IGES_2060\n" + "Number of fails in transfer : %d\n" + "!\n" + ".IGES_2065\n" + "End of IGES data translation (Elapsed time : %s).\n" + "!\n" + ".IGES_2070\n" + "Translating IGES entity DE:%d Type:%d\n" + "!\n" + ".IGES_2075\n" + "\n" + "%s produced.\n" + "!\n" + ".IGES_2076\n" + "No TopoDS_Shape produced.\n" + "\n" + "!Messages for TPSTAT.\n" + ".IGES_3000\n" + "********************************************************************************\n" + ".IGES_3005\n" + "General statistics for transfer :\n" + "!\n" + ".IGES_3010\n" + " Number of selected IGES entities : %d\n" + "!\n" + ".IGES_3011\n" + " Number of roots IGES entities : %d\n" + "!\n" + ".IGES_3015\n" + " Number of CasCade resulting Shapes : %d\n" + "!\n" + ".IGES_3020\n" + " Number of warnings : %d\n" + "!\n" + ".IGES_3025\n" + " Number of fails : %d\n" + "!\n" + ".IGES_3030\n" + "Count W/F Type Form Message on IGES entity\n" + "----- --- ---- ---- ----------------------\n" + "!\n" + ".IGES_3035\n" + "On IGES entities (DE) :\n" + "!\n" + ".IGES_3040\n" + "Count of CasCade resulting shapes\n" + "\n" + "!\n" + ".IGES_3045\n" + "\n" + "Count CasCade Shapes\n" + "----- --------------\n" + "!\n" + ".IGES_3050\n" + "Mapping of all IGES entities\n" + ".IGES_3055\n" + "\n" + "Type Form Count CasCade Shapes\n" + "---- ---- ----- --------------\n" + "!\n" + "! Debug messages\n" + ".IGES_10005\n" + " Small edge removed\n" + ".IGES_10010\n" + " Degenerated edge detected\n" + ".IGES_10015\n" + " Lacking edge inserted\n" + "!\n" + "!\n" + ".IGES_10020\n" + " Null area wire was detected, wire skipped.\n"; diff --git a/src/XSMessage/XSTEP.us b/src/XSMessage/XSTEP.us index d77ed81a97..9dff5b33ab 100755 --- a/src/XSMessage/XSTEP.us +++ b/src/XSMessage/XSTEP.us @@ -67,7 +67,7 @@ Number of ignored Null Entities : %d. Unknown entity %s. ! .XSTEP_23 - Recovered entity. + Recovered entity %s. ! .XSTEP_24 Report : %d unknown entities.