Reorganized resources to keep source part in src and real-time scripts in resource folder.
For the installation result no changes, still installed to src for windows.
get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
- OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
+ OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
else()
- OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
+ OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
endif()
endforeach()
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)
+ if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}")
+ file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}/FILES" RESOURCE_FILES)
set (CurrentResource_Directory "${CurrentResource}")
set (isResDirectory TRUE)
else()
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 "// 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)
-
- set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
- foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
- string (REPLACE "\"" "\\\"" line "${line}")
- set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
- endforeach()
- set (OCCT_HEADER_FILE_CONTENT "${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)
+ message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}")
+ # generate content for header file
+ set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file resources/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
+ # read resource file
+ file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
+ set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
+ foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
+ string (REPLACE "\"" "\\\"" line "${line}")
+ set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
+ endforeach()
+ set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};\n\n")
+ # 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()
endforeach()
endif()
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
-CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
+CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
-CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
+CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
-CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
+CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
)
set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/inc"
- set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src"
+ set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource"
set "CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data"
set "CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples"
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests"
export CSF_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
- export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/src"
+ export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/resource"
export CSF_OCCTDataPath="@CMAKE_SOURCE_DIR@/data"
export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples"
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests"
-@OCCT_HEADER_FILE_CONTENT@
+// clang-format off
+@OCCT_HEADER_FILE_CONTENT@// clang-format on
--- /dev/null
+!!!!!!!!!! ----- Messages file for BOPAlgo package --------- !!!!!!!!!
+! Keyword is name of corresponding alert (error or warning) class
+
+! Special key used to check that messages are loaded; see BOPAlgo_Options.cxx
+.BOPAlgo_LOAD_CHECKER
+N/A
+
+.BOPAlgo_AlertBOPIsNotSet
+The type of Boolean Operation is not set
+
+.BOPAlgo_AlertBOPNotAllowed
+Boolean operation of the given type is not allowed on the given inputs
+
+.BOPAlgo_AlertSolidBuilderFailed
+Building Fused solid has failed
+
+.BOPAlgo_AlertTooFewArguments
+There are no enough arguments to perform the operation
+
+.BOPAlgo_AlertMultipleArguments
+More than one argument is provided
+
+.BOPAlgo_AlertNoFiller
+The Pave Filler (the intersection tool) has not been created
+
+.BOPAlgo_AlertIntersectionFailed
+The intersection of the arguments has failed
+
+.BOPAlgo_AlertBuilderFailed
+Building of the result shape has failed
+
+.BOPAlgo_AlertNullFace
+The face given to be split is a null shape
+
+.BOPAlgo_AlertNullInputShapes
+No or null input shapes
+
+.BOPAlgo_AlertPostTreatFF
+Cannot connect face intersection curves
+
+.BOPAlgo_AlertEmptyShape
+Some of the arguments are empty shapes
+
+.BOPAlgo_AlertSelfInterferingShape
+Some of the arguments are self-interfering shapes
+
+.BOPAlgo_AlertTooSmallEdge
+Some edges are too small and have no valid range
+
+.BOPAlgo_AlertNotSplittableEdge
+Some edges are very small and have such a small valid range, that they cannot be split
+
+.BOPAlgo_AlertBadPositioning
+The positioning of the shapes leads to creation of the small edges without valid range
+
+.BOPAlgo_AlertShellSplitterFailed
+Unable to build loops from the given faces
+
+.BOPAlgo_AlertRemovalOfIBForMDimShapes
+Removal of internal boundaries among the multi-dimensional shapes is not supported yet
+
+.BOPAlgo_AlertRemovalOfIBForSolidsFailed
+Removal of internal boundaries among Solids has failed
+
+.BOPAlgo_AlertRemovalOfIBForFacesFailed
+Removal of internal boundaries among Faces has failed
+
+.BOPAlgo_AlertRemovalOfIBForEdgesFailed
+Removal of internal boundaries among Edges has failed
+
+.BOPAlgo_AlertIntersectionOfPairOfShapesFailed
+Intersection of pair of shapes has failed
+
+.BOPAlgo_AlertBuildingPCurveFailed
+Building 2D curve of edge on face has failed
+
+.BOPAlgo_AlertAcquiredSelfIntersection
+Some sub-shapes of some of the argument become connected through other shapes and the argument became self-interfered
+
+.BOPAlgo_AlertUnsupportedType
+Unsupported type of input shape
+
+.BOPAlgo_AlertUnableToRemoveTheFeature
+Unable to remove the feature
+
+.BOPAlgo_AlertNoFacesToRemove
+No faces have been found for removal
+
+.BOPAlgo_AlertRemoveFeaturesFailed
+The Feature Removal algorithm has failed
+
+.BOPAlgo_AlertSolidBuilderUnusedFaces
+Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation
+
+.BOPAlgo_AlertFaceBuilderUnusedEdges
+Some of the edges passed to the Face Builder algorithm have not been classified and not used for faces creation
+
+.BOPAlgo_AlertUnableToOrientTheShape
+Unable to orient the shape correctly
+
+.BOPAlgo_AlertUnknownShape
+Shape is unknown for operation
+
+.BOPAlgo_AlertNoPeriodicityRequired
+No periodicity has been requested for the shape
+
+.BOPAlgo_AlertUnableToTrim
+Unable to trim the shape for making it periodic (BOP Common fails)
+
+.BOPAlgo_AlertUnableToMakeIdentical
+Unable to make the shape to look identical on opposite sides (Splitter fails)
+
+.BOPAlgo_AlertUnableToRepeat
+Unable to repeat the shape (Gluer fails)
+
+.BOPAlgo_AlertMultiDimensionalArguments
+Multi-dimensional arguments
+
+.BOPAlgo_AlertUnableToMakePeriodic
+Unable to make the shape periodic
+
+.BOPAlgo_AlertUnableToGlue
+Unable to glue the shapes
+
+.BOPAlgo_AlertShapeIsNotPeriodic
+The shape is not periodic
+
+.BOPAlgo_AlertUnableToMakeClosedEdgeOnFace
+Unable to make closed edge on face.
--- /dev/null
+BOPAlgo.msg
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+if { [info commands addmenu] == "" } { return }
+
+global theMenus
+if [info exists theMenus(Curves)] {
+ destroy [string trimright $theMenus(Curves) ".menu"]
+ unset theMenus(Curves)
+}
+
+addmenu Curves "Line" {
+ dialbox line name l origin {0 0 0} direction {1 0 0}
+}
+addmenu Curves "Circle" {
+ dialbox circle name c center {0 0 0} normal {0 0 1} xdir {1 0 0} radius 1
+}
+addmenu Curves "Ellipse" {
+ dialbox ellipse name e center {0 0 0} normal {0 0 1} xdir {1 0 0} radii {1 0.5}
+}
+addmenu Curves "Hyperbola" {
+ dialbox hyperbola name h center {0 0 0} normal {0 0 1} xdir {1 0 0} radii {1 0.5}
+}
+
+addmenu Curves "Parabola" {
+ dialbox parabola name b center {0 0 0} normal {0 0 1} xdir {1 0 0} focus 1
+}
+redrawhelp
--- /dev/null
+# Copyright (c) 2013-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+############################################################################
+# This file defines scripts for verification of OCCT tests.
+# It provides top-level commands starting with 'check'.
+# Type 'help check*' to get their synopsis.
+# See OCCT Tests User Guide for description of the test system.
+#
+# Note: procedures with names starting with underscore are for internal use
+# inside the test system.
+############################################################################
+
+help checkcolor {
+ Check pixel color.
+ Use: checkcolor x y red green blue
+ x y - pixel coordinates
+ red green blue - expected pixel color (values from 0 to 1)
+ Function check color with tolerance (5x5 area)
+}
+# Procedure to check color using command vreadpixel with tolerance
+proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
+ puts "Coordinate x = $coord_x"
+ puts "Coordinate y = $coord_y"
+ puts "RED color of RGB is $rd_get"
+ puts "GREEN color of RGB is $gr_get"
+ puts "BLUE color of RGB is $bl_get"
+
+ if { $coord_x <= 1 || $coord_y <= 1 } {
+ puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
+ return -1
+ }
+
+ set color ""
+ catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] }
+ if {"$color" == ""} {
+ puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view"
+ }
+ set rd [lindex $color 0]
+ set gr [lindex $color 1]
+ set bl [lindex $color 2]
+ set rd_int [expr int($rd * 1.e+05)]
+ set gr_int [expr int($gr * 1.e+05)]
+ set bl_int [expr int($bl * 1.e+05)]
+ set rd_ch [expr int($rd_get * 1.e+05)]
+ set gr_ch [expr int($gr_get * 1.e+05)]
+ set bl_ch [expr int($bl_get * 1.e+05)]
+
+ if { $rd_ch != 0 } {
+ set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
+ } else {
+ set tol_rd $rd_int
+ }
+ if { $gr_ch != 0 } {
+ set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
+ } else {
+ set tol_gr $gr_int
+ }
+ if { $bl_ch != 0 } {
+ set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
+ } else {
+ set tol_bl $bl_int
+ }
+
+ set status 0
+ if { $tol_rd > 0.2 } {
+ puts "Warning : RED light of additive color model RGB is invalid"
+ set status 1
+ }
+ if { $tol_gr > 0.2 } {
+ puts "Warning : GREEN light of additive color model RGB is invalid"
+ set status 1
+ }
+ if { $tol_bl > 0.2 } {
+ puts "Warning : BLUE light of additive color model RGB is invalid"
+ set status 1
+ }
+
+ if { $status != 0 } {
+ puts "Warning : Colors of default coordinate are not equal"
+ }
+
+ global stat
+ if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
+ set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
+ set stat [lindex $info end]
+ if { ${stat} != 1 } {
+ puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
+ return $stat
+ } else {
+ puts "Point with valid color was found"
+ return $stat
+ }
+ } else {
+ set stat 1
+ }
+}
+
+# Procedure to check color in the point near default coordinate
+proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
+ set x_start [expr ${coord_x} - 2]
+ set y_start [expr ${coord_y} - 2]
+ set mistake 0
+ set i 0
+ while { $mistake != 1 && $i <= 5 } {
+ set j 0
+ while { $mistake != 1 && $j <= 5 } {
+ set position_x [expr ${x_start} + $j]
+ set position_y [expr ${y_start} + $i]
+ puts $position_x
+ puts $position_y
+
+ set color ""
+ catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] }
+ if {"$color" == ""} {
+ puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view"
+ incr j
+ continue
+ }
+ set rd [lindex $color 0]
+ set gr [lindex $color 1]
+ set bl [lindex $color 2]
+ set rd_int [expr int($rd * 1.e+05)]
+ set gr_int [expr int($gr * 1.e+05)]
+ set bl_int [expr int($bl * 1.e+05)]
+
+ if { $rd_ch != 0 } {
+ set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
+ } else {
+ set tol_rd $rd_int
+ }
+ if { $gr_ch != 0 } {
+ set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
+ } else {
+ set tol_gr $gr_int
+ }
+ if { $bl_ch != 0 } {
+ set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
+ } else {
+ set tol_bl $bl_int
+ }
+
+ if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
+ puts "Warning : Point with true color was not found near default coordinates"
+ set mistake 0
+ } else {
+ set mistake 1
+ }
+ incr j
+ }
+ incr i
+ }
+ return $mistake
+}
+
+# auxiliary: check argument
+proc _check_arg {check_name check_result {get_value 0}} {
+ upvar ${check_result} ${check_result}
+ upvar arg arg
+ upvar narg narg
+ upvar args args
+ if { $arg == ${check_name} } {
+ if { ${get_value} == "?" } {
+ set next_arg_index [expr $narg + 1]
+ if { $next_arg_index < [llength $args] && ! [regexp {^-[^0-9]} [lindex $args $next_arg_index]] } {
+ set ${check_result} "[lindex $args $next_arg_index]"
+ set narg ${next_arg_index}
+ } else {
+ set ${check_result} "true"
+ }
+ } elseif {${get_value}} {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-[^0-9]} [lindex $args $narg]] } {
+ set ${check_result} "[lindex $args $narg]"
+ } else {
+ error "Option ${check_result} requires argument"
+ }
+ } else {
+ set ${check_result} "true"
+ }
+ return 1
+ }
+ return 0
+}
+
+help checknbshapes {
+ Compare number of sub-shapes in "shape" with given reference data
+
+ Use: checknbshapes shape [options...]
+ Allowed options are:
+ -vertex N
+ -edge N
+ -wire N
+ -face N
+ -shell N
+ -solid N
+ -compsolid N
+ -compound N
+ -shape N
+ -t: compare the number of sub-shapes in "shape" counting
+ the same sub-shapes with different location as different sub-shapes.
+ -m msg: print "msg" in case of error
+ -ref [nbshapes a]: compare the number of sub-shapes in "shape" and in "a".
+ -vertex N, -edge N and other options are still working.
+}
+proc checknbshapes {shape args} {
+ puts "checknbshapes ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ set nbVERTEX -1
+ set nbEDGE -1
+ set nbWIRE -1
+ set nbFACE -1
+ set nbSHELL -1
+ set nbSOLID -1
+ set nbCOMPSOLID -1
+ set nbCOMPOUND -1
+ set nbSHAPE -1
+
+ set message ""
+ set count_locations 0
+ set ref_info ""
+
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+ if {[_check_arg "-vertex" nbVERTEX 1] ||
+ [_check_arg "-edge" nbEDGE 1] ||
+ [_check_arg "-wire" nbWIRE 1] ||
+ [_check_arg "-face" nbFACE 1] ||
+ [_check_arg "-shell" nbSHELL 1] ||
+ [_check_arg "-solid" nbSOLID 1] ||
+ [_check_arg "-compsolid" nbCOMPSOLID 1] ||
+ [_check_arg "-compound" nbCOMPOUND 1] ||
+ [_check_arg "-shape" nbSHAPE 1] ||
+ [_check_arg "-t" count_locations] ||
+ [_check_arg "-m" message 1] ||
+ [_check_arg "-ref" ref_info 1]
+ } {
+ continue
+ }
+ # unsupported option
+ if { [regexp {^-} $arg] } {
+ error "Error: unsupported option \"$arg\""
+ }
+ error "Error: cannot interpret argument $narg ($arg)"
+ }
+
+ if { ${count_locations} == 0 } {
+ set nb_info [nbshapes ${shape}]
+ } else {
+ set nb_info [nbshapes ${shape} -t]
+ }
+
+ set EntityList {VERTEX EDGE WIRE FACE SHELL SOLID COMPSOLID COMPOUND SHAPE}
+
+ foreach Entity ${EntityList} {
+ set expr_string "${Entity} +: +(\[-0-9.+eE\]+)"
+ set to_compare {}
+ # get number of elements from ${shape}
+ if { [regexp "${expr_string}" ${nb_info} full nb_entity2] } {
+ lappend to_compare ${nb_entity2}
+ } else {
+ error "Error : command \"nbshapes ${shape}\" gives an empty result"
+ }
+ # get number of elements from options -vertex -edge and so on
+ set nb_entity1 [set nb${Entity}]
+ if { ${nb_entity1} != -1 } {
+ lappend to_compare ${nb_entity1}
+ }
+ # get number of elements from option -ref
+ if { [regexp "${expr_string}" ${ref_info} full nb_entity_ref] } {
+ lappend to_compare ${nb_entity_ref}
+ }
+ # skip comparing if no reference data was given
+ if {[llength $to_compare] == 1} {
+ continue
+ }
+ # compare all values, if they are equal, length of sorted list "to_compare"
+ # (with key -unique) should be equal to 1
+ set to_compare [lsort -dictionary -unique $to_compare]
+ if { [llength $to_compare] != 1 } {
+ puts "Error : ${message} is WRONG because number of ${Entity} entities in shape \"${shape}\" is ${nb_entity2}"
+ } else {
+ puts "OK : ${message} is GOOD because number of ${Entity} entities is equal to number of expected ${Entity} entities"
+ }
+ }
+}
+
+# Procedure to check equality of two reals with tolerance (relative and absolute)
+help checkreal {
+ Compare value with expected
+ Use: checkreal name value expected tol_abs tol_rel
+}
+proc checkreal {name value expected tol_abs tol_rel} {
+ if { abs ($value - $expected) > $tol_abs + $tol_rel * abs ($expected) } {
+ puts "Error: $name = $value is not equal to expected $expected"
+ } else {
+ puts "Check of $name OK: value = $value, expected = $expected"
+ }
+ return
+}
+
+# Procedure to check equality of two 3D points with tolerance
+help checkpoint {
+ Compare two 3D points with given tolerance
+ Use: checkpoint name {valueX valueY valueZ} {expectedX expectedY expectedZ} tolerance
+}
+proc checkpoint {theName theValue theExpected theTolerance} {
+ set e 0.0001
+ foreach i {0 1 2} {
+ if { [expr abs([lindex $theValue $i] - [lindex $theExpected $i])] > $theTolerance } {
+ puts "Error: $theName, ($theValue) is not equal to expected ($theExpected)"
+ return
+ }
+ }
+ puts "Check of $theName OK: value = ($theValue), expected = ($theExpected)"
+ return
+}
+
+help checkfreebounds {
+ Compare number of free edges with ref_value
+
+ Use: checkfreebounds shape ref_value [options...]
+ Allowed options are:
+ -tol N: used tolerance (default -0.01)
+ -type N: used type, possible values are "closed" and "opened" (default "closed")
+}
+proc checkfreebounds {shape ref_value args} {
+ puts "checkfreebounds ${shape} ${ref_value} ${args}"
+ upvar ${shape} ${shape}
+
+ set tol -0.01
+ set type "closed"
+
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+ if {[_check_arg "-tol" tol 1] ||
+ [_check_arg "-type" type 1]
+ } {
+ continue
+ }
+ # unsupported option
+ if { [regexp {^-} $arg] } {
+ error "Error: unsupported option \"$arg\""
+ }
+ error "Error: cannot interpret argument $narg ($arg)"
+ }
+
+ if {"$type" != "closed" && "$type" != "opened"} {
+ error "Error : wrong -type key \"${type}\""
+ }
+
+ freebounds ${shape} ${tol}
+ set free_edges [llength [explode ${shape}_[string range $type 0 0] e]]
+
+ if { ${ref_value} == -1 } {
+ puts "Error : Number of free edges is UNSTABLE"
+ return
+ }
+
+ if { ${free_edges} != ${ref_value} } {
+ puts "Error : Number of free edges is not equal to reference data"
+ } else {
+ puts "OK : Number of free edges is ${free_edges}"
+ }
+}
+
+help checkmaxtol {
+ Returns max tolerance of the shape and prints error message if specified
+ criteria are not satisfied.
+
+ Use: checkmaxtol shape [options...]
+
+ Options specify criteria for checking the maximal tolerance value:
+ -ref <value>: check it to be equal to reference value.
+ -min_tol <value>: check it to be not greater than specified value.
+ -source <list of shapes>: check it to be not greater than
+ maximal tolerance of specified shape(s)
+ -multi_tol <value>: additional multiplier for value specified by -min_tol
+ or -shapes options.
+}
+
+proc checkmaxtol {shape args} {
+ puts "checkmaxtol ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ set ref_value ""
+ set source_shapes {}
+ set min_tol 0
+ set tol_multiplier 0
+
+ # check arguments
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+ if {[_check_arg "-min_tol" min_tol 1] ||
+ [_check_arg "-multi_tol" tol_multiplier 1] ||
+ [_check_arg "-source" source_shapes 1] ||
+ [_check_arg "-ref" ref_value 1]
+ } {
+ continue
+ }
+ # unsupported option
+ if { [regexp {^-} $arg] } {
+ error "Error: unsupported option \"$arg\""
+ }
+ error "Error: cannot interpret argument $narg ($arg)"
+ }
+
+ # get max tol of shape
+ set max_tol 0
+ if {[regexp "Tolerance MAX=(\[-0-9.+eE\]+)" [tolerance ${shape}] full maxtol_temp]} {
+ set max_tol ${maxtol_temp}
+ } else {
+ error "Error: cannot get tolerances of shape \"${shape}\""
+ }
+
+ # find max tol of source shapes
+ foreach source_shape ${source_shapes} {
+ upvar ${source_shape} ${source_shape}
+ set _src_max_tol [checkmaxtol ${source_shape}]
+ if { [expr ${_src_max_tol} > ${min_tol} ] } {
+ set min_tol ${_src_max_tol}
+ }
+ }
+ # apply -multi_tol option
+ if {${tol_multiplier}} {
+ set min_tol [expr ${tol_multiplier} * ${_src_max_tol}]
+ }
+ # compare max tol of source shapes with checking tolerance
+ if { ${min_tol} && [expr ${max_tol} > ${min_tol}] } {
+ puts "Error: tolerance of \"${shape}\" (${max_tol}) is greater than checking tolerance (${min_tol})"
+ }
+ if { ${ref_value} != "" } {
+ checkreal "Max tolerance" ${max_tol} ${ref_value} 0.0001 0.01
+ }
+ return ${max_tol}
+}
+
+help checkfaults {
+ Compare faults number of given shapes.
+
+ Use: checkfaults shape source_shape [ref_value=0]
+}
+proc checkfaults {shape source_shape {ref_value 0}} {
+ puts "checkfaults ${shape} ${source_shape} ${ref_value}"
+ upvar $shape $shape
+ upvar $source_shape $source_shape
+ set cs_a [checkshape $source_shape]
+ set nb_a 0
+ if {[regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_a full nb_a_begin nb_a_end]} {
+ set nb_a [expr $nb_a_end - $nb_a_begin +1]
+ }
+ set cs_r [checkshape $shape]
+ set nb_r 0
+ if {[regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_r full nb_r_begin nb_r_end]} {
+ set nb_r [expr $nb_r_end - $nb_r_begin +1]
+ }
+ puts "Number of faults for the initial shape is $nb_a."
+ puts "Number of faults for the resulting shape is $nb_r."
+
+ if { ${ref_value} == -1 } {
+ puts "Error : Number of faults is UNSTABLE"
+ return
+ }
+
+ if { $nb_r > $nb_a } {
+ puts "Error : Number of faults is $nb_r"
+ }
+}
+
+# auxiliary: check all arguments
+proc _check_args { args {options {}} {command_name ""}} {
+ # check arguments
+ for {set narg 0} {${narg} < [llength ${args}]} {incr narg} {
+ set arg [lindex ${args} ${narg}]
+ set toContinue 0
+ foreach option ${options} {
+ set option_name [lindex ${option} 0]
+ set variable_to_save_value [lindex ${option} 1]
+ set get_value [lindex ${option} 2]
+ set local_value ""
+ if { [_check_arg ${option_name} local_value ${get_value}] } {
+ upvar 1 ${variable_to_save_value} ${variable_to_save_value}
+ set ${variable_to_save_value} ${local_value}
+ set toContinue 1
+ }
+ }
+ if {${toContinue}} { continue }
+ # unsupported option
+ if { [regexp {^-} ${arg}] } {
+ error "Error: unsupported option \"${arg}\""
+ }
+ error "Error: cannot interpret argument ${narg} (${arg})"
+ }
+ foreach option ${options} {
+ set option_name [lindex ${option} 0]
+ set variable_to_save_value [lindex ${option} 1]
+ set should_exist [lindex ${option} 3]
+ if {![info exists ${variable_to_save_value}] && ${should_exist} == 1} {
+ error "Error: wrong using of command '${command_name}', '${option_name}' option is required"
+ }
+ }
+}
+
+help checkprops {
+ Procedure includes commands to compute length, area and volume of input shape.
+
+ Use: checkprops shapename [options...]
+ Allowed options are:
+ -l LENGTH: command lprops, computes the mass properties of all edges in the shape with a linear density of 1
+ -s AREA: command sprops, computes the mass properties of all faces with a surface density of 1
+ -v VOLUME: command vprops, computes the mass properties of all solids with a density of 1
+ -eps EPSILON: the epsilon defines relative precision of computation
+ -deps DEPSILON: the epsilon defines relative precision to compare corresponding values
+ -equal SHAPE: compare area\volume\length of input shapes. Puts error if its are not equal
+ -notequal SHAPE: compare area\volume\length of input shapes. Puts error if its are equal
+ -skip: count shared shapes only once, skipping repetitions
+ Options -l, -s and -v are independent and can be used in any order. Tolerance epsilon is the same for all options.
+}
+
+proc checkprops {shape args} {
+ puts "checkprops ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
+ puts "Error: The command cannot be built"
+ return
+ }
+
+ set length -1
+ set area -1
+ set volume -1
+ set epsilon 1.0e-4
+ set compared_equal_shape -1
+ set compared_notequal_shape -1
+ set equal_check 0
+ set skip 0
+ set depsilon 1e-2
+
+ set options {{"-eps" epsilon 1}
+ {"-equal" compared_equal_shape 1}
+ {"-notequal" compared_notequal_shape 1}
+ {"-skip" skip 0}
+ {"-deps" depsilon 1}}
+
+ if { [regexp {\-[not]*equal} $args] } {
+ lappend options {"-s" area 0}
+ lappend options {"-l" length 0}
+ lappend options {"-v" volume 0}
+ set equal_check 1
+ } else {
+ lappend options {"-s" area 1}
+ lappend options {"-l" length 1}
+ lappend options {"-v" volume 1}
+ }
+ _check_args ${args} ${options} "checkprops"
+
+ if { ${length} != -1 || ${equal_check} == 1 } {
+ lappend CommandNames {lprops}
+ set equal_check 0
+ }
+ if { ${area} != -1 || ${equal_check} == 1 } {
+ lappend CommandNames {sprops}
+ set equal_check 0
+ }
+ if { ${volume} != -1 || ${equal_check} == 1 } {
+ lappend CommandNames {vprops}
+ set equal_check 0
+ }
+
+ set skip_option ""
+ if { $skip } {
+ set skip_option "-skip"
+ }
+
+ foreach CommandName ${CommandNames} {
+ switch $CommandName {
+ "lprops" { set mass ${length}; set prop "length" }
+ "sprops" { set mass ${area}; set prop "area" }
+ "vprops" { set mass ${volume}; set prop "volume" }
+ }
+ regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${shape} ${epsilon} $skip_option] full m
+
+ if { ${compared_equal_shape} != -1 } {
+ upvar ${compared_equal_shape} ${compared_equal_shape}
+ regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_equal_shape} ${epsilon} $skip_option] full compared_m
+ if { $compared_m != $m } {
+ puts "Error: Shape ${compared_equal_shape} is not equal to shape ${shape}"
+ }
+ }
+
+ if { ${compared_notequal_shape} != -1 } {
+ upvar ${compared_notequal_shape} ${compared_notequal_shape}
+ regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_notequal_shape} ${epsilon} $skip_option] full compared_m
+ if { $compared_m == $m } {
+ puts "Error: Shape ${compared_notequal_shape} is equal shape to ${shape}"
+ }
+ }
+
+ if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
+ if { [string compare "$mass" "empty"] != 0 } {
+ if { $m == 0 } {
+ puts "Error : The command is not valid. The $prop is 0."
+ }
+ # check of change of area is < 1%
+ if { ($mass != 0 && abs (($mass - $m) / double($mass)) > $depsilon) ||
+ ($mass == 0 && $m != 0) } {
+ puts "Error : The $prop of result shape is $m, expected $mass"
+ }
+ } else {
+ if { $m != 0 } {
+ puts "Error : The command is not valid. The $prop is $m"
+ }
+ }
+ }
+ }
+}
+
+help checkdump {
+ Procedure includes command to parse output dump and compare it with reference values.
+
+ Use: checkdump shapename [options...]
+ Allowed options are:
+ -name NAME: list of parsing parameters (e.g. Center, Axis, etc)
+ -ref VALUE: list of reference values for each parameter in NAME
+ -eps EPSILON: the epsilon defines relative precision of computation
+}
+
+proc checkdump {shape args} {
+ puts "checkdump ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ set ddump -1
+ set epsilon -1
+ set options {{"-name" params 1}
+ {"-ref" ref 1}
+ {"-eps" epsilon 1}
+ {"-dump" ddump 1}}
+
+ if { ${ddump} == -1 } {
+ set ddump [dump ${shape}]
+ }
+ _check_args ${args} ${options} "checkdump"
+
+ set index 0
+ foreach param ${params} {
+ set pattern "${param}\\s*:\\s*"
+ set number_pattern "(\[-0-9.+eE\]+)\\s*"
+ set ref_values ""
+ set local_ref ${ref}
+ if { [llength ${params}] > 1 } {
+ set local_ref [lindex ${ref} ${index}]
+ }
+ foreach item ${local_ref} {
+ if { ![regexp "$pattern$number_pattern" $ddump full res] } {
+ puts "Error: checked parameter ${param} is not listed in dump"
+ break
+ }
+ lappend ref_values $res
+ set pattern "${pattern}${res},\\s*"
+ ## without precision
+ if { ${epsilon} == -1 } {
+ if { ${item} != ${res} } {
+ puts "Error: parameter ${param} - current value (${res}) is not equal to reference value (${item})"
+ } else {
+ puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
+ }
+ ## with precision
+ } else {
+ set precision 0.0000001
+ if { ( abs($res) > $precision ) || ( abs($item) > $precision ) } {
+ if { ($item != 0 && [expr 1.*abs($item - $res)/$item] > $epsilon) || ($item == 0 && $res != 0) } {
+ puts "Error: The $param of the resulting shape is $res and the expected $param is $item"
+ } else {
+ puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
+ }
+ }
+ }
+ }
+ incr index
+ }
+}
+
+help checklength {
+ Procedure includes commands to compute length of input curve.
+
+ Use: checklength curvename [options...]
+ Allowed options are:
+ -l LENGTH: command length, computes the length of input curve with precision of computation
+ -eps EPSILON: the epsilon defines relative precision of computation
+ -equal CURVE: compare length of input curves. Puts error if its are not equal
+ -notequal CURVE: compare length of input curves. Puts error if its are equal
+}
+
+proc checklength {shape args} {
+ puts "checklength ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
+ puts "Error: The command cannot be built"
+ return
+ }
+
+ set length -1
+ set epsilon 1.0e-4
+ set compared_equal_shape -1
+ set compared_notequal_shape -1
+ set equal_check 0
+
+ set options {{"-eps" epsilon 1}
+ {"-equal" compared_equal_shape 1}
+ {"-notequal" compared_notequal_shape 1}}
+
+ if { [regexp {\-[not]*equal} $args] } {
+ lappend options {"-l" length 0}
+ set equal_check 1
+ } else {
+ lappend options {"-l" length 1}
+ }
+ _check_args ${args} ${options} "checkprops"
+
+ if { ${length} != -1 || ${equal_check} == 1 } {
+ set CommandName length
+ set mass $length
+ set prop "length"
+ set equal_check 0
+ }
+
+ regexp "The +length+ ${shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${shape} ${epsilon}] full m
+
+ if { ${compared_equal_shape} != -1 } {
+ upvar ${compared_equal_shape} ${compared_equal_shape}
+ regexp "The +length+ ${compared_equal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_equal_shape} ${epsilon}] full compared_m
+ if { $compared_m != $m } {
+ puts "Error: length of shape ${compared_equal_shape} is not equal to shape ${shape}"
+ }
+ }
+
+ if { ${compared_notequal_shape} != -1 } {
+ upvar ${compared_notequal_shape} ${compared_notequal_shape}
+ regexp "The +length+ ${compared_notequal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_notequal_shape} ${epsilon}] full compared_m
+ if { $compared_m == $m } {
+ puts "Error: length of shape ${compared_notequal_shape} is equal shape to ${shape}"
+ }
+ }
+
+ if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
+ if { [string compare "$mass" "empty"] != 0 } {
+ if { $m == 0 } {
+ puts "Error : The command is not valid. The $prop is 0."
+ }
+ if { $mass > 0 } {
+ puts "The expected $prop is $mass"
+ }
+ #check of change of area is < 1%
+ if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
+ puts "Error : The $prop of result shape is $m"
+ }
+ } else {
+ if { $m != 0 } {
+ puts "Error : The command is not valid. The $prop is $m"
+ }
+ }
+ }
+}
+
+help checkview {
+ Display shape in selected viewer.
+
+ Use: checkview [options...]
+ Allowed options are:
+ -display shapename: display shape with name 'shapename'
+ -3d: display shape in 3d viewer
+ -2d [ v2d / smallview ]: display shape in 2d viewer (default viewer is a 'smallview')
+ -vdispmode N: it is possible to set vdispmode for 3d viewer (default value is 1)
+ -screenshot: procedure will try to make screenshot of already created viewer
+ -path <path>: location of saved screenshot of viewer
+
+ Procedure can check some property of shape (length, area or volume) and compare it with some value N:
+ -l [N]
+ -s [N]
+ -v [N]
+ If current property is equal to value N, shape is marked as valid in procedure.
+ If value N is not given procedure will mark shape as valid if current property is non-zero.
+ -with {a b c}: display shapes 'a' 'b' 'c' together with 'shape' (if shape is valid)
+ -otherwise {d e f}: display shapes 'd' 'e' 'f' instead of 'shape' (if shape is NOT valid)
+ Note that one of two options -2d/-3d is required.
+}
+
+proc checkview {args} {
+ puts "checkview ${args}"
+
+ set 3dviewer 0
+ set 2dviewer false
+ set shape ""
+ set PathToSave ""
+ set dispmode 1
+ set isScreenshot 0
+ set check_length false
+ set check_area false
+ set check_volume false
+ set otherwise {}
+ set with {}
+
+ set options {{"-3d" 3dviewer 0}
+ {"-2d" 2dviewer ?}
+ {"-display" shape 1}
+ {"-path" PathToSave 1}
+ {"-vdispmode" dispmode 1}
+ {"-screenshot" isScreenshot 0}
+ {"-otherwise" otherwise 1}
+ {"-with" with 1}
+ {"-l" check_length ?}
+ {"-s" check_area ?}
+ {"-v" check_volume ?}}
+
+ # check arguments
+ _check_args ${args} ${options} "checkview"
+
+ if { ${PathToSave} == "" } {
+ set PathToSave "./photo.png"
+ }
+
+ if { ${3dviewer} == 0 && ${2dviewer} == false } {
+ error "Error: wrong using of command 'checkview', please use -2d or -3d option"
+ }
+
+ if { ${isScreenshot} } {
+ if { ${3dviewer} } {
+ vdump ${PathToSave}
+ } else {
+ xwd ${PathToSave}
+ }
+ return
+ }
+
+ set mass 0
+ set isBAD 0
+ upvar ${shape} ${shape}
+ if {[isdraw ${shape}]} {
+ # check area
+ if { [string is boolean ${check_area}] } {
+ if { ${check_area} } {
+ regexp {Mass +: +([-0-9.+eE]+)} [sprops ${shape}] full mass
+ }
+ } else {
+ set mass ${check_area}
+ }
+ # check length
+ if { [string is boolean ${check_length}] } {
+ if { ${check_length} } {
+ regexp {Mass +: +([-0-9.+eE]+)} [lprops ${shape}] full mass
+ }
+ } else {
+ set mass ${check_length}
+ }
+ # check volume
+ if { [string is boolean ${check_volume}] } {
+ if { ${check_volume} } {
+ regexp {Mass +: +([-0-9.+eE]+)} [vprops ${shape}] full mass
+ }
+ } else {
+ set mass ${check_volume}
+ }
+ } else {
+ set isBAD 1
+ }
+ if { ${3dviewer} } {
+ vinit
+ vclear
+ } elseif { ([string is boolean ${2dviewer}] && ${2dviewer}) || ${2dviewer} == "smallview"} {
+ smallview
+ clear
+ } elseif { ${2dviewer} == "v2d"} {
+ v2d
+ 2dclear
+ }
+ if {[isdraw ${shape}]} {
+ if { ( ${check_area} == false && ${check_length} == false && ${check_volume} == false ) || ( ${mass} != 0 ) } {
+ foreach s ${with} {
+ upvar ${s} ${s}
+ }
+ lappend with ${shape}
+ if { ${3dviewer} } {
+ vdisplay {*}${with}
+ } else {
+ donly {*}${with}
+ }
+ } else {
+ set isBAD 1
+ }
+ } else {
+ set isBAD 1
+ }
+
+ if { ${isBAD} && [llength ${otherwise}] } {
+ foreach s ${otherwise} {
+ upvar ${s} ${s}
+ }
+ if { ${3dviewer} } {
+ vdisplay {*}${otherwise}
+ } else {
+ donly {*}${otherwise}
+ }
+ }
+
+ if { ${3dviewer} } {
+ vsetdispmode ${dispmode}
+ vfit
+ vdump ${PathToSave}
+ } else {
+ if { ([string is boolean ${2dviewer}] && ${2dviewer}) || ${2dviewer} == "smallview"} {
+ fit
+ } elseif { ${2dviewer} == "v2d"} {
+ 2dfit
+ }
+ xwd ${PathToSave}
+ }
+
+}
+
+help checktrinfo {
+ Compare maximum deflection, number of nodes and triangles in "shape" mesh with given reference data
+
+ Use: checktrinfo shapename [options...]
+ Allowed options are:
+ -face [N]: compare current number of faces in "shapename" mesh with given reference data.
+ If reference value N is not given and current number of faces is equal to 0
+ procedure checktrinfo will print an error.
+ -empty[N]: compare current number of empty faces in "shapename" mesh with given reference data.
+ If reference value N is not given and current number of empty faces is greater that 0
+ procedure checktrinfo will print an error.
+ -tri [N]: compare current number of triangles in "shapename" mesh with given reference data.
+ If reference value N is not given and current number of triangles is equal to 0
+ procedure checktrinfo will print an error.
+ -nod [N]: compare current number of nodes in "shapename" mesh with given reference data.
+ If reference value N is not givenand current number of nodes is equal to 0
+ procedure checktrinfo will print an error.
+ -defl [N]: compare current value of maximum deflection in "shapename" mesh with given reference data
+ If reference value N is not given and current maximum deflection is equal to 0
+ procedure checktrinfo will print an error.
+ -max_defl N: compare current value of maximum deflection in "shapename" mesh with max possible value
+ -tol_abs_tri N: absolute tolerance for comparison of number of triangles (default value 0)
+ -tol_rel_tri N: relative tolerance for comparison of number of triangles (default value 0)
+ -tol_abs_nod N: absolute tolerance for comparison of number of nodes (default value 0)
+ -tol_rel_nod N: relative tolerance for comparison of number of nodes (default value 0)
+ -tol_abs_defl N: absolute tolerance for deflection comparison (default value 0)
+ -tol_rel_defl N: relative tolerance for deflection comparison (default value 0)
+ -ref [trinfo a]: compare deflection, number of triangles and nodes in "shapename" and in "a"
+}
+proc checktrinfo {shape args} {
+ puts "checktrinfo ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
+ puts "Error: The command cannot be built"
+ return
+ }
+
+ set ref_nb_faces false
+ set ref_nb_empty_faces true
+ set ref_nb_triangles false
+ set ref_nb_nodes false
+ set ref_deflection false
+ set tol_abs_defl 0
+ set tol_rel_defl 0
+ set tol_abs_tri 0
+ set tol_rel_tri 0
+ set tol_abs_nod 0
+ set tol_rel_nod 0
+ set max_defl -1
+ set ref_info ""
+
+ set options {{"-face" ref_nb_faces ?}
+ {"-empty" ref_nb_empty_faces ?}
+ {"-tri" ref_nb_triangles ?}
+ {"-nod" ref_nb_nodes ?}
+ {"-defl" ref_deflection ?}
+ {"-tol_abs_defl" tol_abs_defl 1}
+ {"-tol_rel_defl" tol_rel_defl 1}
+ {"-tol_abs_tri" tol_abs_tri 1}
+ {"-tol_rel_tri" tol_rel_tri 1}
+ {"-tol_abs_nod" tol_abs_nod 1}
+ {"-tol_rel_nod" tol_rel_nod 1}
+ {"-max_defl" max_defl 1}
+ {"-ref" ref_info 1}}
+
+ _check_args ${args} ${options} "checktrinfo"
+
+ # get current number of faces, triangles and nodes, value of max deflection
+ set tri_info [trinfo ${shape}]
+ set triinfo_pattern "(\[0-9\]+) +faces(.*\[^0-9]\(\[0-9\]+) +empty faces)?.*\[^0-9]\(\[0-9\]+) +triangles.*\[^0-9]\(\[0-9\]+) +nodes.*Maximal deflection +(\[-0-9.+eE\]+)"
+ if {![regexp "${triinfo_pattern}" ${tri_info} dump cur_nb_faces tmp cur_nb_empty_faces cur_nb_triangles cur_nb_nodes cur_deflection]} {
+ puts "Error: command trinfo prints empty info"
+ }
+ if { ${cur_nb_empty_faces} == "" } {
+ set cur_nb_empty_faces 0
+ }
+
+ # get reference values from -ref option
+ if { "${ref_info}" != ""} {
+ if {![regexp "${triinfo_pattern}" ${ref_info} dump ref_nb_faces tmp ref_nb_empty_faces ref_nb_triangles ref_nb_nodes ref_deflection]} {
+ puts "Error: reference information given by -ref option is wrong"
+ }
+ }
+
+ # check number of faces
+ if { [string is boolean ${ref_nb_faces}] } {
+ if { ${cur_nb_faces} <= 0 && ${ref_nb_faces} } {
+ puts "Error: Number of faces is equal to 0"
+ }
+ } else {
+ if {[regexp {!([-0-9.+eE]+)} $ref_nb_faces full ref_nb_faces_value]} {
+ if {${ref_nb_faces_value} == ${cur_nb_faces} } {
+ puts "Error: Number of faces is equal to ${ref_nb_faces_value} but it should not"
+ }
+ } else {
+ checkreal "Number of faces" ${cur_nb_faces} ${ref_nb_faces} ${tol_abs_tri} ${tol_rel_tri}
+ }
+ }
+ # check number of empty faces
+ if { [string is boolean ${ref_nb_empty_faces}] } {
+ if { ${cur_nb_empty_faces} > 0 && !${ref_nb_empty_faces} } {
+ puts "Error: Number of empty faces is greater that 0"
+ }
+ } else {
+ if {[regexp {!([-0-9.+eE]+)} $ref_nb_empty_faces full ref_nb_empty_faces_value]} {
+ if {${ref_nb_empty_faces_value} == ${cur_nb_empty_faces} } {
+ puts "Error: Number of empty faces is equal to ${ref_nb_empty_faces_value} but it should not"
+ }
+ } else {
+ checkreal "Number of empty faces" ${cur_nb_empty_faces} ${ref_nb_empty_faces} ${tol_abs_tri} ${tol_rel_tri}
+ }
+ }
+
+ # check number of triangles
+ if { [string is boolean ${ref_nb_triangles}] } {
+ if { ${cur_nb_triangles} <= 0 && ${ref_nb_triangles} } {
+ puts "Error: Number of triangles is equal to 0"
+ }
+ } else {
+ if {[regexp {!([-0-9.+eE]+)} $ref_nb_triangles full ref_nb_triangles_value]} {
+ if {${ref_nb_triangles_value} == ${cur_nb_triangles} } {
+ puts "Error: Number of triangles is equal to ${ref_nb_triangles_value} but it should not"
+ }
+ } else {
+ checkreal "Number of triangles" ${cur_nb_triangles} ${ref_nb_triangles} ${tol_abs_tri} ${tol_rel_tri}
+ }
+ }
+
+ # check number of nodes
+ if { [string is boolean ${ref_nb_nodes}] } {
+ if { ${cur_nb_nodes} <= 0 && ${ref_nb_nodes} } {
+ puts "Error: Number of nodes is equal to 0"
+ }
+ } else {
+ if {[regexp {!([-0-9.+eE]+)} $ref_nb_nodes full ref_nb_nodes_value]} {
+ if {${ref_nb_nodes_value} == ${cur_nb_nodes} } {
+ puts "Error: Number of nodes is equal to ${ref_nb_nodes_value} but it should not"
+ }
+ } else {
+ checkreal "Number of nodes" ${cur_nb_nodes} ${ref_nb_nodes} ${tol_abs_nod} ${tol_rel_nod}
+ }
+ }
+
+ # check deflection
+ if { [string is boolean ${ref_deflection}] } {
+ if { ${cur_deflection} <= 0 && ${ref_deflection} } {
+ puts "Error: Maximal deflection is equal to 0"
+ }
+ } else {
+ checkreal "Maximal deflection" ${cur_deflection} ${ref_deflection} ${tol_abs_defl} ${tol_rel_defl}
+ }
+
+ if { ${max_defl} != -1 && ${cur_deflection} > ${max_defl} } {
+ puts "Error: Maximal deflection is too big"
+ }
+}
+
+help checkplatform {
+ Return name of current platform if no options are given.
+
+ Use: checkplatform [options...]
+ Allowed options are:
+ -windows : return 1 if current platform is 'Windows', otherwise return 0
+ -linux : return 1 if current platform is 'Linux', otherwise return 0
+ -osx : return 1 if current platform is 'MacOS X', otherwise return 0
+
+ Only one option can be used at once.
+ If no option is given, procedure will return the name of current platform.
+}
+proc checkplatform {args} {
+ set check_for_windows false
+ set check_for_linux false
+ set check_for_macosx false
+
+ set options {{"-windows" check_for_windows 0}
+ {"-linux" check_for_linux 0}
+ {"-osx" check_for_macosx 0}}
+
+ _check_args ${args} ${options} "checkplatform"
+
+ if { [regexp "indows" $::tcl_platform(os)] } {
+ set current_platform Windows
+ } elseif { $::tcl_platform(os) == "Linux" } {
+ set current_platform Linux
+ } elseif { $::tcl_platform(os) == "Darwin" } {
+ set current_platform MacOS
+ }
+
+ # no args are given
+ if { !${check_for_windows} && !${check_for_linux} && !${check_for_macosx}} {
+ return ${current_platform}
+ }
+
+ # check usage of proc checkplatform
+ if { [expr [string is true ${check_for_windows}] + [string is true ${check_for_linux}] + [string is true ${check_for_macosx}] ] > 1} {
+ error "Error: wrong usage of command checkplatform, only single option can be used at once"
+ }
+
+ # checking for Windows platform
+ if { ${check_for_windows} && ${current_platform} == "Windows" } {
+ return 1
+ }
+
+ # checking for Mac OS X platforms
+ if { ${check_for_linux} && ${current_platform} == "Linux" } {
+ return 1
+ }
+
+ # checking for Mac OS X platforms
+ if { ${check_for_macosx} && ${current_platform} == "MacOS" } {
+ return 1
+ }
+
+ # current platform is not equal to given as argument platform, return false
+ return 0
+}
+
+help checkgravitycenter {
+ Compare Center Of Gravity with given reference data
+
+ Use: checkgravitycenter shape prop_type x y z tol
+}
+proc checkgravitycenter {shape prop_type x y z tol} {
+ puts "checkgravitycenter ${shape} $prop_type $x $y $z $tol"
+ upvar ${shape} ${shape}
+
+ if { $prop_type == "-l" } {
+ set outstr [lprops $shape]
+ } elseif { $prop_type == "-s" } {
+ set outstr [sprops $shape]
+ } elseif { $prop_type == "-v" } {
+ set outstr [vprops $shape]
+ } else {
+ error "Error : invalid prop_type"
+ }
+
+ if { ![regexp {\nX = +([-0-9.+eE]+).*\nY = +([-0-9.+eE]+).*\nZ = +([-0-9.+eE]+)} ${outstr} full comp_x comp_y comp_z] } {
+ error "Error : cannot evaluate properties"
+ }
+
+ if { [expr abs($comp_x-$x)] < $tol && [expr abs($comp_y-$y)] < $tol && [expr abs($comp_z-$z)] < $tol } {
+ puts "Check of center of gravity is OK: value = ($comp_x, $comp_y, $comp_z), expected = ($x, $y, $z)"
+ } else {
+ puts "Error: center of gravity ($comp_x, $comp_y, $comp_z) is not equal to expected ($x, $y, $z)"
+ }
+}
+
+help checkMultilineStrings {
+ Compares two strings.
+ Logically splits the strings to lines by the new line characters.
+ Outputs the first different lines.
+
+ Use: checkMultilineStrings <string_1> <string_2>
+}
+proc checkMultilineStrings {tS1 tS2} {
+ set aL1 [split $tS1 \n]
+ set aL2 [split $tS2 \n]
+
+ set aC1 [llength $aL1]
+ set aC2 [llength $aL2]
+ set aC [expr {min($aC1, $aC2)}]
+
+ for {set aI 0} {$aI < $aC} {incr aI} {
+ if {[lindex $aL1 $aI] != [lindex $aL2 $aI]} {
+ puts "Error. $aI-th lines are different:"
+ puts "[lindex $aL1 $aI]"
+ puts "[lindex $aL2 $aI]"
+ }
+ }
+
+ if {$aC1 != $aC2} {
+ puts "Error. Line counts are different: $aC1 != $aC2."
+ }
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+# This script is to be executed automatically at DRAWEXE start.
+#
+# For that to happen, either environment DRAWDEFAULT should be set pointing
+# to this file, or CASROOT variable should be set, so that the script is
+# found as $CASROOT/src/DrawResources/DrawDefault
+
+# indicate that DRAW is interactive environment
+set tcl_interactive 1
+
+# define location of standard DRAW scripts; normally it is
+# $CASROOT/src/DrawResources
+set dir ""
+if { [info exists env(DRAWHOME) ] } {
+ set dir $env(DRAWHOME)
+} else {
+ if { [info exists env(CASROOT) ] } {
+ set dir [file join $env(CASROOT) src DrawResources]
+ } else {
+ puts "Warning: CASROOT is not defined, some features may not load correctly"
+ set dir [file dirname [info script]]
+ }
+}
+
+# load standard DRAW scripts
+if { [file isdirectory $dir] } {
+ foreach script {StandardCommands.tcl Geometry.tcl StandardViews.tcl
+ TestCommands.tcl CheckCommands.tcl Vector.tcl} {
+ if [file exist [file join $dir $script]] {
+ source [file join $dir $script]
+ } else {
+ puts "Warning: could not find command file $script"
+ }
+ }
+
+ # and TK extensions
+ set stationname $tcl_platform(platform)
+ if [info exists tk_version] {
+ source [file join $dir DrawTK.tcl]
+ # setup the icon for main window
+ if { ${stationname} == "windows" } {
+ wm iconbitmap . -default [file join $dir lamp.ico]
+ }
+ wm title . Draw
+ }
+} else {
+ puts "Warning: could not find DRAW directory"
+}
+
+# set default testing environment (unless already defined before)
+if { ! [info exists env(CSF_TestScriptsPath)] } {
+ if {[info exists ::env(CSF_OCCTTestsPath)] && [file isdirectory $env(CSF_OCCTTestsPath)]} {
+ set env(CSF_TestScriptsPath) $env(CSF_OCCTTestsPath)
+ } elseif { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
+ set env(CSF_TestScriptsPath) $env(CASROOT)/tests
+ }
+}
+if {[info exists ::env(CSF_OCCTDataPath)] && [file isdirectory $env(CSF_OCCTDataPath)]} {
+ if { ! [info exists env(CSF_TestDataPath)] } {
+ set env(CSF_TestDataPath) $env(CSF_OCCTDataPath)
+ } else {
+ set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CSF_OCCTDataPath)
+ }
+} elseif { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
+ if { ! [info exists env(CSF_TestDataPath)] } {
+ set env(CSF_TestDataPath) $env(CASROOT)/data
+ } else {
+ set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data
+ }
+}
+
+# load application-defined initialization script, which is expected to
+# be found either in the file pointed by environment variable CSF_DrawAppliInit,
+# or in the file DrawAppliInit in the current directory
+set draw_appli_init_file DrawAppliInit
+if { [info exists env(CSF_DrawAppliInit)] } {
+ set draw_appli_init_file $env(CSF_DrawAppliInit)
+}
+if { [file readable $draw_appli_init_file] } {
+ if { [catch {source $draw_appli_init_file} res] } {
+ puts "Warning: problem while loading file $draw_appli_init_file: $res"
+ }
+}
+
+# on Windows, set special handler to update automatically environment variables
+# in C subsystem when Tcl environment changes (see Mantis issue #23197)
+if { $tcl_platform(platform) == "windows" && ! [catch {dgetenv PATH}] } {
+ proc _update_c_env {envenv var op} {
+ global env
+ if { $op == "unset" } {
+ if { $var != "" } {
+ dsetenv $var
+ } else {
+ #"array get env varname" command calls _update_c_env with op="unset" and var=""
+ #It leads to detach of trace from env array
+ trace add variable env array _update_c_env
+ trace add variable env read _update_c_env
+ trace add variable env write _update_c_env
+ trace add variable env unset _update_c_env
+ }
+ } elseif { $op == "write" } {
+ dsetenv $var $env($var)
+ } elseif { $op == "read" } {
+ return dgetenv $var
+ }
+ }
+ #Execute "trace add ..." block from _update_c_env proc
+ _update_c_env env "" "unset"
+}
+
+# arm signal handler with default FPE setting
+dsetsignal
+
+# silent return from the script
+return
--- /dev/null
+! Description of available plugins for DRAW Test Harness
+! *****************************************************************************
+!
+! Format of the file is compliant with the standard Open CASCADE resource files
+! (see the Resource_Manager.cdl file for details).
+!
+! Each key defines a sequence of either further keys or a name of the dynamic
+! library. Keys can be nested down to an arbitrary level. However, make sure
+! there are no cyclic dependencies (internal checks are not performed).
+!
+! For details how to implement a DRAW plugin refer to the Test Harness User's
+! Guide.
+!
+! To load a plugin use the following command in DRAW:
+!
+! Draw> pload [-PluginFileName] [[Key1] [Key2]...], where:
+! <-PluginFileName> - Defines the name of a resource file.
+! If this parameter is omitted then the default name DrawPlugin
+! is used.
+! According to the Open CASCADE resource file management rules
+! the environment variable CSF_<PluginFileName>Defaults must
+! be set and point to the directory storing the file. If it is
+! omitted then it defaults to $CASROOT/src/DrawResources.
+! [Key] - Defines the key(s) enumerating plugins to be loaded.
+! If no keys are specified then the key named DEFAULT is used
+! (if there is no such in the file then no plugins are loaded).
+!
+!
+! NOTE: Make sure the DATAEXCHANGE or XDE key succeeds the OCAF key in a sequence
+!
+
+DEFAULT : MODELING
+MODELING : TOPTEST
+VISUALIZATION : AISV
+OCAFKERNEL : DCAF
+DATAEXCHANGEKERNEL : XSDRAW, DE
+OCAF : VISUALIZATION, OCAFKERNEL
+DATAEXCHANGE : XDE, VISUALIZATION
+XDE : DATAEXCHANGEKERNEL, XDEDRAW, STEP, IGES, GLTF, OBJ, PLY, STL, VRML
+ALL : MODELING, OCAFKERNEL, DATAEXCHANGE
+
+TOPTEST : TKTopTest
+DCAF : TKDCAF
+AISV : TKViewerTest
+GL : TKOpenGlTest
+OPENGL : TKOpenGlTest
+GLES : TKOpenGlesTest
+OPENGLES : TKOpenGlesTest
+D3DHOST : TKD3DHostTest
+XSDRAW : TKXSDRAW
+XDEDRAW : TKXDEDRAW
+TOBJ : TKTObjDRAW
+DFBROWSER : TKDFBrowser
+QAcommands : TKQADraw
+VIS : TKIVtkDraw
+INSPECTOR : TKToolsDraw
+DE : TKXSDRAWDE
+STEP : TKXSDRAWSTEP
+IGES : TKXSDRAWIGES
+GLTF : TKXSDRAWGLTF
+OBJ : TKXSDRAWOBJ
+PLY : TKXSDRAWPLY
+STL : TKXSDRAWSTL
+VRML : TKXSDRAWVRML
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+#
+# TK features for Draw
+#
+
+# reload bindings
+if { [info exists tk_library] } {
+ set version [split [info tclversion] "."]
+ set major [lindex ${version} 0]
+ set minor [lindex ${version} 1]
+ if { (${major} > 8) || (${major} >= 8 && ${minor} >= 4) } {
+ #source $tk_library/tk.tcl
+ } else {
+ source $tk_library/tk.tcl
+ }
+}
+
+#fills menu "Load" with submenus
+proc fillloadmenu {} {
+ set drawplugpath ""
+ if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin]} {
+ set drawplugpath "$::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin"
+ } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/DrawPlugin]} {
+ set drawplugpath "$::env(CASROOT)/src/DrawResources/DrawPlugin"
+ }
+
+ set chan [open [file nativename $drawplugpath]]
+ while {[gets $chan line] >= 0} {
+ if {[lindex [split $line ""] 0] != "!"} {
+ if {[lindex [split $line ""] 0] == ""} {continue}
+ set plugname [lindex [split $line " "] 0]
+ addmenu Load "pload $plugname" "pload $plugname"
+ }
+ }
+ close $chan
+}
+
+wm geometry . +10+10
+bind . <F1> {vcommands}
+
+frame .mbar -relief raised -bd 2
+pack .mbar -side top -fill x
+focus .mbar
+
+set theMenus("") ""
+set Draw_MenuIndex 0
+
+proc addmenuitem {menu options} {
+
+ global theMenus Draw_MenuIndex
+ if {![info exists theMenus($menu)]} {
+ incr Draw_MenuIndex
+ set m .mbar.m$Draw_MenuIndex.menu
+ menubutton .mbar.m$Draw_MenuIndex -text $menu -menu $m
+ pack .mbar.m$Draw_MenuIndex -side left
+ menu $m
+ set theMenus($menu) $m
+ } else {set m $theMenus($menu)}
+
+ eval $m add $options
+}
+
+proc addmenu {menu submenu {command ""}} {
+ if {$command == ""} {set command $submenu}
+ addmenuitem $menu "command -label {$submenu} -command {$command}"
+}
+
+#################################
+# Menus definition
+#################################
+
+# the file menu
+
+addmenu File "Choose Data Directory" vdatadir
+addmenu File "Load Shape (restore)" vrestore
+addmenu File "Load Script (source)" vsource
+addmenu File Exit exit
+
+# the Load menu
+fillloadmenu
+
+# the view menu
+
+source [file join $dir Move.tcl]
+
+addmenuitem Views {checkbutton -label "Extended view commands" \
+ -command ShowHideExtCommands -variable ShowExtCommands -onvalue 1 -offvalue 0}
+addmenuitem Views "separator"
+addmenu Views axo {smallview AXON}
+addmenu Views top {smallview +X+Y}
+addmenu Views front {smallview +X+Z}
+addmenu Views left {smallview +Y+Z}
+addmenu Views 2d {smallview -2D-}
+addmenuitem Views "separator"
+addmenu Views mu4
+addmenu Views av2d
+addmenu Views axo
+addmenu Views pers
+
+# the display menu
+
+addmenu Display fit "fit; repaint"
+addmenu Display 2dfit "2dfit; repaint"
+addmenu Display clear
+addmenu Display 2dclear
+
+# the samples menu
+addmenu Samples "View samples" vsample
+
+# the help menu
+
+addmenu Help "System Info" sysinfo
+addmenu Help Commands vcommands
+addmenu Help About about
+addmenu Help "User Guide" openuserguide
+
+#redraw help submenu in the end of menu
+proc redrawhelp {} {
+ global theMenus
+ set m $theMenus(Help)
+ destroy [string trimright $m ".menu"]
+ if [info exists theMenus(Help)] {unset theMenus(Help)}
+ addmenu Help "System Info" sysinfo
+ addmenu Help Commands vcommands
+ addmenu Help About about
+ addmenu Help "User Guide" openuserguide
+}
+
+#################################
+# Modal dialog box
+# add OK, help, cancel buttons
+#################################
+
+proc modaldialog {box okproc {helpproc ""} {cancelproc ""}} {
+ wm geometry $box +10+60
+ button $box.ok -text ok -command "$okproc ; destroy $box"
+ pack $box.ok -side left
+ button $box.ko -text Cancel -command "$cancelproc ; destroy $box"
+ pack $box.ko -side right
+ if {$helpproc != ""} {
+ button $box.help -text Help -command $helpproc
+ pack $box.help -side right
+ }
+ grab set $box
+}
+
+
+#################################
+# File menu procedures
+#################################
+
+##############################
+#
+# dialbox command arg1 val1 arg2 val2 ...
+#
+##############################
+
+proc dialbox args {
+ set com [lindex $args 0]
+
+ toplevel .d
+ wm title .d $com
+
+ # com will be the command
+ set com "eval $com"
+
+ # create entries for the arguments
+ set n [llength $args]
+
+ for {set i 1} {$i < $n} {incr i 2} {
+
+ frame .d.a$i
+ label .d.a$i.l -text [lindex $args $i]
+ entry .d.a$i.e -relief sunken
+ .d.a$i.e insert end [lindex $args [expr $i+1]]
+ pack .d.a$i.l -side left
+ pack .d.a$i.e -side right
+ pack .d.a$i -side top -fill x
+
+ append com { [} ".d.a$i.e get" {]}
+ }
+ append com ";repaint"
+
+ modaldialog .d $com "help [lindex $args 0]"
+ }
+proc sdatadir {d} {
+ global Draw_DataDir
+ set Draw_DataDir $d
+}
+
+proc vdatadir {} {
+ global Draw_DataDir
+ sdatadir [tk_chooseDirectory -title "Data Directory" -initialdir $Draw_DataDir]
+}
+
+proc rresto {f} {
+ if {[file exists $f]} {
+ if {! [file isdirectory $f]} {
+ puts "restore $f [file tail $f]"
+ uplevel \#0 "restore $f [file tail $f]"
+ repaint
+ }
+ }
+}
+
+proc vrestore {} {
+ global Draw_DataDir
+ rresto [tk_getOpenFile -title "Load Shape (restore)" -filetypes {{{BREP} {.brep}}} -initialdir $Draw_DataDir]
+}
+
+
+proc ssour {f} {
+ global Draw_Source
+ if {[file exists $f]} {
+ set Draw_Source $f
+ if {! [file isdirectory $f]} {
+ puts "source $f [file tail $f]"
+ uplevel \#0 "source $f"
+ }
+ }
+}
+
+set Draw_Source [pwd]
+proc vsource {} {
+ global Draw_Source
+ ssour [tk_getOpenFile -title "Load Script (source)" -filetypes {{{All Files} *}} -initialdir Draw_Source]
+}
+
+#Creates a "Samples" window
+proc vsamples {} {
+ #create list {{category} {title} {filename}}
+ set alistofthree ""
+
+ set samplespath ""
+ if { [array names ::env CSF_OCCTSamplesPath] != "" && "$::env(CSF_OCCTSamplesPath)" != "" && [file exists $::env(CSF_OCCTSamplesPath)/tcl/]} {
+ set samplespath "$::env(CSF_OCCTSamplesPath)/tcl/"
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/samples/tcl/]} {
+ set samplespath "$::env(CASROOT)/samples/tcl/"
+ }
+
+ foreach fname [glob -path "${samplespath}" *.tcl] {
+
+ set chan [open $fname]
+ set istitlefound 0
+ while {[gets $chan line] >= 0} {
+ if {[lindex [split $line " "] 0] == "#Category:"} {
+ set acategory [string trim [string trimleft $line "#Category: "]]
+ }
+ if {[lindex [split $line " "] 0] == "#Title:"} {
+ set atitle [string trim [string trimleft $line "#Title: "]]
+ lappend alistofthree $acategory $atitle $fname
+ incr istitlefound
+ break
+ }
+ }
+ close $chan
+ if {$istitlefound == 0} {
+ lappend alistofthree Other "[lindex [split $fname \\] end]" $fname
+ }
+ }
+ #create window
+ toplevel .samples
+ wm title .samples "Samples"
+ wm geometry .samples +0+0
+ wm minsize .samples 800 600
+ frame .samples.right
+ frame .samples.left
+ frame .samples.right.textframe
+ frame .samples.right.botframe
+ ttk::treeview .samples.left.tree -selectmode browse -yscrollcommand {.samples.left.treescroll set}
+ pack .samples.left.tree -fill both -expand 1 -side left
+ .samples.left.tree column #0 -minwidth 200
+ .samples.left.tree heading #0 -text "Samples"
+ pack .samples.right -side right -fill both -expand 1 -padx 10 -pady 10
+ pack .samples.left -side left -padx 10 -pady 10 -fill both
+ pack .samples.right.textframe -side top -fill both -expand 1
+ pack .samples.right.botframe -side bottom -fill both -expand 1
+ text .samples.right.textframe.text -yscrollcommand {.samples.right.textframe.scroll set} -xscrollcommand {.samples.right.botframe.scrollx set} -wrap none -width 40 -height 32
+ pack .samples.right.textframe.text -fill both -side left -expand 1
+ .samples.right.textframe.text delete 0.0 end
+ .samples.right.textframe.text configure -state disabled
+ set i 1
+ foreach {acat title fnam} $alistofthree {
+ if [.samples.left.tree exists $acat] {
+ .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
+ .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
+ incr i
+ continue
+ } else {
+ .samples.left.tree insert {} end -id $acat -text $acat
+ .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
+ .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
+ incr i
+ }
+ }
+ scrollbar .samples.right.textframe.scroll -command {.samples.right.textframe.text yview}
+ scrollbar .samples.left.treescroll -command {.samples.left.tree yview}
+ scrollbar .samples.right.botframe.scrollx -command {.samples.right.textframe.text xview} -orient horizontal
+ pack .samples.right.textframe.scroll -side right -fill y
+ pack .samples.right.botframe.scrollx -side top -fill x
+ pack .samples.left.treescroll -side right -fill y
+ button .samples.right.botframe.button -text "Run sample" -state disabled
+ pack .samples.right.botframe.button -fill none -pady 10
+}
+
+#Fills the textbox in "Samples" window
+proc fillsampletext {fname} {
+ .samples.right.botframe.button configure -state normal -command "lower .samples;catch {vclose ALL};catch {vremove -all}; catch {vclear}; source {$fname}"
+ .samples.right.textframe.text configure -state normal
+ .samples.right.textframe.text delete 0.0 end
+ set chan [open "$fname"]
+ while {[gets $chan line] >= 0} {
+ .samples.right.textframe.text insert end "$line\n"
+ }
+ close $chan
+ .samples.right.textframe.text configure -state disabled
+}
+
+#Creates a "Commands help" window
+proc vcommands {} {
+ global Draw_Groups Find_Button_Click_Count Entry_Cache
+ set Find_Button_Click_Count 0
+ set Entry_Cache ""
+ toplevel .commands
+ focus .commands
+ wm minsize .commands 800 600
+ wm title .commands "Commands help"
+ wm geometry .commands +0+0
+ frame .commands.t
+ frame .commands.left
+ ttk::treeview .commands.left.tree -selectmode browse -yscrollcommand {.commands.left.treescroll set}
+ .commands.left.tree column #0 -width 300
+ .commands.left.tree heading #0 -text "Help treeview"
+ pack .commands.left.tree -expand 1 -fill both -side left
+ pack .commands.t -side right -fill both -expand 1 -padx 10 -pady 10
+ pack .commands.left -side left -fill both -padx 10 -pady 10
+ pack [frame .commands.t.top] -side top -fill x -padx 10 -pady 10
+ text .commands.t.text -yscrollcommand {.commands.t.scroll set} -width 40
+ .commands.t.text delete 0.0 end
+ pack .commands.t.text -fill both -side left -expand 1
+ .commands.t.text configure -state disabled
+ pack [entry .commands.t.top.e -width 20] -side left
+ pack [button .commands.t.top.findcom -text "Find command" -command vhelpsearch] -side left -padx 10
+ pack [button .commands.t.top.textfind -text "Find in text" -command "vhelptextsearch; incr Find_Button_Click_Count"] -side left
+ set i 1
+ set j 100
+ set newgroupinx 0
+ foreach h [lsort [array names Draw_Groups]] {
+ .commands.left.tree insert {} end -id $i -text $h -tags "info$i"
+ .commands.left.tree tag bind info$i <1> "vcomhelp {$h}"
+ set newgroupinx $j
+ foreach f [lsort $Draw_Groups($h)] {
+ .commands.left.tree insert $i end -id $j -text $f -tags "selected$j"
+ .commands.left.tree tag bind selected$j <1> "vcomhelp {$h} $j $newgroupinx"
+ incr j
+ }
+ incr i
+ }
+ scrollbar .commands.t.scroll -command {.commands.t.text yview}
+ scrollbar .commands.left.treescroll -command {.commands.left.tree yview}
+ pack .commands.t.scroll -side right -fill y
+ pack .commands.left.treescroll -side right -fill y -expand 1
+ #hotkeys
+ bind .commands.t.top.e <Return> {vhelpsearch}
+ bind .commands <Control-f> {focus .commands.t.top.e}
+ bind .commands <Control-F> {focus .commands.t.top.e}
+ bind .commands <Escape> {destroy .commands}
+ }
+
+############################################################
+# Fills the textbox in "Commands help" window
+# $h -group of commands to display
+# $selindex - index of selected item in the treeview
+# $startindex - index of item int the treeview to start from
+############################################################
+proc vcomhelp {h {selindex -1} {startindex 0}} {
+ global Draw_Helps Draw_Groups
+ set highlighted false
+ .commands.t.text configure -state normal
+ .commands.t.text delete 1.0 end
+ foreach f [lsort $Draw_Groups($h)] {
+ if {$startindex == $selindex} {
+ .commands.t.text insert end "$f : $Draw_Helps($f)\n\n" "highlightline"
+ incr startindex
+ set highlighted true
+ continue
+ }
+ .commands.t.text insert end "$f : $Draw_Helps($f)\n\n"
+ incr startindex
+ }
+ .commands.t.text tag configure highlightline -background yellow -relief raised
+ .commands.t.text configure -state disabled
+ if {$highlighted == true} {.commands.t.text see highlightline.last}
+}
+
+#Creates a "About" window
+proc about {} {
+ toplevel .about
+ focus .about
+ wm resizable .about 0 0
+ wm title .about "About"
+ set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
+ set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
+ wm geometry .about 400x200+$screenwidth+$screenheight
+
+ set logopath ""
+ if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png]} {
+ set logopath "$::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png"
+ } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/OCC_logo.png]} {
+ set logopath "$::env(CASROOT)/src/DrawResources/OCC_logo.png"
+ }
+
+ image create photo occlogo -file $logopath -format png
+ frame .about.logo -bg red
+ frame .about.links -bg blue
+ frame .about.copyright
+ pack .about.logo -side top -fill both
+ pack .about.links -fill both
+ pack .about.copyright -side top -fill both
+ label .about.logo.img -image occlogo
+ pack .about.logo.img -fill both
+ text .about.links.text -bg lightgray -fg blue -height 1 -width 10
+ .about.links.text insert end "http://www.opencascade.com/" "link1"
+ .about.links.text tag bind link1 <1> "_launchBrowser http://www.opencascade.com/"
+ .about.links.text tag bind link1 <Enter> ".about.links.text configure -cursor hand2"
+ .about.links.text tag bind link1 <Leave> ".about.links.text configure -cursor arrow"
+ .about.links.text tag configure link1 -underline true -justify center
+ pack .about.links.text -fill both
+ label .about.copyright.text -text "Copyright (c) 1999-2019 OPEN CASCADE SAS"
+ button .about.button -text "OK" -command "destroy .about"
+ pack .about.button -padx 10 -pady 10
+ pack .about.copyright.text
+ .about.links.text configure -state disabled
+ grab .about
+ bind .about <Return> {destroy .about}
+}
+
+#Executes files and hyperlinks
+proc launchBrowser url {
+ global tcl_platform
+
+ if {$tcl_platform(platform) eq "windows"} {
+ set command [list {*}[auto_execok start] {}]
+ } elseif {$tcl_platform(os) eq "Darwin"} {
+ set command [list open]
+ } else {
+ set command [list xdg-open]
+ }
+ exec {*}$command $url &
+}
+
+#Safe execution of files and hyperlinks
+proc _launchBrowser {url} {
+ if [catch {launchBrowser $url} err] {
+ tk_messageBox -icon error -message "error '$err' with '$command'"
+ }
+}
+################################################################
+# This procedure tries to open an userguide on Draw Harness in pdf format
+# If there is no a such one, then tries to open it in html format
+# Else opens a site with this guide
+################################################################
+proc openuserguide {} {
+ if { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf]} {
+ _launchBrowser $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf
+ } elseif { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html]} {
+ _launchBrowser $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf]} {
+ _launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf
+ } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html]} {
+ _launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html
+ } else {
+ launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html}
+ }
+}
+
+#Search through commands and display the result
+proc vhelpsearch {} {
+ global Draw_Groups Entry_Cache
+ set searchstring [.commands.t.top.e get]
+ set i 1
+ set j 100
+ set newgroupinx 0
+ set isfound 0
+ foreach h [lsort [array names Draw_Groups]] {
+ set newgroupinx $j
+ foreach f [lsort $Draw_Groups($h)] {
+ if {$f == $searchstring} {
+ incr isfound
+ .commands.left.tree see $j
+ .commands.left.tree selection set $j
+ vcomhelp $h $j $newgroupinx
+ break
+ }
+ incr j
+ }
+ incr i
+ }
+ if {$isfound == 0} {
+ errorhelp "No help found for '$searchstring'!"
+ } else {set Entry_Cache ""}
+}
+
+#Displays an error window with $errstring inside
+proc errorhelp {errstring} {
+ toplevel .errorhelp
+ focus .errorhelp
+ wm resizable .errorhelp 0 0
+ wm title .errorhelp "Error"
+ set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
+ set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
+ wm geometry .errorhelp +$screenwidth+$screenheight
+ text .errorhelp.t -width 40 -height 5
+ .errorhelp.t insert end $errstring
+ button .errorhelp.button -text "OK" -command "destroy .errorhelp"
+ pack .errorhelp.t
+ .errorhelp.t configure -state disabled
+ pack .errorhelp.button -padx 10 -pady 10
+ bind .errorhelp <Return> {destroy .errorhelp}
+ grab .errorhelp
+}
+
+#Search through text of help and display the result
+proc vhelptextsearch {} {
+ global Draw_Helps Draw_Groups Find_Button_Click_Count Entry_Cache End_of_Search
+ set searchstring [.commands.t.top.e get]
+ if {$Entry_Cache != $searchstring} {
+ set Find_Button_Click_Count 0
+ set End_of_Search 0
+ set Entry_Cache $searchstring
+ }
+ if {$End_of_Search} {
+ errorhelp "No more '$searchstring' found!"
+ return
+ }
+ .commands.t.text configure -state normal
+ .commands.t.text delete 0.0 end
+ set i 0
+ set isfound 0
+ foreach h [lsort [array names Draw_Groups]] {
+ foreach f [lsort $Draw_Groups($h)] {
+ if [string match *$searchstring* $Draw_Helps($f)] {
+ incr i
+ if {$i > $Find_Button_Click_Count+1} {incr isfound; break}
+ .commands.t.text insert end "$f : "
+ foreach line [list $Draw_Helps($f)] {
+ foreach word [split $line " "] {
+ if [string match *$searchstring* $word] {
+ .commands.t.text insert end "$word" "highlightword"
+ .commands.t.text insert end " "
+ continue
+ }
+ .commands.t.text insert end "$word "
+ }
+ }
+ .commands.t.text insert end \n\n
+ }
+ }
+ }
+ if {!$isfound} {
+ incr End_of_Search
+ }
+ .commands.t.text tag configure highlightword -background yellow -relief raised
+ .commands.t.text see end
+}
+
+#Create a "System information" window
+proc sysinfo {} {
+ toplevel .info
+ wm title .info "System information"
+ wm resizable .info 0 0
+ pack [frame .info.top] -side top -fill both -padx 5 -pady 10
+ pack [frame .info.bot] -side bottom -fill both -padx 5 -pady 10
+ pack [frame .info.top.left] -side left -fill both -padx 5 -pady 10
+ pack [frame .info.top.mid] -side left -fill both -padx 5 -pady 10
+ pack [frame .info.top.right] -side left -fill both -padx 5 -pady 10
+ pack [label .info.top.left.label -text "OCCT build configuration "]
+ pack [label .info.top.mid.label -text "Memory info"]
+ pack [label .info.top.right.label -text "OpenGL info"]
+ pack [text .info.top.left.text -width 50 -height 20]
+ pack [text .info.top.mid.text -width 50 -height 20]
+ pack [text .info.top.right.text -width 50 -height 20]
+ pack [button .info.bot.button -text "Update" -command rescaninfo]
+ pack [button .info.bot.close -text "Close" -command "destroy .info"] -pady 10
+ rescaninfo
+}
+
+#Updates information in "System information" window
+proc rescaninfo {} {
+ .info.top.left.text configure -state normal
+ .info.top.mid.text configure -state normal
+ .info.top.right.text configure -state normal
+ .info.top.left.text delete 0.0 end
+ .info.top.mid.text delete 0.0 end
+ .info.top.right.text delete 0.0 end
+ .info.top.left.text insert end [dversion]
+ .info.top.mid.text insert end [meminfo]
+ set glinfo ""
+ if [catch {vglinfo} err] {
+ if {$err == ""} {
+ .info.top.right.text insert end "No active view. Please call vinit."
+ } else {
+ .info.top.right.text insert end "VISUALIZATION is not loaded. Please call pload VISUALIZATION"
+ }
+ } else {
+ .info.top.right.text insert end [vglinfo]
+ }
+ .info.top.left.text configure -state disabled
+ .info.top.mid.text configure -state disabled
+ .info.top.right.text configure -state disabled
+}
--- /dev/null
+srcinc:::CURVES.tcl
+srcinc:::dftree.tcl
+srcinc:::DrawDefault
+srcinc:::DrawPlugin
+srcinc:::DrawTK.tcl
+srcinc:::Geometry.tcl
+srcinc:::InitEnvironment.tcl
+srcinc:::lamp.ico
+srcinc:::Move.tcl
+srcinc:::PROFIL.tcl
+srcinc:::SCAN.tcl
+srcinc:::StandardCommands.tcl
+srcinc:::StandardViews.tcl
+srcinc:::SURFACES.tcl
+srcinc:::TestCommands.tcl
+srcinc:::TKTopTest.tcl
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+proc cmp {} {
+ dtyp .
+ set name [lastrep id x y b]
+ global $name
+ lastrep id x1 y1 z1 b
+ cfindp $name id x y pole
+ if {[dval pole] == 0} return
+ dset x0 x1 y0 y1 z0 z1 b 0
+ draw id 6 $name
+ while {[dval b] == 0} {
+ pick id x2 y2 z2 b nowait
+ dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
+ draw id 6 $name
+ cmovep $name pole dx dy dz
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval b] == 1} return;
+ dset dx x0-x2 dy y0-y2 dz z0-z2
+ cmovep $name pole dx dy dz
+}
+
+proc smp {} {
+ dtyp .
+ set name [lastrep id x y b]
+ global $name
+ lastrep id x1 y1 z1 b
+ sfindp $name id x y upole vpole
+ if {[dval upole] == 0} return
+ dset x0 x1 y0 y1 z0 z1 b 0
+ draw id 6 $name
+ while { [dval b] == 0} {
+ pick id x2 y2 z2 b nowait
+ dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
+ draw id 6 $name
+ movep $name upole vpole dx dy dz
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval b] == 1} return
+ dset dx x0-x2 dy y0-y2 dz z0-z2
+ movep $name upole vpole dx dy dz
+}
+
+#################################################
+# smooth
+#################################################
+
+help smooth {smooth cname tol [filename] } "DRAW Variables management"
+
+proc smooth {name tol {file ""}} {
+ if {$file == ""} {
+ uplevel #0 "bsmooth $name $tol"
+ } else {
+ global Draw_DataDir
+ uplevel #0 "bsmooth $name $tol $Draw_DataDir/$file"
+ }
+ return $name
+}
+
+#################################################
+# beziersmooth
+#################################################
+
+help beziersmooth { beziersmooth cname tol deg [-GR -VA -PR] [filename] } "DRAW Variables management"
+
+proc beziersmooth {name tol deg option {file ""}} {
+ if {$file == ""} {
+ uplevel #0 "bzsmooth $name $tol $deg $option"
+ } else {
+ global Draw_DataDir
+ uplevel #0 "bzsmooth $name $tol $deg $option $Draw_DataDir/$file"
+ }
+ return $name
+}
+
+help pickf {name : extract picked with mouse face as a new variable\
+} {DRAW Variables management}
+
+proc pickf {name} {
+ global $name
+ eval renamevar "[pickface]" $name
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+################################################
+#
+# find the name of the station
+#
+################################################
+proc wokstation {} {
+ set LINE_FROM_UNAME [ exec uname -a ] ;
+ if { [ regexp SunOS $LINE_FROM_UNAME ] } {
+ return "sun"
+ } elseif { [ regexp IRIX $LINE_FROM_UNAME ] } {
+ return "sil"
+ } elseif { [ regexp OSF $LINE_FROM_UNAME ] } {
+ return "ao1"
+ } elseif { [ regexp HP-UX $LINE_FROM_UNAME ] } {
+ return "hp"
+ } elseif { [ regexp Linux $LINE_FROM_UNAME ] } {
+ return "lin"
+ } elseif { [ regexp FreeBSD $LINE_FROM_UNAME ] } {
+ return "bsd"
+ } elseif { [ regexp Darwin $LINE_FROM_UNAME ] } {
+ return "mac"
+ } elseif { [ regexp AIX $LINE_FROM_UNAME ] } {
+ return "aix"
+ } else {
+ return "wnt"
+ }
+
+}
+
+set env(STATION) [ wokstation ]
+
+# PMN LE 6/06/1997
+# Ce type d'environnement n'a rien n'a faire dans les sources
+# On doit le faire dans des ilots.tcl ou des ud.tcl ou bien
+# dans les procedures de test externes a WOK
+#set env(WBCONTAINER) /adv_20/BAG
+#set env(WBROOT) "/adv_21/MDL/k1deb/ref"
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+#
+# 02/02/1996 : pbo : creation
+# 25/10/1996 : pbo : add 2d view
+#
+# rotation/panning/zoom with buttons
+#
+
+frame .move -relief groove -borderwidth 1
+#toplevel .move
+
+frame .move.rotate -borderwidth 1
+label .move.rotate.title -text " Rotation "
+button .move.rotate.l -text " < " -command {l ; repaint}
+button .move.rotate.r -text " > " -command {r ; repaint}
+button .move.rotate.u -text " ^ " -command {u ; repaint}
+button .move.rotate.d -text " v " -command {d ; repaint}
+pack .move.rotate.title -side top
+pack .move.rotate.l -side left
+pack .move.rotate.r -side right
+pack .move.rotate.u -side top
+pack .move.rotate.d -side bottom
+pack .move.rotate
+
+frame .move.panning -borderwidth 1
+label .move.panning.title -text " Panning "
+button .move.panning.l -text " < " -command {pl ; 2dpl ; repaint}
+button .move.panning.r -text " > " -command {pr ; 2dpr ; repaint}
+button .move.panning.u -text " ^ " -command {pu ; 2dpu ; repaint}
+button .move.panning.d -text " v " -command {pd ; 2dpd ; repaint}
+pack .move.panning.title -side top
+pack .move.panning.l -side left
+pack .move.panning.r -side right
+pack .move.panning.u -side top
+pack .move.panning.d -side bottom
+pack .move.panning
+
+frame .move.zoom -borderwidth 1
+label .move.zoom.title -text " Zoom "
+button .move.zoom.mu -text " + " -command {mu ; 2dmu ; repaint}
+button .move.zoom.md -text " - " -command {md ; 2dmd ; repaint}
+button .move.zoom.fit -text "max" -command {fit ; 2dfit; repaint}
+button .move.zoom.w -text "win" -command {wzoom ; repaint}
+pack .move.zoom.title -side top
+pack .move.zoom.w -side left
+pack .move.zoom.fit -side right
+pack .move.zoom.mu -side top
+pack .move.zoom.md -side bottom
+pack .move.zoom
+
+frame .pick -borderwidth 1
+label .pick.title -text " Pick "
+button .pick.coords -text "Coords" -command {catch {puts [mpick]}}
+button .pick.dist -text "Dist" -command {catch {puts [mdist]}}
+button .pick.whatis -text "What is" -command {catch {puts [whatis .]}}
+button .pick.erase -text "Erase" -command {catch {puts [erase .]}}
+pack .pick.title
+pack .pick.coords -pady 2 -padx 10
+pack .pick.dist -pady 2 -padx 10
+pack .pick.whatis -pady 2 -padx 10
+pack .pick.erase -pady 2 -padx 10
+
+set ShowExtCommands 0
+
+proc ShowHideExtCommands {} {
+ global ShowExtCommands
+ if $ShowExtCommands {
+ pack .move -pady 1 -padx 1 -side left
+ pack .pick -pady 1 -padx 1
+ } else {
+ pack forget .move .pick
+ }
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+# File: BRepOffset.cxx
+# Created: Wed Oct 25 10:39:23 1995
+# Author: Bruno DUMORTIER
+# <dub@fuegox>
+
+
+addmenu Sketch "Sketch" { vprofil2d }
+
+proc mkprofil2d {last} {
+ global [.top.p.eobj.name get]
+ global [.top.p.eobj.face get]
+ global DX
+ global DY
+ global DX0
+ global DY0
+
+ append cmd " F "
+ append cmd [dval DX] " " [dval DY]
+
+ for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
+ append cmd " [.top.l.lb.cm get $i]"
+ }
+ if [info exist cmd] {
+ uplevel #0 eval 2dprofile [.top.p.eobj.name get] $cmd $last
+ }
+ .top.p.eobj.com delete 0 end
+ set DX0 [dval DX]
+ set DY0 [dval DY]
+ update
+ repaint
+}
+
+proc mkprofil3d {last} {
+ global [.top.p.eobj.name get]
+ global [.top.p.eobj.face get]
+ global DX
+ global DY
+
+ append cmd " F "
+ append cmd [dval DX] " " [dval DY]
+
+ if [info exist [.top.p.eobj.face get]] {
+ append cmd " S"
+ append cmd " [.top.p.eobj.face get]";
+ }
+ for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
+ append cmd " [.top.l.lb.cm get $i]"
+ }
+ if [info exist cmd] {
+ puts $cmd
+ eval profile [.top.p.eobj.name get] $cmd $last
+ }
+ .top.p.eobj.com delete 0 end
+ repaint
+}
+
+proc bougex {} {
+ global DX
+ global DY
+
+ dset x0 DX
+ dset y0 DY
+
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset DX x0+x2-x1 DY y0
+ mkprofil2d WW
+ }
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
+ dset DX x0 DY y0
+ mkprofil2d WW
+}
+
+proc bougey {} {
+ global DX
+ global DY
+
+ dset x0 DX
+ dset y0 DY
+
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset DX x0 DY y0+y2-y1
+ mkprofil2d WW
+ }
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
+ dset DX x0 DY y0
+ mkprofil2d WW
+}
+
+proc bouge {} {
+ global DX
+ global DY
+
+ dset x0 DX
+ dset y0 DY
+
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset DX x0+x2-x1 DY y0+y2-y1
+ mkprofil2d WW
+ }
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
+ dset DX x0 DY y0
+ mkprofil2d WW
+}
+
+proc bougefp {} {
+ global DX
+ global DY
+
+ dset x0 DX
+ dset y0 DY
+
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick 29 x2 y2 z2 MOUSEbutton nowait
+ dset DX x2 DY y2
+ mkprofil2d WW
+ }
+ if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
+ dset DX x0 DY y0
+ mkprofil2d WW
+}
+
+proc movex {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x1
+ if { [dval dx] != 0 } {
+ append MO "x "
+ append MO [dval dx]
+ }
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ if { [dval dx] != 0 } {
+ append MO "x "
+ append MO [dval dx]
+ }
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc movey {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dy y2-y1
+ if { [dval dy] != 0 } {
+ append MO "y "
+ append MO [dval dy]
+ }
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ if { [dval dy] != 0 } {
+ append MO "y "
+ append MO [dval dy]
+ }
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc movec {} {
+ autodisplay
+ upvar #0 pi PI
+ upvar #0 CurX CX
+ upvar #0 CurY CY
+ upvar #0 CurDX CDX
+ upvar #0 CurDY CDY
+
+ line dummyline CX CY CDX CDY
+
+ point p1 CX CY
+ repaint
+ pick id x1 y1 z1 MOUSEbutton
+ dset sign 1
+ if {[dval MOUSEbutton] == 2} { dset sign -1}
+ dset MOUSEbutton 0
+ autodisplay
+
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ autodisplay
+ point p2 x2 y2
+ cirtang dummy dummyline p1 p2
+ dset PS sign*(CDX*(y2-CY)-CDY*(x2-CX))
+ if { [dval PS] < 0 } { reverse dummy_1}
+ parameters dummy_1 CX CY U1
+ parameters dummy_1 x2 y2 U2
+ autodisplay
+ eval trim dummy_1 dummy_1 U1 U2
+ repaint
+ }
+
+ if {[dval MOUSEbutton] == 1} {
+ erase dummy_1
+ set MO ""
+ if { [dval U2] < [dval U1]} { dset U2 U2+2*PI}
+ dset da sign*180*(U2-U1)/PI
+ 2dcvalue dummy_1 0 X Y DX DY
+ dset dr sqrt(DX*DX+DY*DY)
+ dset PS CDX*(y2-CY)-CDY*(x2-CX)
+ if { [dval PS] < 0 } {dset dr -dr}
+ if { [dval dr] != 0 } {
+ if { [dval da] != 0 } {
+ append MO "c "
+ append MO [format "%.3f" [dval dr]] " "
+ append MO [format "%.3f" [dval da]]
+ .top.l.lb.cm insert end $MO
+ }
+ }
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc movel {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dr sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
+ if { [dval dr] != 0 } {
+ append MO "l "
+ append MO [dval dr]
+ }
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ if { [dval dr] != 0 } {
+ append MO "l "
+ append MO [dval dr]
+ }
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc movet {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x1 dy y2-y1
+ if { [dval dx] != 0 || [dval dy] != 0 } {
+ append MO "t "
+ append MO [dval dx] " " [dval dy]
+ }
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ if { [dval dx] != 0 || [dval dy] != 0 } {
+ append MO "t "
+ append MO [dval dx] " " [dval dy]
+ }
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc movexx {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ append MO "xx "
+ append MO [dval x2]
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ append MO "xx "
+ append MO [dval x2]
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc moveyy {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ append MO "yy "
+ append MO [dval y2]
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ append MO "yy "
+ append MO [dval y2]
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc moveix {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ append MO "ix "
+ append MO [dval x2]
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ append MO "ix "
+ append MO [dval x2]
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc moveiy {} {
+ pick id x1 y1 z1 MOUSEbutton
+ dset MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ set MO ""
+ pick id x2 y2 z2 MOUSEbutton nowait
+ append MO "iy "
+ append MO [dval y2]
+ append MO " WW"
+ mkprofil2d $MO
+ }
+ if {[dval MOUSEbutton] == 1} {
+ set MO ""
+ append MO "iy "
+ append MO [dval y2]
+ .top.l.lb.cm insert end $MO
+ mkprofil2d WW
+ return
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+}
+
+proc vprofil2d {} {
+
+ toplevel .top -bg cornsilk
+ wm geometry .top +10+10
+ wm title .top "SKETCHER"
+
+ frame .top.l -bg cornsilk
+
+ frame .top.l.lb -bg azure1 -relief ridge -bd 4
+ listbox .top.l.lb.cm -bg azure1 -yscrollcommand ".top.l.lb.sc set"
+# scrollbar .top.l.lb.sc -bg azure2 -fg grey80 -activeforeground grey90\
+# -relief sunken -command ".top.l.lb.cm yview"
+ scrollbar .top.l.lb.sc -bg azure2 \
+ -relief sunken -command ".top.l.lb.cm yview"
+ bind .top.l.lb.cm <Double-Button-1> {
+ .top.p.eobj.com delete 0 end
+ .top.p.eobj.com insert end\
+ [.top.l.lb.cm get [.top.l.lb.cm curselection]]
+ }
+ pack .top.l.lb.cm .top.l.lb.sc -side left -fill both -padx 2m
+
+ frame .top.l.t -bg azure2 -relief ridge -bd 4
+ radiobutton .top.l.t.a -bg azure3 -activebackground azure2\
+ -text "face" -variable proftype -value F
+ radiobutton .top.l.t.b -bg azure3 -activebackground azure2\
+ -text "closed" -variable proftype -value W
+ radiobutton .top.l.t.c -bg azure3 -activebackground azure2\
+ -text "wire" -variable proftype -value " "
+
+ frame .top.l.f -bg azure2 -relief ridge -bd 4
+ button .top.l.f.f -bg deepskyblue -activebackground lightskyblue1\
+ -text " FIT " -command {
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+ 2dfit; repaint
+ }
+ button .top.l.f.u -bg deepskyblue -activebackground lightskyblue1\
+ -text " ZOOM + " -command {
+ 2dmu; repaint
+ }
+ button .top.l.f.d -bg deepskyblue -activebackground lightskyblue1\
+ -text " ZOOM - " -command {2dmd; repaint}
+
+ pack .top.l.f.f .top.l.f.u .top.l.f.d -side right -padx 1m -pady 1m
+
+ frame .top.l.d -bg azure2 -relief ridge -bd 4
+ button .top.l.d.u -bg deepskyblue -activebackground lightskyblue1\
+ -text " UP" -command 2dpu
+ button .top.l.d.d -bg deepskyblue -activebackground lightskyblue1\
+ -text "DOWN" -command 2dpd
+ button .top.l.d.l -bg deepskyblue -activebackground lightskyblue1\
+ -text "LEFT" -command 2dpl
+ button .top.l.d.r -bg deepskyblue -activebackground lightskyblue1\
+ -text "RIGHT" -command 2dpr
+ pack .top.l.d.u .top.l.d.d .top.l.d.l .top.l.d.r -side left\
+ -padx 1m -pady 1m
+
+ frame .top.l.q -bg azure2 -relief ridge -bd 4
+ button .top.l.q.ok -bg deepskyblue -activebackground lightskyblue1\
+ -text " VALI " -command {
+ delete 29
+ if { $proftype == "F"} {
+ set proftype " "
+ } elseif { $proftype != "W" } {
+ set proftype "WW"
+ }
+ mkprofil3d $proftype
+ destroy .top
+ if [info exist PickedFace] { erase PickedFace}
+ repaint;
+ }
+ button .top.l.q.ko -bg deepskyblue -activebackground lightskyblue1\
+ -text " CANCEL " -command {
+ delete 29
+ if [info exist [.top.p.eobj.name get]] {
+ eval unset [.top.p.eobj.name get];
+ }
+ destroy .top
+ if [info exist PickedFace] { unset PickedFace}
+ repaint;
+ }
+ button .top.l.q.h -bg deepskyblue -activebackground lightskyblue1\
+ -text " HELP " -command helpme
+ pack .top.l.q.ok .top.l.q.ko .top.l.q.h -side left -fill both\
+ -padx 2m -pady 1m
+
+ pack .top.l.t.a .top.l.t.b .top.l.t.c -side left -padx 1m -pady 1m
+
+ pack .top.l.lb .top.l.t -side top -pady 1m -fill both
+ pack .top.l.f .top.l.d -side top -pady 1m -fill both
+ pack .top.l.q -side bottom -fill both -pady 1m
+
+ pack .top.l -side left -fill both -padx 1m
+
+ frame .top.p -bg azure2 -relief ridge -bd 4
+
+ frame .top.p.obj -bg azure2
+ frame .top.p.eobj -bg azure2
+ label .top.p.obj.name -bg azure2 -text "Name:"
+ entry .top.p.eobj.name -bg azure1 -relief sunken
+ .top.p.eobj.name insert end "prof"
+
+ label .top.p.obj.com -bg azure2 -text "Command:"
+ entry .top.p.eobj.com -bg azure1 -relief sunken
+ bind .top.p.eobj.com <Return> {
+ .top.l.lb.cm insert end [.top.p.eobj.com get]
+ mkprofil2d WW
+ }
+
+ label .top.p.obj.face -bg azure2 -text "Face:"
+ entry .top.p.eobj.face -bg azure1 -relief sunken -textvariable CURFACE
+ bind .top.p.eobj.face <Return> {
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ } elseif { [.top.p.eobj.face get] == "."} {
+ uplevel #0 pickface
+ set CURFACE PickedFace
+ uplevel #0 eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+ 2dfit
+ repaint
+ }
+
+ label .top.p.obj.x0 -bg azure2 -text "X0:"
+ entry .top.p.eobj.x0 -bg azure1 -relief sunken -textvariable DX0
+ bind .top.p.eobj.x0 <Return> {
+ dset DX [expr $DX0]
+ mkprofil2d WW
+ }
+
+ label .top.p.obj.y0 -bg azure2 -text "Y0:"
+ entry .top.p.eobj.y0 -bg azure1 -relief sunken -textvariable DY0
+ bind .top.p.eobj.y0 <Return> {
+ dset DY [expr $DY0]
+ mkprofil2d WW
+ }
+
+ frame .top.c -bg azure2 -relief ridge -bd 4
+ button .top.c.add -bg deepskyblue -activebackground lightskyblue1\
+ -text " Add " -command {
+ .top.l.lb.cm insert end [.top.p.eobj.com get]
+ mkprofil2d WW
+ }
+ button .top.c.rem -bg deepskyblue -activebackground lightskyblue1\
+ -text "Remove" -command {
+ if {[.top.l.lb.cm curselection] != ""} {
+ .top.l.lb.cm delete [.top.l.lb.cm curselection]
+ } else {
+ .top.l.lb.cm delete end
+ }
+ 2dclear
+ if [info exist [.top.p.eobj.face get]] {
+ eval pcurve [.top.p.eobj.face get];
+ }
+ mkprofil2d WW
+ }
+ button .top.c.set -bg deepskyblue -activebackground lightskyblue1\
+ -text " Set " -command {
+ if {[.top.l.lb.cm curselection] != ""} {
+ .top.l.lb.cm insert [.top.l.lb.cm curselection]\
+ [.top.p.eobj.com get]
+ .top.l.lb.cm delete [.top.l.lb.cm curselection]
+ } else {
+ .top.l.lb.cm insert end [.top.l.lb.cm get]
+ }
+ mkprofil2d WW
+ }
+ pack .top.c.add .top.c.rem .top.c.set -side left -fill both\
+ -padx 4m -pady 1m
+
+ frame .top.m -bg azure2 -relief ridge -bd 4
+
+ frame .top.m.m1 -bg azure2
+ button .top.m.m1.x -bg deepskyblue -activebackground lightskyblue1\
+ -text " X " -command movex
+ button .top.m.m1.xx -bg deepskyblue -activebackground lightskyblue1\
+ -text " XX " -command movexx
+
+ frame .top.m.m2 -bg azure2
+ button .top.m.m2.y -bg deepskyblue -activebackground lightskyblue1\
+ -text " Y " -command movey
+ button .top.m.m2.yy -bg deepskyblue -activebackground lightskyblue1\
+ -text " YY " -command moveyy
+
+ frame .top.m.m3 -bg azure2
+ button .top.m.m3.c -bg deepskyblue -activebackground lightskyblue1\
+ -text " C " -command movec
+ button .top.m.m3.ix -bg deepskyblue -activebackground lightskyblue1\
+ -text " IX " -command moveix
+
+ frame .top.m.m4 -bg azure2
+ button .top.m.m4.l -bg deepskyblue -activebackground lightskyblue1\
+ -text " L " -command movel
+ button .top.m.m4.iy -bg deepskyblue -activebackground lightskyblue1\
+ -text " IY " -command moveiy
+
+ frame .top.m.m5 -bg azure2
+ button .top.m.m5.t -bg deepskyblue -activebackground lightskyblue1\
+ -text " T " -command movet
+ button .top.m.m5.tt -bg deepskyblue -activebackground lightskyblue1\
+ -text " TT " -command movett
+
+ frame .top.sc -bg azure2 -relief ridge -bd 4
+ frame .top.sc.sc1 -bg azure2
+ button .top.sc.sc1.d -bg deepskyblue -activebackground lightskyblue1\
+ -text "SCAN" -command bouge
+ button .top.sc.sc1.f -bg deepskyblue -activebackground lightskyblue1\
+ -text " First Point " -command bougefp
+
+ frame .top.sc.sc2 -bg azure2
+ button .top.sc.sc2.x -bg deepskyblue -activebackground lightskyblue1\
+ -text " SCAN X " -command bougex
+ button .top.sc.sc2.y -bg deepskyblue -activebackground lightskyblue1\
+ -text " SCAN Y " -command bougey
+
+ pack .top.p.obj.name .top.p.obj.com .top.p.obj.face .top.p.obj.x0\
+ .top.p.obj.y0 -side top -fill x -pady 1m
+ pack .top.p.eobj.name .top.p.eobj.com .top.p.eobj.face .top.p.eobj.x0\
+ .top.p.eobj.y0 -side top -fill x -pady 1m
+ pack .top.p.obj .top.p.eobj -side left
+
+ pack .top.m.m1.x .top.m.m1.xx -side top -fill x -pady 1m
+ pack .top.m.m2.y .top.m.m2.yy -side top -fill x -pady 1m
+ pack .top.m.m3.c .top.m.m3.ix -side top -fill x -pady 1m
+ pack .top.m.m4.l .top.m.m4.iy -side top -fill x -pady 1m
+ pack .top.m.m5.t .top.m.m5.tt -side top -fill x -pady 1m
+ pack .top.m.m1 .top.m.m2 .top.m.m3 .top.m.m4 .top.m.m5 -side left -padx 2m
+
+ pack .top.sc.sc1.d .top.sc.sc1.f -side top -fill x -pady 1m
+ pack .top.sc.sc2.x .top.sc.sc2.y -side top -fill x -pady 1m
+ pack .top.sc.sc1 .top.sc.sc2 -side left -padx 6m
+
+ pack .top.p -side top -fill both -padx 1m -pady 1m
+ pack .top.c -side top -fill both -padx 1m -pady 1m
+ pack .top.m -side top -fill both -padx 1m -pady 1m
+ pack .top.sc -side top -fill both -padx 1m -pady 1m
+
+ #global variables and init them
+ global proftype
+ global CURFACE
+ global DX
+ global DY
+ global DX0
+ global DY0
+
+ set proftype " "
+ set CURFACE ""
+ set DX0 ""
+ set DY0 ""
+ dset DX 0
+ dset DY 0
+
+ view 29 -2D- 465 10 664 410
+ 2dclear
+ # call 2dprofile to initialize CurX CurY CurDX CurDY
+ mkprofil2d WW
+}
+
+proc helpme {} {
+ toplevel .h -bg azure3
+ wm title .h "HELP"
+ wm geometry .h +40+90
+ message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text\
+ "Build a profile in the UV plane from a moving point and direction.\n \
+ The original point and direction are 0 0 and 1 0.\n \
+ Codes and values describe the point or direction change.\n \
+ When the point change the direction becomes the tangent.\n \
+ All angles are in degree (may be negative).\n \
+ By default the profile is closed.\n \
+ \n \
+ Instruction\tParameters\tAction\n \
+ F\t\tX Y\t\tSet the first point\n \
+ X\t\tDX\t\tTranslate point along X\n \
+ Y\t\tDY\t\tTranslate point along Y\n \
+ L\t\tDL\t\tTranslate point along direction\n \
+ XX\t\tX\t\tSet point X coordinate\n \
+ YY\t\tY\t\tSet point Y coordinate\n \
+ T\t\tDX DY\t\tTranslate point\n \
+ TT\t\tX Y\t\tSet point\n \
+ R\t\tAngle\t\tRotate direction\n \
+ RR\t\tAngle\t\tSet direction\n \
+ D\t\tDX DY\t\tSet direction\n \
+ IX\t\tX\t\tIntersect with vertical\n \
+ IY\t\tY\t\tIntersect with horizontal\n \
+ C\t\tRadius Angle\tArc of circle tangent to direction"
+
+ frame .h.q -relief ridge -bd 4 -bg azure3
+ button .h.q.q -bg deepskyblue -activebackground lightskyblue1 -text "QUIT" -command {destroy .h}
+ pack .h.q.q -padx 1m -pady 1m
+ pack .h.m .h.q -side top -pady 2m
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+proc 2dscan {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ erase $name
+ draw id 6 $name
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
+ draw id 6 $name
+ 2dtranslate $name dx dy
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval MOUSEbutton] == 1} { display $name; return; }
+ dset dx x0-x2 dy y0-y2 dz z0-z2
+ 2dtranslate $name dx dy
+ display $name
+}
+
+proc scan {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ erase $name
+ draw id 6 $name
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
+ draw id 6 $name
+ translate $name dx dy dz
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval MOUSEbutton] == 1} { display $name; return; }
+ dset dx x0-x2 dy y0-y2 dz z0-z2
+ translate $name dx dy dz
+ display $name
+}
+
+proc scanx {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ erase $name
+ draw id 6 $name
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x1 x1 x2
+ draw id 6 $name
+ translate $name dx 0 0
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval MOUSEbutton] == 1} {display $name; return;}
+ dset dx x0-x2
+ translate $name dx 0 0
+ display $name
+}
+
+proc scany {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ erase $name
+ draw id 6 $name
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dy y2-y1 y1 y2
+ draw id 6 $name
+ translate $name 0 dy 0
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval MOUSEbutton] == 1} { display $name; return;}
+ dset dy y0-y2
+ translate $name 0 dy 0
+ display $name
+}
+
+proc scanz {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ erase $name
+ draw id 6 $name
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dz z2-z1 z1 z2
+ draw id 6 $name
+ translate $name 0 0 dz
+ draw id 6 $name
+ }
+ draw id 6 $name
+ if {[dval MOUSEbutton] == 1} { display $name; return;}
+ dset dz z0-z2
+ translate $name 0 0 dz
+ display $name
+}
+
+proc tscan {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x0 dy y2-y0 dz z2-z0
+ eval ttranslate [explode $name e] dx dy dz
+ repaint
+ }
+ if {[dval MOUSEbutton] == 3} return;
+ dset dx x2-x0 dy y2-y0 dz z2-z0
+ ttranslate $name dx dy dz
+}
+
+proc tscanx {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dx x2-x0
+ eval ttranslate [explode $name e] dx 0 0
+ repaint
+ }
+ if {[dval MOUSEbutton] == 3} return;
+ dset dx x2-x0
+ ttranslate $name dx 0 0
+}
+
+proc tscany {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dy y2-y0
+ eval ttranslate [explode $name e] 0 dy 0
+ repaint
+ }
+ if {[dval MOUSEbutton] == 3} return;
+ dset dy y2-y0
+ ttranslate $name 0 dy 0
+}
+
+proc tscanz {} {
+ dtyp .
+ set name [lastrep id x y MOUSEbutton]
+ global $name
+ lastrep id x1 y1 z1 MOUSEbutton
+ dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
+ while {[dval MOUSEbutton] == 0} {
+ pick id x2 y2 z2 MOUSEbutton nowait
+ dset dz z2-z0
+ eval ttranslate [explode $name e] 0 0 dz
+ repaint
+ }
+ if {[dval MOUSEbutton] == 3} return;
+ dset dz z2-z0
+ ttranslate $name 0 0 dz
+}
+
+
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+if { [info commands addmenu] == "" } { return }
+
+global theMenus
+if [info exists theMenus(Surfaces)] {
+ destroy [string trimright $theMenus(Surfaces) ".menu"]
+ unset theMenus(Surfaces)
+}
+
+proc dialanasurf {command sname args} {
+ set com "dialbox $command name $sname origin {0 0 0} normal {0 0 1} xdir {1 0 0} "
+ foreach l $args {append com " $l"}
+ eval $com
+}
+
+addmenu Surfaces "Plane" {dialanasurf plane p {}}
+addmenu Surfaces "Cylinder" {dialanasurf cylinder c {radius 1}}
+addmenu Surfaces "Cone" {dialanasurf cone c {angle 30 radius 0}}
+addmenu Surfaces "Sphere" {dialanasurf sphere s {radius 1}}
+addmenu Surfaces "Torus" {dialanasurf torus t {radii {1 0.8}}}
+addmenu Surfaces "Revolution" {dialbox revsur name r basis . origin {0 0 0} axis {0 0 1}}
+addmenu Surfaces "Extrusion" {dialbox extsurf name e basis . direction {0 0 1}}
+redrawhelp
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+#
+# Draw standard initialisation
+#
+
+#################################################
+# prompts
+#################################################
+
+set Draw_CmdIndex 0
+set tcl_prompt1 {
+ incr Draw_CmdIndex
+ puts -nonewline "Draw\[$Draw_CmdIndex\]> "
+}
+
+set tcl_prompt2 {puts -nonewline "> "}
+
+#################################################
+# the help command in TCL
+#################################################
+proc help {{theCommand ""} {theHelpString ""} {theGroup "Procedures"}} {
+ global Draw_Helps Draw_Groups
+ if {$theCommand == ""} {
+ # help general
+ set aCmdWidth 15
+ foreach aGrpIter [lsort [array names Draw_Groups]] {
+ dputs -intense "\n\n$aGrpIter"
+ set i 1
+ set aLine ""
+ foreach aCmdIter [lsort $Draw_Groups($aGrpIter)] {
+ if {$i == 1} {
+ puts -nonewline "$aLine\n"
+ set aLine " "
+ }
+
+ append aLine $aCmdIter
+ set aLineLen [string length $aLine]
+ for {set j [expr $aLineLen + 1]} {$j < [expr $aCmdWidth * $i + 2]} {incr j} {
+ append aLine " "
+ }
+ append aLine " "
+ incr i
+ if {$i == 5} {set i 1}
+ }
+ puts "$aLine"
+ }
+ } elseif {$theHelpString == ""} {
+ # help function
+ set isFound 0
+ foreach aCmdIter [lsort [array names Draw_Helps]] {
+ if {[string match $theCommand $aCmdIter]} {
+ dputs -nonewline -intense $aCmdIter
+ set aLines [split $Draw_Helps($aCmdIter) "\n"]
+ set aNbLines [llength $aLines]
+ set isFirstLine 0
+ for {set aLineIter 0} {$aLineIter < $aNbLines} {incr aLineIter} {
+ set aLine [lindex $aLines $aLineIter]
+ if { "$aLine" == "" && ($aLineIter == 0 || $aLineIter == [expr $aNbLines - 1]) } { continue }
+ if { $isFirstLine == 0 } {
+ set isFirstLine 1
+ for {set j [string length $aCmdIter]} {$j < 15} {incr j} {
+ puts -nonewline " "
+ }
+ puts -nonewline " : "
+ } else {
+ if { ![string match "\t\t:*" $aLine] } {
+ puts -nonewline " : "
+ }
+ }
+ puts -nonewline "${aLine}\n"
+ }
+ set isFound 1
+ }
+ }
+ if {!$isFound} {
+ if {[string first * $theCommand] != -1} {
+ puts "No matching commands found!"
+ } else {
+ puts "No help found for '$theCommand'! Please try 'help $theCommand*' to find matching commands."
+ }
+ }
+ } else {
+ # set help
+ lappend Draw_Groups($theGroup) $theCommand
+ set Draw_Helps($theCommand) $theHelpString
+ }
+ flush stdout
+}
+
+help help {help pattern, or help command string group, to set help} {DRAW General Commands}
+#################################################
+# the getsourcefile command in TCL
+#################################################
+
+help getsourcefile {getsourcefile, or getsourcefile command } {DRAW General Commands}
+
+proc getsourcefile {{command ""}} {
+
+ global Draw_Helps Draw_Groups Draw_Files
+
+ set out {}
+ if {$command == ""} {
+
+ # help general
+ foreach h [lsort [array names Draw_Groups]] {
+ lappend out "" "" "$h"
+ set i 0
+ foreach f [lsort $Draw_Groups($h)] {
+ if {$i == 0} {
+ lappend out ""
+ }
+ incr i
+#
+# check that the command has its source file set
+#
+ foreach command_that_has_file [array names Draw_Files] {
+ if {($command_that_has_file == $f)} {
+ lappend out [format {%-20s %s} $f $Draw_Files($f)]
+ }
+ }
+ }
+ }
+ } else {
+
+ # getsourcefile fonction
+ append command "*"
+ foreach f [lsort [array names Draw_Files]] {
+ if {[string match $command $f]} {
+ lappend out [format {%-20s %s} $f $Draw_Files($f)]
+ }
+ }
+
+ }
+ return [join $out "\n"]
+}
+
+#################################################
+# whatis
+#################################################
+
+#proc gwhatis {aVarName} {
+# global $aVarName
+# puts -nonewline $aVarName; puts -nonewline " is a "; puts [dtyp ${aVarName}]
+#}
+
+help whatis "whatis object1 object2 ..."
+
+proc whatis args {
+ set __out_string ""
+ foreach i $args {
+ if {$i == "."} {set i [dname $i]}
+ #gwhatis $i
+ global $i
+ set __tmp_string "$i is a [dtyp $i]\n"
+ set __out_string "${__out_string}${__tmp_string}"
+ }
+ return ${__out_string}
+}
+
+#################################################
+# library, lsource
+#################################################
+
+proc library lib {
+ global auto_path
+ set auto_path [linsert $auto_path 0 $lib]
+ if [file readable $lib/LibraryInit] {
+ puts "Loading $lib/LibraryInit"
+ uplevel "source $lib/LibraryInit"
+ }
+}
+
+proc lsource file {
+ if [file readable $file] {source $file} else {
+ global auto_path
+ foreach dir $auto_path {
+ if [file readable $dir/$file] {
+ uplevel #0 "source $dir/$file"
+ break
+ }
+ }
+ }
+}
+
+#################################################
+# directory
+#################################################
+
+proc isgdraw {var} {
+ global $var
+ return [isdraw $var]
+}
+
+help directory {directory [pattern], list draw variables} {DRAW Variables management}
+
+proc directory {{joker *}} {
+ set res ""
+ foreach var [info globals $joker] {
+ if [isgdraw $var] {lappend res $var}
+ }
+ return $res
+}
+
+proc lsd {} { exec ls [datadir] }
+
+proc dall {} {
+ set schmurtz ""
+ foreach var [info globals] {
+ global $var
+ if [isdraw $var] {
+ if ![isprot $var] {
+ lappend schmurtz $var; unset $var
+ }
+ }
+ }
+ return $schmurtz
+}
+
+#################################################
+# repeat, do
+#################################################
+
+proc repeat {val script} {
+ for {set i 1} {$i <= $val} {incr i} {uplevel $script}
+}
+
+proc do {var start end args} {
+ global errorInfo errorCode
+ if {[llength args] == 1} {
+ set incr 1
+ set body args
+ } else {
+ set incr [lindex 1 args]
+ set body [lindex 2 args]
+ }
+ upvar $var v
+ if {[dval $incr] < 0} {set rel >=} else {set rel <=}
+ for {dset v $start} {[dval v] $rel [dval end]} {dset v [dval v+($incr)]} {
+ set code [catch {uplevel $body} string]
+ if {$code == 1} {
+ return -code error -errorInfo $errorInfo -errorcode $errorCode $string
+ } elseif {$code == 2} {
+ return -code return $string
+ }elseif {$code == 3} {
+ return
+ } elseif {$code > 4} {
+ return -code $code $string
+ }
+ }
+}
+
+#################################################
+# datadir, save, restore
+#################################################
+
+set Draw_DataDir "."
+
+help datadir {datadir [directory]} "DRAW Variables management"
+
+proc datadir {{dir ""}} {
+ global Draw_DataDir
+ if {$dir != ""} {
+ if {![file isdirectory $dir]} {
+ error "datadir : $dir is not a directory"
+ } else {
+ set Draw_DataDir $dir
+ }
+ }
+ return $Draw_DataDir
+}
+
+help save {save variable [filename]} "DRAW Variables management"
+
+proc save {name {file ""}} {
+ if {$file == ""} {set file $name}
+ upvar $name n
+ if {![isdraw n]} {error "save : $name is not a Draw variable"}
+ global Draw_DataDir
+ bsave n [file join $Draw_DataDir $file]
+ return [file join $Draw_DataDir $file]
+}
+
+help restore {restore filename [variablename]} "DRAW Variables management"
+
+proc restore {file {name ""}} {
+ if {$name == ""} {
+ # if name is not given explicitly, use name of the file w/o extension
+ set name [file rootname [file tail $file]]
+ }
+ global Draw_DataDir
+ upvar $name n
+ brestore [file join $Draw_DataDir $file ] n
+ return $name
+}
+
+#################################################
+# misc...
+#################################################
+
+proc ppcurve {a} {
+ 2dclear;
+ uplevel pcurve $a;
+ 2dfit;
+}
+
+#################################################
+# display and donly with jokers
+#################################################
+
+help disp {display variables matched by glob pattern} "DRAW Variables management"
+
+proc disp { args } {
+ set res ""
+ foreach joker $args {
+ if { $joker == "." } {
+ dtyp .
+ set joker [lastrep id x y b]
+ }
+ foreach var [info globals $joker] {
+ if { $var == "." } {
+ dtyp .
+ set var [lastrep id x y b]
+ }
+ if [isgdraw $var] {lappend res $var}
+ }
+ }
+ uplevel #0 eval display $res
+ return $res
+}
+
+help don {display only variables matched by glob pattern} "DRAW Variables management"
+
+proc don { args } {
+ set res ""
+ foreach joker $args {
+ if { $joker == "." } {
+ dtyp .
+ set joker [lastrep id x y b]
+ }
+ foreach var [info globals $joker] {
+ if { $var == "." } {
+ dtyp .
+ set var [lastrep id x y b]
+ }
+ if [isgdraw $var] {lappend res $var}
+ }
+ }
+ uplevel #0 eval donly $res
+ return $res
+}
+
+help del {unset (remove) variables matched by glob pattern} "DRAW Variables management"
+
+proc del args {
+ set res ""
+ foreach joker [eval concat $args] {
+ if { $joker == "." } {
+ dtyp .
+ set joker [lastrep id x y b]
+ }
+ foreach var [directory $joker] {
+ global $var
+ if ![isprot $var] {
+ lappend res $var; unset $var
+ }
+ }
+ }
+ return $res
+}
+
+help era {erase variables matched by glob pattern} "DRAW Variables management"
+
+proc era args {
+ set res ""
+ foreach joker [eval concat $args] {
+ if { $joker == "." } {
+ dtyp .
+ set joker [lastrep id x y b]
+ }
+ eval lappend res [directory $joker]
+ }
+ if [llength $res] {
+ uplevel \#0 eval erase $res
+ }
+}
+
+# The following commands (definitions are surrounded by if) are
+# available in extended Tcl (Tclx).
+# These procedures are added just to make full-working simulations of them.
+
+if {[info commands lvarpop] == ""} {
+ proc lvarpop args {
+ upvar [lindex $args 0] lvar
+ set index 0
+ set len [llength $lvar]
+ if {[llength $args] > 1} {
+ set ind [lindex $args 1]
+ if [regexp "^end" $ind] {
+ set index [expr $len-1]
+ } elseif [regexp "^len" $ind] {
+ set index $len
+ } else {set index $ind}
+ }
+ set el [lindex $lvar $index]
+ set newlvar {}
+ for {set i 0} {$i < $index} {incr i} {
+ lappend newlvar [lindex $lvar $i]
+ }
+ if {[llength $args] > 2} {
+ lappend newlvar [lindex $args 2]
+ }
+ for {set i [expr $index+1]} {$i < $len} {incr i} {
+ lappend newlvar [lindex $lvar $i]
+ }
+ set lvar $newlvar
+ return $el
+ }
+}
+
+if {[info commands lmatch] == ""} {
+ proc lmatch args {
+ set mode [switch -- [lindex $args 0] {
+ -exact {format 0}
+ -glob {format 1}
+ -regexp {format 2}}]
+ if {$mode == ""} {set mode 1} else {lvarpop args}
+ if {[llength $args] < 2} {puts "usage: lmatch ?mode? list pattern";return}
+ set list [lindex $args 0]
+ set pattern [lindex $args 1]
+ set res {}
+ foreach a $list {
+ if [switch $mode {
+ 0 {expr [string compare $a $pattern] == 0}
+ 1 {string match $pattern $a}
+ 2 {regexp $pattern $a}}] {lappend res $a}
+ }
+ return $res
+ }
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+#
+# view management scripts
+#
+#
+
+proc mu4 {} {
+ global tcl_platform
+ set stationname $tcl_platform(platform)
+ delete
+# if { ${stationname} == "windows" } {
+# view 1 +X+Z 20 20 300 300
+# view 2 +X+Y 20 350 300 300
+# view 3 -Y+Z 328 20 300 300
+# view 4 AXON 328 350 300 300
+# } else {
+ view 1 +X+Z 320 20 400 400
+ view 2 +X+Y 320 450 400 400
+ view 3 -Y+Z 728 20 400 400
+ view 4 AXON 728 450 400 400
+# }
+}
+
+help mu4 ", Four views layout" "DRAW Graphic Commands"
+
+proc mu7 {} {
+ delete
+ view 1 +Y+Z 0 300 275 270
+ view 2 +X-Y 285 0 275 270
+ view 3 +X+Z 285 300 275 270
+ view 4 +X+Y 285 600 275 270
+ view 5 -Y+Z 570 300 275 270
+ view 6 -X+Z 855 300 275 270
+ view 7 AXON 855 600 275 270
+}
+help mu7 ", Seven views layout" "DRAW Graphic Commands"
+
+proc mu8 {} {
+ delete
+ view 1 +Y+Z 0 300 275 270
+ view 2 +X-Y 285 0 275 270
+ view 3 +X+Z 285 300 275 270
+ view 4 +X+Y 285 600 275 270
+ view 5 -Y+Z 570 300 275 270
+ view 6 PERS 855 0 275 270
+ view 7 -X+Z 855 300 275 270
+ view 8 AXON 855 600 275 270
+}
+help mu8 ", Seven views layout" "DRAW Graphic Commands"
+
+proc mu24 {} {
+ delete
+ view 1 +X+Y 0 0 180 190
+ view 2 -Y+X 0 220 180 190
+ view 3 -X-Y 0 440 180 190
+ view 4 +Y-X 0 660 180 190
+
+ view 5 +Y+X 190 0 180 190
+ view 6 -X+Y 190 220 180 190
+ view 7 -Y-X 190 440 180 190
+ view 8 +X-Y 190 660 180 190
+
+ view 9 +X+Z 380 0 180 190
+ view 10 -Z+X 380 220 180 190
+ view 11 -X-Z 380 440 180 190
+ view 12 +Z-X 380 660 180 190
+
+ view 13 +Z+X 570 0 180 190
+ view 14 -X+Z 570 220 180 190
+ view 15 -Z-X 570 440 180 190
+ view 16 +X-Z 570 660 180 190
+
+ view 17 +Y+Z 760 0 180 190
+ view 18 -Z+Y 760 220 180 190
+ view 19 -Y-Z 760 440 180 190
+ view 20 +Z-Y 760 660 180 190
+
+ view 21 +Z+Y 950 0 180 190
+ view 22 -Y+Z 950 220 180 190
+ view 23 -Z-Y 950 440 180 190
+ view 24 +Y-Z 950 660 180 190
+
+}
+help mu24 ", 24 views layout" "DRAW Graphic Commands"
+
+proc axo {} {
+ global tcl_platform
+ set stationname $tcl_platform(platform)
+ delete
+# if { ${stationname} == "windows" } {
+# view 1 AXON 10 120 600 600
+# } else {
+ view 1 AXON 465 20 800 800
+# }
+}
+help axo ", One axonometric view. Orientation +X-Y+Z" "DRAW Graphic Commands"
+
+proc haxo {} {
+ delete
+ view 1 AXON 465 20 800 800*20.4/29.1
+}
+help haxo ", One axonometric horizontal view. Orientation +X-Y+Z" "DRAW Graphic Commands"
+
+proc vaxo {} {
+ delete
+ view 1 AXON 705 20 800*20.4/29.1 800
+}
+help vaxo ", One axonometric vertical view. Orientation +X-Y+Z" "DRAW Graphic Commands"
+
+proc pers {} {
+ delete
+ view 1 PERS 465 20 800 800
+}
+help pers ", One perspective view" "DRAW Graphic Commands"
+
+proc hpers {} {
+ delete
+ view 1 PERS 465 20 800 800*20.4/29.1
+}
+help hpers ", One perspective horizontal view" "DRAW Graphic Commands"
+
+proc vpers {} {
+ delete
+ view 1 PERS 705 20 800*20.4/29.1 800
+}
+help vpers ", One perspective vertical view" "DRAW Graphic Commands"
+
+proc front {} {
+ delete
+ view 1 +X+Z 465 20 800 800
+}
+help front ", One front view. Orientation +X+Z" "DRAW Graphic Commands"
+
+proc hfront {} {
+ delete
+ view 1 +X+Z 465 20 800 800*20.4/29.1
+}
+help hfront ", One front horizontal view. Orientation +X+Z" "DRAW Graphic Commands"
+
+proc vfront {} {
+ delete
+ view 1 +X+Z 705 20 800*20.4/29.1 800
+}
+help vfront ", One front vertical view. Orientation +X+Z" "DRAW Graphic Commands"
+
+proc top {} {
+ delete
+ view 1 +X+Y 465 20 800 800
+}
+help top ", One top view. Orientation +X+Y" "DRAW Graphic Commands"
+
+proc htop {} {
+ delete
+ view 1 +X+Y 465 20 800 800*20.4/29.1
+}
+help htop ", One top horizontal view. Orientation +X+Y" "DRAW Graphic Commands"
+
+proc vtop {} {
+ delete
+ view 1 +X+Y 705 20 800*20.4/29.1 800
+}
+help vtop ", One top vertical view. Orientation +X+Y" "DRAW Graphic Commands"
+
+proc left {} {
+ delete
+ view 1 -Y+Z 465 20 800 800
+}
+help left ", One left view. Orientation -Y+Z" "DRAW Graphic Commands"
+
+proc hleft {} {
+ delete
+ view 1 -Y+Z 465 20 800 800*20.4/29.1
+}
+help hleft ", One left horizontal view. Orientation -Y+Z" "DRAW Graphic Commands"
+
+proc vleft {} {
+ delete
+ view 1 -Y+Z 705 20 800*20.4/29.1 800
+}
+help vleft ", One left vertical view. Orientation -Y+Z" "DRAW Graphic Commands"
+
+proc back {} {
+ delete
+ view 1 -X+Z 465 20 800 800
+}
+help back ", One back view. Orientation -X+Z" "DRAW Graphic Commands"
+
+proc hback {} {
+ delete
+ view 1 -X+Z 465 20 800 800*20.4/29.1
+}
+help hback ", One back horizontal view. Orientation -X+Z" "DRAW Graphic Commands"
+
+proc vback {} {
+ delete
+ view 1 -X+Z 705 20 800*20.4/29.1 800
+}
+help vback ", One back vertical view. Orientation -X+Z" "DRAW Graphic Commands"
+
+proc right {} {
+ delete
+ view 1 +Y+Z 465 20 800 800
+}
+help right ", One right view. Orientation +Y+Z" "DRAW Graphic Commands"
+
+proc hright {} {
+ delete
+ view 1 +Y+Z 465 20 800 800*20.4/29.1
+}
+help hright ", One right horizontal view. Orientation +Y+Z" "DRAW Graphic Commands"
+
+proc vright {} {
+ delete
+ view 1 +Y+Z 705 20 800*20.4/29.1 800
+}
+help vright ", One right vertical view. Orientation +Y+Z" "DRAW Graphic Commands"
+
+proc bottom {} {
+ delete
+ view 1 +X-Y 465 20 800 800
+}
+help bottom ", One bottom view. Orientation +X-Y" "DRAW Graphic Commands"
+
+proc hbottom {} {
+ delete
+ view 1 +X-Y 465 20 800 800*20.4/29.1
+}
+help hbottom ", One bottom horizontal view. Orientation +X-Y" "DRAW Graphic Commands"
+
+proc vbottom {} {
+ delete
+ view 1 +X-Y 705 20 800*20.4/29.1 800
+}
+help vbottom ", One bottom vertical view. Orientation +X-Y" "DRAW Graphic Commands"
+
+proc v2d {} {
+ delete
+ view 1 -2D- 465 20 800 800
+}
+help v2d ", One 2d view" "DRAW Graphic Commands"
+
+proc av2d {} {
+ delete
+ global tcl_platform
+ set stationname $tcl_platform(platform)
+# if { ${stationname} == "windows" } {
+# view 2 -2D- 328 20 300 300
+# view 1 AXON 328 350 300 300
+# } else {
+ view 2 -2D- 728 20 400 400
+ view 1 AXON 728 450 400 400
+# }
+}
+help av2d ", axono and 2d view" "DRAW Graphic Commands"
+
+proc v2d2 {} {
+ view 2 -2D- 728 20 400 400
+}
+help v2d2 "2d view on number 2" "DRAW Graphic Commands"
+
+proc smallview {{v AXON}} {
+ global tcl_platform
+ set stationname $tcl_platform(platform)
+ delete
+# if { ${stationname} == "windows" } {
+# view 1 $v 328 350 300 300
+# } else {
+ view 1 $v 728 450 400 400
+# }
+}
+
+help smallview " AXON PERS -2D- +X+Y ..." "DRAW Graphic Commands"
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+set Draw_GEOMETRY 1
+
+if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/CURVES.tcl]} {
+ source $env(CSF_OCCTResourcePath)/DrawResources/CURVES.tcl
+} else {
+ source $env(CASROOT)/src/DrawResources/CURVES.tcl
+}
+
+if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/SURFACES.tcl]} {
+ source $env(CSF_OCCTResourcePath)/DrawResources/SURFACES.tcl
+} else {
+ source $env(CASROOT)/src/DrawResources/SURFACES.tcl
+}
+
--- /dev/null
+# Copyright (c) 2013-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+############################################################################
+# This file defines scripts for execution of OCCT tests.
+# It should be loaded automatically when DRAW is started, and provides
+# top-level commands starting with 'test'. Type 'help test' to get their
+# synopsis.
+# See OCCT Tests User Guide for description of the test system.
+#
+# Note: procedures with names starting with underscore are for internal use
+# inside the test system.
+############################################################################
+
+# Default verbose level for command _run_test
+set _tests_verbose 0
+
+# regexp for parsing test case results in summary log
+set _test_case_regexp {^CASE\s+([\w.-]+)\s+([\w.-]+)\s+([\w.-]+)\s*:\s*([\w]+)(.*)}
+
+# Basic command to run indicated test case in DRAW
+help test {
+ Run specified test case
+ Use: test group grid casename [options...]
+ Allowed options are:
+ -echo: all commands and results are echoed immediately,
+ but log is not saved and summary is not produced
+ It is also possible to use "1" instead of "-echo"
+ If echo is OFF, log is stored in memory and only summary
+ is output (the log can be obtained with command "dlog get")
+ -outfile filename: set log file (should be non-existing),
+ it is possible to save log file in text file or
+ in html file(with snapshot), for that "filename"
+ should have ".html" extension
+ -overwrite: force writing log in existing file
+ -beep: play sound signal at the end of the test
+ -errors: show all lines from the log report that are recognized as errors
+ This key will be ignored if the "-echo" key is already set.
+}
+proc test {group grid casename {args {}}} {
+ # set default values of arguments
+ set echo 0
+ set errors 0
+ set logfile ""
+ set overwrite 0
+ set signal 0
+
+ # get test case paths (will raise error if input is invalid)
+ _get_test $group $grid $casename dir gridname casefile
+
+ # check arguments
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+ # if echo specified as "-echo", convert it to bool
+ if { $arg == "-echo" || $arg == "1" } {
+ set echo t
+ continue
+ }
+
+ # output log file
+ if { $arg == "-outfile" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logfile [lindex $args $narg]
+ } else {
+ error "Option -outfile requires argument"
+ }
+ continue
+ }
+
+ # allow overwrite existing log
+ if { $arg == "-overwrite" } {
+ set overwrite 1
+ continue
+ }
+
+ # sound signal at the end of the test
+ if { $arg == "-beep" } {
+ set signal t
+ continue
+ }
+
+ # if errors specified as "-errors", convert it to bool
+ if { $arg == "-errors" } {
+ set errors t
+ continue
+ }
+
+ # unsupported option
+ error "Error: unsupported option \"$arg\""
+ }
+ # run test
+ uplevel _run_test $dir $group $gridname $casefile $echo
+
+ # check log
+ if { !$echo } {
+ _check_log $dir $group $gridname $casename $errors [dlog get] summary html_log
+
+ # create log file
+ if { ! $overwrite && [file isfile $logfile] } {
+ error "Error: Specified log file \"$logfile\" exists; please remove it before running test or use -overwrite option"
+ }
+ if {$logfile != ""} {
+ if {[file extension $logfile] == ".html"} {
+ if {[regexp {vdump ([^\s\n]+)} $html_log dump snapshot]} {
+ catch {file copy -force $snapshot [file rootname $logfile][file extension $snapshot]}
+ }
+ _log_html $logfile $html_log "Test $group $grid $casename"
+ } else {
+ _log_save $logfile "[dlog get]\n$summary" "Test $group $grid $casename"
+ }
+ }
+ }
+
+ # play sound signal at the end of test
+ if {$signal} {
+ puts "\7\7\7\7"
+ }
+ return
+}
+
+# Basic command to run indicated test case in DRAW
+help testgrid {
+ Run all tests, or specified group, or one grid
+ Use: testgrid [groupmask [gridmask [casemask]]] [options...]
+ Allowed options are:
+ -exclude N: exclude group, subgroup or single test case from executing, where
+ N is name of group, subgroup or case. Excluded items should be separated by comma.
+ Option should be used as the first argument after list of executed groups, grids, and test cases.
+ -parallel N: run N parallel processes (default is number of CPUs, 0 to disable)
+ -refresh N: save summary logs every N seconds (default 600, minimal 1, 0 to disable)
+ -outdir dirname: set log directory (should be empty or non-existing)
+ -overwrite: force writing logs in existing non-empty directory
+ -xml filename: write XML report for Jenkins (in JUnit-like format)
+ -beep: play sound signal at the end of the tests
+ -regress dirname: re-run only a set of tests that have been detected as regressions on some previous run.
+ -skipped dirname: re-run only a set of tests that have been skipped on some previous run.
+ Here "dirname" is path to directory containing results of previous run.
+ -skip N: skip first N tests (useful to restart after abort)
+ Groups, grids, and test cases to be executed can be specified by list of file
+ masks, separated by spaces or comma; default is all (*).
+}
+proc testgrid {args} {
+ global env tcl_platform _tests_verbose
+
+ ######################################################
+ # check arguments
+ ######################################################
+
+ # check that environment variable defining paths to test scripts is defined
+ if { ! [info exists env(CSF_TestScriptsPath)] ||
+ [llength $env(CSF_TestScriptsPath)] <= 0 } {
+ error "Error: Environment variable CSF_TestScriptsPath is not defined"
+ }
+
+ # treat options
+ set parallel [_get_nb_cpus]
+ set refresh 60
+ set logdir ""
+ set overwrite 0
+ set xmlfile ""
+ set signal 0
+ set exc_group 0
+ set exc_grid 0
+ set exc_case 0
+ set regress 0
+ set skipped 0
+ set logdir_regr ""
+ set logdir_skip ""
+ set nbskip 0
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+
+ # parallel execution
+ if { $arg == "-parallel" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set parallel [expr [lindex $args $narg]]
+ } else {
+ error "Option -parallel requires argument"
+ }
+ continue
+ }
+
+ # refresh logs time
+ if { $arg == "-refresh" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set refresh [expr [lindex $args $narg]]
+ } else {
+ error "Option -refresh requires argument"
+ }
+ continue
+ }
+
+ # output directory
+ if { $arg == "-outdir" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logdir [lindex $args $narg]
+ } else {
+ error "Option -outdir requires argument"
+ }
+ continue
+ }
+
+ # allow overwrite logs
+ if { $arg == "-overwrite" } {
+ set overwrite 1
+ continue
+ }
+
+ # refresh logs time
+ if { $arg == "-xml" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set xmlfile [lindex $args $narg]
+ }
+ if { $xmlfile == "" } {
+ set xmlfile TESTS-summary.xml
+ }
+ continue
+ }
+
+ # sound signal at the end of the test
+ if { $arg == "-beep" } {
+ set signal t
+ continue
+ }
+
+ # re-run only a set of tests that have been detected as regressions on some previous run
+ if { $arg == "-regress" || $arg == "-skipped" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ if { $arg == "-regress" } {
+ set logdir_regr [file normalize [string trim [lindex $args $narg]]]
+ set regress 1
+ } else {
+ set logdir_skip [file normalize [string trim [lindex $args $narg]]]
+ set skipped 1
+ }
+ } else {
+ error "Option $arg requires argument"
+ }
+ continue
+ }
+
+ # skip N first tests
+ if { $arg == "-skip" } {
+ incr narg
+ if { $narg < [llength $args] && [string is integer [lindex $args $narg]] } {
+ set nbskip [lindex $args $narg]
+ } else {
+ error "Option -skip requires integer argument"
+ }
+ continue
+ }
+
+ # exclude group, subgroup or single test case from executing
+ if { $arg == "-exclude" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set argts $args
+ set idx_begin [string first " -ex" $argts]
+ if { ${idx_begin} != "-1" } {
+ set argts [string replace $argts 0 $idx_begin]
+ }
+ set idx_exclude [string first "exclude" $argts]
+ if { ${idx_exclude} != "-1" } {
+ set argts [string replace $argts 0 $idx_exclude+7]
+ }
+ set idx [string first " -" $argts]
+ if { ${idx} != "-1" } {
+ set argts [string replace $argts $idx end]
+ }
+ set argts [split $argts ,]
+ foreach argt $argts {
+ if { [llength $argt] == 1 } {
+ lappend exclude_group $argt
+ set exc_group 1
+ } elseif { [llength $argt] == 2 } {
+ lappend exclude_grid $argt
+ set exc_grid 1
+ incr narg
+ } elseif { [llength $argt] == 3 } {
+ lappend exclude_case $argt
+ set exc_case 1
+ incr narg
+ incr narg
+ }
+ }
+ } else {
+ error "Option -exclude requires argument"
+ }
+ continue
+ }
+
+ # unsupported option
+ if { [regexp {^-} $arg] } {
+ error "Error: unsupported option \"$arg\""
+ }
+
+ # treat arguments not recognized as options as group and grid names
+ if { ! [info exists groupmask] } {
+ set groupmask [split $arg ,]
+ } elseif { ! [info exists gridmask] } {
+ set gridmask [split $arg ,]
+ } elseif { ! [info exists casemask] } {
+ set casemask [split $arg ,]
+ } else {
+ error "Error: cannot interpret argument $narg ($arg)"
+ }
+ }
+
+ # check that target log directory is empty or does not exist
+ set logdir [file normalize [string trim $logdir]]
+ if { $logdir == "" } {
+ # if specified logdir is empty string, generate unique name like
+ # results/<branch>_<timestamp>
+ set prefix ""
+ if { ! [catch {exec git branch} gitout] &&
+ [regexp {[*] ([\w-]+)} $gitout res branch] } {
+ set prefix "${branch}_"
+ }
+ set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]"
+
+ set logdir [file normalize $logdir]
+ }
+ if { [file isdirectory $logdir] && ! $overwrite && ! [catch {glob -directory $logdir *}] } {
+ error "Error: Specified log directory \"$logdir\" is not empty; please clean it before running tests"
+ }
+ if { [catch {file mkdir $logdir}] || ! [file writable $logdir] } {
+ error "Error: Cannot create directory \"$logdir\", or it is not writable"
+ }
+
+ # masks for search of test groups, grids, and cases
+ if { ! [info exists groupmask] } { set groupmask * }
+ if { ! [info exists gridmask ] } { set gridmask * }
+ if { ! [info exists casemask ] } { set casemask * }
+
+ # Find test cases with FAILED and IMPROVEMENT statuses in previous run
+ # if option "regress" is given
+ set rerun_group_grid_case {}
+
+ if { ${regress} > 0 || ${skipped} > 0 } {
+ if { "${groupmask}" != "*"} {
+ lappend rerun_group_grid_case [list $groupmask $gridmask $casemask]
+ }
+ } else {
+ lappend rerun_group_grid_case [list $groupmask $gridmask $casemask]
+ }
+
+ if { ${regress} > 0 } {
+ if { [file exists ${logdir_regr}/tests.log] } {
+ set fd [open ${logdir_regr}/tests.log]
+ while { [gets $fd line] >= 0 } {
+ if {[regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): FAILED} $line dump group grid casename] ||
+ [regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): IMPROVEMENT} $line dump group grid casename]} {
+ lappend rerun_group_grid_case [list $group $grid $casename]
+ }
+ }
+ close $fd
+ } else {
+ error "Error: file ${logdir_regr}/tests.log is not found, check your input arguments!"
+ }
+ }
+ if { ${skipped} > 0 } {
+ if { [file exists ${logdir_skip}/tests.log] } {
+ set fd [open ${logdir_skip}/tests.log]
+ while { [gets $fd line] >= 0 } {
+ if {[regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): SKIPPED} $line dump group grid casename] } {
+ lappend rerun_group_grid_case [list $group $grid $casename]
+ }
+ }
+ close $fd
+ } else {
+ error "Error: file ${logdir_skip}/tests.log is not found, check your input arguments!"
+ }
+ }
+
+ ######################################################
+ # prepare list of tests to be performed
+ ######################################################
+
+ # list of tests, each defined by a list of:
+ # test scripts directory
+ # group (subfolder) name
+ # grid (subfolder) name
+ # test case name
+ # path to test case file
+ set tests_list {}
+
+ foreach group_grid_case ${rerun_group_grid_case} {
+ set groupmask [lindex $group_grid_case 0]
+ set gridmask [lindex $group_grid_case 1]
+ set casemask [lindex $group_grid_case 2]
+
+ # iterate by all script paths
+ foreach dir [lsort -unique [_split_path $env(CSF_TestScriptsPath)]] {
+ # protection against empty paths
+ set dir [string trim $dir]
+ if { $dir == "" } { continue }
+
+ if { $_tests_verbose > 0 } { _log_and_puts log "Examining tests directory $dir" }
+
+ # check that directory exists
+ if { ! [file isdirectory $dir] } {
+ _log_and_puts log "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped"
+ continue
+ }
+
+ # search all directories in the current dir with specified mask
+ if [catch {glob -directory $dir -tail -types d {*}$groupmask} groups] { continue }
+
+ # exclude selected groups from all groups
+ if { ${exc_group} > 0 } {
+ foreach exclude_group_element ${exclude_group} {
+ set idx [lsearch $groups "${exclude_group_element}"]
+ if { ${idx} != "-1" } {
+ set groups [lreplace $groups $idx $idx]
+ } else {
+ continue
+ }
+ }
+ }
+
+ # iterate by groups
+ if { $_tests_verbose > 0 } { _log_and_puts log "Groups to be executed: $groups" }
+ foreach group [lsort -dictionary $groups] {
+ if { $_tests_verbose > 0 } { _log_and_puts log "Examining group directory $group" }
+
+ # file grids.list must exist: it defines sequence of grids in the group
+ if { ! [file exists $dir/$group/grids.list] } {
+ _log_and_puts log "Warning: directory $dir/$group does not contain file grids.list, skipped"
+ continue
+ }
+
+ # read grids.list file and make a list of grids to be executed
+ set gridlist {}
+ set fd [open $dir/$group/grids.list]
+ set nline 0
+ while { [gets $fd line] >= 0 } {
+ incr nline
+
+ # skip comments and empty lines
+ if { [regexp "\[ \t\]*\#.*" $line] } { continue }
+ if { [string trim $line] == "" } { continue }
+
+ # get grid id and name
+ if { ! [regexp "^\(\[0-9\]+\)\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridid grid] } {
+ _log_and_puts log "Warning: cannot recognize line $nline in file $dir/$group/grids.list as \"gridid gridname\"; ignored"
+ continue
+ }
+
+ # check that grid fits into the specified mask
+ foreach mask $gridmask {
+ if { $mask == $gridid || [string match $mask $grid] } {
+ lappend gridlist $grid
+ }
+ }
+ }
+ close $fd
+
+ # exclude selected grids from all grids
+ if { ${exc_grid} > 0 } {
+ foreach exclude_grid_element ${exclude_grid} {
+ set exclude_elem [lindex $exclude_grid_element end]
+ set idx [lsearch $gridlist "${exclude_elem}"]
+ if { ${idx} != "-1" } {
+ set gridlist [lreplace $gridlist $idx $idx]
+ } else {
+ continue
+ }
+ }
+ }
+
+ # iterate by all grids
+ foreach grid $gridlist {
+
+ # check if this grid is aliased to another one
+ set griddir $dir/$group/$grid
+ if { [file exists $griddir/cases.list] } {
+ set fd [open $griddir/cases.list]
+ if { [gets $fd line] >= 0 } {
+ set griddir [file normalize $dir/$group/$grid/[string trim $line]]
+ }
+ close $fd
+ }
+
+ # check if grid directory actually exists
+ if { ! [file isdirectory $griddir] } {
+ _log_and_puts log "Error: tests directory for grid $grid ($griddir) is missing; skipped"
+ continue
+ }
+
+ # create directory for logging test results
+ if { $logdir != "" } { file mkdir $logdir/$group/$grid }
+
+ # iterate by all tests in the grid directory
+ if { [catch {glob -directory $griddir -type f {*}$casemask} testfiles] } { continue }
+
+ # exclude selected test cases from all testfiles
+ if { ${exc_case} > 0 } {
+ foreach exclude_case_element ${exclude_case} {
+ set exclude_casegroup_elem [lindex $exclude_case_element end-2]
+ set exclude_casegrid_elem [lindex $exclude_case_element end-1]
+ set exclude_elem [lindex $exclude_case_element end]
+ if { ${exclude_casegrid_elem} == "${grid}" } {
+ set idx [lsearch $testfiles "${dir}/${exclude_casegroup_elem}/${exclude_casegrid_elem}/${exclude_elem}"]
+ if { ${idx} != "-1" } {
+ set testfiles [lreplace $testfiles $idx $idx]
+ } else {
+ continue
+ }
+ }
+ }
+ }
+
+ foreach casefile [lsort -dictionary $testfiles] {
+ # filter out files with reserved names
+ set casename [file tail $casefile]
+ if { $casename == "begin" || $casename == "end" ||
+ $casename == "parse.rules" } {
+ continue
+ }
+
+ if { $nbskip > 0 } {
+ incr nbskip -1
+ } else {
+ # Check if current test matches exclude pattern
+ set should_exclude 0
+ if { ${exc_case} > 0 } {
+ foreach excl $exclude_case {
+ if {[string match "$group" [lindex $excl 0]] &&
+ [string match "$grid" [lindex $excl 1]] &&
+ [string match "$casename" [lindex $excl 2]]} {
+ set should_exclude 1
+ break
+ }
+ }
+ }
+ if {!$should_exclude} {
+ lappend tests_list [list $dir $group $grid $casename $casefile]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if { [llength $tests_list] < 1 } {
+ error "Error: no tests are found, check your input arguments and variable CSF_TestScriptsPath!"
+ } else {
+ puts "Running tests (total [llength $tests_list] test cases)..."
+ }
+ ######################################################
+ # run tests
+ ######################################################
+
+ # log command arguments and environment
+ lappend log "Command: testgrid $args"
+ lappend log "Host: [info hostname]"
+ lappend log "Started on: [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]"
+ catch {lappend log "DRAW build:\n[dversion]" }
+ catch { pload VISUALIZATION; vinit g/v/info -virtual -w 2 -h 2 }
+ catch { lappend log "[vglinfo -complete -lineWidth 80]" }
+ catch { vclose g/v/info 0 }
+ lappend log "Environment:"
+ foreach envar [lsort [array names env]] {
+ lappend log "$envar=\"$env($envar)\""
+ }
+ lappend log ""
+
+ set refresh_timer [clock seconds]
+ uplevel dchrono _timer reset
+ uplevel dchrono _timer start
+
+ # if parallel execution is requested, allocate thread pool
+ if { $parallel > 0 } {
+ if { ! [info exists tcl_platform(threaded)] || [catch {package require Thread}] } {
+ _log_and_puts log "Warning: Tcl package Thread is not available, running in sequential mode"
+ set parallel 0
+ } else {
+ set worker [tpool::create -minworkers $parallel -maxworkers $parallel]
+ # suspend the pool until all jobs are posted, to prevent blocking of the process
+ # of starting / processing jobs by running threads
+ catch {tpool::suspend $worker}
+ if { $_tests_verbose > 0 } { _log_and_puts log "Executing tests in (up to) $parallel threads" }
+ # limit number of jobs in the queue by reasonable value
+ # to prevent slowdown due to unnecessary queue processing
+ set nbpooled 0
+ set nbpooled_max [expr 10 * $parallel]
+ set nbpooled_ok [expr 5 * $parallel]
+ }
+ }
+
+ # start test cases
+ set userbreak 0
+ foreach test_def $tests_list {
+ # check for user break
+ if { $userbreak || "[info commands dbreak]" == "dbreak" && [catch dbreak] } {
+ set userbreak 1
+ break
+ }
+
+ set dir [lindex $test_def 0]
+ set group [lindex $test_def 1]
+ set grid [lindex $test_def 2]
+ set casename [lindex $test_def 3]
+ set casefile [lindex $test_def 4]
+
+ # command to set tests for generation of image in results directory
+ set imgdir_cmd ""
+ if { $logdir != "" } { set imgdir_cmd "set imagedir $logdir/$group/$grid" }
+
+ # prepare command file for running test case in separate instance of DRAW
+ set file_cmd "$logdir/$group/$grid/${casename}.tcl"
+ set fd_cmd [open $file_cmd w]
+
+ # UTF-8 encoding is used by default on Linux everywhere, and "unicode" is set
+ # by default as encoding of stdin and stdout on Windows in interactive mode;
+ # however in batch mode on Windows default encoding is set to system one (e.g. 1252),
+ # so we need to set UTF-8 encoding explicitly to have Unicode symbols transmitted
+ # correctly between calling and caller processes
+ if { "$tcl_platform(platform)" == "windows" } {
+ puts $fd_cmd "fconfigure stdout -encoding utf-8"
+ puts $fd_cmd "fconfigure stdin -encoding utf-8"
+ }
+
+ # commands to set up and run test
+ puts $fd_cmd "$imgdir_cmd"
+ puts $fd_cmd "set test_image $casename"
+ puts $fd_cmd "_run_test $dir $group $grid $casefile t"
+
+ # use dlog command to obtain complete output of the test when it is absent (i.e. since OCCT 6.6.0)
+ # note: this is not needed if echo is set to 1 in call to _run_test above
+ if { ! [catch {dlog get}] } {
+ puts $fd_cmd "puts \[dlog get\]"
+ } else {
+ # else try to use old-style QA_ variables to get more output...
+ set env(QA_DUMP) 1
+ set env(QA_DUP) 1
+ set env(QA_print_command) 1
+ }
+
+ # final 'exit' is needed when running on Linux under VirtualGl
+ puts $fd_cmd "exit"
+ close $fd_cmd
+
+ # command to run DRAW with a command file;
+ # note that empty string is passed as standard input to avoid possible
+ # hang-ups due to waiting for stdin of the launching process
+ set command "exec <<{} DRAWEXE -f $file_cmd"
+
+ # alternative method to run without temporary file; disabled as it needs too many backslashes
+ # else {
+ # set command "exec <<\"\" DRAWEXE -c $imgdir_cmd\\\; set test_image $casename\\\; \
+ # _run_test $dir $group $grid $casefile\\\; \
+ # puts \\\[dlog get\\\]\\\; exit"
+ # }
+
+ # run test case, either in parallel or sequentially
+ if { $parallel > 0 } {
+ # parallel execution
+ set job [tpool::post -nowait $worker "catch \"$command\" output; return \$output"]
+ set job_def($job) [list $logdir $dir $group $grid $casename]
+ incr nbpooled
+ if { $nbpooled > $nbpooled_max } {
+ _testgrid_process_jobs $worker $nbpooled_ok
+ }
+ } else {
+ # sequential execution
+ catch {eval $command} output
+ _log_test_case $output $logdir $dir $group $grid $casename log
+
+ # update summary log with requested period
+ if { $logdir != "" && $refresh > 0 && [expr [clock seconds] - $refresh_timer > $refresh] } {
+ # update and dump summary
+ _log_summarize $logdir $log
+ set refresh_timer [clock seconds]
+ }
+ }
+ }
+
+ # get results of started threads
+ if { $parallel > 0 } {
+ _testgrid_process_jobs $worker
+ # release thread pool
+ if { $nbpooled > 0 } {
+ tpool::cancel $worker [array names job_def]
+ }
+ catch {tpool::resume $worker}
+ tpool::release $worker
+ }
+
+ uplevel dchrono _timer stop
+ set time [lindex [split [uplevel dchrono _timer show] "\n"] 0]
+
+ if { $userbreak } {
+ _log_and_puts log "*********** Stopped by user break ***********"
+ set time "${time} \nNote: the process is not finished, stopped by user break!"
+ }
+
+ ######################################################
+ # output summary logs and exit
+ ######################################################
+
+ _log_summarize $logdir $log $time
+ if { $logdir != "" } {
+ puts "Detailed logs are saved in $logdir"
+ }
+ if { $logdir != "" && $xmlfile != "" } {
+ # XML output file is assumed relative to log dir unless it is absolute
+ if { [ file pathtype $xmlfile] == "relative" } {
+ set xmlfile [file normalize $logdir/$xmlfile]
+ }
+ _log_xml_summary $logdir $xmlfile $log 0
+ puts "XML summary is saved to $xmlfile"
+ }
+ # play sound signal at the end of test
+ if {$signal} {
+ puts "\7\7\7\7"
+ }
+ return
+}
+
+# Procedure to regenerate summary log from logs of test cases
+help testsummarize {
+ Regenerate summary log in the test directory from logs of test cases.
+ This can be necessary if test grids are executed separately (e.g. on
+ different stations) or some grids have been re-executed.
+ Use: testsummarize dir
+}
+proc testsummarize {dir} {
+ global _test_case_regexp
+
+ if { ! [file isdirectory $dir] } {
+ error "Error: \"$dir\" is not a directory"
+ }
+
+ # get summary statements from all test cases in one log
+ set log {}
+
+ # to avoid huge listing of logs, first find all subdirectories and iterate
+ # by them, parsing log files in each subdirectory independently
+ foreach grid [glob -directory $dir -types d -tails */*] {
+ foreach caselog [glob -nocomplain -directory [file join $dir $grid] -types f -tails *.log] {
+ set file [file join $dir $grid $caselog]
+ set nbfound 0
+ set fd [open $file r]
+ while { [gets $fd line] >= 0 } {
+ if { [regexp $_test_case_regexp $line res grp grd cas status message] } {
+ if { "[file join $grid $caselog]" != "[file join $grp $grd ${cas}.log]" } {
+ puts "Error: $file contains status line for another test case ($line)"
+ }
+ lappend log $line
+ incr nbfound
+ }
+ }
+ close $fd
+
+ if { $nbfound != 1 } {
+ puts "Error: $file contains $nbfound status lines, expected 1"
+ }
+ }
+ }
+
+ _log_summarize $dir $log "Summary regenerated from logs at [clock format [clock seconds]]"
+ return
+}
+
+# Procedure to compare results of two runs of test cases
+help testdiff {
+ Compare results of two executions of tests (CPU times, ...)
+ Use: testdiff dir1 dir2 [groupname [gridname]] [options...]
+ Where dir1 and dir2 are directories containing logs of two test runs.
+ dir1 (A) should point to NEW tests results to be verified and dir2 (B) to REFERENCE results.
+ Allowed options are:
+ -image [filename]: compare only images and save its in specified file (default
+ name is <dir1>/diffimage-<dir2>.log)
+ -cpu [filename]: compare only CPU and save it in specified file (default
+ name is <dir1>/diffcpu-<dir2>.log)
+ -memory [filename]: compare only memory and save it in specified file (default
+ name is <dir1>/diffmemory-<dir2>.log)
+ -save filename: save resulting log in specified file (default name is
+ <dir1>/diff-<dir2>.log); HTML log is saved with same name
+ and extension .html
+ -status {same|ok|all}: filter cases for comparing by their status:
+ same - only cases with same status are compared (default)
+ ok - only cases with OK status in both logs are compared
+ all - results are compared regardless of status
+ -verbose level:
+ 1 - output only differences
+ 2 - output also list of logs and directories present in one of dirs only
+ 3 - (default) output also progress messages
+ -highlight_percent value: highlight considerable (>value in %) deviations
+ of CPU and memory (default value is 5%)
+}
+proc testdiff {dir1 dir2 args} {
+ if { "$dir1" == "$dir2" } {
+ error "Input directories are the same"
+ }
+
+ ######################################################
+ # check arguments
+ ######################################################
+
+ # treat options
+ set logfile [file join $dir1 "diff-[file tail $dir2].log"]
+ set logfile_image ""
+ set logfile_cpu ""
+ set logfile_memory ""
+ set image false
+ set cpu false
+ set memory false
+ set basename ""
+ set save false
+ set status "same"
+ set verbose 3
+ set highlight_percent 5
+ for {set narg 0} {$narg < [llength $args]} {incr narg} {
+ set arg [lindex $args $narg]
+ # log file name
+ if { $arg == "-save" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logfile [lindex $args $narg]
+ } else {
+ error "Error: Option -save must be followed by log file name"
+ }
+ set save true
+ continue
+ }
+
+ # image compared log
+ if { $arg == "-image" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logfile_image [lindex $args $narg]
+ } else {
+ set logfile_image [file join $dir1 "diffimage-[file tail $dir2].log"]
+ incr narg -1
+ }
+ set image true
+ continue
+ }
+
+ # CPU compared log
+ if { $arg == "-cpu" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logfile_cpu [lindex $args $narg]
+ } else {
+ set logfile_cpu [file join $dir1 "diffcpu-[file tail $dir2].log"]
+ incr narg -1
+ }
+ set cpu true
+ continue
+ }
+
+ # memory compared log
+ if { $arg == "-memory" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set logfile_memory [lindex $args $narg]
+ } else {
+ set logfile_memory [file join $dir1 "diffmemory-[file tail $dir2].log"]
+ incr narg -1
+ }
+ set memory true
+ continue
+ }
+
+ # status filter
+ if { $arg == "-status" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set status [lindex $args $narg]
+ } else {
+ set status ""
+ }
+ if { "$status" != "same" && "$status" != "all" && "$status" != "ok" } {
+ error "Error: Option -status must be followed by one of \"same\", \"all\", or \"ok\""
+ }
+ continue
+ }
+
+ # verbose level
+ if { $arg == "-verbose" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set verbose [expr [lindex $args $narg]]
+ } else {
+ error "Error: Option -verbose must be followed by integer verbose level"
+ }
+ continue
+ }
+
+ # highlight_percent
+ if { $arg == "-highlight_percent" } {
+ incr narg
+ if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
+ set highlight_percent [expr [lindex $args $narg]]
+ } else {
+ error "Error: Option -highlight_percent must be followed by integer value"
+ }
+ continue
+ }
+
+ if { [regexp {^-} $arg] } {
+ error "Error: unsupported option \"$arg\""
+ }
+
+ # non-option arguments form a subdirectory path
+ set basename [file join $basename $arg]
+ }
+
+ if {$image != false || $cpu != false || $memory != false} {
+ if {$save != false} {
+ error "Error: Option -save can not be used with image/cpu/memory options"
+ }
+ }
+
+ # run diff procedure (recursive)
+ _test_diff $dir1 $dir2 $basename $image $cpu $memory $status $verbose log log_image log_cpu log_memory
+
+ # save result to log file
+ if {$image == false && $cpu == false && $memory == false} {
+ if { "$logfile" != "" } {
+ _log_save $logfile [join $log "\n"]
+ _log_html_diff "[file rootname $logfile].html" $log $dir1 $dir2 ${highlight_percent}
+ puts "Log is saved to $logfile (and .html)"
+ }
+ } else {
+ foreach mode {image cpu memory} {
+ if {"[set logfile_${mode}]" != ""} {
+ _log_save "[set logfile_${mode}]" [join "[set log_${mode}]" "\n"]
+ _log_html_diff "[file rootname [set logfile_${mode}]].html" "[set log_${mode}]" $dir1 $dir2 ${highlight_percent}
+ puts "Log (${mode}) is saved to [set logfile_${mode}] (and .html)"
+ }
+ }
+ }
+ return
+}
+
+# Procedure to check data file before adding it to repository
+help testfile {
+ Checks specified data files for putting them into the test data files repository.
+
+ Use: testfile filelist
+
+ Will report if:
+ - data file (non-binary) is in DOS encoding (CR/LF)
+ - same data file (with same or another name) already exists in the repository
+ - another file with the same name already exists
+ Note that names are considered to be case-insensitive (for compatibility
+ with Windows).
+
+ Unless the file is already in the repository, tries to load it, reports
+ the recognized file format, file size, number of faces and edges in the
+ loaded shape (if any), information contained its triangulation, and makes
+ snapshot (in the temporary directory).
+
+ Finally it advises whether the file should be put to public section of the
+ repository.
+
+ Use: testfile -check
+
+ If "-check" is given as an argument, then procedure will check files already
+ located in the repository (for possible duplicates and for DOS encoding).
+}
+proc testfile {filelist} {
+ global env
+
+ # check that CSF_TestDataPath is defined
+ if { ! [info exists env(CSF_TestDataPath)] } {
+ error "Environment variable CSF_TestDataPath must be defined!"
+ }
+
+ set checkrepo f
+ if { "$filelist" == "-check" } { set checkrepo t }
+
+ # build registry of existing data files (name -> path) and (size -> path)
+ puts "Collecting info on test data files repository..."
+ foreach dir [_split_path $env(CSF_TestDataPath)] {
+ while {[llength $dir] != 0} {
+ set curr [lindex $dir 0]
+ set dir [lrange $dir 1 end]
+ eval lappend dir [glob -nocomplain -directory $curr -type d *]
+ foreach file [glob -nocomplain -directory $curr -type f *] {
+ set name [file tail $file]
+ set name_lower [string tolower $name]
+ set size [file size $file]
+
+ # check that the file is not in DOS encoding
+ if { $checkrepo } {
+ if { [_check_dos_encoding $file] } {
+ puts "Warning: file $file is in DOS encoding; was this intended?"
+ }
+ _check_file_format $file
+
+ # check if file with the same name is present twice or more
+ if { [info exists names($name_lower)] } {
+ puts "Error: more than one file with name $name is present in the repository:"
+ if { [_diff_files $file $names($name_lower)] } {
+ puts "(files are different by content)"
+ } else {
+ puts "(files are same by content)"
+ }
+ puts "--> $file"
+ puts "--> $names($name_lower)"
+ continue
+ }
+
+ # check if file with the same content exists
+ if { [info exists sizes($size)] } {
+ foreach other $sizes($size) {
+ if { ! [_diff_files $file $other] } {
+ puts "Warning: two files with the same content found:"
+ puts "--> $file"
+ puts "--> $other"
+ }
+ }
+ }
+ }
+
+ # add the file to the registry
+ lappend names($name_lower) $file
+ lappend sizes($size) $file
+ }
+ }
+ }
+ if { $checkrepo || [llength $filelist] <= 0 } { return }
+
+ # check the new files
+ set has_images f
+ puts "Checking new file(s)..."
+ foreach file $filelist {
+ set name [file tail $file]
+ set name_lower [string tolower $name]
+ set found f
+
+ # check for presence of the file with same name
+ if { [info exists names($name_lower)] } {
+ set found f
+ foreach other $names($name_lower) {
+ # avoid comparing the file with itself
+ if { [file normalize $file] == [file normalize $other] } {
+ continue
+ }
+ # compare content
+ if { [_diff_files $file $other] } {
+ puts "\n* $file: error\n name is already used by existing file\n --> $other"
+ } else {
+ puts "\n* $file: already present \n --> $other"
+ }
+ set found t
+ break
+ }
+ if { $found } { continue }
+ }
+
+ # get size of the file; if it is in DOS encoding and less than 1 MB,
+ # estimate also its size in UNIX encoding to be able to find same
+ # file if already present but in UNIX encoding
+ set sizeact [file size $file]
+ set sizeunx ""
+ set isdos [_check_dos_encoding $file]
+ if { $isdos && $sizeact < 10000000 } {
+ set fd [open $file r]
+ fconfigure $fd -translation crlf
+ set sizeunx [string length [read $fd]]
+ close $fd
+ }
+
+ # check if file with the same content exists
+ foreach size "$sizeact $sizeunx" {
+ if { [info exists sizes($size)] } {
+ foreach other $sizes($size) {
+ # avoid comparing the file with itself
+ if { [file normalize $file] == [file normalize $other] } {
+ continue
+ }
+ # compare content
+ if { ! [_diff_files $file $other] } {
+ puts "\n* $file: duplicate \n already present under name [file tail $other]\n --> $other"
+ set found t
+ break
+ }
+ }
+ if { $found } { break }
+ }
+ }
+ if { $found } { continue }
+
+ # file is not present yet, so to be analyzed
+ puts "\n* $file: new file"
+
+ # add the file to the registry as if it were added to the repository,
+ # to report possible duplicates among the currently processed files
+ lappend names($name_lower) $file
+ if { "$sizeunx" != "" } {
+ lappend sizes($sizeunx) $file
+ } else {
+ lappend sizes($sizeact) $file
+ }
+
+ # first of all, complain if it is in DOS encoding
+ if { $isdos } {
+ puts " Warning: DOS encoding detected, consider converting to"
+ puts " UNIX unless DOS line ends are needed for the test"
+ }
+
+ # try to read the file
+ set format [_check_file_format $file]
+ if { [catch {uplevel load_data_file $file $format a}] } {
+ puts " Warning: Cannot read as $format file"
+ continue
+ }
+
+ # warn if shape contains triangulation
+ pload MODELING
+ if { "$format" != "STL" &&
+ [regexp {([0-9]+)\s+triangles} [uplevel trinfo a] res nbtriangles] &&
+ $nbtriangles != 0 } {
+ puts " Warning: shape contains triangulation ($nbtriangles triangles),"
+ puts " consider removing them unless they are needed for the test!"
+ }
+
+ # get number of faces and edges
+ set edges 0
+ set faces 0
+ set nbs [uplevel nbshapes a]
+ regexp {EDGE[ \t:]*([0-9]+)} $nbs res edges
+ regexp {FACE[ \t:]*([0-9]+)} $nbs res faces
+
+ # classify; first check file size and number of faces and edges
+ if { $size < 95000 && $faces < 20 && $edges < 100 } {
+ set dir public
+ } else {
+ set dir private
+ }
+
+ # add stats
+ puts " $format size=[expr $size / 1024] KiB, nbfaces=$faces, nbedges=$edges -> $dir"
+
+ set tmpdir [_get_temp_dir]
+ file mkdir $tmpdir/$dir
+
+ # make snapshot
+ pload VISUALIZATION
+ uplevel vdisplay a
+ uplevel vsetdispmode 1
+ uplevel vfit
+ uplevel vzfit
+ uplevel vdump $tmpdir/$dir/[file rootname [file tail $file]].png
+ set has_images t
+ }
+ if { $has_images } {
+ puts "Snapshots are saved in subdirectory [_get_temp_dir]"
+ }
+}
+
+# Procedure to locate data file for test given its name.
+# The search is performed assuming that the function is called
+# from the test case script; the search order is:
+# - subdirectory "data" of the test script (grid) folder
+# - subdirectories in environment variable CSF_TestDataPath
+# - subdirectory set by datadir command
+# If file is not found, raises Tcl error.
+proc locate_data_file {filename} {
+ global env groupname gridname casename
+
+ # check if the file is located in the subdirectory data of the script dir
+ set scriptfile [info script]
+ if { "$scriptfile" != "" } {
+ set path [file join [file dirname "$scriptfile"] data "$filename"]
+ if { [file exists "$path"] } {
+ return [file normalize "$path"]
+ }
+ }
+
+ # check sub-directories in paths indicated by CSF_TestDataPath
+ if { [info exists env(CSF_TestDataPath)] } {
+ foreach dir [_split_path $env(CSF_TestDataPath)] {
+ set dir [list "$dir"]
+ while {[llength "$dir"] != 0} {
+ set name [lindex "$dir" 0]
+ set dir [lrange "$dir" 1 end]
+
+ # skip directories starting with dot
+ set aTail [file tail "$name"]
+ if { [regexp {^[.]} "$aTail"] } { continue }
+ if { [file exists "$name/$filename"] } {
+ return [file normalize "$name/$filename"]
+ }
+ eval lappend dir [glob -nocomplain -directory "$name" -type d *]
+ }
+ }
+ }
+
+ # check current datadir
+ if { [file exists "[uplevel datadir]/$filename"] } {
+ return [file normalize "[uplevel datadir]/$filename"]
+ }
+
+ # raise error
+ error [join [list "File $filename could not be found" \
+ "(should be in paths indicated by CSF_TestDataPath environment variable, " \
+ "or in subfolder data in the script directory)"] "\n"]
+}
+
+# Internal procedure to find test case indicated by group, grid, and test case names;
+# returns:
+# - dir: path to the base directory of the tests group
+# - gridname: actual name of the grid
+# - casefile: path to the test case script
+# if no such test is found, raises error with appropriate message
+proc _get_test {group grid casename _dir _gridname _casefile} {
+ upvar $_dir dir
+ upvar $_gridname gridname
+ upvar $_casefile casefile
+
+ global env
+
+ # check that environment variable defining paths to test scripts is defined
+ if { ! [info exists env(CSF_TestScriptsPath)] ||
+ [llength $env(CSF_TestScriptsPath)] <= 0 } {
+ error "Error: Environment variable CSF_TestScriptsPath is not defined"
+ }
+
+ # iterate by all script paths
+ foreach dir [_split_path $env(CSF_TestScriptsPath)] {
+ # protection against empty paths
+ set dir [string trim $dir]
+ if { $dir == "" } { continue }
+
+ # check that directory exists
+ if { ! [file isdirectory $dir] } {
+ puts "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped"
+ continue
+ }
+
+ # check if test group with given name exists in this dir
+ # if not, continue to the next test dir
+ if { ! [file isdirectory $dir/$group] } { continue }
+
+ # check that grid with given name (possibly alias) exists; stop otherwise
+ set gridname $grid
+ if { ! [file isdirectory $dir/$group/$gridname] } {
+ # check if grid is named by alias rather than by actual name
+ if { [file exists $dir/$group/grids.list] } {
+ set fd [open $dir/$group/grids.list]
+ while { [gets $fd line] >= 0 } {
+ if { [regexp "\[ \t\]*\#.*" $line] } { continue }
+ if { [regexp "^$grid\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridname] } {
+ break
+ }
+ }
+ close $fd
+ }
+ }
+ if { ! [file isdirectory $dir/$group/$gridname] } { continue }
+
+ # get actual file name of the script; stop if it cannot be found
+ set casefile $dir/$group/$gridname/$casename
+ if { ! [file exists $casefile] } {
+ # check if this grid is aliased to another one
+ if { [file exists $dir/$group/$gridname/cases.list] } {
+ set fd [open $dir/$group/$gridname/cases.list]
+ if { [gets $fd line] >= 0 } {
+ set casefile [file normalize $dir/$group/$gridname/[string trim $line]/$casename]
+ }
+ close $fd
+ }
+ }
+ if { [file exists $casefile] } {
+ # normal return
+ return
+ }
+ }
+
+ # coming here means specified test is not found; report error
+ error [join [list "Error: test case $group / $grid / $casename is not found in paths listed in variable" \
+ "CSF_TestScriptsPath (current value is \"$env(CSF_TestScriptsPath)\")"] "\n"]
+}
+
+# Internal procedure to run test case indicated by base directory,
+# grid and grid names, and test case file path.
+# The log can be obtained by command "dlog get".
+proc _run_test {scriptsdir group gridname casefile echo} {
+ global env
+
+ # start timer
+ uplevel dchrono _timer reset
+ uplevel dchrono _timer start
+ catch {uplevel meminfo h} membase
+
+ # enable commands logging; switch to old-style mode if dlog command is not present
+ set dlog_exists 1
+ if { [catch {dlog reset}] } {
+ set dlog_exists 0
+ } elseif { $echo } {
+ decho on
+ } else {
+ dlog reset
+ dlog on
+ rename puts puts-saved
+ proc puts args {
+ global _tests_verbose
+
+ # log only output to stdout and stderr, not to file!
+ if {[llength $args] > 1} {
+ set optarg [lindex $args end-1]
+ if { $optarg == "stdout" || $optarg == "stderr" || $optarg == "-newline" } {
+ dlog add [lindex $args end]
+ } else {
+ eval puts-saved $args
+ }
+ } else {
+ dlog add [lindex $args end]
+ }
+ }
+ }
+
+ # evaluate test case
+ set tmp_imagedir 0
+ if [catch {
+ # set variables identifying test case
+ uplevel set casename [file tail $casefile]
+ uplevel set groupname $group
+ uplevel set gridname $gridname
+ uplevel set dirname $scriptsdir
+
+ # set path for saving of log and images (if not yet set) to temp dir
+ if { ! [uplevel info exists imagedir] } {
+ uplevel set test_image \$casename
+
+ # create subdirectory in temp named after group and grid with timestamp
+ set rootlogdir [_get_temp_dir]
+
+ set imagedir "${group}-${gridname}-${::casename}-[clock format [clock seconds] -format {%Y-%m-%dT%Hh%Mm%Ss}]"
+ set imagedir [file normalize ${rootlogdir}/$imagedir]
+
+ if { [catch {file mkdir $imagedir}] || ! [file writable $imagedir] ||
+ ! [catch {glob -directory $imagedir *}] } {
+ # puts "Warning: Cannot create directory \"$imagedir\", or it is not empty; \"${rootlogdir}\" is used"
+ set imagedir $rootlogdir
+ }
+
+ uplevel set imagedir \"$imagedir\"
+ set tmp_imagedir 1
+ }
+
+ # execute test scripts
+ if { [file exists $scriptsdir/$group/begin] } {
+ puts "Executing $scriptsdir/$group/begin..."; flush stdout
+ uplevel source -encoding utf-8 $scriptsdir/$group/begin
+ }
+ if { [file exists $scriptsdir/$group/$gridname/begin] } {
+ puts "Executing $scriptsdir/$group/$gridname/begin..."; flush stdout
+ uplevel source -encoding utf-8 $scriptsdir/$group/$gridname/begin
+ }
+
+ puts "Executing $casefile..."; flush stdout
+ uplevel source -encoding utf-8 $casefile
+
+ if { [file exists $scriptsdir/$group/$gridname/end] } {
+ puts "Executing $scriptsdir/$group/$gridname/end..."; flush stdout
+ uplevel source -encoding utf-8 $scriptsdir/$group/$gridname/end
+ }
+ if { [file exists $scriptsdir/$group/end] } {
+ puts "Executing $scriptsdir/$group/end..."; flush stdout
+ uplevel source -encoding utf-8 $scriptsdir/$group/end
+ }
+ } res] {
+ if { "$res" == "" } { set res "EMPTY" }
+ # in echo mode, output error message using dputs command to have it colored,
+ # note that doing the same in logged mode would duplicate the message
+ if { ! $dlog_exists || ! $echo } {
+ puts "Tcl Exception: $res"
+ } else {
+ decho off
+ dputs -red -intense "Tcl Exception: $res"
+ }
+ }
+
+ # stop logging
+ if { $dlog_exists } {
+ if { $echo } {
+ decho off
+ } else {
+ rename puts {}
+ rename puts-saved puts
+ dlog off
+ }
+ }
+
+ # stop cpulimit killer if armed by the test
+ cpulimit
+
+ # add memory and timing info
+ set stats ""
+ if { ! [catch {uplevel meminfo h} memuse] } {
+ append stats "MEMORY DELTA: [expr ($memuse - $membase) / 1024] KiB\n"
+ }
+ uplevel dchrono _timer stop
+ set cpu_usr [uplevel dchrono _timer -userCPU]
+ set elps [uplevel dchrono _timer -elapsed]
+ append stats "TOTAL CPU TIME: $cpu_usr sec\n"
+ append stats "ELAPSED TIME: $elps sec\n"
+ if { $dlog_exists && ! $echo } {
+ dlog add $stats
+ } else {
+ puts $stats
+ }
+
+ # unset global vars
+ uplevel unset casename groupname gridname dirname
+ if { $tmp_imagedir } { uplevel unset imagedir test_image }
+}
+
+# Internal procedure to check log of test execution and decide if it passed or failed
+proc _check_log {dir group gridname casename errors log {_summary {}} {_html_log {}}} {
+ global env
+ if { $_summary != "" } { upvar $_summary summary }
+ if { $_html_log != "" } { upvar $_html_log html_log }
+ set summary {}
+ set html_log {}
+ set errors_log {}
+
+ if [catch {
+
+ # load definition of 'bad words' indicating test failure
+ # note that rules are loaded in the order of decreasing priority (grid - group - common),
+ # thus grid rules will override group ones
+ set badwords {}
+ foreach rulesfile [list $dir/$group/$gridname/parse.rules $dir/$group/parse.rules $dir/parse.rules] {
+ if [catch {set fd [open $rulesfile r]}] { continue }
+ while { [gets $fd line] >= 0 } {
+ # skip comments and empty lines
+ if { [regexp "\[ \t\]*\#.*" $line] } { continue }
+ if { [string trim $line] == "" } { continue }
+ # extract regexp
+ if { ! [regexp {^([^/]*)/([^/]*)/(.*)$} $line res status rexp comment] } {
+ puts "Warning: cannot recognize parsing rule \"$line\" in file $rulesfile"
+ continue
+ }
+ set status [string trim $status]
+ if { $comment != "" } { append status " ([string trim $comment])" }
+ set rexp [regsub -all {\\b} $rexp {\\y}] ;# convert regexp from Perl to Tcl style
+ lappend badwords [list $status $rexp]
+ }
+ close $fd
+ }
+ if { [llength $badwords] <= 0 } {
+ puts "Warning: no definition of error indicators found (check files parse.rules)"
+ }
+
+ # analyse log line-by-line
+ set todos {} ;# TODO statements
+ set requs {} ;# REQUIRED statements
+ set todo_incomplete -1
+ set status ""
+ foreach line [split $log "\n"] {
+ # check if line defines specific treatment of some messages
+ if [regexp -nocase {^[ \s]*TODO ([^:]*):(.*)$} $line res platforms pattern] {
+ if { ! [regexp -nocase {\mAll\M} $platforms] &&
+ ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
+ lappend html_log [_html_highlight IGNORE $line]
+ continue ;# TODO statement is for another platform
+ }
+
+ # record TODOs that mark unstable cases
+ if { [regexp {[\?]} $platforms] } {
+ set todos_unstable([llength $todos]) 1
+ }
+
+ # convert legacy regexps from Perl to Tcl style
+ set pattern [regsub -all {\\b} [string trim $pattern] {\\y}]
+
+ # special case: TODO TEST INCOMPLETE
+ if { [string trim $pattern] == "TEST INCOMPLETE" } {
+ set todo_incomplete [llength $todos]
+ }
+
+ lappend todos [list $pattern [llength $html_log] $line]
+ lappend html_log [_html_highlight BAD $line]
+ continue
+ }
+ if [regexp -nocase {^[ \s]*REQUIRED ([^:]*):[ \s]*(.*)$} $line res platforms pattern] {
+ if { ! [regexp -nocase {\mAll\M} $platforms] &&
+ ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
+ lappend html_log [_html_highlight IGNORE $line]
+ continue ;# REQUIRED statement is for another platform
+ }
+ lappend requs [list $pattern [llength $html_log] $line]
+ lappend html_log [_html_highlight OK $line]
+ continue
+ }
+
+ # check for presence of required messages
+ set ismarked 0
+ for {set i 0} {$i < [llength $requs]} {incr i} {
+ set pattern [lindex $requs $i 0]
+ if { [regexp $pattern $line] } {
+ incr required_count($i)
+ lappend html_log [_html_highlight OK $line]
+ set ismarked 1
+ continue
+ }
+ }
+ if { $ismarked } {
+ continue
+ }
+
+ # check for presence of messages indicating test result
+ foreach bw $badwords {
+ if { [regexp [lindex $bw 1] $line] } {
+ # check if this is known bad case
+ set is_known 0
+ for {set i 0} {$i < [llength $todos]} {incr i} {
+ set pattern [lindex $todos $i 0]
+ if { [regexp $pattern $line] } {
+ set is_known 1
+ incr todo_count($i)
+ lappend html_log [_html_highlight BAD $line]
+ break
+ }
+ }
+
+ # if it is not in todo, define status
+ if { ! $is_known } {
+ set stat [lindex $bw 0 0]
+ if {$errors} {
+ lappend errors_log $line
+ }
+ lappend html_log [_html_highlight $stat $line]
+ if { $status == "" && $stat != "OK" && ! [regexp -nocase {^IGNOR} $stat] } {
+ set status [lindex $bw 0]
+ }
+ }
+ set ismarked 1
+ break
+ }
+ }
+ if { ! $ismarked } {
+ lappend html_log $line
+ }
+ }
+
+ # check for presence of TEST COMPLETED statement
+ if { $status == "" && ! [regexp {TEST COMPLETED} $log] } {
+ # check whether absence of TEST COMPLETED is known problem
+ if { $todo_incomplete >= 0 } {
+ incr todo_count($todo_incomplete)
+ } else {
+ set status "FAILED (no final message is found)"
+ }
+ }
+
+ # report test as failed if it doesn't contain required pattern
+ if { $status == "" } {
+ for {set i 0} {$i < [llength $requs]} {incr i} {
+ if { ! [info exists required_count($i)] } {
+ set linenum [lindex $requs $i 1]
+ set html_log [lreplace $html_log $linenum $linenum [_html_highlight FAILED [lindex $requs $i 2]]]
+ set status "FAILED (REQUIRED statement no. [expr $i + 1] is not found)"
+ }
+ }
+ }
+
+ # check declared bad cases and diagnose possible improvement
+ # (bad case declared but not detected).
+ # Note that absence of the problem marked by TODO with question mark
+ # (unstable) is not reported as improvement.
+ if { $status == "" } {
+ for {set i 0} {$i < [llength $todos]} {incr i} {
+ if { ! [info exists todos_unstable($i)] &&
+ (! [info exists todo_count($i)] || $todo_count($i) <= 0) } {
+ set linenum [lindex $todos $i 1]
+ set html_log [lreplace $html_log $linenum $linenum [_html_highlight IMPROVEMENT [lindex $todos $i 2]]]
+ set status "IMPROVEMENT (expected problem TODO no. [expr $i + 1] is not detected)"
+ break;
+ }
+ }
+ }
+
+ # report test as known bad if at least one of expected problems is found
+ if { $status == "" && [llength [array names todo_count]] > 0 } {
+ set status "BAD (known problem)"
+ }
+
+ # report normal OK
+ if { $status == "" } {set status "OK" }
+
+ } res] {
+ set status "FAILED ($res)"
+ }
+
+ # put final message
+ _log_and_puts summary "CASE $group $gridname $casename: $status"
+ set summary [join $summary "\n"]
+ if {$errors} {
+ foreach error $errors_log {
+ _log_and_puts summary " $error"
+ }
+ }
+ set html_log "[_html_highlight [lindex $status 0] $summary]\n[join $html_log \n]"
+}
+
+# Auxiliary procedure putting message to both cout and log variable (list)
+proc _log_and_puts {logvar message} {
+ if { $logvar != "" } {
+ upvar $logvar log
+ lappend log $message
+ }
+ puts $message
+}
+
+# Auxiliary procedure to log result on single test case
+proc _log_test_case {output logdir dir group grid casename logvar} {
+ upvar $logvar log
+ set show_errors 0
+
+ # check result and make HTML log
+ _check_log $dir $group $grid $casename $show_errors $output summary html_log
+ lappend log $summary
+
+ # save log to file
+ if { $logdir != "" } {
+ _log_html $logdir/$group/$grid/$casename.html $html_log "Test $group $grid $casename"
+ _log_save $logdir/$group/$grid/$casename.log "$output\n$summary" "Test $group $grid $casename"
+ }
+
+ # remove intermediate command file used to run test
+ if { [file exists $logdir/$group/$grid/${casename}.tcl] } {
+ file delete $logdir/$group/$grid/${casename}.tcl
+ }
+}
+
+# Auxiliary procedure to save log to file
+proc _log_save {file log {title {}}} {
+ # create missing directories as needed
+ catch {file mkdir [file dirname $file]}
+
+ # try to open a file
+ if [catch {set fd [open $file w]} res] {
+ error "Error saving log file $file: $res"
+ }
+
+ # dump log and close
+ puts $fd "$title\n"
+ puts $fd $log
+ close $fd
+ return
+}
+
+# Auxiliary procedure to make a (relative if possible) URL to a file for
+# inclusion a reference in HTML log
+proc _make_url {htmldir file} {
+ set htmlpath [file split [file normalize $htmldir]]
+ set filepath [file split [file normalize $file]]
+ for {set i 0} {$i < [llength $htmlpath]} {incr i} {
+ if { "[lindex $htmlpath $i]" != "[lindex $filepath $i]" } {
+ if { $i == 0 } { break }
+ return "[string repeat "../" [expr [llength $htmlpath] - $i - 1]][eval file join [lrange $filepath $i end]]"
+ }
+ }
+
+ # if relative path could not be made, return full file URL
+ return "file://[file normalize $file]"
+}
+
+# Auxiliary procedure to save log to file
+proc _log_html {file log {title {}}} {
+ # create missing directories as needed
+ catch {file mkdir [file dirname $file]}
+
+ # try to open a file
+ if [catch {set fd [open $file w]} res] {
+ error "Error saving log file $file: $res"
+ }
+
+ # print header
+ puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
+ puts $fd "<title>$title</title></head><body><h1>$title</h1>"
+
+ # add images if present; these should have either PNG, GIF, or JPG extension,
+ # and start with name of the test script, with optional suffix separated
+ # by underscore or dash
+ set imgbasename [file rootname [file tail $file]]
+ foreach img [lsort [glob -nocomplain -directory [file dirname $file] -tails \
+ ${imgbasename}.gif ${imgbasename}.png ${imgbasename}.jpg \
+ ${imgbasename}_*.gif ${imgbasename}_*.png ${imgbasename}_*.jpg \
+ ${imgbasename}-*.gif ${imgbasename}-*.png ${imgbasename}-*.jpg]] {
+ puts $fd "<p>[file tail $img]<br><img src=\"$img\"/><p>"
+ }
+
+ # print log body, trying to add HTML links to script files on lines like
+ # "Executing <filename>..."
+ puts $fd "<pre>"
+ foreach line [split $log "\n"] {
+ if { [regexp {Executing[ \t]+([a-zA-Z0-9._/:-]+[^.])} $line res script] &&
+ [file exists $script] } {
+ set line [regsub $script $line "<a href=\"[_make_url $file $script]\">$script</a>"]
+ }
+ puts $fd $line
+ }
+ puts $fd "</pre></body></html>"
+
+ close $fd
+ return
+}
+
+# Auxiliary method to make text with HTML highlighting according to status
+proc _html_color {status} {
+ # choose a color for the cell according to result
+ if { $status == "OK" } {
+ return lightgreen
+ } elseif { [regexp -nocase {^FAIL} $status] } {
+ return ff8080
+ } elseif { [regexp -nocase {^BAD} $status] } {
+ return yellow
+ } elseif { [regexp -nocase {^IMP} $status] } {
+ return orange
+ } elseif { [regexp -nocase {^SKIP} $status] } {
+ return gray
+ } elseif { [regexp -nocase {^IGNOR} $status] } {
+ return gray
+ } else {
+ puts "Warning: no color defined for status $status, using red as if FAILED"
+ return red
+ }
+}
+
+# Format text line in HTML to be colored according to the status
+proc _html_highlight {status line} {
+ return "<table><tr><td bgcolor=\"[_html_color $status]\">$line</td></tr></table>"
+}
+
+# Internal procedure to generate HTML page presenting log of the tests
+# execution in tabular form, with links to reports on individual cases
+proc _log_html_summary {logdir log totals regressions improvements skipped total_time} {
+ global _test_case_regexp
+
+ # create missing directories as needed
+ file mkdir $logdir
+
+ # try to open a file and start HTML
+ if [catch {set fd [open $logdir/summary.html w]} res] {
+ error "Error creating log file: $res"
+ }
+
+ # write HRML header, including command to refresh log if still in progress
+ puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
+ puts $fd "<title>Tests summary</title>"
+ if { $total_time == "" } {
+ puts $fd "<meta http-equiv=\"refresh\" content=\"10\">"
+ }
+ puts $fd "<meta http-equiv=\"pragma\" content=\"NO-CACHE\">"
+ puts $fd "</head><body>"
+
+ # put summary
+ set legend(OK) "Test passed OK"
+ set legend(FAILED) "Test failed (regression)"
+ set legend(BAD) "Known problem"
+ set legend(IMPROVEMENT) "Possible improvement (expected problem not detected)"
+ set legend(SKIPPED) "Test skipped due to lack of data file"
+ puts $fd "<h1>Summary</h1><table>"
+ foreach nbstat $totals {
+ set status [lindex $nbstat 1]
+ if { [info exists legend($status)] } {
+ set comment $legend($status)
+ } else {
+ set comment "User-defined status"
+ }
+ puts $fd "<tr><td align=\"right\">[lindex $nbstat 0]</td><td bgcolor=\"[_html_color $status]\">$status</td><td>$comment</td></tr>"
+ }
+ puts $fd "</table>"
+
+ # time stamp and elapsed time info
+ puts $fd "<p>Generated on [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}] on [info hostname]\n<p>"
+ if { $total_time != "" } {
+ puts $fd [join [split $total_time "\n"] "<p>"]
+ } else {
+ puts $fd "<p>NOTE: This is intermediate summary; the tests are still running! This page will refresh automatically until tests are finished."
+ }
+
+ # print regressions and improvements
+ foreach featured [list $regressions $improvements $skipped] {
+ if { [llength $featured] <= 1 } { continue }
+ set status [string trim [lindex $featured 0] { :}]
+ puts $fd "<h2>$status</h2>"
+ puts $fd "<table>"
+ set groupgrid ""
+ foreach test [lrange $featured 1 end] {
+ if { ! [regexp {^(.*)\s+([\w\-.]+)$} $test res gg name] } {
+ set gg UNKNOWN
+ set name "Error building short list; check details"
+ }
+ if { $gg != $groupgrid } {
+ if { $groupgrid != "" } { puts $fd "</tr>" }
+ set groupgrid $gg
+ puts $fd "<tr><td>$gg</td>"
+ }
+ puts $fd "<td bgcolor=\"[_html_color $status]\"><a href=\"[regsub -all { } $gg /]/${name}.html\">$name</a></td>"
+ }
+ if { $groupgrid != "" } { puts $fd "</tr>" }
+ puts $fd "</table>"
+ }
+
+ # put detailed log with TOC
+ puts $fd "<hr><h1>Details</h1>"
+ puts $fd "<div style=\"float:right; padding: 10px; border-style: solid; border-color: blue; border-width: 2px;\">"
+
+ # process log line-by-line
+ set group {}
+ set letter {}
+ set body {}
+ foreach line [lsort -dictionary $log] {
+ # check that the line is case report in the form "CASE group grid name: result (explanation)"
+ if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } {
+ continue
+ }
+
+ # start new group
+ if { $grp != $group } {
+ if { $letter != "" } { lappend body "</tr></table>" }
+ set letter {}
+ set group $grp
+ set grid {}
+ puts $fd "<a href=\"#$group\">$group</a><br>"
+ lappend body "<h2><a name=\"$group\">Group $group</a></h2>"
+ }
+
+ # start new grid
+ if { $grd != $grid } {
+ if { $letter != "" } { lappend body "</tr></table>" }
+ set letter {}
+ set grid $grd
+ puts $fd " <a href=\"#$group-$grid\">$grid</a><br>"
+ lappend body "<h2><a name=\"$group-$grid\">Grid $group $grid</a></h2>"
+ }
+
+ # check if test case name is <letter><digit>;
+ # if not, set alnum to period "." to recognize non-standard test name
+ if { ! [regexp {\A([A-Za-z]{1,2})([0-9]{1,2})\Z} $casename res alnum number] &&
+ ! [regexp {\A([A-Za-z0-9]+)_([0-9]+)\Z} $casename res alnum number] } {
+ set alnum $casename
+ }
+
+ # start new row when letter changes or for non-standard names
+ if { $alnum != $letter || $alnum == "." } {
+ if { $letter != "" } {
+ lappend body "</tr><tr>"
+ } else {
+ lappend body "<table><tr>"
+ }
+ set letter $alnum
+ }
+
+ lappend body "<td bgcolor=\"[_html_color $result]\"><a href=\"$group/$grid/${casename}.html\">$casename</a></td>"
+ }
+ puts $fd "</div>\n[join $body "\n"]</tr></table>"
+
+ # add remaining lines of log as plain text
+ puts $fd "<h2>Plain text messages</h2>\n<pre>"
+ foreach line $log {
+ if { ! [regexp $_test_case_regexp $line] } {
+ puts $fd "$line"
+ }
+ }
+ puts $fd "</pre>"
+
+ # close file and exit
+ puts $fd "</body>"
+ close $fd
+ return
+}
+
+# Procedure to dump summary logs of tests
+proc _log_summarize {logdir log {total_time {}}} {
+
+ # sort log records alphabetically to have the same behavior on Linux and Windows
+ # (also needed if tests are run in parallel)
+ set loglist [lsort -dictionary $log]
+
+ # classify test cases by status
+ foreach line $loglist {
+ if { [regexp {^CASE ([^:]*): ([[:alnum:]]+).*$} $line res caseid status] } {
+ lappend stat($status) $caseid
+ }
+ }
+ set totals {}
+ set improvements {Improvements:}
+ set regressions {Failed:}
+ set skipped {Skipped:}
+ if { [info exists stat] } {
+ foreach status [lsort [array names stat]] {
+ lappend totals [list [llength $stat($status)] $status]
+
+ # separately count improvements (status starting with IMP), skipped (status starting with SKIP) and regressions (all except IMP, OK, BAD, and SKIP)
+ if { [regexp -nocase {^IMP} $status] } {
+ eval lappend improvements $stat($status)
+ } elseif { [regexp -nocase {^SKIP} $status] } {
+ eval lappend skipped $stat($status)
+ } elseif { $status != "OK" && ! [regexp -nocase {^BAD} $status] && ! [regexp -nocase {^SKIP} $status] } {
+ eval lappend regressions $stat($status)
+ }
+ }
+ }
+
+ # if time is specified, add totals
+ if { $total_time != "" } {
+ if { [llength $improvements] > 1 } {
+ _log_and_puts log [join $improvements "\n "]
+ }
+ if { [llength $regressions] > 1 } {
+ _log_and_puts log [join $regressions "\n "]
+ }
+ if { [llength $skipped] > 1 } {
+ _log_and_puts log [join $skipped "\n "]
+ }
+ if { [llength $improvements] == 1 && [llength $regressions] == 1 } {
+ _log_and_puts log "No regressions"
+ }
+ _log_and_puts log "Total cases: [join $totals {, }]"
+ _log_and_puts log $total_time
+ }
+
+ # save log to files
+ if { $logdir != "" } {
+ _log_html_summary $logdir $log $totals $regressions $improvements $skipped $total_time
+ _log_save $logdir/tests.log [join $log "\n"] "Tests summary"
+ }
+
+ return
+}
+
+# Internal procedure to generate XML log in JUnit style, for further
+# consumption by Jenkins or similar systems.
+#
+# The output is intended to conform to XML schema supported by Jenkins found at
+# https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd
+#
+# The mapping of the fields is inspired by annotated schema of Apache Ant JUnit XML format found at
+# http://windyroad.org/dl/Open%20Source/JUnit.xsd
+proc _log_xml_summary {logdir filename log include_cout} {
+ global _test_case_regexp
+
+ catch {file mkdir [file dirname $filename]}
+
+ # try to open a file and start XML
+ if [catch {set fd [open $filename w]} res] {
+ error "Error creating XML summary file $filename: $res"
+ }
+ puts $fd "<?xml version='1.0' encoding='utf-8'?>"
+ puts $fd "<testsuites>"
+
+ # prototype for command to generate test suite tag
+ set time_and_host "timestamp=\"[clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%S}]\" hostname=\"[info hostname]\""
+ set cmd_testsuite {puts $fd "<testsuite name=\"$group $grid\" tests=\"$nbtests\" failures=\"$nbfail\" errors=\"$nberr\" time=\"$time\" skipped=\"$nbskip\" $time_and_host>\n$testcases\n</testsuite>\n"}
+
+ # sort log and process it line-by-line
+ set group {}
+ foreach line [lsort -dictionary $log] {
+ # check that the line is case report in the form "CASE group grid name: result (explanation)"
+ if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } {
+ continue
+ }
+ set message [string trim $message " \t\r\n()"]
+
+ # start new testsuite for each grid
+ if { $grp != $group || $grd != $grid } {
+
+ # write previous test suite
+ if [info exists testcases] { eval $cmd_testsuite }
+
+ set testcases {}
+ set nbtests 0
+ set nberr 0
+ set nbfail 0
+ set nbskip 0
+ set time 0.
+
+ set group $grp
+ set grid $grd
+ }
+
+ incr nbtests
+
+ # parse test log and get its CPU time
+ set testout {}
+ set add_cpu {}
+ if { [catch {set fdlog [open $logdir/$group/$grid/${casename}.log r]} ret] } {
+ puts "Error: cannot open $logdir/$group/$grid/${casename}.log: $ret"
+ } else {
+ while { [gets $fdlog logline] >= 0 } {
+ if { $include_cout } {
+ append testout "$logline\n"
+ }
+ if [regexp -nocase {TOTAL CPU TIME:\s*([\d.]+)\s*sec} $logline res cpu] {
+ set add_cpu " time=\"$cpu\""
+ set time [expr $time + $cpu]
+ }
+ }
+ close $fdlog
+ }
+ if { ! $include_cout } {
+ set testout "$line\n"
+ }
+
+ # record test case with its output and status
+ # Mapping is: SKIPPED, BAD, and OK to OK, all other to failure
+ append testcases "\n <testcase name=\"$casename\"$add_cpu status=\"$result\">\n"
+ append testcases "\n <system-out>\n$testout </system-out>"
+ if { $result != "OK" } {
+ if { [regexp -nocase {^SKIP} $result] } {
+ incr nberr
+ append testcases "\n <error name=\"$result\" message=\"$message\"/>"
+ } elseif { [regexp -nocase {^BAD} $result] } {
+ incr nbskip
+ append testcases "\n <skipped>$message</skipped>"
+ } else {
+ incr nbfail
+ append testcases "\n <failure name=\"$result\" message=\"$message\"/>"
+ }
+ }
+ append testcases "\n </testcase>"
+ }
+
+ # write last test suite
+ if [info exists testcases] { eval $cmd_testsuite }
+
+ # the end
+ puts $fd "</testsuites>"
+ close $fd
+ return
+}
+
+# Auxiliary procedure to split path specification (usually defined by
+# environment variable) into list of directories or files
+proc _split_path {pathspec} {
+ global tcl_platform
+
+ # first replace all \ (which might occur on Windows) by /
+ regsub -all "\\\\" $pathspec "/" pathspec
+
+ # split path by platform-specific separator
+ return [split $pathspec [_path_separator]]
+}
+
+# Auxiliary procedure to define platform-specific separator for directories in
+# path specification
+proc _path_separator {} {
+ global tcl_platform
+
+ # split path by platform-specific separator
+ if { $tcl_platform(platform) == "windows" } {
+ return ";"
+ } else {
+ return ":"
+ }
+}
+
+# Procedure to make a diff and common of two lists
+proc _list_diff {list1 list2 _in1 _in2 _common} {
+ upvar $_in1 in1
+ upvar $_in2 in2
+ upvar $_common common
+
+ set in1 {}
+ set in2 {}
+ set common {}
+ foreach item $list1 {
+ if { [lsearch -exact $list2 $item] >= 0 } {
+ lappend common $item
+ } else {
+ lappend in1 $item
+ }
+ }
+ foreach item $list2 {
+ if { [lsearch -exact $common $item] < 0 } {
+ lappend in2 $item
+ }
+ }
+ return
+}
+
+# procedure to load a file to Tcl string
+proc _read_file {filename} {
+ set fd [open $filename r]
+ set result [read -nonewline $fd]
+ close $fd
+ return $result
+}
+
+# procedure to construct name for the mage diff file
+proc _diff_img_name {dir1 dir2 casepath imgfile} {
+ return [file join $dir1 $casepath "diff-[file tail $dir2]-$imgfile"]
+}
+
+# auxiliary procedure to produce string comparing two values
+proc _diff_show_ratio {value1 value2} {
+ if {[expr double ($value2)] == 0.} {
+ return "$value1 / $value2"
+ } else {
+ return "$value1 / $value2 \[[format "%+5.2f%%" [expr 100 * ($value1 - $value2) / double($value2)]]\]"
+ }
+}
+
+# auxiliary procedure to produce string comparing two values, where first value is a portion of second
+proc _diff_show_positive_ratio {value1 value2} {
+ if {[expr double ($value2)] == 0.} {
+ return "$value1 / $value2"
+ } else {
+ return "$value1 / $value2 \[[format "%4.2f%%" [expr 100 * double($value1) / double($value2)]]\]"
+ }
+}
+
+# procedure to check cpu user time
+proc _check_time {regexp_msg} {
+ upvar log log
+ upvar log1 log1
+ upvar log2 log2
+ upvar log_cpu log_cpu
+ upvar cpu cpu
+ upvar basename basename
+ upvar casename casename
+ set time1_list [dict create]
+ set time2_list [dict create]
+ set cpu_find UNDEFINED
+
+ foreach line1 [split $log1 "\n"] {
+ if { [regexp "${regexp_msg}" $line1 dump chronometer_name cpu_find] } {
+ dict set time1_list "${chronometer_name}" "${cpu_find}"
+ }
+ }
+
+ foreach line2 [split $log2 "\n"] {
+ if { [regexp "${regexp_msg}" $line2 dump chronometer_name cpu_find] } {
+ dict set time2_list "${chronometer_name}" "${cpu_find}"
+ }
+ }
+
+ if { [llength [dict keys $time1_list]] != [llength [dict keys $time2_list]] } {
+ puts "Error: number of dchrono/chrono COUNTER are different in the same test cases"
+ } else {
+ foreach key [dict keys $time1_list] {
+ set time1 [dict get $time1_list $key]
+ set time2 [dict get $time2_list $key]
+
+ # compare CPU user time with 10% precision (but not less 0.5 sec)
+ if { [expr abs ($time1 - $time2) > 0.5 + 0.05 * abs ($time1 + $time2)] } {
+ if {$cpu != false} {
+ _log_and_puts log_cpu "COUNTER $key: [split $basename /] $casename: [_diff_show_ratio $time1 $time2]"
+ } else {
+ _log_and_puts log "COUNTER $key: [split $basename /] $casename: [_diff_show_ratio $time1 $time2]"
+ }
+ }
+ }
+ }
+}
+
+# Procedure to compare results of two runs of test cases
+proc _test_diff {dir1 dir2 basename image cpu memory status verbose _logvar _logimage _logcpu _logmemory {_statvar ""}} {
+ upvar $_logvar log
+ upvar $_logimage log_image
+ upvar $_logcpu log_cpu
+ upvar $_logmemory log_memory
+
+ # make sure to load diffimage command
+ uplevel pload VISUALIZATION
+
+ # prepare variable (array) for collecting statistics
+ if { "$_statvar" != "" } {
+ upvar $_statvar stat
+ } else {
+ set stat(cpu1) 0
+ set stat(cpu2) 0
+ set stat(mem1) 0
+ set stat(mem2) 0
+ set stat(img1) 0
+ set stat(img2) 0
+ set log {}
+ set log_image {}
+ set log_cpu {}
+ set log_memory {}
+ }
+
+ # first check subdirectories
+ set path1 [file join $dir1 $basename]
+ set path2 [file join $dir2 $basename]
+ set list1 [glob -directory $path1 -types d -tails -nocomplain *]
+ set list2 [glob -directory $path2 -types d -tails -nocomplain *]
+ if { [llength $list1] >0 || [llength $list2] > 0 } {
+ _list_diff $list1 $list2 in1 in2 common
+ if { "$verbose" > 1 } {
+ if { [llength $in1] > 0 } { _log_and_puts log "Only in $path1: $in1" }
+ if { [llength $in2] > 0 } { _log_and_puts log "Only in $path2: $in2" }
+ }
+ foreach subdir $common {
+ if { "$verbose" > 2 } {
+ _log_and_puts log "Checking [file join $basename $subdir]"
+ }
+ _test_diff $dir1 $dir2 [file join $basename $subdir] $image $cpu $memory $status $verbose log log_image log_cpu log_memory stat
+ }
+ } else {
+ # check log files (only if directory has no subdirs)
+ set list1 [glob -directory $path1 -types f -tails -nocomplain *.log]
+ set list2 [glob -directory $path2 -types f -tails -nocomplain *.log]
+ _list_diff $list1 $list2 in1 in2 common
+ if { "$verbose" > 1 } {
+ if { [llength $in1] > 0 } { _log_and_puts log "Only in $path1: $in1" }
+ if { [llength $in2] > 0 } { _log_and_puts log "Only in $path2: $in2" }
+ }
+ set gcpu1 0
+ set gcpu2 0
+ set gmem1 0
+ set gmem2 0
+ foreach logfile $common {
+ # load two logs
+ set log1 [_read_file [file join $dir1 $basename $logfile]]
+ set log2 [_read_file [file join $dir2 $basename $logfile]]
+ set casename [file rootname $logfile]
+
+ # check execution statuses
+ if {$image == false && $cpu == false && $memory == false} {
+ set status1 UNDEFINED
+ set status2 UNDEFINED
+ if { ! [regexp {CASE [^:]*:\s*([\w]+)} $log1 res1 status1] ||
+ ! [regexp {CASE [^:]*:\s*([\w]+)} $log2 res2 status2] ||
+ "$status1" != "$status2" } {
+ _log_and_puts log "STATUS [split $basename /] $casename: $status1 / $status2"
+ # if test statuses are different, further comparison makes
+ # no sense unless explicitly requested
+ if { "$status" != "all" } {
+ continue
+ }
+ }
+ if { "$status" == "ok" && "$status1" != "OK" } {
+ continue
+ }
+ }
+
+ if { ! $image } {
+ # check CPU user time in test cases
+ set checkCPURegexp "COUNTER (.+): (\[-0-9.+eE\]+)"
+ if { [regexp "${checkCPURegexp}" $log1] &&
+ [regexp "${checkCPURegexp}" $log2] } {
+ _check_time "${checkCPURegexp}"
+ }
+ }
+
+ # check CPU times
+ if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
+ set cpu1 UNDEFINED
+ set cpu2 UNDEFINED
+ if { [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log1 res1 cpu1] &&
+ [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log2 res1 cpu2] } {
+ set stat(cpu1) [expr $stat(cpu1) + $cpu1]
+ set stat(cpu2) [expr $stat(cpu2) + $cpu2]
+ set gcpu1 [expr $gcpu1 + $cpu1]
+ set gcpu2 [expr $gcpu2 + $cpu2]
+
+ # compare CPU times with 10% precision (but not less 0.5 sec)
+ if { [expr abs ($cpu1 - $cpu2) > 0.5 + 0.05 * abs ($cpu1 + $cpu2)] } {
+ if {$cpu != false} {
+ _log_and_puts log_cpu "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]"
+ } else {
+ _log_and_puts log "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]"
+ }
+ }
+ }
+ }
+
+ # check memory delta
+ if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
+ set mem1 UNDEFINED
+ set mem2 UNDEFINED
+ if { [regexp {MEMORY DELTA:\s*([\d.]+)} $log1 res1 mem1] &&
+ [regexp {MEMORY DELTA:\s*([\d.]+)} $log2 res1 mem2] } {
+ set stat(mem1) [expr $stat(mem1) + $mem1]
+ set stat(mem2) [expr $stat(mem2) + $mem2]
+ set gmem1 [expr $gmem1 + $mem1]
+ set gmem2 [expr $gmem2 + $mem2]
+
+ # compare memory usage with 10% precision (but not less 16 KiB)
+ if { [expr abs ($mem1 - $mem2) > 16 + 0.05 * abs ($mem1 + $mem2)] } {
+ if {$memory != false} {
+ _log_and_puts log_memory "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]"
+ } else {
+ _log_and_puts log "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]"
+ }
+ }
+ }
+ }
+
+ # check images
+ if {$image != false || ($image == false && $cpu == false && $memory == false)} {
+ set aCaseDiffColorTol 0
+ if { [regexp {IMAGE_COLOR_TOLERANCE:\s*([\d.]+)} $log1 res1 imgtol1] } { set aCaseDiffColorTol $imgtol1 }
+ set imglist1 [glob -directory $path1 -types f -tails -nocomplain ${casename}.{png,gif} ${casename}-*.{png,gif} ${casename}_*.{png,gif}]
+ set imglist2 [glob -directory $path2 -types f -tails -nocomplain ${casename}.{png,gif} ${casename}-*.{png,gif} ${casename}_*.{png,gif}]
+ _list_diff $imglist1 $imglist2 imgin1 imgin2 imgcommon
+ if { "$verbose" > 1 } {
+ # Differences in image lists might reflect changes in test case or in list of tests (new/removed test cases),
+ # but might also reflect image dump failures.
+ if { [llength $imgin1] > 0 } {
+ set stat(img1) [expr $stat(img1) + [llength $imgin1]]
+ set stat(img2) [expr $stat(img2) + [llength $imgin1]]
+ if {$image != false} {
+ _log_and_puts log_image "Only in $path1: $imgin1"
+ } else {
+ _log_and_puts log "Only in $path1: $imgin1"
+ }
+ }
+ if { [llength $imgin2] > 0 } {
+ set stat(img1) [expr $stat(img1) + [llength $imgin2]]
+ if {$image != false} {
+ _log_and_puts log_image "Only in $path2: $imgin2"
+ } else {
+ _log_and_puts log "Only in $path2: $imgin2"
+ }
+ }
+ }
+
+ foreach imgfile $imgcommon {
+ set stat(img2) [expr $stat(img2) + 1]
+ # if { $verbose > 1 } { _log_and_puts log "Checking [split basename /] $casename: $imgfile" }
+ set diffile [_diff_img_name $dir1 $dir2 $basename $imgfile]
+ if { [catch {diffimage [file join $dir1 $basename $imgfile] \
+ [file join $dir2 $basename $imgfile] \
+ -toleranceOfColor 0.0 -blackWhite off -borderFilter off $diffile} diff] } {
+ set stat(img1) [expr $stat(img1) + 1]
+ if {$image != false} {
+ _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
+ } else {
+ _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
+ }
+ file delete -force $diffile ;# clean possible previous result of diffimage
+ } elseif { $diff != 0 } {
+ set diff [string trimright $diff \n]
+ if {$aCaseDiffColorTol != 0} {
+ # retry with color tolerance
+ if { [catch {diffimage [file join $dir1 $basename $imgfile] \
+ [file join $dir2 $basename $imgfile] \
+ -toleranceOfColor $aCaseDiffColorTol -blackWhite off -borderFilter off $diffile} diff2] } {
+ set stat(img1) [expr $stat(img1) + 1]
+ if {$image != false} {
+ _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
+ } else {
+ _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
+ }
+ continue
+ } elseif { $diff2 == 0 } {
+ # exclude image diff within tolerance but still keep info in the log
+ set toLogImageCase false
+ file delete -force $diffile
+ set stat(img1) [expr $stat(img1) + 1]
+ if {$image != false} {
+ _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile is similar \[$diff different pixels\]"
+ } else {
+ _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile is similar \[$diff different pixels\]"
+ }
+ continue
+ }
+ }
+
+ set stat(img1) [expr $stat(img1) + 1]
+ if {$image != false} {
+ _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile differs \[$diff different pixels\]"
+ } else {
+ _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile differs \[$diff different pixels\]"
+ }
+ } else {
+ file delete -force $diffile ;# clean useless artifact of diffimage
+ }
+ }
+ }
+ }
+
+ # report CPU and memory difference in group if it is greater than 10%
+ if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
+ if { [expr abs ($gcpu1 - $gcpu2) > 0.5 + 0.005 * abs ($gcpu1 + $gcpu2)] } {
+ if {$cpu != false} {
+ _log_and_puts log_cpu "CPU [split $basename /]: [_diff_show_ratio $gcpu1 $gcpu2]"
+ } else {
+ _log_and_puts log "CPU [split $basename /]: [_diff_show_ratio $gcpu1 $gcpu2]"
+ }
+ }
+ }
+ if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
+ if { [expr abs ($gmem1 - $gmem2) > 16 + 0.005 * abs ($gmem1 + $gmem2)] } {
+ if {$memory != false} {
+ _log_and_puts log_memory "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]"
+ } else {
+ _log_and_puts log "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]"
+ }
+ }
+ }
+ }
+
+ if { "$_statvar" == "" } {
+ if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
+ if {$memory != false} {
+ _log_and_puts log_memory "Total MEMORY difference: [_diff_show_ratio $stat(mem1) $stat(mem2)]"
+ } else {
+ _log_and_puts log "Total MEMORY difference: [_diff_show_ratio $stat(mem1) $stat(mem2)]"
+ }
+ }
+ if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
+ if {$cpu != false} {
+ _log_and_puts log_cpu "Total CPU difference: [_diff_show_ratio $stat(cpu1) $stat(cpu2)]"
+ } else {
+ _log_and_puts log "Total CPU difference: [_diff_show_ratio $stat(cpu1) $stat(cpu2)]"
+ }
+ }
+ if {$image != false || ($image == false && $cpu == false && $memory == false)} {
+ if {$image != false} {
+ _log_and_puts log_image "Total IMAGE difference: [_diff_show_positive_ratio $stat(img1) $stat(img2)]"
+ } else {
+ _log_and_puts log "Total IMAGE difference: [_diff_show_positive_ratio $stat(img1) $stat(img2)]"
+ }
+ }
+ }
+}
+
+# Auxiliary procedure to save log of results comparison to file
+proc _log_html_diff {file log dir1 dir2 highlight_percent} {
+ # create missing directories as needed
+ catch {file mkdir [file dirname $file]}
+
+ # try to open a file
+ if [catch {set fd [open $file w]} res] {
+ error "Error saving log file $file: $res"
+ }
+
+ # print header
+ puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
+ puts $fd "<title>Diff $dir1 vs. $dir2</title></head><body>"
+ puts $fd "<h1>Comparison of test results:</h1>"
+ puts $fd "<h2>Version A \[NEW\] - $dir1</h2>"
+ puts $fd "<h2>Version B \[REF\] - $dir2</h2>"
+
+ # add script for switching between images on click
+ puts $fd ""
+ puts $fd "<script type=\"text/javascript\">"
+ puts $fd " function diffimage_toggle(img,url1,url2)"
+ puts $fd " {"
+ puts $fd " if (img.show2nd) { img.src = url1; img.show2nd = false; }"
+ puts $fd " else { img.src = url2; img.show2nd = true; }"
+ puts $fd " }"
+ puts $fd " function diffimage_reset(img,url) { img.src = url; img.show2nd = true; }"
+ puts $fd "</script>"
+ puts $fd ""
+
+ # print log body
+ puts $fd "<pre>"
+ set logpath [file split [file normalize $file]]
+ foreach line $log {
+ # put a line; highlight considerable (> ${highlight_percent}%) deviations of CPU and memory
+ if { [regexp "\[\\\[](\[0-9.e+-]+)%\[\]]" $line res value] &&
+ [expr abs($value)] > ${highlight_percent} } {
+ puts $fd "<table><tr><td bgcolor=\"[expr $value > 0 ? \"ff8080\" : \"lightgreen\"]\">$line</td></tr></table>"
+ } elseif { [regexp {^IMAGE[ \t]+([^:]+):[ \t]+([A-Za-z0-9_.-]+) is similar} $line res case img] } {
+ if { [catch {eval file join "" [lrange $case 0 end-1]} gridpath] } {
+ # note: special handler for the case if test grid directoried are compared directly
+ set gridpath ""
+ }
+ set aCaseName [lindex $case end]
+ puts $fd "<table><tr><td bgcolor=\"orange\"><a href=\"[_make_url $file [file join $dir1 $gridpath $aCaseName.html]]\">$line</a></td></tr></table>"
+ } elseif { [regexp {^IMAGE[ \t]+([^:]+):[ \t]+([A-Za-z0-9_.-]+)} $line res case img] } {
+ # add images
+ puts $fd $line
+ if { [catch {eval file join "" [lrange $case 0 end-1]} gridpath] } {
+ # note: special handler for the case if test grid directoried are compared directly
+ set gridpath ""
+ }
+ set aCaseName [lindex $case end]
+ set img1url [_make_url $file [file join $dir1 $gridpath $img]]
+ set img2url [_make_url $file [file join $dir2 $gridpath $img]]
+ set img1 "<a href=\"[_make_url $file [file join $dir1 $gridpath $aCaseName.html]]\"><img src=\"$img1url\"></a>"
+ set img2 "<a href=\"[_make_url $file [file join $dir2 $gridpath $aCaseName.html]]\"><img src=\"$img2url\"></a>"
+
+ set difffile [_diff_img_name $dir1 $dir2 $gridpath $img]
+ set imgdurl [_make_url $file $difffile]
+ if { [file exists $difffile] } {
+ set imgd "<img src=\"$imgdurl\" onmouseout=diffimage_reset(this,\"$imgdurl\") onclick=diffimage_toggle(this,\"$img1url\",\"$img2url\")>"
+ } else {
+ set imgd "N/A"
+ }
+
+ puts $fd "<table><tr><th><abbr title=\"$dir1\">Version A</abbr></th><th><abbr title=\"$dir2\">Version B</abbr></th><th>Diff (click to toggle)</th></tr>"
+ puts $fd "<tr><td>$img1</td><td>$img2</td><td>$imgd</td></tr></table>"
+ } else {
+ puts $fd $line
+ }
+ }
+ puts $fd "</pre></body></html>"
+
+ close $fd
+ return
+}
+
+# get number of CPUs on the system
+proc _get_nb_cpus {} {
+ global tcl_platform env
+
+ if { "$tcl_platform(platform)" == "windows" } {
+ # on Windows, take the value of the environment variable
+ if { [info exists env(NUMBER_OF_PROCESSORS)] &&
+ ! [catch {expr $env(NUMBER_OF_PROCESSORS) > 0} res] && $res >= 0 } {
+ return $env(NUMBER_OF_PROCESSORS)
+ }
+ } elseif { "$tcl_platform(os)" == "Linux" } {
+ # on Linux, take number of logical processors listed in /proc/cpuinfo
+ if { [catch {open "/proc/cpuinfo" r} fd] } {
+ return 0 ;# should never happen, but...
+ }
+ set nb 0
+ while { [gets $fd line] >= 0 } {
+ if { [regexp {^processor[ \t]*:} $line] } {
+ incr nb
+ }
+ }
+ close $fd
+ return $nb
+ } elseif { "$tcl_platform(os)" == "Darwin" } {
+ # on MacOS X, call sysctl command
+ if { ! [catch {exec sysctl hw.ncpu} ret] &&
+ [regexp {^hw[.]ncpu[ \t]*:[ \t]*([0-9]+)} $ret res nb] } {
+ return $nb
+ }
+ }
+
+ # if cannot get good value, return 0 as default
+ return 0
+}
+
+# check two files for difference
+proc _diff_files {file1 file2} {
+ set fd1 [open $file1 "r"]
+ set fd2 [open $file2 "r"]
+
+ set differ f
+ while {! $differ} {
+ set nb1 [gets $fd1 line1]
+ set nb2 [gets $fd2 line2]
+ if { $nb1 != $nb2 } { set differ t; break }
+ if { $nb1 < 0 } { break }
+ if { [string compare $line1 $line2] } {
+ set differ t
+ }
+ }
+
+ close $fd1
+ close $fd2
+
+ return $differ
+}
+
+# Check if file is in DOS encoding.
+# This check is done by presence of \r\n combination at the end of the first
+# line (i.e. prior to any other \n symbol).
+# Note that presence of non-ascii symbols typically used for recognition
+# of binary files is not suitable since some IGES and STEP files contain
+# non-ascii symbols.
+# Special check is added for PNG files which contain \r\n in the beginning.
+proc _check_dos_encoding {file} {
+ set fd [open $file rb]
+ set isdos f
+ if { [gets $fd line] && [regexp {.*\r$} $line] &&
+ ! [regexp {^.PNG} $line] } {
+ set isdos t
+ }
+ close $fd
+ return $isdos
+}
+
+# procedure to recognize format of a data file by its first symbols (for OCCT
+# BREP and geometry DRAW formats, IGES, and STEP) and extension (all others)
+proc _check_file_format {file} {
+ set fd [open $file rb]
+ set line [read $fd 1024]
+ close $fd
+
+ set warn f
+ set ext [file extension $file]
+ set format unknown
+ if { [regexp {^DBRep_DrawableShape} $line] } {
+ set format BREP
+ if { "$ext" != ".brep" && "$ext" != ".rle" &&
+ "$ext" != ".draw" && "$ext" != "" } {
+ set warn t
+ }
+ } elseif { [regexp {^DrawTrSurf_} $line] } {
+ set format DRAW
+ if { "$ext" != ".rle" &&
+ "$ext" != ".draw" && "$ext" != "" } {
+ set warn t
+ }
+ } elseif { [regexp {^[ \t]*ISO-10303-21} $line] } {
+ set format STEP
+ if { "$ext" != ".step" && "$ext" != ".stp" } {
+ set warn t
+ }
+ } elseif { [regexp {^.\{72\}S[0 ]\{6\}1} $line] } {
+ set format IGES
+ if { "$ext" != ".iges" && "$ext" != ".igs" } {
+ set warn t
+ }
+ } elseif { "$ext" == ".igs" } {
+ set format IGES
+ } elseif { "$ext" == ".stp" } {
+ set format STEP
+ } else {
+ set format [string toupper [string range $ext 1 end]]
+ }
+
+ if { $warn } {
+ puts "$file: Warning: extension ($ext) does not match format ($format)"
+ }
+
+ return $format
+}
+
+# procedure to load file knowing its format
+proc load_data_file {file format shape} {
+ switch $format {
+ BREP { uplevel restore $file $shape }
+ DRAW { uplevel restore $file $shape }
+ IGES { pload XSDRAW; uplevel igesbrep $file $shape * }
+ STEP { pload XSDRAW; uplevel stepread $file __a *; uplevel renamevar __a_1 $shape }
+ STL { pload XSDRAW; uplevel readstl $shape $file triangulation }
+ default { error "Cannot read $format file $file" }
+ }
+}
+
+# procedure to get name of temporary directory,
+# ensuring it is existing and writeable
+proc _get_temp_dir {} {
+ global env tcl_platform
+
+ # check typical environment variables
+ foreach var {TempDir Temp Tmp} {
+ # check different case
+ foreach name [list [string toupper $var] $var [string tolower $var]] {
+ if { [info exists env($name)] && [file isdirectory $env($name)] &&
+ [file writable $env($name)] } {
+ return [regsub -all {\\} $env($name) /]
+ }
+ }
+ }
+
+ # check platform-specific locations
+ set fallback tmp
+ if { "$tcl_platform(platform)" == "windows" } {
+ set paths "c:/TEMP c:/TMP /TEMP /TMP"
+ if { [info exists env(HOMEDRIVE)] && [info exists env(HOMEPATH)] } {
+ set fallback [regsub -all {\\} "$env(HOMEDRIVE)$env(HOMEPATH)/tmp" /]
+ }
+ } else {
+ set paths "/tmp /var/tmp /usr/tmp"
+ if { [info exists env(HOME)] } {
+ set fallback "$env(HOME)/tmp"
+ }
+ }
+ foreach dir $paths {
+ if { [file isdirectory $dir] && [file writable $dir] } {
+ return $dir
+ }
+ }
+
+ # fallback case: use subdir /tmp of home or current dir
+ file mkdir $fallback
+ return $fallback
+}
+
+# extract of code from testgrid command used to process jobs running in
+# parallel until number of jobs in the queue becomes equal or less than
+# specified value
+proc _testgrid_process_jobs {worker {nb_ok 0}} {
+ # bind local vars to variables of the caller procedure
+ upvar log log
+ upvar logdir logdir
+ upvar job_def job_def
+ upvar nbpooled nbpooled
+ upvar userbreak userbreak
+ upvar refresh refresh
+ upvar refresh_timer refresh_timer
+
+ catch {tpool::resume $worker}
+ while { ! $userbreak && $nbpooled > $nb_ok } {
+ foreach job [tpool::wait $worker [array names job_def]] {
+ eval _log_test_case \[tpool::get $worker $job\] $job_def($job) log
+ unset job_def($job)
+ incr nbpooled -1
+ }
+
+ # check for user break
+ if { "[info commands dbreak]" == "dbreak" && [catch dbreak] } {
+ set userbreak 1
+ }
+
+ # update summary log with requested period
+ if { $logdir != "" && $refresh > 0 && [clock seconds] > $refresh_timer + $refresh } {
+ _log_summarize $logdir $log
+ set refresh_timer [clock seconds]
+ }
+ }
+ catch {tpool::suspend $worker}
+}
+
+help checkcolor {
+ Check pixel color.
+ Use: checkcolor x y red green blue
+ x y - pixel coordinates
+ red green blue - expected pixel color (values from 0 to 1)
+ Function check color with tolerance (5x5 area)
+}
+# Procedure to check color using command vreadpixel with tolerance
+proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
+ puts "Coordinate x = $coord_x"
+ puts "Coordinate y = $coord_y"
+ puts "RED color of RGB is $rd_get"
+ puts "GREEN color of RGB is $gr_get"
+ puts "BLUE color of RGB is $bl_get"
+
+ if { $coord_x <= 1 || $coord_y <= 1 } {
+ puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
+ return -1
+ }
+
+ set color ""
+ catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] }
+ if {"$color" == ""} {
+ puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view"
+ }
+ set rd [lindex $color 0]
+ set gr [lindex $color 1]
+ set bl [lindex $color 2]
+ set rd_int [expr int($rd * 1.e+05)]
+ set gr_int [expr int($gr * 1.e+05)]
+ set bl_int [expr int($bl * 1.e+05)]
+ set rd_ch [expr int($rd_get * 1.e+05)]
+ set gr_ch [expr int($gr_get * 1.e+05)]
+ set bl_ch [expr int($bl_get * 1.e+05)]
+
+ if { $rd_ch != 0 } {
+ set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
+ } else {
+ set tol_rd $rd_int
+ }
+ if { $gr_ch != 0 } {
+ set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
+ } else {
+ set tol_gr $gr_int
+ }
+ if { $bl_ch != 0 } {
+ set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
+ } else {
+ set tol_bl $bl_int
+ }
+
+ set status 0
+ if { $tol_rd > 0.2 } {
+ puts "Warning : RED light of additive color model RGB is invalid"
+ set status 1
+ }
+ if { $tol_gr > 0.2 } {
+ puts "Warning : GREEN light of additive color model RGB is invalid"
+ set status 1
+ }
+ if { $tol_bl > 0.2 } {
+ puts "Warning : BLUE light of additive color model RGB is invalid"
+ set status 1
+ }
+
+ if { $status != 0 } {
+ puts "Warning : Colors of default coordinate are not equal"
+ }
+
+ global stat
+ if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
+ set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
+ set stat [lindex $info end]
+ if { ${stat} != 1 } {
+ puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
+ return $stat
+ } else {
+ puts "Point with valid color was found"
+ return $stat
+ }
+ } else {
+ set stat 1
+ }
+}
+
+# Procedure to check color in the point near default coordinate
+proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
+ set x_start [expr ${coord_x} - 2]
+ set y_start [expr ${coord_y} - 2]
+ set mistake 0
+ set i 0
+ while { $mistake != 1 && $i <= 5 } {
+ set j 0
+ while { $mistake != 1 && $j <= 5 } {
+ set position_x [expr ${x_start} + $j]
+ set position_y [expr ${y_start} + $i]
+ puts $position_x
+ puts $position_y
+
+ set color ""
+ catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] }
+ if {"$color" == ""} {
+ puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view"
+ incr j
+ continue
+ }
+ set rd [lindex $color 0]
+ set gr [lindex $color 1]
+ set bl [lindex $color 2]
+ set rd_int [expr int($rd * 1.e+05)]
+ set gr_int [expr int($gr * 1.e+05)]
+ set bl_int [expr int($bl * 1.e+05)]
+
+ if { $rd_ch != 0 } {
+ set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
+ } else {
+ set tol_rd $rd_int
+ }
+ if { $gr_ch != 0 } {
+ set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
+ } else {
+ set tol_gr $gr_int
+ }
+ if { $bl_ch != 0 } {
+ set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
+ } else {
+ set tol_bl $bl_int
+ }
+
+ if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
+ puts "Warning : Point with true color was not found near default coordinates"
+ set mistake 0
+ } else {
+ set mistake 1
+ }
+ incr j
+ }
+ incr i
+ }
+ return $mistake
+}
+
+# Procedure to check if sequence of values in listval follows linear trend
+# adding the same delta on each step.
+#
+# The function does statistical estimation of the mean variation of the
+# values of the sequence, and dispersion, and returns true only if both
+# dispersion and deviation of the mean from expected delta are within
+# specified tolerance.
+#
+# If mean variation differs from expected delta on more than two dispersions,
+# the check fails and procedure raises error with specified message.
+#
+# Otherwise the procedure returns false meaning that more iterations are needed.
+# Note that false is returned in any case if length of listval is less than 3.
+#
+# See example of use to check memory leaks in bugs/caf/bug23489
+#
+proc checktrend {listval delta tolerance message} {
+ set nbval [llength $listval]
+ if { $nbval < 3} {
+ return 0
+ }
+
+ # calculate mean value
+ set mean 0.
+ set prev [lindex $listval 0]
+ foreach val [lrange $listval 1 end] {
+ set mean [expr $mean + ($val - $prev)]
+ set prev $val
+ }
+ set mean [expr $mean / ($nbval - 1)]
+
+ # calculate dispersion
+ set sigma 0.
+ set prev [lindex $listval 0]
+ foreach val [lrange $listval 1 end] {
+ set d [expr ($val - $prev) - $mean]
+ set sigma [expr $sigma + $d * $d]
+ set prev $val
+ }
+ set sigma [expr sqrt ($sigma / ($nbval - 2))]
+
+ puts "Checking trend: nb = $nbval, mean delta = $mean, sigma = $sigma"
+
+ # check if deviation is definitely too big
+ if { abs ($mean - $delta) > $tolerance + 2. * $sigma } {
+ puts "Checking trend failed: mean delta per step = $mean, sigma = $sigma, expected delta = $delta"
+ error "$message"
+ }
+
+ # check if deviation is clearly within a range
+ return [expr abs ($mean - $delta) <= $sigma && $sigma <= $tolerance]
+}
+
+# Procedure to clean up test results by removing skipped test directories
+help cleanuptest {
+ Clean up test results by removing skipped test case directories and non-essential files.
+ Use: cleanuptest results_dir
+ Where results_dir is the directory containing test results including tests.log
+}
+proc cleanuptest {results_dir} {
+ # Function to extract test case path from test case name
+ proc get_test_path {test_case} {
+ # Extract directory parts from test case string
+ # Format: "CASE group grid case: status"
+ if { [regexp {^CASE ([^ ]+) (.*[^ ]) ([^ ]+):} $test_case -> group grid case] } {
+ # Remove any extra spaces from grid
+ set grid [string trim $grid]
+ return [file join $group $grid $case]
+ }
+ puts "Error: Cannot parse test case: $test_case"
+ return ""
+ }
+
+ set log_file [file join $results_dir "tests.log"]
+ if { ! [file exists $log_file] } {
+ puts "Error: No tests.log found in $results_dir"
+ return
+ }
+
+ # Process tests.log and find skipped tests
+ set fd [open $log_file r]
+ while {[gets $fd line] >= 0} {
+ if {[regexp {^CASE.*: SKIPPED \(data file is missing\)$} $line]} {
+ set test_path [get_test_path $line]
+ if { $test_path != "" } {
+ set full_path [file join $results_dir $test_path]
+ # Delete any files with this base path (any extension)
+ set files_to_delete [glob -nocomplain "${full_path}*"]
+ foreach file $files_to_delete {
+ if {[file exists $file]} {
+ file delete -force $file
+ }
+ }
+ # Delete directory if it exists
+ if {[file isdirectory $full_path]} {
+ file delete -force $full_path
+ }
+ }
+ }
+ }
+ close $fd
+}
--- /dev/null
+# Copyright (c) 2016 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+#
+# Created by: M.Sazonov
+#
+# Working with vectors and various measurements
+#
+# [2d] point is represented by (two/three) coords
+# [2d] vector is represented by (two/three) coords
+# plane is represented by an origin point and a normal vector
+# [2d] line is represented by an origin point and a vector
+
+help vec {vec x1 y1 z1 x2 y2 z2
+ returns coordinates of vector between two points\
+} {Vector and measurement Commands}
+
+proc vec {x1 y1 z1 x2 y2 z2} {
+ uplevel list [dval ($x2)-($x1)] [dval ($y2)-($y1)] [dval ($z2)-($z1)]
+}
+
+help 2dvec {2dvec x1 y1 x2 y2
+ returns coordinates of 2D vector between two 2D points\
+} {Vector and measurement Commands}
+
+proc 2dvec {x1 y1 x2 y2} {
+ uplevel list [dval ($x2)-($x1)] [dval ($y2)-($y1)]
+}
+
+help pln {pln x1 y1 z1 x2 y2 z2 x3 y3 z3
+ returns plane built on three points\
+} {Vector and measurement Commands}
+
+proc pln {x1 y1 z1 x2 y2 z2 x3 y3 z3} {
+ set v12 [uplevel eval norm [vec $x1 $y1 $z1 $x2 $y2 $z2]]
+ set v13 [uplevel eval norm [vec $x1 $y1 $z1 $x3 $y3 $z3]]
+ set vn [eval cross $v12 $v13]
+ set N [eval module $vn]
+ if [expr $N < 1e-7] {
+ puts "points are on a line"
+ return
+ }
+ concat $x1 $y1 $z1 [eval norm $vn]
+}
+
+help module {module x y z
+ returns module of a vector\
+} {Vector and measurement Commands}
+
+proc module {x y z} {
+ uplevel dval sqrt(($x)*($x)+($y)*($y)+($z)*($z))
+}
+
+help 2dmodule {2dmodule x y
+ returns module of a 2D vector\
+} {Vector and measurement Commands}
+
+proc 2dmodule {x y} {
+ uplevel dval sqrt(($x)*($x)+($y)*($y))
+}
+
+help norm {norm x y z
+ returns unified vector from a given vector\
+} {Vector and measurement Commands}
+
+proc norm {x y z} {
+ set N [uplevel dval sqrt(($x)*($x)+($y)*($y)+($z)*($z))]
+ list [uplevel dval ($x)/$N] [uplevel dval ($y)/$N] [uplevel dval ($z)/$N]
+}
+
+help 2dnorm {2dnorm x y
+ returns unified vector from a given 2D vector\
+} {Vector and measurement Commands}
+
+proc 2dnorm {x y} {
+ set N [uplevel dval sqrt(($x)*($x)+($y)*($y))]
+ list [uplevel dval ($x)/$N] [uplevel dval ($y)/$N]
+}
+
+help inverse {inverse x y z
+ returns inversed vector\
+} {Vector and measurement Commands}
+
+proc inverse {x y z} {
+ list [uplevel dval -$x] [uplevel dval -$y] [uplevel dval -$z]
+}
+
+help 2dinverse {2dinverse x y
+ returns inversed 2D vector\
+} {Vector and measurement Commands}
+
+proc 2dinverse {x y} {
+ list [uplevel dval -$x] [uplevel dval -$y]
+}
+
+help 2dort {2dort x y
+ returns 2D vector rotated on 90 degrees\
+} {Vector and measurement Commands}
+
+proc 2dort {x y} {
+ list [uplevel dval -$y] [uplevel dval $x]
+}
+
+help distpp {distpp x1 y1 z1 x2 y2 z2
+ returns distance between two points\
+} {Vector and measurement Commands}
+
+proc distpp {x1 y1 z1 x2 y2 z2} {
+ eval module [uplevel vec $x1 $y1 $z1 $x2 $y2 $z2]
+}
+
+help 2ddistpp {2ddistpp x1 y1 x2 y2
+ returns distance between two 2D points\
+} {Vector and measurement Commands}
+
+proc 2ddistpp {x1 y1 x2 y2} {
+ eval 2dmodule [uplevel 1 2dvec $x1 $y1 $x2 $y2]
+}
+
+help distplp {distplp xo yo zo dx dy dz xp yp zp
+ returns distance between plane and point\
+} {Vector and measurement Commands}
+
+proc distplp {xo yo zo dx dy dz xp yp zp} {
+ set vop [uplevel vec $xo $yo $zo $xp $yp $zp]
+ set vn [uplevel norm $dx $dy $dz]
+ eval dot $vop $vn
+}
+
+help distlp {distlp xo yo zo dx dy dz xp yp zp
+ returns distance between line and point\
+} {Vector and measurement Commands}
+
+proc distlp {xo yo zo dx dy dz xp yp zp} {
+ set vop [uplevel vec $xo $yo $zo $xp $yp $zp]
+ set vl [uplevel norm $dx $dy $dz]
+ eval module [eval cross $vl $vop]
+}
+
+help 2ddistlp {2ddistlp xo yo dx dy xp yp
+ returns distance between 2D line and point\
+} {Vector and measurement Commands}
+
+proc 2ddistlp {xo yo dx dy xp yp} {
+ set vop [uplevel 1 2dvec $xo $yo $xp $yp]
+ set vl [uplevel 1 2dnorm $dx $dy]
+ eval 2dcross $vl $vop
+}
+
+help distppp {distppp x1 y1 z1 x2 y2 z2 x3 y3 z3
+ returns deviation of point p2 from segment p1-p3\
+} {Vector and measurement Commands}
+
+proc distppp {x1 y1 z1 x2 y2 z2 x3 y3 z3} {
+ set vop [uplevel vec $x1 $y1 $z1 $x2 $y2 $z2]
+ set vl [uplevel eval norm [vec $x1 $y1 $z1 $x3 $y3 $z3]]
+ eval module [eval cross $vl $vop]
+}
+
+help 2ddistppp {2ddistppp x1 y1 x2 y2 x3 y3
+ returns deviation of 2D point p2 from segment p1-p3 (sign shows the side)\
+} {Vector and measurement Commands}
+
+proc 2ddistppp {x1 y1 x2 y2 x3 y3} {
+ set vop [uplevel 1 2dvec $x1 $y1 $x2 $y2]
+ set vl [uplevel eval 2dnorm [2dvec $x1 $y1 $x3 $y3]]
+ eval 2dcross $vl $vop
+}
+
+help barycen {barycen x1 y1 z1 x2 y2 z2 par
+ returns point of a given parameter between two points\
+} {Vector and measurement Commands}
+
+proc barycen {x1 y1 z1 x2 y2 z2 par} {
+ uplevel list [dval ($x1)*(1-($par))+($x2)*($par)]\
+ [dval ($y1)*(1-($par))+($y2)*($par)]\
+ [dval ($z1)*(1-($par))+($z2)*($par)]
+}
+
+help 2dbarycen {2dbarycen x1 y1 x2 y2 par
+ returns 2D point of a given parameter between two points\
+} {Vector and measurement Commands}
+
+proc 2dbarycen {x1 y1 x2 y2 par} {
+ uplevel list [dval ($x1)*(1-($par))+($x2)*($par)]\
+ [dval ($y1)*(1-($par))+($y2)*($par)]
+}
+
+help cross {cross x1 y1 z1 x2 y2 z2
+ returns cross product of two vectors\
+} {Vector and measurement Commands}
+
+proc cross {x1 y1 z1 x2 y2 z2} {
+ set x [uplevel dval ($y1)*($z2)-($z1)*($y2)]
+ set y [uplevel dval ($z1)*($x2)-($x1)*($z2)]
+ set z [uplevel dval ($x1)*($y2)-($y1)*($x2)]
+ list $x $y $z
+}
+
+help 2dcross {2dcross x1 y1 x2 y2
+ returns cross product of two 2D vectors\
+} {Vector and measurement Commands}
+
+proc 2dcross {x1 y1 x2 y2} {
+ uplevel dval ($x1)*($y2)-($y1)*($x2)
+}
+
+help dot {dot x1 y1 z1 x2 y2 z2
+ returns scalar product of two vectors\
+} {Vector and measurement Commands}
+
+proc dot {x1 y1 z1 x2 y2 z2} {
+ uplevel dval ($x1)*($x2)+($y1)*($y2)+($z1)*($z2)
+}
+
+help 2ddot {2ddot x1 y1 x2 y2
+ returns scalar product of two 2D vectors\
+} {Vector and measurement Commands}
+
+proc 2ddot {x1 y1 x2 y2} {
+ uplevel dval ($x1)*($x2)+($y1)*($y2)
+}
+
+help vecangle {vecangle x1 y1 z1 x2 y2 z2
+ returns angle between two vectors\
+} {Vector and measurement Commands}
+
+proc vecangle {x1 y1 z1 x2 y2 z2} {
+ set d [uplevel dot $x1 $y1 $z1 $x2 $y2 $z2]
+ set c [uplevel cross $x1 $y1 $z1 $x2 $y2 $z2]
+ set cm [uplevel module $c]
+
+ set m1 [uplevel module $x1 $y1 $z1]
+ set m2 [uplevel module $x2 $y2 $z2]
+ set mm [expr $m1*$m2]
+
+ if { $cm < $d } {
+ expr asin($cm/$mm)
+ } else {
+ expr acos($d/$mm)
+ }
+}
+
+help 2dvecangle {2dvecangle x1 y1 x2 y2
+ returns angle between two vectors\
+} {Vector and measurement Commands}
+
+proc 2dvecangle {x1 y1 x2 y2} {
+ set d [uplevel 1 2ddot $x1 $y1 $x2 $y2]
+ set c [uplevel 1 2dcross $x1 $y1 $x2 $y2]
+
+ set m1 [uplevel 1 2dmodule $x1 $y1]
+ set m2 [uplevel 1 2dmodule $x2 $y2]
+ set mm [expr $m1*$m2]
+
+ if { $c < $d } {
+ expr asin($c/$mm)
+ } else {
+ expr acos($d/$mm)
+ }
+}
+
+help scale {scale x y z factor
+ returns vector multiplied by scalar\
+} {Vector and measurement Commands}
+
+proc scale {x y z factor} {
+ list [dval $x*$factor] [dval $y^$factor] [dval $z*$factor]
+}
+
+help 2dscale {2dscale x y factor
+ returns 2D vector multiplied by scalar\
+} {Vector and measurement Commands}
+
+proc 2dscale {x y factor} {
+ list [dval $x*$factor] [dval $y^$factor]
+}
+
+help pntc {pntc curve u
+ returns coordinates of point on curve with given parameter\
+} {Vector and measurement Commands}
+
+proc pntc {curv u} {
+ upvar \#0 $curv c
+ cvalue c $u x y z
+ return "[dval x] [dval y] [dval z]"
+}
+
+help 2dpntc {2dpntc curv2d u
+ returns coordinates of 2D point on 2D curve with given parameter\
+} {Vector and measurement Commands}
+
+proc 2dpntc {curv2d u} {
+ upvar \#0 $curv2d c
+ 2dcvalue c $u x y
+ return "[dval x] [dval y]"
+}
+
+help pntsu {pntsu surf u v
+ returns coordinates of point on surface with given parameters\
+} {Vector and measurement Commands}
+
+proc pntsu {surf u v} {
+ upvar \#0 $surf s
+ svalue s $u $v x y z
+ return "[dval x] [dval y] [dval z]"
+}
+
+help pntcons {pntcons curv2d surf u
+ returns coordinates of point on surface defined by
+ point on 2D curve with given parameter\
+} {Vector and measurement Commands}
+
+proc pntcons {curv2d surf u} {
+ upvar \#0 $curv2d c $surf s
+ 2dcvalue c $u u0 v0
+ svalue s u0 v0 x y z
+ return "[dval x] [dval y] [dval z]"
+}
+
+help pnt {pnt point_or_vertex
+ returns coordinates of point in the given Draw variable of type point or vertex\
+} {Vector and measurement Commands}
+
+proc pnt var {
+ upvar \#0 $var v
+ set type [dtyp v]
+ set pp v
+ if {[lindex $type 1] == "VERTEX"} {
+ mkpoint p v
+ set pp p
+ set type "point"
+ }
+ if {$type == "point"} {
+ if [catch {coord $pp x y z}] {
+ if ![catch {coord $pp x y}] {
+ return "[dval x] [dval y]"
+ }
+ } else {
+ return "[dval x] [dval y] [dval z]"
+ }
+ }
+}
+
+help drseg {drseg name x1 y1 z1 x2 y2 z2
+ creates a trimmed line between two points\
+} {Vector and measurement Commands}
+
+proc drseg {name x1 y1 z1 x2 y2 z2} {
+ set x [uplevel dval $x1]
+ set y [uplevel dval $y1]
+ set z [uplevel dval $z1]
+ set dx [uplevel dval ($x2)-($x1)]
+ set dy [uplevel dval ($y2)-($y1)]
+ set dz [uplevel dval ($z2)-($z1)]
+ set len [module $dx $dy $dz]
+ uplevel line $name $x $y $z $dx $dy $dz
+ uplevel trim $name $name 0 $len
+}
+
+help 2ddrseg {2ddrseg name x1 y1 x2 y2
+ creates a trimmed 2D line between two 2D points\
+} {Vector and measurement Commands}
+
+proc 2ddrseg {name x1 y1 x2 y2} {
+ set x [uplevel dval $x1]
+ set y [uplevel dval $y1]
+ set dx [uplevel dval ($x2)-($x1)]
+ set dy [uplevel dval ($y2)-($y1)]
+ set len [2dmodule $dx $dy]
+ uplevel line $name $x $y $dx $dy
+ uplevel trim $name $name 0 $len
+}
+
+help mpick {show coordinates at mouse click\
+} {Vector and measurement Commands}
+
+proc mpick {} {
+ puts "Pick position"
+ pick id x1 y1 z1 b
+ concat [dval x1] [dval y1] [dval z1]
+}
+
+help mdist {compute distance between two points of mouse clicks\
+} {Vector and measurement Commands}
+
+proc mdist {} {
+ puts "Pick first position"
+ pick id x1 y1 z1 b
+ puts "Pick second position"
+ pick id x2 y2 z2 b
+ dval sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
+}
--- /dev/null
+# Copyright (c) 1999-2014 OPEN CASCADE SAS
+#
+# This file is part of Open CASCADE Technology software library.
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License version 2.1 as published
+# by the Free Software Foundation, with special exception defined in the file
+# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+# distribution for complete text of the license and disclaimer of any warranty.
+#
+# Alternatively, this file may be used under the terms of Open CASCADE
+# commercial license or contractual agreement.
+
+###########################
+# #
+# Version 1.4 #
+# by SZV #
+# #
+###########################
+#
+# Open : double-clic or +
+# Close : double-clic or -
+# Refresh tree : close top level and re-open
+#
+# Attributes:
+# white : interoperable
+# white + c : non interoperable
+# X : X Reference
+# Red : not yet committed in transaction #0
+#
+#
+
+proc __update { args } {
+}
+
+proc dftree { DDF_Browser } {
+
+ global env
+ global DFTREE_WINDOWS
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ puts $DDF_Browser
+
+ package require Tk
+
+ ## Create images
+ set DFTREE_GLOBALS(ImageLabel) [DFOpenImage dfb_folder.gif]
+ set DFTREE_GLOBALS(ImageAttrOther) [DFOpenImage dfb_attribute.gif]
+ set DFTREE_GLOBALS(ImageAttrNS) [DFOpenImage dfb_attribns.gif]
+
+## set DFTREE_LabelStyle [tixDisplayStyle imagetext \
+## -font 9x15bold \
+## -background Bisque3 \
+## ]
+
+## set DFTREE_LabelStyle1 [tixDisplayStyle imagetext \
+## -font 9x15bold \
+## -background Bisque3 \
+## -foreground SeaGreen2 \
+## ]
+
+## set DFTREE_AttributeStyle [tixDisplayStyle imagetext \
+## -font 9x15 \
+## -background Bisque3 \
+## ]
+
+## set DFTREE_AttributeStyle1 [tixDisplayStyle imagetext \
+## -font 9x15 \
+## -background Bisque3 \
+## -foreground DarkGreen \
+## ]
+
+## set DFTREE_AttributeStyle2 [tixDisplayStyle imagetext \
+## -font 9x15 \
+## -background Bisque3 \
+## -foreground Red \
+## ]
+
+ set w .$DDF_Browser
+ toplevel $w -width 700 -height 400 -background bisque3
+ wm minsize $w 700 400
+
+ ########
+ # Tree #
+ ########
+
+ #set tree1 [ttk::treeview $w.tree -show tree]
+ set tree1 [ttk::treeview $w.tree -show tree -xscrollcommand "$w.tree.xscroll set" -yscrollcommand "$w.tree.yscroll set"]
+ set aScrollX [ttk::scrollbar $w.tree.xscroll -command "$w.tree xview" -orient horizontal]
+ set aScrollY [ttk::scrollbar $w.tree.yscroll -command "$w.tree yview"]
+ pack $aScrollX -side bottom -fill x
+ pack $aScrollY -side right -fill y
+ $tree1 tag bind Label <<TreeviewOpen>> [list DFTREE:Tree:Open $DDF_Browser $w]
+ $tree1 tag configure Label -font 9x15bold -foreground DarkGreen
+ #$tree1 tag configure Attribute -font 9x15 -background bisque3
+ #$tree1 tag configure AttributeList -font 9x15 -background bisque3
+ pack $tree1 -expand yes -fill both -padx 4 -pady 4
+
+ # to see different fonts: /usr/openwin/lib/X11/fonts/misc or xlsfonts?
+ # 8x13 8x13bold 9x15 9x15bold
+ # hlist.font 8x13bold
+ # hlist.gap "15"
+ # hlist.indent "30"
+
+ set DFTREE_WINDOWS($w,tree) $tree1
+ set DFTREE_WINDOWS($w,root) [$tree1 insert {} end \
+ -text $DDF_Browser \
+ -values "" \
+ -tags Label]
+
+ # Here we need to open first node!
+
+ return
+}
+
+###############################################################################
+#
+#
+proc DFTREE:Tree:Open { DDF_Browser w } {
+
+ global DFTREE_WINDOWS
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ set df_tree $DFTREE_WINDOWS($w,tree)
+ set df_node [$df_tree focus]
+
+ #if {$df_node == $DFTREE_WINDOWS($w,root)} {
+ # This is root
+ set chdlist [$df_tree children $df_node]
+ if {$chdlist != {}} {
+ # The root branch already exists in hlist.
+ # Clear all its children to force the tree to be updated.
+ $df_tree delete $chdlist
+ }
+ #}
+
+ #update
+ DFTREE:Tree:Fill $DDF_Browser $df_tree $df_node
+ return
+}
+
+###############################################################################
+#
+#
+proc DFTREE:Tree:Fill { DDF_Browser df_tree df_node } {
+
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ set loc [lindex [$df_tree item $df_node -values] 0]
+ set type [lindex [$df_tree item $df_node -tags] 0]
+
+ switch -glob $type {
+
+ Label {
+ DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_node $loc
+ }
+
+ #AttributeList {
+ # DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $loc
+ #}
+
+ default {
+ }
+ }
+ return
+}
+
+###############################################################################
+# $df_entry is a label entry, "1:3:2" for example, or "" for root.
+#
+proc DFTREE:Tree:UpdateLabel { DDF_Browser df_tree df_node df_entry } {
+
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ foreach fullname [split [DFOpenLabel $DDF_Browser $df_entry] "\\" ] {
+ FCTREE:Tree:DecodeLabelItem $DDF_Browser $df_tree $df_node $df_entry $fullname
+ }
+ return
+}
+
+###############################################################################
+#
+#
+proc DFTREE:Tree:UpdateAttributeList { DDF_Browser df_tree df_node df_entry} {
+
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ set image_other $DFTREE_GLOBALS(ImageAttrOther)
+ set image_ns $DFTREE_GLOBALS(ImageAttrNS)
+ #set xrefimage $DFTREE_GLOBALS(ImageAttrOther)
+
+ # abv: index attributes
+ set num 0
+ set attributes [split [DFOpenAttributeList $DDF_Browser $df_entry ] "\\" ]
+ set iattributes {}
+ foreach fullname $attributes {
+ set num [expr $num + 1]
+ lappend fullname $num
+ lappend iattributes $fullname
+ }
+
+ foreach fullname [lsort $iattributes] {
+
+ # Information first split
+ set tmplist [split $fullname " "]
+ set name [lindex $tmplist 0]
+ set transaction [lindex $tmplist 1]
+ set valid [lindex $tmplist 2]
+ set forgotten [lindex $tmplist 3]
+ set backuped [lindex $tmplist 4]
+ set maybeopen [lindex $tmplist 5]
+
+ # Name analysis to suppress the map address.
+ set shortlist [split $name "#"]
+ set shortname [lindex $shortlist 0]
+ set index [lindex $shortlist 1]
+
+ # Package analysis to determine the icon type.
+ #set pk [lindex [split $name _] 0]
+ set node_img $image_other
+ #if {$pk == "TDataStd" || $pk == "TNaming"} {set node_img $standardimage}
+ #if {$pk == "TXRef"} {set node_img $xrefimage}
+ if {$shortname == "TNaming_NamedShape"} {set node_img $image_ns}
+
+ set textname "$shortname"
+
+# if { [llength $tmplist] >5 } { set textname [lindex $tmplist 5] }
+ set textname "$textname [DFGetAttributeValue $DDF_Browser $df_entry [lindex $tmplist 6]]"
+
+ # Transaction analysis
+ if {$transaction == "0"} {
+# set locstyle $DFTREE_AttributeStyle
+ } else {
+# set textname "$textname T=$transaction"
+# set locstyle $DFTREE_AttributeStyle1
+ }
+
+ # Valid?
+ if {$valid == "NotValid"} {set textname "$textname $valid"}
+
+ # Forgotten?
+ if {$forgotten == "Forgotten"} {set textname "$textname $forgotten"}
+
+ # Backuped?
+ if {$backuped == "Backuped"} {set textname "$textname $backuped"}
+
+ set df_new [$df_tree insert $df_node end \
+ -text $textname -image $node_img -tags Attribute]
+
+ if {$maybeopen == "1"} {
+ $df_tree item $df_new -open true
+ DFTREE:Tree:UpdateAttribute $DDF_Browser $df_tree $df_new $index
+ }
+ }
+}
+
+###############################################################################
+# $loc is always the attribute index
+#
+proc DFTREE:Tree:UpdateAttribute { DDF_Browser df_tree df_node a_index } {
+
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ set tmplist [split [DFOpenAttribute $DDF_Browser $a_index ] "\\"]
+
+ # Failed or not?
+ if {[lindex $tmplist 0] == "Failed"} {
+## set locstyle $DFTREE_AttributeStyle2
+ } else {
+## set locstyle $DFTREE_AttributeStyle
+ }
+
+ foreach name $tmplist {
+ $df_tree insert $df_node end -text $name -tags Terminal
+ }
+ return
+}
+
+###############################################################################
+# item:
+# "Entry Name=TheNameIfExists Modified|NotModified 0|1"
+proc FCTREE:Tree:DecodeLabelItem { DDF_Browser df_tree df_node df_entry labelItem} {
+
+ global DFTREE_GLOBALS
+ global $DDF_Browser
+
+ set tmplist [split $labelItem " " ]
+ set labname [lindex $tmplist 0]
+
+ set textname "$labname"
+
+ if {$labname == "AttributeList"} {
+
+ # Attribute List
+ # --------------
+
+ #set modified [lindex $tmplist 1]
+
+ # Modified or not?
+ #if {$modified == "Modified"} {
+ # set textname "$textname $modified"
+## set locstyle $DFTREE_AttributeStyle1
+ #} else {
+## set locstyle $DFTREE_AttributeStyle
+ #}
+
+ #set df_new [$df_tree insert $df_node end \
+ # -text $textname \
+ # -image $DFTREE_GLOBALS(ImageAttrList) \
+ # -tags AttributeList]
+
+ #$df_tree item $df_new -open true
+
+ DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $df_entry
+
+ } else {
+
+ # Sub-label(s)
+ # ------------
+
+ set name [lindex $tmplist 1]
+ set modified [lindex $tmplist 2]
+ set maybeopen [lindex $tmplist 3]
+
+ # Name?
+ set ll [expr [string length $name] -2]
+ if {$ll > 0} {
+ set textname "$textname [string range $name 1 $ll]"
+ }
+
+ # Modified or not?
+ if {$modified == "Modified"} {
+ set textname "$textname $modified"
+ }
+
+ set df_new [$df_tree insert $df_node end \
+ -text $textname \
+ -image $DFTREE_GLOBALS(ImageLabel) \
+ -values $labname \
+ -tags Label]
+
+ if {$maybeopen == "1"} {
+ $df_tree item $df_new -open true
+ }
+
+ DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_new $labname
+ }
+}
+
+###############################################################################
+#
+#
+proc DFGetAttributeValue { DDF_Browser lab index } {
+
+ global $DDF_Browser; # necessary for DRAW command to see the browser
+
+ if {[catch "XAttributeValue $DDF_Browser $lab $index" ret]} {
+ return ""
+ }
+ if {"$ret" == ""} { return "" }
+ return "\[$ret\]"
+}
+
+###############################################################################
+#
+#
+proc DFOpenImage { img } {
+
+ global env
+
+ if {[catch "image create photo -file $env(CSF_OCCTResourcePath)/DrawResources/$img" ret]} {
+ return ""
+ }
+ return $ret
+}
--- /dev/null
+msgfile:::SHAPE.fr
+msgfile:::SHAPE.us
--- /dev/null
+! Message file for Shape Healing
+
+
+! ------------------------------------------------------------------------------
+! Messages for shape names
+!
+.Name.Shape.MSG0
+!
+.Name.Vertex.MSG0
+!
+.Name.Edge.MSG0
+!
+.Name.Wire.MSG0
+!
+.Name.Face.MSG0
+!
+.Name.Shell.MSG0
+!
+.Name.Solid.MSG0
+!
+.Name.CompSolid.MSG0
+!
+.Name.Compound.MSG0
+!
+! ------------------------------------------------------------------------------
+! Messages for sequence of operators
+!
+.SP.Sequence.Info.Seq
+Sequence d'operateurs: %s
+!
+.SP.Sequence.Info.Operator
+Operateur %d/%d: %s
+!
+.SP.Sequence.Error.NoOp
+Error: Operator %s is not found
+!
+.SP.Sequence.Error.Except
+Error: Operator %s failed with exception %s
+!
+.SP.Sequence.Warn.NoSeq
+Warning: Shape Processing: sequence not defined for %s
+!
+! ------------------------------------------------------------------------------
+! Messages for printing results of shape processing
+!
+.PrResult.Print.MSG50
+ Shells:
+!
+.PrResult.Print.MSG55
+ Faces:
+!
+.PrResult.Print.MSG100
+Mapping:
+!
+.PrResult.Print.MSG110
+ Le Resultat est un Shell : %d
+!
+.PrResult.Print.MSG115
+ Le Resultat est une Face : %d
+!
+.PrResult.Print.MSG150
+ Pas de Resultat : %d
+!
+.PrResult.Print.MSG200
+Taux de Preparation:
+!
+.PrResult.Print.MSG205
+ Shells: %d pour cent
+!
+.PrResult.Print.MSG210
+ Faces : %d pour cent
+!
+!
+! ==============================================================================
+! Messages for Shape Healing
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wire
+!
+.FixWire.FixDegenerated.MSG0
+Detection d'Arete(s) degeneree(s)
+!
+.FixWire.FixDegenerated.MSG5
+L'Arete n0 %d est degeneree
+!
+.FixWire.FixCurve3d.Removed
+Incomplete edge (with no pcurves or 3d curve) removed
+!
+.FixAdvWire.FixSmall.MSG0
+Petite(s) arete(s) supprimee(s)
+!
+.FixAdvWire.FixSmall.MSG5
+L'arete n0 %d etait petite, supprimee
+!
+.FixAdvWire.FixIntersection.MSG0
+Auto-intersection corrigee
+!
+.FixAdvWire.FixIntersection.MSG5
+L'arete etait auto-intersectante, corrigee
+!
+.FixAdvWire.FixIntersection.MSG10
+Les aretes s'intersectent, corrigees
+!
+.FixAdvWire.FixLacking.MSG0
+Insertion d'arete(s) manquante(s)
+!
+.FixAdvWire.FixLacking.MSG5
+Arete n0 %d manquante, inseree
+!
+.FixAdvWire..MSG0
+!
+.FixAdvWire..MSG5
+!
+.FixAdvWire..MSG10
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Face
+!
+.FixAdvFace.FixMissingSeam.MSG0
+Arete de couture manquante, ajoutee
+!
+.FixAdvFace.FixSmallAreaWire.MSG0
+Contour d'aire nulle, supprime
+!
+.FixAdvFace.FixOrientation.MSG0
+Face creee avec bords naturels
+!
+.FixAdvFace.FixOrientation.MSG5
+Contour sur face inverse
+!
+.FixAdvFace.FixOrientation.MSG11
+Impossible d'orienter le contour
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wireframe
+!
+.FixWireframe.FixSmallEdges.MSG0
+Small edge removed
+!
+.FixWireframe.FixSmallEdges.MSG1
+Small wire removed
+!
+.FixWireframe.FixSmallEdges.MSG2
+Small face removed
+!
+.FixWireframe.FixFixWireGaps.MSG0
+Gaps in a wire fixed
+!
+!
+.Fix.SplitCommonVertex.MSG0
+Wires with common vertex fixed
+!
+!
+.FixAdvShell.FixOrientation.MSG20
+Impossible d'orienter les faces dans le shell, creation de plusieurs shells
+!
+.FixAdvShell.FixOrientation.MSG30
+Shell avec connexions incorrectes, divise en plusieurs parties
+!
+.FixAdvSolid.FixShell.MSG10
+Impossible de creer un Solide a partir d'un shell ouvert
+!
+.FixAdvSolid.FixOrientation.MSG20
+L'Orientation du/des shell(s) dans le solida ete corrigee
+!
+.FixAdvSolid.FixOrientation.MSG30
+Solide avec connexions incorrectes, divise en plusieurs parties
+!
+.FixAdvFace.FixLoopWire.MSG0
+Wire was split on several wires
+!
+.FixAdvFace..MSG5
+!
+.FixAdvFace..MSG10
+!
+.FixEdge.SameParameter.MSG0
+Not same parameter edge fixed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallFace
+!
+.FixAdvFace.FixSpotFace.MSG0
+Spot face removed
+!
+.FixAdvFace.FixStripFace.MSG0
+Strip face removed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallSolid
+!
+.ShapeFix.FixSmallSolid.MSG0
+Small solid removed
+!
+.ShapeFix.FixSmallSolid.MSG1
+Small solid merged with other
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Shell
+!
+.FixAdvShell.FixOrientation.MSG0
+Faces mal orientees dans le shell, corrigees
+!
+.FixAdvShell.FixOrientation.MSG5
+Faces mal orientees dans le shell, non corrigees
+!
+.FixAdvShell.FixClosedFlag.MSG0
+Shell has incorrect flag isClosed
+!
+.FixAdvShell..MSG5
+!
+.FixAdvShell..MSG10
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeUpgrade
+!
+.ShapeDivide.FaceDivide.MSG0
+Face divided
+!
+.ShapeDivide.WireDivide.MSG0
+Wire divided
+!
+.ShapeDivide.EdgeDivide.MSG0
+Edge divided
+!
+.ShapeDivide.FaceConvertToBezier.MSG0
+Face converted to Bezier
+!
+.ShapeDivide.WireConvertToBezier.MSG0
+Wire converted to Bezier
+!
+.ShapeDivide.EdgeConvertToBezier.MSG0
+Edge converted to Bezier
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeCustom
+!
+.BSplineRestriction.NewSurface.MSG0
+Face converted to BSpline
+!
+.BSplineRestriction.NewSurface.MSG1
+BSpline Face re-approximated
+!
+.BSplineRestriction.NewCurve.MSG0
+Edge converted to BSpline
+!
+.BSplineRestriction.NewCurve.MSG1
+BSpline Edge re-approximated
+!
+!
+.ConvertToBSpline.NewSurface.MSG0
+Face converted to BSpline
+!
+.ConvertToBSpline.NewCurve.MSG0
+Edge converted to BSpline
+!
+!
+.ConvertToRevolution.NewSurface.MSG0
+Face converted to surface of revolution
+!
+!
+.DirectModification.NewSurface.MSG0
+Direction of Face of revolution corrected
+!
+!
+.SweptToElementary.NewSurface.MSG0
+Swept Face converted to elementary
+!
--- /dev/null
+
+! Message file for Shape Healing
+
+
+! ------------------------------------------------------------------------------
+! Messages for shape names
+!
+.Name.Shape.MSG0
+!
+.Name.Vertex.MSG0
+!
+.Name.Edge.MSG0
+!
+.Name.Wire.MSG0
+!
+.Name.Face.MSG0
+!
+.Name.Shell.MSG0
+!
+.Name.Solid.MSG0
+!
+.Name.CompSolid.MSG0
+!
+.Name.Compound.MSG0
+!
+! ------------------------------------------------------------------------------
+! Messages for sequence of operators
+!
+.SP.Sequence.Info.Seq
+Info: Shape Processing: Sequence of operators: %s
+!
+.SP.Sequence.Info.Operator
+Info: Shape Processing: Operator %d/%d: %s
+!
+.SP.Sequence.Error.NoOp
+Error: Shape Processing: Operator %s is not found
+!
+.SP.Sequence.Error.Except
+Error: Shape Processing: Operator %s failed with exception %s
+!
+.SP.Sequence.Warn.NoSeq
+Warning: Shape Processing: Sequence not defined for %s, nothing to do
+!
+! ------------------------------------------------------------------------------
+! Messages for printing results of shape processing
+!
+.PrResult.Print.MSG50
+ Shells:
+!
+.PrResult.Print.MSG55
+ Faces:
+!
+.PrResult.Print.MSG100
+Mapping:
+!
+.PrResult.Print.MSG110
+ Result is Shell : %d
+!
+.PrResult.Print.MSG115
+ Result is Face : %d
+!
+.PrResult.Print.MSG150
+ No Result : %d
+!
+.PrResult.Print.MSG200
+Preparation ratio:
+!
+.PrResult.Print.MSG205
+ Shells: %d per cent
+!
+.PrResult.Print.MSG210
+ Faces : %d per cent
+!
+! ==============================================================================
+! Messages for Shape Healing
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wire
+!
+.FixWire.FixDegenerated.MSG0
+Degenerated edge(s) detected
+!
+.FixWire.FixDegenerated.MSG5
+Degenerated edge %d detected
+!
+.FixWire.FixCurve3d.Removed
+Incomplete edge (with no pcurves or 3d curve) removed
+!
+.FixAdvWire.FixSmall.MSG0
+Small edge(s) removed
+!
+.FixAdvWire.FixSmall.MSG5
+Edge %d was small, removed
+!
+.FixAdvWire.FixIntersection.MSG0
+Self-intersection corrected
+!
+.FixAdvWire.FixIntersection.MSG5
+Edge was self-intersecting, corrected
+!
+.FixAdvWire.FixIntersection.MSG10
+Edges were intersecting, corrected
+!
+.FixAdvWire.FixLacking.MSG0
+Lacking edge(s) inserted
+!
+.FixAdvWire.FixLacking.MSG5
+Lacking edge %d inserted
+!
+.FixAdvWire..MSG0
+!
+.FixAdvWire..MSG5
+!
+.FixAdvWire..MSG10
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Face
+!
+.FixAdvFace.FixMissingSeam.MSG0
+Missing seam-edge added
+!
+.FixAdvFace.FixSmallAreaWire.MSG0
+Null area wire detected, wire skipped
+!
+.FixAdvFace.FixOrientation.MSG0
+Face created with natural bounds
+!
+.FixAdvFace.FixOrientation.MSG5
+Wire on face was reversed
+!
+.FixAdvFace.FixOrientation.MSG11
+Cannot orient wire
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wireframe
+!
+.FixWireframe.FixSmallEdges.MSG0
+Small edge removed
+!
+.FixWireframe.FixSmallEdges.MSG1
+Small wire removed
+!
+.FixWireframe.FixSmallEdges.MSG2
+Small face removed
+!
+.FixWireframe.FixFixWireGaps.MSG0
+Gaps in a wire fixed
+!
+!
+.Fix.SplitCommonVertex.MSG0
+Wires with common vertex fixed
+!
+!
+.FixAdvShell.FixOrientation.MSG20
+Impossible to orient faces in shell, several shells created
+!
+.FixAdvShell.FixOrientation.MSG30
+Improperly connected shell split into parts
+!
+.FixAdvSolid.FixShell.MSG10
+Solid cannot be created from an open shell
+!
+.FixAdvSolid.FixOrientation.MSG20
+Orientation of shell(s) in solid was corrected
+!
+.FixAdvSolid.FixOrientation.MSG30
+Improperly connected solid split into several parts
+!
+.FixAdvFace.FixLoopWire.MSG0
+Wire was split on several wires
+!
+.FixAdvFace..MSG5
+!
+.FixAdvFace..MSG10
+!
+.FixEdge.SameParameter.MSG0
+Not same parameter edge fixed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallFace
+!
+.FixAdvFace.FixSpotFace.MSG0
+Spot face removed
+!
+.FixAdvFace.FixStripFace.MSG0
+Strip face removed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallSolid
+!
+.ShapeFix.FixSmallSolid.MSG0
+Small solid removed
+!
+.ShapeFix.FixSmallSolid.MSG1
+Small solid merged with other
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Shell
+!
+.FixAdvShell.FixOrientation.MSG0
+Faces were incorrectly oriented in the shell, corrected
+!
+.FixAdvShell.FixOrientation.MSG5
+Faces were incorrectly oriented in the shell, not corrected
+!
+.FixAdvShell.FixClosedFlag.MSG0
+Shell has incorrect flag isClosed
+!
+.FixAdvShell..MSG5
+!
+.FixAdvShell..MSG10
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeUpgrade
+!
+.ShapeDivide.FaceDivide.MSG0
+Face divided
+!
+.ShapeDivide.WireDivide.MSG0
+Wire divided
+!
+.ShapeDivide.EdgeDivide.MSG0
+Edge divided
+!
+.ShapeDivide.FaceConvertToBezier.MSG0
+Face converted to Bezier
+!
+.ShapeDivide.WireConvertToBezier.MSG0
+Wire converted to Bezier
+!
+.ShapeDivide.EdgeConvertToBezier.MSG0
+Edge converted to Bezier
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeCustom
+!
+.BSplineRestriction.NewSurface.MSG0
+Face converted to BSpline
+!
+.BSplineRestriction.NewSurface.MSG1
+BSpline Face re-approximated
+!
+.BSplineRestriction.NewCurve.MSG0
+Edge converted to BSpline
+!
+.BSplineRestriction.NewCurve.MSG1
+BSpline Edge re-approximated
+!
+!
+.ConvertToBSpline.NewSurface.MSG0
+Face converted to BSpline
+!
+.ConvertToBSpline.NewCurve.MSG0
+Edge converted to BSpline
+!
+!
+.ConvertToRevolution.NewSurface.MSG0
+Face converted to surface of revolution
+!
+!
+.DirectModification.NewSurface.MSG0
+Direction of Face of revolution corrected
+!
+!
+.SweptToElementary.NewSurface.MSG0
+Swept Face converted to elementary
+!
--- /dev/null
+
+//! @file Declarations.glsl includes definition of common uniform variables in OCCT GLSL programs
+//! @def THE_MAX_LIGHTS
+//! Specifies the length of array of lights, which is 8 by default. Defined by Shader Manager.
+// #define THE_MAX_LIGHTS 8
+
+//! @def THE_MAX_CLIP_PLANES
+//! Specifies the length of array of clipping planes, which is 8 by default. Defined by Shader Manager.
+// #define THE_MAX_CLIP_PLANES 8
+
+//! @def THE_NB_FRAG_OUTPUTS
+//! Specifies the length of array of Fragment Shader outputs, which is 1 by default. Defined by Shader Manager.
+// #define THE_NB_FRAG_OUTPUTS 1
+
+// compatibility macros
+#if (__VERSION__ >= 130)
+ #define THE_ATTRIBUTE in
+ #define THE_SHADER_IN in
+ #define THE_SHADER_OUT out
+ #define THE_OUT out
+ #define occTexture1D texture
+ #define occTexture2D texture
+ #define occTexture3D texture
+ #define occTextureCube texture
+ #define occTextureCubeLod textureLod
+#else
+ #define THE_ATTRIBUTE attribute
+ #define THE_SHADER_IN varying
+ #define THE_SHADER_OUT varying
+ #define THE_OUT
+ #define occTexture1D texture1D
+ #define occTexture2D texture2D
+ #define occTexture3D texture3D
+ #define occTextureCube textureCube
+ #if !defined(GL_ES) || defined(textureCubeLod)
+ #define occTextureCubeLod textureCubeLod
+ #else // fallback
+ #define occTextureCubeLod(theSampl,theCoord,theLod) textureCube(theSampl,theCoord)
+ #endif
+#endif
+
+#ifdef GL_ES
+#if (__VERSION__ >= 300)
+ #define THE_PREC_ENUM highp // lowp should be enough for enums but triggers driver bugs
+#else
+ #define THE_PREC_ENUM lowp
+#endif
+#else
+ #define THE_PREC_ENUM
+#endif
+
+// Vertex attributes
+#ifdef VERTEX_SHADER
+ THE_ATTRIBUTE vec4 occVertex;
+ THE_ATTRIBUTE vec3 occNormal;
+ THE_ATTRIBUTE vec4 occTexCoord;
+ THE_ATTRIBUTE vec4 occVertColor;
+#elif defined(FRAGMENT_SHADER)
+ #if (__VERSION__ >= 130)
+ #ifdef OCC_ENABLE_draw_buffers
+ out vec4 occFragColorArray[THE_NB_FRAG_OUTPUTS];
+ #define occFragColorArrayAlias occFragColorArray
+ #define occFragColor0 occFragColorArray[0]
+ #else
+ out vec4 occFragColor0;
+ #endif
+ #else
+ #ifdef OCC_ENABLE_draw_buffers
+ #define occFragColorArrayAlias gl_FragData
+ #define occFragColor0 gl_FragData[0]
+ #else
+ #define occFragColor0 gl_FragColor
+ #endif
+ #endif
+
+ #if (THE_NB_FRAG_OUTPUTS >= 2)
+ #define occFragColor1 occFragColorArrayAlias[1]
+ #else
+ vec4 occFragColor1;
+ #endif
+ #if (THE_NB_FRAG_OUTPUTS >= 3)
+ #define occFragColor2 occFragColorArrayAlias[2]
+ #else
+ vec4 occFragColor2;
+ #endif
+ #if (THE_NB_FRAG_OUTPUTS >= 4)
+ #define occFragColor3 occFragColorArrayAlias[3]
+ #else
+ vec4 occFragColor3;
+ #endif
+
+ // Built-in outputs notation
+ #define occFragColor occFragColor0
+ #define occFragCoverage occFragColor1
+
+ #define occPeelDepth occFragColor0
+ #define occPeelFrontColor occFragColor1
+ #define occPeelBackColor occFragColor2
+
+ //! Define the main Fragment Shader early return procedure.
+ bool occFragEarlyReturn();
+
+ //! Define the main Fragment Shader output - color value.
+ void occSetFragColor (in vec4 theColor);
+#endif
+
+// Pi number definitions
+#define PI 3.141592654
+#define PI_2 6.283185307
+#define PI_DIV_2 1.570796327
+#define PI_DIV_3 1.047197551
+#define PI_DIV_4 0.785398163
+#define INV_PI 0.318309886
+#define INV_PI_2 0.159154943
+
+// Matrix state
+uniform mat4 occWorldViewMatrix; //!< World-view matrix
+uniform mat4 occProjectionMatrix; //!< Projection matrix
+uniform mat4 occModelWorldMatrix; //!< Model-world matrix
+
+uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix
+uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix
+uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix
+
+uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix
+uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix
+uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix
+
+uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix
+uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix
+uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix
+
+#if defined(THE_IS_PBR)
+uniform sampler2D occEnvLUT; //!< Environment Lookup Table
+uniform sampler2D occDiffIBLMapSHCoeffs; //!< Packed diffuse (irradiance) IBL map's spherical harmonics coefficients
+uniform samplerCube occSpecIBLMap; //!< Specular IBL map
+uniform int occNbSpecIBLLevels; //!< Number of mipmap levels used in occSpecIBLMap to store different roughness values maps
+
+vec3 occDiffIBLMap (in vec3 theNormal); //!< Unpacks spherical harmonics coefficients to diffuse IBL map's values
+#endif
+
+// light type enumeration (same as Graphic3d_TypeOfLightSource)
+const int OccLightType_Direct = 1; //!< directional light source
+const int OccLightType_Point = 2; //!< isotropic point light source
+const int OccLightType_Spot = 3; //!< spot light source
+
+// Light sources
+uniform vec4 occLightAmbient; //!< Cumulative ambient color
+#if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
+#if (THE_MAX_LIGHTS > 1)
+ #define occLight_Index(theId) theId
+#else
+ #define occLight_Index(theId) 0
+#endif
+uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources
+
+//! Type of light source, int (see OccLightType enum).
+#define occLight_Type(theId) occLightSourcesTypes[occLight_Index(theId)]
+
+//! Specular intensity (equals to diffuse), vec3.
+#define occLight_Specular(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
+
+//! Intensity of light source (>= 0), float.
+#define occLight_Intensity(theId) occLightSources[occLight_Index(theId) * 4 + 0].a
+
+//! Is light a headlight, bool? DEPRECATED method.
+#define occLight_IsHeadlight(theId) false
+
+//! Position of specified light source or direction of directional light source, vec3.
+#define occLight_Position(theId) occLightSources[occLight_Index(theId) * 4 + 1].xyz
+
+//! Direction of specified spot light source, vec3.
+#define occLight_SpotDirection(theId) occLightSources[occLight_Index(theId) * 4 + 2].xyz
+
+//! Range on which point light source (positional or spot) can affect (>= 0), float.
+#define occLight_Range(theId) occLightSources[occLight_Index(theId) * 4 + 2].w
+
+//! Maximum spread angle of the spot light (in radians), float.
+#define occLight_SpotCutOff(theId) occLightSources[occLight_Index(theId) * 4 + 3].z
+
+//! Attenuation of the spot light intensity (from 0 to 1), float.
+#define occLight_SpotExponent(theId) occLightSources[occLight_Index(theId) * 4 + 3].w
+
+#if !defined(THE_IS_PBR)
+//! Diffuse intensity (equals to Specular), vec3.
+#define occLight_Diffuse(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
+
+//! Const attenuation factor of positional light source, float.
+#define occLight_ConstAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].x
+
+//! Linear attenuation factor of positional light source, float.
+#define occLight_LinearAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].y
+#endif
+#endif
+
+#if defined(THE_IS_PBR)
+//! Converts roughness value from range [0, 1] to real value for calculations
+float occRoughness (in float theNormalizedRoughness);
+
+// Front/back material properties accessors
+vec4 occPBRMaterial_Color(in bool theIsFront); //!< Base color of PBR material
+float occPBRMaterial_Metallic(in bool theIsFront); //!< Metallic coefficient
+float occPBRMaterial_NormalizedRoughness(in bool theIsFront); //!< Normalized roughness coefficient
+vec3 occPBRMaterial_Emission(in bool theIsFront); //!< Light intensity emitted by material
+float occPBRMaterial_IOR(in bool theIsFront); //!< Index of refraction
+#define occMaterial_Emission occPBRMaterial_Emission
+#define occMaterial_Color occPBRMaterial_Color
+#else
+vec4 occMaterial_Diffuse(in bool theIsFront); //!< Diffuse reflection
+vec3 occMaterial_Specular(in bool theIsFront); //!< Specular reflection
+float occMaterial_Shininess(in bool theIsFront); //!< Specular exponent
+vec3 occMaterial_Ambient(in bool theIsFront); //!< Ambient reflection
+vec3 occMaterial_Emission(in bool theIsFront); //!< Emission color
+#define occMaterial_Color occMaterial_Diffuse
+#endif
+
+#ifdef THE_HAS_DEFAULT_SAMPLER
+#define occActiveSampler occSampler0 //!< alias for backward compatibility
+#define occSamplerBaseColor occSampler0 //!< alias to a base color texture
+uniform sampler2D occSampler0; //!< current active sampler;
+#endif //! occSampler1, occSampler2,... should be defined in GLSL program body for multitexturing
+
+#if defined(THE_HAS_TEXTURE_COLOR) && defined(FRAGMENT_SHADER)
+#define occMaterialBaseColor(theIsFront, theTexCoord) (occMaterial_Color(theIsFront) * occTexture2D(occSamplerBaseColor, theTexCoord))
+#else
+#define occMaterialBaseColor(theIsFront, theTexCoord) occMaterial_Color(theIsFront)
+#endif
+
+#if defined(THE_HAS_TEXTURE_OCCLUSION) && defined(FRAGMENT_SHADER)
+uniform sampler2D occSamplerOcclusion; //!< R occlusion texture sampler
+#define occMaterialOcclusion(theColor, theTexCoord) theColor *= occTexture2D(occSamplerOcclusion, theTexCoord).r;
+#else
+#define occMaterialOcclusion(theColor, theTexCoord)
+#endif
+
+#if defined(THE_HAS_TEXTURE_EMISSIVE) && defined(FRAGMENT_SHADER)
+uniform sampler2D occSamplerEmissive; //!< RGB emissive texture sampler
+#define occMaterialEmission(theIsFront, theTexCoord) (occMaterial_Emission(theIsFront) * occTexture2D(occSamplerEmissive, theTexCoord).rgb)
+#else
+#define occMaterialEmission(theIsFront, theTexCoord) occMaterial_Emission(theIsFront)
+#endif
+
+#if defined(THE_HAS_TEXTURE_NORMAL) && defined(FRAGMENT_SHADER)
+uniform sampler2D occSamplerNormal; //!< XYZ normal texture sampler with W==0 indicating no texture
+#define occTextureNormal(theTexCoord) occTexture2D(occSamplerNormal, theTexCoord)
+#else
+#define occTextureNormal(theTexCoord) vec4(0.0) // no normal map
+#endif
+
+#if defined(THE_HAS_TEXTURE_METALROUGHNESS) && defined(FRAGMENT_SHADER)
+uniform sampler2D occSamplerMetallicRoughness; //!< BG metallic-roughness texture sampler
+#define occMaterialRoughness(theIsFront, theTexCoord) (occPBRMaterial_NormalizedRoughness(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).g)
+#define occMaterialMetallic(theIsFront, theTexCoord) (occPBRMaterial_Metallic(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).b)
+#else
+#define occMaterialRoughness(theIsFront, theTexCoord) occPBRMaterial_NormalizedRoughness(theIsFront)
+#define occMaterialMetallic(theIsFront, theTexCoord) occPBRMaterial_Metallic(theIsFront)
+#endif
+
+uniform vec4 occColor; //!< color value (in case of disabled lighting)
+uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?
+uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?
+uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters
+uniform float occPointSize; //!< point size
+
+//! Parameters of blended order-independent transparency rendering algorithm
+uniform int occOitOutput; //!< Enable bit for writing output color buffers for OIT (occFragColor, occFragCoverage)
+uniform float occOitDepthFactor; //!< Influence of the depth component to the coverage of the accumulated fragment
+uniform float occAlphaCutoff; //!< alpha test cutoff value
+
+//! Parameters of clipping planes
+#if defined(THE_MAX_CLIP_PLANES) && (THE_MAX_CLIP_PLANES > 0)
+uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];
+uniform THE_PREC_ENUM int occClipPlaneChains[THE_MAX_CLIP_PLANES]; //! Indicating the number of planes in the Chain
+uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes
+#endif
+//! @endfile Declarations.glsl
--- /dev/null
+
+//! @file DeclarationsImpl.glsl includes implementation of common functions and properties accessors
+#if defined(FRAGMENT_SHADER)
+
+#if defined(OCC_DEPTH_PEEL_OIT)
+uniform sampler2D occDepthPeelingDepth;
+uniform sampler2D occDepthPeelingFrontColor;
+int IsFrontPeelLayer = -1;
+bool occFragEarlyReturn()
+{
+ #define THE_DEPTH_CLEAR_VALUE -1e15f
+ ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
+ vec2 aLastDepth = texelFetch (occDepthPeelingDepth, aFragCoord, 0).rg;
+ occPeelFrontColor = texelFetch (occDepthPeelingFrontColor, aFragCoord, 0);
+ occPeelDepth.rg = vec2 (THE_DEPTH_CLEAR_VALUE); // depth value always increases, so that MAX blend equation can be used
+ occPeelBackColor = vec4 (0.0); // back color is blend after each peeling pass
+
+ float aNearDepth = -aLastDepth.x;
+ float aFarDepth = aLastDepth.y;
+ float aFragDepth = gl_FragCoord.z; // 0 - 1
+ if (aFragDepth < aNearDepth || aFragDepth > aFarDepth)
+ {
+ return true; // skip peeled depth
+ }
+ else if (aFragDepth > aNearDepth && aFragDepth < aFarDepth)
+ {
+ // to be rendered at next peeling pass
+ occPeelDepth.rg = vec2 (-aFragDepth, aFragDepth);
+ return true;
+ }
+
+ IsFrontPeelLayer = (gl_FragCoord.z == aNearDepth) ? 1 : 0;
+ return false;
+}
+#else
+bool occFragEarlyReturn() { return false; }
+#endif
+
+void occSetFragColor (in vec4 theColor)
+{
+#if defined(OCC_ALPHA_TEST)
+ if (theColor.a < occAlphaCutoff) discard;
+#endif
+#if defined(OCC_WRITE_WEIGHT_OIT_COVERAGE)
+ float aWeight = theColor.a * clamp (1e+2 * pow (1.0 - gl_FragCoord.z * occOitDepthFactor, 3.0), 1e-2, 1e+2);
+ occFragCoverage.r = theColor.a * aWeight;
+ occFragColor = vec4 (theColor.rgb * theColor.a * aWeight, theColor.a);
+#elif defined(OCC_DEPTH_PEEL_OIT)
+ if (IsFrontPeelLayer == 1) // front is blended directly
+ {
+ vec4 aLastColor = occPeelFrontColor;
+ float anAlphaMult = 1.0 - aLastColor.a;
+ occPeelFrontColor.rgb = aLastColor.rgb + theColor.rgb * theColor.a * anAlphaMult;
+ occPeelFrontColor.a = 1.0 - anAlphaMult * (1.0 - theColor.a);
+ }
+ else if (IsFrontPeelLayer == 0) // back is blended afterwards
+ {
+ occPeelBackColor = theColor;
+ }
+#else
+ occFragColor = theColor;
+#endif
+}
+#endif
+
+#if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
+// arrays of light sources
+uniform vec4 occLightSources[THE_MAX_LIGHTS * 4]; //!< packed light sources parameters
+uniform THE_PREC_ENUM int occLightSourcesTypes[THE_MAX_LIGHTS]; //!< packed light sources types
+#endif
+
+#if defined(THE_IS_PBR)
+vec3 occDiffIBLMap (in vec3 theNormal)
+{
+ vec3 aSHCoeffs[9];
+ for (int i = 0; i < 9; ++i)
+ {
+ aSHCoeffs[i] = occTexture2D (occDiffIBLMapSHCoeffs, vec2 ((float(i) + 0.5) / 9.0, 0.0)).rgb;
+ }
+ return aSHCoeffs[0]
+
+ + aSHCoeffs[1] * theNormal.x
+ + aSHCoeffs[2] * theNormal.y
+ + aSHCoeffs[3] * theNormal.z
+
+ + aSHCoeffs[4] * theNormal.x * theNormal.z
+ + aSHCoeffs[5] * theNormal.y * theNormal.z
+ + aSHCoeffs[6] * theNormal.x * theNormal.y
+
+ + aSHCoeffs[7] * (3.0 * theNormal.z * theNormal.z - 1.0)
+ + aSHCoeffs[8] * (theNormal.x * theNormal.x - theNormal.y * theNormal.y);
+}
+#endif
+
+// front and back material properties accessors
+#if defined(THE_IS_PBR)
+uniform vec4 occPbrMaterial[3 * 2];
+
+#define MIN_ROUGHNESS 0.01
+float occRoughness (in float theNormalizedRoughness) { return theNormalizedRoughness * (1.0 - MIN_ROUGHNESS) + MIN_ROUGHNESS; }
+vec4 occPBRMaterial_Color(in bool theIsFront) { return theIsFront ? occPbrMaterial[0] : occPbrMaterial[3]; }
+vec3 occPBRMaterial_Emission(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].rgb : occPbrMaterial[4].rgb; }
+float occPBRMaterial_IOR(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].w : occPbrMaterial[4].w; }
+float occPBRMaterial_Metallic(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].b : occPbrMaterial[5].b; }
+float occPBRMaterial_NormalizedRoughness(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].g : occPbrMaterial[5].g; }
+#else
+uniform vec4 occCommonMaterial[4 * 2];
+
+vec4 occMaterial_Diffuse(in bool theIsFront) { return theIsFront ? occCommonMaterial[0] : occCommonMaterial[4]; }
+vec3 occMaterial_Emission(in bool theIsFront) { return theIsFront ? occCommonMaterial[1].rgb : occCommonMaterial[5].rgb; }
+vec3 occMaterial_Specular(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].rgb : occCommonMaterial[6].rgb; }
+float occMaterial_Shininess(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].a : occCommonMaterial[6].a; }
+vec3 occMaterial_Ambient(in bool theIsFront) { return theIsFront ? occCommonMaterial[3].rgb : occCommonMaterial[7].rgb; }
+#endif
+
+// 2D texture coordinates transformation
+vec2 occTextureTrsf_Translation(void) { return occTexTrsf2d[0].xy; }
+vec2 occTextureTrsf_Scale(void) { return occTexTrsf2d[0].zw; }
+float occTextureTrsf_RotationSin(void) { return occTexTrsf2d[1].x; }
+float occTextureTrsf_RotationCos(void) { return occTexTrsf2d[1].y; }
+//! @endfile DeclarationsImpl.glsl
--- /dev/null
+#ifdef ADAPTIVE_SAMPLING
+
+ #extension GL_ARB_shader_image_load_store : require
+
+ #extension GL_ARB_shader_image_size : enable
+
+ //! OpenGL image used for accumulating rendering result.
+ volatile restrict layout(r32f) uniform image2D uRenderImage;
+
+ //! OpenGL image storing variance of sampled pixels blocks.
+ volatile restrict layout(r32i) uniform iimage2D uVarianceImage;
+
+ //! Scale factor used to quantize visual error (float) into signed integer.
+ uniform float uVarianceScaleFactor;
+
+ //! Screen space tile size.
+ uniform ivec2 uTileSize;
+
+#else // ADAPTIVE_SAMPLING
+
+ //! Input image.
+ uniform sampler2D uInputTexture;
+
+ //! Ray tracing depth image.
+ uniform sampler2D uDepthTexture;
+
+#endif // ADAPTIVE_SAMPLING
+
+//! Number of accumulated frames.
+uniform int uAccumFrames;
+
+//! Is debug mode enabled for importance screen sampling.
+uniform int uDebugAdaptive;
+
+//! Exposure value for tone mapping.
+uniform float uExposure;
+
+#ifdef TONE_MAPPING_FILMIC
+
+//! White point value for filmic tone mapping.
+uniform float uWhitePoint;
+
+#endif // TONE_MAPPING
+
+//! Output pixel color.
+out vec4 OutColor;
+
+//! RGB weight factors to calculate luminance.
+#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)
+
+// =======================================================================
+// function : ToneMappingFilmic
+// purpose :
+// =======================================================================
+vec4 ToneMappingFilmic(vec4 theColor, float theWhitePoint)
+{
+ vec4 aPackColor = vec4 (theColor.rgb, theWhitePoint);
+ vec4 aFilmicCurve = 1.425f * aPackColor + vec4 (0.05f);
+ vec4 aResultColor = (aPackColor * aFilmicCurve + vec4 (0.004f)) / (aPackColor * (aFilmicCurve + vec4 (0.55f)) + vec4 (0.0491f)) - vec4 (0.0821f);
+ return vec4 (aResultColor.rgb / aResultColor.www, 1.0);
+}
+
+// =======================================================================
+// function : main
+// purpose :
+// =======================================================================
+void main (void)
+{
+#ifndef ADAPTIVE_SAMPLING
+
+ vec4 aColor = texelFetch (uInputTexture, ivec2 (gl_FragCoord.xy), 0);
+
+#ifdef PATH_TRACING
+ float aDepth = aColor.w; // path tracing uses averaged depth
+#else
+ float aDepth = texelFetch (uDepthTexture, ivec2 (gl_FragCoord.xy), 0).r;
+#endif
+
+ gl_FragDepth = aDepth;
+
+#else // ADAPTIVE_SAMPLING
+
+ ivec2 aPixel = ivec2 (gl_FragCoord.xy);
+
+ vec4 aColor = vec4 (0.0);
+
+ // fetch accumulated color and total number of samples
+ aColor.x = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,
+ 2 * aPixel.y + 0)).x;
+ aColor.y = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,
+ 2 * aPixel.y + 0)).x;
+ aColor.z = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,
+ 2 * aPixel.y + 1)).x;
+ aColor.w = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,
+ 2 * aPixel.y + 1)).x;
+
+ // calculate normalization factor
+ float aSampleWeight = 1.f / max (1.0, aColor.w);
+
+ // calculate averaged depth value
+ gl_FragDepth = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,
+ 2 * aPixel.y + 1)).x * aSampleWeight;
+
+ // calculate averaged radiance for all samples and even samples only
+ float aHalfRad = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,
+ 2 * aPixel.y + 0)).x * aSampleWeight * 2.f;
+
+ float aAverRad = dot (aColor.rgb, LUMA) * aSampleWeight;
+
+ // apply our 'tone mapping' operator (gamma correction and clamping)
+ aHalfRad = min (1.f, sqrt (aHalfRad));
+ aAverRad = min (1.f, sqrt (aAverRad));
+
+ // calculate visual error
+ float anError = (aAverRad - aHalfRad) * (aAverRad - aHalfRad);
+
+ // accumulate visual error to current block; estimated error is written only
+ // after the first 40 samples and path length has reached 10 bounces or more
+ imageAtomicAdd (uVarianceImage, aPixel / uTileSize,
+ int (mix (uVarianceScaleFactor, anError * uVarianceScaleFactor, aColor.w > 40.f)));
+
+ if (uDebugAdaptive == 0) // normal rendering
+ {
+ aColor = vec4 (aColor.rgb * aSampleWeight, 1.0);
+ }
+ else // showing number of samples
+ {
+ vec2 aRatio = vec2 (1.f, 1.f);
+#ifdef GL_ARB_shader_image_size
+ aRatio = vec2 (imageSize (uRenderImage)) / vec2 (3.f * 512.f, 2.f * 512.f);
+#endif
+ aColor = vec4 (0.5f * aColor.rgb * aSampleWeight + vec3 (0.f, sqrt (aRatio.x * aRatio.y) * aColor.w / uAccumFrames * 0.35f, 0.f), 1.0);
+ }
+
+#endif // ADAPTIVE_SAMPLING
+
+#ifdef PATH_TRACING
+
+ aColor *= pow (2.0, uExposure);
+
+#ifdef TONE_MAPPING_FILMIC
+ aColor = ToneMappingFilmic (aColor, uWhitePoint);
+#endif // TONE_MAPPING
+
+#ifdef THE_SHIFT_sRGB
+ // apply gamma correction (we use gamma = 2)
+ OutColor = vec4 (sqrt (aColor.rgb), 0.f);
+#else
+ OutColor = vec4 (aColor.rgb, 0.f);
+#endif
+
+#else // not PATH_TRACING
+
+ OutColor = aColor;
+
+#endif
+}
--- /dev/null
+srcinc:::Declarations.glsl
+srcinc:::DeclarationsImpl.glsl
+srcinc:::LightShadow.glsl
+srcinc:::PBRCookTorrance.glsl
+srcinc:::PBRDirectionalLight.glsl
+srcinc:::PBRDistribution.glsl
+srcinc:::PBREnvBaking.fs
+srcinc:::PBREnvBaking.vs
+srcinc:::PBRFresnel.glsl
+srcinc:::PBRGeometry.glsl
+srcinc:::PBRIllumination.glsl
+srcinc:::PBRPointLight.glsl
+srcinc:::PBRSpotLight.glsl
+srcinc:::PhongShading.fs
+srcinc:::PhongShading.vs
+srcinc:::PhongDirectionalLight.glsl
+srcinc:::PhongPointLight.glsl
+srcinc:::PhongSpotLight.glsl
+srcinc:::PointLightAttenuation.glsl
+srcinc:::Display.fs
+srcinc:::RaytraceBase.fs
+srcinc:::RaytraceRender.fs
+srcinc:::PathtraceBase.fs
+srcinc:::RaytraceBase.vs
+srcinc:::RaytraceSmooth.fs
+srcinc:::TangentSpaceNormal.glsl
+srcinc:::SkydomBackground.fs
--- /dev/null
+#if (__VERSION__ >= 120)
+//! Coefficients for gathering close samples for antialiasing.
+//! Use only with decent OpenGL (array constants cannot be initialized with GLSL 1.1 / GLSL ES 1.1)
+const vec2 occPoissonDisk16[16] = vec2[](
+ vec2(-0.94201624,-0.39906216), vec2( 0.94558609,-0.76890725), vec2(-0.09418410,-0.92938870), vec2( 0.34495938, 0.29387760),
+ vec2(-0.91588581, 0.45771432), vec2(-0.81544232,-0.87912464), vec2(-0.38277543, 0.27676845), vec2( 0.97484398, 0.75648379),
+ vec2( 0.44323325,-0.97511554), vec2( 0.53742981,-0.47373420), vec2(-0.26496911,-0.41893023), vec2( 0.79197514, 0.19090188),
+ vec2(-0.24188840, 0.99706507), vec2(-0.81409955, 0.91437590), vec2( 0.19984126, 0.78641367), vec2( 0.14383161,-0.14100790)
+);
+#endif
+
+//! Function computes directional and spot light shadow attenuation (1.0 means no shadow).
+float occLightShadow (in sampler2D theShadow,
+ in int theId,
+ in vec3 theNormal)
+{
+ vec4 aPosLightSpace = PosLightSpace[occLight_Index(theId)];
+ vec3 aLightDir = occLight_Position (theId);
+ vec3 aProjCoords = (aPosLightSpace.xyz / aPosLightSpace.w);
+#ifdef THE_ZERO_TO_ONE_DEPTH
+ aProjCoords.xy = aProjCoords.xy * 0.5 + vec2 (0.5);
+#else
+ aProjCoords = aProjCoords * 0.5 + vec3 (0.5);
+#endif
+ float aCurrentDepth = aProjCoords.z;
+ if (aProjCoords.x < 0.0 || aProjCoords.x > 1.0
+ || aProjCoords.y < 0.0 || aProjCoords.y > 1.0
+ || aCurrentDepth > 1.0)
+ {
+ return 1.0;
+ }
+
+ vec2 aTexelSize = vec2 (occShadowMapSizeBias.x);
+ float aBias = max (occShadowMapSizeBias.y * (1.0 - dot (theNormal, aLightDir)), occShadowMapSizeBias.y * 0.1);
+#if (__VERSION__ >= 120)
+ float aShadow = 0.0;
+ for (int aPosIter = 0; aPosIter < 16; ++aPosIter)
+ {
+ float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy + occPoissonDisk16[aPosIter] * aTexelSize).r;
+ aShadow += (aCurrentDepth - aBias) > aClosestDepth ? 1.0 : 0.0;
+ }
+ return 1.0 - aShadow / 16.0;
+#else
+ float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy).r;
+ float aShadow = (aCurrentDepth - aBias) > aClosestDepth ? 1.0 : 0.0;
+ return 1.0 - aShadow;
+#endif
+}
--- /dev/null
+//! Calculates Cook-Torrance BRDF.
+vec3 occPBRCookTorrance (in vec3 theView,
+ in vec3 theLight,
+ in vec3 theNormal,
+ in vec3 theBaseColor,
+ in float theMetallic,
+ in float theRoughness,
+ in float theIOR)
+{
+ vec3 aHalf = normalize (theView + theLight);
+ float aCosV = max(dot(theView, theNormal), 0.0);
+ float aCosL = max(dot(theLight, theNormal), 0.0);
+ float aCosH = max(dot(aHalf, theNormal), 0.0);
+ float aCosVH = max(dot(aHalf, theView), 0.0);
+ vec3 aCookTorrance = occPBRDistribution (aCosH, theRoughness)
+ * occPBRGeometry (aCosV, aCosL, theRoughness)
+ * occPBRFresnel (theBaseColor, theMetallic, theIOR, aCosVH);
+ aCookTorrance /= 4.0;
+ return aCookTorrance;
+}
--- /dev/null
+//! Function computes contribution of directional light source
+//! into global variable DirectLighting (PBR shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param theIsFront front/back face flag
+//! @param theShadow shadow attenuation
+void occDirectionalLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in bool theIsFront,
+ in float theShadow)
+{
+ vec3 aLight = occLight_Position (theId);
+ theNormal = theIsFront ? theNormal : -theNormal;
+ DirectLighting += occPBRIllumination (theView, aLight, theNormal,
+ BaseColor, Metallic, Roughness, IOR,
+ occLight_Specular (theId),
+ occLight_Intensity(theId)) * theShadow;
+}
--- /dev/null
+//! Calculates micro facet normals distribution.
+float occPBRDistribution (in float theCosH,
+ in float theRoughness)
+{
+ float aDistribution = theRoughness * theRoughness;
+ aDistribution = aDistribution / (theCosH * theCosH * (aDistribution * aDistribution - 1.0) + 1.0);
+ aDistribution = INV_PI * aDistribution * aDistribution;
+ return aDistribution;
+}
--- /dev/null
+THE_SHADER_IN vec3 ViewDirection; //!< direction of fetching from environment cubemap
+
+#if (__VERSION__ >= 120)
+uniform int uSamplesNum; //!< number of samples in Monte-Carlo integration
+#else
+const int uSamplesNum = 256;
+#endif
+uniform samplerCube uEnvMap; //!< source of baking (environment cubemap)
+
+#ifdef THE_TO_BAKE_DIFFUSE
+uniform int uYCoeff; //!< coefficient of Y controlling horizontal flip of cubemap
+uniform int uZCoeff; //!< coefficient of Z controlling vertical flip of cubemap
+#endif
+
+#ifdef THE_TO_BAKE_SPECULAR
+uniform int uCurrentLevel; //!< current level of specular IBL map (ignored in case of diffuse map's processing)
+uniform float uEnvSolidAngleSource; //!< source solid angle sample computed from one edge's size of source environment map's zero mipmap level
+#endif
+
+//! Returns coordinates of point theNumber from Hammersley point set having size theSize.
+vec2 hammersley (in int theNumber,
+ in int theSize)
+{
+ int aDenominator = 2;
+ int aNumber = theNumber;
+ float aVanDerCorput = 0.0;
+ for (int i = 0; i < 32; ++i)
+ {
+ if (aNumber > 0)
+ {
+ aVanDerCorput += mod(float(aNumber), 2.0) / float(aDenominator);
+ aNumber /= 2;
+ aDenominator *= 2;
+ }
+ }
+ return vec2(float(theNumber) / float(theSize), aVanDerCorput);
+}
+
+//! This function does importance sampling on hemisphere surface using GGX normal distribution function
+//! in tangent space (positive z axis is surface normal direction).
+vec3 importanceSample (in vec2 theHammersleyPoint,
+ in float theRoughness)
+{
+ float aPhi = PI_2 * theHammersleyPoint.x;
+ theRoughness *= theRoughness;
+ theRoughness *= theRoughness;
+ float aCosTheta = sqrt((1.0 - theHammersleyPoint.y) / (1.0 + (theRoughness - 1.0) * theHammersleyPoint.y));
+ float aSinTheta = sqrt(1.0 - aCosTheta * aCosTheta);
+ return vec3(aSinTheta * cos(aPhi),
+ aSinTheta * sin(aPhi),
+ aCosTheta);
+}
+
+//! This function uniformly generates samples on whole sphere.
+vec3 sphereUniformSample (in vec2 theHammersleyPoint)
+{
+ float aPhi = PI_2 * theHammersleyPoint.x;
+ float aCosTheta = 2.0 * theHammersleyPoint.y - 1.0;
+ float aSinTheta = sqrt(1.0 - aCosTheta * aCosTheta);
+ return vec3(aSinTheta * cos(aPhi),
+ aSinTheta * sin(aPhi),
+ aCosTheta);
+}
+
+//! Transforms resulted sampled direction from tangent space to world space considering the surface normal.
+vec3 fromTangentSpace (in vec3 theVector,
+ in vec3 theNormal)
+{
+ vec3 anUp = (abs(theNormal.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
+ vec3 anX = normalize(cross(anUp, theNormal));
+ vec3 anY = cross(theNormal, anX);
+ return anX * theVector.x + anY * theVector.y + theNormal * theVector.z;
+}
+
+#ifdef THE_TO_BAKE_DIFFUSE
+#if (__VERSION__ >= 120)
+const float aSHBasisFuncCoeffs[9] = float[9]
+(
+ 0.282095 * 0.282095,
+ 0.488603 * 0.488603,
+ 0.488603 * 0.488603,
+ 0.488603 * 0.488603,
+ 1.092548 * 1.092548,
+ 1.092548 * 1.092548,
+ 1.092548 * 1.092548,
+ 0.315392 * 0.315392,
+ 0.546274 * 0.546274
+);
+const float aSHCosCoeffs[9] = float[9]
+(
+ 3.141593,
+ 2.094395,
+ 2.094395,
+ 2.094395,
+ 0.785398,
+ 0.785398,
+ 0.785398,
+ 0.785398,
+ 0.785398
+);
+#else
+uniform float aSHBasisFuncCoeffs[9];
+uniform float aSHCosCoeffs[9];
+#endif
+
+//! Bakes diffuse IBL map's spherical harmonics coefficients.
+vec3 bakeDiffuseSH()
+{
+ int anId = int(gl_FragCoord.x);
+ float aCoef;
+#if (__VERSION__ >= 120)
+ aCoef = aSHCosCoeffs[anId] * aSHBasisFuncCoeffs[anId];
+#else
+ if (anId == 0) { aCoef = aSHCosCoeffs[0] * aSHBasisFuncCoeffs[0]; }
+ else if (anId == 1) { aCoef = aSHCosCoeffs[1] * aSHBasisFuncCoeffs[1]; }
+ else if (anId == 2) { aCoef = aSHCosCoeffs[2] * aSHBasisFuncCoeffs[2]; }
+ else if (anId == 3) { aCoef = aSHCosCoeffs[3] * aSHBasisFuncCoeffs[3]; }
+ else if (anId == 4) { aCoef = aSHCosCoeffs[4] * aSHBasisFuncCoeffs[4]; }
+ else if (anId == 5) { aCoef = aSHCosCoeffs[5] * aSHBasisFuncCoeffs[5]; }
+ else if (anId == 6) { aCoef = aSHCosCoeffs[6] * aSHBasisFuncCoeffs[6]; }
+ else if (anId == 7) { aCoef = aSHCosCoeffs[7] * aSHBasisFuncCoeffs[7]; }
+ else { aCoef = aSHCosCoeffs[8] * aSHBasisFuncCoeffs[8]; }
+#endif
+ vec3 aRes = vec3 (0.0);
+ for (int aSampleIter = 0; aSampleIter < uSamplesNum; ++aSampleIter)
+ {
+ vec2 aHammersleyPoint = hammersley (aSampleIter, uSamplesNum);
+ vec3 aDir = sphereUniformSample (aHammersleyPoint);
+
+ vec3 aVal = occTextureCube (uEnvMap, cubemapVectorTransform (aDir, uYCoeff, uZCoeff)).rgb;
+ #if (__VERSION__ >= 120)
+ float aFunc[9];
+ aFunc[0] = 1.0;
+
+ aFunc[1] = aDir.x;
+ aFunc[2] = aDir.y;
+ aFunc[3] = aDir.z;
+
+ aFunc[4] = aDir.x * aDir.z;
+ aFunc[5] = aDir.y * aDir.z;
+ aFunc[6] = aDir.x * aDir.y;
+
+ aFunc[7] = 3.0 * aDir.z * aDir.z - 1.0;
+ aFunc[8] = aDir.x * aDir.x - aDir.y * aDir.y;
+
+ aRes += aVal * aFunc[anId];
+ #else
+ if (anId == 0) { aRes += aVal * 1.0; }
+ else if (anId == 1) { aRes += aVal * aDir.x; }
+ else if (anId == 2) { aRes += aVal * aDir.y; }
+ else if (anId == 3) { aRes += aVal * aDir.z; }
+ else if (anId == 4) { aRes += aVal * (aDir.x * aDir.z); }
+ else if (anId == 5) { aRes += aVal * (aDir.y * aDir.z); }
+ else if (anId == 6) { aRes += aVal * (aDir.x * aDir.y); }
+ else if (anId == 7) { aRes += aVal * (3.0 * aDir.z * aDir.z - 1.0); }
+ else { aRes += aVal * (aDir.x * aDir.x - aDir.y * aDir.y); }
+ #endif
+ }
+
+ return 4.0 * aRes * aCoef / float(uSamplesNum);
+}
+#endif
+
+#ifdef THE_TO_BAKE_SPECULAR
+//! Computes a single sample for specular IBL map.
+vec4 specularMapSample (in vec3 theNormal,
+ in float theRoughness,
+ in int theNumber,
+ in int theSize)
+{
+ vec2 aHammersleyPoint = hammersley (theNumber, theSize);
+ vec3 aHalf = importanceSample (aHammersleyPoint, occRoughness (theRoughness));
+ float aHdotV = aHalf.z;
+ aHalf = fromTangentSpace (aHalf, theNormal);
+ vec3 aLight = -reflect (theNormal, aHalf);
+ float aNdotL = dot (aLight, theNormal);
+ if (aNdotL > 0.0)
+ {
+ float aSolidAngleSample = 1.0 / (float(theSize) * (occPBRDistribution (aHdotV, theRoughness) * 0.25 + 0.0001) + 0.0001);
+ float aLod = (theRoughness == 0.0) ? 0.0 : 0.5 * log2 (aSolidAngleSample / uEnvSolidAngleSource);
+ return vec4 (occTextureCubeLod (uEnvMap, aLight, aLod).rgb * aNdotL, aNdotL);
+ }
+ return vec4 (0.0);
+}
+
+//! Bakes specular IBL map.
+vec3 bakeSpecularMap (in vec3 theNormal,
+ in float theRoughness)
+{
+ vec4 aResult = vec4(0.0);
+ if (theRoughness == 0.0)
+ {
+ aResult = specularMapSample (theNormal, theRoughness, 0, 1);
+ }
+ else
+ {
+ for (int aSampleIter = 0; aSampleIter < uSamplesNum; ++aSampleIter)
+ {
+ aResult += specularMapSample (theNormal, theRoughness, aSampleIter, uSamplesNum);
+ }
+ }
+ return aResult.xyz / aResult.w;
+}
+#endif
+
+void main()
+{
+ vec3 aViewDirection = normalize (ViewDirection);
+#ifdef THE_TO_BAKE_DIFFUSE
+ vec4 aRes = vec4 (bakeDiffuseSH(), 1.0);
+#ifdef THE_TO_PACK_FLOAT
+ int aCompIndex = int(gl_FragCoord.y);
+ float aComp = aCompIndex == 0 ? aRes.x : (aCompIndex == 1 ? aRes.y : aRes.z);
+ int aFixedPrec = int(aComp * 2147483647.0);
+ int aFixedDiv1 = aFixedPrec / 256;
+ int aFixedDiv2 = aFixedDiv1 / 256;
+ int aFixedDiv3 = aFixedDiv2 / 256;
+ vec4 aPacked = vec4(float(aFixedPrec), float(aFixedDiv1), float(aFixedDiv2), float(aFixedDiv3));
+ aRes = fract (aPacked * (1.0 / 256.0));
+#endif
+ occFragColor = aRes;
+#else
+ float aRoughness = float(uCurrentLevel) / float(occNbSpecIBLLevels - 1);
+ occFragColor = vec4 (bakeSpecularMap (aViewDirection, aRoughness), 1.0);
+#endif
+}
--- /dev/null
+THE_SHADER_OUT vec3 ViewDirection; //!< direction of fetching from environment cubemap
+
+uniform int uCurrentSide; //!< current side of cubemap
+uniform int uYCoeff; //!< coefficient of Y controlling horizontal flip of cubemap
+uniform int uZCoeff; //!< coefficient of Z controlling vertical flip of cubemap
+
+void main()
+{
+ vec3 aDir;
+ vec2 aCoord;
+ if (uCurrentSide == 0)
+ {
+ aCoord = mat2( 0,-1,-1, 0) * occVertex.xy;
+ aDir.x = 1.0;
+ aDir.y = aCoord.x;
+ aDir.z = aCoord.y;
+ }
+ else if (uCurrentSide == 1)
+ {
+ aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;
+ aDir.x = -1.0;
+ aDir.y = aCoord.x;
+ aDir.z = aCoord.y;
+ }
+ else if (uCurrentSide == 2)
+ {
+ aCoord = mat2( 0, 1, 1, 0) * occVertex.xy;
+ aDir.x = aCoord.y;
+ aDir.y = 1.0;
+ aDir.z = aCoord.x;
+ }
+ else if (uCurrentSide == 3)
+ {
+ aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;
+ aDir.x = aCoord.y;
+ aDir.y = -1.0;
+ aDir.z = aCoord.x;
+ }
+ else if (uCurrentSide == 4)
+ {
+ aCoord = mat2( 1, 0, 0,-1) * occVertex.xy;
+ aDir.x = aCoord.x;
+ aDir.y = aCoord.y;
+ aDir.z = 1.0;
+ }
+ else //if (uCurrentSide == 5)
+ {
+ aCoord = mat2(-1, 0, 0,-1) * occVertex.xy;
+ aDir.x = aCoord.x;
+ aDir.y = aCoord.y;
+ aDir.z = -1.0;
+ }
+ ViewDirection = cubemapVectorTransform (aDir, uYCoeff, uZCoeff);
+ gl_Position = vec4 (occVertex.xy, 0.0, 1.0);
+}
--- /dev/null
+//! Functions to calculate fresnel coefficient and approximate zero fresnel value.
+vec3 occPBRFresnel (in vec3 theBaseColor,
+ in float theMetallic,
+ in float theIOR)
+{
+ theIOR = (1.0 - theIOR) / (1.0 + theIOR);
+ theIOR *= theIOR;
+ vec3 f0 = vec3(theIOR);
+ f0 = mix (f0, theBaseColor.rgb, theMetallic);
+ return f0;
+}
+
+vec3 occPBRFresnel (in vec3 theBaseColor,
+ in float theMetallic,
+ in float theIOR,
+ in float theCosVH)
+{
+ vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);
+ theCosVH = 1.0 - theCosVH;
+ theCosVH *= theCosVH;
+ theCosVH *= theCosVH * theCosVH * theCosVH * theCosVH;
+ return f0 + (vec3 (1.0) - f0) * theCosVH;
+}
+
+vec3 occPBRFresnel (in vec3 theBaseColor,
+ in float theMetallic,
+ in float theRoughness,
+ in float theIOR,
+ in float theCosV)
+{
+ vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);
+ theCosV = 1.0 - theCosV;
+ theCosV *= theCosV;
+ theCosV *= theCosV * theCosV * theCosV * theCosV;
+ return f0 + (max(vec3(1.0 - theRoughness), f0) - f0) * theCosV;
+}
--- /dev/null
+//! Calculates geometry factor for Cook-Torrance BRDF.
+float occPBRGeometry (in float theCosV,
+ in float theCosL,
+ in float theRoughness)
+{
+ float k = theRoughness + 1.0;
+ k *= 0.125 * k;
+ float g1 = 1.0;
+ g1 /= theCosV * (1.0 - k) + k;
+ float g2 = 1.0;
+ g2 /= theCosL * (1.0 - k) + k;
+ return g1 * g2;
+}
--- /dev/null
+//! Calculates direct illumination using Cook-Torrance BRDF.
+vec3 occPBRIllumination (in vec3 theView,
+ in vec3 theLight,
+ in vec3 theNormal,
+ in vec4 theBaseColor,
+ in float theMetallic,
+ in float theRoughness,
+ in float theIOR,
+ in vec3 theLightColor,
+ in float theLightIntensity)
+{
+ vec3 aHalf = normalize (theView + theLight);
+ float aCosVH = max(dot(theView, aHalf), 0.0);
+ vec3 aFresnel = occPBRFresnel (theBaseColor.rgb, theMetallic, theIOR, aCosVH);
+ vec3 aSpecular = occPBRCookTorrance (theView,
+ theLight,
+ theNormal,
+ theBaseColor.rgb,
+ theMetallic,
+ theRoughness,
+ theIOR);
+ vec3 aDiffuse = vec3(1.0) - aFresnel;
+ aDiffuse *= 1.0 - theMetallic;
+ aDiffuse *= INV_PI;
+ aDiffuse *= theBaseColor.rgb;
+ aDiffuse = mix (vec3(0.0), aDiffuse, theBaseColor.a);
+ return (aDiffuse + aSpecular) * theLightColor * theLightIntensity * max(0.0, dot(theLight, theNormal));
+}
--- /dev/null
+//! Function computes contribution of isotropic point light source
+//! into global variable DirectLighting (PBR shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param thePoint 3D position (world space)
+//! @param theIsFront front/back face flag
+void occPointLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint,
+ in bool theIsFront)
+{
+ vec3 aLight = occLight_Position (theId) - thePoint;
+
+ float aDist = length (aLight);
+ float aRange = occLight_Range (theId);
+ float anAtten = occPointLightAttenuation (aDist, aRange);
+ if (anAtten <= 0.0) return;
+ aLight /= aDist;
+
+ theNormal = theIsFront ? theNormal : -theNormal;
+ DirectLighting += occPBRIllumination (theView, aLight, theNormal,
+ BaseColor, Metallic, Roughness, IOR,
+ occLight_Specular (theId),
+ occLight_Intensity(theId) * anAtten);
+}
--- /dev/null
+//! Function computes contribution of spotlight source
+//! into global variable DirectLighting (PBR shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param thePoint 3D position (world space)
+//! @param theIsFront front/back face flag
+void occSpotLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint,
+ in bool theIsFront,
+ in float theShadow)
+{
+ vec3 aLight = occLight_Position (theId) - thePoint;
+
+ float aDist = length (aLight);
+ float aRange = occLight_Range (theId);
+ float anAtten = occPointLightAttenuation (aDist, aRange);
+ if (anAtten <= 0.0) return;
+ aLight /= aDist;
+
+ vec3 aSpotDir = occLight_SpotDirection (theId);
+ // light cone
+ float aCosA = dot (aSpotDir, -aLight);
+ float aRelativeAngle = 2.0 * acos(aCosA) / occLight_SpotCutOff(theId);
+ if (aCosA >= 1.0 || aRelativeAngle > 1.0)
+ {
+ return;
+ }
+ float anExponent = occLight_SpotExponent (theId);
+ if ((1.0 - aRelativeAngle) <= anExponent)
+ {
+ float anAngularAttenuationOffset = cos(0.5 * occLight_SpotCutOff(theId));
+ float anAngularAttenuationScale = 1.0 / max(0.001, cos(0.5 * occLight_SpotCutOff(theId) * (1.0 - anExponent)) - anAngularAttenuationOffset);
+ anAngularAttenuationOffset *= -anAngularAttenuationScale;
+ float anAngularAttenuantion = clamp(aCosA * anAngularAttenuationScale + anAngularAttenuationOffset, 0.0, 1.0);
+ anAtten *= anAngularAttenuantion * anAngularAttenuantion;
+ }
+ theNormal = theIsFront ? theNormal : -theNormal;
+ DirectLighting += occPBRIllumination (theView, aLight, theNormal,
+ BaseColor, Metallic, Roughness, IOR,
+ occLight_Specular(theId),
+ occLight_Intensity(theId) * anAtten) * theShadow;
+}
--- /dev/null
+#ifdef _MSC_VER
+ #define PATH_TRACING // just for editing in MS VS
+
+ #define in
+ #define out
+ #define inout
+
+ typedef struct { float x; float y; } vec2;
+ typedef struct { float x; float y; float z; } vec3;
+ typedef struct { float x; float y; float z; float w; } vec4;
+#endif
+
+#ifdef PATH_TRACING
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Specific data types
+
+//! Describes local space at the hit point (visualization space).
+struct SLocalSpace
+{
+ //! Local X axis.
+ vec3 AxisX;
+
+ //! Local Y axis.
+ vec3 AxisY;
+
+ //! Local Z axis.
+ vec3 AxisZ;
+};
+
+//! Describes material properties (BSDF).
+struct SBSDF
+{
+ //! Weight of coat specular/glossy BRDF.
+ vec4 Kc;
+
+ //! Weight of base diffuse BRDF + base color texture index in W.
+ vec4 Kd;
+
+ //! Weight of base specular/glossy BRDF.
+ vec4 Ks;
+
+ //! Weight of base specular/glossy BTDF + metallic-roughness texture index in W.
+ vec4 Kt;
+
+ //! Fresnel coefficients of coat layer.
+ vec3 FresnelCoat;
+
+ //! Fresnel coefficients of base layer + normal map texture index in W.
+ vec4 FresnelBase;
+};
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Support subroutines
+
+//=======================================================================
+// function : buildLocalSpace
+// purpose : Generates local space for the given normal
+//=======================================================================
+SLocalSpace buildLocalSpace (in vec3 theNormal)
+{
+ vec3 anAxisX = vec3 (theNormal.z, 0.f, -theNormal.x);
+ vec3 anAxisY = vec3 (0.f, -theNormal.z, theNormal.y);
+
+ float aSqrLenX = dot (anAxisX, anAxisX);
+ float aSqrLenY = dot (anAxisY, anAxisY);
+
+ if (aSqrLenX > aSqrLenY)
+ {
+ anAxisX *= inversesqrt (aSqrLenX);
+ anAxisY = cross (anAxisX, theNormal);
+ }
+ else
+ {
+ anAxisY *= inversesqrt (aSqrLenY);
+ anAxisX = cross (anAxisY, theNormal);
+ }
+
+ return SLocalSpace (anAxisX, anAxisY, theNormal);
+}
+
+//=======================================================================
+// function : toLocalSpace
+// purpose : Transforms the vector to local space from world space
+//=======================================================================
+vec3 toLocalSpace (in vec3 theVector, in SLocalSpace theSpace)
+{
+ return vec3 (dot (theVector, theSpace.AxisX),
+ dot (theVector, theSpace.AxisY),
+ dot (theVector, theSpace.AxisZ));
+}
+
+//=======================================================================
+// function : fromLocalSpace
+// purpose : Transforms the vector from local space to world space
+//=======================================================================
+vec3 fromLocalSpace (in vec3 theVector, in SLocalSpace theSpace)
+{
+ return theVector.x * theSpace.AxisX +
+ theVector.y * theSpace.AxisY +
+ theVector.z * theSpace.AxisZ;
+}
+
+//=======================================================================
+// function : convolve
+// purpose : Performs a linear convolution of the vector components
+//=======================================================================
+float convolve (in vec3 theVector, in vec3 theFactor)
+{
+ return dot (theVector, theFactor) * (1.f / max (theFactor.x + theFactor.y + theFactor.z, 1e-15f));
+}
+
+//=======================================================================
+// function : fresnelSchlick
+// purpose : Computes the Fresnel reflection formula using
+// Schlick's approximation.
+//=======================================================================
+vec3 fresnelSchlick (in float theCosI, in vec3 theSpecularColor)
+{
+ return theSpecularColor + (UNIT - theSpecularColor) * pow (1.f - theCosI, 5.f);
+}
+
+//=======================================================================
+// function : fresnelDielectric
+// purpose : Computes the Fresnel reflection formula for dielectric in
+// case of circularly polarized light (Based on PBRT code).
+//=======================================================================
+float fresnelDielectric (in float theCosI,
+ in float theCosT,
+ in float theEtaI,
+ in float theEtaT)
+{
+ float aParl = (theEtaT * theCosI - theEtaI * theCosT) /
+ (theEtaT * theCosI + theEtaI * theCosT);
+
+ float aPerp = (theEtaI * theCosI - theEtaT * theCosT) /
+ (theEtaI * theCosI + theEtaT * theCosT);
+
+ return (aParl * aParl + aPerp * aPerp) * 0.5f;
+}
+
+#define ENVIRONMENT_IOR 1.f
+
+//=======================================================================
+// function : fresnelDielectric
+// purpose : Computes the Fresnel reflection formula for dielectric in
+// case of circularly polarized light (based on PBRT code)
+//=======================================================================
+float fresnelDielectric (in float theCosI, in float theIndex)
+{
+ float aFresnel = 1.f;
+
+ float anEtaI = theCosI > 0.f ? 1.f : theIndex;
+ float anEtaT = theCosI > 0.f ? theIndex : 1.f;
+
+ float aSinT2 = (anEtaI * anEtaI) / (anEtaT * anEtaT) * (1.f - theCosI * theCosI);
+
+ if (aSinT2 < 1.f)
+ {
+ aFresnel = fresnelDielectric (abs (theCosI), sqrt (1.f - aSinT2), anEtaI, anEtaT);
+ }
+
+ return aFresnel;
+}
+
+//=======================================================================
+// function : fresnelConductor
+// purpose : Computes the Fresnel reflection formula for conductor in case
+// of circularly polarized light (based on PBRT source code)
+//=======================================================================
+float fresnelConductor (in float theCosI, in float theEta, in float theK)
+{
+ float aTmp = 2.f * theEta * theCosI;
+
+ float aTmp1 = theEta * theEta + theK * theK;
+
+ float aSPerp = (aTmp1 - aTmp + theCosI * theCosI) /
+ (aTmp1 + aTmp + theCosI * theCosI);
+
+ float aTmp2 = aTmp1 * theCosI * theCosI;
+
+ float aSParl = (aTmp2 - aTmp + 1.f) /
+ (aTmp2 + aTmp + 1.f);
+
+ return (aSPerp + aSParl) * 0.5f;
+}
+
+#define FRESNEL_SCHLICK -0.5f
+#define FRESNEL_CONSTANT -1.5f
+#define FRESNEL_CONDUCTOR -2.5f
+#define FRESNEL_DIELECTRIC -3.5f
+
+//=======================================================================
+// function : fresnelMedia
+// purpose : Computes the Fresnel reflection formula for general medium
+// in case of circularly polarized light.
+//=======================================================================
+vec3 fresnelMedia (in float theCosI, in vec3 theFresnel)
+{
+ vec3 aFresnel;
+
+ if (theFresnel.x > FRESNEL_SCHLICK)
+ {
+ aFresnel = fresnelSchlick (abs (theCosI), theFresnel);
+ }
+ else if (theFresnel.x > FRESNEL_CONSTANT)
+ {
+ aFresnel = vec3 (theFresnel.z);
+ }
+ else if (theFresnel.x > FRESNEL_CONDUCTOR)
+ {
+ aFresnel = vec3 (fresnelConductor (abs (theCosI), theFresnel.y, theFresnel.z));
+ }
+ else
+ {
+ aFresnel = vec3 (fresnelDielectric (theCosI, theFresnel.y));
+ }
+
+ return aFresnel;
+}
+
+//=======================================================================
+// function : transmitted
+// purpose : Computes transmitted direction in tangent space
+// (in case of TIR returned result is undefined!)
+//=======================================================================
+void transmitted (in float theIndex, in vec3 theIncident, out vec3 theTransmit)
+{
+ // Compute relative index of refraction
+ float anEta = (theIncident.z > 0.f) ? 1.f / theIndex : theIndex;
+
+ // Handle total internal reflection (TIR)
+ float aSinT2 = anEta * anEta * (1.f - theIncident.z * theIncident.z);
+
+ // Compute direction of transmitted ray
+ float aCosT = sqrt (1.f - min (aSinT2, 1.f)) * sign (-theIncident.z);
+
+ theTransmit = normalize (vec3 (-anEta * theIncident.x,
+ -anEta * theIncident.y,
+ aCosT));
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+// Handlers and samplers for materials
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+//=======================================================================
+// function : EvalLambertianReflection
+// purpose : Evaluates Lambertian BRDF, with cos(N, PSI)
+//=======================================================================
+float EvalLambertianReflection (in vec3 theWi, in vec3 theWo)
+{
+ return (theWi.z <= 0.f || theWo.z <= 0.f) ? 0.f : theWi.z * (1.f / M_PI);
+}
+
+#define FLT_EPSILON 1.0e-5f
+
+//=======================================================================
+// function : SmithG1
+// purpose :
+//=======================================================================
+float SmithG1 (in vec3 theDirection, in vec3 theM, in float theRoughness)
+{
+ float aResult = 0.f;
+
+ if (dot (theDirection, theM) * theDirection.z > 0.f)
+ {
+ float aTanThetaM = sqrt (1.f - theDirection.z * theDirection.z) / theDirection.z;
+
+ if (aTanThetaM == 0.f)
+ {
+ aResult = 1.f;
+ }
+ else
+ {
+ float aVal = 1.f / (theRoughness * aTanThetaM);
+
+ // Use rational approximation to shadowing-masking function (from Mitsuba)
+ aResult = (3.535f + 2.181f * aVal) / (1.f / aVal + 2.276f + 2.577f * aVal);
+ }
+ }
+
+ return min (aResult, 1.f);
+}
+
+//=======================================================================
+// function : EvalBlinnReflection
+// purpose : Evaluates Blinn glossy BRDF, with cos(N, PSI)
+//=======================================================================
+vec3 EvalBlinnReflection (in vec3 theWi, in vec3 theWo, in vec3 theFresnel, in float theRoughness)
+{
+ // calculate the reflection half-vec
+ vec3 aH = normalize (theWi + theWo);
+
+ // roughness value -> Blinn exponent
+ float aPower = max (2.f / (theRoughness * theRoughness) - 2.f, 0.f);
+
+ // calculate microfacet distribution
+ float aD = (aPower + 2.f) * (1.f / M_2_PI) * pow (aH.z, aPower);
+
+ // calculate shadow-masking function
+ float aG = SmithG1 (theWo, aH, theRoughness) *
+ SmithG1 (theWi, aH, theRoughness);
+
+ // return total amount of reflection
+ return (theWi.z <= 0.f || theWo.z <= 0.f) ? ZERO :
+ aD * aG / (4.f * theWo.z) * fresnelMedia (dot (theWo, aH), theFresnel);
+}
+
+//=======================================================================
+// function : EvalBsdfLayered
+// purpose : Evaluates BSDF for specified material, with cos(N, PSI)
+//=======================================================================
+vec3 EvalBsdfLayered (in SBSDF theBSDF, in vec3 theWi, in vec3 theWo)
+{
+#ifdef TWO_SIDED_BXDF
+ theWi.z *= sign (theWi.z);
+ theWo.z *= sign (theWo.z);
+#endif
+
+ vec3 aBxDF = theBSDF.Kd.rgb * EvalLambertianReflection (theWi, theWo);
+
+ if (theBSDF.Ks.w > FLT_EPSILON)
+ {
+ aBxDF += theBSDF.Ks.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelBase.rgb, theBSDF.Ks.w);
+ }
+
+ aBxDF *= UNIT - fresnelMedia (theWo.z, theBSDF.FresnelCoat);
+
+ if (theBSDF.Kc.w > FLT_EPSILON)
+ {
+ aBxDF += theBSDF.Kc.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelCoat, theBSDF.Kc.w);
+ }
+
+ return aBxDF;
+}
+
+//=======================================================================
+// function : SampleLambertianReflection
+// purpose : Samples Lambertian BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)
+//=======================================================================
+vec3 SampleLambertianReflection (in vec3 theWo, out vec3 theWi, inout float thePDF)
+{
+ float aKsi1 = RandFloat();
+ float aKsi2 = RandFloat();
+
+ theWi = vec3 (cos (M_2_PI * aKsi1),
+ sin (M_2_PI * aKsi1),
+ sqrt (1.f - aKsi2));
+
+ theWi.xy *= sqrt (aKsi2);
+
+#ifdef TWO_SIDED_BXDF
+ theWi.z *= sign (theWo.z);
+#endif
+
+ thePDF *= theWi.z * (1.f / M_PI);
+
+#ifdef TWO_SIDED_BXDF
+ return UNIT;
+#else
+ return UNIT * step (0.f, theWo.z);
+#endif
+}
+
+//=======================================================================
+// function : SampleGlossyBlinnReflection
+// purpose : Samples Blinn BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)
+// The BRDF is a product of three main terms, D, G, and F,
+// which is then divided by two cosine terms. Here we perform
+// importance sample the D part of the Blinn model; trying to
+// develop a sampling procedure that accounted for all of the
+// terms would be complex, and it is the D term that accounts
+// for most of the variation.
+//=======================================================================
+vec3 SampleGlossyBlinnReflection (in vec3 theWo, out vec3 theWi, in vec3 theFresnel, in float theRoughness, inout float thePDF)
+{
+ float aKsi1 = RandFloat();
+ float aKsi2 = RandFloat();
+
+ // roughness value --> Blinn exponent
+ float aPower = max (2.f / (theRoughness * theRoughness) - 2.f, 0.f);
+
+ // normal from microface distribution
+ float aCosThetaM = pow (aKsi1, 1.f / (aPower + 2.f));
+
+ vec3 aM = vec3 (cos (M_2_PI * aKsi2),
+ sin (M_2_PI * aKsi2),
+ aCosThetaM);
+
+ aM.xy *= sqrt (1.f - aCosThetaM * aCosThetaM);
+
+ // calculate PDF of sampled direction
+ thePDF *= (aPower + 2.f) * (1.f / M_2_PI) * pow (aCosThetaM, aPower + 1.f);
+
+#ifdef TWO_SIDED_BXDF
+ bool toFlip = theWo.z < 0.f;
+
+ if (toFlip)
+ theWo.z = -theWo.z;
+#endif
+
+ float aCosDelta = dot (theWo, aM);
+
+ // pick input based on half direction
+ theWi = -theWo + 2.f * aCosDelta * aM;
+
+ if (theWi.z <= 0.f || theWo.z <= 0.f)
+ {
+ return ZERO;
+ }
+
+ // Jacobian of half-direction mapping
+ thePDF /= 4.f * aCosDelta;
+
+ // compute shadow-masking coefficient
+ float aG = SmithG1 (theWo, aM, theRoughness) *
+ SmithG1 (theWi, aM, theRoughness);
+
+#ifdef TWO_SIDED_BXDF
+ if (toFlip)
+ theWi.z = -theWi.z;
+#endif
+
+ return (aG * aCosDelta) / (theWo.z * aM.z) * fresnelMedia (aCosDelta, theFresnel);
+}
+
+//=======================================================================
+// function : BsdfPdfLayered
+// purpose : Calculates BSDF of sampling input knowing output
+//=======================================================================
+float BsdfPdfLayered (in SBSDF theBSDF, in vec3 theWo, in vec3 theWi, in vec3 theWeight)
+{
+ float aPDF = 0.f; // PDF of sampling input direction
+
+ // We choose whether the light is reflected or transmitted
+ // by the coating layer according to the Fresnel equations
+ vec3 aCoatF = fresnelMedia (theWo.z, theBSDF.FresnelCoat);
+
+ // Coat BRDF is scaled by its Fresnel reflectance term. For
+ // reasons of simplicity we scale base BxDFs only by coat's
+ // Fresnel transmittance term
+ vec3 aCoatT = UNIT - aCoatF;
+
+ float aPc = dot (theBSDF.Kc.rgb * aCoatF, theWeight);
+ float aPd = dot (theBSDF.Kd.rgb * aCoatT, theWeight);
+ float aPs = dot (theBSDF.Ks.rgb * aCoatT, theWeight);
+ float aPt = dot (theBSDF.Kt.rgb * aCoatT, theWeight);
+
+ if (theWi.z * theWo.z > 0.f)
+ {
+ vec3 aH = normalize (theWi + theWo);
+
+ aPDF = aPd * abs (theWi.z / M_PI);
+
+ if (theBSDF.Kc.w > FLT_EPSILON)
+ {
+ float aPower = max (2.f / (theBSDF.Kc.w * theBSDF.Kc.w) - 2.f, 0.f); // roughness --> exponent
+
+ aPDF += aPc * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);
+ }
+
+ if (theBSDF.Ks.w > FLT_EPSILON)
+ {
+ float aPower = max (2.f / (theBSDF.Ks.w * theBSDF.Ks.w) - 2.f, 0.f); // roughness --> exponent
+
+ aPDF += aPs * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);
+ }
+ }
+
+ return aPDF / (aPc + aPd + aPs + aPt);
+}
+
+//! Tool macro to handle sampling of particular BxDF
+#define PICK_BXDF_LAYER(p, k) aPDF = p / aTotalR; theWeight *= k / aPDF;
+
+//=======================================================================
+// function : SampleBsdfLayered
+// purpose : Samples specified composite material (BSDF)
+//=======================================================================
+float SampleBsdfLayered (in SBSDF theBSDF, in vec3 theWo, out vec3 theWi, inout vec3 theWeight, inout bool theInside)
+{
+ // NOTE: OCCT uses two-layer material model. We have base diffuse, glossy, or transmissive
+ // layer, covered by one glossy/specular coat. In the current model, the layers themselves
+ // have no thickness; they can simply reflect light or transmits it to the layer under it.
+ // We use actual BRDF model only for direct reflection by the coat layer. For transmission
+ // through this layer, we approximate it as a flat specular surface.
+
+ float aPDF = 0.f; // PDF of sampled direction
+
+ // We choose whether the light is reflected or transmitted
+ // by the coating layer according to the Fresnel equations
+ vec3 aCoatF = fresnelMedia (theWo.z, theBSDF.FresnelCoat);
+
+ // Coat BRDF is scaled by its Fresnel term. According to
+ // Wilkie-Weidlich layered BSDF model, transmission term
+ // for light passing through the coat at direction I and
+ // leaving it in O is T = ( 1 - F (O) ) x ( 1 - F (I) ).
+ // For reasons of simplicity, we discard the second term
+ // and scale base BxDFs only by the first term.
+ vec3 aCoatT = UNIT - aCoatF;
+
+ float aPc = dot (theBSDF.Kc.rgb * aCoatF, theWeight);
+ float aPd = dot (theBSDF.Kd.rgb * aCoatT, theWeight);
+ float aPs = dot (theBSDF.Ks.rgb * aCoatT, theWeight);
+ float aPt = dot (theBSDF.Kt.rgb * aCoatT, theWeight);
+
+ // Calculate total reflection probability
+ float aTotalR = (aPc + aPd) + (aPs + aPt);
+
+ // Generate random variable to select BxDF
+ float aKsi = aTotalR * RandFloat();
+
+ if (aKsi < aPc) // REFLECTION FROM COAT
+ {
+ PICK_BXDF_LAYER (aPc, theBSDF.Kc.rgb)
+
+ if (theBSDF.Kc.w < FLT_EPSILON)
+ {
+ theWeight *= aCoatF;
+
+ theWi = vec3 (-theWo.x,
+ -theWo.y,
+ theWo.z);
+ }
+ else
+ {
+ theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelCoat, theBSDF.Kc.w, aPDF);
+ }
+
+ aPDF = mix (aPDF, MAXFLOAT, theBSDF.Kc.w < FLT_EPSILON);
+ }
+ else if (aKsi < aTotalR) // REFLECTION FROM BASE
+ {
+ theWeight *= aCoatT;
+
+ if (aKsi < aPc + aPd) // diffuse BRDF
+ {
+ PICK_BXDF_LAYER (aPd, theBSDF.Kd.rgb)
+
+ theWeight *= SampleLambertianReflection (theWo, theWi, aPDF);
+ }
+ else if (aKsi < (aPc + aPd) + aPs) // specular/glossy BRDF
+ {
+ PICK_BXDF_LAYER (aPs, theBSDF.Ks.rgb)
+
+ if (theBSDF.Ks.w < FLT_EPSILON)
+ {
+ theWeight *= fresnelMedia (theWo.z, theBSDF.FresnelBase.rgb);
+
+ theWi = vec3 (-theWo.x,
+ -theWo.y,
+ theWo.z);
+ }
+ else
+ {
+ theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelBase.rgb, theBSDF.Ks.w, aPDF);
+ }
+
+ aPDF = mix (aPDF, MAXFLOAT, theBSDF.Ks.w < FLT_EPSILON);
+ }
+ else // specular transmission
+ {
+ PICK_BXDF_LAYER (aPt, theBSDF.Kt.rgb)
+
+ // refracted direction should exist if we are here
+ transmitted (theBSDF.FresnelCoat.y, theWo, theWi);
+
+ theInside = !theInside; aPDF = MAXFLOAT;
+ }
+ }
+
+ // path termination for extra small weights
+ theWeight = mix (ZERO, theWeight, step (FLT_EPSILON, aTotalR));
+
+ return aPDF;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+// Handlers and samplers for light sources
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+//=======================================================================
+// function : SampleLight
+// purpose : General sampling function for directional and point lights
+//=======================================================================
+vec3 SampleLight (in vec3 theToLight, inout float theDistance, in bool isInfinite, in float theSmoothness, inout float thePDF)
+{
+ SLocalSpace aSpace = buildLocalSpace (theToLight * (1.f / theDistance));
+
+ // for point lights smoothness defines radius
+ float aCosMax = isInfinite ? theSmoothness :
+ inversesqrt (1.f + theSmoothness * theSmoothness / (theDistance * theDistance));
+
+ float aKsi1 = RandFloat();
+ float aKsi2 = RandFloat();
+
+ float aTmp = 1.f - aKsi2 * (1.f - aCosMax);
+
+ vec3 anInput = vec3 (cos (M_2_PI * aKsi1),
+ sin (M_2_PI * aKsi1),
+ aTmp);
+
+ anInput.xy *= sqrt (1.f - aTmp * aTmp);
+
+ thePDF = (aCosMax < 1.f) ? (thePDF / M_2_PI) / (1.f - aCosMax) : MAXFLOAT;
+
+ return normalize (fromLocalSpace (anInput, aSpace));
+}
+
+//=======================================================================
+// function : HandlePointLight
+// purpose :
+//=======================================================================
+float HandlePointLight (in vec3 theInput, in vec3 theToLight, in float theRadius, in float theDistance, inout float thePDF)
+{
+ float aCosMax = inversesqrt (1.f + theRadius * theRadius / (theDistance * theDistance));
+
+ float aVisibility = step (aCosMax, dot (theInput, theToLight));
+
+ thePDF *= step (-1.f, -aCosMax) * aVisibility * (1.f / M_2_PI) / (1.f - aCosMax);
+
+ return aVisibility;
+}
+
+//=======================================================================
+// function : HandleDistantLight
+// purpose :
+//=======================================================================
+float HandleDistantLight (in vec3 theInput, in vec3 theToLight, in float theCosMax, inout float thePDF)
+{
+ float aVisibility = step (theCosMax, dot (theInput, theToLight));
+
+ thePDF *= step (-1.f, -theCosMax) * aVisibility * (1.f / M_2_PI) / (1.f - theCosMax);
+
+ return aVisibility;
+}
+
+// =======================================================================
+// function: IntersectLight
+// purpose : Checks intersections with light sources
+// =======================================================================
+vec3 IntersectLight (in SRay theRay, in int theDepth, in float theHitDistance, out float thePDF)
+{
+ vec3 aTotalRadiance = ZERO;
+ thePDF = 0.f; // PDF of sampling light sources
+ for (int aLightIdx = 0; aLightIdx < uLightCount; ++aLightIdx)
+ {
+ vec4 aLight = texelFetch (uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
+ vec4 aParam = texelFetch (uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));
+
+ // W component: 0 for infinite light and 1 for point light
+ aLight.xyz -= mix (ZERO, theRay.Origin, aLight.w);
+ float aPDF = 1.0 / float(uLightCount);
+ if (aLight.w != 0.f) // point light source
+ {
+ float aCenterDst = length (aLight.xyz);
+ if (aCenterDst < theHitDistance)
+ {
+ float aVisibility = HandlePointLight (
+ theRay.Direct, normalize (aLight.xyz), aParam.w /* radius */, aCenterDst, aPDF);
+
+ if (aVisibility > 0.f)
+ {
+ theHitDistance = aCenterDst;
+ aTotalRadiance = aParam.rgb;
+
+ thePDF = aPDF;
+ }
+ }
+ }
+ else if (theHitDistance == MAXFLOAT) // directional light source
+ {
+ aTotalRadiance += aParam.rgb * HandleDistantLight (
+ theRay.Direct, aLight.xyz, aParam.w /* angle cosine */, aPDF);
+
+ thePDF += aPDF;
+ }
+ }
+
+ if (thePDF == 0.f && theHitDistance == MAXFLOAT) // light source not found
+ {
+ if (theDepth + uEnvMapForBack == 0) // view ray and map is hidden
+ {
+ aTotalRadiance = BackgroundColor().rgb;
+ }
+ else
+ {
+ #ifdef BACKGROUND_CUBEMAP
+ if (theDepth == 0)
+ {
+ vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;
+ vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;
+ vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));
+ vec3 aDirect = uEyeView * aLocalDir.z +
+ uEyeSide * aLocalDir.x +
+ uEyeVert * aLocalDir.y;
+ aTotalRadiance = FetchEnvironment (aDirect, 1.0, true).rgb;
+ }
+ else
+ {
+ aTotalRadiance = FetchEnvironment (theRay.Direct, 1.0, false).rgb;
+ }
+ #else
+ aTotalRadiance = FetchEnvironment (theRay.Direct, 1.0, theDepth == 0).rgb;
+ #endif
+ }
+ #ifdef THE_SHIFT_sRGB
+ aTotalRadiance = pow (aTotalRadiance, vec3 (2.f));
+ #endif
+ }
+
+ return aTotalRadiance;
+}
+
+#define MIN_THROUGHPUT vec3 (1.0e-3f)
+#define MIN_CONTRIBUTION vec3 (1.0e-2f)
+
+#define MATERIAL_KC(index) (19 * index + 11)
+#define MATERIAL_KD(index) (19 * index + 12)
+#define MATERIAL_KS(index) (19 * index + 13)
+#define MATERIAL_KT(index) (19 * index + 14)
+#define MATERIAL_LE(index) (19 * index + 15)
+#define MATERIAL_FRESNEL_COAT(index) (19 * index + 16)
+#define MATERIAL_FRESNEL_BASE(index) (19 * index + 17)
+#define MATERIAL_ABSORPT_BASE(index) (19 * index + 18)
+
+//! Enables experimental Russian roulette sampling path termination.
+//! In most cases, it provides faster image convergence with minimal
+//! bias, so it is enabled by default.
+#define RUSSIAN_ROULETTE
+
+//! Frame step to increase number of bounces. This mode is used
+//! for interaction with the model, when path length is limited
+//! for the first samples, and gradually increasing when camera
+//! is stabilizing.
+#ifdef ADAPTIVE_SAMPLING
+ #define FRAME_STEP 4
+#else
+ #define FRAME_STEP 5
+#endif
+
+//=======================================================================
+// function : IsNotZero
+// purpose : Checks whether BSDF reflects direct light
+//=======================================================================
+bool IsNotZero (in SBSDF theBSDF, in vec3 theThroughput)
+{
+ vec3 aGlossy = theBSDF.Kc.rgb * step (FLT_EPSILON, theBSDF.Kc.w) +
+ theBSDF.Ks.rgb * step (FLT_EPSILON, theBSDF.Ks.w);
+
+ return convolve (theBSDF.Kd.rgb + aGlossy, theThroughput) > FLT_EPSILON;
+}
+
+//=======================================================================
+// function : NormalAdaptation
+// purpose : Adapt smooth normal (which may be different from geometry normal) in order to avoid black areas in render
+//=======================================================================
+bool NormalAdaptation (in vec3 theView, in vec3 theGeometryNormal, inout vec3 theSmoothNormal)
+{
+ float aMinCos = dot(theView, theGeometryNormal);
+ aMinCos = 0.5 * (sqrt(1.0 - aMinCos) + sqrt(1.0 + aMinCos));
+ float aCos = dot(theGeometryNormal, theSmoothNormal);
+ if (aCos < aMinCos)
+ {
+ theSmoothNormal = aMinCos * theGeometryNormal + normalize(theSmoothNormal - aCos * theGeometryNormal) * sqrt(1.0 - aMinCos * aMinCos);
+ return true;
+ }
+ return false;
+}
+
+//=======================================================================
+// function : PathTrace
+// purpose : Calculates radiance along the given ray
+//=======================================================================
+vec4 PathTrace (in SRay theRay, in vec3 theInverse, in int theNbSamples)
+{
+ float aRaytraceDepth = MAXFLOAT;
+
+ vec3 aRadiance = ZERO;
+ vec3 aThroughput = UNIT;
+
+ int aTransfID = 0; // ID of object transformation
+ bool aInMedium = false; // is the ray inside an object
+
+ float aExpPDF = 1.f;
+ float aImpPDF = 1.f;
+
+ for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)
+ {
+ SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);
+
+ STriangle aTriangle = SceneNearestHit (theRay, theInverse, aHit, aTransfID);
+
+ // check implicit path
+ vec3 aLe = IntersectLight (theRay, aDepth, aHit.Time, aExpPDF);
+
+ if (any (greaterThan (aLe, ZERO)) || aTriangle.TriIndex.x == -1)
+ {
+ float aMIS = (aDepth == 0 || aImpPDF == MAXFLOAT) ? 1.f :
+ aImpPDF * aImpPDF / (aExpPDF * aExpPDF + aImpPDF * aImpPDF);
+
+ aRadiance += aThroughput * aLe * aMIS; break; // terminate path
+ }
+
+ vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTransfID + 0).xyz;
+ vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTransfID + 1).xyz;
+ vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTransfID + 2).xyz;
+
+ // compute geometrical normal
+ aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),
+ dot (aInvTransf1, aHit.Normal),
+ dot (aInvTransf2, aHit.Normal)));
+
+ theRay.Origin += theRay.Direct * aHit.Time; // get new intersection point
+
+ // evaluate depth on first hit
+ if (aDepth == 0)
+ {
+ vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);
+
+ float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);
+ #ifdef THE_ZERO_TO_ONE_DEPTH
+ aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);
+ #else
+ aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;
+ #endif
+ }
+
+ SBSDF aBSDF;
+
+ // fetch BxDF weights
+ aBSDF.Kc = texelFetch (uRaytraceMaterialTexture, MATERIAL_KC (aTriangle.TriIndex.w));
+ aBSDF.Kd = texelFetch (uRaytraceMaterialTexture, MATERIAL_KD (aTriangle.TriIndex.w));
+ aBSDF.Ks = texelFetch (uRaytraceMaterialTexture, MATERIAL_KS (aTriangle.TriIndex.w));
+ aBSDF.Kt = texelFetch (uRaytraceMaterialTexture, MATERIAL_KT (aTriangle.TriIndex.w));
+
+ // fetch Fresnel reflectance for both layers
+ aBSDF.FresnelCoat = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_COAT (aTriangle.TriIndex.w)).xyz;
+ aBSDF.FresnelBase = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_BASE (aTriangle.TriIndex.w));
+
+ vec4 anLE = texelFetch (uRaytraceMaterialTexture, MATERIAL_LE (aTriangle.TriIndex.w));
+
+ // compute smooth normal (in parallel with fetch)
+ vec3 aNormal = SmoothNormal (aHit.UV, aTriangle.TriIndex);
+ aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),
+ dot (aInvTransf1, aNormal),
+ dot (aInvTransf2, aNormal)));
+
+#ifdef USE_TEXTURES
+ if (aBSDF.Kd.w >= 0.0 || aBSDF.Kt.w >= 0.0 || aBSDF.FresnelBase.w >=0.0 || anLE.w >= 0.0)
+ {
+ vec2 aUVs[3];
+ vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriangle.TriIndex, aUVs), 0.f, 1.f);
+ vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriangle.TriIndex.w));
+ vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriangle.TriIndex.w));
+ aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),
+ dot (aTrsfRow2, aTexCoord));
+
+ if (anLE.w >= 0.0)
+ {
+ anLE.rgb *= textureLod (sampler2D (uTextureSamplers[int (anLE.w)]), aTexCoord.st, 0.0).rgb;
+ }
+ if (aBSDF.Kt.w >= 0.0)
+ {
+ vec2 aTexMetRough = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kt.w)]), aTexCoord.st, 0.0).bg;
+ float aPbrMetal = aTexMetRough.x;
+ float aPbrRough2 = aTexMetRough.y * aTexMetRough.y;
+ aBSDF.Ks.a *= aPbrRough2;
+ // when using metal-roughness texture, global metalness of material (encoded in FresnelBase) is expected to be 1.0 so that Kd will be 0.0
+ aBSDF.Kd.rgb = aBSDF.FresnelBase.rgb * (1.0 - aPbrMetal);
+ aBSDF.FresnelBase.rgb *= aPbrMetal;
+ }
+ if (aBSDF.Kd.w >= 0.0)
+ {
+ vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.0);
+ vec3 aDiff = aTexColor.rgb * aTexColor.a;
+ aBSDF.Kd.rgb *= aDiff;
+ aBSDF.FresnelBase.rgb *= aDiff;
+ if (aTexColor.a != 1.0)
+ {
+ // mix transparency BTDF with texture alpha-channel
+ aBSDF.Ks.rgb *= aTexColor.a;
+ aBSDF.Kt.rgb = (UNIT - aTexColor.aaa) + aTexColor.a * aBSDF.Kt.rgb;
+ }
+ }
+ #ifndef IGNORE_NORMAL_MAP
+ if (aBSDF.FresnelBase.w >= 0.0)
+ {
+ for (int i = 0 ; i < 3; ++i)
+ {
+ aUVs[i] = vec2 (dot (aTrsfRow1, vec4(aUVs[i], 0.0, 1.0)),
+ dot (aTrsfRow2, vec4(aUVs[i], 0.0, 1.0)));
+ }
+ vec3 aMapNormalValue = textureLod (sampler2D (uTextureSamplers[int (aBSDF.FresnelBase.w)]), aTexCoord.st, 0.0).xyz;
+ mat2 aDeltaUVMatrix = mat2 (aUVs[1] - aUVs[0], aUVs[1] - aUVs[2]);
+ mat2x3 aDeltaVectorMatrix = mat2x3 (aTriangle.Points[1] - aTriangle.Points[0], aTriangle.Points[1] - aTriangle.Points[2]);
+ aNormal = TangentSpaceNormal (aDeltaUVMatrix, aDeltaVectorMatrix, aMapNormalValue, aNormal, true);
+ }
+ #endif
+ }
+#endif
+ NormalAdaptation (-theRay.Direct, aHit.Normal, aNormal);
+ aHit.Normal = aNormal;
+ SLocalSpace aSpace = buildLocalSpace (aNormal);
+
+ if (uLightCount > 0 && IsNotZero (aBSDF, aThroughput))
+ {
+ aExpPDF = 1.0 / float(uLightCount);
+
+ int aLightIdx = min (int (floor (RandFloat() * float(uLightCount))), uLightCount - 1);
+
+ vec4 aLight = texelFetch (uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
+ vec4 aParam = texelFetch (uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));
+
+ // 'w' component is 0 for infinite light and 1 for point light
+ aLight.xyz -= mix (ZERO, theRay.Origin, aLight.w);
+
+ float aDistance = length (aLight.xyz);
+
+ aLight.xyz = SampleLight (aLight.xyz, aDistance,
+ aLight.w == 0.f /* is infinite */, aParam.w /* max cos or radius */, aExpPDF);
+
+ aImpPDF = BsdfPdfLayered (aBSDF,
+ toLocalSpace (-theRay.Direct, aSpace), toLocalSpace (aLight.xyz, aSpace), aThroughput);
+
+ // MIS weight including division by explicit PDF
+ float aMIS = (aExpPDF == MAXFLOAT) ? 1.f : aExpPDF / (aExpPDF * aExpPDF + aImpPDF * aImpPDF);
+
+ vec3 aContrib = aMIS * aParam.rgb /* Le */ * EvalBsdfLayered (
+ aBSDF, toLocalSpace (aLight.xyz, aSpace), toLocalSpace (-theRay.Direct, aSpace));
+
+ if (any (greaterThan (aContrib, MIN_CONTRIBUTION))) // check if light source is important
+ {
+ SRay aShadow = SRay (theRay.Origin + aLight.xyz * uSceneEpsilon, aLight.xyz);
+
+ aShadow.Origin += aHit.Normal * mix (
+ -uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, aLight.xyz)));
+
+ float aVisibility = SceneAnyHit (aShadow,
+ InverseDirection (aLight.xyz), aLight.w == 0.f ? MAXFLOAT : aDistance);
+
+ aRadiance += aVisibility * (aThroughput * aContrib);
+ }
+ }
+
+ // account for self-emission
+ aRadiance += aThroughput * anLE.rgb;
+
+ if (aInMedium) // handle attenuation
+ {
+ vec4 aScattering = texelFetch (uRaytraceMaterialTexture, MATERIAL_ABSORPT_BASE (aTriangle.TriIndex.w));
+
+ aThroughput *= exp (-aHit.Time * aScattering.w * (UNIT - aScattering.rgb));
+ }
+
+ vec3 anInput = UNIT; // sampled input direction
+
+ aImpPDF = SampleBsdfLayered (aBSDF,
+ toLocalSpace (-theRay.Direct, aSpace), anInput, aThroughput, aInMedium);
+
+ float aSurvive = float (any (greaterThan (aThroughput, MIN_THROUGHPUT)));
+
+#ifdef RUSSIAN_ROULETTE
+ aSurvive = aDepth < 3 ? aSurvive : min (dot (LUMA, aThroughput), 0.95f);
+#endif
+
+ // here, we additionally increase path length for non-diffuse bounces
+ if (RandFloat() > aSurvive
+ || all (lessThan (aThroughput, MIN_THROUGHPUT))
+ || aDepth >= (theNbSamples / FRAME_STEP + int(step (1.0 / M_PI, aImpPDF))))
+ {
+ aDepth = INVALID_BOUNCES; // terminate path
+ }
+
+#ifdef RUSSIAN_ROULETTE
+ aThroughput /= aSurvive;
+#endif
+
+ anInput = normalize (fromLocalSpace (anInput, aSpace));
+
+ theRay = SRay (theRay.Origin + anInput * uSceneEpsilon +
+ aHit.Normal * mix (-uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, anInput))), anInput);
+
+ theInverse = InverseDirection (anInput);
+ }
+
+ gl_FragDepth = aRaytraceDepth;
+
+ return vec4 (aRadiance, aRaytraceDepth);
+}
+
+#endif
--- /dev/null
+//! Function computes contribution of directional light source
+//! into global variables Diffuse and Specular (Phong shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param theIsFront front/back face flag
+//! @param theShadow shadow attenuation
+void occDirectionalLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in bool theIsFront,
+ in float theShadow)
+{
+ vec3 aLight = occLight_Position (theId);
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
+ }
+
+ Diffuse += occLight_Diffuse (theId) * aNdotL * theShadow;
+ Specular += occLight_Specular (theId) * aSpecl * theShadow;
+}
--- /dev/null
+//! Function computes contribution of isotropic point light source
+//! into global variables Diffuse and Specular (Phong shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param thePoint 3D position (world space)
+//! @param theIsFront front/back face flag
+void occPointLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint,
+ in bool theIsFront)
+{
+ vec3 aLight = occLight_Position (theId) - thePoint;
+
+ float aDist = length (aLight);
+ float aRange = occLight_Range (theId);
+ float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));
+ if (anAtten <= 0.0) return;
+ aLight /= aDist;
+
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
+ }
+
+ Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten;
+ Specular += occLight_Specular(theId) * aSpecl * anAtten;
+}
--- /dev/null
+// Created on: 2013-10-10
+// Created by: Denis BOGOLEPOV
+// Copyright (c) 2013-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+varying vec3 View; //!< Direction to the viewer
+varying vec3 Normal; //!< Vertex normal in view space
+varying vec4 Position; //!< Vertex position in view space.
+varying vec4 PositionWorld; //!< Vertex position in world space
+
+vec3 Ambient; //!< Ambient contribution of light sources
+vec3 Diffuse; //!< Diffuse contribution of light sources
+vec3 Specular; //!< Specular contribution of light sources
+
+//! Computes contribution of isotropic point light source
+void pointLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint)
+{
+ vec3 aLight = occLight_Position (theId).xyz;
+ if (!occLight_IsHeadlight (theId))
+ {
+ aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));
+ }
+ aLight -= thePoint;
+
+ float aDist = length (aLight);
+ aLight = aLight * (1.0 / aDist);
+
+ float anAtten = 1.0 / (occLight_ConstAttenuation (theId)
+ + occLight_LinearAttenuation (theId) * aDist);
+
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
+ }
+
+ Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;
+ Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;
+}
+
+//! Computes contribution of spotlight source
+void spotLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint)
+{
+ vec3 aLight = occLight_Position (theId).xyz;
+ vec3 aSpotDir = occLight_SpotDirection (theId).xyz;
+ if (!occLight_IsHeadlight (theId))
+ {
+ aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));
+ aSpotDir = vec3 (occWorldViewMatrix * vec4 (aSpotDir, 0.0));
+ }
+ aLight -= thePoint;
+
+ float aDist = length (aLight);
+ aLight = aLight * (1.0 / aDist);
+
+ aSpotDir = normalize (aSpotDir);
+
+ // light cone
+ float aCosA = dot (aSpotDir, -aLight);
+ if (aCosA >= 1.0 || aCosA < cos (occLight_SpotCutOff (theId)))
+ {
+ return;
+ }
+
+ float anExponent = occLight_SpotExponent (theId);
+ float anAtten = 1.0 / (occLight_ConstAttenuation (theId)
+ + occLight_LinearAttenuation (theId) * aDist);
+ if (anExponent > 0.0)
+ {
+ anAtten *= pow (aCosA, anExponent * 128.0);
+ }
+
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
+ }
+
+ Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;
+ Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;
+}
+
+//! Computes contribution of directional light source
+void directionalLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView)
+{
+ vec3 aLight = normalize (occLight_Position (theId).xyz);
+ if (!occLight_IsHeadlight (theId))
+ {
+ aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 0.0));
+ }
+
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
+ }
+
+ Diffuse += occLight_Diffuse (theId).rgb * aNdotL;
+ Specular += occLight_Specular (theId).rgb * aSpecl;
+}
+
+//! Computes illumination from light sources
+vec4 computeLighting (in vec3 theNormal,
+ in vec3 theView,
+ in vec4 thePoint)
+{
+ // Clear the light intensity accumulators
+ Ambient = occLightAmbient.rgb;
+ Diffuse = vec3 (0.0);
+ Specular = vec3 (0.0);
+ vec3 aPoint = thePoint.xyz / thePoint.w;
+ for (int anIndex = 0; anIndex < occLightSourcesCount; ++anIndex)
+ {
+ int aType = occLight_Type (anIndex);
+ if (aType == OccLightType_Direct)
+ {
+ directionalLight (anIndex, theNormal, theView);
+ }
+ else if (aType == OccLightType_Point)
+ {
+ pointLight (anIndex, theNormal, theView, aPoint);
+ }
+ else if (aType == OccLightType_Spot)
+ {
+ spotLight (anIndex, theNormal, theView, aPoint);
+ }
+ }
+
+ vec3 aMatAmbient = occMaterial_Ambient (gl_FrontFacing);
+ vec4 aMatDiffuse = occMaterial_Diffuse (gl_FrontFacing);
+ vec3 aMatSpecular = occMaterial_Specular(gl_FrontFacing);
+ vec3 aMatEmission = occMaterial_Emission(gl_FrontFacing);
+ vec3 aColor = Ambient * aMatAmbient.rgb
+ + Diffuse * aMatDiffuse.rgb
+ + Specular * aMatSpecular.rgb
+ + aMatEmission.rgb;
+ return vec4 (aColor, aMatDiffuse.a);
+}
+
+//! Entry point to the Fragment Shader
+void main()
+{
+ // process clipping planes
+ for (int anIndex = 0; anIndex < occClipPlaneCount; ++anIndex)
+ {
+ vec4 aClipEquation = occClipPlaneEquations[anIndex];
+ if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0)
+ {
+ discard;
+ }
+ }
+
+ vec4 aColor = computeLighting (normalize (Normal), normalize (View), Position);
+ occSetFragColor (aColor);
+}
--- /dev/null
+// Created on: 2013-10-10
+// Created by: Denis BOGOLEPOV
+// Copyright (c) 2013-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+varying vec3 View; //!< Direction to the viewer
+varying vec3 Normal; //!< Vertex normal in view space
+varying vec4 Position; //!< Vertex position in view space
+varying vec4 PositionWorld; //!< Vertex position in world space
+
+//! Computes the normal in view space
+vec3 TransformNormal (in vec3 theNormal)
+{
+ vec4 aResult = occWorldViewMatrixInverseTranspose
+ * occModelWorldMatrixInverseTranspose
+ * vec4 (theNormal, 0.0);
+ return normalize (aResult.xyz);
+}
+
+//! Entry point to the Vertex Shader
+void main()
+{
+ PositionWorld = occModelWorldMatrix * occVertex;
+ Position = occWorldViewMatrix * PositionWorld;
+ Normal = TransformNormal (occNormal);
+
+ // Note: The specified view vector is absolutely correct only for the orthogonal projection.
+ // For perspective projection it will be approximate, but it is in good agreement with the OpenGL calculations.
+ View = vec3 (0.0, 0.0, 1.0);
+
+ // Do fixed functionality vertex transform
+ gl_Position = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;
+}
--- /dev/null
+//! Function computes contribution of spotlight source
+//! into global variables Diffuse and Specular (Phong shading).
+//! @param theId light source index
+//! @param theNormal surface normal
+//! @param theView view direction
+//! @param thePoint 3D position (world space)
+//! @param theIsFront front/back face flag
+//! @param theShadow the value from shadow map
+void occSpotLight (in int theId,
+ in vec3 theNormal,
+ in vec3 theView,
+ in vec3 thePoint,
+ in bool theIsFront,
+ in float theShadow)
+{
+ vec3 aLight = occLight_Position (theId) - thePoint;
+
+ float aDist = length (aLight);
+ float aRange = occLight_Range (theId);
+ float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));
+ if (anAtten <= 0.0) return;
+ aLight /= aDist;
+
+ vec3 aSpotDir = occLight_SpotDirection (theId);
+ // light cone
+ float aCosA = dot (aSpotDir, -aLight);
+ if (aCosA >= 1.0 || aCosA < cos (occLight_SpotCutOff (theId)))
+ {
+ return;
+ }
+
+ float anExponent = occLight_SpotExponent (theId);
+ if (anExponent > 0.0)
+ {
+ anAtten *= pow (aCosA, anExponent * 128.0);
+ }
+
+ vec3 aHalf = normalize (aLight + theView);
+
+ vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
+ float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
+ float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
+
+ float aSpecl = 0.0;
+ if (aNdotL > 0.0)
+ {
+ aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
+ }
+
+ Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten * theShadow;
+ Specular += occLight_Specular(theId) * aSpecl * anAtten * theShadow;
+}
--- /dev/null
+//! Returns point light source attenuation factor
+float occRangedPointLightAttenuation (in float theDistance, in float theRange)
+{
+ if (theDistance <= theRange)
+ {
+ float aResult = theDistance / theRange;
+ aResult *= aResult;
+ aResult *= aResult;
+ aResult = 1.0 - aResult;
+ aResult = clamp(aResult, 0.0, 1.0);
+ aResult /= max(0.0001, theDistance * theDistance);
+ return aResult;
+ }
+ return -1.0;
+}
+
+//! Returns point light source attenuation factor with quadratic attenuation in case of zero range.
+float occPointLightAttenuation (in float theDistance, in float theRange)
+{
+ if (theRange == 0.0)
+ {
+ return 1.0 / max(0.0001, theDistance * theDistance);
+ }
+ return occRangedPointLightAttenuation (theDistance, theRange);
+}
+
+//! Returns point light source attenuation factor with linear attenuation in case of zero range.
+float occPointLightAttenuation (in float theDistance, in float theRange, in float theLinearAttenuation, in float theConstAttenuation)
+{
+ if (theRange == 0.0)
+ {
+ return 1.0 / (theConstAttenuation + theLinearAttenuation * theDistance);
+ }
+ return occRangedPointLightAttenuation (theDistance, theRange);
+}
--- /dev/null
+#ifdef ADAPTIVE_SAMPLING
+ #extension GL_ARB_shader_image_load_store : require
+#endif
+#ifdef ADAPTIVE_SAMPLING_ATOMIC
+ #extension GL_NV_shader_atomic_float : require
+#endif
+
+#ifdef USE_TEXTURES
+ #extension GL_ARB_bindless_texture : require
+#endif
+
+//! Normalized pixel coordinates.
+in vec2 vPixel;
+
+//! Sub-pixel offset in for FSAA.
+uniform vec2 uFsaaOffset;
+//! Sub-pixel offset in Y direction for FSAA.
+uniform float uOffsetY;
+
+//! Origin of viewing ray in left-top corner.
+uniform vec3 uOriginLT;
+//! Origin of viewing ray in left-bottom corner.
+uniform vec3 uOriginLB;
+//! Origin of viewing ray in right-top corner.
+uniform vec3 uOriginRT;
+//! Origin of viewing ray in right-bottom corner.
+uniform vec3 uOriginRB;
+
+//! Width of the rendering window.
+uniform int uWinSizeX;
+//! Height of the rendering window.
+uniform int uWinSizeY;
+
+//! Direction of viewing ray in left-top corner.
+uniform vec3 uDirectLT;
+//! Direction of viewing ray in left-bottom corner.
+uniform vec3 uDirectLB;
+//! Direction of viewing ray in right-top corner.
+uniform vec3 uDirectRT;
+//! Direction of viewing ray in right-bottom corner.
+uniform vec3 uDirectRB;
+
+//! Inverse model-view-projection matrix.
+uniform mat4 uUnviewMat;
+
+//! Model-view-projection matrix.
+uniform mat4 uViewMat;
+
+//! Texture buffer of data records of bottom-level BVH nodes.
+uniform isamplerBuffer uSceneNodeInfoTexture;
+//! Texture buffer of minimum points of bottom-level BVH nodes.
+uniform samplerBuffer uSceneMinPointTexture;
+//! Texture buffer of maximum points of bottom-level BVH nodes.
+uniform samplerBuffer uSceneMaxPointTexture;
+//! Texture buffer of transformations of high-level BVH nodes.
+uniform samplerBuffer uSceneTransformTexture;
+
+//! Texture buffer of vertex coords.
+uniform samplerBuffer uGeometryVertexTexture;
+//! Texture buffer of vertex normals.
+uniform samplerBuffer uGeometryNormalTexture;
+#ifdef USE_TEXTURES
+ //! Texture buffer of per-vertex UV-coordinates.
+ uniform samplerBuffer uGeometryTexCrdTexture;
+#endif
+//! Texture buffer of triangle indices.
+uniform isamplerBuffer uGeometryTriangTexture;
+
+//! Texture buffer of material properties.
+uniform samplerBuffer uRaytraceMaterialTexture;
+//! Texture buffer of light source properties.
+uniform samplerBuffer uRaytraceLightSrcTexture;
+
+#ifdef BACKGROUND_CUBEMAP
+ //! Environment cubemap texture.
+ uniform samplerCube uEnvMapTexture;
+ //! Coefficient of Y controlling horizontal flip of cubemap
+ uniform int uYCoeff;
+ //! Coefficient of Z controlling vertical flip of cubemap
+ uniform int uZCoeff;
+#else
+ //! Environment map texture.
+ uniform sampler2D uEnvMapTexture;
+#endif
+
+//! Total number of light sources.
+uniform int uLightCount;
+//! Intensity of global ambient light.
+uniform vec4 uGlobalAmbient;
+
+//! Enables/disables hard shadows.
+uniform int uShadowsEnabled;
+//! Enables/disables specular reflections.
+uniform int uReflectEnabled;
+//! Enables/disables environment map lighting.
+uniform int uEnvMapEnabled;
+//! Enables/disables environment map background.
+uniform int uEnvMapForBack;
+
+//! Radius of bounding sphere of the scene.
+uniform float uSceneRadius;
+//! Scene epsilon to prevent self-intersections.
+uniform float uSceneEpsilon;
+
+#ifdef USE_TEXTURES
+ //! Unique 64-bit handles of OpenGL textures.
+ uniform uvec2 uTextureSamplers[MAX_TEX_NUMBER];
+#endif
+
+#ifdef ADAPTIVE_SAMPLING
+ //! OpenGL image used for accumulating rendering result.
+ volatile restrict layout(r32f) uniform image2D uRenderImage;
+
+#ifdef ADAPTIVE_SAMPLING_ATOMIC
+ //! OpenGL image storing offsets of sampled pixels blocks.
+ coherent restrict layout(rg32i) uniform iimage2D uOffsetImage;
+#else
+ //! OpenGL image defining per-tile amount of samples.
+ volatile restrict layout(r32i) uniform iimage2D uTilesImage;
+#endif
+
+ //! Screen space tile size.
+ uniform ivec2 uTileSize;
+#endif
+
+//! Top color of gradient background.
+uniform vec4 uBackColorTop;
+//! Bottom color of gradient background.
+uniform vec4 uBackColorBot;
+
+//! Aperture radius of camera used for depth-of-field
+uniform float uApertureRadius;
+
+//! Focal distance of camera used for depth-of field
+uniform float uFocalPlaneDist;
+
+//! Camera position used for projective mode
+uniform vec3 uEyeOrig;
+
+//! Camera view direction used for projective mode
+uniform vec3 uEyeView;
+
+//! Camera's screen vertical direction used for projective mode
+uniform vec3 uEyeVert;
+
+//! Camera's screen horizontal direction used for projective mode
+uniform vec3 uEyeSide;
+
+//! Camera's screen size used for projective mode
+uniform vec2 uEyeSize;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Specific data types
+
+//! Stores ray parameters.
+struct SRay
+{
+ vec3 Origin;
+ vec3 Direct;
+};
+
+//! Stores intersection parameters.
+struct SIntersect
+{
+ float Time;
+ vec2 UV;
+ vec3 Normal;
+};
+
+//! Stores triangle's vertex indexes and vertexes itself
+struct STriangle
+{
+ ivec4 TriIndex;
+ vec3 Points[3];
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Some useful constants
+
+#define MAXFLOAT 1e15f
+
+#define SMALL vec3 (exp2 (-80.0f))
+
+#define ZERO vec3 (0.0f, 0.0f, 0.0f)
+#define UNIT vec3 (1.0f, 1.0f, 1.0f)
+
+#define AXIS_X vec3 (1.0f, 0.0f, 0.0f)
+#define AXIS_Y vec3 (0.0f, 1.0f, 0.0f)
+#define AXIS_Z vec3 (0.0f, 0.0f, 1.0f)
+
+#define M_PI 3.141592653f
+#define M_2_PI 6.283185307f
+#define M_PI_2 1.570796327f
+
+#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)
+
+// =======================================================================
+// function : MatrixRowMultiplyDir
+// purpose : Multiplies a vector by matrix
+// =======================================================================
+vec3 MatrixRowMultiplyDir (in vec3 v,
+ in vec4 m0,
+ in vec4 m1,
+ in vec4 m2)
+{
+ return vec3 (dot (m0.xyz, v),
+ dot (m1.xyz, v),
+ dot (m2.xyz, v));
+}
+
+//! 32-bit state of random number generator.
+uint RandState;
+
+// =======================================================================
+// function : SeedRand
+// purpose : Applies hash function by Thomas Wang to randomize seeds
+// (see http://www.burtleburtle.net/bob/hash/integer.html)
+// =======================================================================
+void SeedRand (in int theSeed, in int theSizeX, in int theRadius)
+{
+ RandState = uint (int (gl_FragCoord.y) / theRadius * theSizeX + int (gl_FragCoord.x) / theRadius + theSeed);
+
+ RandState = (RandState + 0x479ab41du) + (RandState << 8);
+ RandState = (RandState ^ 0xe4aa10ceu) ^ (RandState >> 5);
+ RandState = (RandState + 0x9942f0a6u) - (RandState << 14);
+ RandState = (RandState ^ 0x5aedd67du) ^ (RandState >> 3);
+ RandState = (RandState + 0x17bea992u) + (RandState << 7);
+}
+
+// =======================================================================
+// function : RandInt
+// purpose : Generates integer using Xorshift algorithm by G. Marsaglia
+// =======================================================================
+uint RandInt()
+{
+ RandState ^= (RandState << 13);
+ RandState ^= (RandState >> 17);
+ RandState ^= (RandState << 5);
+
+ return RandState;
+}
+
+// =======================================================================
+// function : RandFloat
+// purpose : Generates a random float in 0 <= x < 1 range
+// =======================================================================
+float RandFloat()
+{
+ return float (RandInt()) * (1.f / 4294967296.f);
+}
+
+// =======================================================================
+// function : MatrixColMultiplyPnt
+// purpose : Multiplies a vector by matrix
+// =======================================================================
+vec3 MatrixColMultiplyPnt (in vec3 v,
+ in vec4 m0,
+ in vec4 m1,
+ in vec4 m2,
+ in vec4 m3)
+{
+ return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z + m3.x,
+ m0.y * v.x + m1.y * v.y + m2.y * v.z + m3.y,
+ m0.z * v.x + m1.z * v.y + m2.z * v.z + m3.z);
+}
+
+// =======================================================================
+// function : MatrixColMultiplyDir
+// purpose : Multiplies a vector by matrix
+// =======================================================================
+vec3 MatrixColMultiplyDir (in vec3 v,
+ in vec4 m0,
+ in vec4 m1,
+ in vec4 m2)
+{
+ return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z,
+ m0.y * v.x + m1.y * v.y + m2.y * v.z,
+ m0.z * v.x + m1.z * v.y + m2.z * v.z);
+}
+
+//=======================================================================
+// function : InverseDirection
+// purpose : Returns safely inverted direction of the given one
+//=======================================================================
+vec3 InverseDirection (in vec3 theInput)
+{
+ vec3 anInverse = 1.f / max (abs (theInput), SMALL);
+
+ return mix (-anInverse, anInverse, step (ZERO, theInput));
+}
+
+//=======================================================================
+// function : BackgroundColor
+// purpose : Returns color of gradient background
+//=======================================================================
+vec4 BackgroundColor()
+{
+#ifdef ADAPTIVE_SAMPLING_ATOMIC
+
+ ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
+
+ ivec2 aTileXY = imageLoad (uOffsetImage, aFragCoord / uTileSize).xy * uTileSize;
+
+ aTileXY.y += aFragCoord.y % min (uWinSizeY - aTileXY.y, uTileSize.y);
+
+ return mix (uBackColorBot, uBackColorTop, float (aTileXY.y) / uWinSizeY);
+
+#else
+
+ return mix (uBackColorBot, uBackColorTop, vPixel.y);
+
+#endif
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Functions for compute ray-object intersection
+
+//=======================================================================
+// function : sampleUniformDisk
+// purpose :
+//=======================================================================
+vec2 sampleUniformDisk ()
+{
+ vec2 aPoint;
+
+ float aKsi1 = 2.f * RandFloat () - 1.f;
+ float aKsi2 = 2.f * RandFloat () - 1.f;
+
+ if (aKsi1 > -aKsi2)
+ {
+ if (aKsi1 > aKsi2)
+ aPoint = vec2 (aKsi1, (M_PI / 4.f) * (0.f + aKsi2 / aKsi1));
+ else
+ aPoint = vec2 (aKsi2, (M_PI / 4.f) * (2.f - aKsi1 / aKsi2));
+ }
+ else
+ {
+ if (aKsi1 < aKsi2)
+ aPoint = vec2 (-aKsi1, (M_PI / 4.f) * (4.f + aKsi2 / aKsi1));
+ else
+ aPoint = vec2 (-aKsi2, (M_PI / 4.f) * (6.f - aKsi1 / aKsi2));
+ }
+
+ return vec2 (sin (aPoint.y), cos (aPoint.y)) * aPoint.x;
+}
+
+// =======================================================================
+// function : GenerateRay
+// purpose :
+// =======================================================================
+SRay GenerateRay (in vec2 thePixel)
+{
+#ifndef DEPTH_OF_FIELD
+
+ vec3 aP0 = mix (uOriginLB, uOriginRB, thePixel.x);
+ vec3 aP1 = mix (uOriginLT, uOriginRT, thePixel.x);
+
+ vec3 aD0 = mix (uDirectLB, uDirectRB, thePixel.x);
+ vec3 aD1 = mix (uDirectLT, uDirectRT, thePixel.x);
+
+ vec3 aDirection = normalize (mix (aD0, aD1, thePixel.y));
+
+ return SRay (mix (aP0, aP1, thePixel.y), aDirection);
+
+#else
+
+ vec2 aPixel = uEyeSize * (thePixel - vec2 (0.5f)) * 2.f;
+
+ vec2 aAperturePnt = sampleUniformDisk () * uApertureRadius;
+
+ vec3 aLocalDir = normalize (vec3 (
+ aPixel * uFocalPlaneDist - aAperturePnt, uFocalPlaneDist));
+
+ vec3 aOrigin = uEyeOrig +
+ uEyeSide * aAperturePnt.x +
+ uEyeVert * aAperturePnt.y;
+
+ vec3 aDirect = uEyeView * aLocalDir.z +
+ uEyeSide * aLocalDir.x +
+ uEyeVert * aLocalDir.y;
+
+ return SRay (aOrigin, aDirect);
+
+#endif
+}
+
+// =======================================================================
+// function : IntersectSphere
+// purpose : Computes ray-sphere intersection
+// =======================================================================
+float IntersectSphere (in SRay theRay, in float theRadius)
+{
+ float aDdotD = dot (theRay.Direct, theRay.Direct);
+ float aDdotO = dot (theRay.Direct, theRay.Origin);
+ float aOdotO = dot (theRay.Origin, theRay.Origin);
+
+ float aD = aDdotO * aDdotO - aDdotD * (aOdotO - theRadius * theRadius);
+
+ if (aD > 0.0f)
+ {
+ float aTime = (sqrt (aD) - aDdotO) * (1.0f / aDdotD);
+
+ return aTime > 0.0f ? aTime : MAXFLOAT;
+ }
+
+ return MAXFLOAT;
+}
+
+// =======================================================================
+// function : IntersectTriangle
+// purpose : Computes ray-triangle intersection (branchless version)
+// =======================================================================
+void IntersectTriangle (in SRay theRay,
+ in vec3 thePnt0,
+ in vec3 thePnt1,
+ in vec3 thePnt2,
+ out vec3 theUVT,
+ out vec3 theNorm)
+{
+ vec3 aToTrg = thePnt0 - theRay.Origin;
+
+ vec3 aEdge0 = thePnt1 - thePnt0;
+ vec3 aEdge1 = thePnt0 - thePnt2;
+
+ theNorm = cross (aEdge1, aEdge0);
+
+ vec3 theVect = cross (theRay.Direct, aToTrg);
+
+ theUVT = vec3 (dot (theNorm, aToTrg),
+ dot (theVect, aEdge1),
+ dot (theVect, aEdge0)) * (1.f / dot (theNorm, theRay.Direct));
+
+ theUVT.x = any (lessThan (theUVT, ZERO)) || (theUVT.y + theUVT.z) > 1.f ? MAXFLOAT : theUVT.x;
+}
+
+#define EMPTY_ROOT ivec4(0)
+
+//! Utility structure containing information about
+//! currently traversing sub-tree of scene's BVH.
+struct SSubTree
+{
+ //! Transformed ray.
+ SRay TrsfRay;
+
+ //! Inversed ray direction.
+ vec3 Inverse;
+
+ //! Parameters of sub-root node.
+ ivec4 SubData;
+};
+
+#define MATERIAL_AMBN(index) (19 * index + 0)
+#define MATERIAL_DIFF(index) (19 * index + 1)
+#define MATERIAL_SPEC(index) (19 * index + 2)
+#define MATERIAL_EMIS(index) (19 * index + 3)
+#define MATERIAL_REFL(index) (19 * index + 4)
+#define MATERIAL_REFR(index) (19 * index + 5)
+#define MATERIAL_TRAN(index) (19 * index + 6)
+#define MATERIAL_TRS1(index) (19 * index + 7)
+#define MATERIAL_TRS2(index) (19 * index + 8)
+#define MATERIAL_TRS3(index) (19 * index + 9)
+
+#define TRS_OFFSET(treelet) treelet.SubData.x
+#define BVH_OFFSET(treelet) treelet.SubData.y
+#define VRT_OFFSET(treelet) treelet.SubData.z
+#define TRG_OFFSET(treelet) treelet.SubData.w
+
+//! Identifies the absence of intersection.
+#define INVALID_HIT ivec4 (-1)
+
+//! Global stack shared between traversal functions.
+int Stack[STACK_SIZE];
+
+// =======================================================================
+// function : pop
+// purpose :
+// =======================================================================
+int pop (inout int theHead)
+{
+ int aData = Stack[theHead];
+
+ int aMask = aData >> 26;
+ int aNode = aMask & 0x3;
+
+ aMask >>= 2;
+
+ if ((aMask & 0x3) == aNode)
+ {
+ --theHead;
+ }
+ else
+ {
+ aMask |= (aMask << 2) & 0x30;
+
+ Stack[theHead] = (aData & 0x03FFFFFF) | (aMask << 26);
+ }
+
+ return (aData & 0x03FFFFFF) + aNode;
+}
+
+// =======================================================================
+// function : SceneNearestHit
+// purpose : Finds intersection with nearest scene triangle
+// =======================================================================
+STriangle SceneNearestHit (in SRay theRay, in vec3 theInverse, inout SIntersect theHit, out int theTrsfId)
+{
+ STriangle aTriangle = STriangle (INVALID_HIT, vec3[](vec3(0.0), vec3(0.0), vec3(0.0)));
+
+ int aNode = 0; // node to traverse
+ int aHead = -1; // pointer of stack
+ int aStop = -1; // BVH level switch
+
+ SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+
+ for (bool toContinue = true; toContinue; /* none */)
+ {
+ ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);
+
+ if (aData.x == 0) // if inner node
+ {
+ aData.y += BVH_OFFSET (aSubTree);
+
+ vec4 aHitTimes = vec4 (MAXFLOAT,
+ MAXFLOAT,
+ MAXFLOAT,
+ MAXFLOAT);
+
+ vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;
+
+ vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+
+ vec3 aTimeMax = max (aNodeMin0, aNodeMax0);
+ vec3 aTimeMin = min (aNodeMin0, aNodeMax0);
+
+ float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin1, aNodeMax1);
+ aTimeMin = min (aNodeMin1, aNodeMax1);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin2, aNodeMax2);
+ aTimeMin = min (aNodeMin2, aNodeMax2);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin3, aNodeMax3);
+ aTimeMin = min (aNodeMin3, aNodeMax3);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;
+
+ ivec4 aChildren = ivec4 (0, 1, 2, 3);
+
+ aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;
+ aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;
+ aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;
+ aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;
+ aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;
+ aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;
+ aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;
+ aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;
+ aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;
+ aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;
+
+ if (aHitTimes.x != MAXFLOAT)
+ {
+ int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2
+ | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);
+
+ if (aHitTimes.y != MAXFLOAT)
+ Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;
+
+ aNode = aData.y + aChildren.x;
+ }
+ else
+ {
+ toContinue = (aHead >= 0);
+
+ if (aHead == aStop) // go to top-level BVH
+ {
+ aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+ }
+
+ if (aHead >= 0)
+ aNode = pop (aHead);
+ }
+ }
+ else if (aData.x < 0) // leaf node (contains triangles)
+ {
+ vec3 aNormal;
+ vec3 aTimeUV;
+
+ for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)
+ {
+ ivec4 aTriIndex = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));
+ vec3 aPoints[3];
+
+ aPoints[0] = texelFetch (uGeometryVertexTexture, aTriIndex.x += VRT_OFFSET (aSubTree)).xyz;
+ aPoints[1] = texelFetch (uGeometryVertexTexture, aTriIndex.y += VRT_OFFSET (aSubTree)).xyz;
+ aPoints[2] = texelFetch (uGeometryVertexTexture, aTriIndex.z += VRT_OFFSET (aSubTree)).xyz;
+
+ IntersectTriangle (aSubTree.TrsfRay, aPoints[0], aPoints[1], aPoints[2], aTimeUV, aNormal);
+
+ if (aTimeUV.x < theHit.Time)
+ {
+ aTriangle.TriIndex = aTriIndex;
+ for (int i = 0; i < 3; ++i)
+ {
+ aTriangle.Points[i] = aPoints[i];
+ }
+
+ theTrsfId = TRS_OFFSET (aSubTree);
+
+ theHit = SIntersect (aTimeUV.x, aTimeUV.yz, aNormal);
+ }
+ }
+
+ toContinue = (aHead >= 0);
+
+ if (aHead == aStop) // go to top-level BVH
+ {
+ aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+ }
+
+ if (aHead >= 0)
+ aNode = pop (aHead);
+ }
+ else if (aData.x > 0) // switch node
+ {
+ aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root
+
+ vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);
+ vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);
+ vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);
+ vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);
+
+ aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,
+ aInvTransf0,
+ aInvTransf1,
+ aInvTransf2);
+
+ aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) /
+ max (abs (aSubTree.TrsfRay.Direct), SMALL);
+
+ aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,
+ aInvTransf0,
+ aInvTransf1,
+ aInvTransf2,
+ aInvTransf3);
+
+ aNode = BVH_OFFSET (aSubTree); // go to sub-root node
+
+ aStop = aHead; // store current stack pointer
+ }
+ }
+
+ return aTriangle;
+}
+
+// =======================================================================
+// function : SceneAnyHit
+// purpose : Finds intersection with any scene triangle
+// =======================================================================
+float SceneAnyHit (in SRay theRay, in vec3 theInverse, in float theDistance)
+{
+ float aFactor = 1.f;
+
+ int aNode = 0; // node to traverse
+ int aHead = -1; // pointer of stack
+ int aStop = -1; // BVH level switch
+
+ SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+
+ for (bool toContinue = true; toContinue; /* none */)
+ {
+ ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);
+
+ if (aData.x == 0) // if inner node
+ {
+ aData.y += BVH_OFFSET (aSubTree);
+
+ vec4 aHitTimes = vec4 (MAXFLOAT,
+ MAXFLOAT,
+ MAXFLOAT,
+ MAXFLOAT);
+
+ vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;
+
+ vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+ vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
+
+ vec3 aTimeMax = max (aNodeMin0, aNodeMax0);
+ vec3 aTimeMin = min (aNodeMin0, aNodeMax0);
+
+ float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin1, aNodeMax1);
+ aTimeMin = min (aNodeMin1, aNodeMax1);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin2, aNodeMax2);
+ aTimeMin = min (aNodeMin2, aNodeMax2);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;
+
+ aTimeMax = max (aNodeMin3, aNodeMax3);
+ aTimeMin = min (aNodeMin3, aNodeMax3);
+
+ aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
+ aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
+
+ aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;
+
+ ivec4 aChildren = ivec4 (0, 1, 2, 3);
+
+ aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;
+ aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;
+ aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;
+ aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;
+ aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;
+ aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;
+ aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;
+ aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;
+ aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;
+ aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;
+
+ if (aHitTimes.x != MAXFLOAT)
+ {
+ int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2
+ | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);
+
+ if (aHitTimes.y != MAXFLOAT)
+ Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;
+
+ aNode = aData.y + aChildren.x;
+ }
+ else
+ {
+ toContinue = (aHead >= 0);
+
+ if (aHead == aStop) // go to top-level BVH
+ {
+ aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+ }
+
+ if (aHead >= 0)
+ aNode = pop (aHead);
+ }
+ }
+ else if (aData.x < 0) // leaf node
+ {
+ vec3 aNormal;
+ vec3 aTimeUV;
+
+ for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)
+ {
+ ivec4 aTriangle = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));
+
+ vec3 aPoint0 = texelFetch (uGeometryVertexTexture, aTriangle.x += VRT_OFFSET (aSubTree)).xyz;
+ vec3 aPoint1 = texelFetch (uGeometryVertexTexture, aTriangle.y += VRT_OFFSET (aSubTree)).xyz;
+ vec3 aPoint2 = texelFetch (uGeometryVertexTexture, aTriangle.z += VRT_OFFSET (aSubTree)).xyz;
+
+ IntersectTriangle (aSubTree.TrsfRay, aPoint0, aPoint1, aPoint2, aTimeUV, aNormal);
+
+#ifdef TRANSPARENT_SHADOWS
+ if (aTimeUV.x < theDistance)
+ {
+ aFactor *= 1.f - texelFetch (uRaytraceMaterialTexture, MATERIAL_TRAN (aTriangle.w)).x;
+ }
+#else
+ if (aTimeUV.x < theDistance)
+ {
+ aFactor = 0.f;
+ }
+#endif
+ }
+
+ toContinue = (aHead >= 0) && (aFactor > 0.1f);
+
+ if (aHead == aStop) // go to top-level BVH
+ {
+ aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
+ }
+
+ if (aHead >= 0)
+ aNode = pop (aHead);
+ }
+ else if (aData.x > 0) // switch node
+ {
+ aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root
+
+ vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);
+ vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);
+ vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);
+ vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);
+
+ aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,
+ aInvTransf0,
+ aInvTransf1,
+ aInvTransf2);
+
+ aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,
+ aInvTransf0,
+ aInvTransf1,
+ aInvTransf2,
+ aInvTransf3);
+
+ aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) / max (abs (aSubTree.TrsfRay.Direct), SMALL);
+
+ aNode = BVH_OFFSET (aSubTree); // go to sub-root node
+
+ aStop = aHead; // store current stack pointer
+ }
+ }
+
+ return aFactor;
+}
+
+#define PI 3.1415926f
+
+// =======================================================================
+// function : Latlong
+// purpose : Converts world direction to environment texture coordinates
+// =======================================================================
+vec2 Latlong (in vec3 thePoint, in float theRadius)
+{
+ float aPsi = acos (-thePoint.z / theRadius);
+
+ float aPhi = atan (thePoint.y, thePoint.x) + PI;
+
+ return vec2 (aPhi * 0.1591549f,
+ aPsi * 0.3183098f);
+}
+
+#ifdef BACKGROUND_CUBEMAP
+//! Transform texture coordinates for cubemap lookup.
+vec3 cubemapVectorTransform (in vec3 theVec, in float theRadius)
+{
+ vec3 aVec = theVec.yzx;
+ aVec.y *= float(uYCoeff);
+ aVec.z *= float(uZCoeff);
+ return aVec;
+}
+#endif
+
+// =======================================================================
+// function : SmoothNormal
+// purpose : Interpolates normal across the triangle
+// =======================================================================
+vec3 SmoothNormal (in vec2 theUV, in ivec4 theTriangle)
+{
+ vec3 aNormal0 = texelFetch (uGeometryNormalTexture, theTriangle.x).xyz;
+ vec3 aNormal1 = texelFetch (uGeometryNormalTexture, theTriangle.y).xyz;
+ vec3 aNormal2 = texelFetch (uGeometryNormalTexture, theTriangle.z).xyz;
+
+ return normalize (aNormal1 * theUV.x +
+ aNormal2 * theUV.y +
+ aNormal0 * (1.0f - theUV.x - theUV.y));
+}
+
+#define POLYGON_OFFSET_UNIT 0.f
+#define POLYGON_OFFSET_FACTOR 1.f
+#define POLYGON_OFFSET_SCALE 0.006f
+
+// =======================================================================
+// function : PolygonOffset
+// purpose : Computes OpenGL polygon offset
+// =======================================================================
+float PolygonOffset (in vec3 theNormal, in vec3 thePoint)
+{
+ vec4 aProjectedNorm = vec4 (theNormal, -dot (theNormal, thePoint)) * uUnviewMat;
+
+ float aPolygonOffset = POLYGON_OFFSET_UNIT;
+
+ if (aProjectedNorm.z * aProjectedNorm.z > 1e-20f)
+ {
+ aProjectedNorm.xy *= 1.f / aProjectedNorm.z;
+
+ aPolygonOffset += POLYGON_OFFSET_FACTOR * max (abs (aProjectedNorm.x),
+ abs (aProjectedNorm.y));
+ }
+
+ return aPolygonOffset;
+}
+
+// =======================================================================
+// function : SmoothUV
+// purpose : Interpolates UV coordinates across the triangle
+// =======================================================================
+#ifdef USE_TEXTURES
+vec2 SmoothUV (in vec2 theUV, in ivec4 theTriangle, out vec2[3] theUVs)
+{
+ theUVs[0] = texelFetch (uGeometryTexCrdTexture, theTriangle.x).st;
+ theUVs[1] = texelFetch (uGeometryTexCrdTexture, theTriangle.y).st;
+ theUVs[2] = texelFetch (uGeometryTexCrdTexture, theTriangle.z).st;
+
+ return theUVs[1] * theUV.x +
+ theUVs[2] * theUV.y +
+ theUVs[0] * (1.0f - theUV.x - theUV.y);
+}
+
+vec2 SmoothUV (in vec2 theUV, in ivec4 theTriangle)
+{
+ vec2 aUVs[3];
+ return SmoothUV (theUV, theTriangle, aUVs);
+}
+#endif
+
+// =======================================================================
+// function : FetchEnvironment
+// purpose :
+// =======================================================================
+vec4 FetchEnvironment (in vec3 theTexCoord, in float theRadius, in bool theIsBackground)
+{
+ if (uEnvMapEnabled == 0)
+ {
+#ifdef PATH_TRACING
+ return theIsBackground ? vec4 (0.0, 0.0, 0.0, 1.0) : uGlobalAmbient;
+#else
+ return vec4 (0.0, 0.0, 0.0, 1.0);
+#endif
+ }
+
+ vec4 anAmbScale = theIsBackground ? vec4(1.0) : uGlobalAmbient;
+ vec4 anEnvColor =
+#ifdef BACKGROUND_CUBEMAP
+ textureLod (uEnvMapTexture, cubemapVectorTransform (theTexCoord, theRadius), 0.0);
+#else
+ textureLod (uEnvMapTexture, Latlong (theTexCoord, theRadius), 0.0);
+#endif
+ return anEnvColor * anAmbScale;
+}
+
+// =======================================================================
+// function : Refract
+// purpose : Computes refraction ray (also handles TIR)
+// =======================================================================
+#ifndef PATH_TRACING
+vec3 Refract (in vec3 theInput,
+ in vec3 theNormal,
+ in float theRefractIndex,
+ in float theInvRefractIndex)
+{
+ float aNdotI = dot (theInput, theNormal);
+
+ float anIndex = aNdotI < 0.0f
+ ? theInvRefractIndex
+ : theRefractIndex;
+
+ float aSquare = anIndex * anIndex * (1.0f - aNdotI * aNdotI);
+
+ if (aSquare > 1.0f)
+ {
+ return reflect (theInput, theNormal);
+ }
+
+ float aNdotT = sqrt (1.0f - aSquare);
+
+ return normalize (anIndex * theInput -
+ (anIndex * aNdotI + (aNdotI < 0.0f ? aNdotT : -aNdotT)) * theNormal);
+}
+#endif
+
+#define MIN_SLOPE 0.0001f
+#define EPS_SCALE 8.0000f
+
+#define THRESHOLD vec3 (0.1f)
+
+#define INVALID_BOUNCES 1000
+
+#define LIGHT_POS(index) (2 * index + 1)
+#define LIGHT_PWR(index) (2 * index + 0)
+
+// =======================================================================
+// function : Radiance
+// purpose : Computes color along the given ray
+// =======================================================================
+#ifndef PATH_TRACING
+vec4 Radiance (in SRay theRay, in vec3 theInverse)
+{
+ vec3 aResult = vec3 (0.0f);
+ vec4 aWeight = vec4 (1.0f);
+
+ int aTrsfId;
+
+ float aRaytraceDepth = MAXFLOAT;
+ float aRefractionIdx = 0.0;
+
+ for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)
+ {
+ SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);
+
+ ivec4 aTriIndex = SceneNearestHit (theRay, theInverse, aHit, aTrsfId).TriIndex;
+
+ if (aTriIndex.x == -1)
+ {
+ vec4 aColor = vec4 (0.0);
+
+ if (bool(uEnvMapForBack) || aWeight.w == 0.0 /* reflection */)
+ {
+ float aRadius = uSceneRadius;
+ vec3 aTexCoord = vec3 (0.0);
+
+ if (aDepth == 0 || (aRefractionIdx == 1.0 && aWeight.w != 0.0))
+ {
+ vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;
+ vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;
+ vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));
+ vec3 aDirect = uEyeView * aLocalDir.z +
+ uEyeSide * aLocalDir.x +
+ uEyeVert * aLocalDir.y;
+
+ aTexCoord = aDirect * uSceneRadius;
+ aRadius = length (aTexCoord);
+ }
+ else
+ {
+ float aTime = IntersectSphere (theRay, uSceneRadius);
+ aTexCoord = theRay.Direct * aTime + theRay.Origin;
+ }
+
+ aColor = FetchEnvironment (aTexCoord, aRadius, aWeight.w != 0.0);
+ }
+ else
+ {
+ aColor = BackgroundColor();
+ }
+
+ aResult += aWeight.xyz * aColor.xyz; aWeight.w *= aColor.w;
+
+ break; // terminate path
+ }
+
+ vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTrsfId + 0).xyz;
+ vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTrsfId + 1).xyz;
+ vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTrsfId + 2).xyz;
+
+ aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),
+ dot (aInvTransf1, aHit.Normal),
+ dot (aInvTransf2, aHit.Normal)));
+
+ theRay.Origin += theRay.Direct * aHit.Time; // intersection point
+
+ // Evaluate depth on first hit
+ if (aDepth == 0)
+ {
+ vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);
+
+ float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);
+ #ifdef THE_ZERO_TO_ONE_DEPTH
+ aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);
+ #else
+ aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;
+ #endif
+ }
+
+ vec3 aNormal = SmoothNormal (aHit.UV, aTriIndex);
+
+ aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),
+ dot (aInvTransf1, aNormal),
+ dot (aInvTransf2, aNormal)));
+
+ vec3 aAmbient = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_AMBN (aTriIndex.w)).rgb;
+ vec4 aDiffuse = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_DIFF (aTriIndex.w));
+ vec4 aSpecular = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_SPEC (aTriIndex.w));
+ vec4 aOpacity = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_TRAN (aTriIndex.w));
+
+#ifdef USE_TEXTURES
+ if (aDiffuse.w >= 0.f)
+ {
+ vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);
+
+ vec4 aTrsfRow1 = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));
+ vec4 aTrsfRow2 = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));
+
+ aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),
+ dot (aTrsfRow2, aTexCoord));
+
+ vec4 aTexColor = textureLod (
+ sampler2D (uTextureSamplers[int(aDiffuse.w)]), aTexCoord.st, 0.f);
+
+ aDiffuse.rgb *= aTexColor.rgb;
+ aAmbient.rgb *= aTexColor.rgb;
+
+ // keep refractive index untouched (Z component)
+ aOpacity.xy = vec2 (aTexColor.w * aOpacity.x, 1.0f - aTexColor.w * aOpacity.x);
+ }
+#endif
+
+ vec3 aEmission = texelFetch (
+ uRaytraceMaterialTexture, MATERIAL_EMIS (aTriIndex.w)).rgb;
+
+ float aGeomFactor = dot (aNormal, theRay.Direct);
+
+ aResult.xyz += aWeight.xyz * aOpacity.x * (
+ uGlobalAmbient.xyz * aAmbient * max (abs (aGeomFactor), 0.5f) + aEmission);
+
+ vec3 aSidedNormal = mix (aNormal, -aNormal, step (0.0f, aGeomFactor));
+
+ for (int aLightIdx = 0; aLightIdx < uLightCount; ++aLightIdx)
+ {
+ vec4 aLight = texelFetch (
+ uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
+
+ float aDistance = MAXFLOAT;
+
+ if (aLight.w != 0.0f) // point light source
+ {
+ aDistance = length (aLight.xyz -= theRay.Origin);
+
+ aLight.xyz *= 1.0f / aDistance;
+ }
+
+ float aLdotN = dot (aLight.xyz, aSidedNormal);
+
+ if (aLdotN > 0.0f) // first check if light source is important
+ {
+ float aVisibility = 1.0f;
+
+ if (bool(uShadowsEnabled))
+ {
+ SRay aShadow = SRay (theRay.Origin, aLight.xyz);
+
+ aShadow.Origin += uSceneEpsilon * (aLight.xyz +
+ mix (-aHit.Normal, aHit.Normal, step (0.0f, dot (aHit.Normal, aLight.xyz))));
+
+ vec3 aInverse = 1.0f / max (abs (aLight.xyz), SMALL);
+
+ aVisibility = SceneAnyHit (
+ aShadow, mix (-aInverse, aInverse, step (ZERO, aLight.xyz)), aDistance);
+ }
+
+ if (aVisibility > 0.0f)
+ {
+ vec3 aIntensity = min (UNIT, vec3 (texelFetch (
+ uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx))));
+
+ float aRdotV = dot (reflect (aLight.xyz, aSidedNormal), theRay.Direct);
+
+ aResult.xyz += aWeight.xyz * (aOpacity.x * aVisibility) * aIntensity *
+ (aDiffuse.xyz * aLdotN + aSpecular.xyz * pow (max (0.f, aRdotV), aSpecular.w));
+ }
+ }
+ }
+
+ if (aOpacity.x != 1.0f)
+ {
+ aWeight *= aOpacity.y;
+ aRefractionIdx = aOpacity.z;
+
+ if (aOpacity.z != 1.0f)
+ {
+ theRay.Direct = Refract (theRay.Direct, aNormal, aOpacity.z, aOpacity.w);
+ }
+ }
+ else
+ {
+ aWeight *= bool(uReflectEnabled) ?
+ texelFetch (uRaytraceMaterialTexture, MATERIAL_REFL (aTriIndex.w)) : vec4 (0.0f);
+
+ vec3 aReflect = reflect (theRay.Direct, aNormal);
+
+ if (dot (aReflect, aHit.Normal) * dot (theRay.Direct, aHit.Normal) > 0.0f)
+ {
+ aReflect = reflect (theRay.Direct, aHit.Normal);
+ }
+
+ theRay.Direct = aReflect;
+ }
+
+ if (all (lessThanEqual (aWeight.xyz, THRESHOLD)))
+ {
+ aDepth = INVALID_BOUNCES;
+ }
+ else if (aOpacity.x == 1.0f || aOpacity.z != 1.0f) // if no simple transparency
+ {
+ theRay.Origin += aHit.Normal * mix (
+ -uSceneEpsilon, uSceneEpsilon, step (0.0f, dot (aHit.Normal, theRay.Direct)));
+
+ theInverse = 1.0f / max (abs (theRay.Direct), SMALL);
+
+ theInverse = mix (-theInverse, theInverse, step (ZERO, theRay.Direct));
+ }
+
+ theRay.Origin += theRay.Direct * uSceneEpsilon;
+ }
+
+ gl_FragDepth = aRaytraceDepth;
+
+ return vec4 (aResult.x,
+ aResult.y,
+ aResult.z,
+ aWeight.w);
+}
+#endif
--- /dev/null
+in vec4 occVertex;
+
+//! Normalized pixel coordinates.
+out vec2 vPixel;
+
+void main (void)
+{
+ vPixel = vec2 ((occVertex.x + 1.f) * 0.5f,
+ (occVertex.y + 1.f) * 0.5f);
+
+ gl_Position = occVertex;
+}
--- /dev/null
+out vec4 OutColor;
+
+// Seed for random number generator (generated on CPU).
+uniform int uFrameRndSeed;
+
+//! Enables/disables using of single RNG seed for 16x16 image
+//! blocks. Increases performance up to 4x, but the noise has
+//! become structured. Can be used fo final rendering.
+uniform int uBlockedRngEnabled;
+
+//! Number of previously rendered frames (used in non-ISS mode).
+uniform int uAccumSamples;
+
+#ifndef ADAPTIVE_SAMPLING
+ //! Input image with previously accumulated samples.
+ uniform sampler2D uAccumTexture;
+#endif
+
+//! Maximum radiance that can be added to the pixel.
+//! Decreases noise level, but introduces some bias.
+uniform float uMaxRadiance;
+
+#ifdef ADAPTIVE_SAMPLING
+//! Wrapper over imageLoad()+imageStore() having similar syntax as imageAtomicAdd().
+//! Modifies one component of 3Wx2H uRenderImage:
+//! |RGL| Red, Green, Luminance
+//! |SBH| Samples, Blue, Hit time transformed into OpenGL NDC space
+//! Returns previous value of the component.
+float addRenderImageComp (in ivec2 theFrag, in ivec2 theComp, in float theVal)
+{
+ ivec2 aCoord = ivec2 (3 * theFrag.x + theComp.x,
+ 2 * theFrag.y + theComp.y);
+#ifdef ADAPTIVE_SAMPLING_ATOMIC
+ return imageAtomicAdd (uRenderImage, aCoord, theVal);
+#else
+ float aVal = imageLoad (uRenderImage, aCoord).x;
+ imageStore (uRenderImage, aCoord, vec4 (aVal + theVal));
+ return aVal;
+#endif
+}
+#endif
+
+// =======================================================================
+// function : main
+// purpose :
+// =======================================================================
+void main (void)
+{
+ SeedRand (uFrameRndSeed, uWinSizeX, uBlockedRngEnabled == 0 ? 1 : 16);
+
+#ifndef PATH_TRACING
+
+ SRay aRay = GenerateRay (vPixel);
+
+#else
+
+ ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
+
+#ifdef ADAPTIVE_SAMPLING
+
+#ifdef ADAPTIVE_SAMPLING_ATOMIC
+ ivec2 aTileXY = imageLoad (uOffsetImage, aFragCoord / uTileSize).xy * uTileSize;
+ if (aTileXY.x < 0) { discard; }
+
+ ivec2 aRealBlockSize = ivec2 (min (uWinSizeX - aTileXY.x, uTileSize.x),
+ min (uWinSizeY - aTileXY.y, uTileSize.y));
+
+ aFragCoord.x = aTileXY.x + (aFragCoord.x % aRealBlockSize.x);
+ aFragCoord.y = aTileXY.y + (aFragCoord.y % aRealBlockSize.y);
+#else
+ int aNbTileSamples = imageAtomicAdd (uTilesImage, aFragCoord / uTileSize, int(-1));
+ if (aNbTileSamples <= 0)
+ {
+ discard;
+ }
+#endif
+
+#endif // ADAPTIVE_SAMPLING
+
+ vec2 aPnt = vec2 (float(aFragCoord.x) + RandFloat(),
+ float(aFragCoord.y) + RandFloat());
+
+ SRay aRay = GenerateRay (aPnt / vec2 (uWinSizeX, uWinSizeY));
+
+#endif // PATH_TRACING
+
+ vec3 aInvDirect = InverseDirection (aRay.Direct);
+
+#ifdef PATH_TRACING
+
+#ifndef ADAPTIVE_SAMPLING
+ vec4 aColor = PathTrace (aRay, aInvDirect, uAccumSamples);
+#else
+ float aNbSamples = addRenderImageComp (aFragCoord, ivec2 (0, 1), 1.0);
+ vec4 aColor = PathTrace (aRay, aInvDirect, int (aNbSamples));
+#endif
+
+ if (any (isnan (aColor.rgb)))
+ {
+ aColor.rgb = ZERO;
+ }
+ aColor.rgb = min (aColor.rgb, vec3 (uMaxRadiance));
+
+#ifdef ADAPTIVE_SAMPLING
+
+ // accumulate RGB color and depth
+ addRenderImageComp (aFragCoord, ivec2 (0, 0), aColor.r);
+ addRenderImageComp (aFragCoord, ivec2 (1, 0), aColor.g);
+ addRenderImageComp (aFragCoord, ivec2 (1, 1), aColor.b);
+ addRenderImageComp (aFragCoord, ivec2 (2, 1), aColor.w);
+ if (int (aNbSamples) % 2 == 0) // accumulate luminance for even samples only
+ {
+ addRenderImageComp (aFragCoord, ivec2 (2, 0), dot (LUMA, aColor.rgb));
+ }
+
+#else
+
+ if (uAccumSamples == 0)
+ {
+ OutColor = aColor;
+ }
+ else
+ {
+ OutColor = mix (texture (uAccumTexture, vPixel), aColor, 1.0 / float(uAccumSamples + 1));
+ }
+
+#endif // ADAPTIVE_SAMPLING
+
+#else
+
+ OutColor = clamp (Radiance (aRay, aInvDirect), 0.f, 1.f);
+
+#endif // PATH_TRACING
+}
--- /dev/null
+//! Input ray-traced image.
+uniform sampler2D uFSAAInputTexture;
+
+//! Number of accumulated FSAA samples.
+uniform int uSamples;
+
+//! Output pixel color.
+out vec4 OutColor;
+
+#define LUM_DIFFERENCE 0.085f
+
+// =======================================================================
+// function : main
+// purpose :
+// =======================================================================
+void main (void)
+{
+#ifndef PATH_TRACING
+
+ int aPixelX = int (gl_FragCoord.x);
+ int aPixelY = int (gl_FragCoord.y);
+
+ // Adjust FLIPTRI pattern used for adaptive FSAA
+ float anOffsetX = mix (uFsaaOffset.x, -uFsaaOffset.x, float (aPixelX % 2));
+ float anOffsetY = mix (uFsaaOffset.y, -uFsaaOffset.y, float (aPixelY % 2));
+
+ vec4 aClr0 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 0), 0);
+ vec4 aClr1 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY - 1), 0);
+ vec4 aClr2 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 1), 0);
+
+ vec4 aClr3 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 0), 0);
+ vec4 aClr4 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY - 1), 0);
+ vec4 aClr5 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 1), 0);
+
+ vec4 aClr6 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 0), 0);
+ vec4 aClr7 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY - 1), 0);
+ vec4 aClr8 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 1), 0);
+
+ float aLum = dot (LUMA, aClr0.xyz);
+
+ bool aRender = abs (aClr1.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr2.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr3.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr4.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr5.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr6.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr7.w - aClr0.w) > LUM_DIFFERENCE ||
+ abs (aClr8.w - aClr0.w) > LUM_DIFFERENCE;
+
+ if (!aRender)
+ {
+ aRender = abs (dot (LUMA, aClr1.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr2.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr3.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr4.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr5.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr6.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr7.xyz) - aLum) > LUM_DIFFERENCE ||
+ abs (dot (LUMA, aClr8.xyz) - aLum) > LUM_DIFFERENCE;
+ }
+
+ vec4 aColor = aClr0;
+
+ if (aRender)
+ {
+ SRay aRay = GenerateRay (vPixel + vec2 (anOffsetX, anOffsetY));
+
+ vec3 aInvDirect = 1.f / max (abs (aRay.Direct), SMALL);
+
+ aInvDirect = vec3 (aRay.Direct.x < 0.f ? -aInvDirect.x : aInvDirect.x,
+ aRay.Direct.y < 0.f ? -aInvDirect.y : aInvDirect.y,
+ aRay.Direct.z < 0.f ? -aInvDirect.z : aInvDirect.z);
+
+ aColor = mix (aClr0, clamp (Radiance (aRay, aInvDirect), 0.0, 1.0), 1.0 / float(uSamples));
+ }
+
+ OutColor = aColor;
+
+#endif
+}
--- /dev/null
+// Constants
+const float M_PI = 3.1415926535;
+const float THE_EARTH_RADIUS = 6360e3;
+const vec3 THE_EARTH_CENTER = vec3 (0.0, -THE_EARTH_RADIUS, 0.0);
+const float THE_ATMO_RADIUS = 6380e3; // atmosphere radius (6420e3?)
+const float THE_G = 0.76; // anisotropy of the medium (papers use 0.76)
+const float THE_G2 = THE_G * THE_G;
+const float THE_HR = 8000.0; // Thickness of the atmosphere
+const float THE_HM = 1000.0; // Same as above but for Mie
+const vec3 THE_BETA_R = vec3 (5.8e-6, 13.5e-6, 33.1e-6); // Reyleigh scattering normal earth
+const vec3 THE_BETA_M = vec3 (21e-6); // Normal Mie scattering
+
+// Parameters
+const float THE_SunAttenuation = 1.0; // sun intensity
+const float THE_EyeHeight = 100.0; // viewer height
+const float THE_HorizonWidth = 0.002;
+const int THE_NbSamples = 8;
+const int THE_NbSamplesLight = 8; // integral sampling rate (might highly hit performance)
+const float THE_SunPower = 5.0;
+const float THE_StarTreshold = 0.98;
+
+// Uniforms
+uniform vec3 uSunDir;
+uniform float uTime;
+uniform float uCloudy;
+uniform float uFog;
+
+float hash13 (in vec3 p3)
+{
+ p3 = fract (p3 * 0.1031);
+ p3 += dot (p3, p3.zyx + 31.32);
+ return fract ((p3.x + p3.y) * p3.z);
+}
+
+float hash12 (in vec2 p)
+{
+ vec3 p3 = fract (vec3(p.xyx) * .1031);
+ p3 += dot (p3, p3.yzx + 33.33);
+ return fract ((p3.x + p3.y) * p3.z);
+}
+
+float smoothStarField (in vec2 theSamplePos)
+{
+ vec2 aFract = fract (theSamplePos);
+ vec2 aFloorSample = floor (theSamplePos);
+ float v1 = hash12 (aFloorSample);
+ float v2 = hash12 (aFloorSample + vec2( 0.0, 1.0 ));
+ float v3 = hash12 (aFloorSample + vec2( 1.0, 0.0 ));
+ float v4 = hash12 (aFloorSample + vec2( 1.0, 1.0 ));
+
+ vec2 u = aFract * aFract * (3.0 - 2.0 * aFract);
+
+ return mix(v1, v2, u.x) +
+ (v3 - v1) * u.y * (1.0 - u.x) +
+ (v4 - v2) * u.x * u.y;
+}
+
+float noisyStarField (in vec2 theSamplePos)
+{
+ float aStarVal = smoothStarField (theSamplePos);
+ if (aStarVal >= THE_StarTreshold)
+ {
+ aStarVal = pow ((aStarVal - THE_StarTreshold) / (1.0 - THE_StarTreshold), 6.0);
+ }
+ else
+ {
+ aStarVal = 0.0;
+ }
+ return aStarVal;
+}
+
+float smoothNoise (in vec3 theCoord)
+{
+ vec3 anInt = floor (theCoord);
+ vec3 anFract = fract (theCoord);
+ anFract = anFract * anFract * (3.0 - (2.0 * anFract));
+ return mix(mix(mix(hash13(anInt ),
+ hash13(anInt + vec3(1.0, 0.0, 0.0)), anFract.x),
+ mix(hash13(anInt + vec3(0.0, 1.0, 0.0)),
+ hash13(anInt + vec3(1.0, 1.0, 0.0)), anFract.x), anFract.y),
+ mix(mix(hash13(anInt + vec3(0.0, 0.0, 1.0)),
+ hash13(anInt + vec3(1.0, 0.0, 1.0)), anFract.x),
+ mix(hash13(anInt + vec3(0.0, 1.0, 1.0)),
+ hash13(anInt + vec3(1.0, 1.0, 1.0)), anFract.x), anFract.y), anFract.z);
+}
+
+float fnoise (in vec3 theCoord, in float theTime)
+{
+ theCoord *= .25;
+ float aNoise;
+
+ aNoise = 0.5000 * smoothNoise (theCoord);
+ theCoord = theCoord * 3.02; theCoord.y -= theTime * 0.2;
+ aNoise += 0.2500 * smoothNoise (theCoord);
+ theCoord = theCoord * 3.03; theCoord.y += theTime * 0.06;
+ aNoise += 0.1250 * smoothNoise (theCoord);
+ theCoord = theCoord * 3.01;
+ aNoise += 0.0625 * smoothNoise (theCoord);
+ theCoord = theCoord * 3.03;
+ aNoise += 0.03125 * smoothNoise (theCoord);
+ theCoord = theCoord * 3.02;
+ aNoise += 0.015625 * smoothNoise (theCoord);
+ return aNoise;
+}
+
+float clouds (in vec3 theTs, in float theTime)
+{
+ float aCloud = fnoise (theTs * 2e-4, theTime) + uCloudy * 0.1;
+ aCloud = smoothstep (0.44, 0.64, aCloud);
+ aCloud *= 70.0;
+ return aCloud + uFog;
+}
+
+void densities (in vec3 thePos, out float theRayleigh, out float theMie, in float theTime)
+{
+ float aHeight = length (thePos - THE_EARTH_CENTER) - THE_EARTH_RADIUS;
+ theRayleigh = exp (-aHeight / THE_HR);
+
+ float aCloud = 0.0;
+ if (aHeight > 5000.0 && aHeight < 8000.0)
+ {
+ aCloud = clouds (thePos + vec3 (0.0, 0.,-theTime*3e3), theTime);
+ aCloud *= sin (M_PI*(aHeight - 5e3) / 5e3) * uCloudy;
+ }
+
+ float aCloud2 = 0.0;
+ if (aHeight > 12e3 && aHeight < 15.5e3)
+ {
+ aCloud2 = fnoise (thePos * 3e-4, theTime) * clouds (thePos * 32.0, theTime);
+ aCloud2 *= sin (M_PI * (aHeight - 12e3) / 12e3) * 0.05;
+ aCloud2 = clamp (aCloud2, 0.0, 1.0);
+ }
+
+ theMie = exp (-aHeight / THE_HM) + aCloud + uFog;
+ theMie += aCloud2;
+}
+
+// ray with sphere intersection problem is reduced to solving the equation
+// (P - C)^2 = r^2 <--- sphere equation
+// where P is P(t) = A + t*B <--- point on ray
+// t^2*dot(B, B) + t*2*dot(B, A-C) + dot(A-C, A-C) - r^2 = 0
+// [ A ] [ B ] [ C ]
+// We just need to solve the above quadratic equation
+float raySphereIntersect (in vec3 theOrig, in vec3 theDir, in float theRadius)
+{
+ theOrig = theOrig - THE_EARTH_CENTER;
+ // A coefficient will be always 1 (theDir is normalized)
+ float B = dot (theOrig, theDir);
+ float C = dot (theOrig, theOrig) - theRadius * theRadius;
+ // optimized version of classic (-b +- sqrt(b^2 - 4ac)) / 2a
+ float aDet2 = B * B - C;
+ if (aDet2 < 0.0) { return -1.0; }
+ float aDet = sqrt (aDet2);
+ float aT1 = -B - aDet;
+ float aT2 = -B + aDet;
+ return aT1 >= 0.0 ? aT1 : aT2;
+}
+
+void scatter (in vec3 theEye, in vec3 theRay, in vec3 theSun,
+ out vec3 theCol, out float theScat, in float theTime)
+{
+ float aRayLen = raySphereIntersect (theEye, theRay, THE_ATMO_RADIUS);
+ float aMu = dot (theRay, theSun);
+ float aMu2 = 1.0 + aMu*aMu;
+ // The Raleigh phase function looks like this:
+ float aPhaseR = 3.0/(16.0 * M_PI) * aMu2;
+ // And the Mie phase function equation is:
+ float aPhaseM = (3.0 / (8.0 * M_PI) * (1.0 - THE_G2) * aMu2)
+ / ((2.0 + THE_G2) * pow (1.0 + THE_G2 - 2.0 * THE_G * aMu, 1.5));
+
+ float anOpticalDepthR = 0.0;
+ float anOpticalDepthM = 0.0;
+ vec3 aSumR = vec3 (0.0);
+ vec3 aSumM = vec3 (0.0); // Mie and Rayleigh contribution
+
+ float dl = aRayLen / float (THE_NbSamples);
+ for (int i = 0; i < THE_NbSamples; ++i)
+ {
+ float l = float(i) * dl;
+ vec3 aSamplePos = theEye + theRay * l;
+
+ float dR, dM;
+ densities (aSamplePos, dR, dM, theTime);
+ dR *= dl;
+ dM *= dl;
+ anOpticalDepthR += dR;
+ anOpticalDepthM += dM;
+
+ float aSegmentLengthLight = raySphereIntersect (aSamplePos, theSun, THE_ATMO_RADIUS);
+ if (aSegmentLengthLight > 0.0)
+ {
+ float dls = aSegmentLengthLight / float (THE_NbSamplesLight);
+ float anOpticalDepthRs = 0.0;
+ float anOpticalDepthMs = 0.0;
+ for (int j = 0; j < THE_NbSamplesLight; ++j)
+ {
+ float ls = float (j) * dls;
+ vec3 aSamplePosS = aSamplePos + theSun * ls;
+ float dRs, dMs;
+ densities (aSamplePosS, dRs, dMs, theTime);
+ anOpticalDepthRs += dRs * dls;
+ anOpticalDepthMs += dMs * dls;
+ }
+
+ vec3 anAttenuation = exp (-(THE_BETA_R * (anOpticalDepthR + anOpticalDepthRs)
+ + THE_BETA_M * (anOpticalDepthM + anOpticalDepthMs)));
+ aSumR += anAttenuation * dR;
+ aSumM += anAttenuation * dM;
+ }
+ }
+
+ theCol = THE_SunPower * (aSumR * THE_BETA_R * aPhaseR + aSumM * THE_BETA_M * aPhaseM);
+ theScat = 1.0 - clamp (anOpticalDepthM*1e-5, 0.0, 1.0);
+}
+
+// This is where all the magic happens. We first raymarch along the primary ray
+// (from the camera origin to the point where the ray exits the atmosphere).
+// For each sample along the primary ray,
+// we then "cast" a light ray and raymarch along that ray as well.
+// We basically shoot a ray in the direction of the sun.
+vec4 computeIncidentLight (in vec3 theRayDirection, in vec2 theUv, in float theTime)
+{
+ float aSunAttenuation = THE_SunAttenuation;
+ vec3 aSunDir = uSunDir;
+ // conversion to moon
+ float aStarAttenuation = 0.0;
+ if (aSunDir.y < 0.0)
+ {
+ aSunDir *= -1.0;
+ aSunAttenuation = aSunAttenuation * 0.1;
+ aStarAttenuation = sqrt (aSunDir.y);
+ }
+
+ vec3 anEyePosition = vec3(0.0, THE_EyeHeight, 0.0);
+
+ // draw a water surface horizontally symmetrically to the sky
+ if (theRayDirection.y <= -THE_HorizonWidth / 2.0)
+ {
+ theRayDirection.y = -THE_HorizonWidth - theRayDirection.y;
+ }
+
+ float aScattering = 0.0;
+ vec3 aColor = vec3 (0.0);
+
+ scatter (anEyePosition, theRayDirection, aSunDir, aColor, aScattering, theTime);
+ aColor *= aSunAttenuation;
+ float aStarIntensity = noisyStarField (theUv * 2048.0);
+ vec3 aStarColor = vec3 (aScattering * aStarIntensity * aStarAttenuation);
+ aColor += aStarColor;
+
+ return vec4 (1.18 * pow (aColor, vec3(0.7)), 1.0);
+}
+
+uniform int uSide;
+
+void main()
+{
+ vec2 anUv = vec2 (2.0 * TexCoord.x - 1.0,
+ 2.0 * TexCoord.y - 1.0);
+ vec3 aPlanes[6];
+ aPlanes[0] = vec3 (+1.0, 0.0, 0.0);
+ aPlanes[1] = vec3 (-1.0, 0.0, 0.0);
+ aPlanes[2] = vec3 ( 0.0,+1.0, 0.0);
+ aPlanes[3] = vec3 ( 0.0,-1.0, 0.0);
+ aPlanes[4] = vec3 ( 0.0, 0.0,+1.0);
+ aPlanes[5] = vec3 ( 0.0, 0.0,-1.0);
+ vec3 aRayDirection;
+ if (uSide == 0)
+ {
+ // Positive X side
+ aRayDirection = aPlanes[0] + vec3 (0.0, +anUv.y, -anUv.x);
+ }
+ else if (uSide == 1)
+ {
+ // Negative X side
+ aRayDirection = aPlanes[1] + vec3 (0.0, +anUv.y, +anUv.x);
+ }
+ else if (uSide == 2)
+ {
+ // Positive Y side
+ aRayDirection = aPlanes[2] + vec3 (+anUv.x, 0.0, +anUv.y);
+ }
+ else if (uSide == 3)
+ {
+ // Negative Y side
+ aRayDirection = aPlanes[3] + vec3 (+anUv.x, 0.0, -anUv.y);
+ }
+ else if (uSide == 4)
+ {
+ // Positive Z side
+ aRayDirection = aPlanes[4] + vec3 (+anUv.x, +anUv.y, 0.0);
+ }
+ else if (uSide == 5)
+ {
+ // Negative Z side
+ aRayDirection = aPlanes[5] + vec3 (-anUv.x, +anUv.y, 0.0);
+ }
+
+ occFragColor = computeIncidentLight (normalize (aRayDirection), anUv, uTime);
+}
--- /dev/null
+//! Calculates transformation from tangent space and apply it to value from normal map to get normal in object space
+vec3 TangentSpaceNormal (in mat2 theDeltaUVMatrix,
+ in mat2x3 theDeltaVectorMatrix,
+ in vec3 theNormalMapValue,
+ in vec3 theNormal,
+ in bool theIsInverse)
+{
+ theNormalMapValue = normalize(theNormalMapValue * 2.0 - vec3(1.0));
+ // Inverse matrix
+ theDeltaUVMatrix = mat2 (theDeltaUVMatrix[1][1], -theDeltaUVMatrix[0][1], -theDeltaUVMatrix[1][0], theDeltaUVMatrix[0][0]);
+ theDeltaVectorMatrix = theDeltaVectorMatrix * theDeltaUVMatrix;
+ // Gram-Schmidt orthogonalization
+ theDeltaVectorMatrix[1] = normalize(theDeltaVectorMatrix[1] - dot(theNormal, theDeltaVectorMatrix[1]) * theNormal);
+ theDeltaVectorMatrix[0] = cross(theDeltaVectorMatrix[1], theNormal);
+ float aDirection = theIsInverse ? -1.0 : 1.0;
+ return mat3 (aDirection * theDeltaVectorMatrix[0], aDirection * theDeltaVectorMatrix[1], theNormal) * theNormalMapValue;
+}
--- /dev/null
+appresource:::Standard
+appresource:::StandardLite
+appresource:::TObj
+appresource:::XCAF
+appresource:::MigrationSheet.txt
+loginfile:::Plugin
--- /dev/null
+TDataStd_Shape TDataXtd_Shape
+TDataStd_Constraint TDataXtd_Constraint
+TDataStd_Geometry TDataXtd_Geometry
+TDataStd_Axis TDataXtd_Axis
+TDataStd_Point TDataXtd_Point
+TDataStd_Plane TDataXtd_Plane
+TDataStd_Position TDataXtd_Position
+TDataStd_Placement TDataXtd_Placement
+TDataStd_PatternStd TDataXtd_PatternStd
+TPrsStd_AISPresentation TDataXtd_Presentation
+PDataStd_Shape PDataXtd_Shape
+PDataStd_Constraint PDataXtd_Constraint
+PDataStd_Geometry PDataXtd_Geometry
+PDataStd_Axis PDataXtd_Axis
+PDataStd_Point PDataXtd_Point
+PDataStd_Plane PDataXtd_Plane
+PDataStd_Position PDataXtd_Position
+PDataStd_Placement PDataXtd_Placement
+PDataStd_PatternStd PDataXtd_PatternStd
+
+
--- /dev/null
+! Description of available plugins
+! ********************************
+!
+! standard attribute drivers plugin
+!
+ad696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStd
+!
+! standard attribute drivers plugin
+!
+bd696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdL
+!
+! XmlOcaf Document Plugin
+!
+03a56820-8269-11d5-aab2-0050044b1af1.Location: TKXml
+03a56822-8269-11d5-aab2-0050044b1af1.Location: TKXml
+03a56824-8269-11d5-aab2-0050044b1af1.Location: TKXml
+!
+! XmlLOcaf Document Plugin
+!
+13a56820-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
+13a56822-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
+13a56824-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
+!
+! BinOcaf Document Plugin
+!
+03a56835-8269-11d5-aab2-0050044b1af1.Location: TKBin
+03a56836-8269-11d5-aab2-0050044b1af1.Location: TKBin
+!
+! BinLOcaf Document Plugin
+!
+13a56835-8269-11d5-aab2-0050044b1af1.Location: TKBinL
+13a56836-8269-11d5-aab2-0050044b1af1.Location: TKBinL
+!
+! XmlXCAF Document Plugin
+!
+f78ff496-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
+f78ff497-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
+!
+! BinXCAF Document Plugin
+!
+a78ff496-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF
+a78ff497-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF
+!
+! TObjXml Document Plugin
+!
+f78ff4a0-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj
+f78ff4a1-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj
+!
+! TObjBin Document Plugin
+!
+f78ff4a2-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj
+f78ff4a3-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj
--- /dev/null
+formatlist:MDTV-Standard|XmlOcaf|BinOcaf
+!
+! Default format
+xml.FileFormat: XmlOcaf
+cbf.FileFormat: BinOcaf
+!
+! standard attributes
+!
+MDTV-Standard.Description: Standard Document Version 1.0
+MDTV-Standard.FileExtension: std
+MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
+!
+! XmlOcaf format
+!
+XmlOcaf.Description: Xml Document Version 1.0
+XmlOcaf.FileExtension: xml
+XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1
+XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1
+!
+! BinOcaf format
+!
+BinOcaf.Description: Bin Ocaf Document Version 1.0
+BinOcaf.FileExtension: cbf
+BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1
+BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1
--- /dev/null
+formatlist:OCC-StdLite|BinLOcaf|XmlLOcaf
+!
+!
+! Lite attributes
+!
+OCC-StdLite.Description: Lite Document Version 1.0
+OCC-StdLite.FileExtension: stdl
+OCC-StdLite.RetrievalPlugin: bd696001-5b34-11d1-b5ba-00a0c9064368
+!
+! BinLOcaf format
+!
+BinLOcaf.Description: Lite Bin Ocaf Document Version 1.0
+BinLOcaf.FileExtension: cbfl
+BinLOcaf.StoragePlugin: 13a56835-8269-11d5-aab2-0050044b1af1
+BinLOcaf.RetrievalPlugin: 13a56836-8269-11d5-aab2-0050044b1af1
+!
+! XmlLOcaf format
+!
+XmlLOcaf.Description: Lite Xml Document Version 1.0
+XmlLOcaf.FileExtension: xmll
+XmlLOcaf.StoragePlugin: 13a56820-8269-11d5-aab2-0050044b1af1
+XmlLOcaf.RetrievalPlugin: 13a56822-8269-11d5-aab2-0050044b1af1
--- /dev/null
+formatlist: TObjXml|TObjBin
+!
+! Default format
+xml.FileFormat: TObjXml
+cbf.FileFormat: TObjBin
+!
+! TObjXml format
+TObjXml.Description: TObj XML Document Version 1.0
+TObjXml.FileExtension: xml
+TObjXml.StoragePlugin: f78ff4a0-a779-11d5-aab4-0050044b1af1
+TObjXml.RetrievalPlugin: f78ff4a1-a779-11d5-aab4-0050044b1af1
+!
+! TObjBin format
+TObjBin.Description: TObj BIN Document Version 1.0
+TObjBin.FileExtension: cbf
+TObjBin.StoragePlugin: f78ff4a2-a779-11d5-aab4-0050044b1af1
+TObjBin.RetrievalPlugin: f78ff4a3-a779-11d5-aab4-0050044b1af1
--- /dev/null
+formatlist: MDTV-XCAF XmlXCAF BinXCAF MDTV-Standard XmlOcaf BinOcaf
+!
+! Default format
+xml.FileFormat: XmlXCAF
+!
+! XCAF attributes
+!
+MDTV-XCAF.Description: XCAF Document Version 1.0
+MDTV-XCAF.FileExtension: dxc
+MDTV-XCAF.StoragePlugin: ed8793f8-3142-11d4-b9b5-0060b0ee281b
+MDTV-XCAF.RetrievalPlugin: ed8793f9-3142-11d4-b9b5-0060b0ee281b
+MDTV-XCAFSchema: ed8793fa-3142-11d4-b9b5-0060b0ee281b
+!
+! XmlXCAF format
+!
+XmlXCAF.Description: XmlXCAF Document Version 1.0
+XmlXCAF.FileExtension: xml
+XmlXCAF.StoragePlugin: f78ff496-a779-11d5-aab4-0050044b1af1
+XmlXCAF.RetrievalPlugin: f78ff497-a779-11d5-aab4-0050044b1af1
+!
+! BinXCAF format
+!
+BinXCAF.Description: BinXCAF Document Version 1.0
+BinXCAF.FileExtension: xbf
+BinXCAF.StoragePlugin: a78ff496-a779-11d5-aab4-0050044b1af1
+BinXCAF.RetrievalPlugin: a78ff497-a779-11d5-aab4-0050044b1af1
+!
+! standard attributes
+!
+MDTV-Standard.Description: Standard Document Version 1.0
+MDTV-Standard.FileExtension: std
+MDTV-Standard.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
+MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
+MDTV-StandardSchema: ad696002-5b34-11d1-b5ba-00a0c9064368
+MDTV-Standard.AttributeStoragePlugin: 47b0b826-d931-11d1-b5da-00a0c9064368
+MDTV-Standard.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c9064368
+!
+! XmlOcaf format
+!
+XmlOcaf.Description: Xml Document Version 1.0
+XmlOcaf.FileExtension: xml
+XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1
+XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1
+!
+! BinOcaf format
+!
+BinOcaf.Description: Bin Ocaf Document Version 1.0
+BinOcaf.FileExtension: cbf
+BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1
+BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1
--- /dev/null
+!!!!!!!!!! ----- Messages file for TObj packages --------- !!!!!!!!!
+! Syntax for keywords: NameOfPackage_NameOfClass_NameOfMessage
+! where NameOfClass is optional or abbreviated
+!!!!!!!!!! --------------------------------------------------- !!!!!!!!!
+
+.TObj_Appl_SDriverFailure
+ Error saving document %s : driver failure. Check presence of resource files.
+
+.TObj_Appl_SWriteFailure
+ Error saving document %s : write failure
+
+.TObj_Appl_SFailure
+ Error saving document %s : general failure of persistence driver
+
+.TObj_Appl_SDocIsNull
+ Error saving document %s : No document to save
+
+.TObj_Appl_SNoObj
+ Error saving document %s : No objects written
+
+.TObj_Appl_SInfoSectionError
+ Error saving document %s : Write info section failure
+
+.TObj_Appl_SUnknownFailure
+ Error saving document %s : unknown failure
+
+.TObj_Appl_RUnknownDocument
+ Error loading document %s : unknown document
+
+.TObj_Appl_RAlreadyRetrieved
+ Error loading document %s : already retrieved
+
+.TObj_Appl_RAlreadyRetrievedAndModified
+ Error loading document %s : already retrieved and modified
+
+.TObj_Appl_RNoDriver
+ Error loading document %s : no appropriate driver was found
+
+.TObj_Appl_ROpenError
+ Error loading document %s : cannot open file
+
+.TObj_Appl_RNoVersion
+ Error loading document %s : no version
+
+.TObj_Appl_RNoModel
+ Error loading document %s : no model
+
+.TObj_Appl_RNoDocument
+ Error loading document %s : no document
+
+.TObj_Appl_RFormatFailure
+ Error loading document %s : format failure
+
+.TObj_Appl_RTypeNotFound
+ Error loading document %s : type not found in schema
+
+.TObj_Appl_RBadFileFormat
+ Error loading document %s : unrecognized file format
+
+.TObj_Appl_RMakeFailure
+ Error loading document %s : failure making document
+
+.TObj_Appl_RPermissionDenied
+ Error loading document %s : permission denied
+
+.TObj_Appl_RDriverFailure
+ Error loading document %s : driver failure
+
+.TObj_Appl_RUnknownFail
+ Error loading document %s : unknown failure
+
+.TObj_Appl_RException
+ Error loading document %s : the file is probably corrupted
+
+.TObj_Appl_Exception
+ An exception was caught: %s
+
+.TObj_M_LoadDocument
+ +++++ Load document %s
+
+.TObj_M_WrongFile
+ File %s has wrong content
+
+.TObj_M_NoWriteAccess
+ Cannot write the file %s, check permissions
--- /dev/null
+icon:::1d_elevation.rgb
+icon:::2d_alienskin.rgb
+icon:::2d_aluminum.rgb
+icon:::2d_blue_rock.rgb
+icon:::2d_bluewhite_paper.rgb
+icon:::2d_brushed.rgb
+icon:::2d_bubbles.rgb
+icon:::2d_bumps.rgb
+icon:::2d_cast.rgb
+icon:::2d_chipbd.rgb
+icon:::2d_clouds.rgb
+icon:::2d_flesh.rgb
+icon:::2d_floor.rgb
+icon:::2d_galvnisd.rgb
+icon:::2d_grass.rgb
+icon:::2d_knurl.rgb
+icon:::2d_maple.rgb
+icon:::2d_marble.rgb
+icon:::2d_MatraDatavision.rgb
+icon:::2d_mottled.rgb
+icon:::2d_rain.rgb
+icon:::2d_rock.rgb
+icon:::2d_chess.rgba
+icon:::env_clouds.rgb
+icon:::env_cv.rgb
+icon:::env_lines.rgb
+icon:::env_medit.rgb
+icon:::env_pearl.rgb
+icon:::env_road.rgb
+icon:::env_sky1.rgb
+icon:::env_sky2.rgb
--- /dev/null
+MASS: kg
+LENGTH: m
+TIME: s
+ELECTRIC CURRENT: A
+THERMODYNAMIC TEMPERATURE: °K
+AMOUNT OF SUBSTANCE: mol
+PLANE ANGLE: rad
+SOLID ANGLE: sr
+AREA: m²
+VOLUME: m³
+INERTIA: m**4
+ANGULAR SPEED: rad/s
+SPEED: m/s
+ACCELERATION: m/s²
+FREQUENCY: Hz
+VOLUMIC MASS: kg/m³
+MASS FLOW: kg/s
+VOLUME FLOW: m³/s
+CONSUMPTION: m²
+QUANTITY OF MOVEMENT: kg*m/s
+KINETIC MOMENT: kg*m²/s
+MOMENT OF INERTIA: kg*m²
+FORCE: N
+MOMENT OF A FORCE: N*m
+LINEIC FORCE: N/m
+PRESSURE: Pa
+DYNAMIC VISCOSITY: Pa/s
+KINETIC VISCOSITY: m²/s
+TENSION SUPERFICIELLE: m/s²
+ELECTRIC POTENTIAL: V
+ENERGY: J
+POWER: W
+LINEIC POWER: W/m
+SURFACIC POWER: W/m²
+VOLUMIC POWER: W/m³
+COEFFICIENT OF LINEAR INFLATION: 1./°K
+THERMICAL CONDUCTIVITY: W/m/°K
+THERMICAL CONVECTIVITY: W/m²/°K
+THERMICAL MASSIC CAPACITY: J/kg/°K
+ENTROPY: J/°K
+ENTHALPY: J
+LUMINOUS FLUX: Lu
+LUMINANCE: cd/m²
+EXITANCE: lx
+LUMINOUS INTENSITY: cd
+LUMINOUS EXPOSITION: lx*s
+LUMINOUS EFFICACITY: Lu/W
+LUMINOUS FLUX: Lu
+ILLUMINANCE: lx
+ELECTRIC CHARGE: C
+ELECTRIC FIELD: V/m
+ELECTRIC CAPACITANCE: F
+MAGNETIC FIELD: A/m
+MAGNETIC FLUX DENSITY: T
+MAGNETIC FLUX: Wb
+INDUCTANCE: H
+RELUCTANCE: 1./H
+ELECTRIC RESISTANCE: O
+ELECTRIC CONDUCTANCE: S
+RESISTIVITY: O*m
+CONDUCTIVITY: S/m
+MOLAR MASS: kg/mol
+MOLAR VOLUME: m³/mol
+CONCENTRATION: kg/m³
+MOLAR CONCENTRATION: mol/m³
+MOLARITY: mol/kg
+ACCOUSTIC INTENSITY: B
+DOSE EQUIVALENT: Si
+ABSORBED DOSE: Gr
+ACTIVITY (OF A RADIONUCLEIDE): Be
+FLUX OF MAGNETIC INDUCTION: kg*m²/s²/A
+ROTATION ACCELERATION: rad/s²
+TRANSLATION STIFFNESS: N/m
+ROTATION STIFFNESS: N*m/rad
--- /dev/null
+CurrentUnits
+MDTVBaseUnits
+MDTVCurrentUnits
+Units.dat
--- /dev/null
+MASS: kg
+LENGTH: mm
+TIME: s
+ELECTRIC CURRENT: A
+THERMODYNAMIC TEMPERATURE: °K
+AMOUNT OF SUBSTANCE: mol
+PLANE ANGLE: rad
+SOLID ANGLE: sr
+AREA: mm²
+VOLUME: mm³
+INERTIA: mm**4
+ANGULAR SPEED: rad/s
+SPEED: mm/s
+ACCELERATION: mm/s²
+FREQUENCY: Hz
+VOLUMIC MASS: kg/mm³
+MASS FLOW: kg/s
+VOLUME FLOW: mm³/s
+CONSUMPTION: mm²
+QUANTITY OF MOVEMENT: kg*mm/s
+KINETIC MOMENT: kg*mm²/s
+MOMENT OF INERTIA: kg*mm²
+FORCE: kg*mm/s²
+MOMENT OF A FORCE: kg*mm²/s²
+PRESSURE: kg/(mm*s²)
+DYNAMIC VISCOSITY: kg/(mm*s)
+KINETIC VISCOSITY: mm²/s
+TENSION SUPERFICIELLE: mm/s²
+ELECTRIC POTENTIAL: V
+ENERGY: kg*mm²/s²
+POWER: kg*mm²/s³
+LINEIC POWER: kg*mm/s³
+SURFACIC POWER: kg/s³
+VOLUMIC POWER: kg/(mm*s³)
+COEFFICIENT OF LINEAR INFLATION: 1./°K
+THERMICAL CONDUCTIVITY: kg*mm/(s³*°K)
+THERMICAL CONVECTIVITY: kg/(s³*°K)
+THERMICAL MASSIC CAPACITY: mm²/(s²*°K)
+ENTROPY: kg*mm²/(s²*°K)
+ENTHALPY: kg*mm²/s²
+LUMINOUS FLUX: Lu
+LUMINANCE: cd/mm²
+EXITANCE: lx
+LUMINOUS INTENSITY: cd
+LUMINOUS EXPOSITION: lx*s
+LUMINOUS EFFICACITY: s³*Lu/(kg*mm²)
+LUMINOUS FLUX: Lu
+ILLUMINANCE: lx
+ELECTRIC CHARGE: C
+ELECTRIC FIELD: V/mm
+ELECTRIC CAPACITANCE: s**4*A²/(kg*mm²)
+MAGNETIC FIELD: A/mm
+MAGNETIC FLUX DENSITY: T
+MAGNETIC FLUX: kg*mm²/(s²*A)
+INDUCTANCE: kg*mm²/(s²*A²)
+RELUCTANCE: s²*A²/(kg*mm²)
+ELECTRIC RESISTANCE: O
+ELECTRIC CONDUCTANCE: S
+RESISTIVITY: O*mm
+CONDUCTIVITY: S/mm
+MOLAR MASS: kg/mol
+MOLAR VOLUME: mm³/mol
+CONCENTRATION: kg/mm³
+MOLAR CONCENTRATION: mol/mm³
+MOLARITY: mol/kg
+ACCOUSTIC INTENSITY: mm/A²
+DOSE EQUIVALENT: mm²/s²
+ABSORBED DOSE: mm²/s²
+ACTIVITY (OF A RADIONUCLEIDE): Be
+FLUX OF MAGNETIC INDUCTION: kg*mm\062/(s\062*A)
--- /dev/null
+MASS: kg
+LENGTH: mm
+TIME: s
+ELECTRIC CURRENT: A
+THERMODYNAMIC TEMPERATURE: °K
+AMOUNT OF SUBSTANCE: mol
+PLANE ANGLE: rad
+SOLID ANGLE: sr
+AREA: mm²
+VOLUME: mm³
+INERTIA: mm**4
+ANGULAR SPEED: rad/s
+SPEED: mm/s
+ACCELERATION: mm/s²
+FREQUENCY: Hz
+VOLUMIC MASS: kg/mm³
+MASS FLOW: kg/s
+VOLUME FLOW: mm³/s
+CONSUMPTION: mm²
+QUANTITY OF MOVEMENT: kg*mm/s
+KINETIC MOMENT: kg*mm²/s
+MOMENT OF INERTIA: kg*mm²
+FORCE: kg*mm/s²
+MOMENT OF A FORCE: kg*mm²/s²
+LINEIC FORCE: kg/s²
+PRESSURE: kg/(mm*s²)
+DYNAMIC VISCOSITY: kg/(mm*s)
+KINETIC VISCOSITY: mm²/s
+TENSION SUPERFICIELLE: mm/s²
+ELECTRIC POTENTIAL: V
+ENERGY: kg*mm²/s²
+POWER: kg*mm²/s³
+LINEIC POWER: kg*mm/s³
+SURFACIC POWER: kg/s³
+VOLUMIC POWER: kg/(mm*s³)
+COEFFICIENT OF LINEAR INFLATION: 1./°K
+THERMICAL CONDUCTIVITY: kg*mm/(s³*°K)
+THERMICAL CONVECTIVITY: kg/(s³*°K)
+THERMICAL MASSIC CAPACITY: mm²/(s²*°K)
+ENTROPY: kg*mm²/(s²*°K)
+ENTHALPY: kg*mm²/s²
+LUMINOUS FLUX: Lu
+LUMINANCE: cd/mm²
+EXITANCE: lx
+LUMINOUS INTENSITY: cd
+LUMINOUS EXPOSITION: lx*s
+LUMINOUS EFFICACITY: s³*Lu/(kg*mm²)
+LUMINOUS FLUX: Lu
+ILLUMINANCE: lx
+ELECTRIC CHARGE: C
+ELECTRIC FIELD: V/mm
+ELECTRIC CAPACITANCE: s**4*A²/(kg*mm²)
+MAGNETIC FIELD: A/mm
+MAGNETIC FLUX DENSITY: T
+MAGNETIC FLUX: kg*mm²/(s²*A)
+INDUCTANCE: kg*mm²/(s²*A²)
+RELUCTANCE: s²*A²/(kg*mm²)
+ELECTRIC RESISTANCE: O
+ELECTRIC CONDUCTANCE: S
+RESISTIVITY: O*mm
+CONDUCTIVITY: S/mm
+MOLAR MASS: kg/mol
+MOLAR VOLUME: mm³/mol
+CONCENTRATION: kg/mm³
+MOLAR CONCENTRATION: mol/mm³
+MOLARITY: mol/kg
+ACCOUSTIC INTENSITY: mm/A²
+DOSE EQUIVALENT: mm²/s²
+ABSORBED DOSE: mm²/s²
+ACTIVITY (OF A RADIONUCLEIDE): Be
+FLUX OF MAGNETIC INDUCTION: kg*mm²/(s²*A)
+ROTATION ACCELERATION: rad/s²
+TRANSLATION STIFFNESS: kg/s²
+ROTATION STIFFNESS: kg*mm²/(s²*rad)
--- /dev/null
+....................................................................................................................................
+ M L T I K N J P S
+DIMENSIONLESS 0 0 0 0 0 0 0 0 0
+....................................................................................................................................
+no unit K 1.
+percent % 0.01 K
+
+....................................................................................................................................
+ M L T I K N J P S
+MASS 1 0 0 0 0 0 0 0 0
+....................................................................................................................................
+gram g .001
+metric carat ct .2 g
+quintal q 100 kg
+tonne t 1000 kg
+
+grain gr .06479891 g
+apothecaries'dram (U.S.) dram_ap 3.88793E-03 kg
+apothecaries'ounce oz_apoth(U.K.) 3.11035E-02 kg
+ oz_ap(U.S.)
+ounce oz 437.5 gr
+pound lb 16 oz
+cental cental 100 lb
+short hundredweight sh.cwt 100 lb
+hundredweight cwt 112 lb
+short ton sh.ton 2000 lb
+ton ton 2240 lb
+....................................................................................................................................
+ M L T I K N J P S
+LENGTH 0 1 0 0 0 0 0 0 0
+....................................................................................................................................
+meter m
+angstrom \xC5 1.E-10 m
+ angstrom
+brasse brasse 1.8288 m
+arpent (Quebec) arpent_longueur 58.47131 m
+micron \xB5 10000 \xC5
+ micron
+
+mille mille 1852 m
+light year Al 9.46053E+15 m
+
+inch in. 0.0254 m
+ in
+caliber caliber 1 in.
+foot ft. 12 in
+ ft
+
+yard yd. 3 ft.
+ yd
+
+statute mile stat.mile 1760 yd.
+nautical mile naut.mile 1852 m
+....................................................................................................................................
+ M L T I K N J P S
+TIME 0 0 1 0 0 0 0 0 0
+....................................................................................................................................
+second of time s
+minute of time min 60 s
+ mn
+
+hour h 60 min
+day j 24 h
+year y 365.25 j
+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*\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 \260K
+ deg.K
+
+Celsius degree of temperature \260C [273.15] \260K
+ deg.C
+
+Rankine degree of temperature \260R (5/9) \260K
+ deg.R
+
+Fahrenheit degree of temperature \260F [(1379/3)] \260R
+ deg.F
+....................................................................................................................................
+ M L T I K N J P S
+AMOUNT OF SUBSTANCE 0 0 0 0 0 1 0 0 0
+....................................................................................................................................
+mole mol
+....................................................................................................................................
+ M L T I K N J P S
+LUMINOUS INTENSITY 0 0 0 0 0 0 1 0 0
+....................................................................................................................................
+candela cd
+bougie nouvelle bougie_nouvelle 1 cd
+....................................................................................................................................
+ M L T I K N J P S
+PLANE ANGLE 0 0 0 0 0 0 0 1 0
+....................................................................................................................................
+radian rad
+second of angle "
+minute of angle ' 60 "
+
+degre of angle \xB0 60 '
+ deg
+
+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*\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\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\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\xB3
+baril (U.S.) baril(U.S.) 42 gal(U.S.)
+barrel (U.S.) barrel(U.S.) .158987 m\xB3
+
+dry barrel (U.S.) bbl .115627 m\xB3
+
+pint (U.K.) pt. 34.67636 cu.in.
+ 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\xB3
+baril (U.K.) baril(U.K.) 36 gal(U.K.)
+
+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
+....................................................................................................................................
+ M L T I K N J P S
+INERTIA 0 4 0 0 0 0 0 0 0
+....................................................................................................................................
+
+
+....................................................................................................................................
+ M L T I K N J P S
+ANGULAR SPEED 0 0 -1 0 0 0 0 1 0
+....................................................................................................................................
+revolution per minute r.p.m. 1 tr/min
+....................................................................................................................................
+ M L T I K N J P S
+SPEED 0 1 -1 0 0 0 0 0 0
+....................................................................................................................................
+knot(U.K.) kn 1 naut.mile/h
+mile per hour m.p.h. 1 stat.mile/h
+noeud noeud 1 mille/h
+....................................................................................................................................
+ M L T I K N J P S
+ACCELERATION 0 1 -2 0 0 0 0 0 0
+....................................................................................................................................
+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
+....................................................................................................................................
+hertz Hz
+baud baud 1 Hz
+....................................................................................................................................
+ M L T I K N J P S
+ACTIVITY (OF A RADIONUCLEIDE) 0 0 -1 0 0 0 0 0 0
+....................................................................................................................................
+becquerel Be
+....................................................................................................................................
+ M L T I K N J P S
+VOLUMIC MASS 1 -3 0 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MASS FLOW 1 0 -1 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+VOLUME FLOW 0 3 -1 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+CONSUMPTION 0 2 0 0 0 0 0 0 0
+....................................................................................................................................
+litre aux 100 kilometers l/100km
+mile per gallon (U.S.) m.p.g.(U.S.) 235.2 l/100km
+mile per gallon (U.K.) m.p.g.(U.K.) 282.5 l/100km
+....................................................................................................................................
+ M L T I K N J P S
+QUANTITY OF MOVEMENT 1 1 -1 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+KINETIC MOMENT 1 2 -1 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MOMENT OF INERTIA 1 2 0 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+FORCE 1 1 -2 0 0 0 0 0 0
+....................................................................................................................................
+newton N
+dyne dyn 1.E-05 N
+gram-force gf .00980665 N
+poundal pdl 0.138255 N
+pound-force lbf 4.44822 N
+sthene sn 1000 N
+....................................................................................................................................
+ M L T I K N J P S
+MOMENT OF A FORCE 1 2 -2 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+LINEIC FORCE 1 0 -2 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+PRESSURE 1 -1 -2 0 0 0 0 0 0
+....................................................................................................................................
+pascal Pa
+athmosphere atm 101325 Pa
+athmosphere technique at 98066.5 Pa
+bar bar 100000 Pa
+barye barye 0.1 Pa
+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\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 g/cm/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\xB2/s
+....................................................................................................................................
+ M L T I K N J P S
+TENSION SUPERFICIELLE 1 0 -2 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC POTENTIAL 1 2 -3 -1 0 0 0 0 0
+....................................................................................................................................
+volt V
+....................................................................................................................................
+ M L T I K N J P S
+ENERGY 1 2 -2 0 0 0 0 0 0
+....................................................................................................................................
+joule J
+electron-volt eV 1.59E-19 J
+erg erg 1.E-07 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
+
+horse-power-hour HP-h 2684500 J
+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 (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
+....................................................................................................................................
+watt W
+cheval-vapeur ch 735.5 W
+poncelet poncelet 100 kgfm/s
+var var 1 V.A
+
+horse-power HP 1.025 ch
+ton of refrigeration ton_of_ref. 3516 W
+british commercial ton of refrigeration brit.comm.ton_of_ref. 3883 W
+....................................................................................................................................
+ M L T I K N J P S
+LINEIC POWER 1 1 -3 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+SURFACIC POWER 1 0 -3 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+VOLUMIC POWER 1 -1 -3 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+COEFFICIENT OF LINEAR INFLATION 0 0 0 0 -1 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+THERMICAL CONDUCTIVITY 1 1 -3 0 -1 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+THERMICAL CONVECTIVITY 1 0 -3 0 -1 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+THERMICAL MASSIC CAPACITY 0 2 -2 0 -1 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ENTROPY 1 2 -2 0 -1 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ENTHALPY 1 2 -2 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+LUMINOUS FLUX 0 0 0 0 0 0 1 0 1
+....................................................................................................................................
+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\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
+....................................................................................................................................
+lux lx
+phot ph 1.E+04 lx
+....................................................................................................................................
+ M L T I K N J P S
+LUMINOUS EXPOSITION 0 -2 1 0 0 0 1 0 1
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+LUMINOUS EFFICACITY -1 -2 3 0 0 0 1 0 1
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC CHARGE 0 0 1 1 0 0 0 0 0
+....................................................................................................................................
+coulomb C
+ampere-hour Ah 3.6E+03 C
+franklin Fr 333.563E-12 C
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC FIELD 1 1 -3 -1 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC CAPACITANCE -1 -2 4 2 0 0 0 0 0
+....................................................................................................................................
+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*\xB6) A/m
+....................................................................................................................................
+ M L T I K N J P S
+MAGNETIC FLUX 1 2 -2 -1 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MAGNETIC FLUX DENSITY 1 0 -2 -1 0 0 0 0 0
+....................................................................................................................................
+tesla T
+gauss Gs 1.E-04 T
+....................................................................................................................................
+ M L T I K N J P S
+FLUX OF MAGNETIC INDUCTION 1 2 -2 -1 0 0 0 0 0
+....................................................................................................................................
+weber Wb
+maxwell Mx 1.E-08 Wb
+....................................................................................................................................
+ M L T I K N J P S
+INDUCTANCE 1 2 -2 -2 0 0 0 0 0
+....................................................................................................................................
+henry H
+....................................................................................................................................
+ M L T I K N J P S
+RELUCTANCE -1 -2 2 2 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC RESISTANCE 1 2 -3 -2 0 0 0 0 0
+....................................................................................................................................
+ohm O
+....................................................................................................................................
+ M L T I K N J P S
+ELECTRIC CONDUCTANCE -1 -2 3 2 0 0 0 0 0
+....................................................................................................................................
+siemens S
+....................................................................................................................................
+ M L T I K N J P S
+RESISTIVITY 1 3 -3 -2 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+CONDUCTIVITY -1 -3 3 2 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MOLAR MASS 1 0 0 0 0 -1 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MOLAR VOLUME 0 3 0 0 0 -1 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+CONCENTRATION 1 -3 0 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MOLAR CONCENTRATION 0 -3 0 0 0 1 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+MOLARITY -1 0 0 0 0 1 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ACOUSTIC INTENSITY 0 1 0 -2 0 0 0 0 0
+....................................................................................................................................
+bel B
+neper Np 0.869 B
+....................................................................................................................................
+ M L T I K N J P S
+ABSORBED DOSE 0 2 -2 0 0 0 0 0 0
+....................................................................................................................................
+gray Gr
+....................................................................................................................................
+ M L T I K N J P S
+DOSE EQUIVALENT 0 2 -2 0 0 0 0 0 0
+....................................................................................................................................
+sievert Si
+....................................................................................................................................
+ M L T I K N J P S
+ROTATION ACCELERATION 0 0 -2 0 0 0 0 1 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+TRANSLATION STIFFNESS 1 0 -2 0 0 0 0 0 0
+....................................................................................................................................
+....................................................................................................................................
+ M L T I K N J P S
+ROTATION STIFFNESS 1 2 -2 0 0 0 0 -1 0
+....................................................................................................................................
--- /dev/null
+srcinc:::occtvr_actions.json
+srcinc:::occtvr_bindings_generic.json
+srcinc:::occtvr_bindings_holographic_hmd.json
+srcinc:::occtvr_bindings_index_hmd.json
+srcinc:::occtvr_bindings_rift.json
+srcinc:::occtvr_bindings_touch.json
+srcinc:::occtvr_bindings_vive.json
+srcinc:::occtvr_bindings_vive_controller.json
+srcinc:::occtvr_bindings_vive_cosmos.json
+srcinc:::occtvr_bindings_vive_pro.json
--- /dev/null
+{
+ "actions": [
+ {
+ "name": "/actions/generic_head/in/headset_on_head",
+ "type": "boolean",
+ "requirement": "optional"
+ },
+ {
+ "name": "/actions/generic_left/in/pose_base",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_right/in/pose_base",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_left/in/pose_front",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_right/in/pose_front",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_left/in/pose_handgrip",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_right/in/pose_handgrip",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_left/in/pose_tip",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_right/in/pose_tip",
+ "type": "pose"
+ },
+ {
+ "name": "/actions/generic_left/out/haptic",
+ "type": "vibration"
+ },
+ {
+ "name": "/actions/generic_right/out/haptic",
+ "type": "vibration"
+ },
+ {
+ "name": "/actions/generic_left/in/appmenu_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/appmenu_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/sysmenu_click",
+ "type": "boolean",
+ "requirement": "optional"
+ },
+ {
+ "name": "/actions/generic_right/in/sysmenu_click",
+ "type": "boolean",
+ "requirement": "optional"
+ },
+ {
+ "name": "/actions/generic_left/in/trigger_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/trigger_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/trigger_pull",
+ "type": "vector1"
+ },
+ {
+ "name": "/actions/generic_right/in/trigger_pull",
+ "type": "vector1"
+ },
+ {
+ "name": "/actions/generic_left/in/grip_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/grip_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/trackpad_position",
+ "type": "vector2"
+ },
+ {
+ "name": "/actions/generic_right/in/trackpad_position",
+ "type": "vector2"
+ },
+ {
+ "name": "/actions/generic_left/in/trackpad_touch",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/trackpad_touch",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/trackpad_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/trackpad_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/thumbstick_position",
+ "type": "vector2"
+ },
+ {
+ "name": "/actions/generic_right/in/thumbstick_position",
+ "type": "vector2"
+ },
+ {
+ "name": "/actions/generic_left/in/thumbstick_touch",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/thumbstick_touch",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_left/in/thumbstick_click",
+ "type": "boolean"
+ },
+ {
+ "name": "/actions/generic_right/in/thumbstick_click",
+ "type": "boolean"
+ }
+ ],
+ "action_sets": [
+ {
+ "name": "/actions/generic_head",
+ "usage": "single"
+ },
+ {
+ "name": "/actions/generic_left",
+ "usage": "leftright"
+ },
+ {
+ "name": "/actions/generic_right",
+ "usage": "leftright"
+ }
+ ],
+ "default_bindings": [
+ {
+ "controller_type": "vive_controller",
+ "binding_url": "occtvr_bindings_vive_controller.json"
+ },
+ {
+ "controller_type": "generic",
+ "binding_url": "occtvr_bindings_generic.json"
+ },
+ {
+ "controller_type": "holographic_controller",
+ "binding_url": "occtvr_bindings_holographic_hmd.json"
+ },
+ {
+ "controller_type": "indexhmd",
+ "binding_url": "occtvr_bindings_index_hmd.json"
+ },
+ {
+ "controller_type": "rift",
+ "binding_url": "occtvr_bindings_rift.json"
+ },
+ {
+ "controller_type": "vive",
+ "binding_url": "occtvr_bindings_vive.json"
+ },
+ {
+ "controller_type": "vive_cosmos",
+ "binding_url": "occtvr_bindings_vive_cosmos.json"
+ },
+ {
+ "controller_type": "vive_pro",
+ "binding_url": "occtvr_bindings_vive_pro.json"
+ }
+ ],
+ "localization": [
+ {
+ "language_tag": "en_US",
+ "/actions/generic_head/in/headset_on_head": "Headset is on head",
+ "/actions/generic_left/in/appmenu_click": "Left app menu",
+ "/actions/generic_left/in/sysmenu_click": "Left system menu",
+ "/actions/generic_left/in/trigger_click": "Left trigger click",
+ "/actions/generic_left/in/trigger_pull": "Left trigger squeeze",
+ "/actions/generic_left/in/grip_click": "Left hand full grip",
+ "/actions/generic_left/in/pose_base": "Left hand base",
+ "/actions/generic_left/in/pose_front": "Left hand front",
+ "/actions/generic_left/in/pose_handgrip": "Left handgrip pose",
+ "/actions/generic_left/in/pose_tip": "Left forefinger tip",
+ "/actions/generic_left/in/trackpad_position": "Left trackpad position",
+ "/actions/generic_left/in/trackpad_touch": "Left trackpad touch",
+ "/actions/generic_left/in/trackpad_click": "Left trackpad click",
+ "/actions/generic_left/in/thumbstick_position": "Left thumbstick position",
+ "/actions/generic_left/in/thumbstick_touch": "Left thumbstick touch",
+ "/actions/generic_left/in/thumbstick_click": "Left thumbstick click",
+ "/actions/generic_left/out/haptic": "Left hand haptic",
+ "/actions/generic_right/in/appmenu_click": "Right app menu",
+ "/actions/generic_right/in/sysmenu_click": "Right system menu",
+ "/actions/generic_right/in/trigger_click": "Right trigger click",
+ "/actions/generic_right/in/trigger_pull": "Right trigger squeeze",
+ "/actions/generic_right/in/grip_click": "Right hand full grip",
+ "/actions/generic_right/in/pose_base": "Right hand base",
+ "/actions/generic_right/in/pose_front": "Right hand front",
+ "/actions/generic_right/in/pose_handgrip": "Right handgrip pose",
+ "/actions/generic_right/in/pose_tip": "Right forefinger tip",
+ "/actions/generic_right/in/trackpad_position": "Right trackpad position",
+ "/actions/generic_right/in/trackpad_touch": "Right trackpad touch",
+ "/actions/generic_right/in/trackpad_click": "Right trackpad click",
+ "/actions/generic_right/in/thumbstick_position": "Right thumbstick position",
+ "/actions/generic_right/in/thumbstick_touch": "Right thumbstick touch",
+ "/actions/generic_right/in/thumbstick_click": "Right thumbstick click",
+ "/actions/generic_right/out/haptic": "Right hand haptic"
+ }
+ ]
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_left": {
+ "haptics": [
+ {
+ "output": "/actions/generic_left/out/haptic",
+ "path": "/user/hand/left/output/haptic"
+ }
+ ],
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/appmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/application_menu"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/trigger_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/trigger"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/trackpad_click" },
+ "touch": { "output": "/actions/generic_left/in/trackpad_touch" },
+ "position": { "output": "/actions/generic_left/in/trackpad_position" }
+ },
+ "mode": "trackpad",
+ "path": "/user/hand/left/input/trackpad"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/grip_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/grip"
+ }
+ ]
+ },
+ "/actions/generic_right": {
+ "haptics": [
+ {
+ "output": "/actions/generic_right/out/haptic",
+ "path": "/user/hand/right/output/haptic"
+ }
+ ],
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/appmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/application_menu"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/trigger_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/trigger"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/trackpad_click" },
+ "touch": { "output": "/actions/generic_right/in/trackpad_touch" },
+ "position": { "output": "/actions/generic_right/in/trackpad_position" }
+ },
+ "mode": "trackpad",
+ "path": "/user/hand/right/input/trackpad"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/grip_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/grip"
+ }
+ ]
+ }
+ },
+ "controller_type": "generic",
+ "description": "Standard Open CASCADE Technology VR bindings for a generic controller",
+ "name": "OCCT VR bindings for a generic controller"
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "holographic_hmd",
+ "description": "",
+ "name": "holographic_hmd defaults"
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "indexhmd",
+ "description": "",
+ "name": "index hmd defaults"
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "rift",
+ "description": "",
+ "name": "rift defaults"
+}
--- /dev/null
+{
+ "action_manifest_version" : 0,
+ "alias_info" : {},
+ "bindings" : {
+ "/actions/generic_left" : {
+ "haptics" : [
+ {
+ "output" : "/actions/generic_left/out/haptic",
+ "path" : "/user/hand/left/output/haptic"
+ }
+ ],
+ "sources" : [
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/appmenu_click"
+ }
+ },
+ "mode" : "button",
+ "path" : "/user/hand/left/input/application_menu"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/trackpad_click"
+ },
+ "position" : {
+ "output" : "/actions/generic_left/in/trackpad_position"
+ },
+ "touch" : {
+ "output" : "/actions/generic_left/in/trackpad_touch"
+ }
+ },
+ "mode" : "trackpad",
+ "path" : "/user/hand/left/input/trackpad"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/sysmenu_click"
+ }
+ },
+ "mode" : "button",
+ "path" : "/user/hand/left/input/system"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/trigger_click"
+ },
+ "pull" : {
+ "output" : "/actions/generic_left/in/trigger_pull"
+ }
+ },
+ "mode" : "trigger",
+ "path" : "/user/hand/left/input/trigger"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/appmenu_click"
+ }
+ },
+ "mode" : "button",
+ "path" : "/user/hand/left/input/x"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_left/in/trackpad_click"
+ },
+ "position" : {
+ "output" : "/actions/generic_left/in/trackpad_position"
+ },
+ "touch" : {
+ "output" : "/actions/generic_left/in/trackpad_touch"
+ }
+ },
+ "mode" : "joystick",
+ "path" : "/user/hand/left/input/joystick"
+ }
+ ]
+ },
+ "/actions/generic_right" : {
+ "haptics" : [
+ {
+ "output" : "/actions/generic_right/out/haptic",
+ "path" : "/user/hand/right/output/haptic"
+ }
+ ],
+ "sources" : [
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_right/in/appmenu_click"
+ }
+ },
+ "mode" : "button",
+ "path" : "/user/hand/right/input/application_menu"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_right/in/trackpad_click"
+ },
+ "position" : {
+ "output" : "/actions/generic_right/in/trackpad_position"
+ },
+ "touch" : {
+ "output" : "/actions/generic_right/in/trackpad_touch"
+ }
+ },
+ "mode" : "trackpad",
+ "path" : "/user/hand/right/input/trackpad"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_right/in/trigger_click"
+ },
+ "pull" : {
+ "output" : "/actions/generic_right/in/trigger_pull"
+ }
+ },
+ "mode" : "trigger",
+ "path" : "/user/hand/right/input/trigger"
+ },
+ {
+ "inputs" : {
+ "click" : {
+ "output" : "/actions/generic_right/in/thumbstick_click"
+ },
+ "position" : {
+ "output" : "/actions/generic_right/in/thumbstick_position"
+ },
+ "touch" : {
+ "output" : "/actions/generic_right/in/thumbstick_touch"
+ }
+ },
+ "mode" : "joystick",
+ "path" : "/user/hand/right/input/joystick"
+ },
+ {
+ "inputs" : {
+ "touch" : {
+ "output" : "/actions/generic_right/in/grip_click"
+ }
+ },
+ "mode" : "trigger",
+ "path" : "/user/hand/right/input/grip"
+ }
+ ]
+ }
+ },
+ "category" : "steamvr_input",
+ "controller_type" : "oculus_touch",
+ "description" : "Standard Open CASCADE Technology VR bindings for an oculus touch controller",
+ "options" : {},
+ "simulated_actions" : []
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "vive",
+ "description": "",
+ "name": "vive defaults"
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_left": {
+ "haptics": [
+ {
+ "output": "/actions/generic_left/out/haptic",
+ "path": "/user/hand/left/output/haptic"
+ }
+ ],
+ "poses": [
+ {
+ "output": "/actions/generic_left/in/pose_base",
+ "path": "/user/hand/left/pose/base"
+ },
+ {
+ "output": "/actions/generic_left/in/pose_front",
+ "path": "/user/hand/left/pose/front"
+ },
+ {
+ "output": "/actions/generic_left/in/pose_handgrip",
+ "path": "/user/hand/left/pose/handgrip"
+ },
+ {
+ "output": "/actions/generic_left/in/pose_tip",
+ "path": "/user/hand/left/pose/tip"
+ }
+ ],
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/appmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/application_menu"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/trigger_click" },
+ "pull": { "output": "/actions/generic_left/in/trigger_pull" }
+ },
+ "mode": "trigger",
+ "path": "/user/hand/left/input/trigger"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/trackpad_click" },
+ "touch": { "output": "/actions/generic_left/in/trackpad_touch" },
+ "position": { "output": "/actions/generic_left/in/trackpad_position" }
+ },
+ "mode": "trackpad",
+ "path": "/user/hand/left/input/trackpad"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/grip_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/grip"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_left/in/sysmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/left/input/system"
+ }
+ ]
+ },
+ "/actions/generic_right": {
+ "haptics": [
+ {
+ "output": "/actions/generic_right/out/haptic",
+ "path": "/user/hand/right/output/haptic"
+ }
+ ],
+ "poses": [
+ {
+ "output": "/actions/generic_right/in/pose_base",
+ "path": "/user/hand/right/pose/base"
+ },
+ {
+ "output": "/actions/generic_right/in/pose_front",
+ "path": "/user/hand/right/pose/front"
+ },
+ {
+ "output": "/actions/generic_right/in/pose_handgrip",
+ "path": "/user/hand/right/pose/handgrip"
+ },
+ {
+ "output": "/actions/generic_right/in/pose_tip",
+ "path": "/user/hand/right/pose/tip"
+ }
+ ],
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/appmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/application_menu"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/trigger_click" },
+ "pull": { "output": "/actions/generic_right/in/trigger_pull" }
+ },
+ "mode": "trigger",
+ "path": "/user/hand/right/input/trigger"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/trackpad_click" },
+ "touch": { "output": "/actions/generic_right/in/trackpad_touch" },
+ "position": { "output": "/actions/generic_right/in/trackpad_position" }
+ },
+ "mode": "trackpad",
+ "path": "/user/hand/right/input/trackpad"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/grip_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/grip"
+ },
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_right/in/sysmenu_click" }
+ },
+ "mode": "button",
+ "path": "/user/hand/right/input/system"
+ }
+ ]
+ }
+ },
+ "controller_type": "vive_controller",
+ "description": "Standard Open CASCADE Technology VR bindings for the Vive controller",
+ "name": "OCCT VR bindings for the Vive controller"
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "vive_cosmos",
+ "description": "",
+ "name": "vive cosmos hmd defaults",
+}
--- /dev/null
+{
+ "bindings": {
+ "/actions/generic_head": {
+ "sources": [
+ {
+ "inputs": {
+ "click": { "output": "/actions/generic_head/in/headset_on_head" }
+ },
+ "mode": "button",
+ "path": "/user/head/proximity"
+ }
+ ]
+ }
+ },
+ "controller_type": "vive_pro",
+ "description": "",
+ "name": "vive_pro defaults"
+}
--- /dev/null
+msgfile:::XSTEP.fr
+msgfile:::XSTEP.us
--- /dev/null
+!LOADING PHASE
+.XSTEP_1
+ Debut du chargement en memoire du fichier IGES.
+!
+.XSTEP_2
+ Erreur d'ouverture du fichier IGES.
+!
+.XSTEP_3
+ Raison : Le fichier n'existe pas.
+!
+.XSTEP_4
+ Raison : Espace memoire insuffisant.
+!
+.XSTEP_5
+ Raison : Ce fichier est protege en lecture.
+!
+.XSTEP_6
+ Raison : Trop de fichiers ouverts.
+!
+.XSTEP_7
+ Raison : Inconnue.
+!
+.XSTEP_8
+ Fin du chargement du fichier IGES (Temps ecoule : %s).
+
+!
+.XSTEP_9
+Debut de lecture du fichier IGES.
+!
+.XSTEP_10
+Fin de lecture du fichier IGES.
+!
+.XSTEP_11
+ Erreur interne pendant la lecture de l'entete : le processus continue.
+!
+.XSTEP_12
+Entete et contenu du fichier IGES ont ete charges.
+!
+.XSTEP_13
+ Erreur interne durant la lecture de l'entite %d.
+!
+.XSTEP_14
+ Erreur interne durant la lecture de l'entite %d parametre %d.
+!
+.XSTEP_15
+ Nombre total d'entites chargees : %d.
+!
+.XSTEP_16
+ Debut du chargement du modele.
+!
+.XSTEP_17
+ Fin du chargement du modele.
+!
+.XSTEP_18
+ Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s.
+!
+.XSTEP_19
+ Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s (numero de ligne peut etre incorrecte).
+!
+.XSTEP_20
+ Il n'y a pas de Terminate Section : le processus continue.
+!
+.XSTEP_21
+Nombre d'entites nulles ignorees : %d.
+!
+.XSTEP_22
+ Entite inconnue %s.
+!
+.XSTEP_23
+ Entite recuperee %s.
+!
+.XSTEP_24
+Resume : %d entites inconnues.
+!
+.XSTEP_25
+ Nombre de fails pendant le chargement en memoire : %d.
+!
+.XSTEP_26
+ Nombre de warnings pendant le chargement en memoire : %d.
+!
+.XSTEP_27
+ Directory Entry : Il n'y a pas de parametre. le transfer continue.
+!
+.XSTEP_28
+ Directory Entry : Le parametre 1 (Type de l'entite) est incorrect.
+!
+.XSTEP_29
+ Directory Entry : Le champ 4 (Line Font Pattern) est incorrect (Un pointeur non nul ou un entier entre 0 et 5 est attendu).
+!
+.XSTEP_30
+ Directory Entry : Le champ 5 (Level) est incorrect (Un pointeur ou un entier non nul est attendu).
+!
+.XSTEP_31
+ Directory Entry : Le champ 6 (View) est incorrect (Un pointeur non nul est attendu).
+!
+.XSTEP_32
+: Directory Entry : Le champ 7 (Transformation Matrix) est incorrect (Un pointeur non nul est attendu).
+!
+.XSTEP_33
+ Entity %s, Type %d : Directory Entry : Le champ 8 (Label Display Associativity) est incorrect (Un pointeur non nul est attendu).
+!
+.XSTEP_34
+ Directory Entry : Le champ 13 (Color Number) est incorrect (Un pointeur non nul ou un entier entre 0 et 8 est attendu).
+!
+.XSTEP_35
+ Entite nulle %s.
+!
+.XSTEP_36
+ Entite inconnue %s.
+!
+.XSTEP_37
+ La liste d'associativites est incorrecte.
+!
+.XSTEP_38
+ La liste de proprietes est incorrecte.
+! ANALYSIS PHASE
+.XSTEP_39
+ Global Section : Nombre de parametres invalides (%d ou %d parametres attendus).
+!
+.XSTEP_40
+ Global Section (Parametres 1 et 2) : Parameter Delimiter Character et Record Delimiter Character doivent etre differents.
+!
+.XSTEP_41
+ Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Virgule pris par defaut.
+!
+.XSTEP_42
+ Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Point Virgule pris par defaut.
+!
+.XSTEP_43
+ Global Section (Parametre 8) : Le parametre Single Precision Magnitude est invalide (Entier Positif attendu). Valeur 38 prise pas defaut.
+!
+.XSTEP_44
+ Global Section (Parametre 9) : Le parametre Single Precision Significance est invalide (Entier Positif attendu). Valeur 6 prise pas defaut.
+!
+.XSTEP_45
+ Global Section (Parametre 10) : Le parametre Double Precision Magnitude est invalide (Entier Positif attendu). Valeur 308 prise pas defaut.
+!
+.XSTEP_46
+ Global Section (Parametre 11) : Le parametre Double Precision Significance est invalide (Entier Positif attendu). Valeur 15 prise pas defaut.
+!
+.XSTEP_47
+ Global Section (Parametre 13) : Le parametre Model Space Scale est invalide (Positif attendu). Valeur 1.0 prise pas defaut.
+!
+.XSTEP_48
+ Global Section (Parametre 14) : Le parametre Unit Flag est invalide (Entier entre 1 et 11 attendu). Valeur 2 prise pas defaut : Millimeters.
+!
+.XSTEP_49
+ Global Section (Parametre 15) : Le parametre Unit Name n'est pas traite.Valeur 2 prise pas defaut : Millimeters.
+!
+.XSTEP_50
+ Global Section (Parametre 15) : Le parametre Unit Name n'est pas defini, ignore.
+!
+.XSTEP_51
+ Global Section (Parametre 14 et 15) : Le parametre Unit Flag ne correspond pas au parametre Unit Name : Unit Name ignore.
+!
+.XSTEP_52
+ Global Section i)(Parametre 19) : Le parametre Minimum Resolution est invalide (Reel Positif attendu). Valeur 0.0 prise pas defaut.
+!
+.XSTEP_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.
+!
+.XSTEP_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.
+!
+.XSTEP_55
+ Global Section (Parametre 25) : Le parametre Last change Date n'est pas defini.
+!
+.XSTEP_56
+ Global Section (Parametre 18) : Le parametre Date n'est pas defini.
+!
+.XSTEP_57
+ Global Section (Parametre %d) : Format de date invalide.
+!
+.XSTEP_58
+ Directory Entry (Champ 1) : Le champ Entity Type Number est invalide
+!
+.XSTEP_59
+ Directory Entry (Champ 3) : Le champ Structure est indefini.
+!
+.XSTEP_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.
+!
+.XSTEP_61
+ Directory Entry (Champ 5) : Le champ Level est invalide (Pointeur ou Entier attendu). Valeur 0 prise par defaut.
+!
+.XSTEP_62
+ Directory Entry (Champ 6) : Le champ View est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
+!
+.XSTEP_63
+ Directory Entry (Champ 7): Le champ Transformation Matrix est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
+!
+.XSTEP_64
+ Directory Entry (Champ 8): Le champ Label Display Entity est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
+!
+.XSTEP_65
+ Directory Entry (Champ 9) : Le champ Blank Status est invalide (Entier attendu : 0 ou 1).
+!
+.XSTEP_66
+ Directory Entry (Champ 9) : Le champ Subordinate Entity Switch est invalide (Entier entre 0 et 3 attendu).
+!
+.XSTEP_67
+ Directory Entry (Champ 9) : Le champ Entity Use Flag est invalide (Entier entre 0 et 6 attendu).
+!
+.XSTEP_68
+ Directory Entry (Champ 9) : Le champ Hierarchy est invalide (Entier entre 0 et 2 attendu).
+!
+.XSTEP_69
+ Directory Entry (Champ 12) : Le champ Line Weight Number n'est pas defini.
+!
+.XSTEP_70
+ Directory Entry (Champ 13) : Le champ Color Number est invalide (Pointeur ou Entier entre 0 et 8 attendu).
+!
+.XSTEP_71
+ Directory Entry (Champ 15) : Le champ Form Number est invalide.
+!
+.XSTEP_72
+ Directory Entry (Champ 19): Le champ Entity Subscript Number est invalide (Entier attendu).
+!Type 116
+.XSTEP_73
+ Parameter Data : Le parametre %d (Coordinate of Point) est invalide (Reel attendu).
+!Type 116
+.XSTEP_74
+ Parameter Data : Le parametre %d (Display Symbol) est invalide (Entite Subfigure Definition, Type 308 attendue).
+!Type 100
+.XSTEP_75
+ Parameter Data : Le parametre 1 ( ZT displacement of Arc) est invalide (Reel attendu).
+!Type 100
+.XSTEP_76
+ Parameter Data : Le parametre %d (Arc Center ) est invalide (Reel attendu).
+!Type 100
+.XSTEP_77
+ Parameter Data : Le parametre %d (Start Point) est invalide (Reel attendu).
+!Type 100
+.XSTEP_78
+ Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
+!Type 102
+.XSTEP_79
+ Parameter Data : Le parametre 1 (Number of Entities) est invalide :%d (Entier Positif attendu).
+!Type 102
+.XSTEP_80
+ Parameter Data : Certains pointeurs de liste d'entites sont nuls ou negatifs : ignores (Entites Point, Connect Point ou Paramerterized Curve attendues).
+!Type 104
+.XSTEP_81
+ Parameter Data : Le parametre %d (Conic Coefficient) est invalide (Reel attendu).
+!Type 104
+.XSTEP_82
+ Parameter Data : Le parametre 7 (Coordinate of Plane) est invalide (Reel attendu).
+!Type 104
+.XSTEP_83
+ Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).
+!Type 104
+.XSTEP_84
+ Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
+!Type 106
+.XSTEP_85
+ Parameter Data : Le parametre 1 (Interpretation Flag) est invalide (Entier attendu : %d).
+!Type 106
+.XSTEP_86
+ Parameter Data : Le parametre 2 (Number of n-tuples) est invalide (Entier Positif attendu).
+!Type 106
+.XSTEP_87
+ Parameter Data : Le parametre 3 (Common Z Displacement) est invalide (Reel attendu).
+!Type 106
+.XSTEP_88
+ Parameter Data : Tous les parametres Data Point ne sont pas de type Reel.
+!Type 110
+.XSTEP_89
+ Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).
+!Type 110
+.XSTEP_90
+ Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
+!Type 112
+.XSTEP_91
+ Parameter Data : Le parametre 1 (Spline Type) est invalide (Entier entre 1 et 6 attendu).
+!Type 112
+.XSTEP_92
+ Parameter Data : Le parametre 2 (Degree of Continuity) est invalide (Entier attendu).
+!Type 112
+.XSTEP_93
+ Parameter Data : Le parametre 3 (Number of Dimensions) est invalide (Entier attendu : 2 ou 3).
+!Type 112
+.XSTEP_94
+ Parameter Data : Le parametre 4 (Number of Segments) est invalide (Entier Positif attendu).
+!Type 112
+.XSTEP_95
+ Parameter Data : Tous les parametres Break Point ne sont pas de type Reel.
+!Type 112
+.XSTEP_96
+ Parameter Data : L'entite est plane mais les parametres BZ, CZ. DZ ne sont pas nuls
+!Type 126
+.XSTEP_97
+ Parameter Data : Le parametre %d (Upper Index of Sum) est invalide (Entier Positif attendu).
+!Type 126
+.XSTEP_98
+ Parameter Data : Le parametre %d (Degree of Basis Functions) est invalide (Entier attendu) : Valeur 0 prise par defaut.
+!Type 126
+.XSTEP_99
+ Parameter Data : Le parametre %d (Planar/Non Planar Flag) est invalide (Booleen attendu).
+!Type 126
+.XSTEP_100
+ Parameter Data : Le parametre %d (Open/Closed Flag) est invalide (Booleen attendu).
+!Type 126
+.XSTEP_101
+ Parameter Data : Le parametre %d (Rational/Polynomial Flag) est invalide (Booleen attendu).
+!Type 126
+.XSTEP_102
+ Parameter Data : Le parametre %d (NonPeriodic/Periodic Flag) est invalide (Booleen attendu).
+!Type 126
+.XSTEP_103
+ Parameter Data : Tous les parametres Knot Sequence ne sont pas de type Reel.
+!Type 126
+.XSTEP_104
+ Parameter Data : Tous les parametres Weight ne sont pas de type Reel Positif.
+!Type 126
+.XSTEP_105
+ Parameter Data : Le parametre %d (Control Point) est invalide (Reel attendu).
+!Type 126
+.XSTEP_106
+ Parameter Data : Le parametre %d (Starting Value) est invalide (Reel attendu).
+!Type 126
+.XSTEP_107
+ Parameter Data : Le parametre %d (Ending Value) est invalide (Reel attendu).
+!Type 126
+.XSTEP_108
+ Parameter Data : Le parametre %d (Unit Normal) est invalide (Reel attendu).
+!Type 126
+.XSTEP_109
+ Parameter Data : Le parametre %d (Unit Normal) n'est pas defini pour une courbe plane.
+!Type 130
+.XSTEP_110
+ Parameter Data : Le parametre 1 (Curve Entity to be offset) est invalide (Entite Curve attendue).
+!Type 130
+.XSTEP_111
+ Parameter Data : Le parametre 2 (Offset Distance Flag) est invalide (Entier entre 1 et 3 attendu).
+!Type 130
+.XSTEP_112
+ Parameter Data : Le parametre 3 (Curve Entity whose coordinate describes the offset) est invalide (Entite Curve attendue).
+!Type 130
+.XSTEP_113
+ Parameter Data : Le parametre 4 (Particular Coordinate) est invalide (Entier attendu).
+!Type 130
+.XSTEP_114
+ Parameter Data : Le parametre 5 (Tapered Offset Type Flag) est invalide (Entier attendu).
+!Type 130
+.XSTEP_115
+ Parameter Data : Le parametre 6 (First Offset distance) est invalide (Reel attendu).
+!Type 130
+.XSTEP_116
+ Parameter Data : Le parametre 7 (Arc Length of Fisrt Offset Distance) est invalide (Reel attendu).
+!Type 130
+.XSTEP_117
+ Parameter Data : Le parametre 8 (Second Offset Distance) est invalide (Reel attendu).
+!Type 130
+.XSTEP_118
+ Parameter Data : Le parametre 9 (Arc Length of Second Offset Distance) est invalide (Reel attendu).
+!Type 130
+.XSTEP_119
+ Parameter Data : Le parametre 13 (Offset Curve Starting Parameter Value) est invalide (Reel attendu).
+!Type 130
+.XSTEP_120
+ Parameter Data : Le parametre 14 (Offset Curve Ending Parameter Value) est invalide (Reel attendu).
+!Type 130
+.XSTEP_121
+ Parameter Data : Le parametre %d (Unit Vector Normal to plane) est invalide (Reel attendu).
+!Type 130
+.XSTEP_122
+ Parameter Data : Le parametre 1 (Type of Bounded Surface Representation) est invalide (Entier attendu : 0 ou 1 ).
+!Type 141
+.XSTEP_123
+ Parameter Data : Le parametre 2 (Trimming Curves Representation) est invalide (Entier entre 0 et 3 attendu).
+!Type 141
+.XSTEP_124
+ Parameter Data : Le parametre 3 (Untrimmed Surface) est invalide (Entite Untrimmed Surface attendue).
+!Type 141
+.XSTEP_125
+ Parameter Data : Surface %d non parametrique (parametre 3).
+!Type 141
+.XSTEP_126
+ Parameter Data : Le parametre 4 (Number of Curves est invalide (Positif attendu).
+!Type 141
+.XSTEP_127
+ Parameter Data : Le parametre 5 (Model Space Curve) est invalide (Entite Curve attendue).
+!Type 141
+.XSTEP_128
+ Parameter Data : Le parametre 6 (Orientation Flag) est invalide (Entier attendu : 1 ou 2).
+!Type 141
+.XSTEP_129
+ Parameter Data : Le parametre 7 (Number of Associated Parameter Space Curves) est invalide (Entier attendu : 0).
+!Type 141
+.XSTEP_130
+ Parameter Data : Certains pointeurs de la liste d'entites Parameter Space Curve sont nuls ou negatifs : ignores (Entites Curve attendues).
+!Type 142
+.XSTEP_131
+ Parameter Data : Le parametre 2 (Surface on which the curve lies) est invalide (Entite Surface attendue).
+!Type 142
+.XSTEP_132
+ Parameter Data : Le parametre 3 (Curve 2D) est invalide (Entite Curve attendue).
+!Type 142
+.XSTEP_133
+ Parameter Data : Le parametre 4 (Curve 3D) est invalide (Entite Curve attendue).
+!Type 142
+.XSTEP_134
+ Parameter Data : Les pointeurs sur les courbes 2D et sont nuls (parameter 3 et 4) (Entites Curve attendues).
+!Type 108
+.XSTEP_135
+ Parameter Data : Le parametre %d (Coefficient Of Plane) est invalide (Reel attendu).
+!Type 108
+.XSTEP_136
+ Parameter Data : Le parametre 5 (Closed Curve) est invalide (Entite Curve attendue).
+!Type 108
+.XSTEP_137
+ Parameter Data : Le parametre 5 est invalide (Pointeur nul attendu lorsque le champ Form Number est 0).
+!Type 108
+.XSTEP_138
+ Parameter Data : Le parametre 9 (DisplaySymbol Size) est invalide (Reel attendu).
+!Type 108
+.XSTEP_139
+ Parameter Data : Le parametre %d (Coordinate of Display Symbol) est invalide (Reel attendu).
+!Type 114
+.XSTEP_140
+ Parameter Data : Le parametre 1 (Spline Boundary Type) est invalide (Entier entre 1 et 6 attendu).
+!Type 114
+.XSTEP_141
+ Parameter Data : Le parametre 3 (Number of U Segments) est invalide (Entier Positif attendu).
+!Type 114
+.XSTEP_142
+ Parameter Data : Le parametre 4 (Number of V Segments) est invalide (Entier Positif attendu).
+!Type 114
+.XSTEP_143
+ Parameter Data : Tous les parametres Breakpoint in U ne sont de type Reel.
+!Type 114
+.XSTEP_144
+ Parameter Data : Tous les parametres Breakpoint in V ne sont pas de type Reel.
+!Type 114
+.XSTEP_145
+ Parameter Data : Tous les parametres %s Coefficient of Patch ne sont pas de type Reel.
+!Type 114
+.XSTEP_146
+ Parameter Data : Le parametre %d (Last Z Coefficient of Patch) est invalide (Reel attendu).
+!Type 114
+.XSTEP_147
+ Parameter Data : Le nombre de parametres %c Coefficient of Patch est invalide (Entier attendu : 16).
+!Type 118
+.XSTEP_148
+ Parameter Data : Le parametre 1 (First Curve) est invalide (Entite Curve attendue).
+!Type 118
+.XSTEP_149
+ Parameter Data : Le parametre 2 (Second Curve) est invalide (Entite Curve attendue).
+!Type 118
+.XSTEP_150
+ Parameter Data : Le parametre 3 (Direction Flag) est invalide (Entier 0 ou 1 attendu).
+!Type 118
+.XSTEP_151
+ Parameter Data : Le parametre 4 (Developable Surface Flag) est invalide (Entier 0 ou 1 attendu).
+!Type 120
+.XSTEP_152
+ Parameter Data : Le parametre 1 (Axis of Revolution) est invalide (Entite attendue).
+!Type 120
+.XSTEP_153
+ Parameter Data : Le parametre 2 (Generatrix Entity) est invalide (Entite attendue).
+!Type 120
+.XSTEP_154
+ Parameter Data : Le parametre 3 (Start Angle) est invalide (Reel attendu).
+!Type 120
+.XSTEP_155
+ Parameter Data : Le parametre 4 (Terminate Angle est invalide (Reel attendu).
+!Type 122
+.XSTEP_156
+ Parameter Data : Le parametre 1 (Generatrix Entity) est invalide (Entite Curve attendue).
+!Type 122
+.XSTEP_157
+ Parameter Data : Le parametre %d (Coordinate of the Terminate Point) est invalide (Reel attendu).
+!Type 128
+.XSTEP_158
+ Parameter Data : Valeur supplementaire invalide (Reel attendu).
+!Type 128
+.XSTEP_159
+ Parameter Data : Valeur Reelle supplementaire : ignoree.
+!Type 128
+.XSTEP_160
+ Parameter Data : Invalid Number of First Knots sequence (Nombre attendu : %d).
+!Type 128
+.XSTEP_161
+ Parameter Data : Invalid Number of Second Knots Sequence (Nombre attendu : %d).
+!Type 140
+.XSTEP_162
+ Parameter Data : Le parametre %d (Coordinate of Offset Indicator) est invalide (Reel attendu).
+!Type 140
+.XSTEP_163
+ Parameter Data : Le parametre 4 (Offset Distance) est invalide (Reel attendu).
+!Type 140
+.XSTEP_164
+ Parameter Data : Le parametre 5 (Surface Entity to be offset) est invalide (Entite Surface attendue).
+!Type 143
+.XSTEP_165
+ Parameter Data : Le parametre 1 (Bounded Surface Representation Type) est invalide (Entier 0 ou 1 attendu).
+!Type 143
+.XSTEP_166
+ Parameter Data : Le parametre 2(Surface Entity to be Bounded) est invalide (Entite Surface attendue).
+!Type 143
+.XSTEP_167
+ Parameter Data : Le parametre 3 (Number of Boundary Entities) est invalide (Entier Positif attendu).
+!Type 143
+.XSTEP_168
+ Parameter Data : Le parametre %d (Boundary Entity) est invalide (Entite Boundary, Type 141 attendue).
+!Type 144
+.XSTEP_169
+ Parameter Data : Le parametre 1 (Surface to be trimmed) est invalide (Entite Surface attendue).
+!Type 144
+.XSTEP_170
+ Parameter Data : Le parametre 2 (Outer Boundary Type) est invalide (Entier 0 ou 1 attendu).
+!Type 144
+.XSTEP_171
+ Parameter Data : Le parametre 3 ( Number of Inner Boundary Closed Curves) est invalide (Entier Positif attendu).
+!Type 144
+.XSTEP_172
+ Parameter Data : Le parametre 4 (Outer Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).
+!Type 144
+.XSTEP_173
+ Parameter Data : Le parametre %d (Inner Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).
+!Type 190
+.XSTEP_174
+ Parameter Data : Le parametre 1 (Point on the Surface) est invalide (Entite Point, Type 116 attendue).
+!Type 190
+.XSTEP_175
+ Parameter Data : Le parametre 2 (Surface Normal Direction) est invalide (Entite Direction attendue).
+!Type 190
+.XSTEP_176
+ Parameter Data : Le parametre 3 (Reference Direction) est invalide (Entite Direction attendue).
+!Type 190
+.XSTEP_177
+ Parameter Data : Le parametre 3 est invalide (Pointeur nul attendu lorsque le champ Form Number est 1).
+!Type 186
+.XSTEP_178
+ Parameter Data : Le parametre 1 (Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).
+!Type 186
+.XSTEP_179
+ Parameter Data : Le parametre %d (Void Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).
+!Type 186
+.XSTEP_180
+ Parameter Data : Le parametre %d (Orientation Flag) est invalide (Booleen attendu).
+!Type 186
+.XSTEP_181
+ Parameter Data : Le parametre 3 (Number of Void Shells) est invalide (Entier Positif attendu).
+!Type 502
+.XSTEP_182
+ Parameter Data : Le parametre 1 (Number of Vertex Tuples) est invalide (Entier Positif attendu).
+!Type 502
+.XSTEP_183
+ Parameter Data : Le parametre % (Coordinate of Vertex) est invalide (Reel attendu).
+!Type 504
+.XSTEP_184
+ Parameter Data : Le parametre 1 (Number of Edge Tuples) est invalide (Entier Positif attendu).
+!Type 504
+.XSTEP_185
+ Parameter Data : Le parametre 2 (Model Space Curve) est invalide (Entite Curve attendue).
+!Type 504
+.XSTEP_186
+ Parameter Data : Le parametre %d (Start Vertex Index) est invalide (Entier attendu).
+!Type 504
+.XSTEP_187
+ Parameter Data : Le parametre %d (Terminate Vertex Index) est invalide (Entier attendu).
+!Type 504
+.XSTEP_188
+ Parameter Data : Le parametre %d (Start Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).
+!Type 504
+.XSTEP_189
+ Parameter Data : Le parametre %d (Terminate Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).!T
+!Type 508
+.XSTEP_190
+ Parameter Data : Le parametre %d (Edge Type) est invalide (Entier 0 ou 1 attendu).
+!Type 508
+.XSTEP_191
+ Parameter Data : Le parametre %d (List Index) est invalide (Entier attendu).
+!Type 508
+.XSTEP_192
+ Parameter Data : Le parametre %d (Number of Parameter Curves) est invalide (Entier Positif attendu).
+!Type 508
+.XSTEP_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
+.XSTEP_194
+ Parameter Data : Le parametre % (Parameter Space Curve) est invalide (Entite Curve attendue).
+!Type 508
+.XSTEP_195
+ Parameter Data : Le parametre %d (Isoparametric Flag) est invalide (Booleen attendu).
+!Type 510
+.XSTEP_196
+ Parameter Data : Le parametre 1 (Surface) est invalide (Entite Surface attendue).
+!Type 510
+.XSTEP_197
+ Parameter Data : Le parametre 2 (Number of Loops) est invalide (Entier Positif attendu).
+!Type 510
+.XSTEP_198
+ Parameter Data : Le parametre 3 (Outer Loop flag) est invalide (Booleen attendu).
+!Type 510
+.XSTEP_199
+ Parameter Data : Le parametre %d (Loop of the Face) est invalide (Entite Loop, Type 508 attendue).
+!Type 514
+.XSTEP_200
+ Parameter Data : Le parametre 1 (Number of Faces) est invalide (Entier Positif attendu).
+!Type 514
+.XSTEP_201
+ Parameter Data : Le parametre 2 (Face) est invalide (Entite Face, Type 510 attendue).
+!Type 402, Form 1 ou 7
+.XSTEP_202
+ Form %d : Parameter Data : Le parametre 1 (Number of Entries) est invalide (Entier attendu).
+!Type 402, Form 1 ou 7
+.XSTEP_203
+ Form %d : Parameter Data : Certains pointeurs de la liste d'entites sont nuls ou negatifs : ignores (Entites attendues).
+!Type 402
+.XSTEP_204
+ Form 9 : Parameter Data : Le parametre 1 (Number of Parent Entity) est invalide (Entier attendu : 1).
+!Type 402
+.XSTEP_205
+ Form 9 : Parameter Data : Le parametre 2 (Number of children) est invalide (Entier Positif attendu).
+!Type 402
+.XSTEP_206
+ Form 9 : Parameter Data : Le parametre 3 (Parent Entity) est invalide (Entite attendue).
+!Type 402
+.XSTEP_207
+ Form 9 : Parameter Data : Certains pointeurs de la liste d'entites filles sont nuls ou negatifs (Entites attendues).
+!Type 308
+.XSTEP_208
+ Parameter Data : Le parametre 1 (Depth of Subfigure) est invalide (Entier attendu).
+!Type 308
+.XSTEP_209
+ Parameter Data : Le parametre 2 (Subfigure Name) est invalide (Chaine au format Hollerith attendue).
+!Type 308
+.XSTEP_210
+ Parameter Data : Le parametre 3 (Number of Entities) est invalide (Entie Positif attendu).
+!Type 308
+.XSTEP_211
+ Parameter Data : Certains pointeurs de la liste d'entites associees sont nuls ou negatifs : ignores (Entites attendues).
+!Type 408
+.XSTEP_212
+ Parameter Data : Le parametre 1 (Subfigure definition entity) est invalide (Entite Subfigure Definition Entity, Type 308 attendue).
+!Type 408
+.XSTEP_213
+ Parameter Data : Le parametre %d (Translation data) est invalide (Reel attendu).
+!Type 408
+.XSTEP_214
+ Parameter Data : Le parametre 5 (Scale Factor) est invalide (Reel attendu). Valeur 1.0 prise par defaut.
+!Type 124
+.XSTEP_215
+ Parameter Data : Tous les elements de la matrice ne sont pas de type Reel.
+!ADDED MESSAGES
+.XSTEP_246
+ Parameter Data : le parametre 4 (Number of segments) est inferieur a 1.
+!
+!
+! DCE 6/11/98 Add in Load phase
+!
+.XSTEP_276
+Parameter Data : le parametre 1 (Curve creation mode) est invalide
+!
+.XSTEP_277
+Parameter Data : le parametre 5 (Representation preference) est invalide (entier attendu).
+!
+.XSTEP_278
+Exception durant le chargement de l'entite %s
+!
+!
+!
+! ===================================================================
+!
+!
+!
+! New translation messages ( S3767 )
+!
+.IGES_1000
+ L'Entite %s n'a pas ete chargee en memoire
+!
+.IGES_1005
+Erreur logicielle : transfert d'entite impossible.
+!
+!.IGES_1006 the same as 1015
+! exception raising during the transfer.
+!
+.IGES_1001
+Form %d : Type d'entite non implemente : conversion impossible.
+!
+.IGES_1010
+ Le TopoDS_Shape resultat n'a pas le meme parametrage 2D et 3D.
+!
+.IGES_1015
+ Erreur logicielle : conversion interrompue.
+!
+.IGES_1020
+ Parameter data : le pointeur %d de la liste d'entite associees est nul ou negatif: ignore.
+!
+.IGES_1025
+ Erreur de conversion sur l'entite %d : entite ignoree.
+!
+.IGES_1030
+ Forme %d: Erreur de conversion sur l'entite IGES %d : entite ignoree.
+!
+.IGES_1035
+ La matrice de transformation est invalide : non appliquee.
+!
+.IGES_1036
+ Erreur logicielle : entite ignoree.
+!
+.IGES_1040
+ Parameter data : le pointeur %d de la liste d'entites est nul ou de type invalide : ignore.
+!
+.IGES_1045
+ Deux entites consecutives sont identiques (rang :%d) : une seule est convertie.
+!
+.IGES_1050
+ La courbe %dD a ete inversee.
+!
+.IGES_1051
+ Toutes le courbes %dD avant le rang %d ont ete inversees.
+!
+.IGES_1055
+ La courbe %dD de rang %d etait legerement deconnectee : reparee.
+!
+.IGES_1060
+ La courbe %dD de rang %d est trop deconnectee : reparee.
+!
+.IGES_1061
+ La surface est converti en TopoDS_Shell pour des problemes de continuite : entite ignoree.
+!
+.IGES_1062
+ Le cas des CurveOnSurface sur Composite Surface n'est pas implemente : la representation 3D est retournee.
+!
+.IGES_1066
+ Erreur de conversion sur la surface support de la courbe.
+!
+.IGES_1070
+ Les representations sont inconstante dans le fichier : Recomputation from %dD.
+!
+.IGES_1090
+ La courbe s'auto-intersectait : reparee.
+!
+.IGES_1095
+ Les representations 2D et 3D des courbes sont invalides : entite ignoree.
+!
+.IGES_1100
+ parameter data : le parametre 2 (Offset Distance Flag) est different de 1 : cas non implemente.
+!
+.IGES_1105
+ Le parametre de fin est hors de la courbe : entite ignoree.
+!
+.IGES_1110
+ Erreur de transfert sur la courbe de base : entite ignoree.
+!
+.IGES_1115
+ Courbe de continuite C0, ne peut etre decoupee en Geom_SplineCurve C1 plus petite que Precision::Confusion().
+!
+.IGES_1120
+ Courbe de continuite C0, a ete decoupe en Geom_BSplineCurve continue C1.
+!
+.IGES_1125
+ Parameter data : le parametre 1 (Type of Bounded Surface Representation) vaut 0 : cas non implemente.
+!
+.IGES_1130
+ Boundary sur Composite Surface : cas non implemente.
+!
+.IGES_1135
+ La representation %dD de la courbe n'est pas definie : calculee a partir de la representation %dD.
+! 2D curve representation is not defined : computed from 3D curve representation.
+!
+.IGES_1140
+ Erreur pendant la conversion de la courbe 3D : recalcul a partir de la courbe 2D.
+!
+.IGES_1145
+ Erreur pendant la conversion de la courbe %dD : recalcul a partir de la representation %dD.
+! error during 2D curve transfer : recomputed from 3D.
+!
+.IGES_1150
+ %s trop deconnecte :recalcul a partir de la representation %dD.
+! 2D TopoDS_Wire too disconnected :recomputed from 3D.
+!
+.IGES_1155
+ Parameter data : (parametres 1 to 6) les coefficients ne satisfont pas a l'equation d'une conique.
+!
+.IGES_1156
+ La conversion de %s %s a echoue : Entite ignoree.
+! (type IGES) (DE:Number) transfer failed : Entity skipped.
+!
+.IGES_1160
+ Parameter data (Parametres 8 to 11) : Les coordonnees de debut et de fin de l'arc sont les memes : entite non bornee.
+!
+.IGES_1165
+ La transformation n'est pas plane : non appliquee.
+!
+.IGES_1170
+L'equation polynomiale est incorrecte.
+!
+.IGES_1175
+ Erreur pendant la creation des points de controle.
+!
+.IGES_1180
+ Parameter data : le parametre 1 (Spline Type >3) : cas non implemente.
+!
+.IGES_1190
+ Parameter data : le parametre 2 (Degree of basis functions ) est plus petit que 0 ou plus grand que maxdegree : conversion interrompue.
+!
+.IGES_1195
+ Parameter data : nombre incorrect de points de controle (au moins deux points sont requis).
+!
+.IGES_1200
+ Erreur de conversion : %s multiplicite initiale > degre %s +1.
+!
+.IGES_1201
+ Erreur de conversion : %s multiplicite finale > degre %s +1.
+!
+.IGES_1210
+ La somme des %s multiplicites n'est pas egale a la somme (nombre de poles + %s degre +1).
+!
+.IGES_1215
+ Parameter data : des parametres de poids ne sont pas reels positifs : entite ignoree.
+!
+.IGES_1220
+ La %s BSpline rationelle est en fait polynomiale.
+!
+.IGES_1221
+ La surface est fait periodique.
+!
+.IGES_1225
+ Les points de depart et d'arrivee sont les memes.
+!
+! 1230 is the same as 1195
+!
+.IGES_1235
+ La courbe est trop courte pour etre convertie : entite ignoree.
+!
+.IGES_1240
+ Vecteur inutile pour cette forme : ignore.
+!
+.IGES_1250
+ La Geom_Surface resultante est continue C0.
+!
+.IGES_1255
+ Le reglage a echoue : entite ignoree.
+!
+.IGES_1265
+ La surface de base n'est pas continue C0 : construction de l'offset surface impossible.
+!
+.IGES_1266
+ La surface de base est continue C0 et ne peut pas etre corrigee en continue C1.
+!
+.IGES_1267
+ La surface de base est continue C0 mais a ete corrigee en continue C1.
+!
+.IGES_1270
+ La surface de base est continue C0 et a ete convertie en TopoDS_Shell : seule la premiere face sera decalee.
+!
+.IGES_1275
+ Model Space Representation 0 cas no implemente : le resultat est la surface de base.
+!
+.IGES_1280
+ Direction invalide: entite ignoree.
+!
+.IGES_1285
+ Parameter data : le pointeur %d de la liste d'entite fille est nul ou negatif : ignore.
+!
+.IGES_1295
+ Le trou %d et le plan ne sont pas coplanaires.
+!
+.IGES_1300
+ La courbe contour est invalide : le plan n'est pas borne.
+!
+.IGES_1305
+ Parameter data : parametre 3 or 4 (nombre de segments) est inferieur a 1.
+!
+.IGES_1306
+ Type invalide pour la courbe numero %d.
+
+.IGES_1310
+ Parameter data : le parametre 3 or 4 (degree of basis function) est inferieur a 1 ou superieur a max degree.
+!
+.IGES_1325
+ Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
+!
+.IGES_1345
+ Parameter data : le parametre %d (parameter space curve) est incorrect.
+!
+.IGES_1360
+ Le TopoDS_Shell resultat n'est pas ferme.
+!
+.IGES_1365
+ Numero d'edge invalide %d.
+!
+.IGES_1370
+ Arete de couture manquante, ajoutee
+!
+.IGES_1371
+ TopoDS_Face creee avec bords naturels
+!
+.IGES_1372
+ Un ou plusieurs TopoDS_Wire(s) sur TopoDS_Face inverse(s)
+!
+.IGES_1373
+ Knots are not in ascending order
+!
+.IGES_1374
+ Difference between weights is too big.
+!
+!
+!
+!
+! Trace File messages
+.IGES_2000
+Diagnostics sur la conversion du fichier IGES : %s
+!
+.IGES_2005
+Niveau de trace : %d
+
+!
+.IGES_2010
+Debut de l'analyse du fichier IGES.
+!
+.IGES_2015
+Nombre de warning pendant l'analyse : %d.
+!
+.IGES_2020
+Nombre de fail pendant l'analyse : %d.
+!
+.IGES_2025
+Fin de l'analyse du fichier (Temps ecoule : %s).
+
+!
+.IGES_2030
+Debut de la conversion de donnees.
+!
+.IGES_2031
+Le fichier n'a pas ete charge en memoire.
+
+!
+.IGES_2032
+L'entite IGES %d n'existe pas.
+
+!
+.IGES_2035
+read.precision.mode : %d
+!
+.IGES_2040
+read.precision.val : %f
+!
+.IGES_2045
+read.iges.bspline.continuity : %d
+!
+.IGES_2050
+read.surfacecurve.mode : %d
+
+!
+.IGES_2055
+Nombre de warnings pendant la conversion : %d.
+!
+.IGES_2060
+Nombre de fails pendant la conversion : %d
+!
+.IGES_2065
+Fin de la conversion des donnees (Temps ecoule : %s).
+!
+.IGES_2070
+Conversion de l'entite IGES DE:%d Type:%d
+!
+.IGES_2075
+
+Resultat : %s.
+!
+.IGES_2076
+Pas de TopoDS_Shape resultat.
+
+!Messages pour TPSTAT.
+.IGES_3000
+********************************************************************************
+.IGES_3005
+Statistiques generale de conversion :
+!
+.IGES_3010
+ Nombre d'entites IGES selectionnees : %d
+!
+.IGES_3011
+ Nombre d'entites IGES racines : %d
+!
+.IGES_3015
+ Nombre de Shapes CasCade produites : %d
+!
+.IGES_3020
+ Nombre de warnings : %d
+!
+.IGES_3025
+ Nombre de fails : %d
+!
+.IGES_3030
+Nombre W/F Type Forme Message affecte
+------ --- ---- ----- ---------------
+!
+.IGES_3035
+Sur les entites IGES (DE) :
+!
+.IGES_3040
+Compte des shapes CasCade resultat
+
+!
+.IGES_3045
+
+Nombre Shapes CasCade
+------ --------------
+!
+.IGES_3050
+Mapping de toutes les entites IGES
+.IGES_3055
+
+Type Forme Nombre Shapes CasCade
+---- ----- ------ --------------
+!
+!
+!
+!
+! Debug messages
+.IGES_10005
+Little edge removed
+.IGES_10010
+Degenerated edge detected
+.IGES_10015
+Small lacking edge inserted
+!
+!
+.IGES_10020
+ Null area wire was detected, wire skipped.
--- /dev/null
+!LOADING PHASE
+.XSTEP_1
+Beginning of IGES file memory loading.
+!
+.XSTEP_2
+IGES file opening error.
+!
+.XSTEP_3
+Reason : No such file or directory.
+!
+.XSTEP_4
+Reason : Not enough space.
+!
+.XSTEP_5
+Reason : Permission denied.
+!
+.XSTEP_6
+Reason : Too many open files.
+!
+.XSTEP_7
+Reason : No determined.
+!
+.XSTEP_8
+End of loading IGES file to memory (Elapsed time : %s).
+
+!
+.XSTEP_9
+Beginning of IGES file reading.
+!
+.XSTEP_10
+End of IGES file reading.
+!
+.XSTEP_11
+Internal error during file header reading. Process continues.
+!
+.XSTEP_12
+Header and content of IGES file are loaded.
+!
+.XSTEP_13
+Internal error during reading of entity %d.
+!
+.XSTEP_14
+Internal error during reading of entity %d (parameter %d).
+!
+.XSTEP_15
+Total number of loaded entities %d.
+!
+.XSTEP_16
+Beginning of model loading.
+!
+.XSTEP_17
+End of model loading.
+!
+.XSTEP_18
+Syntax error in IGES file at line %d in section %s.
+!
+.XSTEP_19
+Syntax error in IGES file at line %d in section %s (line number may be incorrect).
+!
+.XSTEP_20
+There is no Terminate Section, please check end of IGES file. Process continues.
+!
+.XSTEP_21
+Number of ignored Null Entities : %d.
+!
+.XSTEP_22
+ Unknown entity %s.
+!
+.XSTEP_23
+ Recovered entity %s.
+!
+.XSTEP_24
+Report : %d unknown entities.
+!
+.XSTEP_25
+Number of fails in memory loading : %d.
+!
+.XSTEP_26
+Number of warnings in memory loading : %d.
+!
+.XSTEP_27
+ Directory Entry : there is no parameter. Process continues.
+!
+.XSTEP_28
+ Directory Entry : parameter 1 (entity type) is incorrect.
+!
+.XSTEP_29
+ Directory Entry : Field 4 (Line Font Pattern) is incorrect (Non null pointer or Integer between 0 and 5 was expected).
+!
+.XSTEP_30
+ Directory Entry : Field 5 (Level) isincorrect (Not null pointer or not null Integer was expected).
+!
+.XSTEP_31
+ Directory Entry : Field 6 (View) is incorrect (Not null pointer or Integer Zero was expected).
+!
+.XSTEP_32
+ Directory Entry : Field 7 (Transformation Matrix) is incorrect (Not null pointer or Integer Zero was expected).
+!
+.XSTEP_33
+ Directory Entry : Field 8 (Label Display Associativity) is incorrect (Not null pointer or Integer Zero was expected).
+!
+.XSTEP_34
+ Directory Entry : Field 13 (Color Number) is incorrect (Not null pointer or Integer between 0 and 8 was expected).
+!
+.XSTEP_35
+ Null entity %s.
+!
+.XSTEP_36
+ Unknown entity %s.
+!
+.XSTEP_37
+ Associativity list is incorrect.
+!
+.XSTEP_38
+ Property list is incorrect.
+! ANALYSIS PHASE
+.XSTEP_39
+Global Section : Incorrect number of parameters (%d or %d parameters were expected).
+!
+.XSTEP_40
+Global Section (Parameters 1 and 2) : Parameter Delimiter Character and Record Delimiter Character must not have the same value.
+!
+.XSTEP_41
+Global Section (Parameter 2) : Parameter Delimiter Character is incorrect. Default character comma taken.
+!
+.XSTEP_42
+Global Section (Parameter 2) : Character Record Delimiter parameter is incorrect. Default character Semicolon taken.
+!
+.XSTEP_43
+Global Section (Parameter 8) : Single Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 38 taken.
+!
+.XSTEP_44
+Global Section (Parameter 9) : Single Precision Significance parameter is incorrect (Expected positive Integer). Default value 6 taken.
+!
+.XSTEP_45
+Global Section (Parameter 10) : Double Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 308 taken.
+!
+.XSTEP_46
+Global Section (Parameter 11) : Double Precision Significance parameter is incorrect (Expected positive Integer). Default value 15 taken.
+!
+.XSTEP_47
+Global Section (Parameter 13) : Model Space Scale parameter is incorrect (Expected positive Real). Default value 1.0 taken.
+!
+.XSTEP_48
+Global Section (Parameter 14) : Unit Flag parameter is incorrect (Integer between 1 et 11 was expected). Default value 2 taken : Millimeters.
+!
+.XSTEP_49
+Global Section (Parameter 15): Unit Name parameter is not recognized. Default value 2 taken : Millimeters.srl
+!
+.XSTEP_50
+Global Section (Parameter 15) : Unit Name parameter is undefined : Unit Name ignored.
+!
+.XSTEP_51
+Global Section (Parameter 14 and 15) : Unit Flag parameter does not correspond to Unit Name parameter : Unit Name ignored.
+!
+.XSTEP_52
+Global Section (Parameter 19) : (Expected positive Real). Default value 0.0 taken.
+!
+.XSTEP_53
+Global Section (Parameter 23) : Version Flag parameter is incorrect (Integer between 1 et 11 was expected. Default value 3 taken : Version 2.0.
+!
+.XSTEP_54
+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.
+!
+.XSTEP_55
+Global Section (Parameter 25) : Last Change Date parameter is undefined.
+!
+.XSTEP_56
+Global Section (Parameter %d) : Date parameter is undefined.
+!
+.XSTEP_57
+Global Section (Parameter %d) : Incorrect Date Format.
+!
+.XSTEP_58
+ Directory Entry (Field 1) : entity type number field is incorrect (Expected Integer : %d).
+!
+.XSTEP_59
+ Directory Entry (Field 3) : Structure field is undefined.
+!
+.XSTEP_60
+ Directory Entry (Field 4) : Line Font Pattern field is incorrect (Pointer or Integer between 0 and 5 was expected). Default value 0 taken.
+!
+.XSTEP_61
+ Directory Entry (Field 5) : Level field is incorrect (Pointer or Integer were expected). Default value 0 taken.
+!
+.XSTEP_62
+ Directory Entry (Field 6) : View field is incorrect (Pointer or Zero were expected). Default value 0 taken.
+!
+.XSTEP_63
+ Directory Entry (Field 7): Transformation Matrix field is incorrect (Pointer or Zero were expected). Default value 0 taken.
+!
+.XSTEP_64
+ Directory Entry (Field 8): Label Display entity field is incorrect (Pointer or Zero were expected). Default value 0 taken.
+!
+.XSTEP_65
+ Directory Entry (Field 9) : Blank Status field is incorrect (Expected Integer : 0 or 1).
+!
+.XSTEP_66
+ Directory Entry (Field 9) : Subordinate entity Switch field is incorrect (Integer between 0 and 3 was expected).
+!
+.XSTEP_67
+ Directory Entry (Field 9) : entity Use Flag is incorrect (Integer between 0 and 6 was expected).
+!
+.XSTEP_68
+ Directory Entry (Field 9) : Hierarchy field is incorrect (Integer between 0 and 2 was expected).
+!
+.XSTEP_69
+ Directory Entry (Field 12) : Line Weight Number is undefined.
+!
+.XSTEP_70
+ Directory Entry (Field 13) : Color Number field is incorrect (Pointer or Integer between 0 and 8 was expected).
+!
+.XSTEP_71
+ Directory Entry (Field 15) : Form Number field is incorrect.
+!
+.XSTEP_72
+ Directory Entry (Field 19): entity Subscript Number field is incorrect (Integer was expected).
+!Type 116
+.XSTEP_73
+Parameter Data : parameter %d (Coordinate of Point) is incorrect (Real was expected).
+!Type 116
+.XSTEP_74
+Parameter Data : parameter %d (Display Symbol) is incorrect (Subfigure Definition entity, Type 308 was expected).
+!Type 100
+.XSTEP_75
+Parameter Data : parameter 1 (ZT displacement of Arc) is incorrect (Real was expected).
+!Type 100
+.XSTEP_76
+Parameter Data : parameter %d (Arc Center) is incorrect (Real was expected).
+!Type 100
+.XSTEP_77
+Parameter Data : parameter %d (Start Point) is incorrect (Real was expected).
+!Type 100
+.XSTEP_78
+Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
+!Type 102
+.XSTEP_79
+Parameter Data : parameter 1 (Number of Entities) is incorrect : %d (Expected positive Integer).
+!Type 102
+.XSTEP_80
+Parameter Data : Some pointers in entity list are null or negative : ignored (Point, Connect Point or Parameterized Curve Entities were expected).
+!Type 104
+.XSTEP_81
+Parameter Data : parameter %d (Conic Coefficient) is incorrect (Real was expected).
+!Type 104
+.XSTEP_82
+Parameter Data : parameter 7 (Coordinate of Plane) is incorrect (Real was expected).
+!Type 104
+.XSTEP_83
+Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).
+!Type 104
+.XSTEP_84
+Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
+!Type 106
+.XSTEP_85
+Parameter Data : parameter 1 (Interpretation Flag) is incorrect (Expected Integer : %d).
+!Type 106
+.XSTEP_86
+Parameter Data : parameter 2 (Number of n-tuples) is incorrect (Expected positive Integer).
+!Type 106
+.XSTEP_87
+Parameter Data : parameter 3 (Common Z Displacement) is incorrect (Real was expected).
+!Type 106
+.XSTEP_88
+Parameter Data : not all Data Point parameters are of Real type.
+!Type 110
+.XSTEP_89
+Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).
+!Type 110
+.XSTEP_90
+Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
+!Type 112
+.XSTEP_91
+Parameter Data : parameter 1 (Spline Type) is incorrect (Integer between 1 and 6 was expected).
+!Type 112
+.XSTEP_92
+Parameter Data (Parameter 2) : parameter 2 (Degree of Continuity) is incorrect (Expected Integer).
+!Type 112
+.XSTEP_93
+Parameter Data : parameter 3 (Number of Dimensions) is incorrect (Expected Integer : 2 or 3).
+!Type 112
+.XSTEP_94
+Parameter Data : parameter 4 (Number of Segments) is incorrect (Expected positive Integer).
+!Type 112
+.XSTEP_95
+Parameter Data : not all Break Point parameters are of Real type.
+!Type 112
+.XSTEP_96
+Parameter Data : entity is planar but parameters BZ, CZ. DZ are not null.
+!Type 126
+.XSTEP_97
+Parameter Data : parameter %d (Upper Index of Sum) is incorrect (Expected positive Integer).
+!Type 126
+.XSTEP_98
+Parameter Data : parameter %d (Degree of Basis Functions) is incorrect (Expected Integer) : Default value 0 taken.
+!Type 126
+.XSTEP_99
+Parameter Data : parameter %d (Planar/Non Planar Flag) is incorrect (Expected Boolean).
+!Type 126
+.XSTEP_100
+Parameter Data : parameter %d (Open/Closed Flag) is incorrect (Expected Boolean).
+!Type 126
+.XSTEP_101
+Parameter Data : parameter %d (Rational/Polynomial Flag) is incorrect (Expected Boolean).
+!Type 126
+.XSTEP_102
+Parameter Data : parameter %d (NonPeriodic/Periodic Flag) is incorrect (Expected Boolean).
+!Type 126
+.XSTEP_103
+Parameter Data : not all Knot Sequence parameters are of Real type.
+!Type 126
+.XSTEP_104
+Parameter Data : not all Weight parameters are of positive Real type.
+!Type 126
+.XSTEP_105
+Parameter Data : parameter %d (Control Point) is incorrect (Real was expected).
+!Type 126
+.XSTEP_106
+Parameter Data : parameter %d (Starting Value) is incorrect (Real was expected).
+!Type 126
+.XSTEP_107
+Parameter Data : parameter %d (Ending Value) is incorrect (Real was expected).
+!Type 126
+.XSTEP_108
+Parameter Data : parameter %d (Unit Normal) is incorrect (Real was expected).
+!Type 126
+.XSTEP_109
+Parameter Data : parameter %d (Unit Normal) is undefined for a planar curve.
+!Type 130
+.XSTEP_110
+Parameter Data : parameter 1 (Curve entity to be offset) is incorrect (Curve entity was expected).
+!Type 130
+.XSTEP_111
+Parameter Data : parameter 2 (Offset Distance Flag) is incorrect (Integer between 1 and 3 was expected).
+!Type 130
+.XSTEP_112
+Parameter Data : parameter 3 (Curve entity whose coordinate describes offset) is incorrect (Curve entity was expected).
+!Type 130
+.XSTEP_113
+Parameter Data : parameter 4 (Particular Coordinate) is incorrect (Expected Integer).
+!Type 130
+.XSTEP_114
+Parameter Data : parameter 5 (Tapered Offset Type Flag) is incorrect (Expected Integer).
+!Type 130
+.XSTEP_115
+Parameter Data : parameter 6 (First Offset distance) is incorrect (Real was expected).
+!Type 130
+.XSTEP_116
+Parameter Data : parameter 7 (Arc Length of First Offset Distance) is incorrect (Real was expected).
+!Type 130
+.XSTEP_117
+Parameter Data : parameter 8 (Second Offset Distance) is incorrect (Real was expected).
+!Type 130
+.XSTEP_118
+Parameter Data : parameter 9 (Arc Length of Second Offset Distance) is incorrect (Real was expected).
+!Type 130
+.XSTEP_119
+Parameter Data : parameter 13 (Offset Curve Starting Parameter Value) is incorrect (Real was expected).
+!Type 130
+.XSTEP_120
+Parameter Data : parameter 14 (Offset Curve Ending Parameter Value) is incorrect (Real was expected).
+!Type 130
+.XSTEP_121
+Parameter Data : parameter %d (Unit Vector Normal to plane) is incorrect (Real was expected).
+!Type 141
+.XSTEP_122
+Parameter Data : parameter 1 (Type of Bounded Surface Representation) is incorrect (Expected Integer : 0 or 1).
+!Type 141
+.XSTEP_123
+Parameter Data : parameter 2 (Trimming Curves Representation) is incorrect (Integer between 0 and 3 was expected).
+!Type 141
+.XSTEP_124
+Parameter Data : parameter 3 (Untrimmed Surface) is incorrect (Untrimmed Surface entity was expected).
+!Type 141
+.XSTEP_125
+Parameter Data : Not parametric Surface %d (parameter 3).
+!Type 141
+.XSTEP_126
+Parameter Data : parameter 4 (Number of Curves) is incorrect (Expected positive).
+!Type 141
+.XSTEP_127
+Parameter Data : parameter 5 (Model Space Curve) is incorrect (Curve entity was expected).
+!Type 141
+.XSTEP_128
+Parameter Data (Parameter 6) : Orientation Flag parameter is incorrect (Expected Integer : 1 or 2).
+!Type 141
+.XSTEP_129
+Parameter Data : parameter 7 (Number of Associated Parameter Space Curves) is incorrect (Expected Integer : 0).
+!Type 141
+.XSTEP_130
+Parameter Data : Some pointers in Parameter Space Curve list are null or negative : ignored (Curve Entities were expected).
+!Type 142
+.XSTEP_131
+Parameter Data : parameter 2 (Surface on which the curve lies) is incorrect (Surface entity was expected).
+!Type 142
+.XSTEP_132
+Parameter Data : parameter 3 (Curve 2D) is incorrect (Curve entity was expected).
+!Type 142
+.XSTEP_133
+Parameter Data : parameter 4 (Curve 3D) is incorrect (Curve entity was expected).
+!Type 142
+.XSTEP_134
+Parameter Data : pointers of Curve 2D and 3D are null (parameter 3 and 4) (Curve Entities were expected).
+!Type 108
+.XSTEP_135
+Parameter Data : parameter %d (Coefficient Of Plane) is incorrect (Real was expected).
+!Type 108
+.XSTEP_136
+Parameter Data : parameter 5 (Closed Curve) is incorrect (Curve entity was expected).
+!Type 108
+.XSTEP_137
+Parameter Data : parameter 5 (Null pointer in Form Number 0 was Expected).
+!Type 108
+.XSTEP_138
+Parameter Data : parameter 9 (Display Symbol Size) is incorrect (Real was expected).
+!Type 108
+.XSTEP_139
+Parameter Data : parameter %d (Coordinate of Display Symbol) is incorrect (Real was expected).
+!Type 114
+.XSTEP_140
+Parameter Data : parameter 1 (Spline Boundary Type) is incorrect (Integer between 1 and 6 was expected).
+!Type 114
+.XSTEP_141
+Parameter Data : parameter 3 (Number of U Segments) is incorrect (Expected positive Integer).
+!Type 114
+.XSTEP_142
+Parameter Data : parameter 4 (Number of V Segments) is incorrect (Expected positive Integer).
+!Type 114
+.XSTEP_143
+Parameter Data : not all Breakpoints in U parameters are of Real type.
+!Type 114
+.XSTEP_144
+Parameter Data : not all Breakpoints in V parameters are of Real type.
+!Type 114
+.XSTEP_145
+Parameter Data : not all %s Coefficient of Patch parameter(s) are of Real type.
+!Type 114
+.XSTEP_146
+Parameter Data : parameter %d (Last Z Coefficient of Patch) is incorrect.
+!Type 114
+.XSTEP_147
+Parameter Data : %s Coefficient of Patch parameters are incorrect (Expected Integer : 16).
+!Type 118
+.XSTEP_148
+Parameter Data : parameter 1 (First Curve) is incorrect.
+!Type 118
+.XSTEP_149
+EParameter Data : parameter 2 (Second Curve) is incorrect.
+!Type 118
+.XSTEP_150
+Parameter Data : parameter 3 (Direction Flag) is incorrect (Integer 0 or 1 was expected).
+!Type 118
+.XSTEP_151
+Parameter Data : parameter 4 (Developable Surface Flag) is incorrect (Integer 0 or 1 was expected).
+!Type 120
+.XSTEP_152
+Parameter Data : parameter 1 (Axis of Revolution) is incorrect.
+!Type 120
+.XSTEP_153
+Parameter Data : parameter 2 (Generatrix entity) is incorrect.
+!Type 120
+.XSTEP_154
+Parameter Data : parameter 3 (Start Angle) is incorrect.
+!Type 120
+.XSTEP_155
+Parameter Data : parameter 4 (Terminate Angle) is incorrect.
+!Type 122
+.XSTEP_156
+Parameter Data : parameter 1 (Generatrix entity) is incorrect.
+!Type 122
+.XSTEP_157
+Parameter Data : parameter %d (Coordinate of Terminate Point) is incorrect.
+!Type 128
+.XSTEP_158
+Parameter Data : Incorrect Additional value.
+!Type 128
+.XSTEP_159
+Parameter Data : Additional Real value : ignored.
+!Type 128
+.XSTEP_160
+Parameter Data : Invalid Number in First Knots sequence.
+!Type 128
+.XSTEP_161
+Parameter Data : Invalid Number in Second Knots sequence.
+!Type 140
+.XSTEP_162
+Parameter Data : parameter %d (Coordinate of Offset Indicator) is incorrect.
+!Type 140
+.XSTEP_163
+Parameter Data : parameter 4 (Offset Distance) is incorrect.
+!Type 140
+.XSTEP_164
+Parameter Data : parameter 5 (Surface entity to be offset) is incorrect.
+!Type 143
+.XSTEP_165
+Parameter Data : parameter 1 (Bounded Surface Representation type) is incorrect (Integer 0 or 1 was expected).
+!Type 143
+.XSTEP_166
+Parameter Data : parameter 2 (Surface entity to be bounded) is incorrect.
+!Type 143
+.XSTEP_167
+Parameter Data : parameter 3 (Number of Boundary entities) is incorrect.
+!Type 143
+.XSTEP_168
+Parameter Data : parameter %d (Boundary entity) is incorrect.
+!Type 144
+.XSTEP_169
+Parameter Data : parameter 1 (Surface to be trimmed) is incorrect.
+!Type 144
+.XSTEP_170
+Parameter Data : parameter 2 (Outer Boundary type) is incorrect (Integer 0 or 1 was expected).
+!Type 144
+.XSTEP_171
+Parameter Data : parameter 3 (Number of Inner Boundary Closed Curves) is incorrect (Expected positive Integer).
+!Type 144
+.XSTEP_172
+Parameter Data : parameter 4 (Outer Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).
+!Type 144
+.XSTEP_173
+Parameter Data : parameter %d (Inner Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).
+!Type 190
+.XSTEP_174
+Parameter Data : parameter 1 (Point on Surface) is incorrect (Point entity, Type 116 was expected).
+!Type 190
+.XSTEP_175
+Parameter Data : parameter 2 ( Surface Normal Direction) is incorrect (Direction entity was expected).
+!Type 190
+.XSTEP_176
+Parameter Data : parameter 3 (Reference Direction) is incorrect (Direction entity was expected).
+!Type 190
+.XSTEP_177
+Parameter Data : parameter 3 (Null pointer was expected when Form Number field is 1).
+!Type 186
+.XSTEP_178
+Parameter Data : parameter 1 (Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).
+!Type 186
+.XSTEP_179
+Parameter Data : parameter %d (Void Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).
+!Type 186
+.XSTEP_180
+Parameter Data : parameter %d (Orientation Flag) is incorrect (Expected Boolean).
+!Type 186
+.XSTEP_181
+Parameter Data : parameter 3 (Number of Void Shells) is incorrect (Expected positive Integer)
+!Type 502
+.XSTEP_182
+Parameter Data : parameter 1 (Number of Vertex Tuples) is incorrect (Expected positive Integer).
+!Type 502
+.XSTEP_183
+Parameter Data : parameter %d (Coordinate of Vertex) is incorrect (Real was expected).
+!Type 504
+.XSTEP_184
+Parameter Data : parameter 1 (Number of Edge Tuples) is incorrect (Expected positive Integer).
+!Type 504
+.XSTEP_185
+Parameter Data : parameter 2 (Model Space Curve) is incorrect (Curve entity was expected).
+!Type 504
+.XSTEP_186
+Parameter Data : parameter %d (Start Vertex Index) is incorrect (Expected Integer).
+!Type 504
+.XSTEP_187
+Parameter Data : parameter %d (Terminate Vertex Index) is incorrect (Expected Integer).
+!Type 504
+.XSTEP_188
+ Parameter Data : parameter %d (Start Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).
+!Type 504
+.XSTEP_189
+ Parameter Data : parameter %d (Terminate Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).
+!Type 508
+.XSTEP_190
+Parameter Da ta : parameter %d (Edge Type) is incorrect (Integer 0 or 1 was expected).
+!Type 508
+.XSTEP_191
+Parameter Data : parameter %d (List Index) is incorrect (Expected Integer).
+!Type 508
+.XSTEP_192
+Parameter Data : parameter %d (Number of Parameter Curves) is incorrect (Expected positive Integer).
+!Type 508
+.XSTEP_193
+Parameter Data : parameter %d (Vertex or Edge List entity) is incorrect (Vertex List or Edge List entity, Type 502 or 504 was expected).
+!Type 508
+.XSTEP_194
+Parameter Data : parameter %d (Parameter Space Curve) is incorrect (Curve entity was expected).
+!Type 508
+.XSTEP_195
+Parameter Data : parameter %d (Isoparametric Flag) is incorrect (Expected Boolean).
+!Type 510
+.XSTEP_196
+Parameter Data : parameter 1 (Surface) is incorrect.
+!Type 510
+.XSTEP_197
+Parameter Data : parameter 2 (Number of Loops) is incorrect (Expected positive Integer).
+!Type 510
+.XSTEP_198
+Parameter Data : parameter 3 (Outer Loop flag) is incorrect (Expected Boolean).
+!Type 510
+.XSTEP_199
+Parameter Data : parameter %d (Loop of the Face) is incorrect (Loop entity, Type 508 was expected).
+!Type 514
+.XSTEP_200
+Parameter Data : parameter 1 (Number of Faces) is incorrect (Expected positive Integer).
+!Type 514
+.XSTEP_201
+Parameter Data : parameter 2 (Face) is incorrect (Face entity, Type 510 was expected).
+!Type 402, Form 1 or 7
+.XSTEP_202
+Form %d : Parameter Data : parameter 1 (Number of Entries) is incorrect (expected positive integer).
+!Type 402, Form 1 or 7
+.XSTEP_203
+Form %d : Parameter Data : some pointers of entity list are null or negative : ignored (Entities were expected).
+!Type 402
+.XSTEP_204
+Form 9 : Parameter Data : parameter 1 (Number of Parent entity) is incorrect (Expected Integer : 1).
+!Type 402
+.XSTEP_205
+Form 9 : Parameter Data : parameter 2 (Number of Children) is incorrect (expected positive integer).
+!Type 402
+.XSTEP_206
+Form 9 : Parameter Data : parameter 3 (Parent entity) is incorrect (entity expected).
+!Type 402
+.XSTEP_207
+Form 9 : Parameter Data : some pointers in Child Entity List are null or negative : ignored (Entities were expected).
+!Type 308
+.XSTEP_208
+Parameter Data : parameter 1 (Depth of Subfigure) is incorrect (Expected Integer).
+!Type 308
+.XSTEP_209
+Parameter Data : parameter 2 (Subfigure Name) is incorrect : %s (Expected String in hollerith Form).
+!Type 308
+.XSTEP_210
+Parameter Data : parameter 3 (Number of Entities) is incorrect (Expected positive Integer).
+!Type 308
+.XSTEP_211
+Parameter Data : Some pointers of Associated entity List are null or negative : ignored (Entities were expected).
+!Type 408
+.XSTEP_212
+Parameter Data : parameter 1 (Subfigure definition entity) is incorrect (Subfigure definition entity, Type 308 expected).
+!Type 408
+.XSTEP_213
+Parameter Data : parameter %d (Translation data) is incorrect (Real was expected).
+!Type 408
+.XSTEP_214
+Parameter Data : parameter 5 (Scale Factor) is incorrect (Real was expected). Default value 1.0 taken.
+!Type 124
+.XSTEP_215
+Parameter Data : not all parameters are of Real type.
+!
+!ADDED MESSAGES
+.XSTEP_246
+ Parameter Data : parameter 4 (Number of segments) is less than 1.
+!
+!
+! DCE 6/11/98 Add in Load phase
+!
+.XSTEP_276
+Parameter Data : Parameter 1 (Curve creation mode) is invalid (integer expected).
+!
+.XSTEP_277
+Parameter Data : Parameter 5 (Representation preference) is invalid (integer expected).
+!
+.XSTEP_278
+Exception during loading entity %s
+!
+!
+!
+! ===================================================================
+!
+!
+!
+! New translation messages ( S3767 )
+!
+.IGES_1000
+ Entity %s has not been loaded into memory
+!
+.IGES_1001
+ Form %d : Not an implemented entity type : cannot transfer.
+!
+.IGES_1005
+ Software error : impossible entity transfer.
+!
+!.IGES_1006 same as 1015
+! exception raising during transfer.
+!
+.IGES_1010
+ Resulting TopoDS_Shape has not same 2D and 3D parametrization.
+!
+.IGES_1015
+ Software error : transfer interrupted !
+
+.IGES_1020
+ Parameter data : pointer %d in associated entity list is null or negative and ignored.
+!
+.IGES_1025
+ Transfer error on IGES entity %d : entity skipped.
+!
+.IGES_1030
+ Form %d: problems during translation some items in the group.
+!
+.IGES_1035
+ Transformation matrix is invalid : not applied.
+!
+.IGES_1036
+ Software error : entity skipped.
+!
+.IGES_1040
+ Parameter data : pointer %d in entity list is null or has an invalid type and ignored.
+!
+.IGES_1045
+ Two consecutives entities are identical (rank %d): only one is transferred.
+!
+.IGES_1050
+ %dD curve of rank %d was reversed.
+!
+.IGES_1051
+ All %dD curves before rank %d were reversed.
+!
+.IGES_1055
+ %dD curves of rank %d were slightly disconnected : repaired.
+!
+.IGES_1060
+ %dD curves of rank %d were too disconnected : entity skipped.
+!
+.IGES_1061
+ Surface is translated to TopoDS_Shell : entity skipped.
+!
+.IGES_1062
+ CurveOnSurface on Composite Surface case not implemented : 3D representation returned.
+!
+.IGES_1066
+ Transfer error on surface where curve lies.
+!
+.IGES_1070
+ Representations in file are inconsistent : recomputated from %dD.
+!
+.IGES_1090
+ Curve was slightly self-intersecting : repaired.
+!
+.IGES_1095
+ 3D and 2D curve representations are invalid : entity skipped.
+!
+.IGES_1100
+ Parameter data : value of parameter 2 (Offset Distance Flag) is not 1 : case not implemented.
+!
+.IGES_1105
+ Ending parameter is beyond end of curve : entity skipped.
+!
+.IGES_1110
+ Transfer error on basic curve : entity skipped.
+!
+.IGES_1115
+ With C0 continuity can not be split into Geom_BSplineCurve C1 lower than Precision::Confusion().
+!
+.IGES_1120
+ With C0 continuity was split into C1 continuity Geom_BSplineCurve.
+!
+.IGES_1125
+ Parameter data : parameter 1 (Type of Bounded Surface Representation = 0) : case not implemented.
+!
+.IGES_1130
+ Boundary on Composite Surface : case not implemented.
+!
+.IGES_1135
+ %dD curve representation is not defined : computed from %dD curve representation.
+! 2D curve representation is not defined : computed from 3D curve representation.
+!
+.IGES_1140
+ Error during 3D curve transfer : recomputed from 2D.
+!
+.IGES_1145
+ Error during %dD curve transfer : recomputed from %dD.
+! error during 2D curve transfer : recomputed from 3D.
+!
+.IGES_1150
+ %s too disconnected :recomputed from %dD.
+! 2D TopoDS_Wire too disconnected :recomputed from 3D.
+!
+.IGES_1155
+ Parameter data : (parameter 1 to 6) coefficients do not satisfy a conic equation.
+!
+.IGES_1156
+ %s %s transfer failed : entity skipped.
+! (type IGES) (DE:Number) transfer failed : entity skipped.
+!
+.IGES_1160
+ Parameter data (Parameters 8 to 11) : start and terminate coordinates of arc are the same : entity not trimmed.
+!
+.IGES_1165
+ Transformation is not planar : not applied.
+!
+.IGES_1170
+ Polynomial equation is incorrect.
+!
+.IGES_1175
+ Error during creation of control points.
+!
+.IGES_1180
+ Parameter data : parameter 1 (Spline Type >3) : case not implemented.
+!
+.IGES_1190
+ Parameter data : parameter 2 (Degree of basis functions) is lower than 0 or greater than max degree : transfer interrupted.
+!
+.IGES_1195
+ Parameter data : incorrect number of control points (2 or more are required).
+!
+.IGES_1200
+ %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.
+!
+.IGES_1201
+ %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.
+!
+.IGES_1210
+ Sum of %s multiplicities is not equal to sum (number of poles + %s degree +1).
+!
+.IGES_1215
+ Parameter data : some weight parameters are not of positive real type : entity skipped.
+!
+.IGES_1220
+ Rational BSpline %s is in fact polynomial.
+!
+.IGES_1221
+ Surface is made periodic.
+!
+.IGES_1225
+ Start and terminate points are the same.
+!
+! 1230 is the same as 1195
+!
+.IGES_1235
+ Curve is too small to be transferred : entity skipped.
+!
+.IGES_1240
+ Vector is not for this form : ignored.
+!
+.IGES_1250
+ Resulting Geom_Surface is C0-continuous.
+!
+.IGES_1255
+ Ruling failed : entity skipped.
+!
+.IGES_1265
+ Basis surface is not C0-continuous : offset surface construction impossible.
+!
+.IGES_1266
+ Basis surface is C0-continuous and cannot be corrected to C1-continuous.
+!
+.IGES_1267
+ Basis surface is C0-continuous but was corrected to C1-continuous.
+!
+.IGES_1270
+ Basis surface is C0-continuous and is transferred into a TopoDS_Shell. Only first face was offsetted.
+!
+.IGES_1275
+ Model Space Representation 0 case not implemented : result is a basis surface.
+!
+.IGES_1280
+ Invalid direction : entity skipped.constituent
+!
+.IGES_1285
+ Parameter data : pointer %d of child entity list is null or negative : skipped.
+!
+.IGES_1295
+ Hole %d and plane are not coplanar.
+!
+.IGES_1300
+ Bounding curve is invalid : plane is not trimmed.
+!
+.IGES_1305
+ Parameter data : parameter 3 or 4 (number of segments) is less than one.
+!
+.IGES_1306
+ Improper type for underlying curve number %d.
+
+.IGES_1310
+ Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.
+!
+.IGES_1325
+ Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
+!
+.IGES_1345
+ Parameter data : parameter %d (parameter space curve) is incorrect.
+!
+.IGES_1360
+ TopoDS_Shell is not closed.
+!
+.IGES_1365
+ Incorrect edge number %d.
+!
+.IGES_1370
+ Missing seam-edge was added
+!
+.IGES_1371
+ TopoDS_Face was created with natural bounds
+!
+.IGES_1372
+ One or more TopoDS_Wire(s) on TopoDS_Face was reversed
+!
+.IGES_1373
+ Knots are not in ascending order
+!
+.IGES_1374
+ Difference between weights is too big.
+!
+!
+!
+!
+! Trace File messages
+.IGES_2000
+Diagnostics for IGES file read : %s
+!
+.IGES_2005
+Trace level : %d
+
+!
+.IGES_2010
+Beginning of IGES file check.
+!
+.IGES_2015
+Number of warnings in check : %d.
+!
+.IGES_2020
+Number of fails in check : %d
+!
+.IGES_2025
+End of file check(Elapsed time : %s).
+!
+.IGES_2030
+Beginning of IGES data translation.
+!
+.IGES_2031
+File has not been loaded.
+
+!
+.IGES_2032
+IGES entity %d does not exist.
+
+!
+.IGES_2035
+read.precision.mode : %d
+!
+.IGES_2040
+read.precision.val : %f
+!
+.IGES_2045
+read.iges.bspline.continuity : %d
+!
+.IGES_2050
+read.surfacecurve.mode : %d
+
+!
+.IGES_2055
+Number of warnings in transfer : %d.
+!
+.IGES_2060
+Number of fails in transfer : %d
+!
+.IGES_2065
+End of IGES data translation (Elapsed time : %s).
+!
+.IGES_2070
+Translating IGES entity DE:%d Type:%d
+!
+.IGES_2075
+
+%s produced.
+!
+.IGES_2076
+No TopoDS_Shape produced.
+
+!Messages for TPSTAT.
+.IGES_3000
+********************************************************************************
+.IGES_3005
+General statistics for transfer :
+!
+.IGES_3010
+ Number of selected IGES entities : %d
+!
+.IGES_3011
+ Number of roots IGES entities : %d
+!
+.IGES_3015
+ Number of CasCade resulting Shapes : %d
+!
+.IGES_3020
+ Number of warnings : %d
+!
+.IGES_3025
+ Number of fails : %d
+!
+.IGES_3030
+Count W/F Type Form Message on IGES entity
+----- --- ---- ---- ----------------------
+!
+.IGES_3035
+On IGES entities (DE) :
+!
+.IGES_3040
+Count of CasCade resulting shapes
+
+!
+.IGES_3045
+
+Count CasCade Shapes
+----- --------------
+!
+.IGES_3050
+Mapping of all IGES entities
+.IGES_3055
+
+Type Form Count CasCade Shapes
+---- ---- ----- --------------
+!
+! Debug messages
+.IGES_10005
+ Small edge removed
+.IGES_10010
+ Degenerated edge detected
+.IGES_10015
+ Lacking edge inserted
+!
+!
+.IGES_10020
+ Null area wire was detected, wire skipped.
--- /dev/null
+srcinc:::IGES
+srcinc:::STEP
--- /dev/null
+
+! Resource file for data exchange ...
+!
+! For meaning of parameters refer to the end of the file
+
+! ==============================================================================
+!
+
+ToIGES.exec.op: DirectFaces
+
+FromIGES.exec.op : FixShape
+
+FromIGES.FixShape.Tolerance3d : &Runtime.Tolerance
+FromIGES.FixShape.MaxTolerance3d : &Runtime.MaxTolerance
+FromIGES.FixShape.MinTolerance3d : 1.e-7
+FromIGES.FixShape.FixFreeShellMode : -1
+FromIGES.FixShape.FixFreeFaceMode : -1
+FromIGES.FixShape.FixFreeWireMode : -1
+FromIGES.FixShape.FixSameParameterMode : -1
+
+FromIGES.FixShape.FixSolidMode : -1
+FromSTEP.FixShape.FixShellOrientationMode : -1
+FromIGES.FixShape.CreateOpenSolidMode : 1
+
+FromIGES.FixShape.FixShellMode : -1
+FromSTEP.FixShape.FixFaceOrientationMode : -1
+
+FromIGES.FixShape.FixFaceMode : -1
+FromIGES.FixShape.FixWireMode : -1
+FromIGES.FixShape.FixOrientationMode : -1
+FromIGES.FixShape.FixAddNaturalBoundMode : -1
+FromIGES.FixShape.FixMissingSeamMode : -1
+FromIGES.FixShape.FixSmallAreaWireMode : -1
+FromIGES.FixShape.RemoveSmallAreaFaceMode : -1
+FromIGES.FixShape.FixIntersectingWiresMode : -1
+FromIGES.FixShape.FixLoopWiresMode : -1
+FromIGES.FixShape.FixSplitFaceMode : -1
+FromIGES.FixShape.AutoCorrectPrecisionMode : 1
+FromIGES.FixShape.ModifyTopologyMode : 0
+FromIGES.FixShape.ModifyGeometryMode : 1
+FromIGES.FixShape.ClosedWireMode : 1
+FromIGES.FixShape.PreferencePCurveMode : 1
+FromIGES.FixShape.FixReorderMode : -1
+FromIGES.FixShape.FixSmallMode : -1
+FromIGES.FixShape.FixConnectedMode : -1
+FromIGES.FixShape.FixEdgeCurvesMode : -1
+FromIGES.FixShape.FixDegeneratedMode : -1
+FromIGES.FixShape.FixLackingMode : -1
+FromIGES.FixShape.FixSelfIntersectionMode : -1
+FromIGES.FixShape.RemoveLoopMode : -1
+FromIGES.FixShape.FixReversed2dMode : -1
+FromIGES.FixShape.FixRemovePCurveMode : -1
+FromIGES.FixShape.FixRemoveCurve3dMode : -1
+FromIGES.FixShape.FixAddPCurveMode : -1
+FromIGES.FixShape.FixAddCurve3dMode : -1
+FromIGES.FixShape.FixSeamMode : -1
+FromIGES.FixShape.FixShiftedMode : -1
+FromIGES.FixShape.FixEdgeSameParameterMode : 0
+FromIGES.FixShape.FixNotchedEdgesMode : -1
+FromIGES.FixShape.FixSelfIntersectingEdgeMode : -1
+FromIGES.FixShape.FixIntersectingEdgesMode : -1
+FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
+
+FromIGES.FixShape.FixVertexPositionMode : 0
+FromIGES.FixShape.FixVertexToleranceMode : -1
--- /dev/null
+
+! Resource file for data exchange ...
+!
+! For meaning of parameters refer to the end of the file
+
+! ==============================================================================
+!
+
+ToSTEP.exec.op : SplitCommonVertex,DirectFaces
+
+FromSTEP.exec.op : FixShape
+
+FromSTEP.FixShape.Tolerance3d : &Runtime.Tolerance
+FromSTEP.FixShape.MaxTolerance3d : &Runtime.MaxTolerance
+FromSTEP.FixShape.MinTolerance3d : 1.e-7
+FromSTEP.FixShape.FixFreeShellMode : -1
+FromSTEP.FixShape.FixFreeFaceMode : -1
+FromSTEP.FixShape.FixFreeWireMode : -1
+FromSTEP.FixShape.FixSameParameterMode : -1
+
+FromSTEP.FixShape.FixSolidMode : -1
+FromSTEP.FixShape.FixShellOrientationMode : -1
+FromSTEP.FixShape.CreateOpenSolidMode : 0
+
+FromSTEP.FixShape.FixShellMode : -1
+FromSTEP.FixShape.FixFaceOrientationMode : -1
+
+FromSTEP.FixShape.FixFaceMode : -1
+FromSTEP.FixShape.FixWireMode : -1
+FromSTEP.FixShape.FixOrientationMode : -1
+FromSTEP.FixShape.FixAddNaturalBoundMode : -1
+FromSTEP.FixShape.FixMissingSeamMode : -1
+FromSTEP.FixShape.FixSmallAreaWireMode : -1
+FromSTEP.FixShape.RemoveSmallAreaFaceMode : -1
+FromSTEP.FixShape.FixIntersectingWiresMode : -1
+FromSTEP.FixShape.FixLoopWiresMode : -1
+FromSTEP.FixShape.FixSplitFaceMode : -1
+FromSTEP.FixShape.AutoCorrectPrecisionMode : 1
+FromSTEP.FixShape.ModifyTopologyMode : 0
+FromSTEP.FixShape.ModifyGeometryMode : 1
+FromSTEP.FixShape.ClosedWireMode : 1
+FromSTEP.FixShape.PreferencePCurveMode : 1
+FromSTEP.FixShape.FixReorderMode : -1
+FromSTEP.FixShape.FixSmallMode : -1
+FromSTEP.FixShape.FixConnectedMode : -1
+FromSTEP.FixShape.FixEdgeCurvesMode : -1
+FromSTEP.FixShape.FixDegeneratedMode : -1
+FromSTEP.FixShape.FixLackingMode : -1
+FromSTEP.FixShape.FixSelfIntersectionMode : -1
+FromSTEP.FixShape.RemoveLoopMode : -1
+FromSTEP.FixShape.FixReversed2dMode : -1
+FromSTEP.FixShape.FixRemovePCurveMode : -1
+FromSTEP.FixShape.FixRemoveCurve3dMode : -1
+FromSTEP.FixShape.FixAddPCurveMode : -1
+FromSTEP.FixShape.FixAddCurve3dMode : -1
+FromSTEP.FixShape.FixSeamMode : -1
+FromSTEP.FixShape.FixShiftedMode : -1
+FromSTEP.FixShape.FixEdgeSameParameterMode : 0
+FromSTEP.FixShape.FixNotchedEdgesMode : -1
+FromSTEP.FixShape.FixTailMode : 0
+FromSTEP.FixShape.MaxTailAngle : 0
+FromSTEP.FixShape.MaxTailWidth : -1
+FromSTEP.FixShape.FixSelfIntersectingEdgeMode : -1
+FromSTEP.FixShape.FixIntersectingEdgesMode : -1
+FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
+
+FromSTEP.FixShape.FixVertexPositionMode : 0
+FromSTEP.FixShape.FixVertexToleranceMode : -1
--- /dev/null
+srcinc:::XmlOcaf.xsd
+srcinc:::XmlOcaf_SmallTypes.xsd
+srcinc:::XmlOcaf_TDataStd.xsd
+srcinc:::XmlOcaf_TDataStd_Name.xsd
+srcinc:::XmlOcaf_TDF.xsd
+srcinc:::XmlOcaf_TDocStd.xsd
+srcinc:::XmlOcaf_TFunction.xsd
+srcinc:::XmlOcaf_TNaming.xsd
+srcinc:::XmlOcaf_TNaming_NamedShape.xsd
+srcinc:::XmlOcaf_TPrsStd.xsd
+srcinc:::XmlXcaf.xsd
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+<include schemaLocation="XmlOcaf_SmallTypes.xsd"/>
+<include schemaLocation="XmlOcaf_TDataStd.xsd"/>
+<include schemaLocation="XmlOcaf_TDF.xsd"/>
+<include schemaLocation="XmlOcaf_TDocStd.xsd"/>
+<include schemaLocation="XmlOcaf_TFunction.xsd"/>
+<include schemaLocation="XmlOcaf_TNaming.xsd"/>
+<include schemaLocation="XmlOcaf_TPrsStd.xsd"/>
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of XmlOcaf Persistence format.
+ This Schema definition resides at: $(CASROOT)/src/XmlOcafResource/XmlOcaf.xsd
+ </documentation>
+</annotation>
+
+<complexType name="LabelType">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="ocaf:AbstractStringAtt"/>
+ <element ref="ocaf:AbstractIntegerAtt"/>
+ <element ref="ocaf:AbstractRealAtt"/>
+ <element ref="ocaf:AbstractListIntegerAtt"/>
+ <element ref="ocaf:AbstractListRealAtt"/>
+ <element ref="ocaf:AbstractAttribute"/>
+ <element ref="ocaf:AbstractXPathLabel"/>
+ <element ref="ocaf:AbstractList3RealAtt"/>
+ </choice>
+ <element name="label" type="ocaf:LabelType" minOccurs="0" maxOccurs="unbounded">
+<!-- This type of uniqueness does not allow recursive structures
+ <unique name="LabelUniqueness">
+ <selector xpath="ocaf:label"/>
+ <field xpath="@tag"/>
+ </unique> -->
+ </element>
+ </sequence>
+ <attribute name="tag" type="positiveInteger" use="required"/>
+</complexType>
+
+<!-- Declaration of document element +++++++++++++++++++++++++++ -->
+<element name="document">
+ <complexType>
+ <sequence>
+
+<!-- Declaration of element 'info' +++++++++++++++++++++++++++++ -->
+ <element name="info">
+ <complexType>
+ <sequence>
+ <element name="iitem" type="string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="date" type="date" use="required"/>
+ <attribute name="schemav" type="nonNegativeInteger" use="required"/>
+ <attribute name="DocVersion" type="nonNegativeInteger" use="required"/>
+ <attribute name="objnb" type="nonNegativeInteger" use="required"/>
+ </complexType>
+ </element> <!-- END 'info' -->
+
+<!-- Declaration of element 'comments' ++++++++++++++++++++++++++ -->
+ <element name="comments">
+ <complexType>
+ <sequence>
+ <element name="citem" type="string" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+ </element> <!-- END 'comments' -->
+
+<!-- Declaration of element 'label' +++++++++++++++++++++++++++++ -->
+ <element name="label">
+ <!-- Local type redefinition from ocaf:LabelType by restriction -->
+ <complexType>
+ <complexContent>
+ <restriction base="ocaf:LabelType">
+ <sequence>
+ <choice minOccurs="0" maxOccurs="unbounded">
+ <element ref="ocaf:AbstractStringAtt"/>
+ <element ref="ocaf:AbstractIntegerAtt"/>
+ <element ref="ocaf:AbstractRealAtt"/>
+ <element ref="ocaf:AbstractListIntegerAtt"/>
+ <element ref="ocaf:AbstractListRealAtt"/>
+ <element ref="ocaf:AbstractAttribute"/>
+ <element ref="ocaf:AbstractXPathLabel"/>
+ <element ref="ocaf:AbstractList3RealAtt"/>
+ </choice>
+ <element name="label" type="ocaf:LabelType" minOccurs="0" maxOccurs="unbounded">
+ <unique name="Label1Uniqueness">
+ <selector xpath="ocaf:label"/>
+ <field xpath="@tag"/> <!-- label tags -->
+ </unique>
+ </element>
+ </sequence>
+ <!-- Difference from ocaf:LabelType is FIXEDNESS of tag attribute -->
+ <attribute name="tag" type="nonNegativeInteger" fixed="0"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+<!-- Uniqueness of tags in sub-labels -->
+ <unique name="Label0Uniqueness">
+ <selector xpath="ocaf:label"/>
+ <field xpath="@tag"/>
+ </unique>
+<!-- Uniqueness of 'id' values of shareable objects -->
+ <unique name="ShareableIdUniqueness">
+ <selector xpath=".//ocaf:*"/>
+ <field xpath="@id"/>
+ </unique>
+ </element> <!-- END 'label 0' -->
+
+<!-- Declaration of element 'shapes' +++++++++++++++++++++++++++ -->
+ <element name="shapes" type="string" minOccurs="0"/>
+
+ </sequence>
+ <attribute name="format" type="string" use="required"/>
+ </complexType>
+</element> <!-- END 'document' -->
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of basic types
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_SmallTypes.xsd
+ </documentation>
+</annotation>
+
+<!-- DEFINITIONS OF SIMPLE BASIC TYPES -->
+
+<simpleType name="ListOfInteger">
+ <list itemType="int"/>
+</simpleType>
+
+<simpleType name="ListOfReal">
+ <list itemType="double"/>
+</simpleType>
+
+<simpleType name="ListOf3Real">
+ <restriction base="ocaf:ListOfReal">
+ <length value="3"/>
+ </restriction>
+</simpleType>
+
+<simpleType name="GuidType">
+ <restriction base="string">
+ <length value="36"/>
+ <pattern value="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/>
+ </restriction>
+</simpleType>
+
+<simpleType name="XPathLabel">
+ <restriction base="string">
+ <pattern value='/document/label(/label\[@tag=\"[1-9][0-9]*\"\])*'/>
+ </restriction>
+</simpleType>
+
+<!-- DEFINITIONS OF BASIC TYPES FOR OCAF ATTRIBUTES -->
+
+<complexType name="AbsStringAttributeType">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsIntegerAttributeType">
+ <simpleContent>
+ <extension base="int">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsRealAttributeType">
+ <simpleContent>
+ <extension base="double">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsListIntegerAttributeType">
+ <simpleContent>
+ <extension base="ocaf:ListOfInteger">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsListRealAttributeType">
+ <simpleContent>
+ <extension base="ocaf:ListOfReal">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsXPathLabelType">
+ <simpleContent>
+ <extension base="ocaf:XPathLabel">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<complexType name="AbsList3RealAttributeType">
+ <simpleContent>
+ <extension base="ocaf:ListOf3Real">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </extension>
+ </simpleContent>
+</complexType>
+
+<!-- DECLARATIONS OF ABSTRACT XML ELEMENTS FOR OCAF ATTRIBUTES -->
+
+<element name="AbstractStringAtt" type="ocaf:AbsStringAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with String content
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractIntegerAtt" type="ocaf:AbsIntegerAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with Integer content
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractRealAtt" type="ocaf:AbsRealAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with Real content
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractListIntegerAtt"
+ type="ocaf:AbsListIntegerAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with List-Of-Integer content
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractListRealAtt"
+ type="ocaf:AbsListRealAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with List-Of-Real content
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractXPathLabel" type="ocaf:AbsXPathLabelType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type representing XPath reference to OCAF label
+ </documentation>
+ </annotation>
+</element>
+
+<element name="AbstractList3RealAtt"
+ type="ocaf:AbsList3RealAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute with List-Of-3-Real content
+ </documentation>
+ </annotation>
+</element>
+
+<!-- DECLARATION OF ABSTRACT XML ELEMENT FOR OCAF ATTRIBUTES WITH NO SIMPLE CONTENT -->
+
+<complexType name="AbstractAttributeType">
+ <complexContent>
+ <restriction base="anyType">
+ <attribute name="id" type="positiveInteger" use="required"/>
+ </restriction>
+ </complexContent>
+</complexType>
+
+<element name="AbstractAttribute" type="ocaf:AbstractAttributeType" abstract="true">
+ <annotation>
+ <documentation>
+ Abstract type corresponding to TDF_Attribute (the ancestor of all OCAF Attributes)
+ </documentation>
+ </annotation>
+</element>
+
+<!-- ELEMENT **LOCATION** -->
+
+<complexType name="Location">
+ <sequence>
+ <element name="datum" minOccurs="0">
+ <complexType>
+ <attribute name="id" type="positiveInteger" use="required"/>
+ <attribute name="trsf" use="required">
+ <simpleType>
+ <restriction base="ocaf:ListOfReal">
+ <length value="14"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="location" type="ocaf:Location" minOccurs="0"/>
+ </sequence>
+ <attribute name="power" type="positiveInteger" use="required"/>
+ <attribute name="datum" type="positiveInteger" use="required"/>
+</complexType>
+
+<element name="location" type="ocaf:Location"/>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TDF
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDF.xsd
+ </documentation>
+</annotation>
+
+<element name="TDF_TagSource" type="ocaf:AbsIntegerAttributeType"
+ substitutionGroup="ocaf:AbstractIntegerAtt"/>
+
+<element name="TDF_Reference" type="ocaf:AbsXPathLabelType"
+ substitutionGroup="ocaf:AbstractXPathLabel"/>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TDataStd
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDataStd.xsd
+ </documentation>
+</annotation>
+
+<element name="TDataStd_Position" type="ocaf:AbsList3RealAttributeType"
+ substitutionGroup="ocaf:AbstractList3RealAtt"/>
+
+<element name="TDataStd_Name" type="ocaf:AbsStringAttributeType"
+ substitutionGroup="ocaf:AbstractStringAtt"/>
+
+<element name="TDataStd_Comment" type="ocaf:AbsStringAttributeType"
+ substitutionGroup="ocaf:AbstractStringAtt"/>
+
+<element name="TDataStd_Integer" type="ocaf:AbsIntegerAttributeType"
+ substitutionGroup="ocaf:AbstractIntegerAtt"/>
+
+<element name="TDataStd_Real" type="ocaf:AbsRealAttributeType"
+ substitutionGroup="ocaf:AbstractRealAtt"/>
+
+<element name="TDataStd_Point" type="ocaf:AbstractAttributeType"
+ substitutionGroup="ocaf:AbstractAttribute"/>
+
+<element name="TDataStd_Axis" type="ocaf:AbstractAttributeType"
+ substitutionGroup="ocaf:AbstractAttribute"/>
+
+<element name="TDataStd_Plane" type="ocaf:AbstractAttributeType"
+ substitutionGroup="ocaf:AbstractAttribute"/>
+
+<element name="TDataStd_Shape" type="ocaf:AbstractAttributeType"
+ substitutionGroup="ocaf:AbstractAttribute"/>
+
+<element name="TDataStd_Directory" type="ocaf:AbstractAttributeType"
+ substitutionGroup="ocaf:AbstractAttribute"/>
+
+<element name="TDataStd_IntegerArray" substitutionGroup="ocaf:AbstractListIntegerAtt">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbsListIntegerAttributeType">
+ <attribute name="first" type="int" default="1"/>
+ <attribute name="last" type="int" use="required"/>
+ <attribute name="delta" type="int" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_RealArray" substitutionGroup="ocaf:AbstractListRealAtt">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbsListRealAttributeType">
+ <attribute name="first" type="int" default="1"/>
+ <attribute name="last" type="int" use="required"/>
+ <attribute name="delta" type="int" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_UAttribute" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="guid" type="ocaf:GuidType" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_TreeNode" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="treeid" type="ocaf:GuidType" use="required"/>
+ <attribute name="children" type="ocaf:ListOfInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_Geometry" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="geomtype" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="any"/>
+ <enumeration value="point"/>
+ <enumeration value="line"/>
+ <enumeration value="circle"/>
+ <enumeration value="ellipse"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_Constraint" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="contype" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="radius"/>
+ <enumeration value="diameter"/>
+ <enumeration value="minorradius"/>
+ <enumeration value="majorradius"/>
+ <enumeration value="tangent"/>
+ <enumeration value="parallel"/>
+ <enumeration value="perpendicular"/>
+ <enumeration value="concentric"/>
+ <enumeration value="coincident"/>
+ <enumeration value="distance"/>
+ <enumeration value="angle"/>
+ <enumeration value="equalradius"/>
+ <enumeration value="symmetry"/>
+ <enumeration value="midpoint"/>
+ <enumeration value="equaldist"/>
+ <enumeration value="fix"/>
+ <enumeration value="rigid"/>
+ <enumeration value="from"/>
+ <enumeration value="axis"/>
+ <enumeration value="mate"/>
+ <enumeration value="alignfaces"/>
+ <enumeration value="alignaxes"/>
+ <enumeration value="axesangle"/>
+ <enumeration value="facesangle"/>
+ <enumeration value="round"/>
+ <enumeration value="offset"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="valueref" type="positiveInteger"/>
+ <attribute name="geometries">
+ <simpleType>
+ <restriction base="ocaf:ListOfInteger">
+ <minLength value="1"/>
+ <maxLength value="4"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="plane" type="positiveInteger"/>
+ <attribute name="flags" use="required">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="[+-]{3}"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_Variable" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="isconst" type="boolean" default="false"/>
+ <attribute name="unit" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_PatternStd" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="signature" type="int" use="required"/>
+ <attribute name="axis1reversed" type="boolean" default="false"/>
+ <attribute name="axis2reversed" type="boolean" default="false"/>
+ <attribute name="nbinstances1" type="positiveInteger"/>
+ <attribute name="value1ref" type="positiveInteger"/>
+ <attribute name="axis1" type="positiveInteger"/>
+ <attribute name="nbinstances2" type="positiveInteger"/>
+ <attribute name="value2ref" type="positiveInteger"/>
+ <attribute name="axis2" type="positiveInteger"/>
+ <attribute name="mirror" type="positiveInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_Relation" substitutionGroup="ocaf:AbstractStringAtt">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbsStringAttributeType">
+ <attribute name="variables" type="ocaf:ListOfInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="TDataStd_Expression" substitutionGroup="ocaf:AbstractStringAtt">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbsStringAttributeType">
+ <attribute name="variables" type="ocaf:ListOfInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attribute TDataStd_Name
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd
+ </documentation>
+</annotation>
+
+<element name="TDataStd_Name" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="extstring" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TDocStd
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDocStd.xsd
+ </documentation>
+</annotation>
+
+<element name="TDocStd_XLink" substitutionGroup="ocaf:AbstractXPathLabel">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbsXPathLabelType">
+ <attribute name="documentEntry" type="string" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TFunction
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TFunction.xsd
+ </documentation>
+</annotation>
+
+<element name="TFunction_Function" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="guid" type="ocaf:GuidType" use="required"/>
+ <attribute name="failure" type="int"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TNaming package
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TNaming.xsd
+ </documentation>
+</annotation>
+
+<complexType name="ArrayOfShapes">
+ <sequence>
+ <element name="shape" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="tshape" use="required">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="[+-ie]\d+"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="location" type="positiveInteger"/>
+ <attribute name="index" type="positiveInteger" use="required"/>
+ <attribute name="x" type="float"/>
+ <attribute name="y" type="float"/>
+ <attribute name="z" type="float"/>
+ </complexType>
+ </element> <!-- end of 'shape' -->
+ </sequence>
+ <attribute name="lower" type="positiveInteger" default="1"/>
+ <attribute name="upper" type="positiveInteger" default="1"/>
+</complexType>
+
+<element name="TNaming_NamedShape" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ <element name="olds" type="ocaf:ArrayOfShapes" minOccurs="0"/>
+ <element name="news" type="ocaf:ArrayOfShapes" minOccurs="0"/>
+ </sequence>
+ <attribute name="evolution" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="primitive"/>
+ <enumeration value="generated"/>
+ <enumeration value="modify"/>
+ <enumeration value="delete"/>
+ <enumeration value="selected"/>
+ <enumeration value="replace"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="version" type="positiveInteger" default="0"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <unique name="OldShapeIndexUniq">
+ <selector xpath="."/>
+ <field xpath="@id"/>
+ <field xpath="ocaf:olds/ocaf:shape/@index"/>
+ </unique>
+ <unique name="NewShapeIndexUniq">
+ <selector xpath="."/>
+ <field xpath="@id"/>
+ <field xpath="ocaf:news/ocaf:shape/@index"/>
+ </unique>
+</element>
+
+<element name="TNaming_Naming" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="index" type="int" use="required"/>
+ <attribute name="stopNS" type="positiveInteger"/>
+ <attribute name="nametype" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="unknown"/>
+ <enumeration value="identity"/>
+ <enumeration value="modifuntil"/>
+ <enumeration value="generation"/>
+ <enumeration value="intersection"/>
+ <enumeration value="union"/>
+ <enumeration value="subtraction"/>
+ <enumeration value="constshape"/>
+ <enumeration value="filterbyneigh"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="shapetype" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="compound"/>
+ <enumeration value="compsolid"/>
+ <enumeration value="solid"/>
+ <enumeration value="shell"/>
+ <enumeration value="face"/>
+ <enumeration value="wire"/>
+ <enumeration value="edge"/>
+ <enumeration value="vertex"/>
+ <enumeration value="shape"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="arguments" type="ocaf:ListOfInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attribute TNaming_NamedShape
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd
+ </documentation>
+</annotation>
+
+<complexType name="Location">
+ <sequence>
+ <element name="datum" minOccurs="0">
+ <complexType>
+ <attribute name="id" type="positiveInteger" use="required"/>
+ <attribute name="trsf" use="required">
+ <simpleType>
+ <restriction base="ocaf:ListOfReal">
+ <length value="14"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+ <element name="location" type="ocaf:Location" minOccurs="0"/>
+ </sequence>
+ <attribute name="power" type="positiveInteger" use="required"/>
+ <attribute name="datum" type="positiveInteger" use="required"/>
+</complexType>
+
+<element name="TNaming_NamedShape" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ <element name="array" minOccurs="0" maxOccurs="2">
+ <complexType>
+ <sequence>
+ <element name="shape" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="location" type="ocaf:Location" minOccurs="0"/>
+ </sequence>
+ <attribute name="tshape" use="required">
+ <simpleType>
+ <restriction base="string">
+ <pattern value="[+-ie]\d+"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="index" type="positiveInteger" use="required"/>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="id" type="positiveInteger" use="required"/>
+ <attribute name="lower" type="positiveInteger"/>
+ <attribute name="upper" type="positiveInteger"/>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="olds" type="positiveInteger"/>
+ <attribute name="news" type="positiveInteger"/>
+ <attribute name="evolution" use="required">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="primitive"/>
+ <enumeration value="generated"/>
+ <enumeration value="modify"/>
+ <enumeration value="delete"/>
+ <enumeration value="selected"/>
+ <enumeration value="replace"/>
+ </restriction>
+ </simpleType>
+ </attribute>
+ <attribute name="version" type="positiveInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from TPrsStd
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TPrsStd.xsd
+ </documentation>
+</annotation>
+
+<element name="TPrsStd_AISPresentation" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="guid" type="ocaf:GuidType" use="required"/>
+ <attribute name="isdisplayed" type="boolean" default="false"/>
+ <attribute name="color" type="int"/>
+ <attribute name="material" type="int"/>
+ <attribute name="transparency" type="double"/>
+ <attribute name="width" type="double"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
--- /dev/null
+<schema targetNamespace="http://www.opencascade.org/OCAF/XML/XCAF"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
+ elementFormDefault="qualified">
+<import namespace="http://www.opencascade.org/OCAF/XML"
+ schemaLocation="XmlOcaf.xsd"/>
+
+<annotation>
+ <documentation xml:lang="en">
+ Copyright (c) 2001-2014 OPEN CASCADE SAS
+
+ This file is part of Open CASCADE Technology software library.
+
+ This library is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License version 2.1 as published
+ by the Free Software Foundation, with special exception defined in the file
+ OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+ distribution for complete text of the license and disclaimer of any warranty.
+
+ Alternatively, this file may be used under the terms of Open CASCADE
+ commercial license or contractual agreement.
+
+ Open Cascade Application Framework: Definition of attributes from XCAFDoc
+ This file is included in XmlOcaf.xsd
+ URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_XCAFDoc.xsd
+ </documentation>
+</annotation>
+
+<element name="Area" type="ocaf:AbsRealAttributeType"
+ substitutionGroup="ocaf:AbstractRealAtt"/>
+
+<element name="Volume" type="ocaf:AbsRealAttributeType"
+ substitutionGroup="ocaf:AbstractRealAtt"/>
+
+<element name="Color" type="ocaf:AbsIntegerAttributeType"
+ substitutionGroup="ocaf:AbstractIntegerAtt"/>
+
+<element name="Centroid" type="ocaf:AbsList3RealAttributeType"
+ substitutionGroup="ocaf:AbstractList3RealAtt"/>
+
+<element name="GraphNode" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <attribute name="treeid" type="ocaf:GuidType" use="required"/>
+ <attribute name="children" type="ocaf:ListOfInteger"/>
+ <attribute name="fathers" type="ocaf:ListOfInteger"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="Location" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ <element ref="ocaf:location" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="DocumentTool" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="ColorTool" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="ShapeTool" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+<element name="LayerTool" substitutionGroup="ocaf:AbstractAttribute">
+ <complexType>
+ <complexContent>
+ <extension base="ocaf:AbstractAttributeType">
+ <sequence>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+</element>
+
+</schema>
+++ /dev/null
-!!!!!!!!!! ----- Messages file for BOPAlgo package --------- !!!!!!!!!
-! Keyword is name of corresponding alert (error or warning) class
-
-! Special key used to check that messages are loaded; see BOPAlgo_Options.cxx
-.BOPAlgo_LOAD_CHECKER
-N/A
-
-.BOPAlgo_AlertBOPIsNotSet
-The type of Boolean Operation is not set
-
-.BOPAlgo_AlertBOPNotAllowed
-Boolean operation of the given type is not allowed on the given inputs
-
-.BOPAlgo_AlertSolidBuilderFailed
-Building Fused solid has failed
-
-.BOPAlgo_AlertTooFewArguments
-There are no enough arguments to perform the operation
-
-.BOPAlgo_AlertMultipleArguments
-More than one argument is provided
-
-.BOPAlgo_AlertNoFiller
-The Pave Filler (the intersection tool) has not been created
-
-.BOPAlgo_AlertIntersectionFailed
-The intersection of the arguments has failed
-
-.BOPAlgo_AlertBuilderFailed
-Building of the result shape has failed
-
-.BOPAlgo_AlertNullFace
-The face given to be split is a null shape
-
-.BOPAlgo_AlertNullInputShapes
-No or null input shapes
-
-.BOPAlgo_AlertPostTreatFF
-Cannot connect face intersection curves
-
-.BOPAlgo_AlertEmptyShape
-Some of the arguments are empty shapes
-
-.BOPAlgo_AlertSelfInterferingShape
-Some of the arguments are self-interfering shapes
-
-.BOPAlgo_AlertTooSmallEdge
-Some edges are too small and have no valid range
-
-.BOPAlgo_AlertNotSplittableEdge
-Some edges are very small and have such a small valid range, that they cannot be split
-
-.BOPAlgo_AlertBadPositioning
-The positioning of the shapes leads to creation of the small edges without valid range
-
-.BOPAlgo_AlertShellSplitterFailed
-Unable to build loops from the given faces
-
-.BOPAlgo_AlertRemovalOfIBForMDimShapes
-Removal of internal boundaries among the multi-dimensional shapes is not supported yet
-
-.BOPAlgo_AlertRemovalOfIBForSolidsFailed
-Removal of internal boundaries among Solids has failed
-
-.BOPAlgo_AlertRemovalOfIBForFacesFailed
-Removal of internal boundaries among Faces has failed
-
-.BOPAlgo_AlertRemovalOfIBForEdgesFailed
-Removal of internal boundaries among Edges has failed
-
-.BOPAlgo_AlertIntersectionOfPairOfShapesFailed
-Intersection of pair of shapes has failed
-
-.BOPAlgo_AlertBuildingPCurveFailed
-Building 2D curve of edge on face has failed
-
-.BOPAlgo_AlertAcquiredSelfIntersection
-Some sub-shapes of some of the argument become connected through other shapes and the argument became self-interfered
-
-.BOPAlgo_AlertUnsupportedType
-Unsupported type of input shape
-
-.BOPAlgo_AlertUnableToRemoveTheFeature
-Unable to remove the feature
-
-.BOPAlgo_AlertNoFacesToRemove
-No faces have been found for removal
-
-.BOPAlgo_AlertRemoveFeaturesFailed
-The Feature Removal algorithm has failed
-
-.BOPAlgo_AlertSolidBuilderUnusedFaces
-Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation
-
-.BOPAlgo_AlertFaceBuilderUnusedEdges
-Some of the edges passed to the Face Builder algorithm have not been classified and not used for faces creation
-
-.BOPAlgo_AlertUnableToOrientTheShape
-Unable to orient the shape correctly
-
-.BOPAlgo_AlertUnknownShape
-Shape is unknown for operation
-
-.BOPAlgo_AlertNoPeriodicityRequired
-No periodicity has been requested for the shape
-
-.BOPAlgo_AlertUnableToTrim
-Unable to trim the shape for making it periodic (BOP Common fails)
-
-.BOPAlgo_AlertUnableToMakeIdentical
-Unable to make the shape to look identical on opposite sides (Splitter fails)
-
-.BOPAlgo_AlertUnableToRepeat
-Unable to repeat the shape (Gluer fails)
-
-.BOPAlgo_AlertMultiDimensionalArguments
-Multi-dimensional arguments
-
-.BOPAlgo_AlertUnableToMakePeriodic
-Unable to make the shape periodic
-
-.BOPAlgo_AlertUnableToGlue
-Unable to glue the shapes
-
-.BOPAlgo_AlertShapeIsNotPeriodic
-The shape is not periodic
-
-.BOPAlgo_AlertUnableToMakeClosedEdgeOnFace
-Unable to make closed edge on face.
-// This file has been automatically generated from resource file src/BOPAlgo/BOPAlgo.msg
+// clang-format off
+// This file has been automatically generated from resource file resources/BOPAlgo/BOPAlgo.msg
static const char BOPAlgo_BOPAlgo_msg[] =
"!!!!!!!!!! ----- Messages file for BOPAlgo package --------- !!!!!!!!!\n"
"Building 2D curve of edge on face has failed\n"
"\n"
".BOPAlgo_AlertAcquiredSelfIntersection\n"
- "Some sub-shapes of some of the argument become connected through other shapes and the argument "
- "became self-interfered\n"
+ "Some sub-shapes of some of the argument become connected through other shapes and the argument became self-interfered\n"
"\n"
".BOPAlgo_AlertUnsupportedType\n"
"Unsupported type of input shape\n"
"The Feature Removal algorithm has failed\n"
"\n"
".BOPAlgo_AlertSolidBuilderUnusedFaces\n"
- "Some of the faces passed to the Solid Builder algorithm have not been classified and not used "
- "for solids creation\n"
+ "Some of the faces passed to the Solid Builder algorithm have not been classified and not used for solids creation\n"
"\n"
".BOPAlgo_AlertFaceBuilderUnusedEdges\n"
- "Some of the edges passed to the Face Builder algorithm have not been classified and not used "
- "for faces creation\n"
+ "Some of the edges passed to the Face Builder algorithm have not been classified and not used for faces creation\n"
"\n"
".BOPAlgo_AlertUnableToOrientTheShape\n"
"Unable to orient the shape correctly\n"
"\n"
".BOPAlgo_AlertUnableToMakeClosedEdgeOnFace\n"
"Unable to make closed edge on face.\n";
+
+// clang-format on
BOPAlgo_Splitter.hxx
BOPAlgo_Splitter.cxx
BOPAlgo_Alerts.hxx
-BOPAlgo.msg
BOPAlgo_BOPAlgo_msg.pxx
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-if { [info commands addmenu] == "" } { return }
-
-global theMenus
-if [info exists theMenus(Curves)] {
- destroy [string trimright $theMenus(Curves) ".menu"]
- unset theMenus(Curves)
-}
-
-addmenu Curves "Line" {
- dialbox line name l origin {0 0 0} direction {1 0 0}
-}
-addmenu Curves "Circle" {
- dialbox circle name c center {0 0 0} normal {0 0 1} xdir {1 0 0} radius 1
-}
-addmenu Curves "Ellipse" {
- dialbox ellipse name e center {0 0 0} normal {0 0 1} xdir {1 0 0} radii {1 0.5}
-}
-addmenu Curves "Hyperbola" {
- dialbox hyperbola name h center {0 0 0} normal {0 0 1} xdir {1 0 0} radii {1 0.5}
-}
-
-addmenu Curves "Parabola" {
- dialbox parabola name b center {0 0 0} normal {0 0 1} xdir {1 0 0} focus 1
-}
-redrawhelp
+++ /dev/null
-# Copyright (c) 2013-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-############################################################################
-# This file defines scripts for verification of OCCT tests.
-# It provides top-level commands starting with 'check'.
-# Type 'help check*' to get their synopsis.
-# See OCCT Tests User Guide for description of the test system.
-#
-# Note: procedures with names starting with underscore are for internal use
-# inside the test system.
-############################################################################
-
-help checkcolor {
- Check pixel color.
- Use: checkcolor x y red green blue
- x y - pixel coordinates
- red green blue - expected pixel color (values from 0 to 1)
- Function check color with tolerance (5x5 area)
-}
-# Procedure to check color using command vreadpixel with tolerance
-proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
- puts "Coordinate x = $coord_x"
- puts "Coordinate y = $coord_y"
- puts "RED color of RGB is $rd_get"
- puts "GREEN color of RGB is $gr_get"
- puts "BLUE color of RGB is $bl_get"
-
- if { $coord_x <= 1 || $coord_y <= 1 } {
- puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
- return -1
- }
-
- set color ""
- catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] }
- if {"$color" == ""} {
- puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view"
- }
- set rd [lindex $color 0]
- set gr [lindex $color 1]
- set bl [lindex $color 2]
- set rd_int [expr int($rd * 1.e+05)]
- set gr_int [expr int($gr * 1.e+05)]
- set bl_int [expr int($bl * 1.e+05)]
- set rd_ch [expr int($rd_get * 1.e+05)]
- set gr_ch [expr int($gr_get * 1.e+05)]
- set bl_ch [expr int($bl_get * 1.e+05)]
-
- if { $rd_ch != 0 } {
- set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
- } else {
- set tol_rd $rd_int
- }
- if { $gr_ch != 0 } {
- set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
- } else {
- set tol_gr $gr_int
- }
- if { $bl_ch != 0 } {
- set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
- } else {
- set tol_bl $bl_int
- }
-
- set status 0
- if { $tol_rd > 0.2 } {
- puts "Warning : RED light of additive color model RGB is invalid"
- set status 1
- }
- if { $tol_gr > 0.2 } {
- puts "Warning : GREEN light of additive color model RGB is invalid"
- set status 1
- }
- if { $tol_bl > 0.2 } {
- puts "Warning : BLUE light of additive color model RGB is invalid"
- set status 1
- }
-
- if { $status != 0 } {
- puts "Warning : Colors of default coordinate are not equal"
- }
-
- global stat
- if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
- set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
- set stat [lindex $info end]
- if { ${stat} != 1 } {
- puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
- return $stat
- } else {
- puts "Point with valid color was found"
- return $stat
- }
- } else {
- set stat 1
- }
-}
-
-# Procedure to check color in the point near default coordinate
-proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
- set x_start [expr ${coord_x} - 2]
- set y_start [expr ${coord_y} - 2]
- set mistake 0
- set i 0
- while { $mistake != 1 && $i <= 5 } {
- set j 0
- while { $mistake != 1 && $j <= 5 } {
- set position_x [expr ${x_start} + $j]
- set position_y [expr ${y_start} + $i]
- puts $position_x
- puts $position_y
-
- set color ""
- catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] }
- if {"$color" == ""} {
- puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view"
- incr j
- continue
- }
- set rd [lindex $color 0]
- set gr [lindex $color 1]
- set bl [lindex $color 2]
- set rd_int [expr int($rd * 1.e+05)]
- set gr_int [expr int($gr * 1.e+05)]
- set bl_int [expr int($bl * 1.e+05)]
-
- if { $rd_ch != 0 } {
- set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
- } else {
- set tol_rd $rd_int
- }
- if { $gr_ch != 0 } {
- set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
- } else {
- set tol_gr $gr_int
- }
- if { $bl_ch != 0 } {
- set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
- } else {
- set tol_bl $bl_int
- }
-
- if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
- puts "Warning : Point with true color was not found near default coordinates"
- set mistake 0
- } else {
- set mistake 1
- }
- incr j
- }
- incr i
- }
- return $mistake
-}
-
-# auxiliary: check argument
-proc _check_arg {check_name check_result {get_value 0}} {
- upvar ${check_result} ${check_result}
- upvar arg arg
- upvar narg narg
- upvar args args
- if { $arg == ${check_name} } {
- if { ${get_value} == "?" } {
- set next_arg_index [expr $narg + 1]
- if { $next_arg_index < [llength $args] && ! [regexp {^-[^0-9]} [lindex $args $next_arg_index]] } {
- set ${check_result} "[lindex $args $next_arg_index]"
- set narg ${next_arg_index}
- } else {
- set ${check_result} "true"
- }
- } elseif {${get_value}} {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-[^0-9]} [lindex $args $narg]] } {
- set ${check_result} "[lindex $args $narg]"
- } else {
- error "Option ${check_result} requires argument"
- }
- } else {
- set ${check_result} "true"
- }
- return 1
- }
- return 0
-}
-
-help checknbshapes {
- Compare number of sub-shapes in "shape" with given reference data
-
- Use: checknbshapes shape [options...]
- Allowed options are:
- -vertex N
- -edge N
- -wire N
- -face N
- -shell N
- -solid N
- -compsolid N
- -compound N
- -shape N
- -t: compare the number of sub-shapes in "shape" counting
- the same sub-shapes with different location as different sub-shapes.
- -m msg: print "msg" in case of error
- -ref [nbshapes a]: compare the number of sub-shapes in "shape" and in "a".
- -vertex N, -edge N and other options are still working.
-}
-proc checknbshapes {shape args} {
- puts "checknbshapes ${shape} ${args}"
- upvar ${shape} ${shape}
-
- set nbVERTEX -1
- set nbEDGE -1
- set nbWIRE -1
- set nbFACE -1
- set nbSHELL -1
- set nbSOLID -1
- set nbCOMPSOLID -1
- set nbCOMPOUND -1
- set nbSHAPE -1
-
- set message ""
- set count_locations 0
- set ref_info ""
-
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
- if {[_check_arg "-vertex" nbVERTEX 1] ||
- [_check_arg "-edge" nbEDGE 1] ||
- [_check_arg "-wire" nbWIRE 1] ||
- [_check_arg "-face" nbFACE 1] ||
- [_check_arg "-shell" nbSHELL 1] ||
- [_check_arg "-solid" nbSOLID 1] ||
- [_check_arg "-compsolid" nbCOMPSOLID 1] ||
- [_check_arg "-compound" nbCOMPOUND 1] ||
- [_check_arg "-shape" nbSHAPE 1] ||
- [_check_arg "-t" count_locations] ||
- [_check_arg "-m" message 1] ||
- [_check_arg "-ref" ref_info 1]
- } {
- continue
- }
- # unsupported option
- if { [regexp {^-} $arg] } {
- error "Error: unsupported option \"$arg\""
- }
- error "Error: cannot interpret argument $narg ($arg)"
- }
-
- if { ${count_locations} == 0 } {
- set nb_info [nbshapes ${shape}]
- } else {
- set nb_info [nbshapes ${shape} -t]
- }
-
- set EntityList {VERTEX EDGE WIRE FACE SHELL SOLID COMPSOLID COMPOUND SHAPE}
-
- foreach Entity ${EntityList} {
- set expr_string "${Entity} +: +(\[-0-9.+eE\]+)"
- set to_compare {}
- # get number of elements from ${shape}
- if { [regexp "${expr_string}" ${nb_info} full nb_entity2] } {
- lappend to_compare ${nb_entity2}
- } else {
- error "Error : command \"nbshapes ${shape}\" gives an empty result"
- }
- # get number of elements from options -vertex -edge and so on
- set nb_entity1 [set nb${Entity}]
- if { ${nb_entity1} != -1 } {
- lappend to_compare ${nb_entity1}
- }
- # get number of elements from option -ref
- if { [regexp "${expr_string}" ${ref_info} full nb_entity_ref] } {
- lappend to_compare ${nb_entity_ref}
- }
- # skip comparing if no reference data was given
- if {[llength $to_compare] == 1} {
- continue
- }
- # compare all values, if they are equal, length of sorted list "to_compare"
- # (with key -unique) should be equal to 1
- set to_compare [lsort -dictionary -unique $to_compare]
- if { [llength $to_compare] != 1 } {
- puts "Error : ${message} is WRONG because number of ${Entity} entities in shape \"${shape}\" is ${nb_entity2}"
- } else {
- puts "OK : ${message} is GOOD because number of ${Entity} entities is equal to number of expected ${Entity} entities"
- }
- }
-}
-
-# Procedure to check equality of two reals with tolerance (relative and absolute)
-help checkreal {
- Compare value with expected
- Use: checkreal name value expected tol_abs tol_rel
-}
-proc checkreal {name value expected tol_abs tol_rel} {
- if { abs ($value - $expected) > $tol_abs + $tol_rel * abs ($expected) } {
- puts "Error: $name = $value is not equal to expected $expected"
- } else {
- puts "Check of $name OK: value = $value, expected = $expected"
- }
- return
-}
-
-# Procedure to check equality of two 3D points with tolerance
-help checkpoint {
- Compare two 3D points with given tolerance
- Use: checkpoint name {valueX valueY valueZ} {expectedX expectedY expectedZ} tolerance
-}
-proc checkpoint {theName theValue theExpected theTolerance} {
- set e 0.0001
- foreach i {0 1 2} {
- if { [expr abs([lindex $theValue $i] - [lindex $theExpected $i])] > $theTolerance } {
- puts "Error: $theName, ($theValue) is not equal to expected ($theExpected)"
- return
- }
- }
- puts "Check of $theName OK: value = ($theValue), expected = ($theExpected)"
- return
-}
-
-help checkfreebounds {
- Compare number of free edges with ref_value
-
- Use: checkfreebounds shape ref_value [options...]
- Allowed options are:
- -tol N: used tolerance (default -0.01)
- -type N: used type, possible values are "closed" and "opened" (default "closed")
-}
-proc checkfreebounds {shape ref_value args} {
- puts "checkfreebounds ${shape} ${ref_value} ${args}"
- upvar ${shape} ${shape}
-
- set tol -0.01
- set type "closed"
-
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
- if {[_check_arg "-tol" tol 1] ||
- [_check_arg "-type" type 1]
- } {
- continue
- }
- # unsupported option
- if { [regexp {^-} $arg] } {
- error "Error: unsupported option \"$arg\""
- }
- error "Error: cannot interpret argument $narg ($arg)"
- }
-
- if {"$type" != "closed" && "$type" != "opened"} {
- error "Error : wrong -type key \"${type}\""
- }
-
- freebounds ${shape} ${tol}
- set free_edges [llength [explode ${shape}_[string range $type 0 0] e]]
-
- if { ${ref_value} == -1 } {
- puts "Error : Number of free edges is UNSTABLE"
- return
- }
-
- if { ${free_edges} != ${ref_value} } {
- puts "Error : Number of free edges is not equal to reference data"
- } else {
- puts "OK : Number of free edges is ${free_edges}"
- }
-}
-
-help checkmaxtol {
- Returns max tolerance of the shape and prints error message if specified
- criteria are not satisfied.
-
- Use: checkmaxtol shape [options...]
-
- Options specify criteria for checking the maximal tolerance value:
- -ref <value>: check it to be equal to reference value.
- -min_tol <value>: check it to be not greater than specified value.
- -source <list of shapes>: check it to be not greater than
- maximal tolerance of specified shape(s)
- -multi_tol <value>: additional multiplier for value specified by -min_tol
- or -shapes options.
-}
-
-proc checkmaxtol {shape args} {
- puts "checkmaxtol ${shape} ${args}"
- upvar ${shape} ${shape}
-
- set ref_value ""
- set source_shapes {}
- set min_tol 0
- set tol_multiplier 0
-
- # check arguments
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
- if {[_check_arg "-min_tol" min_tol 1] ||
- [_check_arg "-multi_tol" tol_multiplier 1] ||
- [_check_arg "-source" source_shapes 1] ||
- [_check_arg "-ref" ref_value 1]
- } {
- continue
- }
- # unsupported option
- if { [regexp {^-} $arg] } {
- error "Error: unsupported option \"$arg\""
- }
- error "Error: cannot interpret argument $narg ($arg)"
- }
-
- # get max tol of shape
- set max_tol 0
- if {[regexp "Tolerance MAX=(\[-0-9.+eE\]+)" [tolerance ${shape}] full maxtol_temp]} {
- set max_tol ${maxtol_temp}
- } else {
- error "Error: cannot get tolerances of shape \"${shape}\""
- }
-
- # find max tol of source shapes
- foreach source_shape ${source_shapes} {
- upvar ${source_shape} ${source_shape}
- set _src_max_tol [checkmaxtol ${source_shape}]
- if { [expr ${_src_max_tol} > ${min_tol} ] } {
- set min_tol ${_src_max_tol}
- }
- }
- # apply -multi_tol option
- if {${tol_multiplier}} {
- set min_tol [expr ${tol_multiplier} * ${_src_max_tol}]
- }
- # compare max tol of source shapes with checking tolerance
- if { ${min_tol} && [expr ${max_tol} > ${min_tol}] } {
- puts "Error: tolerance of \"${shape}\" (${max_tol}) is greater than checking tolerance (${min_tol})"
- }
- if { ${ref_value} != "" } {
- checkreal "Max tolerance" ${max_tol} ${ref_value} 0.0001 0.01
- }
- return ${max_tol}
-}
-
-help checkfaults {
- Compare faults number of given shapes.
-
- Use: checkfaults shape source_shape [ref_value=0]
-}
-proc checkfaults {shape source_shape {ref_value 0}} {
- puts "checkfaults ${shape} ${source_shape} ${ref_value}"
- upvar $shape $shape
- upvar $source_shape $source_shape
- set cs_a [checkshape $source_shape]
- set nb_a 0
- if {[regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_a full nb_a_begin nb_a_end]} {
- set nb_a [expr $nb_a_end - $nb_a_begin +1]
- }
- set cs_r [checkshape $shape]
- set nb_r 0
- if {[regexp {Faulty shapes in variables faulty_([0-9]*) to faulty_([0-9]*)} $cs_r full nb_r_begin nb_r_end]} {
- set nb_r [expr $nb_r_end - $nb_r_begin +1]
- }
- puts "Number of faults for the initial shape is $nb_a."
- puts "Number of faults for the resulting shape is $nb_r."
-
- if { ${ref_value} == -1 } {
- puts "Error : Number of faults is UNSTABLE"
- return
- }
-
- if { $nb_r > $nb_a } {
- puts "Error : Number of faults is $nb_r"
- }
-}
-
-# auxiliary: check all arguments
-proc _check_args { args {options {}} {command_name ""}} {
- # check arguments
- for {set narg 0} {${narg} < [llength ${args}]} {incr narg} {
- set arg [lindex ${args} ${narg}]
- set toContinue 0
- foreach option ${options} {
- set option_name [lindex ${option} 0]
- set variable_to_save_value [lindex ${option} 1]
- set get_value [lindex ${option} 2]
- set local_value ""
- if { [_check_arg ${option_name} local_value ${get_value}] } {
- upvar 1 ${variable_to_save_value} ${variable_to_save_value}
- set ${variable_to_save_value} ${local_value}
- set toContinue 1
- }
- }
- if {${toContinue}} { continue }
- # unsupported option
- if { [regexp {^-} ${arg}] } {
- error "Error: unsupported option \"${arg}\""
- }
- error "Error: cannot interpret argument ${narg} (${arg})"
- }
- foreach option ${options} {
- set option_name [lindex ${option} 0]
- set variable_to_save_value [lindex ${option} 1]
- set should_exist [lindex ${option} 3]
- if {![info exists ${variable_to_save_value}] && ${should_exist} == 1} {
- error "Error: wrong using of command '${command_name}', '${option_name}' option is required"
- }
- }
-}
-
-help checkprops {
- Procedure includes commands to compute length, area and volume of input shape.
-
- Use: checkprops shapename [options...]
- Allowed options are:
- -l LENGTH: command lprops, computes the mass properties of all edges in the shape with a linear density of 1
- -s AREA: command sprops, computes the mass properties of all faces with a surface density of 1
- -v VOLUME: command vprops, computes the mass properties of all solids with a density of 1
- -eps EPSILON: the epsilon defines relative precision of computation
- -deps DEPSILON: the epsilon defines relative precision to compare corresponding values
- -equal SHAPE: compare area\volume\length of input shapes. Puts error if its are not equal
- -notequal SHAPE: compare area\volume\length of input shapes. Puts error if its are equal
- -skip: count shared shapes only once, skipping repetitions
- Options -l, -s and -v are independent and can be used in any order. Tolerance epsilon is the same for all options.
-}
-
-proc checkprops {shape args} {
- puts "checkprops ${shape} ${args}"
- upvar ${shape} ${shape}
-
- if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
- puts "Error: The command cannot be built"
- return
- }
-
- set length -1
- set area -1
- set volume -1
- set epsilon 1.0e-4
- set compared_equal_shape -1
- set compared_notequal_shape -1
- set equal_check 0
- set skip 0
- set depsilon 1e-2
-
- set options {{"-eps" epsilon 1}
- {"-equal" compared_equal_shape 1}
- {"-notequal" compared_notequal_shape 1}
- {"-skip" skip 0}
- {"-deps" depsilon 1}}
-
- if { [regexp {\-[not]*equal} $args] } {
- lappend options {"-s" area 0}
- lappend options {"-l" length 0}
- lappend options {"-v" volume 0}
- set equal_check 1
- } else {
- lappend options {"-s" area 1}
- lappend options {"-l" length 1}
- lappend options {"-v" volume 1}
- }
- _check_args ${args} ${options} "checkprops"
-
- if { ${length} != -1 || ${equal_check} == 1 } {
- lappend CommandNames {lprops}
- set equal_check 0
- }
- if { ${area} != -1 || ${equal_check} == 1 } {
- lappend CommandNames {sprops}
- set equal_check 0
- }
- if { ${volume} != -1 || ${equal_check} == 1 } {
- lappend CommandNames {vprops}
- set equal_check 0
- }
-
- set skip_option ""
- if { $skip } {
- set skip_option "-skip"
- }
-
- foreach CommandName ${CommandNames} {
- switch $CommandName {
- "lprops" { set mass ${length}; set prop "length" }
- "sprops" { set mass ${area}; set prop "area" }
- "vprops" { set mass ${volume}; set prop "volume" }
- }
- regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${shape} ${epsilon} $skip_option] full m
-
- if { ${compared_equal_shape} != -1 } {
- upvar ${compared_equal_shape} ${compared_equal_shape}
- regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_equal_shape} ${epsilon} $skip_option] full compared_m
- if { $compared_m != $m } {
- puts "Error: Shape ${compared_equal_shape} is not equal to shape ${shape}"
- }
- }
-
- if { ${compared_notequal_shape} != -1 } {
- upvar ${compared_notequal_shape} ${compared_notequal_shape}
- regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_notequal_shape} ${epsilon} $skip_option] full compared_m
- if { $compared_m == $m } {
- puts "Error: Shape ${compared_notequal_shape} is equal shape to ${shape}"
- }
- }
-
- if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
- if { [string compare "$mass" "empty"] != 0 } {
- if { $m == 0 } {
- puts "Error : The command is not valid. The $prop is 0."
- }
- # check of change of area is < 1%
- if { ($mass != 0 && abs (($mass - $m) / double($mass)) > $depsilon) ||
- ($mass == 0 && $m != 0) } {
- puts "Error : The $prop of result shape is $m, expected $mass"
- }
- } else {
- if { $m != 0 } {
- puts "Error : The command is not valid. The $prop is $m"
- }
- }
- }
- }
-}
-
-help checkdump {
- Procedure includes command to parse output dump and compare it with reference values.
-
- Use: checkdump shapename [options...]
- Allowed options are:
- -name NAME: list of parsing parameters (e.g. Center, Axis, etc)
- -ref VALUE: list of reference values for each parameter in NAME
- -eps EPSILON: the epsilon defines relative precision of computation
-}
-
-proc checkdump {shape args} {
- puts "checkdump ${shape} ${args}"
- upvar ${shape} ${shape}
-
- set ddump -1
- set epsilon -1
- set options {{"-name" params 1}
- {"-ref" ref 1}
- {"-eps" epsilon 1}
- {"-dump" ddump 1}}
-
- if { ${ddump} == -1 } {
- set ddump [dump ${shape}]
- }
- _check_args ${args} ${options} "checkdump"
-
- set index 0
- foreach param ${params} {
- set pattern "${param}\\s*:\\s*"
- set number_pattern "(\[-0-9.+eE\]+)\\s*"
- set ref_values ""
- set local_ref ${ref}
- if { [llength ${params}] > 1 } {
- set local_ref [lindex ${ref} ${index}]
- }
- foreach item ${local_ref} {
- if { ![regexp "$pattern$number_pattern" $ddump full res] } {
- puts "Error: checked parameter ${param} is not listed in dump"
- break
- }
- lappend ref_values $res
- set pattern "${pattern}${res},\\s*"
- ## without precision
- if { ${epsilon} == -1 } {
- if { ${item} != ${res} } {
- puts "Error: parameter ${param} - current value (${res}) is not equal to reference value (${item})"
- } else {
- puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
- }
- ## with precision
- } else {
- set precision 0.0000001
- if { ( abs($res) > $precision ) || ( abs($item) > $precision ) } {
- if { ($item != 0 && [expr 1.*abs($item - $res)/$item] > $epsilon) || ($item == 0 && $res != 0) } {
- puts "Error: The $param of the resulting shape is $res and the expected $param is $item"
- } else {
- puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
- }
- }
- }
- }
- incr index
- }
-}
-
-help checklength {
- Procedure includes commands to compute length of input curve.
-
- Use: checklength curvename [options...]
- Allowed options are:
- -l LENGTH: command length, computes the length of input curve with precision of computation
- -eps EPSILON: the epsilon defines relative precision of computation
- -equal CURVE: compare length of input curves. Puts error if its are not equal
- -notequal CURVE: compare length of input curves. Puts error if its are equal
-}
-
-proc checklength {shape args} {
- puts "checklength ${shape} ${args}"
- upvar ${shape} ${shape}
-
- if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
- puts "Error: The command cannot be built"
- return
- }
-
- set length -1
- set epsilon 1.0e-4
- set compared_equal_shape -1
- set compared_notequal_shape -1
- set equal_check 0
-
- set options {{"-eps" epsilon 1}
- {"-equal" compared_equal_shape 1}
- {"-notequal" compared_notequal_shape 1}}
-
- if { [regexp {\-[not]*equal} $args] } {
- lappend options {"-l" length 0}
- set equal_check 1
- } else {
- lappend options {"-l" length 1}
- }
- _check_args ${args} ${options} "checkprops"
-
- if { ${length} != -1 || ${equal_check} == 1 } {
- set CommandName length
- set mass $length
- set prop "length"
- set equal_check 0
- }
-
- regexp "The +length+ ${shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${shape} ${epsilon}] full m
-
- if { ${compared_equal_shape} != -1 } {
- upvar ${compared_equal_shape} ${compared_equal_shape}
- regexp "The +length+ ${compared_equal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_equal_shape} ${epsilon}] full compared_m
- if { $compared_m != $m } {
- puts "Error: length of shape ${compared_equal_shape} is not equal to shape ${shape}"
- }
- }
-
- if { ${compared_notequal_shape} != -1 } {
- upvar ${compared_notequal_shape} ${compared_notequal_shape}
- regexp "The +length+ ${compared_notequal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_notequal_shape} ${epsilon}] full compared_m
- if { $compared_m == $m } {
- puts "Error: length of shape ${compared_notequal_shape} is equal shape to ${shape}"
- }
- }
-
- if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
- if { [string compare "$mass" "empty"] != 0 } {
- if { $m == 0 } {
- puts "Error : The command is not valid. The $prop is 0."
- }
- if { $mass > 0 } {
- puts "The expected $prop is $mass"
- }
- #check of change of area is < 1%
- if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
- puts "Error : The $prop of result shape is $m"
- }
- } else {
- if { $m != 0 } {
- puts "Error : The command is not valid. The $prop is $m"
- }
- }
- }
-}
-
-help checkview {
- Display shape in selected viewer.
-
- Use: checkview [options...]
- Allowed options are:
- -display shapename: display shape with name 'shapename'
- -3d: display shape in 3d viewer
- -2d [ v2d / smallview ]: display shape in 2d viewer (default viewer is a 'smallview')
- -vdispmode N: it is possible to set vdispmode for 3d viewer (default value is 1)
- -screenshot: procedure will try to make screenshot of already created viewer
- -path <path>: location of saved screenshot of viewer
-
- Procedure can check some property of shape (length, area or volume) and compare it with some value N:
- -l [N]
- -s [N]
- -v [N]
- If current property is equal to value N, shape is marked as valid in procedure.
- If value N is not given procedure will mark shape as valid if current property is non-zero.
- -with {a b c}: display shapes 'a' 'b' 'c' together with 'shape' (if shape is valid)
- -otherwise {d e f}: display shapes 'd' 'e' 'f' instead of 'shape' (if shape is NOT valid)
- Note that one of two options -2d/-3d is required.
-}
-
-proc checkview {args} {
- puts "checkview ${args}"
-
- set 3dviewer 0
- set 2dviewer false
- set shape ""
- set PathToSave ""
- set dispmode 1
- set isScreenshot 0
- set check_length false
- set check_area false
- set check_volume false
- set otherwise {}
- set with {}
-
- set options {{"-3d" 3dviewer 0}
- {"-2d" 2dviewer ?}
- {"-display" shape 1}
- {"-path" PathToSave 1}
- {"-vdispmode" dispmode 1}
- {"-screenshot" isScreenshot 0}
- {"-otherwise" otherwise 1}
- {"-with" with 1}
- {"-l" check_length ?}
- {"-s" check_area ?}
- {"-v" check_volume ?}}
-
- # check arguments
- _check_args ${args} ${options} "checkview"
-
- if { ${PathToSave} == "" } {
- set PathToSave "./photo.png"
- }
-
- if { ${3dviewer} == 0 && ${2dviewer} == false } {
- error "Error: wrong using of command 'checkview', please use -2d or -3d option"
- }
-
- if { ${isScreenshot} } {
- if { ${3dviewer} } {
- vdump ${PathToSave}
- } else {
- xwd ${PathToSave}
- }
- return
- }
-
- set mass 0
- set isBAD 0
- upvar ${shape} ${shape}
- if {[isdraw ${shape}]} {
- # check area
- if { [string is boolean ${check_area}] } {
- if { ${check_area} } {
- regexp {Mass +: +([-0-9.+eE]+)} [sprops ${shape}] full mass
- }
- } else {
- set mass ${check_area}
- }
- # check length
- if { [string is boolean ${check_length}] } {
- if { ${check_length} } {
- regexp {Mass +: +([-0-9.+eE]+)} [lprops ${shape}] full mass
- }
- } else {
- set mass ${check_length}
- }
- # check volume
- if { [string is boolean ${check_volume}] } {
- if { ${check_volume} } {
- regexp {Mass +: +([-0-9.+eE]+)} [vprops ${shape}] full mass
- }
- } else {
- set mass ${check_volume}
- }
- } else {
- set isBAD 1
- }
- if { ${3dviewer} } {
- vinit
- vclear
- } elseif { ([string is boolean ${2dviewer}] && ${2dviewer}) || ${2dviewer} == "smallview"} {
- smallview
- clear
- } elseif { ${2dviewer} == "v2d"} {
- v2d
- 2dclear
- }
- if {[isdraw ${shape}]} {
- if { ( ${check_area} == false && ${check_length} == false && ${check_volume} == false ) || ( ${mass} != 0 ) } {
- foreach s ${with} {
- upvar ${s} ${s}
- }
- lappend with ${shape}
- if { ${3dviewer} } {
- vdisplay {*}${with}
- } else {
- donly {*}${with}
- }
- } else {
- set isBAD 1
- }
- } else {
- set isBAD 1
- }
-
- if { ${isBAD} && [llength ${otherwise}] } {
- foreach s ${otherwise} {
- upvar ${s} ${s}
- }
- if { ${3dviewer} } {
- vdisplay {*}${otherwise}
- } else {
- donly {*}${otherwise}
- }
- }
-
- if { ${3dviewer} } {
- vsetdispmode ${dispmode}
- vfit
- vdump ${PathToSave}
- } else {
- if { ([string is boolean ${2dviewer}] && ${2dviewer}) || ${2dviewer} == "smallview"} {
- fit
- } elseif { ${2dviewer} == "v2d"} {
- 2dfit
- }
- xwd ${PathToSave}
- }
-
-}
-
-help checktrinfo {
- Compare maximum deflection, number of nodes and triangles in "shape" mesh with given reference data
-
- Use: checktrinfo shapename [options...]
- Allowed options are:
- -face [N]: compare current number of faces in "shapename" mesh with given reference data.
- If reference value N is not given and current number of faces is equal to 0
- procedure checktrinfo will print an error.
- -empty[N]: compare current number of empty faces in "shapename" mesh with given reference data.
- If reference value N is not given and current number of empty faces is greater that 0
- procedure checktrinfo will print an error.
- -tri [N]: compare current number of triangles in "shapename" mesh with given reference data.
- If reference value N is not given and current number of triangles is equal to 0
- procedure checktrinfo will print an error.
- -nod [N]: compare current number of nodes in "shapename" mesh with given reference data.
- If reference value N is not givenand current number of nodes is equal to 0
- procedure checktrinfo will print an error.
- -defl [N]: compare current value of maximum deflection in "shapename" mesh with given reference data
- If reference value N is not given and current maximum deflection is equal to 0
- procedure checktrinfo will print an error.
- -max_defl N: compare current value of maximum deflection in "shapename" mesh with max possible value
- -tol_abs_tri N: absolute tolerance for comparison of number of triangles (default value 0)
- -tol_rel_tri N: relative tolerance for comparison of number of triangles (default value 0)
- -tol_abs_nod N: absolute tolerance for comparison of number of nodes (default value 0)
- -tol_rel_nod N: relative tolerance for comparison of number of nodes (default value 0)
- -tol_abs_defl N: absolute tolerance for deflection comparison (default value 0)
- -tol_rel_defl N: relative tolerance for deflection comparison (default value 0)
- -ref [trinfo a]: compare deflection, number of triangles and nodes in "shapename" and in "a"
-}
-proc checktrinfo {shape args} {
- puts "checktrinfo ${shape} ${args}"
- upvar ${shape} ${shape}
-
- if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
- puts "Error: The command cannot be built"
- return
- }
-
- set ref_nb_faces false
- set ref_nb_empty_faces true
- set ref_nb_triangles false
- set ref_nb_nodes false
- set ref_deflection false
- set tol_abs_defl 0
- set tol_rel_defl 0
- set tol_abs_tri 0
- set tol_rel_tri 0
- set tol_abs_nod 0
- set tol_rel_nod 0
- set max_defl -1
- set ref_info ""
-
- set options {{"-face" ref_nb_faces ?}
- {"-empty" ref_nb_empty_faces ?}
- {"-tri" ref_nb_triangles ?}
- {"-nod" ref_nb_nodes ?}
- {"-defl" ref_deflection ?}
- {"-tol_abs_defl" tol_abs_defl 1}
- {"-tol_rel_defl" tol_rel_defl 1}
- {"-tol_abs_tri" tol_abs_tri 1}
- {"-tol_rel_tri" tol_rel_tri 1}
- {"-tol_abs_nod" tol_abs_nod 1}
- {"-tol_rel_nod" tol_rel_nod 1}
- {"-max_defl" max_defl 1}
- {"-ref" ref_info 1}}
-
- _check_args ${args} ${options} "checktrinfo"
-
- # get current number of faces, triangles and nodes, value of max deflection
- set tri_info [trinfo ${shape}]
- set triinfo_pattern "(\[0-9\]+) +faces(.*\[^0-9]\(\[0-9\]+) +empty faces)?.*\[^0-9]\(\[0-9\]+) +triangles.*\[^0-9]\(\[0-9\]+) +nodes.*Maximal deflection +(\[-0-9.+eE\]+)"
- if {![regexp "${triinfo_pattern}" ${tri_info} dump cur_nb_faces tmp cur_nb_empty_faces cur_nb_triangles cur_nb_nodes cur_deflection]} {
- puts "Error: command trinfo prints empty info"
- }
- if { ${cur_nb_empty_faces} == "" } {
- set cur_nb_empty_faces 0
- }
-
- # get reference values from -ref option
- if { "${ref_info}" != ""} {
- if {![regexp "${triinfo_pattern}" ${ref_info} dump ref_nb_faces tmp ref_nb_empty_faces ref_nb_triangles ref_nb_nodes ref_deflection]} {
- puts "Error: reference information given by -ref option is wrong"
- }
- }
-
- # check number of faces
- if { [string is boolean ${ref_nb_faces}] } {
- if { ${cur_nb_faces} <= 0 && ${ref_nb_faces} } {
- puts "Error: Number of faces is equal to 0"
- }
- } else {
- if {[regexp {!([-0-9.+eE]+)} $ref_nb_faces full ref_nb_faces_value]} {
- if {${ref_nb_faces_value} == ${cur_nb_faces} } {
- puts "Error: Number of faces is equal to ${ref_nb_faces_value} but it should not"
- }
- } else {
- checkreal "Number of faces" ${cur_nb_faces} ${ref_nb_faces} ${tol_abs_tri} ${tol_rel_tri}
- }
- }
- # check number of empty faces
- if { [string is boolean ${ref_nb_empty_faces}] } {
- if { ${cur_nb_empty_faces} > 0 && !${ref_nb_empty_faces} } {
- puts "Error: Number of empty faces is greater that 0"
- }
- } else {
- if {[regexp {!([-0-9.+eE]+)} $ref_nb_empty_faces full ref_nb_empty_faces_value]} {
- if {${ref_nb_empty_faces_value} == ${cur_nb_empty_faces} } {
- puts "Error: Number of empty faces is equal to ${ref_nb_empty_faces_value} but it should not"
- }
- } else {
- checkreal "Number of empty faces" ${cur_nb_empty_faces} ${ref_nb_empty_faces} ${tol_abs_tri} ${tol_rel_tri}
- }
- }
-
- # check number of triangles
- if { [string is boolean ${ref_nb_triangles}] } {
- if { ${cur_nb_triangles} <= 0 && ${ref_nb_triangles} } {
- puts "Error: Number of triangles is equal to 0"
- }
- } else {
- if {[regexp {!([-0-9.+eE]+)} $ref_nb_triangles full ref_nb_triangles_value]} {
- if {${ref_nb_triangles_value} == ${cur_nb_triangles} } {
- puts "Error: Number of triangles is equal to ${ref_nb_triangles_value} but it should not"
- }
- } else {
- checkreal "Number of triangles" ${cur_nb_triangles} ${ref_nb_triangles} ${tol_abs_tri} ${tol_rel_tri}
- }
- }
-
- # check number of nodes
- if { [string is boolean ${ref_nb_nodes}] } {
- if { ${cur_nb_nodes} <= 0 && ${ref_nb_nodes} } {
- puts "Error: Number of nodes is equal to 0"
- }
- } else {
- if {[regexp {!([-0-9.+eE]+)} $ref_nb_nodes full ref_nb_nodes_value]} {
- if {${ref_nb_nodes_value} == ${cur_nb_nodes} } {
- puts "Error: Number of nodes is equal to ${ref_nb_nodes_value} but it should not"
- }
- } else {
- checkreal "Number of nodes" ${cur_nb_nodes} ${ref_nb_nodes} ${tol_abs_nod} ${tol_rel_nod}
- }
- }
-
- # check deflection
- if { [string is boolean ${ref_deflection}] } {
- if { ${cur_deflection} <= 0 && ${ref_deflection} } {
- puts "Error: Maximal deflection is equal to 0"
- }
- } else {
- checkreal "Maximal deflection" ${cur_deflection} ${ref_deflection} ${tol_abs_defl} ${tol_rel_defl}
- }
-
- if { ${max_defl} != -1 && ${cur_deflection} > ${max_defl} } {
- puts "Error: Maximal deflection is too big"
- }
-}
-
-help checkplatform {
- Return name of current platform if no options are given.
-
- Use: checkplatform [options...]
- Allowed options are:
- -windows : return 1 if current platform is 'Windows', otherwise return 0
- -linux : return 1 if current platform is 'Linux', otherwise return 0
- -osx : return 1 if current platform is 'MacOS X', otherwise return 0
-
- Only one option can be used at once.
- If no option is given, procedure will return the name of current platform.
-}
-proc checkplatform {args} {
- set check_for_windows false
- set check_for_linux false
- set check_for_macosx false
-
- set options {{"-windows" check_for_windows 0}
- {"-linux" check_for_linux 0}
- {"-osx" check_for_macosx 0}}
-
- _check_args ${args} ${options} "checkplatform"
-
- if { [regexp "indows" $::tcl_platform(os)] } {
- set current_platform Windows
- } elseif { $::tcl_platform(os) == "Linux" } {
- set current_platform Linux
- } elseif { $::tcl_platform(os) == "Darwin" } {
- set current_platform MacOS
- }
-
- # no args are given
- if { !${check_for_windows} && !${check_for_linux} && !${check_for_macosx}} {
- return ${current_platform}
- }
-
- # check usage of proc checkplatform
- if { [expr [string is true ${check_for_windows}] + [string is true ${check_for_linux}] + [string is true ${check_for_macosx}] ] > 1} {
- error "Error: wrong usage of command checkplatform, only single option can be used at once"
- }
-
- # checking for Windows platform
- if { ${check_for_windows} && ${current_platform} == "Windows" } {
- return 1
- }
-
- # checking for Mac OS X platforms
- if { ${check_for_linux} && ${current_platform} == "Linux" } {
- return 1
- }
-
- # checking for Mac OS X platforms
- if { ${check_for_macosx} && ${current_platform} == "MacOS" } {
- return 1
- }
-
- # current platform is not equal to given as argument platform, return false
- return 0
-}
-
-help checkgravitycenter {
- Compare Center Of Gravity with given reference data
-
- Use: checkgravitycenter shape prop_type x y z tol
-}
-proc checkgravitycenter {shape prop_type x y z tol} {
- puts "checkgravitycenter ${shape} $prop_type $x $y $z $tol"
- upvar ${shape} ${shape}
-
- if { $prop_type == "-l" } {
- set outstr [lprops $shape]
- } elseif { $prop_type == "-s" } {
- set outstr [sprops $shape]
- } elseif { $prop_type == "-v" } {
- set outstr [vprops $shape]
- } else {
- error "Error : invalid prop_type"
- }
-
- if { ![regexp {\nX = +([-0-9.+eE]+).*\nY = +([-0-9.+eE]+).*\nZ = +([-0-9.+eE]+)} ${outstr} full comp_x comp_y comp_z] } {
- error "Error : cannot evaluate properties"
- }
-
- if { [expr abs($comp_x-$x)] < $tol && [expr abs($comp_y-$y)] < $tol && [expr abs($comp_z-$z)] < $tol } {
- puts "Check of center of gravity is OK: value = ($comp_x, $comp_y, $comp_z), expected = ($x, $y, $z)"
- } else {
- puts "Error: center of gravity ($comp_x, $comp_y, $comp_z) is not equal to expected ($x, $y, $z)"
- }
-}
-
-help checkMultilineStrings {
- Compares two strings.
- Logically splits the strings to lines by the new line characters.
- Outputs the first different lines.
-
- Use: checkMultilineStrings <string_1> <string_2>
-}
-proc checkMultilineStrings {tS1 tS2} {
- set aL1 [split $tS1 \n]
- set aL2 [split $tS2 \n]
-
- set aC1 [llength $aL1]
- set aC2 [llength $aL2]
- set aC [expr {min($aC1, $aC2)}]
-
- for {set aI 0} {$aI < $aC} {incr aI} {
- if {[lindex $aL1 $aI] != [lindex $aL2 $aI]} {
- puts "Error. $aI-th lines are different:"
- puts "[lindex $aL1 $aI]"
- puts "[lindex $aL2 $aI]"
- }
- }
-
- if {$aC1 != $aC2} {
- puts "Error. Line counts are different: $aC1 != $aC2."
- }
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-# This script is to be executed automatically at DRAWEXE start.
-#
-# For that to happen, either environment DRAWDEFAULT should be set pointing
-# to this file, or CASROOT variable should be set, so that the script is
-# found as $CASROOT/src/DrawResources/DrawDefault
-
-# indicate that DRAW is interactive environment
-set tcl_interactive 1
-
-# define location of standard DRAW scripts; normally it is
-# $CASROOT/src/DrawResources
-set dir ""
-if { [info exists env(DRAWHOME) ] } {
- set dir $env(DRAWHOME)
-} else {
- if { [info exists env(CASROOT) ] } {
- set dir [file join $env(CASROOT) src DrawResources]
- } else {
- puts "Warning: CASROOT is not defined, some features may not load correctly"
- set dir [file dirname [info script]]
- }
-}
-
-# load standard DRAW scripts
-if { [file isdirectory $dir] } {
- foreach script {StandardCommands.tcl Geometry.tcl StandardViews.tcl
- TestCommands.tcl CheckCommands.tcl Vector.tcl} {
- if [file exist [file join $dir $script]] {
- source [file join $dir $script]
- } else {
- puts "Warning: could not find command file $script"
- }
- }
-
- # and TK extensions
- set stationname $tcl_platform(platform)
- if [info exists tk_version] {
- source [file join $dir DrawTK.tcl]
- # setup the icon for main window
- if { ${stationname} == "windows" } {
- wm iconbitmap . -default [file join $dir lamp.ico]
- }
- wm title . Draw
- }
-} else {
- puts "Warning: could not find DRAW directory"
-}
-
-# set default testing environment (unless already defined before)
-if { ! [info exists env(CSF_TestScriptsPath)] } {
- if {[info exists ::env(CSF_OCCTTestsPath)] && [file isdirectory $env(CSF_OCCTTestsPath)]} {
- set env(CSF_TestScriptsPath) $env(CSF_OCCTTestsPath)
- } elseif { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
- set env(CSF_TestScriptsPath) $env(CASROOT)/tests
- }
-}
-if {[info exists ::env(CSF_OCCTDataPath)] && [file isdirectory $env(CSF_OCCTDataPath)]} {
- if { ! [info exists env(CSF_TestDataPath)] } {
- set env(CSF_TestDataPath) $env(CSF_OCCTDataPath)
- } else {
- set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CSF_OCCTDataPath)
- }
-} elseif { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } {
- if { ! [info exists env(CSF_TestDataPath)] } {
- set env(CSF_TestDataPath) $env(CASROOT)/data
- } else {
- set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data
- }
-}
-
-# load application-defined initialization script, which is expected to
-# be found either in the file pointed by environment variable CSF_DrawAppliInit,
-# or in the file DrawAppliInit in the current directory
-set draw_appli_init_file DrawAppliInit
-if { [info exists env(CSF_DrawAppliInit)] } {
- set draw_appli_init_file $env(CSF_DrawAppliInit)
-}
-if { [file readable $draw_appli_init_file] } {
- if { [catch {source $draw_appli_init_file} res] } {
- puts "Warning: problem while loading file $draw_appli_init_file: $res"
- }
-}
-
-# on Windows, set special handler to update automatically environment variables
-# in C subsystem when Tcl environment changes (see Mantis issue #23197)
-if { $tcl_platform(platform) == "windows" && ! [catch {dgetenv PATH}] } {
- proc _update_c_env {envenv var op} {
- global env
- if { $op == "unset" } {
- if { $var != "" } {
- dsetenv $var
- } else {
- #"array get env varname" command calls _update_c_env with op="unset" and var=""
- #It leads to detach of trace from env array
- trace add variable env array _update_c_env
- trace add variable env read _update_c_env
- trace add variable env write _update_c_env
- trace add variable env unset _update_c_env
- }
- } elseif { $op == "write" } {
- dsetenv $var $env($var)
- } elseif { $op == "read" } {
- return dgetenv $var
- }
- }
- #Execute "trace add ..." block from _update_c_env proc
- _update_c_env env "" "unset"
-}
-
-# arm signal handler with default FPE setting
-dsetsignal
-
-# silent return from the script
-return
+++ /dev/null
-! Description of available plugins for DRAW Test Harness
-! *****************************************************************************
-!
-! Format of the file is compliant with the standard Open CASCADE resource files
-! (see the Resource_Manager.cdl file for details).
-!
-! Each key defines a sequence of either further keys or a name of the dynamic
-! library. Keys can be nested down to an arbitrary level. However, make sure
-! there are no cyclic dependencies (internal checks are not performed).
-!
-! For details how to implement a DRAW plugin refer to the Test Harness User's
-! Guide.
-!
-! To load a plugin use the following command in DRAW:
-!
-! Draw> pload [-PluginFileName] [[Key1] [Key2]...], where:
-! <-PluginFileName> - Defines the name of a resource file.
-! If this parameter is omitted then the default name DrawPlugin
-! is used.
-! According to the Open CASCADE resource file management rules
-! the environment variable CSF_<PluginFileName>Defaults must
-! be set and point to the directory storing the file. If it is
-! omitted then it defaults to $CASROOT/src/DrawResources.
-! [Key] - Defines the key(s) enumerating plugins to be loaded.
-! If no keys are specified then the key named DEFAULT is used
-! (if there is no such in the file then no plugins are loaded).
-!
-!
-! NOTE: Make sure the DATAEXCHANGE or XDE key succeeds the OCAF key in a sequence
-!
-
-DEFAULT : MODELING
-MODELING : TOPTEST
-VISUALIZATION : AISV
-OCAFKERNEL : DCAF
-DATAEXCHANGEKERNEL : XSDRAW, DE
-OCAF : VISUALIZATION, OCAFKERNEL
-DATAEXCHANGE : XDE, VISUALIZATION
-XDE : DATAEXCHANGEKERNEL, XDEDRAW, STEP, IGES, GLTF, OBJ, PLY, STL, VRML
-ALL : MODELING, OCAFKERNEL, DATAEXCHANGE
-
-TOPTEST : TKTopTest
-DCAF : TKDCAF
-AISV : TKViewerTest
-GL : TKOpenGlTest
-OPENGL : TKOpenGlTest
-GLES : TKOpenGlesTest
-OPENGLES : TKOpenGlesTest
-D3DHOST : TKD3DHostTest
-XSDRAW : TKXSDRAW
-XDEDRAW : TKXDEDRAW
-TOBJ : TKTObjDRAW
-DFBROWSER : TKDFBrowser
-QAcommands : TKQADraw
-VIS : TKIVtkDraw
-INSPECTOR : TKToolsDraw
-DE : TKXSDRAWDE
-STEP : TKXSDRAWSTEP
-IGES : TKXSDRAWIGES
-GLTF : TKXSDRAWGLTF
-OBJ : TKXSDRAWOBJ
-PLY : TKXSDRAWPLY
-STL : TKXSDRAWSTL
-VRML : TKXSDRAWVRML
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-#
-# TK features for Draw
-#
-
-# reload bindings
-if { [info exists tk_library] } {
- set version [split [info tclversion] "."]
- set major [lindex ${version} 0]
- set minor [lindex ${version} 1]
- if { (${major} > 8) || (${major} >= 8 && ${minor} >= 4) } {
- #source $tk_library/tk.tcl
- } else {
- source $tk_library/tk.tcl
- }
-}
-
-#fills menu "Load" with submenus
-proc fillloadmenu {} {
- set drawplugpath ""
- if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin]} {
- set drawplugpath "$::env(CSF_OCCTResourcePath)/DrawResources/DrawPlugin"
- } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/DrawPlugin]} {
- set drawplugpath "$::env(CASROOT)/src/DrawResources/DrawPlugin"
- }
-
- set chan [open [file nativename $drawplugpath]]
- while {[gets $chan line] >= 0} {
- if {[lindex [split $line ""] 0] != "!"} {
- if {[lindex [split $line ""] 0] == ""} {continue}
- set plugname [lindex [split $line " "] 0]
- addmenu Load "pload $plugname" "pload $plugname"
- }
- }
- close $chan
-}
-
-wm geometry . +10+10
-bind . <F1> {vcommands}
-
-frame .mbar -relief raised -bd 2
-pack .mbar -side top -fill x
-focus .mbar
-
-set theMenus("") ""
-set Draw_MenuIndex 0
-
-proc addmenuitem {menu options} {
-
- global theMenus Draw_MenuIndex
- if {![info exists theMenus($menu)]} {
- incr Draw_MenuIndex
- set m .mbar.m$Draw_MenuIndex.menu
- menubutton .mbar.m$Draw_MenuIndex -text $menu -menu $m
- pack .mbar.m$Draw_MenuIndex -side left
- menu $m
- set theMenus($menu) $m
- } else {set m $theMenus($menu)}
-
- eval $m add $options
-}
-
-proc addmenu {menu submenu {command ""}} {
- if {$command == ""} {set command $submenu}
- addmenuitem $menu "command -label {$submenu} -command {$command}"
-}
-
-#################################
-# Menus definition
-#################################
-
-# the file menu
-
-addmenu File "Choose Data Directory" vdatadir
-addmenu File "Load Shape (restore)" vrestore
-addmenu File "Load Script (source)" vsource
-addmenu File Exit exit
-
-# the Load menu
-fillloadmenu
-
-# the view menu
-
-source [file join $dir Move.tcl]
-
-addmenuitem Views {checkbutton -label "Extended view commands" \
- -command ShowHideExtCommands -variable ShowExtCommands -onvalue 1 -offvalue 0}
-addmenuitem Views "separator"
-addmenu Views axo {smallview AXON}
-addmenu Views top {smallview +X+Y}
-addmenu Views front {smallview +X+Z}
-addmenu Views left {smallview +Y+Z}
-addmenu Views 2d {smallview -2D-}
-addmenuitem Views "separator"
-addmenu Views mu4
-addmenu Views av2d
-addmenu Views axo
-addmenu Views pers
-
-# the display menu
-
-addmenu Display fit "fit; repaint"
-addmenu Display 2dfit "2dfit; repaint"
-addmenu Display clear
-addmenu Display 2dclear
-
-# the samples menu
-addmenu Samples "View samples" vsample
-
-# the help menu
-
-addmenu Help "System Info" sysinfo
-addmenu Help Commands vcommands
-addmenu Help About about
-addmenu Help "User Guide" openuserguide
-
-#redraw help submenu in the end of menu
-proc redrawhelp {} {
- global theMenus
- set m $theMenus(Help)
- destroy [string trimright $m ".menu"]
- if [info exists theMenus(Help)] {unset theMenus(Help)}
- addmenu Help "System Info" sysinfo
- addmenu Help Commands vcommands
- addmenu Help About about
- addmenu Help "User Guide" openuserguide
-}
-
-#################################
-# Modal dialog box
-# add OK, help, cancel buttons
-#################################
-
-proc modaldialog {box okproc {helpproc ""} {cancelproc ""}} {
- wm geometry $box +10+60
- button $box.ok -text ok -command "$okproc ; destroy $box"
- pack $box.ok -side left
- button $box.ko -text Cancel -command "$cancelproc ; destroy $box"
- pack $box.ko -side right
- if {$helpproc != ""} {
- button $box.help -text Help -command $helpproc
- pack $box.help -side right
- }
- grab set $box
-}
-
-
-#################################
-# File menu procedures
-#################################
-
-##############################
-#
-# dialbox command arg1 val1 arg2 val2 ...
-#
-##############################
-
-proc dialbox args {
- set com [lindex $args 0]
-
- toplevel .d
- wm title .d $com
-
- # com will be the command
- set com "eval $com"
-
- # create entries for the arguments
- set n [llength $args]
-
- for {set i 1} {$i < $n} {incr i 2} {
-
- frame .d.a$i
- label .d.a$i.l -text [lindex $args $i]
- entry .d.a$i.e -relief sunken
- .d.a$i.e insert end [lindex $args [expr $i+1]]
- pack .d.a$i.l -side left
- pack .d.a$i.e -side right
- pack .d.a$i -side top -fill x
-
- append com { [} ".d.a$i.e get" {]}
- }
- append com ";repaint"
-
- modaldialog .d $com "help [lindex $args 0]"
- }
-proc sdatadir {d} {
- global Draw_DataDir
- set Draw_DataDir $d
-}
-
-proc vdatadir {} {
- global Draw_DataDir
- sdatadir [tk_chooseDirectory -title "Data Directory" -initialdir $Draw_DataDir]
-}
-
-proc rresto {f} {
- if {[file exists $f]} {
- if {! [file isdirectory $f]} {
- puts "restore $f [file tail $f]"
- uplevel \#0 "restore $f [file tail $f]"
- repaint
- }
- }
-}
-
-proc vrestore {} {
- global Draw_DataDir
- rresto [tk_getOpenFile -title "Load Shape (restore)" -filetypes {{{BREP} {.brep}}} -initialdir $Draw_DataDir]
-}
-
-
-proc ssour {f} {
- global Draw_Source
- if {[file exists $f]} {
- set Draw_Source $f
- if {! [file isdirectory $f]} {
- puts "source $f [file tail $f]"
- uplevel \#0 "source $f"
- }
- }
-}
-
-set Draw_Source [pwd]
-proc vsource {} {
- global Draw_Source
- ssour [tk_getOpenFile -title "Load Script (source)" -filetypes {{{All Files} *}} -initialdir Draw_Source]
-}
-
-#Creates a "Samples" window
-proc vsamples {} {
- #create list {{category} {title} {filename}}
- set alistofthree ""
-
- set samplespath ""
- if { [array names ::env CSF_OCCTSamplesPath] != "" && "$::env(CSF_OCCTSamplesPath)" != "" && [file exists $::env(CSF_OCCTSamplesPath)/tcl/]} {
- set samplespath "$::env(CSF_OCCTSamplesPath)/tcl/"
- } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/samples/tcl/]} {
- set samplespath "$::env(CASROOT)/samples/tcl/"
- }
-
- foreach fname [glob -path "${samplespath}" *.tcl] {
-
- set chan [open $fname]
- set istitlefound 0
- while {[gets $chan line] >= 0} {
- if {[lindex [split $line " "] 0] == "#Category:"} {
- set acategory [string trim [string trimleft $line "#Category: "]]
- }
- if {[lindex [split $line " "] 0] == "#Title:"} {
- set atitle [string trim [string trimleft $line "#Title: "]]
- lappend alistofthree $acategory $atitle $fname
- incr istitlefound
- break
- }
- }
- close $chan
- if {$istitlefound == 0} {
- lappend alistofthree Other "[lindex [split $fname \\] end]" $fname
- }
- }
- #create window
- toplevel .samples
- wm title .samples "Samples"
- wm geometry .samples +0+0
- wm minsize .samples 800 600
- frame .samples.right
- frame .samples.left
- frame .samples.right.textframe
- frame .samples.right.botframe
- ttk::treeview .samples.left.tree -selectmode browse -yscrollcommand {.samples.left.treescroll set}
- pack .samples.left.tree -fill both -expand 1 -side left
- .samples.left.tree column #0 -minwidth 200
- .samples.left.tree heading #0 -text "Samples"
- pack .samples.right -side right -fill both -expand 1 -padx 10 -pady 10
- pack .samples.left -side left -padx 10 -pady 10 -fill both
- pack .samples.right.textframe -side top -fill both -expand 1
- pack .samples.right.botframe -side bottom -fill both -expand 1
- text .samples.right.textframe.text -yscrollcommand {.samples.right.textframe.scroll set} -xscrollcommand {.samples.right.botframe.scrollx set} -wrap none -width 40 -height 32
- pack .samples.right.textframe.text -fill both -side left -expand 1
- .samples.right.textframe.text delete 0.0 end
- .samples.right.textframe.text configure -state disabled
- set i 1
- foreach {acat title fnam} $alistofthree {
- if [.samples.left.tree exists $acat] {
- .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
- .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
- incr i
- continue
- } else {
- .samples.left.tree insert {} end -id $acat -text $acat
- .samples.left.tree insert $acat end -id $title -text $title -tags "selected$i"
- .samples.left.tree tag bind selected$i <1> "fillsampletext {$fnam}"
- incr i
- }
- }
- scrollbar .samples.right.textframe.scroll -command {.samples.right.textframe.text yview}
- scrollbar .samples.left.treescroll -command {.samples.left.tree yview}
- scrollbar .samples.right.botframe.scrollx -command {.samples.right.textframe.text xview} -orient horizontal
- pack .samples.right.textframe.scroll -side right -fill y
- pack .samples.right.botframe.scrollx -side top -fill x
- pack .samples.left.treescroll -side right -fill y
- button .samples.right.botframe.button -text "Run sample" -state disabled
- pack .samples.right.botframe.button -fill none -pady 10
-}
-
-#Fills the textbox in "Samples" window
-proc fillsampletext {fname} {
- .samples.right.botframe.button configure -state normal -command "lower .samples;catch {vclose ALL};catch {vremove -all}; catch {vclear}; source {$fname}"
- .samples.right.textframe.text configure -state normal
- .samples.right.textframe.text delete 0.0 end
- set chan [open "$fname"]
- while {[gets $chan line] >= 0} {
- .samples.right.textframe.text insert end "$line\n"
- }
- close $chan
- .samples.right.textframe.text configure -state disabled
-}
-
-#Creates a "Commands help" window
-proc vcommands {} {
- global Draw_Groups Find_Button_Click_Count Entry_Cache
- set Find_Button_Click_Count 0
- set Entry_Cache ""
- toplevel .commands
- focus .commands
- wm minsize .commands 800 600
- wm title .commands "Commands help"
- wm geometry .commands +0+0
- frame .commands.t
- frame .commands.left
- ttk::treeview .commands.left.tree -selectmode browse -yscrollcommand {.commands.left.treescroll set}
- .commands.left.tree column #0 -width 300
- .commands.left.tree heading #0 -text "Help treeview"
- pack .commands.left.tree -expand 1 -fill both -side left
- pack .commands.t -side right -fill both -expand 1 -padx 10 -pady 10
- pack .commands.left -side left -fill both -padx 10 -pady 10
- pack [frame .commands.t.top] -side top -fill x -padx 10 -pady 10
- text .commands.t.text -yscrollcommand {.commands.t.scroll set} -width 40
- .commands.t.text delete 0.0 end
- pack .commands.t.text -fill both -side left -expand 1
- .commands.t.text configure -state disabled
- pack [entry .commands.t.top.e -width 20] -side left
- pack [button .commands.t.top.findcom -text "Find command" -command vhelpsearch] -side left -padx 10
- pack [button .commands.t.top.textfind -text "Find in text" -command "vhelptextsearch; incr Find_Button_Click_Count"] -side left
- set i 1
- set j 100
- set newgroupinx 0
- foreach h [lsort [array names Draw_Groups]] {
- .commands.left.tree insert {} end -id $i -text $h -tags "info$i"
- .commands.left.tree tag bind info$i <1> "vcomhelp {$h}"
- set newgroupinx $j
- foreach f [lsort $Draw_Groups($h)] {
- .commands.left.tree insert $i end -id $j -text $f -tags "selected$j"
- .commands.left.tree tag bind selected$j <1> "vcomhelp {$h} $j $newgroupinx"
- incr j
- }
- incr i
- }
- scrollbar .commands.t.scroll -command {.commands.t.text yview}
- scrollbar .commands.left.treescroll -command {.commands.left.tree yview}
- pack .commands.t.scroll -side right -fill y
- pack .commands.left.treescroll -side right -fill y -expand 1
- #hotkeys
- bind .commands.t.top.e <Return> {vhelpsearch}
- bind .commands <Control-f> {focus .commands.t.top.e}
- bind .commands <Control-F> {focus .commands.t.top.e}
- bind .commands <Escape> {destroy .commands}
- }
-
-############################################################
-# Fills the textbox in "Commands help" window
-# $h -group of commands to display
-# $selindex - index of selected item in the treeview
-# $startindex - index of item int the treeview to start from
-############################################################
-proc vcomhelp {h {selindex -1} {startindex 0}} {
- global Draw_Helps Draw_Groups
- set highlighted false
- .commands.t.text configure -state normal
- .commands.t.text delete 1.0 end
- foreach f [lsort $Draw_Groups($h)] {
- if {$startindex == $selindex} {
- .commands.t.text insert end "$f : $Draw_Helps($f)\n\n" "highlightline"
- incr startindex
- set highlighted true
- continue
- }
- .commands.t.text insert end "$f : $Draw_Helps($f)\n\n"
- incr startindex
- }
- .commands.t.text tag configure highlightline -background yellow -relief raised
- .commands.t.text configure -state disabled
- if {$highlighted == true} {.commands.t.text see highlightline.last}
-}
-
-#Creates a "About" window
-proc about {} {
- toplevel .about
- focus .about
- wm resizable .about 0 0
- wm title .about "About"
- set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
- set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
- wm geometry .about 400x200+$screenwidth+$screenheight
-
- set logopath ""
- if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png]} {
- set logopath "$::env(CSF_OCCTResourcePath)/DrawResources/OCC_logo.png"
- } elseif {[array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/src/DrawResources/OCC_logo.png]} {
- set logopath "$::env(CASROOT)/src/DrawResources/OCC_logo.png"
- }
-
- image create photo occlogo -file $logopath -format png
- frame .about.logo -bg red
- frame .about.links -bg blue
- frame .about.copyright
- pack .about.logo -side top -fill both
- pack .about.links -fill both
- pack .about.copyright -side top -fill both
- label .about.logo.img -image occlogo
- pack .about.logo.img -fill both
- text .about.links.text -bg lightgray -fg blue -height 1 -width 10
- .about.links.text insert end "http://www.opencascade.com/" "link1"
- .about.links.text tag bind link1 <1> "_launchBrowser http://www.opencascade.com/"
- .about.links.text tag bind link1 <Enter> ".about.links.text configure -cursor hand2"
- .about.links.text tag bind link1 <Leave> ".about.links.text configure -cursor arrow"
- .about.links.text tag configure link1 -underline true -justify center
- pack .about.links.text -fill both
- label .about.copyright.text -text "Copyright (c) 1999-2019 OPEN CASCADE SAS"
- button .about.button -text "OK" -command "destroy .about"
- pack .about.button -padx 10 -pady 10
- pack .about.copyright.text
- .about.links.text configure -state disabled
- grab .about
- bind .about <Return> {destroy .about}
-}
-
-#Executes files and hyperlinks
-proc launchBrowser url {
- global tcl_platform
-
- if {$tcl_platform(platform) eq "windows"} {
- set command [list {*}[auto_execok start] {}]
- } elseif {$tcl_platform(os) eq "Darwin"} {
- set command [list open]
- } else {
- set command [list xdg-open]
- }
- exec {*}$command $url &
-}
-
-#Safe execution of files and hyperlinks
-proc _launchBrowser {url} {
- if [catch {launchBrowser $url} err] {
- tk_messageBox -icon error -message "error '$err' with '$command'"
- }
-}
-################################################################
-# This procedure tries to open an userguide on Draw Harness in pdf format
-# If there is no a such one, then tries to open it in html format
-# Else opens a site with this guide
-################################################################
-proc openuserguide {} {
- if { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf]} {
- _launchBrowser $::env(CSF_OCCTDocPath)/pdf/user_guides/occt_test_harness.pdf
- } elseif { [array names ::env CSF_OCCTDocPath] != "" && "$::env(CSF_OCCTDocPath)" != "" && [file exists $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html]} {
- _launchBrowser $::env(CSF_OCCTDocPath)/overview/html/occt_user_guides__test_harness.html
- } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf]} {
- _launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf
- } elseif { [array names ::env CASROOT] != "" && "$::env(CASROOT)" != "" && [file exists $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html]} {
- _launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html
- } else {
- launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html}
- }
-}
-
-#Search through commands and display the result
-proc vhelpsearch {} {
- global Draw_Groups Entry_Cache
- set searchstring [.commands.t.top.e get]
- set i 1
- set j 100
- set newgroupinx 0
- set isfound 0
- foreach h [lsort [array names Draw_Groups]] {
- set newgroupinx $j
- foreach f [lsort $Draw_Groups($h)] {
- if {$f == $searchstring} {
- incr isfound
- .commands.left.tree see $j
- .commands.left.tree selection set $j
- vcomhelp $h $j $newgroupinx
- break
- }
- incr j
- }
- incr i
- }
- if {$isfound == 0} {
- errorhelp "No help found for '$searchstring'!"
- } else {set Entry_Cache ""}
-}
-
-#Displays an error window with $errstring inside
-proc errorhelp {errstring} {
- toplevel .errorhelp
- focus .errorhelp
- wm resizable .errorhelp 0 0
- wm title .errorhelp "Error"
- set screenheight [expr {int([winfo screenheight .]*0.5-200)}]
- set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}]
- wm geometry .errorhelp +$screenwidth+$screenheight
- text .errorhelp.t -width 40 -height 5
- .errorhelp.t insert end $errstring
- button .errorhelp.button -text "OK" -command "destroy .errorhelp"
- pack .errorhelp.t
- .errorhelp.t configure -state disabled
- pack .errorhelp.button -padx 10 -pady 10
- bind .errorhelp <Return> {destroy .errorhelp}
- grab .errorhelp
-}
-
-#Search through text of help and display the result
-proc vhelptextsearch {} {
- global Draw_Helps Draw_Groups Find_Button_Click_Count Entry_Cache End_of_Search
- set searchstring [.commands.t.top.e get]
- if {$Entry_Cache != $searchstring} {
- set Find_Button_Click_Count 0
- set End_of_Search 0
- set Entry_Cache $searchstring
- }
- if {$End_of_Search} {
- errorhelp "No more '$searchstring' found!"
- return
- }
- .commands.t.text configure -state normal
- .commands.t.text delete 0.0 end
- set i 0
- set isfound 0
- foreach h [lsort [array names Draw_Groups]] {
- foreach f [lsort $Draw_Groups($h)] {
- if [string match *$searchstring* $Draw_Helps($f)] {
- incr i
- if {$i > $Find_Button_Click_Count+1} {incr isfound; break}
- .commands.t.text insert end "$f : "
- foreach line [list $Draw_Helps($f)] {
- foreach word [split $line " "] {
- if [string match *$searchstring* $word] {
- .commands.t.text insert end "$word" "highlightword"
- .commands.t.text insert end " "
- continue
- }
- .commands.t.text insert end "$word "
- }
- }
- .commands.t.text insert end \n\n
- }
- }
- }
- if {!$isfound} {
- incr End_of_Search
- }
- .commands.t.text tag configure highlightword -background yellow -relief raised
- .commands.t.text see end
-}
-
-#Create a "System information" window
-proc sysinfo {} {
- toplevel .info
- wm title .info "System information"
- wm resizable .info 0 0
- pack [frame .info.top] -side top -fill both -padx 5 -pady 10
- pack [frame .info.bot] -side bottom -fill both -padx 5 -pady 10
- pack [frame .info.top.left] -side left -fill both -padx 5 -pady 10
- pack [frame .info.top.mid] -side left -fill both -padx 5 -pady 10
- pack [frame .info.top.right] -side left -fill both -padx 5 -pady 10
- pack [label .info.top.left.label -text "OCCT build configuration "]
- pack [label .info.top.mid.label -text "Memory info"]
- pack [label .info.top.right.label -text "OpenGL info"]
- pack [text .info.top.left.text -width 50 -height 20]
- pack [text .info.top.mid.text -width 50 -height 20]
- pack [text .info.top.right.text -width 50 -height 20]
- pack [button .info.bot.button -text "Update" -command rescaninfo]
- pack [button .info.bot.close -text "Close" -command "destroy .info"] -pady 10
- rescaninfo
-}
-
-#Updates information in "System information" window
-proc rescaninfo {} {
- .info.top.left.text configure -state normal
- .info.top.mid.text configure -state normal
- .info.top.right.text configure -state normal
- .info.top.left.text delete 0.0 end
- .info.top.mid.text delete 0.0 end
- .info.top.right.text delete 0.0 end
- .info.top.left.text insert end [dversion]
- .info.top.mid.text insert end [meminfo]
- set glinfo ""
- if [catch {vglinfo} err] {
- if {$err == ""} {
- .info.top.right.text insert end "No active view. Please call vinit."
- } else {
- .info.top.right.text insert end "VISUALIZATION is not loaded. Please call pload VISUALIZATION"
- }
- } else {
- .info.top.right.text insert end [vglinfo]
- }
- .info.top.left.text configure -state disabled
- .info.top.mid.text configure -state disabled
- .info.top.right.text configure -state disabled
-}
+++ /dev/null
-srcinc:::CURVES.tcl
-srcinc:::dftree.tcl
-srcinc:::DrawDefault
-srcinc:::DrawPlugin
-srcinc:::DrawTK.tcl
-srcinc:::Geometry.tcl
-srcinc:::InitEnvironment.tcl
-srcinc:::lamp.ico
-srcinc:::Move.tcl
-srcinc:::PROFIL.tcl
-srcinc:::SCAN.tcl
-srcinc:::StandardCommands.tcl
-srcinc:::StandardViews.tcl
-srcinc:::SURFACES.tcl
-srcinc:::TestCommands.tcl
-srcinc:::TKTopTest.tcl
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-proc cmp {} {
- dtyp .
- set name [lastrep id x y b]
- global $name
- lastrep id x1 y1 z1 b
- cfindp $name id x y pole
- if {[dval pole] == 0} return
- dset x0 x1 y0 y1 z0 z1 b 0
- draw id 6 $name
- while {[dval b] == 0} {
- pick id x2 y2 z2 b nowait
- dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
- draw id 6 $name
- cmovep $name pole dx dy dz
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval b] == 1} return;
- dset dx x0-x2 dy y0-y2 dz z0-z2
- cmovep $name pole dx dy dz
-}
-
-proc smp {} {
- dtyp .
- set name [lastrep id x y b]
- global $name
- lastrep id x1 y1 z1 b
- sfindp $name id x y upole vpole
- if {[dval upole] == 0} return
- dset x0 x1 y0 y1 z0 z1 b 0
- draw id 6 $name
- while { [dval b] == 0} {
- pick id x2 y2 z2 b nowait
- dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
- draw id 6 $name
- movep $name upole vpole dx dy dz
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval b] == 1} return
- dset dx x0-x2 dy y0-y2 dz z0-z2
- movep $name upole vpole dx dy dz
-}
-
-#################################################
-# smooth
-#################################################
-
-help smooth {smooth cname tol [filename] } "DRAW Variables management"
-
-proc smooth {name tol {file ""}} {
- if {$file == ""} {
- uplevel #0 "bsmooth $name $tol"
- } else {
- global Draw_DataDir
- uplevel #0 "bsmooth $name $tol $Draw_DataDir/$file"
- }
- return $name
-}
-
-#################################################
-# beziersmooth
-#################################################
-
-help beziersmooth { beziersmooth cname tol deg [-GR -VA -PR] [filename] } "DRAW Variables management"
-
-proc beziersmooth {name tol deg option {file ""}} {
- if {$file == ""} {
- uplevel #0 "bzsmooth $name $tol $deg $option"
- } else {
- global Draw_DataDir
- uplevel #0 "bzsmooth $name $tol $deg $option $Draw_DataDir/$file"
- }
- return $name
-}
-
-help pickf {name : extract picked with mouse face as a new variable\
-} {DRAW Variables management}
-
-proc pickf {name} {
- global $name
- eval renamevar "[pickface]" $name
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-################################################
-#
-# find the name of the station
-#
-################################################
-proc wokstation {} {
- set LINE_FROM_UNAME [ exec uname -a ] ;
- if { [ regexp SunOS $LINE_FROM_UNAME ] } {
- return "sun"
- } elseif { [ regexp IRIX $LINE_FROM_UNAME ] } {
- return "sil"
- } elseif { [ regexp OSF $LINE_FROM_UNAME ] } {
- return "ao1"
- } elseif { [ regexp HP-UX $LINE_FROM_UNAME ] } {
- return "hp"
- } elseif { [ regexp Linux $LINE_FROM_UNAME ] } {
- return "lin"
- } elseif { [ regexp FreeBSD $LINE_FROM_UNAME ] } {
- return "bsd"
- } elseif { [ regexp Darwin $LINE_FROM_UNAME ] } {
- return "mac"
- } elseif { [ regexp AIX $LINE_FROM_UNAME ] } {
- return "aix"
- } else {
- return "wnt"
- }
-
-}
-
-set env(STATION) [ wokstation ]
-
-# PMN LE 6/06/1997
-# Ce type d'environnement n'a rien n'a faire dans les sources
-# On doit le faire dans des ilots.tcl ou des ud.tcl ou bien
-# dans les procedures de test externes a WOK
-#set env(WBCONTAINER) /adv_20/BAG
-#set env(WBROOT) "/adv_21/MDL/k1deb/ref"
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-#
-# 02/02/1996 : pbo : creation
-# 25/10/1996 : pbo : add 2d view
-#
-# rotation/panning/zoom with buttons
-#
-
-frame .move -relief groove -borderwidth 1
-#toplevel .move
-
-frame .move.rotate -borderwidth 1
-label .move.rotate.title -text " Rotation "
-button .move.rotate.l -text " < " -command {l ; repaint}
-button .move.rotate.r -text " > " -command {r ; repaint}
-button .move.rotate.u -text " ^ " -command {u ; repaint}
-button .move.rotate.d -text " v " -command {d ; repaint}
-pack .move.rotate.title -side top
-pack .move.rotate.l -side left
-pack .move.rotate.r -side right
-pack .move.rotate.u -side top
-pack .move.rotate.d -side bottom
-pack .move.rotate
-
-frame .move.panning -borderwidth 1
-label .move.panning.title -text " Panning "
-button .move.panning.l -text " < " -command {pl ; 2dpl ; repaint}
-button .move.panning.r -text " > " -command {pr ; 2dpr ; repaint}
-button .move.panning.u -text " ^ " -command {pu ; 2dpu ; repaint}
-button .move.panning.d -text " v " -command {pd ; 2dpd ; repaint}
-pack .move.panning.title -side top
-pack .move.panning.l -side left
-pack .move.panning.r -side right
-pack .move.panning.u -side top
-pack .move.panning.d -side bottom
-pack .move.panning
-
-frame .move.zoom -borderwidth 1
-label .move.zoom.title -text " Zoom "
-button .move.zoom.mu -text " + " -command {mu ; 2dmu ; repaint}
-button .move.zoom.md -text " - " -command {md ; 2dmd ; repaint}
-button .move.zoom.fit -text "max" -command {fit ; 2dfit; repaint}
-button .move.zoom.w -text "win" -command {wzoom ; repaint}
-pack .move.zoom.title -side top
-pack .move.zoom.w -side left
-pack .move.zoom.fit -side right
-pack .move.zoom.mu -side top
-pack .move.zoom.md -side bottom
-pack .move.zoom
-
-frame .pick -borderwidth 1
-label .pick.title -text " Pick "
-button .pick.coords -text "Coords" -command {catch {puts [mpick]}}
-button .pick.dist -text "Dist" -command {catch {puts [mdist]}}
-button .pick.whatis -text "What is" -command {catch {puts [whatis .]}}
-button .pick.erase -text "Erase" -command {catch {puts [erase .]}}
-pack .pick.title
-pack .pick.coords -pady 2 -padx 10
-pack .pick.dist -pady 2 -padx 10
-pack .pick.whatis -pady 2 -padx 10
-pack .pick.erase -pady 2 -padx 10
-
-set ShowExtCommands 0
-
-proc ShowHideExtCommands {} {
- global ShowExtCommands
- if $ShowExtCommands {
- pack .move -pady 1 -padx 1 -side left
- pack .pick -pady 1 -padx 1
- } else {
- pack forget .move .pick
- }
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-# File: BRepOffset.cxx
-# Created: Wed Oct 25 10:39:23 1995
-# Author: Bruno DUMORTIER
-# <dub@fuegox>
-
-
-addmenu Sketch "Sketch" { vprofil2d }
-
-proc mkprofil2d {last} {
- global [.top.p.eobj.name get]
- global [.top.p.eobj.face get]
- global DX
- global DY
- global DX0
- global DY0
-
- append cmd " F "
- append cmd [dval DX] " " [dval DY]
-
- for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
- append cmd " [.top.l.lb.cm get $i]"
- }
- if [info exist cmd] {
- uplevel #0 eval 2dprofile [.top.p.eobj.name get] $cmd $last
- }
- .top.p.eobj.com delete 0 end
- set DX0 [dval DX]
- set DY0 [dval DY]
- update
- repaint
-}
-
-proc mkprofil3d {last} {
- global [.top.p.eobj.name get]
- global [.top.p.eobj.face get]
- global DX
- global DY
-
- append cmd " F "
- append cmd [dval DX] " " [dval DY]
-
- if [info exist [.top.p.eobj.face get]] {
- append cmd " S"
- append cmd " [.top.p.eobj.face get]";
- }
- for {set i 0} {$i < [.top.l.lb.cm size]} {incr i} {
- append cmd " [.top.l.lb.cm get $i]"
- }
- if [info exist cmd] {
- puts $cmd
- eval profile [.top.p.eobj.name get] $cmd $last
- }
- .top.p.eobj.com delete 0 end
- repaint
-}
-
-proc bougex {} {
- global DX
- global DY
-
- dset x0 DX
- dset y0 DY
-
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset DX x0+x2-x1 DY y0
- mkprofil2d WW
- }
- if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
- dset DX x0 DY y0
- mkprofil2d WW
-}
-
-proc bougey {} {
- global DX
- global DY
-
- dset x0 DX
- dset y0 DY
-
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset DX x0 DY y0+y2-y1
- mkprofil2d WW
- }
- if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
- dset DX x0 DY y0
- mkprofil2d WW
-}
-
-proc bouge {} {
- global DX
- global DY
-
- dset x0 DX
- dset y0 DY
-
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset DX x0+x2-x1 DY y0+y2-y1
- mkprofil2d WW
- }
- if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
- dset DX x0 DY y0
- mkprofil2d WW
-}
-
-proc bougefp {} {
- global DX
- global DY
-
- dset x0 DX
- dset y0 DY
-
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick 29 x2 y2 z2 MOUSEbutton nowait
- dset DX x2 DY y2
- mkprofil2d WW
- }
- if {[dval MOUSEbutton] == 1} { mkprofil2d WW; return; }
- dset DX x0 DY y0
- mkprofil2d WW
-}
-
-proc movex {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x1
- if { [dval dx] != 0 } {
- append MO "x "
- append MO [dval dx]
- }
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- if { [dval dx] != 0 } {
- append MO "x "
- append MO [dval dx]
- }
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc movey {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dy y2-y1
- if { [dval dy] != 0 } {
- append MO "y "
- append MO [dval dy]
- }
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- if { [dval dy] != 0 } {
- append MO "y "
- append MO [dval dy]
- }
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc movec {} {
- autodisplay
- upvar #0 pi PI
- upvar #0 CurX CX
- upvar #0 CurY CY
- upvar #0 CurDX CDX
- upvar #0 CurDY CDY
-
- line dummyline CX CY CDX CDY
-
- point p1 CX CY
- repaint
- pick id x1 y1 z1 MOUSEbutton
- dset sign 1
- if {[dval MOUSEbutton] == 2} { dset sign -1}
- dset MOUSEbutton 0
- autodisplay
-
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- autodisplay
- point p2 x2 y2
- cirtang dummy dummyline p1 p2
- dset PS sign*(CDX*(y2-CY)-CDY*(x2-CX))
- if { [dval PS] < 0 } { reverse dummy_1}
- parameters dummy_1 CX CY U1
- parameters dummy_1 x2 y2 U2
- autodisplay
- eval trim dummy_1 dummy_1 U1 U2
- repaint
- }
-
- if {[dval MOUSEbutton] == 1} {
- erase dummy_1
- set MO ""
- if { [dval U2] < [dval U1]} { dset U2 U2+2*PI}
- dset da sign*180*(U2-U1)/PI
- 2dcvalue dummy_1 0 X Y DX DY
- dset dr sqrt(DX*DX+DY*DY)
- dset PS CDX*(y2-CY)-CDY*(x2-CX)
- if { [dval PS] < 0 } {dset dr -dr}
- if { [dval dr] != 0 } {
- if { [dval da] != 0 } {
- append MO "c "
- append MO [format "%.3f" [dval dr]] " "
- append MO [format "%.3f" [dval da]]
- .top.l.lb.cm insert end $MO
- }
- }
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc movel {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dr sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
- if { [dval dr] != 0 } {
- append MO "l "
- append MO [dval dr]
- }
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- if { [dval dr] != 0 } {
- append MO "l "
- append MO [dval dr]
- }
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc movet {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x1 dy y2-y1
- if { [dval dx] != 0 || [dval dy] != 0 } {
- append MO "t "
- append MO [dval dx] " " [dval dy]
- }
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- if { [dval dx] != 0 || [dval dy] != 0 } {
- append MO "t "
- append MO [dval dx] " " [dval dy]
- }
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc movexx {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- append MO "xx "
- append MO [dval x2]
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- append MO "xx "
- append MO [dval x2]
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc moveyy {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- append MO "yy "
- append MO [dval y2]
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- append MO "yy "
- append MO [dval y2]
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc moveix {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- append MO "ix "
- append MO [dval x2]
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- append MO "ix "
- append MO [dval x2]
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc moveiy {} {
- pick id x1 y1 z1 MOUSEbutton
- dset MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- set MO ""
- pick id x2 y2 z2 MOUSEbutton nowait
- append MO "iy "
- append MO [dval y2]
- append MO " WW"
- mkprofil2d $MO
- }
- if {[dval MOUSEbutton] == 1} {
- set MO ""
- append MO "iy "
- append MO [dval y2]
- .top.l.lb.cm insert end $MO
- mkprofil2d WW
- return
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
-}
-
-proc vprofil2d {} {
-
- toplevel .top -bg cornsilk
- wm geometry .top +10+10
- wm title .top "SKETCHER"
-
- frame .top.l -bg cornsilk
-
- frame .top.l.lb -bg azure1 -relief ridge -bd 4
- listbox .top.l.lb.cm -bg azure1 -yscrollcommand ".top.l.lb.sc set"
-# scrollbar .top.l.lb.sc -bg azure2 -fg grey80 -activeforeground grey90\
-# -relief sunken -command ".top.l.lb.cm yview"
- scrollbar .top.l.lb.sc -bg azure2 \
- -relief sunken -command ".top.l.lb.cm yview"
- bind .top.l.lb.cm <Double-Button-1> {
- .top.p.eobj.com delete 0 end
- .top.p.eobj.com insert end\
- [.top.l.lb.cm get [.top.l.lb.cm curselection]]
- }
- pack .top.l.lb.cm .top.l.lb.sc -side left -fill both -padx 2m
-
- frame .top.l.t -bg azure2 -relief ridge -bd 4
- radiobutton .top.l.t.a -bg azure3 -activebackground azure2\
- -text "face" -variable proftype -value F
- radiobutton .top.l.t.b -bg azure3 -activebackground azure2\
- -text "closed" -variable proftype -value W
- radiobutton .top.l.t.c -bg azure3 -activebackground azure2\
- -text "wire" -variable proftype -value " "
-
- frame .top.l.f -bg azure2 -relief ridge -bd 4
- button .top.l.f.f -bg deepskyblue -activebackground lightskyblue1\
- -text " FIT " -command {
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
- 2dfit; repaint
- }
- button .top.l.f.u -bg deepskyblue -activebackground lightskyblue1\
- -text " ZOOM + " -command {
- 2dmu; repaint
- }
- button .top.l.f.d -bg deepskyblue -activebackground lightskyblue1\
- -text " ZOOM - " -command {2dmd; repaint}
-
- pack .top.l.f.f .top.l.f.u .top.l.f.d -side right -padx 1m -pady 1m
-
- frame .top.l.d -bg azure2 -relief ridge -bd 4
- button .top.l.d.u -bg deepskyblue -activebackground lightskyblue1\
- -text " UP" -command 2dpu
- button .top.l.d.d -bg deepskyblue -activebackground lightskyblue1\
- -text "DOWN" -command 2dpd
- button .top.l.d.l -bg deepskyblue -activebackground lightskyblue1\
- -text "LEFT" -command 2dpl
- button .top.l.d.r -bg deepskyblue -activebackground lightskyblue1\
- -text "RIGHT" -command 2dpr
- pack .top.l.d.u .top.l.d.d .top.l.d.l .top.l.d.r -side left\
- -padx 1m -pady 1m
-
- frame .top.l.q -bg azure2 -relief ridge -bd 4
- button .top.l.q.ok -bg deepskyblue -activebackground lightskyblue1\
- -text " VALI " -command {
- delete 29
- if { $proftype == "F"} {
- set proftype " "
- } elseif { $proftype != "W" } {
- set proftype "WW"
- }
- mkprofil3d $proftype
- destroy .top
- if [info exist PickedFace] { erase PickedFace}
- repaint;
- }
- button .top.l.q.ko -bg deepskyblue -activebackground lightskyblue1\
- -text " CANCEL " -command {
- delete 29
- if [info exist [.top.p.eobj.name get]] {
- eval unset [.top.p.eobj.name get];
- }
- destroy .top
- if [info exist PickedFace] { unset PickedFace}
- repaint;
- }
- button .top.l.q.h -bg deepskyblue -activebackground lightskyblue1\
- -text " HELP " -command helpme
- pack .top.l.q.ok .top.l.q.ko .top.l.q.h -side left -fill both\
- -padx 2m -pady 1m
-
- pack .top.l.t.a .top.l.t.b .top.l.t.c -side left -padx 1m -pady 1m
-
- pack .top.l.lb .top.l.t -side top -pady 1m -fill both
- pack .top.l.f .top.l.d -side top -pady 1m -fill both
- pack .top.l.q -side bottom -fill both -pady 1m
-
- pack .top.l -side left -fill both -padx 1m
-
- frame .top.p -bg azure2 -relief ridge -bd 4
-
- frame .top.p.obj -bg azure2
- frame .top.p.eobj -bg azure2
- label .top.p.obj.name -bg azure2 -text "Name:"
- entry .top.p.eobj.name -bg azure1 -relief sunken
- .top.p.eobj.name insert end "prof"
-
- label .top.p.obj.com -bg azure2 -text "Command:"
- entry .top.p.eobj.com -bg azure1 -relief sunken
- bind .top.p.eobj.com <Return> {
- .top.l.lb.cm insert end [.top.p.eobj.com get]
- mkprofil2d WW
- }
-
- label .top.p.obj.face -bg azure2 -text "Face:"
- entry .top.p.eobj.face -bg azure1 -relief sunken -textvariable CURFACE
- bind .top.p.eobj.face <Return> {
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- } elseif { [.top.p.eobj.face get] == "."} {
- uplevel #0 pickface
- set CURFACE PickedFace
- uplevel #0 eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
- 2dfit
- repaint
- }
-
- label .top.p.obj.x0 -bg azure2 -text "X0:"
- entry .top.p.eobj.x0 -bg azure1 -relief sunken -textvariable DX0
- bind .top.p.eobj.x0 <Return> {
- dset DX [expr $DX0]
- mkprofil2d WW
- }
-
- label .top.p.obj.y0 -bg azure2 -text "Y0:"
- entry .top.p.eobj.y0 -bg azure1 -relief sunken -textvariable DY0
- bind .top.p.eobj.y0 <Return> {
- dset DY [expr $DY0]
- mkprofil2d WW
- }
-
- frame .top.c -bg azure2 -relief ridge -bd 4
- button .top.c.add -bg deepskyblue -activebackground lightskyblue1\
- -text " Add " -command {
- .top.l.lb.cm insert end [.top.p.eobj.com get]
- mkprofil2d WW
- }
- button .top.c.rem -bg deepskyblue -activebackground lightskyblue1\
- -text "Remove" -command {
- if {[.top.l.lb.cm curselection] != ""} {
- .top.l.lb.cm delete [.top.l.lb.cm curselection]
- } else {
- .top.l.lb.cm delete end
- }
- 2dclear
- if [info exist [.top.p.eobj.face get]] {
- eval pcurve [.top.p.eobj.face get];
- }
- mkprofil2d WW
- }
- button .top.c.set -bg deepskyblue -activebackground lightskyblue1\
- -text " Set " -command {
- if {[.top.l.lb.cm curselection] != ""} {
- .top.l.lb.cm insert [.top.l.lb.cm curselection]\
- [.top.p.eobj.com get]
- .top.l.lb.cm delete [.top.l.lb.cm curselection]
- } else {
- .top.l.lb.cm insert end [.top.l.lb.cm get]
- }
- mkprofil2d WW
- }
- pack .top.c.add .top.c.rem .top.c.set -side left -fill both\
- -padx 4m -pady 1m
-
- frame .top.m -bg azure2 -relief ridge -bd 4
-
- frame .top.m.m1 -bg azure2
- button .top.m.m1.x -bg deepskyblue -activebackground lightskyblue1\
- -text " X " -command movex
- button .top.m.m1.xx -bg deepskyblue -activebackground lightskyblue1\
- -text " XX " -command movexx
-
- frame .top.m.m2 -bg azure2
- button .top.m.m2.y -bg deepskyblue -activebackground lightskyblue1\
- -text " Y " -command movey
- button .top.m.m2.yy -bg deepskyblue -activebackground lightskyblue1\
- -text " YY " -command moveyy
-
- frame .top.m.m3 -bg azure2
- button .top.m.m3.c -bg deepskyblue -activebackground lightskyblue1\
- -text " C " -command movec
- button .top.m.m3.ix -bg deepskyblue -activebackground lightskyblue1\
- -text " IX " -command moveix
-
- frame .top.m.m4 -bg azure2
- button .top.m.m4.l -bg deepskyblue -activebackground lightskyblue1\
- -text " L " -command movel
- button .top.m.m4.iy -bg deepskyblue -activebackground lightskyblue1\
- -text " IY " -command moveiy
-
- frame .top.m.m5 -bg azure2
- button .top.m.m5.t -bg deepskyblue -activebackground lightskyblue1\
- -text " T " -command movet
- button .top.m.m5.tt -bg deepskyblue -activebackground lightskyblue1\
- -text " TT " -command movett
-
- frame .top.sc -bg azure2 -relief ridge -bd 4
- frame .top.sc.sc1 -bg azure2
- button .top.sc.sc1.d -bg deepskyblue -activebackground lightskyblue1\
- -text "SCAN" -command bouge
- button .top.sc.sc1.f -bg deepskyblue -activebackground lightskyblue1\
- -text " First Point " -command bougefp
-
- frame .top.sc.sc2 -bg azure2
- button .top.sc.sc2.x -bg deepskyblue -activebackground lightskyblue1\
- -text " SCAN X " -command bougex
- button .top.sc.sc2.y -bg deepskyblue -activebackground lightskyblue1\
- -text " SCAN Y " -command bougey
-
- pack .top.p.obj.name .top.p.obj.com .top.p.obj.face .top.p.obj.x0\
- .top.p.obj.y0 -side top -fill x -pady 1m
- pack .top.p.eobj.name .top.p.eobj.com .top.p.eobj.face .top.p.eobj.x0\
- .top.p.eobj.y0 -side top -fill x -pady 1m
- pack .top.p.obj .top.p.eobj -side left
-
- pack .top.m.m1.x .top.m.m1.xx -side top -fill x -pady 1m
- pack .top.m.m2.y .top.m.m2.yy -side top -fill x -pady 1m
- pack .top.m.m3.c .top.m.m3.ix -side top -fill x -pady 1m
- pack .top.m.m4.l .top.m.m4.iy -side top -fill x -pady 1m
- pack .top.m.m5.t .top.m.m5.tt -side top -fill x -pady 1m
- pack .top.m.m1 .top.m.m2 .top.m.m3 .top.m.m4 .top.m.m5 -side left -padx 2m
-
- pack .top.sc.sc1.d .top.sc.sc1.f -side top -fill x -pady 1m
- pack .top.sc.sc2.x .top.sc.sc2.y -side top -fill x -pady 1m
- pack .top.sc.sc1 .top.sc.sc2 -side left -padx 6m
-
- pack .top.p -side top -fill both -padx 1m -pady 1m
- pack .top.c -side top -fill both -padx 1m -pady 1m
- pack .top.m -side top -fill both -padx 1m -pady 1m
- pack .top.sc -side top -fill both -padx 1m -pady 1m
-
- #global variables and init them
- global proftype
- global CURFACE
- global DX
- global DY
- global DX0
- global DY0
-
- set proftype " "
- set CURFACE ""
- set DX0 ""
- set DY0 ""
- dset DX 0
- dset DY 0
-
- view 29 -2D- 465 10 664 410
- 2dclear
- # call 2dprofile to initialize CurX CurY CurDX CurDY
- mkprofil2d WW
-}
-
-proc helpme {} {
- toplevel .h -bg azure3
- wm title .h "HELP"
- wm geometry .h +40+90
- message .h.m -justify left -bg azure2 -width 13c -relief ridge -bd 4 -text\
- "Build a profile in the UV plane from a moving point and direction.\n \
- The original point and direction are 0 0 and 1 0.\n \
- Codes and values describe the point or direction change.\n \
- When the point change the direction becomes the tangent.\n \
- All angles are in degree (may be negative).\n \
- By default the profile is closed.\n \
- \n \
- Instruction\tParameters\tAction\n \
- F\t\tX Y\t\tSet the first point\n \
- X\t\tDX\t\tTranslate point along X\n \
- Y\t\tDY\t\tTranslate point along Y\n \
- L\t\tDL\t\tTranslate point along direction\n \
- XX\t\tX\t\tSet point X coordinate\n \
- YY\t\tY\t\tSet point Y coordinate\n \
- T\t\tDX DY\t\tTranslate point\n \
- TT\t\tX Y\t\tSet point\n \
- R\t\tAngle\t\tRotate direction\n \
- RR\t\tAngle\t\tSet direction\n \
- D\t\tDX DY\t\tSet direction\n \
- IX\t\tX\t\tIntersect with vertical\n \
- IY\t\tY\t\tIntersect with horizontal\n \
- C\t\tRadius Angle\tArc of circle tangent to direction"
-
- frame .h.q -relief ridge -bd 4 -bg azure3
- button .h.q.q -bg deepskyblue -activebackground lightskyblue1 -text "QUIT" -command {destroy .h}
- pack .h.q.q -padx 1m -pady 1m
- pack .h.m .h.q -side top -pady 2m
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-proc 2dscan {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- erase $name
- draw id 6 $name
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
- draw id 6 $name
- 2dtranslate $name dx dy
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval MOUSEbutton] == 1} { display $name; return; }
- dset dx x0-x2 dy y0-y2 dz z0-z2
- 2dtranslate $name dx dy
- display $name
-}
-
-proc scan {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- erase $name
- draw id 6 $name
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
- draw id 6 $name
- translate $name dx dy dz
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval MOUSEbutton] == 1} { display $name; return; }
- dset dx x0-x2 dy y0-y2 dz z0-z2
- translate $name dx dy dz
- display $name
-}
-
-proc scanx {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- erase $name
- draw id 6 $name
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x1 x1 x2
- draw id 6 $name
- translate $name dx 0 0
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval MOUSEbutton] == 1} {display $name; return;}
- dset dx x0-x2
- translate $name dx 0 0
- display $name
-}
-
-proc scany {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- erase $name
- draw id 6 $name
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dy y2-y1 y1 y2
- draw id 6 $name
- translate $name 0 dy 0
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval MOUSEbutton] == 1} { display $name; return;}
- dset dy y0-y2
- translate $name 0 dy 0
- display $name
-}
-
-proc scanz {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- erase $name
- draw id 6 $name
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dz z2-z1 z1 z2
- draw id 6 $name
- translate $name 0 0 dz
- draw id 6 $name
- }
- draw id 6 $name
- if {[dval MOUSEbutton] == 1} { display $name; return;}
- dset dz z0-z2
- translate $name 0 0 dz
- display $name
-}
-
-proc tscan {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x0 dy y2-y0 dz z2-z0
- eval ttranslate [explode $name e] dx dy dz
- repaint
- }
- if {[dval MOUSEbutton] == 3} return;
- dset dx x2-x0 dy y2-y0 dz z2-z0
- ttranslate $name dx dy dz
-}
-
-proc tscanx {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dx x2-x0
- eval ttranslate [explode $name e] dx 0 0
- repaint
- }
- if {[dval MOUSEbutton] == 3} return;
- dset dx x2-x0
- ttranslate $name dx 0 0
-}
-
-proc tscany {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dy y2-y0
- eval ttranslate [explode $name e] 0 dy 0
- repaint
- }
- if {[dval MOUSEbutton] == 3} return;
- dset dy y2-y0
- ttranslate $name 0 dy 0
-}
-
-proc tscanz {} {
- dtyp .
- set name [lastrep id x y MOUSEbutton]
- global $name
- lastrep id x1 y1 z1 MOUSEbutton
- dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
- while {[dval MOUSEbutton] == 0} {
- pick id x2 y2 z2 MOUSEbutton nowait
- dset dz z2-z0
- eval ttranslate [explode $name e] 0 0 dz
- repaint
- }
- if {[dval MOUSEbutton] == 3} return;
- dset dz z2-z0
- ttranslate $name 0 0 dz
-}
-
-
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-if { [info commands addmenu] == "" } { return }
-
-global theMenus
-if [info exists theMenus(Surfaces)] {
- destroy [string trimright $theMenus(Surfaces) ".menu"]
- unset theMenus(Surfaces)
-}
-
-proc dialanasurf {command sname args} {
- set com "dialbox $command name $sname origin {0 0 0} normal {0 0 1} xdir {1 0 0} "
- foreach l $args {append com " $l"}
- eval $com
-}
-
-addmenu Surfaces "Plane" {dialanasurf plane p {}}
-addmenu Surfaces "Cylinder" {dialanasurf cylinder c {radius 1}}
-addmenu Surfaces "Cone" {dialanasurf cone c {angle 30 radius 0}}
-addmenu Surfaces "Sphere" {dialanasurf sphere s {radius 1}}
-addmenu Surfaces "Torus" {dialanasurf torus t {radii {1 0.8}}}
-addmenu Surfaces "Revolution" {dialbox revsur name r basis . origin {0 0 0} axis {0 0 1}}
-addmenu Surfaces "Extrusion" {dialbox extsurf name e basis . direction {0 0 1}}
-redrawhelp
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-#
-# Draw standard initialisation
-#
-
-#################################################
-# prompts
-#################################################
-
-set Draw_CmdIndex 0
-set tcl_prompt1 {
- incr Draw_CmdIndex
- puts -nonewline "Draw\[$Draw_CmdIndex\]> "
-}
-
-set tcl_prompt2 {puts -nonewline "> "}
-
-#################################################
-# the help command in TCL
-#################################################
-proc help {{theCommand ""} {theHelpString ""} {theGroup "Procedures"}} {
- global Draw_Helps Draw_Groups
- if {$theCommand == ""} {
- # help general
- set aCmdWidth 15
- foreach aGrpIter [lsort [array names Draw_Groups]] {
- dputs -intense "\n\n$aGrpIter"
- set i 1
- set aLine ""
- foreach aCmdIter [lsort $Draw_Groups($aGrpIter)] {
- if {$i == 1} {
- puts -nonewline "$aLine\n"
- set aLine " "
- }
-
- append aLine $aCmdIter
- set aLineLen [string length $aLine]
- for {set j [expr $aLineLen + 1]} {$j < [expr $aCmdWidth * $i + 2]} {incr j} {
- append aLine " "
- }
- append aLine " "
- incr i
- if {$i == 5} {set i 1}
- }
- puts "$aLine"
- }
- } elseif {$theHelpString == ""} {
- # help function
- set isFound 0
- foreach aCmdIter [lsort [array names Draw_Helps]] {
- if {[string match $theCommand $aCmdIter]} {
- dputs -nonewline -intense $aCmdIter
- set aLines [split $Draw_Helps($aCmdIter) "\n"]
- set aNbLines [llength $aLines]
- set isFirstLine 0
- for {set aLineIter 0} {$aLineIter < $aNbLines} {incr aLineIter} {
- set aLine [lindex $aLines $aLineIter]
- if { "$aLine" == "" && ($aLineIter == 0 || $aLineIter == [expr $aNbLines - 1]) } { continue }
- if { $isFirstLine == 0 } {
- set isFirstLine 1
- for {set j [string length $aCmdIter]} {$j < 15} {incr j} {
- puts -nonewline " "
- }
- puts -nonewline " : "
- } else {
- if { ![string match "\t\t:*" $aLine] } {
- puts -nonewline " : "
- }
- }
- puts -nonewline "${aLine}\n"
- }
- set isFound 1
- }
- }
- if {!$isFound} {
- if {[string first * $theCommand] != -1} {
- puts "No matching commands found!"
- } else {
- puts "No help found for '$theCommand'! Please try 'help $theCommand*' to find matching commands."
- }
- }
- } else {
- # set help
- lappend Draw_Groups($theGroup) $theCommand
- set Draw_Helps($theCommand) $theHelpString
- }
- flush stdout
-}
-
-help help {help pattern, or help command string group, to set help} {DRAW General Commands}
-#################################################
-# the getsourcefile command in TCL
-#################################################
-
-help getsourcefile {getsourcefile, or getsourcefile command } {DRAW General Commands}
-
-proc getsourcefile {{command ""}} {
-
- global Draw_Helps Draw_Groups Draw_Files
-
- set out {}
- if {$command == ""} {
-
- # help general
- foreach h [lsort [array names Draw_Groups]] {
- lappend out "" "" "$h"
- set i 0
- foreach f [lsort $Draw_Groups($h)] {
- if {$i == 0} {
- lappend out ""
- }
- incr i
-#
-# check that the command has its source file set
-#
- foreach command_that_has_file [array names Draw_Files] {
- if {($command_that_has_file == $f)} {
- lappend out [format {%-20s %s} $f $Draw_Files($f)]
- }
- }
- }
- }
- } else {
-
- # getsourcefile fonction
- append command "*"
- foreach f [lsort [array names Draw_Files]] {
- if {[string match $command $f]} {
- lappend out [format {%-20s %s} $f $Draw_Files($f)]
- }
- }
-
- }
- return [join $out "\n"]
-}
-
-#################################################
-# whatis
-#################################################
-
-#proc gwhatis {aVarName} {
-# global $aVarName
-# puts -nonewline $aVarName; puts -nonewline " is a "; puts [dtyp ${aVarName}]
-#}
-
-help whatis "whatis object1 object2 ..."
-
-proc whatis args {
- set __out_string ""
- foreach i $args {
- if {$i == "."} {set i [dname $i]}
- #gwhatis $i
- global $i
- set __tmp_string "$i is a [dtyp $i]\n"
- set __out_string "${__out_string}${__tmp_string}"
- }
- return ${__out_string}
-}
-
-#################################################
-# library, lsource
-#################################################
-
-proc library lib {
- global auto_path
- set auto_path [linsert $auto_path 0 $lib]
- if [file readable $lib/LibraryInit] {
- puts "Loading $lib/LibraryInit"
- uplevel "source $lib/LibraryInit"
- }
-}
-
-proc lsource file {
- if [file readable $file] {source $file} else {
- global auto_path
- foreach dir $auto_path {
- if [file readable $dir/$file] {
- uplevel #0 "source $dir/$file"
- break
- }
- }
- }
-}
-
-#################################################
-# directory
-#################################################
-
-proc isgdraw {var} {
- global $var
- return [isdraw $var]
-}
-
-help directory {directory [pattern], list draw variables} {DRAW Variables management}
-
-proc directory {{joker *}} {
- set res ""
- foreach var [info globals $joker] {
- if [isgdraw $var] {lappend res $var}
- }
- return $res
-}
-
-proc lsd {} { exec ls [datadir] }
-
-proc dall {} {
- set schmurtz ""
- foreach var [info globals] {
- global $var
- if [isdraw $var] {
- if ![isprot $var] {
- lappend schmurtz $var; unset $var
- }
- }
- }
- return $schmurtz
-}
-
-#################################################
-# repeat, do
-#################################################
-
-proc repeat {val script} {
- for {set i 1} {$i <= $val} {incr i} {uplevel $script}
-}
-
-proc do {var start end args} {
- global errorInfo errorCode
- if {[llength args] == 1} {
- set incr 1
- set body args
- } else {
- set incr [lindex 1 args]
- set body [lindex 2 args]
- }
- upvar $var v
- if {[dval $incr] < 0} {set rel >=} else {set rel <=}
- for {dset v $start} {[dval v] $rel [dval end]} {dset v [dval v+($incr)]} {
- set code [catch {uplevel $body} string]
- if {$code == 1} {
- return -code error -errorInfo $errorInfo -errorcode $errorCode $string
- } elseif {$code == 2} {
- return -code return $string
- }elseif {$code == 3} {
- return
- } elseif {$code > 4} {
- return -code $code $string
- }
- }
-}
-
-#################################################
-# datadir, save, restore
-#################################################
-
-set Draw_DataDir "."
-
-help datadir {datadir [directory]} "DRAW Variables management"
-
-proc datadir {{dir ""}} {
- global Draw_DataDir
- if {$dir != ""} {
- if {![file isdirectory $dir]} {
- error "datadir : $dir is not a directory"
- } else {
- set Draw_DataDir $dir
- }
- }
- return $Draw_DataDir
-}
-
-help save {save variable [filename]} "DRAW Variables management"
-
-proc save {name {file ""}} {
- if {$file == ""} {set file $name}
- upvar $name n
- if {![isdraw n]} {error "save : $name is not a Draw variable"}
- global Draw_DataDir
- bsave n [file join $Draw_DataDir $file]
- return [file join $Draw_DataDir $file]
-}
-
-help restore {restore filename [variablename]} "DRAW Variables management"
-
-proc restore {file {name ""}} {
- if {$name == ""} {
- # if name is not given explicitly, use name of the file w/o extension
- set name [file rootname [file tail $file]]
- }
- global Draw_DataDir
- upvar $name n
- brestore [file join $Draw_DataDir $file ] n
- return $name
-}
-
-#################################################
-# misc...
-#################################################
-
-proc ppcurve {a} {
- 2dclear;
- uplevel pcurve $a;
- 2dfit;
-}
-
-#################################################
-# display and donly with jokers
-#################################################
-
-help disp {display variables matched by glob pattern} "DRAW Variables management"
-
-proc disp { args } {
- set res ""
- foreach joker $args {
- if { $joker == "." } {
- dtyp .
- set joker [lastrep id x y b]
- }
- foreach var [info globals $joker] {
- if { $var == "." } {
- dtyp .
- set var [lastrep id x y b]
- }
- if [isgdraw $var] {lappend res $var}
- }
- }
- uplevel #0 eval display $res
- return $res
-}
-
-help don {display only variables matched by glob pattern} "DRAW Variables management"
-
-proc don { args } {
- set res ""
- foreach joker $args {
- if { $joker == "." } {
- dtyp .
- set joker [lastrep id x y b]
- }
- foreach var [info globals $joker] {
- if { $var == "." } {
- dtyp .
- set var [lastrep id x y b]
- }
- if [isgdraw $var] {lappend res $var}
- }
- }
- uplevel #0 eval donly $res
- return $res
-}
-
-help del {unset (remove) variables matched by glob pattern} "DRAW Variables management"
-
-proc del args {
- set res ""
- foreach joker [eval concat $args] {
- if { $joker == "." } {
- dtyp .
- set joker [lastrep id x y b]
- }
- foreach var [directory $joker] {
- global $var
- if ![isprot $var] {
- lappend res $var; unset $var
- }
- }
- }
- return $res
-}
-
-help era {erase variables matched by glob pattern} "DRAW Variables management"
-
-proc era args {
- set res ""
- foreach joker [eval concat $args] {
- if { $joker == "." } {
- dtyp .
- set joker [lastrep id x y b]
- }
- eval lappend res [directory $joker]
- }
- if [llength $res] {
- uplevel \#0 eval erase $res
- }
-}
-
-# The following commands (definitions are surrounded by if) are
-# available in extended Tcl (Tclx).
-# These procedures are added just to make full-working simulations of them.
-
-if {[info commands lvarpop] == ""} {
- proc lvarpop args {
- upvar [lindex $args 0] lvar
- set index 0
- set len [llength $lvar]
- if {[llength $args] > 1} {
- set ind [lindex $args 1]
- if [regexp "^end" $ind] {
- set index [expr $len-1]
- } elseif [regexp "^len" $ind] {
- set index $len
- } else {set index $ind}
- }
- set el [lindex $lvar $index]
- set newlvar {}
- for {set i 0} {$i < $index} {incr i} {
- lappend newlvar [lindex $lvar $i]
- }
- if {[llength $args] > 2} {
- lappend newlvar [lindex $args 2]
- }
- for {set i [expr $index+1]} {$i < $len} {incr i} {
- lappend newlvar [lindex $lvar $i]
- }
- set lvar $newlvar
- return $el
- }
-}
-
-if {[info commands lmatch] == ""} {
- proc lmatch args {
- set mode [switch -- [lindex $args 0] {
- -exact {format 0}
- -glob {format 1}
- -regexp {format 2}}]
- if {$mode == ""} {set mode 1} else {lvarpop args}
- if {[llength $args] < 2} {puts "usage: lmatch ?mode? list pattern";return}
- set list [lindex $args 0]
- set pattern [lindex $args 1]
- set res {}
- foreach a $list {
- if [switch $mode {
- 0 {expr [string compare $a $pattern] == 0}
- 1 {string match $pattern $a}
- 2 {regexp $pattern $a}}] {lappend res $a}
- }
- return $res
- }
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-#
-# view management scripts
-#
-#
-
-proc mu4 {} {
- global tcl_platform
- set stationname $tcl_platform(platform)
- delete
-# if { ${stationname} == "windows" } {
-# view 1 +X+Z 20 20 300 300
-# view 2 +X+Y 20 350 300 300
-# view 3 -Y+Z 328 20 300 300
-# view 4 AXON 328 350 300 300
-# } else {
- view 1 +X+Z 320 20 400 400
- view 2 +X+Y 320 450 400 400
- view 3 -Y+Z 728 20 400 400
- view 4 AXON 728 450 400 400
-# }
-}
-
-help mu4 ", Four views layout" "DRAW Graphic Commands"
-
-proc mu7 {} {
- delete
- view 1 +Y+Z 0 300 275 270
- view 2 +X-Y 285 0 275 270
- view 3 +X+Z 285 300 275 270
- view 4 +X+Y 285 600 275 270
- view 5 -Y+Z 570 300 275 270
- view 6 -X+Z 855 300 275 270
- view 7 AXON 855 600 275 270
-}
-help mu7 ", Seven views layout" "DRAW Graphic Commands"
-
-proc mu8 {} {
- delete
- view 1 +Y+Z 0 300 275 270
- view 2 +X-Y 285 0 275 270
- view 3 +X+Z 285 300 275 270
- view 4 +X+Y 285 600 275 270
- view 5 -Y+Z 570 300 275 270
- view 6 PERS 855 0 275 270
- view 7 -X+Z 855 300 275 270
- view 8 AXON 855 600 275 270
-}
-help mu8 ", Seven views layout" "DRAW Graphic Commands"
-
-proc mu24 {} {
- delete
- view 1 +X+Y 0 0 180 190
- view 2 -Y+X 0 220 180 190
- view 3 -X-Y 0 440 180 190
- view 4 +Y-X 0 660 180 190
-
- view 5 +Y+X 190 0 180 190
- view 6 -X+Y 190 220 180 190
- view 7 -Y-X 190 440 180 190
- view 8 +X-Y 190 660 180 190
-
- view 9 +X+Z 380 0 180 190
- view 10 -Z+X 380 220 180 190
- view 11 -X-Z 380 440 180 190
- view 12 +Z-X 380 660 180 190
-
- view 13 +Z+X 570 0 180 190
- view 14 -X+Z 570 220 180 190
- view 15 -Z-X 570 440 180 190
- view 16 +X-Z 570 660 180 190
-
- view 17 +Y+Z 760 0 180 190
- view 18 -Z+Y 760 220 180 190
- view 19 -Y-Z 760 440 180 190
- view 20 +Z-Y 760 660 180 190
-
- view 21 +Z+Y 950 0 180 190
- view 22 -Y+Z 950 220 180 190
- view 23 -Z-Y 950 440 180 190
- view 24 +Y-Z 950 660 180 190
-
-}
-help mu24 ", 24 views layout" "DRAW Graphic Commands"
-
-proc axo {} {
- global tcl_platform
- set stationname $tcl_platform(platform)
- delete
-# if { ${stationname} == "windows" } {
-# view 1 AXON 10 120 600 600
-# } else {
- view 1 AXON 465 20 800 800
-# }
-}
-help axo ", One axonometric view. Orientation +X-Y+Z" "DRAW Graphic Commands"
-
-proc haxo {} {
- delete
- view 1 AXON 465 20 800 800*20.4/29.1
-}
-help haxo ", One axonometric horizontal view. Orientation +X-Y+Z" "DRAW Graphic Commands"
-
-proc vaxo {} {
- delete
- view 1 AXON 705 20 800*20.4/29.1 800
-}
-help vaxo ", One axonometric vertical view. Orientation +X-Y+Z" "DRAW Graphic Commands"
-
-proc pers {} {
- delete
- view 1 PERS 465 20 800 800
-}
-help pers ", One perspective view" "DRAW Graphic Commands"
-
-proc hpers {} {
- delete
- view 1 PERS 465 20 800 800*20.4/29.1
-}
-help hpers ", One perspective horizontal view" "DRAW Graphic Commands"
-
-proc vpers {} {
- delete
- view 1 PERS 705 20 800*20.4/29.1 800
-}
-help vpers ", One perspective vertical view" "DRAW Graphic Commands"
-
-proc front {} {
- delete
- view 1 +X+Z 465 20 800 800
-}
-help front ", One front view. Orientation +X+Z" "DRAW Graphic Commands"
-
-proc hfront {} {
- delete
- view 1 +X+Z 465 20 800 800*20.4/29.1
-}
-help hfront ", One front horizontal view. Orientation +X+Z" "DRAW Graphic Commands"
-
-proc vfront {} {
- delete
- view 1 +X+Z 705 20 800*20.4/29.1 800
-}
-help vfront ", One front vertical view. Orientation +X+Z" "DRAW Graphic Commands"
-
-proc top {} {
- delete
- view 1 +X+Y 465 20 800 800
-}
-help top ", One top view. Orientation +X+Y" "DRAW Graphic Commands"
-
-proc htop {} {
- delete
- view 1 +X+Y 465 20 800 800*20.4/29.1
-}
-help htop ", One top horizontal view. Orientation +X+Y" "DRAW Graphic Commands"
-
-proc vtop {} {
- delete
- view 1 +X+Y 705 20 800*20.4/29.1 800
-}
-help vtop ", One top vertical view. Orientation +X+Y" "DRAW Graphic Commands"
-
-proc left {} {
- delete
- view 1 -Y+Z 465 20 800 800
-}
-help left ", One left view. Orientation -Y+Z" "DRAW Graphic Commands"
-
-proc hleft {} {
- delete
- view 1 -Y+Z 465 20 800 800*20.4/29.1
-}
-help hleft ", One left horizontal view. Orientation -Y+Z" "DRAW Graphic Commands"
-
-proc vleft {} {
- delete
- view 1 -Y+Z 705 20 800*20.4/29.1 800
-}
-help vleft ", One left vertical view. Orientation -Y+Z" "DRAW Graphic Commands"
-
-proc back {} {
- delete
- view 1 -X+Z 465 20 800 800
-}
-help back ", One back view. Orientation -X+Z" "DRAW Graphic Commands"
-
-proc hback {} {
- delete
- view 1 -X+Z 465 20 800 800*20.4/29.1
-}
-help hback ", One back horizontal view. Orientation -X+Z" "DRAW Graphic Commands"
-
-proc vback {} {
- delete
- view 1 -X+Z 705 20 800*20.4/29.1 800
-}
-help vback ", One back vertical view. Orientation -X+Z" "DRAW Graphic Commands"
-
-proc right {} {
- delete
- view 1 +Y+Z 465 20 800 800
-}
-help right ", One right view. Orientation +Y+Z" "DRAW Graphic Commands"
-
-proc hright {} {
- delete
- view 1 +Y+Z 465 20 800 800*20.4/29.1
-}
-help hright ", One right horizontal view. Orientation +Y+Z" "DRAW Graphic Commands"
-
-proc vright {} {
- delete
- view 1 +Y+Z 705 20 800*20.4/29.1 800
-}
-help vright ", One right vertical view. Orientation +Y+Z" "DRAW Graphic Commands"
-
-proc bottom {} {
- delete
- view 1 +X-Y 465 20 800 800
-}
-help bottom ", One bottom view. Orientation +X-Y" "DRAW Graphic Commands"
-
-proc hbottom {} {
- delete
- view 1 +X-Y 465 20 800 800*20.4/29.1
-}
-help hbottom ", One bottom horizontal view. Orientation +X-Y" "DRAW Graphic Commands"
-
-proc vbottom {} {
- delete
- view 1 +X-Y 705 20 800*20.4/29.1 800
-}
-help vbottom ", One bottom vertical view. Orientation +X-Y" "DRAW Graphic Commands"
-
-proc v2d {} {
- delete
- view 1 -2D- 465 20 800 800
-}
-help v2d ", One 2d view" "DRAW Graphic Commands"
-
-proc av2d {} {
- delete
- global tcl_platform
- set stationname $tcl_platform(platform)
-# if { ${stationname} == "windows" } {
-# view 2 -2D- 328 20 300 300
-# view 1 AXON 328 350 300 300
-# } else {
- view 2 -2D- 728 20 400 400
- view 1 AXON 728 450 400 400
-# }
-}
-help av2d ", axono and 2d view" "DRAW Graphic Commands"
-
-proc v2d2 {} {
- view 2 -2D- 728 20 400 400
-}
-help v2d2 "2d view on number 2" "DRAW Graphic Commands"
-
-proc smallview {{v AXON}} {
- global tcl_platform
- set stationname $tcl_platform(platform)
- delete
-# if { ${stationname} == "windows" } {
-# view 1 $v 328 350 300 300
-# } else {
- view 1 $v 728 450 400 400
-# }
-}
-
-help smallview " AXON PERS -2D- +X+Y ..." "DRAW Graphic Commands"
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-set Draw_GEOMETRY 1
-
-if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/CURVES.tcl]} {
- source $env(CSF_OCCTResourcePath)/DrawResources/CURVES.tcl
-} else {
- source $env(CASROOT)/src/DrawResources/CURVES.tcl
-}
-
-if {[array names ::env CSF_OCCTResourcePath] != "" && "$::env(CSF_OCCTResourcePath)" != "" && [file exists $::env(CSF_OCCTResourcePath)/DrawResources/SURFACES.tcl]} {
- source $env(CSF_OCCTResourcePath)/DrawResources/SURFACES.tcl
-} else {
- source $env(CASROOT)/src/DrawResources/SURFACES.tcl
-}
-
+++ /dev/null
-# Copyright (c) 2013-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-############################################################################
-# This file defines scripts for execution of OCCT tests.
-# It should be loaded automatically when DRAW is started, and provides
-# top-level commands starting with 'test'. Type 'help test' to get their
-# synopsis.
-# See OCCT Tests User Guide for description of the test system.
-#
-# Note: procedures with names starting with underscore are for internal use
-# inside the test system.
-############################################################################
-
-# Default verbose level for command _run_test
-set _tests_verbose 0
-
-# regexp for parsing test case results in summary log
-set _test_case_regexp {^CASE\s+([\w.-]+)\s+([\w.-]+)\s+([\w.-]+)\s*:\s*([\w]+)(.*)}
-
-# Basic command to run indicated test case in DRAW
-help test {
- Run specified test case
- Use: test group grid casename [options...]
- Allowed options are:
- -echo: all commands and results are echoed immediately,
- but log is not saved and summary is not produced
- It is also possible to use "1" instead of "-echo"
- If echo is OFF, log is stored in memory and only summary
- is output (the log can be obtained with command "dlog get")
- -outfile filename: set log file (should be non-existing),
- it is possible to save log file in text file or
- in html file(with snapshot), for that "filename"
- should have ".html" extension
- -overwrite: force writing log in existing file
- -beep: play sound signal at the end of the test
- -errors: show all lines from the log report that are recognized as errors
- This key will be ignored if the "-echo" key is already set.
-}
-proc test {group grid casename {args {}}} {
- # set default values of arguments
- set echo 0
- set errors 0
- set logfile ""
- set overwrite 0
- set signal 0
-
- # get test case paths (will raise error if input is invalid)
- _get_test $group $grid $casename dir gridname casefile
-
- # check arguments
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
- # if echo specified as "-echo", convert it to bool
- if { $arg == "-echo" || $arg == "1" } {
- set echo t
- continue
- }
-
- # output log file
- if { $arg == "-outfile" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logfile [lindex $args $narg]
- } else {
- error "Option -outfile requires argument"
- }
- continue
- }
-
- # allow overwrite existing log
- if { $arg == "-overwrite" } {
- set overwrite 1
- continue
- }
-
- # sound signal at the end of the test
- if { $arg == "-beep" } {
- set signal t
- continue
- }
-
- # if errors specified as "-errors", convert it to bool
- if { $arg == "-errors" } {
- set errors t
- continue
- }
-
- # unsupported option
- error "Error: unsupported option \"$arg\""
- }
- # run test
- uplevel _run_test $dir $group $gridname $casefile $echo
-
- # check log
- if { !$echo } {
- _check_log $dir $group $gridname $casename $errors [dlog get] summary html_log
-
- # create log file
- if { ! $overwrite && [file isfile $logfile] } {
- error "Error: Specified log file \"$logfile\" exists; please remove it before running test or use -overwrite option"
- }
- if {$logfile != ""} {
- if {[file extension $logfile] == ".html"} {
- if {[regexp {vdump ([^\s\n]+)} $html_log dump snapshot]} {
- catch {file copy -force $snapshot [file rootname $logfile][file extension $snapshot]}
- }
- _log_html $logfile $html_log "Test $group $grid $casename"
- } else {
- _log_save $logfile "[dlog get]\n$summary" "Test $group $grid $casename"
- }
- }
- }
-
- # play sound signal at the end of test
- if {$signal} {
- puts "\7\7\7\7"
- }
- return
-}
-
-# Basic command to run indicated test case in DRAW
-help testgrid {
- Run all tests, or specified group, or one grid
- Use: testgrid [groupmask [gridmask [casemask]]] [options...]
- Allowed options are:
- -exclude N: exclude group, subgroup or single test case from executing, where
- N is name of group, subgroup or case. Excluded items should be separated by comma.
- Option should be used as the first argument after list of executed groups, grids, and test cases.
- -parallel N: run N parallel processes (default is number of CPUs, 0 to disable)
- -refresh N: save summary logs every N seconds (default 600, minimal 1, 0 to disable)
- -outdir dirname: set log directory (should be empty or non-existing)
- -overwrite: force writing logs in existing non-empty directory
- -xml filename: write XML report for Jenkins (in JUnit-like format)
- -beep: play sound signal at the end of the tests
- -regress dirname: re-run only a set of tests that have been detected as regressions on some previous run.
- -skipped dirname: re-run only a set of tests that have been skipped on some previous run.
- Here "dirname" is path to directory containing results of previous run.
- -skip N: skip first N tests (useful to restart after abort)
- Groups, grids, and test cases to be executed can be specified by list of file
- masks, separated by spaces or comma; default is all (*).
-}
-proc testgrid {args} {
- global env tcl_platform _tests_verbose
-
- ######################################################
- # check arguments
- ######################################################
-
- # check that environment variable defining paths to test scripts is defined
- if { ! [info exists env(CSF_TestScriptsPath)] ||
- [llength $env(CSF_TestScriptsPath)] <= 0 } {
- error "Error: Environment variable CSF_TestScriptsPath is not defined"
- }
-
- # treat options
- set parallel [_get_nb_cpus]
- set refresh 60
- set logdir ""
- set overwrite 0
- set xmlfile ""
- set signal 0
- set exc_group 0
- set exc_grid 0
- set exc_case 0
- set regress 0
- set skipped 0
- set logdir_regr ""
- set logdir_skip ""
- set nbskip 0
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
-
- # parallel execution
- if { $arg == "-parallel" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set parallel [expr [lindex $args $narg]]
- } else {
- error "Option -parallel requires argument"
- }
- continue
- }
-
- # refresh logs time
- if { $arg == "-refresh" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set refresh [expr [lindex $args $narg]]
- } else {
- error "Option -refresh requires argument"
- }
- continue
- }
-
- # output directory
- if { $arg == "-outdir" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logdir [lindex $args $narg]
- } else {
- error "Option -outdir requires argument"
- }
- continue
- }
-
- # allow overwrite logs
- if { $arg == "-overwrite" } {
- set overwrite 1
- continue
- }
-
- # refresh logs time
- if { $arg == "-xml" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set xmlfile [lindex $args $narg]
- }
- if { $xmlfile == "" } {
- set xmlfile TESTS-summary.xml
- }
- continue
- }
-
- # sound signal at the end of the test
- if { $arg == "-beep" } {
- set signal t
- continue
- }
-
- # re-run only a set of tests that have been detected as regressions on some previous run
- if { $arg == "-regress" || $arg == "-skipped" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- if { $arg == "-regress" } {
- set logdir_regr [file normalize [string trim [lindex $args $narg]]]
- set regress 1
- } else {
- set logdir_skip [file normalize [string trim [lindex $args $narg]]]
- set skipped 1
- }
- } else {
- error "Option $arg requires argument"
- }
- continue
- }
-
- # skip N first tests
- if { $arg == "-skip" } {
- incr narg
- if { $narg < [llength $args] && [string is integer [lindex $args $narg]] } {
- set nbskip [lindex $args $narg]
- } else {
- error "Option -skip requires integer argument"
- }
- continue
- }
-
- # exclude group, subgroup or single test case from executing
- if { $arg == "-exclude" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set argts $args
- set idx_begin [string first " -ex" $argts]
- if { ${idx_begin} != "-1" } {
- set argts [string replace $argts 0 $idx_begin]
- }
- set idx_exclude [string first "exclude" $argts]
- if { ${idx_exclude} != "-1" } {
- set argts [string replace $argts 0 $idx_exclude+7]
- }
- set idx [string first " -" $argts]
- if { ${idx} != "-1" } {
- set argts [string replace $argts $idx end]
- }
- set argts [split $argts ,]
- foreach argt $argts {
- if { [llength $argt] == 1 } {
- lappend exclude_group $argt
- set exc_group 1
- } elseif { [llength $argt] == 2 } {
- lappend exclude_grid $argt
- set exc_grid 1
- incr narg
- } elseif { [llength $argt] == 3 } {
- lappend exclude_case $argt
- set exc_case 1
- incr narg
- incr narg
- }
- }
- } else {
- error "Option -exclude requires argument"
- }
- continue
- }
-
- # unsupported option
- if { [regexp {^-} $arg] } {
- error "Error: unsupported option \"$arg\""
- }
-
- # treat arguments not recognized as options as group and grid names
- if { ! [info exists groupmask] } {
- set groupmask [split $arg ,]
- } elseif { ! [info exists gridmask] } {
- set gridmask [split $arg ,]
- } elseif { ! [info exists casemask] } {
- set casemask [split $arg ,]
- } else {
- error "Error: cannot interpret argument $narg ($arg)"
- }
- }
-
- # check that target log directory is empty or does not exist
- set logdir [file normalize [string trim $logdir]]
- if { $logdir == "" } {
- # if specified logdir is empty string, generate unique name like
- # results/<branch>_<timestamp>
- set prefix ""
- if { ! [catch {exec git branch} gitout] &&
- [regexp {[*] ([\w-]+)} $gitout res branch] } {
- set prefix "${branch}_"
- }
- set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]"
-
- set logdir [file normalize $logdir]
- }
- if { [file isdirectory $logdir] && ! $overwrite && ! [catch {glob -directory $logdir *}] } {
- error "Error: Specified log directory \"$logdir\" is not empty; please clean it before running tests"
- }
- if { [catch {file mkdir $logdir}] || ! [file writable $logdir] } {
- error "Error: Cannot create directory \"$logdir\", or it is not writable"
- }
-
- # masks for search of test groups, grids, and cases
- if { ! [info exists groupmask] } { set groupmask * }
- if { ! [info exists gridmask ] } { set gridmask * }
- if { ! [info exists casemask ] } { set casemask * }
-
- # Find test cases with FAILED and IMPROVEMENT statuses in previous run
- # if option "regress" is given
- set rerun_group_grid_case {}
-
- if { ${regress} > 0 || ${skipped} > 0 } {
- if { "${groupmask}" != "*"} {
- lappend rerun_group_grid_case [list $groupmask $gridmask $casemask]
- }
- } else {
- lappend rerun_group_grid_case [list $groupmask $gridmask $casemask]
- }
-
- if { ${regress} > 0 } {
- if { [file exists ${logdir_regr}/tests.log] } {
- set fd [open ${logdir_regr}/tests.log]
- while { [gets $fd line] >= 0 } {
- if {[regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): FAILED} $line dump group grid casename] ||
- [regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): IMPROVEMENT} $line dump group grid casename]} {
- lappend rerun_group_grid_case [list $group $grid $casename]
- }
- }
- close $fd
- } else {
- error "Error: file ${logdir_regr}/tests.log is not found, check your input arguments!"
- }
- }
- if { ${skipped} > 0 } {
- if { [file exists ${logdir_skip}/tests.log] } {
- set fd [open ${logdir_skip}/tests.log]
- while { [gets $fd line] >= 0 } {
- if {[regexp {CASE ([^\s]+) ([^\s]+) ([^\s]+): SKIPPED} $line dump group grid casename] } {
- lappend rerun_group_grid_case [list $group $grid $casename]
- }
- }
- close $fd
- } else {
- error "Error: file ${logdir_skip}/tests.log is not found, check your input arguments!"
- }
- }
-
- ######################################################
- # prepare list of tests to be performed
- ######################################################
-
- # list of tests, each defined by a list of:
- # test scripts directory
- # group (subfolder) name
- # grid (subfolder) name
- # test case name
- # path to test case file
- set tests_list {}
-
- foreach group_grid_case ${rerun_group_grid_case} {
- set groupmask [lindex $group_grid_case 0]
- set gridmask [lindex $group_grid_case 1]
- set casemask [lindex $group_grid_case 2]
-
- # iterate by all script paths
- foreach dir [lsort -unique [_split_path $env(CSF_TestScriptsPath)]] {
- # protection against empty paths
- set dir [string trim $dir]
- if { $dir == "" } { continue }
-
- if { $_tests_verbose > 0 } { _log_and_puts log "Examining tests directory $dir" }
-
- # check that directory exists
- if { ! [file isdirectory $dir] } {
- _log_and_puts log "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped"
- continue
- }
-
- # search all directories in the current dir with specified mask
- if [catch {glob -directory $dir -tail -types d {*}$groupmask} groups] { continue }
-
- # exclude selected groups from all groups
- if { ${exc_group} > 0 } {
- foreach exclude_group_element ${exclude_group} {
- set idx [lsearch $groups "${exclude_group_element}"]
- if { ${idx} != "-1" } {
- set groups [lreplace $groups $idx $idx]
- } else {
- continue
- }
- }
- }
-
- # iterate by groups
- if { $_tests_verbose > 0 } { _log_and_puts log "Groups to be executed: $groups" }
- foreach group [lsort -dictionary $groups] {
- if { $_tests_verbose > 0 } { _log_and_puts log "Examining group directory $group" }
-
- # file grids.list must exist: it defines sequence of grids in the group
- if { ! [file exists $dir/$group/grids.list] } {
- _log_and_puts log "Warning: directory $dir/$group does not contain file grids.list, skipped"
- continue
- }
-
- # read grids.list file and make a list of grids to be executed
- set gridlist {}
- set fd [open $dir/$group/grids.list]
- set nline 0
- while { [gets $fd line] >= 0 } {
- incr nline
-
- # skip comments and empty lines
- if { [regexp "\[ \t\]*\#.*" $line] } { continue }
- if { [string trim $line] == "" } { continue }
-
- # get grid id and name
- if { ! [regexp "^\(\[0-9\]+\)\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridid grid] } {
- _log_and_puts log "Warning: cannot recognize line $nline in file $dir/$group/grids.list as \"gridid gridname\"; ignored"
- continue
- }
-
- # check that grid fits into the specified mask
- foreach mask $gridmask {
- if { $mask == $gridid || [string match $mask $grid] } {
- lappend gridlist $grid
- }
- }
- }
- close $fd
-
- # exclude selected grids from all grids
- if { ${exc_grid} > 0 } {
- foreach exclude_grid_element ${exclude_grid} {
- set exclude_elem [lindex $exclude_grid_element end]
- set idx [lsearch $gridlist "${exclude_elem}"]
- if { ${idx} != "-1" } {
- set gridlist [lreplace $gridlist $idx $idx]
- } else {
- continue
- }
- }
- }
-
- # iterate by all grids
- foreach grid $gridlist {
-
- # check if this grid is aliased to another one
- set griddir $dir/$group/$grid
- if { [file exists $griddir/cases.list] } {
- set fd [open $griddir/cases.list]
- if { [gets $fd line] >= 0 } {
- set griddir [file normalize $dir/$group/$grid/[string trim $line]]
- }
- close $fd
- }
-
- # check if grid directory actually exists
- if { ! [file isdirectory $griddir] } {
- _log_and_puts log "Error: tests directory for grid $grid ($griddir) is missing; skipped"
- continue
- }
-
- # create directory for logging test results
- if { $logdir != "" } { file mkdir $logdir/$group/$grid }
-
- # iterate by all tests in the grid directory
- if { [catch {glob -directory $griddir -type f {*}$casemask} testfiles] } { continue }
-
- # exclude selected test cases from all testfiles
- if { ${exc_case} > 0 } {
- foreach exclude_case_element ${exclude_case} {
- set exclude_casegroup_elem [lindex $exclude_case_element end-2]
- set exclude_casegrid_elem [lindex $exclude_case_element end-1]
- set exclude_elem [lindex $exclude_case_element end]
- if { ${exclude_casegrid_elem} == "${grid}" } {
- set idx [lsearch $testfiles "${dir}/${exclude_casegroup_elem}/${exclude_casegrid_elem}/${exclude_elem}"]
- if { ${idx} != "-1" } {
- set testfiles [lreplace $testfiles $idx $idx]
- } else {
- continue
- }
- }
- }
- }
-
- foreach casefile [lsort -dictionary $testfiles] {
- # filter out files with reserved names
- set casename [file tail $casefile]
- if { $casename == "begin" || $casename == "end" ||
- $casename == "parse.rules" } {
- continue
- }
-
- if { $nbskip > 0 } {
- incr nbskip -1
- } else {
- # Check if current test matches exclude pattern
- set should_exclude 0
- if { ${exc_case} > 0 } {
- foreach excl $exclude_case {
- if {[string match "$group" [lindex $excl 0]] &&
- [string match "$grid" [lindex $excl 1]] &&
- [string match "$casename" [lindex $excl 2]]} {
- set should_exclude 1
- break
- }
- }
- }
- if {!$should_exclude} {
- lappend tests_list [list $dir $group $grid $casename $casefile]
- }
- }
- }
- }
- }
- }
- }
- if { [llength $tests_list] < 1 } {
- error "Error: no tests are found, check your input arguments and variable CSF_TestScriptsPath!"
- } else {
- puts "Running tests (total [llength $tests_list] test cases)..."
- }
- ######################################################
- # run tests
- ######################################################
-
- # log command arguments and environment
- lappend log "Command: testgrid $args"
- lappend log "Host: [info hostname]"
- lappend log "Started on: [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}]"
- catch {lappend log "DRAW build:\n[dversion]" }
- catch { pload VISUALIZATION; vinit g/v/info -virtual -w 2 -h 2 }
- catch { lappend log "[vglinfo -complete -lineWidth 80]" }
- catch { vclose g/v/info 0 }
- lappend log "Environment:"
- foreach envar [lsort [array names env]] {
- lappend log "$envar=\"$env($envar)\""
- }
- lappend log ""
-
- set refresh_timer [clock seconds]
- uplevel dchrono _timer reset
- uplevel dchrono _timer start
-
- # if parallel execution is requested, allocate thread pool
- if { $parallel > 0 } {
- if { ! [info exists tcl_platform(threaded)] || [catch {package require Thread}] } {
- _log_and_puts log "Warning: Tcl package Thread is not available, running in sequential mode"
- set parallel 0
- } else {
- set worker [tpool::create -minworkers $parallel -maxworkers $parallel]
- # suspend the pool until all jobs are posted, to prevent blocking of the process
- # of starting / processing jobs by running threads
- catch {tpool::suspend $worker}
- if { $_tests_verbose > 0 } { _log_and_puts log "Executing tests in (up to) $parallel threads" }
- # limit number of jobs in the queue by reasonable value
- # to prevent slowdown due to unnecessary queue processing
- set nbpooled 0
- set nbpooled_max [expr 10 * $parallel]
- set nbpooled_ok [expr 5 * $parallel]
- }
- }
-
- # start test cases
- set userbreak 0
- foreach test_def $tests_list {
- # check for user break
- if { $userbreak || "[info commands dbreak]" == "dbreak" && [catch dbreak] } {
- set userbreak 1
- break
- }
-
- set dir [lindex $test_def 0]
- set group [lindex $test_def 1]
- set grid [lindex $test_def 2]
- set casename [lindex $test_def 3]
- set casefile [lindex $test_def 4]
-
- # command to set tests for generation of image in results directory
- set imgdir_cmd ""
- if { $logdir != "" } { set imgdir_cmd "set imagedir $logdir/$group/$grid" }
-
- # prepare command file for running test case in separate instance of DRAW
- set file_cmd "$logdir/$group/$grid/${casename}.tcl"
- set fd_cmd [open $file_cmd w]
-
- # UTF-8 encoding is used by default on Linux everywhere, and "unicode" is set
- # by default as encoding of stdin and stdout on Windows in interactive mode;
- # however in batch mode on Windows default encoding is set to system one (e.g. 1252),
- # so we need to set UTF-8 encoding explicitly to have Unicode symbols transmitted
- # correctly between calling and caller processes
- if { "$tcl_platform(platform)" == "windows" } {
- puts $fd_cmd "fconfigure stdout -encoding utf-8"
- puts $fd_cmd "fconfigure stdin -encoding utf-8"
- }
-
- # commands to set up and run test
- puts $fd_cmd "$imgdir_cmd"
- puts $fd_cmd "set test_image $casename"
- puts $fd_cmd "_run_test $dir $group $grid $casefile t"
-
- # use dlog command to obtain complete output of the test when it is absent (i.e. since OCCT 6.6.0)
- # note: this is not needed if echo is set to 1 in call to _run_test above
- if { ! [catch {dlog get}] } {
- puts $fd_cmd "puts \[dlog get\]"
- } else {
- # else try to use old-style QA_ variables to get more output...
- set env(QA_DUMP) 1
- set env(QA_DUP) 1
- set env(QA_print_command) 1
- }
-
- # final 'exit' is needed when running on Linux under VirtualGl
- puts $fd_cmd "exit"
- close $fd_cmd
-
- # command to run DRAW with a command file;
- # note that empty string is passed as standard input to avoid possible
- # hang-ups due to waiting for stdin of the launching process
- set command "exec <<{} DRAWEXE -f $file_cmd"
-
- # alternative method to run without temporary file; disabled as it needs too many backslashes
- # else {
- # set command "exec <<\"\" DRAWEXE -c $imgdir_cmd\\\; set test_image $casename\\\; \
- # _run_test $dir $group $grid $casefile\\\; \
- # puts \\\[dlog get\\\]\\\; exit"
- # }
-
- # run test case, either in parallel or sequentially
- if { $parallel > 0 } {
- # parallel execution
- set job [tpool::post -nowait $worker "catch \"$command\" output; return \$output"]
- set job_def($job) [list $logdir $dir $group $grid $casename]
- incr nbpooled
- if { $nbpooled > $nbpooled_max } {
- _testgrid_process_jobs $worker $nbpooled_ok
- }
- } else {
- # sequential execution
- catch {eval $command} output
- _log_test_case $output $logdir $dir $group $grid $casename log
-
- # update summary log with requested period
- if { $logdir != "" && $refresh > 0 && [expr [clock seconds] - $refresh_timer > $refresh] } {
- # update and dump summary
- _log_summarize $logdir $log
- set refresh_timer [clock seconds]
- }
- }
- }
-
- # get results of started threads
- if { $parallel > 0 } {
- _testgrid_process_jobs $worker
- # release thread pool
- if { $nbpooled > 0 } {
- tpool::cancel $worker [array names job_def]
- }
- catch {tpool::resume $worker}
- tpool::release $worker
- }
-
- uplevel dchrono _timer stop
- set time [lindex [split [uplevel dchrono _timer show] "\n"] 0]
-
- if { $userbreak } {
- _log_and_puts log "*********** Stopped by user break ***********"
- set time "${time} \nNote: the process is not finished, stopped by user break!"
- }
-
- ######################################################
- # output summary logs and exit
- ######################################################
-
- _log_summarize $logdir $log $time
- if { $logdir != "" } {
- puts "Detailed logs are saved in $logdir"
- }
- if { $logdir != "" && $xmlfile != "" } {
- # XML output file is assumed relative to log dir unless it is absolute
- if { [ file pathtype $xmlfile] == "relative" } {
- set xmlfile [file normalize $logdir/$xmlfile]
- }
- _log_xml_summary $logdir $xmlfile $log 0
- puts "XML summary is saved to $xmlfile"
- }
- # play sound signal at the end of test
- if {$signal} {
- puts "\7\7\7\7"
- }
- return
-}
-
-# Procedure to regenerate summary log from logs of test cases
-help testsummarize {
- Regenerate summary log in the test directory from logs of test cases.
- This can be necessary if test grids are executed separately (e.g. on
- different stations) or some grids have been re-executed.
- Use: testsummarize dir
-}
-proc testsummarize {dir} {
- global _test_case_regexp
-
- if { ! [file isdirectory $dir] } {
- error "Error: \"$dir\" is not a directory"
- }
-
- # get summary statements from all test cases in one log
- set log {}
-
- # to avoid huge listing of logs, first find all subdirectories and iterate
- # by them, parsing log files in each subdirectory independently
- foreach grid [glob -directory $dir -types d -tails */*] {
- foreach caselog [glob -nocomplain -directory [file join $dir $grid] -types f -tails *.log] {
- set file [file join $dir $grid $caselog]
- set nbfound 0
- set fd [open $file r]
- while { [gets $fd line] >= 0 } {
- if { [regexp $_test_case_regexp $line res grp grd cas status message] } {
- if { "[file join $grid $caselog]" != "[file join $grp $grd ${cas}.log]" } {
- puts "Error: $file contains status line for another test case ($line)"
- }
- lappend log $line
- incr nbfound
- }
- }
- close $fd
-
- if { $nbfound != 1 } {
- puts "Error: $file contains $nbfound status lines, expected 1"
- }
- }
- }
-
- _log_summarize $dir $log "Summary regenerated from logs at [clock format [clock seconds]]"
- return
-}
-
-# Procedure to compare results of two runs of test cases
-help testdiff {
- Compare results of two executions of tests (CPU times, ...)
- Use: testdiff dir1 dir2 [groupname [gridname]] [options...]
- Where dir1 and dir2 are directories containing logs of two test runs.
- dir1 (A) should point to NEW tests results to be verified and dir2 (B) to REFERENCE results.
- Allowed options are:
- -image [filename]: compare only images and save its in specified file (default
- name is <dir1>/diffimage-<dir2>.log)
- -cpu [filename]: compare only CPU and save it in specified file (default
- name is <dir1>/diffcpu-<dir2>.log)
- -memory [filename]: compare only memory and save it in specified file (default
- name is <dir1>/diffmemory-<dir2>.log)
- -save filename: save resulting log in specified file (default name is
- <dir1>/diff-<dir2>.log); HTML log is saved with same name
- and extension .html
- -status {same|ok|all}: filter cases for comparing by their status:
- same - only cases with same status are compared (default)
- ok - only cases with OK status in both logs are compared
- all - results are compared regardless of status
- -verbose level:
- 1 - output only differences
- 2 - output also list of logs and directories present in one of dirs only
- 3 - (default) output also progress messages
- -highlight_percent value: highlight considerable (>value in %) deviations
- of CPU and memory (default value is 5%)
-}
-proc testdiff {dir1 dir2 args} {
- if { "$dir1" == "$dir2" } {
- error "Input directories are the same"
- }
-
- ######################################################
- # check arguments
- ######################################################
-
- # treat options
- set logfile [file join $dir1 "diff-[file tail $dir2].log"]
- set logfile_image ""
- set logfile_cpu ""
- set logfile_memory ""
- set image false
- set cpu false
- set memory false
- set basename ""
- set save false
- set status "same"
- set verbose 3
- set highlight_percent 5
- for {set narg 0} {$narg < [llength $args]} {incr narg} {
- set arg [lindex $args $narg]
- # log file name
- if { $arg == "-save" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logfile [lindex $args $narg]
- } else {
- error "Error: Option -save must be followed by log file name"
- }
- set save true
- continue
- }
-
- # image compared log
- if { $arg == "-image" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logfile_image [lindex $args $narg]
- } else {
- set logfile_image [file join $dir1 "diffimage-[file tail $dir2].log"]
- incr narg -1
- }
- set image true
- continue
- }
-
- # CPU compared log
- if { $arg == "-cpu" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logfile_cpu [lindex $args $narg]
- } else {
- set logfile_cpu [file join $dir1 "diffcpu-[file tail $dir2].log"]
- incr narg -1
- }
- set cpu true
- continue
- }
-
- # memory compared log
- if { $arg == "-memory" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set logfile_memory [lindex $args $narg]
- } else {
- set logfile_memory [file join $dir1 "diffmemory-[file tail $dir2].log"]
- incr narg -1
- }
- set memory true
- continue
- }
-
- # status filter
- if { $arg == "-status" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set status [lindex $args $narg]
- } else {
- set status ""
- }
- if { "$status" != "same" && "$status" != "all" && "$status" != "ok" } {
- error "Error: Option -status must be followed by one of \"same\", \"all\", or \"ok\""
- }
- continue
- }
-
- # verbose level
- if { $arg == "-verbose" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set verbose [expr [lindex $args $narg]]
- } else {
- error "Error: Option -verbose must be followed by integer verbose level"
- }
- continue
- }
-
- # highlight_percent
- if { $arg == "-highlight_percent" } {
- incr narg
- if { $narg < [llength $args] && ! [regexp {^-} [lindex $args $narg]] } {
- set highlight_percent [expr [lindex $args $narg]]
- } else {
- error "Error: Option -highlight_percent must be followed by integer value"
- }
- continue
- }
-
- if { [regexp {^-} $arg] } {
- error "Error: unsupported option \"$arg\""
- }
-
- # non-option arguments form a subdirectory path
- set basename [file join $basename $arg]
- }
-
- if {$image != false || $cpu != false || $memory != false} {
- if {$save != false} {
- error "Error: Option -save can not be used with image/cpu/memory options"
- }
- }
-
- # run diff procedure (recursive)
- _test_diff $dir1 $dir2 $basename $image $cpu $memory $status $verbose log log_image log_cpu log_memory
-
- # save result to log file
- if {$image == false && $cpu == false && $memory == false} {
- if { "$logfile" != "" } {
- _log_save $logfile [join $log "\n"]
- _log_html_diff "[file rootname $logfile].html" $log $dir1 $dir2 ${highlight_percent}
- puts "Log is saved to $logfile (and .html)"
- }
- } else {
- foreach mode {image cpu memory} {
- if {"[set logfile_${mode}]" != ""} {
- _log_save "[set logfile_${mode}]" [join "[set log_${mode}]" "\n"]
- _log_html_diff "[file rootname [set logfile_${mode}]].html" "[set log_${mode}]" $dir1 $dir2 ${highlight_percent}
- puts "Log (${mode}) is saved to [set logfile_${mode}] (and .html)"
- }
- }
- }
- return
-}
-
-# Procedure to check data file before adding it to repository
-help testfile {
- Checks specified data files for putting them into the test data files repository.
-
- Use: testfile filelist
-
- Will report if:
- - data file (non-binary) is in DOS encoding (CR/LF)
- - same data file (with same or another name) already exists in the repository
- - another file with the same name already exists
- Note that names are considered to be case-insensitive (for compatibility
- with Windows).
-
- Unless the file is already in the repository, tries to load it, reports
- the recognized file format, file size, number of faces and edges in the
- loaded shape (if any), information contained its triangulation, and makes
- snapshot (in the temporary directory).
-
- Finally it advises whether the file should be put to public section of the
- repository.
-
- Use: testfile -check
-
- If "-check" is given as an argument, then procedure will check files already
- located in the repository (for possible duplicates and for DOS encoding).
-}
-proc testfile {filelist} {
- global env
-
- # check that CSF_TestDataPath is defined
- if { ! [info exists env(CSF_TestDataPath)] } {
- error "Environment variable CSF_TestDataPath must be defined!"
- }
-
- set checkrepo f
- if { "$filelist" == "-check" } { set checkrepo t }
-
- # build registry of existing data files (name -> path) and (size -> path)
- puts "Collecting info on test data files repository..."
- foreach dir [_split_path $env(CSF_TestDataPath)] {
- while {[llength $dir] != 0} {
- set curr [lindex $dir 0]
- set dir [lrange $dir 1 end]
- eval lappend dir [glob -nocomplain -directory $curr -type d *]
- foreach file [glob -nocomplain -directory $curr -type f *] {
- set name [file tail $file]
- set name_lower [string tolower $name]
- set size [file size $file]
-
- # check that the file is not in DOS encoding
- if { $checkrepo } {
- if { [_check_dos_encoding $file] } {
- puts "Warning: file $file is in DOS encoding; was this intended?"
- }
- _check_file_format $file
-
- # check if file with the same name is present twice or more
- if { [info exists names($name_lower)] } {
- puts "Error: more than one file with name $name is present in the repository:"
- if { [_diff_files $file $names($name_lower)] } {
- puts "(files are different by content)"
- } else {
- puts "(files are same by content)"
- }
- puts "--> $file"
- puts "--> $names($name_lower)"
- continue
- }
-
- # check if file with the same content exists
- if { [info exists sizes($size)] } {
- foreach other $sizes($size) {
- if { ! [_diff_files $file $other] } {
- puts "Warning: two files with the same content found:"
- puts "--> $file"
- puts "--> $other"
- }
- }
- }
- }
-
- # add the file to the registry
- lappend names($name_lower) $file
- lappend sizes($size) $file
- }
- }
- }
- if { $checkrepo || [llength $filelist] <= 0 } { return }
-
- # check the new files
- set has_images f
- puts "Checking new file(s)..."
- foreach file $filelist {
- set name [file tail $file]
- set name_lower [string tolower $name]
- set found f
-
- # check for presence of the file with same name
- if { [info exists names($name_lower)] } {
- set found f
- foreach other $names($name_lower) {
- # avoid comparing the file with itself
- if { [file normalize $file] == [file normalize $other] } {
- continue
- }
- # compare content
- if { [_diff_files $file $other] } {
- puts "\n* $file: error\n name is already used by existing file\n --> $other"
- } else {
- puts "\n* $file: already present \n --> $other"
- }
- set found t
- break
- }
- if { $found } { continue }
- }
-
- # get size of the file; if it is in DOS encoding and less than 1 MB,
- # estimate also its size in UNIX encoding to be able to find same
- # file if already present but in UNIX encoding
- set sizeact [file size $file]
- set sizeunx ""
- set isdos [_check_dos_encoding $file]
- if { $isdos && $sizeact < 10000000 } {
- set fd [open $file r]
- fconfigure $fd -translation crlf
- set sizeunx [string length [read $fd]]
- close $fd
- }
-
- # check if file with the same content exists
- foreach size "$sizeact $sizeunx" {
- if { [info exists sizes($size)] } {
- foreach other $sizes($size) {
- # avoid comparing the file with itself
- if { [file normalize $file] == [file normalize $other] } {
- continue
- }
- # compare content
- if { ! [_diff_files $file $other] } {
- puts "\n* $file: duplicate \n already present under name [file tail $other]\n --> $other"
- set found t
- break
- }
- }
- if { $found } { break }
- }
- }
- if { $found } { continue }
-
- # file is not present yet, so to be analyzed
- puts "\n* $file: new file"
-
- # add the file to the registry as if it were added to the repository,
- # to report possible duplicates among the currently processed files
- lappend names($name_lower) $file
- if { "$sizeunx" != "" } {
- lappend sizes($sizeunx) $file
- } else {
- lappend sizes($sizeact) $file
- }
-
- # first of all, complain if it is in DOS encoding
- if { $isdos } {
- puts " Warning: DOS encoding detected, consider converting to"
- puts " UNIX unless DOS line ends are needed for the test"
- }
-
- # try to read the file
- set format [_check_file_format $file]
- if { [catch {uplevel load_data_file $file $format a}] } {
- puts " Warning: Cannot read as $format file"
- continue
- }
-
- # warn if shape contains triangulation
- pload MODELING
- if { "$format" != "STL" &&
- [regexp {([0-9]+)\s+triangles} [uplevel trinfo a] res nbtriangles] &&
- $nbtriangles != 0 } {
- puts " Warning: shape contains triangulation ($nbtriangles triangles),"
- puts " consider removing them unless they are needed for the test!"
- }
-
- # get number of faces and edges
- set edges 0
- set faces 0
- set nbs [uplevel nbshapes a]
- regexp {EDGE[ \t:]*([0-9]+)} $nbs res edges
- regexp {FACE[ \t:]*([0-9]+)} $nbs res faces
-
- # classify; first check file size and number of faces and edges
- if { $size < 95000 && $faces < 20 && $edges < 100 } {
- set dir public
- } else {
- set dir private
- }
-
- # add stats
- puts " $format size=[expr $size / 1024] KiB, nbfaces=$faces, nbedges=$edges -> $dir"
-
- set tmpdir [_get_temp_dir]
- file mkdir $tmpdir/$dir
-
- # make snapshot
- pload VISUALIZATION
- uplevel vdisplay a
- uplevel vsetdispmode 1
- uplevel vfit
- uplevel vzfit
- uplevel vdump $tmpdir/$dir/[file rootname [file tail $file]].png
- set has_images t
- }
- if { $has_images } {
- puts "Snapshots are saved in subdirectory [_get_temp_dir]"
- }
-}
-
-# Procedure to locate data file for test given its name.
-# The search is performed assuming that the function is called
-# from the test case script; the search order is:
-# - subdirectory "data" of the test script (grid) folder
-# - subdirectories in environment variable CSF_TestDataPath
-# - subdirectory set by datadir command
-# If file is not found, raises Tcl error.
-proc locate_data_file {filename} {
- global env groupname gridname casename
-
- # check if the file is located in the subdirectory data of the script dir
- set scriptfile [info script]
- if { "$scriptfile" != "" } {
- set path [file join [file dirname "$scriptfile"] data "$filename"]
- if { [file exists "$path"] } {
- return [file normalize "$path"]
- }
- }
-
- # check sub-directories in paths indicated by CSF_TestDataPath
- if { [info exists env(CSF_TestDataPath)] } {
- foreach dir [_split_path $env(CSF_TestDataPath)] {
- set dir [list "$dir"]
- while {[llength "$dir"] != 0} {
- set name [lindex "$dir" 0]
- set dir [lrange "$dir" 1 end]
-
- # skip directories starting with dot
- set aTail [file tail "$name"]
- if { [regexp {^[.]} "$aTail"] } { continue }
- if { [file exists "$name/$filename"] } {
- return [file normalize "$name/$filename"]
- }
- eval lappend dir [glob -nocomplain -directory "$name" -type d *]
- }
- }
- }
-
- # check current datadir
- if { [file exists "[uplevel datadir]/$filename"] } {
- return [file normalize "[uplevel datadir]/$filename"]
- }
-
- # raise error
- error [join [list "File $filename could not be found" \
- "(should be in paths indicated by CSF_TestDataPath environment variable, " \
- "or in subfolder data in the script directory)"] "\n"]
-}
-
-# Internal procedure to find test case indicated by group, grid, and test case names;
-# returns:
-# - dir: path to the base directory of the tests group
-# - gridname: actual name of the grid
-# - casefile: path to the test case script
-# if no such test is found, raises error with appropriate message
-proc _get_test {group grid casename _dir _gridname _casefile} {
- upvar $_dir dir
- upvar $_gridname gridname
- upvar $_casefile casefile
-
- global env
-
- # check that environment variable defining paths to test scripts is defined
- if { ! [info exists env(CSF_TestScriptsPath)] ||
- [llength $env(CSF_TestScriptsPath)] <= 0 } {
- error "Error: Environment variable CSF_TestScriptsPath is not defined"
- }
-
- # iterate by all script paths
- foreach dir [_split_path $env(CSF_TestScriptsPath)] {
- # protection against empty paths
- set dir [string trim $dir]
- if { $dir == "" } { continue }
-
- # check that directory exists
- if { ! [file isdirectory $dir] } {
- puts "Warning: directory $dir listed in CSF_TestScriptsPath does not exist, skipped"
- continue
- }
-
- # check if test group with given name exists in this dir
- # if not, continue to the next test dir
- if { ! [file isdirectory $dir/$group] } { continue }
-
- # check that grid with given name (possibly alias) exists; stop otherwise
- set gridname $grid
- if { ! [file isdirectory $dir/$group/$gridname] } {
- # check if grid is named by alias rather than by actual name
- if { [file exists $dir/$group/grids.list] } {
- set fd [open $dir/$group/grids.list]
- while { [gets $fd line] >= 0 } {
- if { [regexp "\[ \t\]*\#.*" $line] } { continue }
- if { [regexp "^$grid\[ \t\]*\(\[A-Za-z0-9_.-\]+\)\$" $line res gridname] } {
- break
- }
- }
- close $fd
- }
- }
- if { ! [file isdirectory $dir/$group/$gridname] } { continue }
-
- # get actual file name of the script; stop if it cannot be found
- set casefile $dir/$group/$gridname/$casename
- if { ! [file exists $casefile] } {
- # check if this grid is aliased to another one
- if { [file exists $dir/$group/$gridname/cases.list] } {
- set fd [open $dir/$group/$gridname/cases.list]
- if { [gets $fd line] >= 0 } {
- set casefile [file normalize $dir/$group/$gridname/[string trim $line]/$casename]
- }
- close $fd
- }
- }
- if { [file exists $casefile] } {
- # normal return
- return
- }
- }
-
- # coming here means specified test is not found; report error
- error [join [list "Error: test case $group / $grid / $casename is not found in paths listed in variable" \
- "CSF_TestScriptsPath (current value is \"$env(CSF_TestScriptsPath)\")"] "\n"]
-}
-
-# Internal procedure to run test case indicated by base directory,
-# grid and grid names, and test case file path.
-# The log can be obtained by command "dlog get".
-proc _run_test {scriptsdir group gridname casefile echo} {
- global env
-
- # start timer
- uplevel dchrono _timer reset
- uplevel dchrono _timer start
- catch {uplevel meminfo h} membase
-
- # enable commands logging; switch to old-style mode if dlog command is not present
- set dlog_exists 1
- if { [catch {dlog reset}] } {
- set dlog_exists 0
- } elseif { $echo } {
- decho on
- } else {
- dlog reset
- dlog on
- rename puts puts-saved
- proc puts args {
- global _tests_verbose
-
- # log only output to stdout and stderr, not to file!
- if {[llength $args] > 1} {
- set optarg [lindex $args end-1]
- if { $optarg == "stdout" || $optarg == "stderr" || $optarg == "-newline" } {
- dlog add [lindex $args end]
- } else {
- eval puts-saved $args
- }
- } else {
- dlog add [lindex $args end]
- }
- }
- }
-
- # evaluate test case
- set tmp_imagedir 0
- if [catch {
- # set variables identifying test case
- uplevel set casename [file tail $casefile]
- uplevel set groupname $group
- uplevel set gridname $gridname
- uplevel set dirname $scriptsdir
-
- # set path for saving of log and images (if not yet set) to temp dir
- if { ! [uplevel info exists imagedir] } {
- uplevel set test_image \$casename
-
- # create subdirectory in temp named after group and grid with timestamp
- set rootlogdir [_get_temp_dir]
-
- set imagedir "${group}-${gridname}-${::casename}-[clock format [clock seconds] -format {%Y-%m-%dT%Hh%Mm%Ss}]"
- set imagedir [file normalize ${rootlogdir}/$imagedir]
-
- if { [catch {file mkdir $imagedir}] || ! [file writable $imagedir] ||
- ! [catch {glob -directory $imagedir *}] } {
- # puts "Warning: Cannot create directory \"$imagedir\", or it is not empty; \"${rootlogdir}\" is used"
- set imagedir $rootlogdir
- }
-
- uplevel set imagedir \"$imagedir\"
- set tmp_imagedir 1
- }
-
- # execute test scripts
- if { [file exists $scriptsdir/$group/begin] } {
- puts "Executing $scriptsdir/$group/begin..."; flush stdout
- uplevel source -encoding utf-8 $scriptsdir/$group/begin
- }
- if { [file exists $scriptsdir/$group/$gridname/begin] } {
- puts "Executing $scriptsdir/$group/$gridname/begin..."; flush stdout
- uplevel source -encoding utf-8 $scriptsdir/$group/$gridname/begin
- }
-
- puts "Executing $casefile..."; flush stdout
- uplevel source -encoding utf-8 $casefile
-
- if { [file exists $scriptsdir/$group/$gridname/end] } {
- puts "Executing $scriptsdir/$group/$gridname/end..."; flush stdout
- uplevel source -encoding utf-8 $scriptsdir/$group/$gridname/end
- }
- if { [file exists $scriptsdir/$group/end] } {
- puts "Executing $scriptsdir/$group/end..."; flush stdout
- uplevel source -encoding utf-8 $scriptsdir/$group/end
- }
- } res] {
- if { "$res" == "" } { set res "EMPTY" }
- # in echo mode, output error message using dputs command to have it colored,
- # note that doing the same in logged mode would duplicate the message
- if { ! $dlog_exists || ! $echo } {
- puts "Tcl Exception: $res"
- } else {
- decho off
- dputs -red -intense "Tcl Exception: $res"
- }
- }
-
- # stop logging
- if { $dlog_exists } {
- if { $echo } {
- decho off
- } else {
- rename puts {}
- rename puts-saved puts
- dlog off
- }
- }
-
- # stop cpulimit killer if armed by the test
- cpulimit
-
- # add memory and timing info
- set stats ""
- if { ! [catch {uplevel meminfo h} memuse] } {
- append stats "MEMORY DELTA: [expr ($memuse - $membase) / 1024] KiB\n"
- }
- uplevel dchrono _timer stop
- set cpu_usr [uplevel dchrono _timer -userCPU]
- set elps [uplevel dchrono _timer -elapsed]
- append stats "TOTAL CPU TIME: $cpu_usr sec\n"
- append stats "ELAPSED TIME: $elps sec\n"
- if { $dlog_exists && ! $echo } {
- dlog add $stats
- } else {
- puts $stats
- }
-
- # unset global vars
- uplevel unset casename groupname gridname dirname
- if { $tmp_imagedir } { uplevel unset imagedir test_image }
-}
-
-# Internal procedure to check log of test execution and decide if it passed or failed
-proc _check_log {dir group gridname casename errors log {_summary {}} {_html_log {}}} {
- global env
- if { $_summary != "" } { upvar $_summary summary }
- if { $_html_log != "" } { upvar $_html_log html_log }
- set summary {}
- set html_log {}
- set errors_log {}
-
- if [catch {
-
- # load definition of 'bad words' indicating test failure
- # note that rules are loaded in the order of decreasing priority (grid - group - common),
- # thus grid rules will override group ones
- set badwords {}
- foreach rulesfile [list $dir/$group/$gridname/parse.rules $dir/$group/parse.rules $dir/parse.rules] {
- if [catch {set fd [open $rulesfile r]}] { continue }
- while { [gets $fd line] >= 0 } {
- # skip comments and empty lines
- if { [regexp "\[ \t\]*\#.*" $line] } { continue }
- if { [string trim $line] == "" } { continue }
- # extract regexp
- if { ! [regexp {^([^/]*)/([^/]*)/(.*)$} $line res status rexp comment] } {
- puts "Warning: cannot recognize parsing rule \"$line\" in file $rulesfile"
- continue
- }
- set status [string trim $status]
- if { $comment != "" } { append status " ([string trim $comment])" }
- set rexp [regsub -all {\\b} $rexp {\\y}] ;# convert regexp from Perl to Tcl style
- lappend badwords [list $status $rexp]
- }
- close $fd
- }
- if { [llength $badwords] <= 0 } {
- puts "Warning: no definition of error indicators found (check files parse.rules)"
- }
-
- # analyse log line-by-line
- set todos {} ;# TODO statements
- set requs {} ;# REQUIRED statements
- set todo_incomplete -1
- set status ""
- foreach line [split $log "\n"] {
- # check if line defines specific treatment of some messages
- if [regexp -nocase {^[ \s]*TODO ([^:]*):(.*)$} $line res platforms pattern] {
- if { ! [regexp -nocase {\mAll\M} $platforms] &&
- ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
- lappend html_log [_html_highlight IGNORE $line]
- continue ;# TODO statement is for another platform
- }
-
- # record TODOs that mark unstable cases
- if { [regexp {[\?]} $platforms] } {
- set todos_unstable([llength $todos]) 1
- }
-
- # convert legacy regexps from Perl to Tcl style
- set pattern [regsub -all {\\b} [string trim $pattern] {\\y}]
-
- # special case: TODO TEST INCOMPLETE
- if { [string trim $pattern] == "TEST INCOMPLETE" } {
- set todo_incomplete [llength $todos]
- }
-
- lappend todos [list $pattern [llength $html_log] $line]
- lappend html_log [_html_highlight BAD $line]
- continue
- }
- if [regexp -nocase {^[ \s]*REQUIRED ([^:]*):[ \s]*(.*)$} $line res platforms pattern] {
- if { ! [regexp -nocase {\mAll\M} $platforms] &&
- ! [regexp -nocase "\\m[checkplatform]\\M" $platforms] } {
- lappend html_log [_html_highlight IGNORE $line]
- continue ;# REQUIRED statement is for another platform
- }
- lappend requs [list $pattern [llength $html_log] $line]
- lappend html_log [_html_highlight OK $line]
- continue
- }
-
- # check for presence of required messages
- set ismarked 0
- for {set i 0} {$i < [llength $requs]} {incr i} {
- set pattern [lindex $requs $i 0]
- if { [regexp $pattern $line] } {
- incr required_count($i)
- lappend html_log [_html_highlight OK $line]
- set ismarked 1
- continue
- }
- }
- if { $ismarked } {
- continue
- }
-
- # check for presence of messages indicating test result
- foreach bw $badwords {
- if { [regexp [lindex $bw 1] $line] } {
- # check if this is known bad case
- set is_known 0
- for {set i 0} {$i < [llength $todos]} {incr i} {
- set pattern [lindex $todos $i 0]
- if { [regexp $pattern $line] } {
- set is_known 1
- incr todo_count($i)
- lappend html_log [_html_highlight BAD $line]
- break
- }
- }
-
- # if it is not in todo, define status
- if { ! $is_known } {
- set stat [lindex $bw 0 0]
- if {$errors} {
- lappend errors_log $line
- }
- lappend html_log [_html_highlight $stat $line]
- if { $status == "" && $stat != "OK" && ! [regexp -nocase {^IGNOR} $stat] } {
- set status [lindex $bw 0]
- }
- }
- set ismarked 1
- break
- }
- }
- if { ! $ismarked } {
- lappend html_log $line
- }
- }
-
- # check for presence of TEST COMPLETED statement
- if { $status == "" && ! [regexp {TEST COMPLETED} $log] } {
- # check whether absence of TEST COMPLETED is known problem
- if { $todo_incomplete >= 0 } {
- incr todo_count($todo_incomplete)
- } else {
- set status "FAILED (no final message is found)"
- }
- }
-
- # report test as failed if it doesn't contain required pattern
- if { $status == "" } {
- for {set i 0} {$i < [llength $requs]} {incr i} {
- if { ! [info exists required_count($i)] } {
- set linenum [lindex $requs $i 1]
- set html_log [lreplace $html_log $linenum $linenum [_html_highlight FAILED [lindex $requs $i 2]]]
- set status "FAILED (REQUIRED statement no. [expr $i + 1] is not found)"
- }
- }
- }
-
- # check declared bad cases and diagnose possible improvement
- # (bad case declared but not detected).
- # Note that absence of the problem marked by TODO with question mark
- # (unstable) is not reported as improvement.
- if { $status == "" } {
- for {set i 0} {$i < [llength $todos]} {incr i} {
- if { ! [info exists todos_unstable($i)] &&
- (! [info exists todo_count($i)] || $todo_count($i) <= 0) } {
- set linenum [lindex $todos $i 1]
- set html_log [lreplace $html_log $linenum $linenum [_html_highlight IMPROVEMENT [lindex $todos $i 2]]]
- set status "IMPROVEMENT (expected problem TODO no. [expr $i + 1] is not detected)"
- break;
- }
- }
- }
-
- # report test as known bad if at least one of expected problems is found
- if { $status == "" && [llength [array names todo_count]] > 0 } {
- set status "BAD (known problem)"
- }
-
- # report normal OK
- if { $status == "" } {set status "OK" }
-
- } res] {
- set status "FAILED ($res)"
- }
-
- # put final message
- _log_and_puts summary "CASE $group $gridname $casename: $status"
- set summary [join $summary "\n"]
- if {$errors} {
- foreach error $errors_log {
- _log_and_puts summary " $error"
- }
- }
- set html_log "[_html_highlight [lindex $status 0] $summary]\n[join $html_log \n]"
-}
-
-# Auxiliary procedure putting message to both cout and log variable (list)
-proc _log_and_puts {logvar message} {
- if { $logvar != "" } {
- upvar $logvar log
- lappend log $message
- }
- puts $message
-}
-
-# Auxiliary procedure to log result on single test case
-proc _log_test_case {output logdir dir group grid casename logvar} {
- upvar $logvar log
- set show_errors 0
-
- # check result and make HTML log
- _check_log $dir $group $grid $casename $show_errors $output summary html_log
- lappend log $summary
-
- # save log to file
- if { $logdir != "" } {
- _log_html $logdir/$group/$grid/$casename.html $html_log "Test $group $grid $casename"
- _log_save $logdir/$group/$grid/$casename.log "$output\n$summary" "Test $group $grid $casename"
- }
-
- # remove intermediate command file used to run test
- if { [file exists $logdir/$group/$grid/${casename}.tcl] } {
- file delete $logdir/$group/$grid/${casename}.tcl
- }
-}
-
-# Auxiliary procedure to save log to file
-proc _log_save {file log {title {}}} {
- # create missing directories as needed
- catch {file mkdir [file dirname $file]}
-
- # try to open a file
- if [catch {set fd [open $file w]} res] {
- error "Error saving log file $file: $res"
- }
-
- # dump log and close
- puts $fd "$title\n"
- puts $fd $log
- close $fd
- return
-}
-
-# Auxiliary procedure to make a (relative if possible) URL to a file for
-# inclusion a reference in HTML log
-proc _make_url {htmldir file} {
- set htmlpath [file split [file normalize $htmldir]]
- set filepath [file split [file normalize $file]]
- for {set i 0} {$i < [llength $htmlpath]} {incr i} {
- if { "[lindex $htmlpath $i]" != "[lindex $filepath $i]" } {
- if { $i == 0 } { break }
- return "[string repeat "../" [expr [llength $htmlpath] - $i - 1]][eval file join [lrange $filepath $i end]]"
- }
- }
-
- # if relative path could not be made, return full file URL
- return "file://[file normalize $file]"
-}
-
-# Auxiliary procedure to save log to file
-proc _log_html {file log {title {}}} {
- # create missing directories as needed
- catch {file mkdir [file dirname $file]}
-
- # try to open a file
- if [catch {set fd [open $file w]} res] {
- error "Error saving log file $file: $res"
- }
-
- # print header
- puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
- puts $fd "<title>$title</title></head><body><h1>$title</h1>"
-
- # add images if present; these should have either PNG, GIF, or JPG extension,
- # and start with name of the test script, with optional suffix separated
- # by underscore or dash
- set imgbasename [file rootname [file tail $file]]
- foreach img [lsort [glob -nocomplain -directory [file dirname $file] -tails \
- ${imgbasename}.gif ${imgbasename}.png ${imgbasename}.jpg \
- ${imgbasename}_*.gif ${imgbasename}_*.png ${imgbasename}_*.jpg \
- ${imgbasename}-*.gif ${imgbasename}-*.png ${imgbasename}-*.jpg]] {
- puts $fd "<p>[file tail $img]<br><img src=\"$img\"/><p>"
- }
-
- # print log body, trying to add HTML links to script files on lines like
- # "Executing <filename>..."
- puts $fd "<pre>"
- foreach line [split $log "\n"] {
- if { [regexp {Executing[ \t]+([a-zA-Z0-9._/:-]+[^.])} $line res script] &&
- [file exists $script] } {
- set line [regsub $script $line "<a href=\"[_make_url $file $script]\">$script</a>"]
- }
- puts $fd $line
- }
- puts $fd "</pre></body></html>"
-
- close $fd
- return
-}
-
-# Auxiliary method to make text with HTML highlighting according to status
-proc _html_color {status} {
- # choose a color for the cell according to result
- if { $status == "OK" } {
- return lightgreen
- } elseif { [regexp -nocase {^FAIL} $status] } {
- return ff8080
- } elseif { [regexp -nocase {^BAD} $status] } {
- return yellow
- } elseif { [regexp -nocase {^IMP} $status] } {
- return orange
- } elseif { [regexp -nocase {^SKIP} $status] } {
- return gray
- } elseif { [regexp -nocase {^IGNOR} $status] } {
- return gray
- } else {
- puts "Warning: no color defined for status $status, using red as if FAILED"
- return red
- }
-}
-
-# Format text line in HTML to be colored according to the status
-proc _html_highlight {status line} {
- return "<table><tr><td bgcolor=\"[_html_color $status]\">$line</td></tr></table>"
-}
-
-# Internal procedure to generate HTML page presenting log of the tests
-# execution in tabular form, with links to reports on individual cases
-proc _log_html_summary {logdir log totals regressions improvements skipped total_time} {
- global _test_case_regexp
-
- # create missing directories as needed
- file mkdir $logdir
-
- # try to open a file and start HTML
- if [catch {set fd [open $logdir/summary.html w]} res] {
- error "Error creating log file: $res"
- }
-
- # write HRML header, including command to refresh log if still in progress
- puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
- puts $fd "<title>Tests summary</title>"
- if { $total_time == "" } {
- puts $fd "<meta http-equiv=\"refresh\" content=\"10\">"
- }
- puts $fd "<meta http-equiv=\"pragma\" content=\"NO-CACHE\">"
- puts $fd "</head><body>"
-
- # put summary
- set legend(OK) "Test passed OK"
- set legend(FAILED) "Test failed (regression)"
- set legend(BAD) "Known problem"
- set legend(IMPROVEMENT) "Possible improvement (expected problem not detected)"
- set legend(SKIPPED) "Test skipped due to lack of data file"
- puts $fd "<h1>Summary</h1><table>"
- foreach nbstat $totals {
- set status [lindex $nbstat 1]
- if { [info exists legend($status)] } {
- set comment $legend($status)
- } else {
- set comment "User-defined status"
- }
- puts $fd "<tr><td align=\"right\">[lindex $nbstat 0]</td><td bgcolor=\"[_html_color $status]\">$status</td><td>$comment</td></tr>"
- }
- puts $fd "</table>"
-
- # time stamp and elapsed time info
- puts $fd "<p>Generated on [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S}] on [info hostname]\n<p>"
- if { $total_time != "" } {
- puts $fd [join [split $total_time "\n"] "<p>"]
- } else {
- puts $fd "<p>NOTE: This is intermediate summary; the tests are still running! This page will refresh automatically until tests are finished."
- }
-
- # print regressions and improvements
- foreach featured [list $regressions $improvements $skipped] {
- if { [llength $featured] <= 1 } { continue }
- set status [string trim [lindex $featured 0] { :}]
- puts $fd "<h2>$status</h2>"
- puts $fd "<table>"
- set groupgrid ""
- foreach test [lrange $featured 1 end] {
- if { ! [regexp {^(.*)\s+([\w\-.]+)$} $test res gg name] } {
- set gg UNKNOWN
- set name "Error building short list; check details"
- }
- if { $gg != $groupgrid } {
- if { $groupgrid != "" } { puts $fd "</tr>" }
- set groupgrid $gg
- puts $fd "<tr><td>$gg</td>"
- }
- puts $fd "<td bgcolor=\"[_html_color $status]\"><a href=\"[regsub -all { } $gg /]/${name}.html\">$name</a></td>"
- }
- if { $groupgrid != "" } { puts $fd "</tr>" }
- puts $fd "</table>"
- }
-
- # put detailed log with TOC
- puts $fd "<hr><h1>Details</h1>"
- puts $fd "<div style=\"float:right; padding: 10px; border-style: solid; border-color: blue; border-width: 2px;\">"
-
- # process log line-by-line
- set group {}
- set letter {}
- set body {}
- foreach line [lsort -dictionary $log] {
- # check that the line is case report in the form "CASE group grid name: result (explanation)"
- if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } {
- continue
- }
-
- # start new group
- if { $grp != $group } {
- if { $letter != "" } { lappend body "</tr></table>" }
- set letter {}
- set group $grp
- set grid {}
- puts $fd "<a href=\"#$group\">$group</a><br>"
- lappend body "<h2><a name=\"$group\">Group $group</a></h2>"
- }
-
- # start new grid
- if { $grd != $grid } {
- if { $letter != "" } { lappend body "</tr></table>" }
- set letter {}
- set grid $grd
- puts $fd " <a href=\"#$group-$grid\">$grid</a><br>"
- lappend body "<h2><a name=\"$group-$grid\">Grid $group $grid</a></h2>"
- }
-
- # check if test case name is <letter><digit>;
- # if not, set alnum to period "." to recognize non-standard test name
- if { ! [regexp {\A([A-Za-z]{1,2})([0-9]{1,2})\Z} $casename res alnum number] &&
- ! [regexp {\A([A-Za-z0-9]+)_([0-9]+)\Z} $casename res alnum number] } {
- set alnum $casename
- }
-
- # start new row when letter changes or for non-standard names
- if { $alnum != $letter || $alnum == "." } {
- if { $letter != "" } {
- lappend body "</tr><tr>"
- } else {
- lappend body "<table><tr>"
- }
- set letter $alnum
- }
-
- lappend body "<td bgcolor=\"[_html_color $result]\"><a href=\"$group/$grid/${casename}.html\">$casename</a></td>"
- }
- puts $fd "</div>\n[join $body "\n"]</tr></table>"
-
- # add remaining lines of log as plain text
- puts $fd "<h2>Plain text messages</h2>\n<pre>"
- foreach line $log {
- if { ! [regexp $_test_case_regexp $line] } {
- puts $fd "$line"
- }
- }
- puts $fd "</pre>"
-
- # close file and exit
- puts $fd "</body>"
- close $fd
- return
-}
-
-# Procedure to dump summary logs of tests
-proc _log_summarize {logdir log {total_time {}}} {
-
- # sort log records alphabetically to have the same behavior on Linux and Windows
- # (also needed if tests are run in parallel)
- set loglist [lsort -dictionary $log]
-
- # classify test cases by status
- foreach line $loglist {
- if { [regexp {^CASE ([^:]*): ([[:alnum:]]+).*$} $line res caseid status] } {
- lappend stat($status) $caseid
- }
- }
- set totals {}
- set improvements {Improvements:}
- set regressions {Failed:}
- set skipped {Skipped:}
- if { [info exists stat] } {
- foreach status [lsort [array names stat]] {
- lappend totals [list [llength $stat($status)] $status]
-
- # separately count improvements (status starting with IMP), skipped (status starting with SKIP) and regressions (all except IMP, OK, BAD, and SKIP)
- if { [regexp -nocase {^IMP} $status] } {
- eval lappend improvements $stat($status)
- } elseif { [regexp -nocase {^SKIP} $status] } {
- eval lappend skipped $stat($status)
- } elseif { $status != "OK" && ! [regexp -nocase {^BAD} $status] && ! [regexp -nocase {^SKIP} $status] } {
- eval lappend regressions $stat($status)
- }
- }
- }
-
- # if time is specified, add totals
- if { $total_time != "" } {
- if { [llength $improvements] > 1 } {
- _log_and_puts log [join $improvements "\n "]
- }
- if { [llength $regressions] > 1 } {
- _log_and_puts log [join $regressions "\n "]
- }
- if { [llength $skipped] > 1 } {
- _log_and_puts log [join $skipped "\n "]
- }
- if { [llength $improvements] == 1 && [llength $regressions] == 1 } {
- _log_and_puts log "No regressions"
- }
- _log_and_puts log "Total cases: [join $totals {, }]"
- _log_and_puts log $total_time
- }
-
- # save log to files
- if { $logdir != "" } {
- _log_html_summary $logdir $log $totals $regressions $improvements $skipped $total_time
- _log_save $logdir/tests.log [join $log "\n"] "Tests summary"
- }
-
- return
-}
-
-# Internal procedure to generate XML log in JUnit style, for further
-# consumption by Jenkins or similar systems.
-#
-# The output is intended to conform to XML schema supported by Jenkins found at
-# https://svn.jenkins-ci.org/trunk/hudson/dtkit/dtkit-format/dtkit-junit-model/src/main/resources/com/thalesgroup/dtkit/junit/model/xsd/junit-4.xsd
-#
-# The mapping of the fields is inspired by annotated schema of Apache Ant JUnit XML format found at
-# http://windyroad.org/dl/Open%20Source/JUnit.xsd
-proc _log_xml_summary {logdir filename log include_cout} {
- global _test_case_regexp
-
- catch {file mkdir [file dirname $filename]}
-
- # try to open a file and start XML
- if [catch {set fd [open $filename w]} res] {
- error "Error creating XML summary file $filename: $res"
- }
- puts $fd "<?xml version='1.0' encoding='utf-8'?>"
- puts $fd "<testsuites>"
-
- # prototype for command to generate test suite tag
- set time_and_host "timestamp=\"[clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%S}]\" hostname=\"[info hostname]\""
- set cmd_testsuite {puts $fd "<testsuite name=\"$group $grid\" tests=\"$nbtests\" failures=\"$nbfail\" errors=\"$nberr\" time=\"$time\" skipped=\"$nbskip\" $time_and_host>\n$testcases\n</testsuite>\n"}
-
- # sort log and process it line-by-line
- set group {}
- foreach line [lsort -dictionary $log] {
- # check that the line is case report in the form "CASE group grid name: result (explanation)"
- if { ! [regexp $_test_case_regexp $line res grp grd casename result message] } {
- continue
- }
- set message [string trim $message " \t\r\n()"]
-
- # start new testsuite for each grid
- if { $grp != $group || $grd != $grid } {
-
- # write previous test suite
- if [info exists testcases] { eval $cmd_testsuite }
-
- set testcases {}
- set nbtests 0
- set nberr 0
- set nbfail 0
- set nbskip 0
- set time 0.
-
- set group $grp
- set grid $grd
- }
-
- incr nbtests
-
- # parse test log and get its CPU time
- set testout {}
- set add_cpu {}
- if { [catch {set fdlog [open $logdir/$group/$grid/${casename}.log r]} ret] } {
- puts "Error: cannot open $logdir/$group/$grid/${casename}.log: $ret"
- } else {
- while { [gets $fdlog logline] >= 0 } {
- if { $include_cout } {
- append testout "$logline\n"
- }
- if [regexp -nocase {TOTAL CPU TIME:\s*([\d.]+)\s*sec} $logline res cpu] {
- set add_cpu " time=\"$cpu\""
- set time [expr $time + $cpu]
- }
- }
- close $fdlog
- }
- if { ! $include_cout } {
- set testout "$line\n"
- }
-
- # record test case with its output and status
- # Mapping is: SKIPPED, BAD, and OK to OK, all other to failure
- append testcases "\n <testcase name=\"$casename\"$add_cpu status=\"$result\">\n"
- append testcases "\n <system-out>\n$testout </system-out>"
- if { $result != "OK" } {
- if { [regexp -nocase {^SKIP} $result] } {
- incr nberr
- append testcases "\n <error name=\"$result\" message=\"$message\"/>"
- } elseif { [regexp -nocase {^BAD} $result] } {
- incr nbskip
- append testcases "\n <skipped>$message</skipped>"
- } else {
- incr nbfail
- append testcases "\n <failure name=\"$result\" message=\"$message\"/>"
- }
- }
- append testcases "\n </testcase>"
- }
-
- # write last test suite
- if [info exists testcases] { eval $cmd_testsuite }
-
- # the end
- puts $fd "</testsuites>"
- close $fd
- return
-}
-
-# Auxiliary procedure to split path specification (usually defined by
-# environment variable) into list of directories or files
-proc _split_path {pathspec} {
- global tcl_platform
-
- # first replace all \ (which might occur on Windows) by /
- regsub -all "\\\\" $pathspec "/" pathspec
-
- # split path by platform-specific separator
- return [split $pathspec [_path_separator]]
-}
-
-# Auxiliary procedure to define platform-specific separator for directories in
-# path specification
-proc _path_separator {} {
- global tcl_platform
-
- # split path by platform-specific separator
- if { $tcl_platform(platform) == "windows" } {
- return ";"
- } else {
- return ":"
- }
-}
-
-# Procedure to make a diff and common of two lists
-proc _list_diff {list1 list2 _in1 _in2 _common} {
- upvar $_in1 in1
- upvar $_in2 in2
- upvar $_common common
-
- set in1 {}
- set in2 {}
- set common {}
- foreach item $list1 {
- if { [lsearch -exact $list2 $item] >= 0 } {
- lappend common $item
- } else {
- lappend in1 $item
- }
- }
- foreach item $list2 {
- if { [lsearch -exact $common $item] < 0 } {
- lappend in2 $item
- }
- }
- return
-}
-
-# procedure to load a file to Tcl string
-proc _read_file {filename} {
- set fd [open $filename r]
- set result [read -nonewline $fd]
- close $fd
- return $result
-}
-
-# procedure to construct name for the mage diff file
-proc _diff_img_name {dir1 dir2 casepath imgfile} {
- return [file join $dir1 $casepath "diff-[file tail $dir2]-$imgfile"]
-}
-
-# auxiliary procedure to produce string comparing two values
-proc _diff_show_ratio {value1 value2} {
- if {[expr double ($value2)] == 0.} {
- return "$value1 / $value2"
- } else {
- return "$value1 / $value2 \[[format "%+5.2f%%" [expr 100 * ($value1 - $value2) / double($value2)]]\]"
- }
-}
-
-# auxiliary procedure to produce string comparing two values, where first value is a portion of second
-proc _diff_show_positive_ratio {value1 value2} {
- if {[expr double ($value2)] == 0.} {
- return "$value1 / $value2"
- } else {
- return "$value1 / $value2 \[[format "%4.2f%%" [expr 100 * double($value1) / double($value2)]]\]"
- }
-}
-
-# procedure to check cpu user time
-proc _check_time {regexp_msg} {
- upvar log log
- upvar log1 log1
- upvar log2 log2
- upvar log_cpu log_cpu
- upvar cpu cpu
- upvar basename basename
- upvar casename casename
- set time1_list [dict create]
- set time2_list [dict create]
- set cpu_find UNDEFINED
-
- foreach line1 [split $log1 "\n"] {
- if { [regexp "${regexp_msg}" $line1 dump chronometer_name cpu_find] } {
- dict set time1_list "${chronometer_name}" "${cpu_find}"
- }
- }
-
- foreach line2 [split $log2 "\n"] {
- if { [regexp "${regexp_msg}" $line2 dump chronometer_name cpu_find] } {
- dict set time2_list "${chronometer_name}" "${cpu_find}"
- }
- }
-
- if { [llength [dict keys $time1_list]] != [llength [dict keys $time2_list]] } {
- puts "Error: number of dchrono/chrono COUNTER are different in the same test cases"
- } else {
- foreach key [dict keys $time1_list] {
- set time1 [dict get $time1_list $key]
- set time2 [dict get $time2_list $key]
-
- # compare CPU user time with 10% precision (but not less 0.5 sec)
- if { [expr abs ($time1 - $time2) > 0.5 + 0.05 * abs ($time1 + $time2)] } {
- if {$cpu != false} {
- _log_and_puts log_cpu "COUNTER $key: [split $basename /] $casename: [_diff_show_ratio $time1 $time2]"
- } else {
- _log_and_puts log "COUNTER $key: [split $basename /] $casename: [_diff_show_ratio $time1 $time2]"
- }
- }
- }
- }
-}
-
-# Procedure to compare results of two runs of test cases
-proc _test_diff {dir1 dir2 basename image cpu memory status verbose _logvar _logimage _logcpu _logmemory {_statvar ""}} {
- upvar $_logvar log
- upvar $_logimage log_image
- upvar $_logcpu log_cpu
- upvar $_logmemory log_memory
-
- # make sure to load diffimage command
- uplevel pload VISUALIZATION
-
- # prepare variable (array) for collecting statistics
- if { "$_statvar" != "" } {
- upvar $_statvar stat
- } else {
- set stat(cpu1) 0
- set stat(cpu2) 0
- set stat(mem1) 0
- set stat(mem2) 0
- set stat(img1) 0
- set stat(img2) 0
- set log {}
- set log_image {}
- set log_cpu {}
- set log_memory {}
- }
-
- # first check subdirectories
- set path1 [file join $dir1 $basename]
- set path2 [file join $dir2 $basename]
- set list1 [glob -directory $path1 -types d -tails -nocomplain *]
- set list2 [glob -directory $path2 -types d -tails -nocomplain *]
- if { [llength $list1] >0 || [llength $list2] > 0 } {
- _list_diff $list1 $list2 in1 in2 common
- if { "$verbose" > 1 } {
- if { [llength $in1] > 0 } { _log_and_puts log "Only in $path1: $in1" }
- if { [llength $in2] > 0 } { _log_and_puts log "Only in $path2: $in2" }
- }
- foreach subdir $common {
- if { "$verbose" > 2 } {
- _log_and_puts log "Checking [file join $basename $subdir]"
- }
- _test_diff $dir1 $dir2 [file join $basename $subdir] $image $cpu $memory $status $verbose log log_image log_cpu log_memory stat
- }
- } else {
- # check log files (only if directory has no subdirs)
- set list1 [glob -directory $path1 -types f -tails -nocomplain *.log]
- set list2 [glob -directory $path2 -types f -tails -nocomplain *.log]
- _list_diff $list1 $list2 in1 in2 common
- if { "$verbose" > 1 } {
- if { [llength $in1] > 0 } { _log_and_puts log "Only in $path1: $in1" }
- if { [llength $in2] > 0 } { _log_and_puts log "Only in $path2: $in2" }
- }
- set gcpu1 0
- set gcpu2 0
- set gmem1 0
- set gmem2 0
- foreach logfile $common {
- # load two logs
- set log1 [_read_file [file join $dir1 $basename $logfile]]
- set log2 [_read_file [file join $dir2 $basename $logfile]]
- set casename [file rootname $logfile]
-
- # check execution statuses
- if {$image == false && $cpu == false && $memory == false} {
- set status1 UNDEFINED
- set status2 UNDEFINED
- if { ! [regexp {CASE [^:]*:\s*([\w]+)} $log1 res1 status1] ||
- ! [regexp {CASE [^:]*:\s*([\w]+)} $log2 res2 status2] ||
- "$status1" != "$status2" } {
- _log_and_puts log "STATUS [split $basename /] $casename: $status1 / $status2"
- # if test statuses are different, further comparison makes
- # no sense unless explicitly requested
- if { "$status" != "all" } {
- continue
- }
- }
- if { "$status" == "ok" && "$status1" != "OK" } {
- continue
- }
- }
-
- if { ! $image } {
- # check CPU user time in test cases
- set checkCPURegexp "COUNTER (.+): (\[-0-9.+eE\]+)"
- if { [regexp "${checkCPURegexp}" $log1] &&
- [regexp "${checkCPURegexp}" $log2] } {
- _check_time "${checkCPURegexp}"
- }
- }
-
- # check CPU times
- if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
- set cpu1 UNDEFINED
- set cpu2 UNDEFINED
- if { [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log1 res1 cpu1] &&
- [regexp {TOTAL CPU TIME:\s*([\d.]+)} $log2 res1 cpu2] } {
- set stat(cpu1) [expr $stat(cpu1) + $cpu1]
- set stat(cpu2) [expr $stat(cpu2) + $cpu2]
- set gcpu1 [expr $gcpu1 + $cpu1]
- set gcpu2 [expr $gcpu2 + $cpu2]
-
- # compare CPU times with 10% precision (but not less 0.5 sec)
- if { [expr abs ($cpu1 - $cpu2) > 0.5 + 0.05 * abs ($cpu1 + $cpu2)] } {
- if {$cpu != false} {
- _log_and_puts log_cpu "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]"
- } else {
- _log_and_puts log "CPU [split $basename /] $casename: [_diff_show_ratio $cpu1 $cpu2]"
- }
- }
- }
- }
-
- # check memory delta
- if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
- set mem1 UNDEFINED
- set mem2 UNDEFINED
- if { [regexp {MEMORY DELTA:\s*([\d.]+)} $log1 res1 mem1] &&
- [regexp {MEMORY DELTA:\s*([\d.]+)} $log2 res1 mem2] } {
- set stat(mem1) [expr $stat(mem1) + $mem1]
- set stat(mem2) [expr $stat(mem2) + $mem2]
- set gmem1 [expr $gmem1 + $mem1]
- set gmem2 [expr $gmem2 + $mem2]
-
- # compare memory usage with 10% precision (but not less 16 KiB)
- if { [expr abs ($mem1 - $mem2) > 16 + 0.05 * abs ($mem1 + $mem2)] } {
- if {$memory != false} {
- _log_and_puts log_memory "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]"
- } else {
- _log_and_puts log "MEMORY [split $basename /] $casename: [_diff_show_ratio $mem1 $mem2]"
- }
- }
- }
- }
-
- # check images
- if {$image != false || ($image == false && $cpu == false && $memory == false)} {
- set aCaseDiffColorTol 0
- if { [regexp {IMAGE_COLOR_TOLERANCE:\s*([\d.]+)} $log1 res1 imgtol1] } { set aCaseDiffColorTol $imgtol1 }
- set imglist1 [glob -directory $path1 -types f -tails -nocomplain ${casename}.{png,gif} ${casename}-*.{png,gif} ${casename}_*.{png,gif}]
- set imglist2 [glob -directory $path2 -types f -tails -nocomplain ${casename}.{png,gif} ${casename}-*.{png,gif} ${casename}_*.{png,gif}]
- _list_diff $imglist1 $imglist2 imgin1 imgin2 imgcommon
- if { "$verbose" > 1 } {
- # Differences in image lists might reflect changes in test case or in list of tests (new/removed test cases),
- # but might also reflect image dump failures.
- if { [llength $imgin1] > 0 } {
- set stat(img1) [expr $stat(img1) + [llength $imgin1]]
- set stat(img2) [expr $stat(img2) + [llength $imgin1]]
- if {$image != false} {
- _log_and_puts log_image "Only in $path1: $imgin1"
- } else {
- _log_and_puts log "Only in $path1: $imgin1"
- }
- }
- if { [llength $imgin2] > 0 } {
- set stat(img1) [expr $stat(img1) + [llength $imgin2]]
- if {$image != false} {
- _log_and_puts log_image "Only in $path2: $imgin2"
- } else {
- _log_and_puts log "Only in $path2: $imgin2"
- }
- }
- }
-
- foreach imgfile $imgcommon {
- set stat(img2) [expr $stat(img2) + 1]
- # if { $verbose > 1 } { _log_and_puts log "Checking [split basename /] $casename: $imgfile" }
- set diffile [_diff_img_name $dir1 $dir2 $basename $imgfile]
- if { [catch {diffimage [file join $dir1 $basename $imgfile] \
- [file join $dir2 $basename $imgfile] \
- -toleranceOfColor 0.0 -blackWhite off -borderFilter off $diffile} diff] } {
- set stat(img1) [expr $stat(img1) + 1]
- if {$image != false} {
- _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
- } else {
- _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
- }
- file delete -force $diffile ;# clean possible previous result of diffimage
- } elseif { $diff != 0 } {
- set diff [string trimright $diff \n]
- if {$aCaseDiffColorTol != 0} {
- # retry with color tolerance
- if { [catch {diffimage [file join $dir1 $basename $imgfile] \
- [file join $dir2 $basename $imgfile] \
- -toleranceOfColor $aCaseDiffColorTol -blackWhite off -borderFilter off $diffile} diff2] } {
- set stat(img1) [expr $stat(img1) + 1]
- if {$image != false} {
- _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
- } else {
- _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile cannot be compared"
- }
- continue
- } elseif { $diff2 == 0 } {
- # exclude image diff within tolerance but still keep info in the log
- set toLogImageCase false
- file delete -force $diffile
- set stat(img1) [expr $stat(img1) + 1]
- if {$image != false} {
- _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile is similar \[$diff different pixels\]"
- } else {
- _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile is similar \[$diff different pixels\]"
- }
- continue
- }
- }
-
- set stat(img1) [expr $stat(img1) + 1]
- if {$image != false} {
- _log_and_puts log_image "IMAGE [split $basename /] $casename: $imgfile differs \[$diff different pixels\]"
- } else {
- _log_and_puts log "IMAGE [split $basename /] $casename: $imgfile differs \[$diff different pixels\]"
- }
- } else {
- file delete -force $diffile ;# clean useless artifact of diffimage
- }
- }
- }
- }
-
- # report CPU and memory difference in group if it is greater than 10%
- if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
- if { [expr abs ($gcpu1 - $gcpu2) > 0.5 + 0.005 * abs ($gcpu1 + $gcpu2)] } {
- if {$cpu != false} {
- _log_and_puts log_cpu "CPU [split $basename /]: [_diff_show_ratio $gcpu1 $gcpu2]"
- } else {
- _log_and_puts log "CPU [split $basename /]: [_diff_show_ratio $gcpu1 $gcpu2]"
- }
- }
- }
- if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
- if { [expr abs ($gmem1 - $gmem2) > 16 + 0.005 * abs ($gmem1 + $gmem2)] } {
- if {$memory != false} {
- _log_and_puts log_memory "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]"
- } else {
- _log_and_puts log "MEMORY [split $basename /]: [_diff_show_ratio $gmem1 $gmem2]"
- }
- }
- }
- }
-
- if { "$_statvar" == "" } {
- if {$memory != false || ($image == false && $cpu == false && $memory == false)} {
- if {$memory != false} {
- _log_and_puts log_memory "Total MEMORY difference: [_diff_show_ratio $stat(mem1) $stat(mem2)]"
- } else {
- _log_and_puts log "Total MEMORY difference: [_diff_show_ratio $stat(mem1) $stat(mem2)]"
- }
- }
- if {$cpu != false || ($image == false && $cpu == false && $memory == false)} {
- if {$cpu != false} {
- _log_and_puts log_cpu "Total CPU difference: [_diff_show_ratio $stat(cpu1) $stat(cpu2)]"
- } else {
- _log_and_puts log "Total CPU difference: [_diff_show_ratio $stat(cpu1) $stat(cpu2)]"
- }
- }
- if {$image != false || ($image == false && $cpu == false && $memory == false)} {
- if {$image != false} {
- _log_and_puts log_image "Total IMAGE difference: [_diff_show_positive_ratio $stat(img1) $stat(img2)]"
- } else {
- _log_and_puts log "Total IMAGE difference: [_diff_show_positive_ratio $stat(img1) $stat(img2)]"
- }
- }
- }
-}
-
-# Auxiliary procedure to save log of results comparison to file
-proc _log_html_diff {file log dir1 dir2 highlight_percent} {
- # create missing directories as needed
- catch {file mkdir [file dirname $file]}
-
- # try to open a file
- if [catch {set fd [open $file w]} res] {
- error "Error saving log file $file: $res"
- }
-
- # print header
- puts $fd "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>"
- puts $fd "<title>Diff $dir1 vs. $dir2</title></head><body>"
- puts $fd "<h1>Comparison of test results:</h1>"
- puts $fd "<h2>Version A \[NEW\] - $dir1</h2>"
- puts $fd "<h2>Version B \[REF\] - $dir2</h2>"
-
- # add script for switching between images on click
- puts $fd ""
- puts $fd "<script type=\"text/javascript\">"
- puts $fd " function diffimage_toggle(img,url1,url2)"
- puts $fd " {"
- puts $fd " if (img.show2nd) { img.src = url1; img.show2nd = false; }"
- puts $fd " else { img.src = url2; img.show2nd = true; }"
- puts $fd " }"
- puts $fd " function diffimage_reset(img,url) { img.src = url; img.show2nd = true; }"
- puts $fd "</script>"
- puts $fd ""
-
- # print log body
- puts $fd "<pre>"
- set logpath [file split [file normalize $file]]
- foreach line $log {
- # put a line; highlight considerable (> ${highlight_percent}%) deviations of CPU and memory
- if { [regexp "\[\\\[](\[0-9.e+-]+)%\[\]]" $line res value] &&
- [expr abs($value)] > ${highlight_percent} } {
- puts $fd "<table><tr><td bgcolor=\"[expr $value > 0 ? \"ff8080\" : \"lightgreen\"]\">$line</td></tr></table>"
- } elseif { [regexp {^IMAGE[ \t]+([^:]+):[ \t]+([A-Za-z0-9_.-]+) is similar} $line res case img] } {
- if { [catch {eval file join "" [lrange $case 0 end-1]} gridpath] } {
- # note: special handler for the case if test grid directoried are compared directly
- set gridpath ""
- }
- set aCaseName [lindex $case end]
- puts $fd "<table><tr><td bgcolor=\"orange\"><a href=\"[_make_url $file [file join $dir1 $gridpath $aCaseName.html]]\">$line</a></td></tr></table>"
- } elseif { [regexp {^IMAGE[ \t]+([^:]+):[ \t]+([A-Za-z0-9_.-]+)} $line res case img] } {
- # add images
- puts $fd $line
- if { [catch {eval file join "" [lrange $case 0 end-1]} gridpath] } {
- # note: special handler for the case if test grid directoried are compared directly
- set gridpath ""
- }
- set aCaseName [lindex $case end]
- set img1url [_make_url $file [file join $dir1 $gridpath $img]]
- set img2url [_make_url $file [file join $dir2 $gridpath $img]]
- set img1 "<a href=\"[_make_url $file [file join $dir1 $gridpath $aCaseName.html]]\"><img src=\"$img1url\"></a>"
- set img2 "<a href=\"[_make_url $file [file join $dir2 $gridpath $aCaseName.html]]\"><img src=\"$img2url\"></a>"
-
- set difffile [_diff_img_name $dir1 $dir2 $gridpath $img]
- set imgdurl [_make_url $file $difffile]
- if { [file exists $difffile] } {
- set imgd "<img src=\"$imgdurl\" onmouseout=diffimage_reset(this,\"$imgdurl\") onclick=diffimage_toggle(this,\"$img1url\",\"$img2url\")>"
- } else {
- set imgd "N/A"
- }
-
- puts $fd "<table><tr><th><abbr title=\"$dir1\">Version A</abbr></th><th><abbr title=\"$dir2\">Version B</abbr></th><th>Diff (click to toggle)</th></tr>"
- puts $fd "<tr><td>$img1</td><td>$img2</td><td>$imgd</td></tr></table>"
- } else {
- puts $fd $line
- }
- }
- puts $fd "</pre></body></html>"
-
- close $fd
- return
-}
-
-# get number of CPUs on the system
-proc _get_nb_cpus {} {
- global tcl_platform env
-
- if { "$tcl_platform(platform)" == "windows" } {
- # on Windows, take the value of the environment variable
- if { [info exists env(NUMBER_OF_PROCESSORS)] &&
- ! [catch {expr $env(NUMBER_OF_PROCESSORS) > 0} res] && $res >= 0 } {
- return $env(NUMBER_OF_PROCESSORS)
- }
- } elseif { "$tcl_platform(os)" == "Linux" } {
- # on Linux, take number of logical processors listed in /proc/cpuinfo
- if { [catch {open "/proc/cpuinfo" r} fd] } {
- return 0 ;# should never happen, but...
- }
- set nb 0
- while { [gets $fd line] >= 0 } {
- if { [regexp {^processor[ \t]*:} $line] } {
- incr nb
- }
- }
- close $fd
- return $nb
- } elseif { "$tcl_platform(os)" == "Darwin" } {
- # on MacOS X, call sysctl command
- if { ! [catch {exec sysctl hw.ncpu} ret] &&
- [regexp {^hw[.]ncpu[ \t]*:[ \t]*([0-9]+)} $ret res nb] } {
- return $nb
- }
- }
-
- # if cannot get good value, return 0 as default
- return 0
-}
-
-# check two files for difference
-proc _diff_files {file1 file2} {
- set fd1 [open $file1 "r"]
- set fd2 [open $file2 "r"]
-
- set differ f
- while {! $differ} {
- set nb1 [gets $fd1 line1]
- set nb2 [gets $fd2 line2]
- if { $nb1 != $nb2 } { set differ t; break }
- if { $nb1 < 0 } { break }
- if { [string compare $line1 $line2] } {
- set differ t
- }
- }
-
- close $fd1
- close $fd2
-
- return $differ
-}
-
-# Check if file is in DOS encoding.
-# This check is done by presence of \r\n combination at the end of the first
-# line (i.e. prior to any other \n symbol).
-# Note that presence of non-ascii symbols typically used for recognition
-# of binary files is not suitable since some IGES and STEP files contain
-# non-ascii symbols.
-# Special check is added for PNG files which contain \r\n in the beginning.
-proc _check_dos_encoding {file} {
- set fd [open $file rb]
- set isdos f
- if { [gets $fd line] && [regexp {.*\r$} $line] &&
- ! [regexp {^.PNG} $line] } {
- set isdos t
- }
- close $fd
- return $isdos
-}
-
-# procedure to recognize format of a data file by its first symbols (for OCCT
-# BREP and geometry DRAW formats, IGES, and STEP) and extension (all others)
-proc _check_file_format {file} {
- set fd [open $file rb]
- set line [read $fd 1024]
- close $fd
-
- set warn f
- set ext [file extension $file]
- set format unknown
- if { [regexp {^DBRep_DrawableShape} $line] } {
- set format BREP
- if { "$ext" != ".brep" && "$ext" != ".rle" &&
- "$ext" != ".draw" && "$ext" != "" } {
- set warn t
- }
- } elseif { [regexp {^DrawTrSurf_} $line] } {
- set format DRAW
- if { "$ext" != ".rle" &&
- "$ext" != ".draw" && "$ext" != "" } {
- set warn t
- }
- } elseif { [regexp {^[ \t]*ISO-10303-21} $line] } {
- set format STEP
- if { "$ext" != ".step" && "$ext" != ".stp" } {
- set warn t
- }
- } elseif { [regexp {^.\{72\}S[0 ]\{6\}1} $line] } {
- set format IGES
- if { "$ext" != ".iges" && "$ext" != ".igs" } {
- set warn t
- }
- } elseif { "$ext" == ".igs" } {
- set format IGES
- } elseif { "$ext" == ".stp" } {
- set format STEP
- } else {
- set format [string toupper [string range $ext 1 end]]
- }
-
- if { $warn } {
- puts "$file: Warning: extension ($ext) does not match format ($format)"
- }
-
- return $format
-}
-
-# procedure to load file knowing its format
-proc load_data_file {file format shape} {
- switch $format {
- BREP { uplevel restore $file $shape }
- DRAW { uplevel restore $file $shape }
- IGES { pload XSDRAW; uplevel igesbrep $file $shape * }
- STEP { pload XSDRAW; uplevel stepread $file __a *; uplevel renamevar __a_1 $shape }
- STL { pload XSDRAW; uplevel readstl $shape $file triangulation }
- default { error "Cannot read $format file $file" }
- }
-}
-
-# procedure to get name of temporary directory,
-# ensuring it is existing and writeable
-proc _get_temp_dir {} {
- global env tcl_platform
-
- # check typical environment variables
- foreach var {TempDir Temp Tmp} {
- # check different case
- foreach name [list [string toupper $var] $var [string tolower $var]] {
- if { [info exists env($name)] && [file isdirectory $env($name)] &&
- [file writable $env($name)] } {
- return [regsub -all {\\} $env($name) /]
- }
- }
- }
-
- # check platform-specific locations
- set fallback tmp
- if { "$tcl_platform(platform)" == "windows" } {
- set paths "c:/TEMP c:/TMP /TEMP /TMP"
- if { [info exists env(HOMEDRIVE)] && [info exists env(HOMEPATH)] } {
- set fallback [regsub -all {\\} "$env(HOMEDRIVE)$env(HOMEPATH)/tmp" /]
- }
- } else {
- set paths "/tmp /var/tmp /usr/tmp"
- if { [info exists env(HOME)] } {
- set fallback "$env(HOME)/tmp"
- }
- }
- foreach dir $paths {
- if { [file isdirectory $dir] && [file writable $dir] } {
- return $dir
- }
- }
-
- # fallback case: use subdir /tmp of home or current dir
- file mkdir $fallback
- return $fallback
-}
-
-# extract of code from testgrid command used to process jobs running in
-# parallel until number of jobs in the queue becomes equal or less than
-# specified value
-proc _testgrid_process_jobs {worker {nb_ok 0}} {
- # bind local vars to variables of the caller procedure
- upvar log log
- upvar logdir logdir
- upvar job_def job_def
- upvar nbpooled nbpooled
- upvar userbreak userbreak
- upvar refresh refresh
- upvar refresh_timer refresh_timer
-
- catch {tpool::resume $worker}
- while { ! $userbreak && $nbpooled > $nb_ok } {
- foreach job [tpool::wait $worker [array names job_def]] {
- eval _log_test_case \[tpool::get $worker $job\] $job_def($job) log
- unset job_def($job)
- incr nbpooled -1
- }
-
- # check for user break
- if { "[info commands dbreak]" == "dbreak" && [catch dbreak] } {
- set userbreak 1
- }
-
- # update summary log with requested period
- if { $logdir != "" && $refresh > 0 && [clock seconds] > $refresh_timer + $refresh } {
- _log_summarize $logdir $log
- set refresh_timer [clock seconds]
- }
- }
- catch {tpool::suspend $worker}
-}
-
-help checkcolor {
- Check pixel color.
- Use: checkcolor x y red green blue
- x y - pixel coordinates
- red green blue - expected pixel color (values from 0 to 1)
- Function check color with tolerance (5x5 area)
-}
-# Procedure to check color using command vreadpixel with tolerance
-proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
- puts "Coordinate x = $coord_x"
- puts "Coordinate y = $coord_y"
- puts "RED color of RGB is $rd_get"
- puts "GREEN color of RGB is $gr_get"
- puts "BLUE color of RGB is $bl_get"
-
- if { $coord_x <= 1 || $coord_y <= 1 } {
- puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
- return -1
- }
-
- set color ""
- catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] }
- if {"$color" == ""} {
- puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view"
- }
- set rd [lindex $color 0]
- set gr [lindex $color 1]
- set bl [lindex $color 2]
- set rd_int [expr int($rd * 1.e+05)]
- set gr_int [expr int($gr * 1.e+05)]
- set bl_int [expr int($bl * 1.e+05)]
- set rd_ch [expr int($rd_get * 1.e+05)]
- set gr_ch [expr int($gr_get * 1.e+05)]
- set bl_ch [expr int($bl_get * 1.e+05)]
-
- if { $rd_ch != 0 } {
- set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
- } else {
- set tol_rd $rd_int
- }
- if { $gr_ch != 0 } {
- set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
- } else {
- set tol_gr $gr_int
- }
- if { $bl_ch != 0 } {
- set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
- } else {
- set tol_bl $bl_int
- }
-
- set status 0
- if { $tol_rd > 0.2 } {
- puts "Warning : RED light of additive color model RGB is invalid"
- set status 1
- }
- if { $tol_gr > 0.2 } {
- puts "Warning : GREEN light of additive color model RGB is invalid"
- set status 1
- }
- if { $tol_bl > 0.2 } {
- puts "Warning : BLUE light of additive color model RGB is invalid"
- set status 1
- }
-
- if { $status != 0 } {
- puts "Warning : Colors of default coordinate are not equal"
- }
-
- global stat
- if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
- set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
- set stat [lindex $info end]
- if { ${stat} != 1 } {
- puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
- return $stat
- } else {
- puts "Point with valid color was found"
- return $stat
- }
- } else {
- set stat 1
- }
-}
-
-# Procedure to check color in the point near default coordinate
-proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
- set x_start [expr ${coord_x} - 2]
- set y_start [expr ${coord_y} - 2]
- set mistake 0
- set i 0
- while { $mistake != 1 && $i <= 5 } {
- set j 0
- while { $mistake != 1 && $j <= 5 } {
- set position_x [expr ${x_start} + $j]
- set position_y [expr ${y_start} + $i]
- puts $position_x
- puts $position_y
-
- set color ""
- catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] }
- if {"$color" == ""} {
- puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view"
- incr j
- continue
- }
- set rd [lindex $color 0]
- set gr [lindex $color 1]
- set bl [lindex $color 2]
- set rd_int [expr int($rd * 1.e+05)]
- set gr_int [expr int($gr * 1.e+05)]
- set bl_int [expr int($bl * 1.e+05)]
-
- if { $rd_ch != 0 } {
- set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
- } else {
- set tol_rd $rd_int
- }
- if { $gr_ch != 0 } {
- set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
- } else {
- set tol_gr $gr_int
- }
- if { $bl_ch != 0 } {
- set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
- } else {
- set tol_bl $bl_int
- }
-
- if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
- puts "Warning : Point with true color was not found near default coordinates"
- set mistake 0
- } else {
- set mistake 1
- }
- incr j
- }
- incr i
- }
- return $mistake
-}
-
-# Procedure to check if sequence of values in listval follows linear trend
-# adding the same delta on each step.
-#
-# The function does statistical estimation of the mean variation of the
-# values of the sequence, and dispersion, and returns true only if both
-# dispersion and deviation of the mean from expected delta are within
-# specified tolerance.
-#
-# If mean variation differs from expected delta on more than two dispersions,
-# the check fails and procedure raises error with specified message.
-#
-# Otherwise the procedure returns false meaning that more iterations are needed.
-# Note that false is returned in any case if length of listval is less than 3.
-#
-# See example of use to check memory leaks in bugs/caf/bug23489
-#
-proc checktrend {listval delta tolerance message} {
- set nbval [llength $listval]
- if { $nbval < 3} {
- return 0
- }
-
- # calculate mean value
- set mean 0.
- set prev [lindex $listval 0]
- foreach val [lrange $listval 1 end] {
- set mean [expr $mean + ($val - $prev)]
- set prev $val
- }
- set mean [expr $mean / ($nbval - 1)]
-
- # calculate dispersion
- set sigma 0.
- set prev [lindex $listval 0]
- foreach val [lrange $listval 1 end] {
- set d [expr ($val - $prev) - $mean]
- set sigma [expr $sigma + $d * $d]
- set prev $val
- }
- set sigma [expr sqrt ($sigma / ($nbval - 2))]
-
- puts "Checking trend: nb = $nbval, mean delta = $mean, sigma = $sigma"
-
- # check if deviation is definitely too big
- if { abs ($mean - $delta) > $tolerance + 2. * $sigma } {
- puts "Checking trend failed: mean delta per step = $mean, sigma = $sigma, expected delta = $delta"
- error "$message"
- }
-
- # check if deviation is clearly within a range
- return [expr abs ($mean - $delta) <= $sigma && $sigma <= $tolerance]
-}
-
-# Procedure to clean up test results by removing skipped test directories
-help cleanuptest {
- Clean up test results by removing skipped test case directories and non-essential files.
- Use: cleanuptest results_dir
- Where results_dir is the directory containing test results including tests.log
-}
-proc cleanuptest {results_dir} {
- # Function to extract test case path from test case name
- proc get_test_path {test_case} {
- # Extract directory parts from test case string
- # Format: "CASE group grid case: status"
- if { [regexp {^CASE ([^ ]+) (.*[^ ]) ([^ ]+):} $test_case -> group grid case] } {
- # Remove any extra spaces from grid
- set grid [string trim $grid]
- return [file join $group $grid $case]
- }
- puts "Error: Cannot parse test case: $test_case"
- return ""
- }
-
- set log_file [file join $results_dir "tests.log"]
- if { ! [file exists $log_file] } {
- puts "Error: No tests.log found in $results_dir"
- return
- }
-
- # Process tests.log and find skipped tests
- set fd [open $log_file r]
- while {[gets $fd line] >= 0} {
- if {[regexp {^CASE.*: SKIPPED \(data file is missing\)$} $line]} {
- set test_path [get_test_path $line]
- if { $test_path != "" } {
- set full_path [file join $results_dir $test_path]
- # Delete any files with this base path (any extension)
- set files_to_delete [glob -nocomplain "${full_path}*"]
- foreach file $files_to_delete {
- if {[file exists $file]} {
- file delete -force $file
- }
- }
- # Delete directory if it exists
- if {[file isdirectory $full_path]} {
- file delete -force $full_path
- }
- }
- }
- }
- close $fd
-}
+++ /dev/null
-# Copyright (c) 2016 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-#
-# Created by: M.Sazonov
-#
-# Working with vectors and various measurements
-#
-# [2d] point is represented by (two/three) coords
-# [2d] vector is represented by (two/three) coords
-# plane is represented by an origin point and a normal vector
-# [2d] line is represented by an origin point and a vector
-
-help vec {vec x1 y1 z1 x2 y2 z2
- returns coordinates of vector between two points\
-} {Vector and measurement Commands}
-
-proc vec {x1 y1 z1 x2 y2 z2} {
- uplevel list [dval ($x2)-($x1)] [dval ($y2)-($y1)] [dval ($z2)-($z1)]
-}
-
-help 2dvec {2dvec x1 y1 x2 y2
- returns coordinates of 2D vector between two 2D points\
-} {Vector and measurement Commands}
-
-proc 2dvec {x1 y1 x2 y2} {
- uplevel list [dval ($x2)-($x1)] [dval ($y2)-($y1)]
-}
-
-help pln {pln x1 y1 z1 x2 y2 z2 x3 y3 z3
- returns plane built on three points\
-} {Vector and measurement Commands}
-
-proc pln {x1 y1 z1 x2 y2 z2 x3 y3 z3} {
- set v12 [uplevel eval norm [vec $x1 $y1 $z1 $x2 $y2 $z2]]
- set v13 [uplevel eval norm [vec $x1 $y1 $z1 $x3 $y3 $z3]]
- set vn [eval cross $v12 $v13]
- set N [eval module $vn]
- if [expr $N < 1e-7] {
- puts "points are on a line"
- return
- }
- concat $x1 $y1 $z1 [eval norm $vn]
-}
-
-help module {module x y z
- returns module of a vector\
-} {Vector and measurement Commands}
-
-proc module {x y z} {
- uplevel dval sqrt(($x)*($x)+($y)*($y)+($z)*($z))
-}
-
-help 2dmodule {2dmodule x y
- returns module of a 2D vector\
-} {Vector and measurement Commands}
-
-proc 2dmodule {x y} {
- uplevel dval sqrt(($x)*($x)+($y)*($y))
-}
-
-help norm {norm x y z
- returns unified vector from a given vector\
-} {Vector and measurement Commands}
-
-proc norm {x y z} {
- set N [uplevel dval sqrt(($x)*($x)+($y)*($y)+($z)*($z))]
- list [uplevel dval ($x)/$N] [uplevel dval ($y)/$N] [uplevel dval ($z)/$N]
-}
-
-help 2dnorm {2dnorm x y
- returns unified vector from a given 2D vector\
-} {Vector and measurement Commands}
-
-proc 2dnorm {x y} {
- set N [uplevel dval sqrt(($x)*($x)+($y)*($y))]
- list [uplevel dval ($x)/$N] [uplevel dval ($y)/$N]
-}
-
-help inverse {inverse x y z
- returns inversed vector\
-} {Vector and measurement Commands}
-
-proc inverse {x y z} {
- list [uplevel dval -$x] [uplevel dval -$y] [uplevel dval -$z]
-}
-
-help 2dinverse {2dinverse x y
- returns inversed 2D vector\
-} {Vector and measurement Commands}
-
-proc 2dinverse {x y} {
- list [uplevel dval -$x] [uplevel dval -$y]
-}
-
-help 2dort {2dort x y
- returns 2D vector rotated on 90 degrees\
-} {Vector and measurement Commands}
-
-proc 2dort {x y} {
- list [uplevel dval -$y] [uplevel dval $x]
-}
-
-help distpp {distpp x1 y1 z1 x2 y2 z2
- returns distance between two points\
-} {Vector and measurement Commands}
-
-proc distpp {x1 y1 z1 x2 y2 z2} {
- eval module [uplevel vec $x1 $y1 $z1 $x2 $y2 $z2]
-}
-
-help 2ddistpp {2ddistpp x1 y1 x2 y2
- returns distance between two 2D points\
-} {Vector and measurement Commands}
-
-proc 2ddistpp {x1 y1 x2 y2} {
- eval 2dmodule [uplevel 1 2dvec $x1 $y1 $x2 $y2]
-}
-
-help distplp {distplp xo yo zo dx dy dz xp yp zp
- returns distance between plane and point\
-} {Vector and measurement Commands}
-
-proc distplp {xo yo zo dx dy dz xp yp zp} {
- set vop [uplevel vec $xo $yo $zo $xp $yp $zp]
- set vn [uplevel norm $dx $dy $dz]
- eval dot $vop $vn
-}
-
-help distlp {distlp xo yo zo dx dy dz xp yp zp
- returns distance between line and point\
-} {Vector and measurement Commands}
-
-proc distlp {xo yo zo dx dy dz xp yp zp} {
- set vop [uplevel vec $xo $yo $zo $xp $yp $zp]
- set vl [uplevel norm $dx $dy $dz]
- eval module [eval cross $vl $vop]
-}
-
-help 2ddistlp {2ddistlp xo yo dx dy xp yp
- returns distance between 2D line and point\
-} {Vector and measurement Commands}
-
-proc 2ddistlp {xo yo dx dy xp yp} {
- set vop [uplevel 1 2dvec $xo $yo $xp $yp]
- set vl [uplevel 1 2dnorm $dx $dy]
- eval 2dcross $vl $vop
-}
-
-help distppp {distppp x1 y1 z1 x2 y2 z2 x3 y3 z3
- returns deviation of point p2 from segment p1-p3\
-} {Vector and measurement Commands}
-
-proc distppp {x1 y1 z1 x2 y2 z2 x3 y3 z3} {
- set vop [uplevel vec $x1 $y1 $z1 $x2 $y2 $z2]
- set vl [uplevel eval norm [vec $x1 $y1 $z1 $x3 $y3 $z3]]
- eval module [eval cross $vl $vop]
-}
-
-help 2ddistppp {2ddistppp x1 y1 x2 y2 x3 y3
- returns deviation of 2D point p2 from segment p1-p3 (sign shows the side)\
-} {Vector and measurement Commands}
-
-proc 2ddistppp {x1 y1 x2 y2 x3 y3} {
- set vop [uplevel 1 2dvec $x1 $y1 $x2 $y2]
- set vl [uplevel eval 2dnorm [2dvec $x1 $y1 $x3 $y3]]
- eval 2dcross $vl $vop
-}
-
-help barycen {barycen x1 y1 z1 x2 y2 z2 par
- returns point of a given parameter between two points\
-} {Vector and measurement Commands}
-
-proc barycen {x1 y1 z1 x2 y2 z2 par} {
- uplevel list [dval ($x1)*(1-($par))+($x2)*($par)]\
- [dval ($y1)*(1-($par))+($y2)*($par)]\
- [dval ($z1)*(1-($par))+($z2)*($par)]
-}
-
-help 2dbarycen {2dbarycen x1 y1 x2 y2 par
- returns 2D point of a given parameter between two points\
-} {Vector and measurement Commands}
-
-proc 2dbarycen {x1 y1 x2 y2 par} {
- uplevel list [dval ($x1)*(1-($par))+($x2)*($par)]\
- [dval ($y1)*(1-($par))+($y2)*($par)]
-}
-
-help cross {cross x1 y1 z1 x2 y2 z2
- returns cross product of two vectors\
-} {Vector and measurement Commands}
-
-proc cross {x1 y1 z1 x2 y2 z2} {
- set x [uplevel dval ($y1)*($z2)-($z1)*($y2)]
- set y [uplevel dval ($z1)*($x2)-($x1)*($z2)]
- set z [uplevel dval ($x1)*($y2)-($y1)*($x2)]
- list $x $y $z
-}
-
-help 2dcross {2dcross x1 y1 x2 y2
- returns cross product of two 2D vectors\
-} {Vector and measurement Commands}
-
-proc 2dcross {x1 y1 x2 y2} {
- uplevel dval ($x1)*($y2)-($y1)*($x2)
-}
-
-help dot {dot x1 y1 z1 x2 y2 z2
- returns scalar product of two vectors\
-} {Vector and measurement Commands}
-
-proc dot {x1 y1 z1 x2 y2 z2} {
- uplevel dval ($x1)*($x2)+($y1)*($y2)+($z1)*($z2)
-}
-
-help 2ddot {2ddot x1 y1 x2 y2
- returns scalar product of two 2D vectors\
-} {Vector and measurement Commands}
-
-proc 2ddot {x1 y1 x2 y2} {
- uplevel dval ($x1)*($x2)+($y1)*($y2)
-}
-
-help vecangle {vecangle x1 y1 z1 x2 y2 z2
- returns angle between two vectors\
-} {Vector and measurement Commands}
-
-proc vecangle {x1 y1 z1 x2 y2 z2} {
- set d [uplevel dot $x1 $y1 $z1 $x2 $y2 $z2]
- set c [uplevel cross $x1 $y1 $z1 $x2 $y2 $z2]
- set cm [uplevel module $c]
-
- set m1 [uplevel module $x1 $y1 $z1]
- set m2 [uplevel module $x2 $y2 $z2]
- set mm [expr $m1*$m2]
-
- if { $cm < $d } {
- expr asin($cm/$mm)
- } else {
- expr acos($d/$mm)
- }
-}
-
-help 2dvecangle {2dvecangle x1 y1 x2 y2
- returns angle between two vectors\
-} {Vector and measurement Commands}
-
-proc 2dvecangle {x1 y1 x2 y2} {
- set d [uplevel 1 2ddot $x1 $y1 $x2 $y2]
- set c [uplevel 1 2dcross $x1 $y1 $x2 $y2]
-
- set m1 [uplevel 1 2dmodule $x1 $y1]
- set m2 [uplevel 1 2dmodule $x2 $y2]
- set mm [expr $m1*$m2]
-
- if { $c < $d } {
- expr asin($c/$mm)
- } else {
- expr acos($d/$mm)
- }
-}
-
-help scale {scale x y z factor
- returns vector multiplied by scalar\
-} {Vector and measurement Commands}
-
-proc scale {x y z factor} {
- list [dval $x*$factor] [dval $y^$factor] [dval $z*$factor]
-}
-
-help 2dscale {2dscale x y factor
- returns 2D vector multiplied by scalar\
-} {Vector and measurement Commands}
-
-proc 2dscale {x y factor} {
- list [dval $x*$factor] [dval $y^$factor]
-}
-
-help pntc {pntc curve u
- returns coordinates of point on curve with given parameter\
-} {Vector and measurement Commands}
-
-proc pntc {curv u} {
- upvar \#0 $curv c
- cvalue c $u x y z
- return "[dval x] [dval y] [dval z]"
-}
-
-help 2dpntc {2dpntc curv2d u
- returns coordinates of 2D point on 2D curve with given parameter\
-} {Vector and measurement Commands}
-
-proc 2dpntc {curv2d u} {
- upvar \#0 $curv2d c
- 2dcvalue c $u x y
- return "[dval x] [dval y]"
-}
-
-help pntsu {pntsu surf u v
- returns coordinates of point on surface with given parameters\
-} {Vector and measurement Commands}
-
-proc pntsu {surf u v} {
- upvar \#0 $surf s
- svalue s $u $v x y z
- return "[dval x] [dval y] [dval z]"
-}
-
-help pntcons {pntcons curv2d surf u
- returns coordinates of point on surface defined by
- point on 2D curve with given parameter\
-} {Vector and measurement Commands}
-
-proc pntcons {curv2d surf u} {
- upvar \#0 $curv2d c $surf s
- 2dcvalue c $u u0 v0
- svalue s u0 v0 x y z
- return "[dval x] [dval y] [dval z]"
-}
-
-help pnt {pnt point_or_vertex
- returns coordinates of point in the given Draw variable of type point or vertex\
-} {Vector and measurement Commands}
-
-proc pnt var {
- upvar \#0 $var v
- set type [dtyp v]
- set pp v
- if {[lindex $type 1] == "VERTEX"} {
- mkpoint p v
- set pp p
- set type "point"
- }
- if {$type == "point"} {
- if [catch {coord $pp x y z}] {
- if ![catch {coord $pp x y}] {
- return "[dval x] [dval y]"
- }
- } else {
- return "[dval x] [dval y] [dval z]"
- }
- }
-}
-
-help drseg {drseg name x1 y1 z1 x2 y2 z2
- creates a trimmed line between two points\
-} {Vector and measurement Commands}
-
-proc drseg {name x1 y1 z1 x2 y2 z2} {
- set x [uplevel dval $x1]
- set y [uplevel dval $y1]
- set z [uplevel dval $z1]
- set dx [uplevel dval ($x2)-($x1)]
- set dy [uplevel dval ($y2)-($y1)]
- set dz [uplevel dval ($z2)-($z1)]
- set len [module $dx $dy $dz]
- uplevel line $name $x $y $z $dx $dy $dz
- uplevel trim $name $name 0 $len
-}
-
-help 2ddrseg {2ddrseg name x1 y1 x2 y2
- creates a trimmed 2D line between two 2D points\
-} {Vector and measurement Commands}
-
-proc 2ddrseg {name x1 y1 x2 y2} {
- set x [uplevel dval $x1]
- set y [uplevel dval $y1]
- set dx [uplevel dval ($x2)-($x1)]
- set dy [uplevel dval ($y2)-($y1)]
- set len [2dmodule $dx $dy]
- uplevel line $name $x $y $dx $dy
- uplevel trim $name $name 0 $len
-}
-
-help mpick {show coordinates at mouse click\
-} {Vector and measurement Commands}
-
-proc mpick {} {
- puts "Pick position"
- pick id x1 y1 z1 b
- concat [dval x1] [dval y1] [dval z1]
-}
-
-help mdist {compute distance between two points of mouse clicks\
-} {Vector and measurement Commands}
-
-proc mdist {} {
- puts "Pick first position"
- pick id x1 y1 z1 b
- puts "Pick second position"
- pick id x2 y2 z2 b
- dval sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
-}
+++ /dev/null
-# Copyright (c) 1999-2014 OPEN CASCADE SAS
-#
-# This file is part of Open CASCADE Technology software library.
-#
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License version 2.1 as published
-# by the Free Software Foundation, with special exception defined in the file
-# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-# distribution for complete text of the license and disclaimer of any warranty.
-#
-# Alternatively, this file may be used under the terms of Open CASCADE
-# commercial license or contractual agreement.
-
-###########################
-# #
-# Version 1.4 #
-# by SZV #
-# #
-###########################
-#
-# Open : double-clic or +
-# Close : double-clic or -
-# Refresh tree : close top level and re-open
-#
-# Attributes:
-# white : interoperable
-# white + c : non interoperable
-# X : X Reference
-# Red : not yet committed in transaction #0
-#
-#
-
-proc __update { args } {
-}
-
-proc dftree { DDF_Browser } {
-
- global env
- global DFTREE_WINDOWS
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- puts $DDF_Browser
-
- package require Tk
-
- ## Create images
- set DFTREE_GLOBALS(ImageLabel) [DFOpenImage dfb_folder.gif]
- set DFTREE_GLOBALS(ImageAttrOther) [DFOpenImage dfb_attribute.gif]
- set DFTREE_GLOBALS(ImageAttrNS) [DFOpenImage dfb_attribns.gif]
-
-## set DFTREE_LabelStyle [tixDisplayStyle imagetext \
-## -font 9x15bold \
-## -background Bisque3 \
-## ]
-
-## set DFTREE_LabelStyle1 [tixDisplayStyle imagetext \
-## -font 9x15bold \
-## -background Bisque3 \
-## -foreground SeaGreen2 \
-## ]
-
-## set DFTREE_AttributeStyle [tixDisplayStyle imagetext \
-## -font 9x15 \
-## -background Bisque3 \
-## ]
-
-## set DFTREE_AttributeStyle1 [tixDisplayStyle imagetext \
-## -font 9x15 \
-## -background Bisque3 \
-## -foreground DarkGreen \
-## ]
-
-## set DFTREE_AttributeStyle2 [tixDisplayStyle imagetext \
-## -font 9x15 \
-## -background Bisque3 \
-## -foreground Red \
-## ]
-
- set w .$DDF_Browser
- toplevel $w -width 700 -height 400 -background bisque3
- wm minsize $w 700 400
-
- ########
- # Tree #
- ########
-
- #set tree1 [ttk::treeview $w.tree -show tree]
- set tree1 [ttk::treeview $w.tree -show tree -xscrollcommand "$w.tree.xscroll set" -yscrollcommand "$w.tree.yscroll set"]
- set aScrollX [ttk::scrollbar $w.tree.xscroll -command "$w.tree xview" -orient horizontal]
- set aScrollY [ttk::scrollbar $w.tree.yscroll -command "$w.tree yview"]
- pack $aScrollX -side bottom -fill x
- pack $aScrollY -side right -fill y
- $tree1 tag bind Label <<TreeviewOpen>> [list DFTREE:Tree:Open $DDF_Browser $w]
- $tree1 tag configure Label -font 9x15bold -foreground DarkGreen
- #$tree1 tag configure Attribute -font 9x15 -background bisque3
- #$tree1 tag configure AttributeList -font 9x15 -background bisque3
- pack $tree1 -expand yes -fill both -padx 4 -pady 4
-
- # to see different fonts: /usr/openwin/lib/X11/fonts/misc or xlsfonts?
- # 8x13 8x13bold 9x15 9x15bold
- # hlist.font 8x13bold
- # hlist.gap "15"
- # hlist.indent "30"
-
- set DFTREE_WINDOWS($w,tree) $tree1
- set DFTREE_WINDOWS($w,root) [$tree1 insert {} end \
- -text $DDF_Browser \
- -values "" \
- -tags Label]
-
- # Here we need to open first node!
-
- return
-}
-
-###############################################################################
-#
-#
-proc DFTREE:Tree:Open { DDF_Browser w } {
-
- global DFTREE_WINDOWS
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- set df_tree $DFTREE_WINDOWS($w,tree)
- set df_node [$df_tree focus]
-
- #if {$df_node == $DFTREE_WINDOWS($w,root)} {
- # This is root
- set chdlist [$df_tree children $df_node]
- if {$chdlist != {}} {
- # The root branch already exists in hlist.
- # Clear all its children to force the tree to be updated.
- $df_tree delete $chdlist
- }
- #}
-
- #update
- DFTREE:Tree:Fill $DDF_Browser $df_tree $df_node
- return
-}
-
-###############################################################################
-#
-#
-proc DFTREE:Tree:Fill { DDF_Browser df_tree df_node } {
-
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- set loc [lindex [$df_tree item $df_node -values] 0]
- set type [lindex [$df_tree item $df_node -tags] 0]
-
- switch -glob $type {
-
- Label {
- DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_node $loc
- }
-
- #AttributeList {
- # DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $loc
- #}
-
- default {
- }
- }
- return
-}
-
-###############################################################################
-# $df_entry is a label entry, "1:3:2" for example, or "" for root.
-#
-proc DFTREE:Tree:UpdateLabel { DDF_Browser df_tree df_node df_entry } {
-
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- foreach fullname [split [DFOpenLabel $DDF_Browser $df_entry] "\\" ] {
- FCTREE:Tree:DecodeLabelItem $DDF_Browser $df_tree $df_node $df_entry $fullname
- }
- return
-}
-
-###############################################################################
-#
-#
-proc DFTREE:Tree:UpdateAttributeList { DDF_Browser df_tree df_node df_entry} {
-
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- set image_other $DFTREE_GLOBALS(ImageAttrOther)
- set image_ns $DFTREE_GLOBALS(ImageAttrNS)
- #set xrefimage $DFTREE_GLOBALS(ImageAttrOther)
-
- # abv: index attributes
- set num 0
- set attributes [split [DFOpenAttributeList $DDF_Browser $df_entry ] "\\" ]
- set iattributes {}
- foreach fullname $attributes {
- set num [expr $num + 1]
- lappend fullname $num
- lappend iattributes $fullname
- }
-
- foreach fullname [lsort $iattributes] {
-
- # Information first split
- set tmplist [split $fullname " "]
- set name [lindex $tmplist 0]
- set transaction [lindex $tmplist 1]
- set valid [lindex $tmplist 2]
- set forgotten [lindex $tmplist 3]
- set backuped [lindex $tmplist 4]
- set maybeopen [lindex $tmplist 5]
-
- # Name analysis to suppress the map address.
- set shortlist [split $name "#"]
- set shortname [lindex $shortlist 0]
- set index [lindex $shortlist 1]
-
- # Package analysis to determine the icon type.
- #set pk [lindex [split $name _] 0]
- set node_img $image_other
- #if {$pk == "TDataStd" || $pk == "TNaming"} {set node_img $standardimage}
- #if {$pk == "TXRef"} {set node_img $xrefimage}
- if {$shortname == "TNaming_NamedShape"} {set node_img $image_ns}
-
- set textname "$shortname"
-
-# if { [llength $tmplist] >5 } { set textname [lindex $tmplist 5] }
- set textname "$textname [DFGetAttributeValue $DDF_Browser $df_entry [lindex $tmplist 6]]"
-
- # Transaction analysis
- if {$transaction == "0"} {
-# set locstyle $DFTREE_AttributeStyle
- } else {
-# set textname "$textname T=$transaction"
-# set locstyle $DFTREE_AttributeStyle1
- }
-
- # Valid?
- if {$valid == "NotValid"} {set textname "$textname $valid"}
-
- # Forgotten?
- if {$forgotten == "Forgotten"} {set textname "$textname $forgotten"}
-
- # Backuped?
- if {$backuped == "Backuped"} {set textname "$textname $backuped"}
-
- set df_new [$df_tree insert $df_node end \
- -text $textname -image $node_img -tags Attribute]
-
- if {$maybeopen == "1"} {
- $df_tree item $df_new -open true
- DFTREE:Tree:UpdateAttribute $DDF_Browser $df_tree $df_new $index
- }
- }
-}
-
-###############################################################################
-# $loc is always the attribute index
-#
-proc DFTREE:Tree:UpdateAttribute { DDF_Browser df_tree df_node a_index } {
-
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- set tmplist [split [DFOpenAttribute $DDF_Browser $a_index ] "\\"]
-
- # Failed or not?
- if {[lindex $tmplist 0] == "Failed"} {
-## set locstyle $DFTREE_AttributeStyle2
- } else {
-## set locstyle $DFTREE_AttributeStyle
- }
-
- foreach name $tmplist {
- $df_tree insert $df_node end -text $name -tags Terminal
- }
- return
-}
-
-###############################################################################
-# item:
-# "Entry Name=TheNameIfExists Modified|NotModified 0|1"
-proc FCTREE:Tree:DecodeLabelItem { DDF_Browser df_tree df_node df_entry labelItem} {
-
- global DFTREE_GLOBALS
- global $DDF_Browser
-
- set tmplist [split $labelItem " " ]
- set labname [lindex $tmplist 0]
-
- set textname "$labname"
-
- if {$labname == "AttributeList"} {
-
- # Attribute List
- # --------------
-
- #set modified [lindex $tmplist 1]
-
- # Modified or not?
- #if {$modified == "Modified"} {
- # set textname "$textname $modified"
-## set locstyle $DFTREE_AttributeStyle1
- #} else {
-## set locstyle $DFTREE_AttributeStyle
- #}
-
- #set df_new [$df_tree insert $df_node end \
- # -text $textname \
- # -image $DFTREE_GLOBALS(ImageAttrList) \
- # -tags AttributeList]
-
- #$df_tree item $df_new -open true
-
- DFTREE:Tree:UpdateAttributeList $DDF_Browser $df_tree $df_node $df_entry
-
- } else {
-
- # Sub-label(s)
- # ------------
-
- set name [lindex $tmplist 1]
- set modified [lindex $tmplist 2]
- set maybeopen [lindex $tmplist 3]
-
- # Name?
- set ll [expr [string length $name] -2]
- if {$ll > 0} {
- set textname "$textname [string range $name 1 $ll]"
- }
-
- # Modified or not?
- if {$modified == "Modified"} {
- set textname "$textname $modified"
- }
-
- set df_new [$df_tree insert $df_node end \
- -text $textname \
- -image $DFTREE_GLOBALS(ImageLabel) \
- -values $labname \
- -tags Label]
-
- if {$maybeopen == "1"} {
- $df_tree item $df_new -open true
- }
-
- DFTREE:Tree:UpdateLabel $DDF_Browser $df_tree $df_new $labname
- }
-}
-
-###############################################################################
-#
-#
-proc DFGetAttributeValue { DDF_Browser lab index } {
-
- global $DDF_Browser; # necessary for DRAW command to see the browser
-
- if {[catch "XAttributeValue $DDF_Browser $lab $index" ret]} {
- return ""
- }
- if {"$ret" == ""} { return "" }
- return "\[$ret\]"
-}
-
-###############################################################################
-#
-#
-proc DFOpenImage { img } {
-
- global env
-
- if {[catch "image create photo -file $env(CSF_OCCTResourcePath)/DrawResources/$img" ret]} {
- return ""
- }
- return $ret
-}
-msgfile:::SHAPE.fr
-msgfile:::SHAPE.us
SHMessage_SHAPE_us.pxx
+++ /dev/null
-! Message file for Shape Healing
-
-
-! ------------------------------------------------------------------------------
-! Messages for shape names
-!
-.Name.Shape.MSG0
-!
-.Name.Vertex.MSG0
-!
-.Name.Edge.MSG0
-!
-.Name.Wire.MSG0
-!
-.Name.Face.MSG0
-!
-.Name.Shell.MSG0
-!
-.Name.Solid.MSG0
-!
-.Name.CompSolid.MSG0
-!
-.Name.Compound.MSG0
-!
-! ------------------------------------------------------------------------------
-! Messages for sequence of operators
-!
-.SP.Sequence.Info.Seq
-Sequence d'operateurs: %s
-!
-.SP.Sequence.Info.Operator
-Operateur %d/%d: %s
-!
-.SP.Sequence.Error.NoOp
-Error: Operator %s is not found
-!
-.SP.Sequence.Error.Except
-Error: Operator %s failed with exception %s
-!
-.SP.Sequence.Warn.NoSeq
-Warning: Shape Processing: sequence not defined for %s
-!
-! ------------------------------------------------------------------------------
-! Messages for printing results of shape processing
-!
-.PrResult.Print.MSG50
- Shells:
-!
-.PrResult.Print.MSG55
- Faces:
-!
-.PrResult.Print.MSG100
-Mapping:
-!
-.PrResult.Print.MSG110
- Le Resultat est un Shell : %d
-!
-.PrResult.Print.MSG115
- Le Resultat est une Face : %d
-!
-.PrResult.Print.MSG150
- Pas de Resultat : %d
-!
-.PrResult.Print.MSG200
-Taux de Preparation:
-!
-.PrResult.Print.MSG205
- Shells: %d pour cent
-!
-.PrResult.Print.MSG210
- Faces : %d pour cent
-!
-!
-! ==============================================================================
-! Messages for Shape Healing
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Wire
-!
-.FixWire.FixDegenerated.MSG0
-Detection d'Arete(s) degeneree(s)
-!
-.FixWire.FixDegenerated.MSG5
-L'Arete n0 %d est degeneree
-!
-.FixWire.FixCurve3d.Removed
-Incomplete edge (with no pcurves or 3d curve) removed
-!
-.FixAdvWire.FixSmall.MSG0
-Petite(s) arete(s) supprimee(s)
-!
-.FixAdvWire.FixSmall.MSG5
-L'arete n0 %d etait petite, supprimee
-!
-.FixAdvWire.FixIntersection.MSG0
-Auto-intersection corrigee
-!
-.FixAdvWire.FixIntersection.MSG5
-L'arete etait auto-intersectante, corrigee
-!
-.FixAdvWire.FixIntersection.MSG10
-Les aretes s'intersectent, corrigees
-!
-.FixAdvWire.FixLacking.MSG0
-Insertion d'arete(s) manquante(s)
-!
-.FixAdvWire.FixLacking.MSG5
-Arete n0 %d manquante, inseree
-!
-.FixAdvWire..MSG0
-!
-.FixAdvWire..MSG5
-!
-.FixAdvWire..MSG10
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Face
-!
-.FixAdvFace.FixMissingSeam.MSG0
-Arete de couture manquante, ajoutee
-!
-.FixAdvFace.FixSmallAreaWire.MSG0
-Contour d'aire nulle, supprime
-!
-.FixAdvFace.FixOrientation.MSG0
-Face creee avec bords naturels
-!
-.FixAdvFace.FixOrientation.MSG5
-Contour sur face inverse
-!
-.FixAdvFace.FixOrientation.MSG11
-Impossible d'orienter le contour
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Wireframe
-!
-.FixWireframe.FixSmallEdges.MSG0
-Small edge removed
-!
-.FixWireframe.FixSmallEdges.MSG1
-Small wire removed
-!
-.FixWireframe.FixSmallEdges.MSG2
-Small face removed
-!
-.FixWireframe.FixFixWireGaps.MSG0
-Gaps in a wire fixed
-!
-!
-.Fix.SplitCommonVertex.MSG0
-Wires with common vertex fixed
-!
-!
-.FixAdvShell.FixOrientation.MSG20
-Impossible d'orienter les faces dans le shell, creation de plusieurs shells
-!
-.FixAdvShell.FixOrientation.MSG30
-Shell avec connexions incorrectes, divise en plusieurs parties
-!
-.FixAdvSolid.FixShell.MSG10
-Impossible de creer un Solide a partir d'un shell ouvert
-!
-.FixAdvSolid.FixOrientation.MSG20
-L'Orientation du/des shell(s) dans le solida ete corrigee
-!
-.FixAdvSolid.FixOrientation.MSG30
-Solide avec connexions incorrectes, divise en plusieurs parties
-!
-.FixAdvFace.FixLoopWire.MSG0
-Wire was split on several wires
-!
-.FixAdvFace..MSG5
-!
-.FixAdvFace..MSG10
-!
-.FixEdge.SameParameter.MSG0
-Not same parameter edge fixed
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_FixSmallFace
-!
-.FixAdvFace.FixSpotFace.MSG0
-Spot face removed
-!
-.FixAdvFace.FixStripFace.MSG0
-Strip face removed
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_FixSmallSolid
-!
-.ShapeFix.FixSmallSolid.MSG0
-Small solid removed
-!
-.ShapeFix.FixSmallSolid.MSG1
-Small solid merged with other
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Shell
-!
-.FixAdvShell.FixOrientation.MSG0
-Faces mal orientees dans le shell, corrigees
-!
-.FixAdvShell.FixOrientation.MSG5
-Faces mal orientees dans le shell, non corrigees
-!
-.FixAdvShell.FixClosedFlag.MSG0
-Shell has incorrect flag isClosed
-!
-.FixAdvShell..MSG5
-!
-.FixAdvShell..MSG10
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeUpgrade
-!
-.ShapeDivide.FaceDivide.MSG0
-Face divided
-!
-.ShapeDivide.WireDivide.MSG0
-Wire divided
-!
-.ShapeDivide.EdgeDivide.MSG0
-Edge divided
-!
-.ShapeDivide.FaceConvertToBezier.MSG0
-Face converted to Bezier
-!
-.ShapeDivide.WireConvertToBezier.MSG0
-Wire converted to Bezier
-!
-.ShapeDivide.EdgeConvertToBezier.MSG0
-Edge converted to Bezier
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeCustom
-!
-.BSplineRestriction.NewSurface.MSG0
-Face converted to BSpline
-!
-.BSplineRestriction.NewSurface.MSG1
-BSpline Face re-approximated
-!
-.BSplineRestriction.NewCurve.MSG0
-Edge converted to BSpline
-!
-.BSplineRestriction.NewCurve.MSG1
-BSpline Edge re-approximated
-!
-!
-.ConvertToBSpline.NewSurface.MSG0
-Face converted to BSpline
-!
-.ConvertToBSpline.NewCurve.MSG0
-Edge converted to BSpline
-!
-!
-.ConvertToRevolution.NewSurface.MSG0
-Face converted to surface of revolution
-!
-!
-.DirectModification.NewSurface.MSG0
-Direction of Face of revolution corrected
-!
-!
-.SweptToElementary.NewSurface.MSG0
-Swept Face converted to elementary
-!
+++ /dev/null
-
-! Message file for Shape Healing
-
-
-! ------------------------------------------------------------------------------
-! Messages for shape names
-!
-.Name.Shape.MSG0
-!
-.Name.Vertex.MSG0
-!
-.Name.Edge.MSG0
-!
-.Name.Wire.MSG0
-!
-.Name.Face.MSG0
-!
-.Name.Shell.MSG0
-!
-.Name.Solid.MSG0
-!
-.Name.CompSolid.MSG0
-!
-.Name.Compound.MSG0
-!
-! ------------------------------------------------------------------------------
-! Messages for sequence of operators
-!
-.SP.Sequence.Info.Seq
-Info: Shape Processing: Sequence of operators: %s
-!
-.SP.Sequence.Info.Operator
-Info: Shape Processing: Operator %d/%d: %s
-!
-.SP.Sequence.Error.NoOp
-Error: Shape Processing: Operator %s is not found
-!
-.SP.Sequence.Error.Except
-Error: Shape Processing: Operator %s failed with exception %s
-!
-.SP.Sequence.Warn.NoSeq
-Warning: Shape Processing: Sequence not defined for %s, nothing to do
-!
-! ------------------------------------------------------------------------------
-! Messages for printing results of shape processing
-!
-.PrResult.Print.MSG50
- Shells:
-!
-.PrResult.Print.MSG55
- Faces:
-!
-.PrResult.Print.MSG100
-Mapping:
-!
-.PrResult.Print.MSG110
- Result is Shell : %d
-!
-.PrResult.Print.MSG115
- Result is Face : %d
-!
-.PrResult.Print.MSG150
- No Result : %d
-!
-.PrResult.Print.MSG200
-Preparation ratio:
-!
-.PrResult.Print.MSG205
- Shells: %d per cent
-!
-.PrResult.Print.MSG210
- Faces : %d per cent
-!
-! ==============================================================================
-! Messages for Shape Healing
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Wire
-!
-.FixWire.FixDegenerated.MSG0
-Degenerated edge(s) detected
-!
-.FixWire.FixDegenerated.MSG5
-Degenerated edge %d detected
-!
-.FixWire.FixCurve3d.Removed
-Incomplete edge (with no pcurves or 3d curve) removed
-!
-.FixAdvWire.FixSmall.MSG0
-Small edge(s) removed
-!
-.FixAdvWire.FixSmall.MSG5
-Edge %d was small, removed
-!
-.FixAdvWire.FixIntersection.MSG0
-Self-intersection corrected
-!
-.FixAdvWire.FixIntersection.MSG5
-Edge was self-intersecting, corrected
-!
-.FixAdvWire.FixIntersection.MSG10
-Edges were intersecting, corrected
-!
-.FixAdvWire.FixLacking.MSG0
-Lacking edge(s) inserted
-!
-.FixAdvWire.FixLacking.MSG5
-Lacking edge %d inserted
-!
-.FixAdvWire..MSG0
-!
-.FixAdvWire..MSG5
-!
-.FixAdvWire..MSG10
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Face
-!
-.FixAdvFace.FixMissingSeam.MSG0
-Missing seam-edge added
-!
-.FixAdvFace.FixSmallAreaWire.MSG0
-Null area wire detected, wire skipped
-!
-.FixAdvFace.FixOrientation.MSG0
-Face created with natural bounds
-!
-.FixAdvFace.FixOrientation.MSG5
-Wire on face was reversed
-!
-.FixAdvFace.FixOrientation.MSG11
-Cannot orient wire
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Wireframe
-!
-.FixWireframe.FixSmallEdges.MSG0
-Small edge removed
-!
-.FixWireframe.FixSmallEdges.MSG1
-Small wire removed
-!
-.FixWireframe.FixSmallEdges.MSG2
-Small face removed
-!
-.FixWireframe.FixFixWireGaps.MSG0
-Gaps in a wire fixed
-!
-!
-.Fix.SplitCommonVertex.MSG0
-Wires with common vertex fixed
-!
-!
-.FixAdvShell.FixOrientation.MSG20
-Impossible to orient faces in shell, several shells created
-!
-.FixAdvShell.FixOrientation.MSG30
-Improperly connected shell split into parts
-!
-.FixAdvSolid.FixShell.MSG10
-Solid cannot be created from an open shell
-!
-.FixAdvSolid.FixOrientation.MSG20
-Orientation of shell(s) in solid was corrected
-!
-.FixAdvSolid.FixOrientation.MSG30
-Improperly connected solid split into several parts
-!
-.FixAdvFace.FixLoopWire.MSG0
-Wire was split on several wires
-!
-.FixAdvFace..MSG5
-!
-.FixAdvFace..MSG10
-!
-.FixEdge.SameParameter.MSG0
-Not same parameter edge fixed
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_FixSmallFace
-!
-.FixAdvFace.FixSpotFace.MSG0
-Spot face removed
-!
-.FixAdvFace.FixStripFace.MSG0
-Strip face removed
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_FixSmallSolid
-!
-.ShapeFix.FixSmallSolid.MSG0
-Small solid removed
-!
-.ShapeFix.FixSmallSolid.MSG1
-Small solid merged with other
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeFix_Shell
-!
-.FixAdvShell.FixOrientation.MSG0
-Faces were incorrectly oriented in the shell, corrected
-!
-.FixAdvShell.FixOrientation.MSG5
-Faces were incorrectly oriented in the shell, not corrected
-!
-.FixAdvShell.FixClosedFlag.MSG0
-Shell has incorrect flag isClosed
-!
-.FixAdvShell..MSG5
-!
-.FixAdvShell..MSG10
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeUpgrade
-!
-.ShapeDivide.FaceDivide.MSG0
-Face divided
-!
-.ShapeDivide.WireDivide.MSG0
-Wire divided
-!
-.ShapeDivide.EdgeDivide.MSG0
-Edge divided
-!
-.ShapeDivide.FaceConvertToBezier.MSG0
-Face converted to Bezier
-!
-.ShapeDivide.WireConvertToBezier.MSG0
-Wire converted to Bezier
-!
-.ShapeDivide.EdgeConvertToBezier.MSG0
-Edge converted to Bezier
-!
-! ------------------------------------------------------------------------------
-! Messages for ShapeCustom
-!
-.BSplineRestriction.NewSurface.MSG0
-Face converted to BSpline
-!
-.BSplineRestriction.NewSurface.MSG1
-BSpline Face re-approximated
-!
-.BSplineRestriction.NewCurve.MSG0
-Edge converted to BSpline
-!
-.BSplineRestriction.NewCurve.MSG1
-BSpline Edge re-approximated
-!
-!
-.ConvertToBSpline.NewSurface.MSG0
-Face converted to BSpline
-!
-.ConvertToBSpline.NewCurve.MSG0
-Edge converted to BSpline
-!
-!
-.ConvertToRevolution.NewSurface.MSG0
-Face converted to surface of revolution
-!
-!
-.DirectModification.NewSurface.MSG0
-Direction of Face of revolution corrected
-!
-!
-.SweptToElementary.NewSurface.MSG0
-Swept Face converted to elementary
-!
--- /dev/null
+// clang-format off
+// This file has been automatically generated from resource file resources/SHMessage/SHAPE.fr
+
+static const char SHMessage_SHAPE_fr[] =
+ "! 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"
+ "Sequence d'operateurs: %s\n"
+ "!\n"
+ ".SP.Sequence.Info.Operator\n"
+ "Operateur %d/%d: %s\n"
+ "!\n"
+ ".SP.Sequence.Error.NoOp\n"
+ "Error: Operator %s is not found\n"
+ "!\n"
+ ".SP.Sequence.Error.Except\n"
+ "Error: Operator %s failed with exception %s\n"
+ "!\n"
+ ".SP.Sequence.Warn.NoSeq\n"
+ "Warning: Shape Processing: sequence not defined for %s\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"
+ " Le Resultat est un Shell : %d\n"
+ "!\n"
+ ".PrResult.Print.MSG115\n"
+ " Le Resultat est une Face : %d\n"
+ "!\n"
+ ".PrResult.Print.MSG150\n"
+ " Pas de Resultat : %d\n"
+ "!\n"
+ ".PrResult.Print.MSG200\n"
+ "Taux de Preparation:\n"
+ "!\n"
+ ".PrResult.Print.MSG205\n"
+ " Shells: %d pour cent\n"
+ "!\n"
+ ".PrResult.Print.MSG210\n"
+ " Faces : %d pour cent\n"
+ "!\n"
+ "!\n"
+ "! ==============================================================================\n"
+ "! Messages for Shape Healing\n"
+ "! \n"
+ "! ------------------------------------------------------------------------------\n"
+ "! Messages for ShapeFix_Wire\n"
+ "! \n"
+ ".FixWire.FixDegenerated.MSG0\n"
+ "Detection d'Arete(s) degeneree(s)\n"
+ "!\n"
+ ".FixWire.FixDegenerated.MSG5\n"
+ "L'Arete n0 %d est degeneree\n"
+ "!\n"
+ ".FixWire.FixCurve3d.Removed\n"
+ "Incomplete edge (with no pcurves or 3d curve) removed\n"
+ "!\n"
+ ".FixAdvWire.FixSmall.MSG0\n"
+ "Petite(s) arete(s) supprimee(s)\n"
+ "! \n"
+ ".FixAdvWire.FixSmall.MSG5\n"
+ "L'arete n0 %d etait petite, supprimee\n"
+ "! \n"
+ ".FixAdvWire.FixIntersection.MSG0\n"
+ "Auto-intersection corrigee\n"
+ "!\n"
+ ".FixAdvWire.FixIntersection.MSG5\n"
+ "L'arete etait auto-intersectante, corrigee\n"
+ "!\n"
+ ".FixAdvWire.FixIntersection.MSG10\n"
+ "Les aretes s'intersectent, corrigees\n"
+ "!\n"
+ ".FixAdvWire.FixLacking.MSG0\n"
+ "Insertion d'arete(s) manquante(s)\n"
+ "!\n"
+ ".FixAdvWire.FixLacking.MSG5\n"
+ "Arete n0 %d manquante, inseree\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"
+ "Arete de couture manquante, ajoutee\n"
+ "!\n"
+ ".FixAdvFace.FixSmallAreaWire.MSG0\n"
+ "Contour d'aire nulle, supprime\n"
+ "!\n"
+ ".FixAdvFace.FixOrientation.MSG0\n"
+ "Face creee avec bords naturels\n"
+ "!\n"
+ ".FixAdvFace.FixOrientation.MSG5\n"
+ "Contour sur face inverse\n"
+ "!\n"
+ ".FixAdvFace.FixOrientation.MSG11\n"
+ "Impossible d'orienter le contour\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 d'orienter les faces dans le shell, creation de plusieurs shells\n"
+ "!\n"
+ ".FixAdvShell.FixOrientation.MSG30\n"
+ "Shell avec connexions incorrectes, divise en plusieurs parties\n"
+ "!\n"
+ ".FixAdvSolid.FixShell.MSG10\n"
+ "Impossible de creer un Solide a partir d'un shell ouvert\n"
+ "!\n"
+ ".FixAdvSolid.FixOrientation.MSG20\n"
+ "L'Orientation du/des shell(s) dans le solida ete corrigee\n"
+ "!\n"
+ ".FixAdvSolid.FixOrientation.MSG30\n"
+ "Solide avec connexions incorrectes, divise en plusieurs parties\n"
+ "!\n"
+ ".FixAdvFace.FixLoopWire.MSG0\n"
+ "Wire was split 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 mal orientees dans le shell, corrigees\n"
+ "!\n"
+ ".FixAdvShell.FixOrientation.MSG5\n"
+ "Faces mal orientees dans le shell, non corrigees\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";
+
+// clang-format on
-// This file has been automatically generated from resource file src/SHMessage/SHAPE.us
+// clang-format off
+// This file has been automatically generated from resource file resources/SHMessage/SHAPE.us
static const char SHMessage_SHAPE_us[] =
"\n"
".SweptToElementary.NewSurface.MSG0\n"
"Swept Face converted to elementary\n"
"!\n";
+
+// clang-format on
+++ /dev/null
-
-//! @file Declarations.glsl includes definition of common uniform variables in OCCT GLSL programs
-//! @def THE_MAX_LIGHTS
-//! Specifies the length of array of lights, which is 8 by default. Defined by Shader Manager.
-// #define THE_MAX_LIGHTS 8
-
-//! @def THE_MAX_CLIP_PLANES
-//! Specifies the length of array of clipping planes, which is 8 by default. Defined by Shader Manager.
-// #define THE_MAX_CLIP_PLANES 8
-
-//! @def THE_NB_FRAG_OUTPUTS
-//! Specifies the length of array of Fragment Shader outputs, which is 1 by default. Defined by Shader Manager.
-// #define THE_NB_FRAG_OUTPUTS 1
-
-// compatibility macros
-#if (__VERSION__ >= 130)
- #define THE_ATTRIBUTE in
- #define THE_SHADER_IN in
- #define THE_SHADER_OUT out
- #define THE_OUT out
- #define occTexture1D texture
- #define occTexture2D texture
- #define occTexture3D texture
- #define occTextureCube texture
- #define occTextureCubeLod textureLod
-#else
- #define THE_ATTRIBUTE attribute
- #define THE_SHADER_IN varying
- #define THE_SHADER_OUT varying
- #define THE_OUT
- #define occTexture1D texture1D
- #define occTexture2D texture2D
- #define occTexture3D texture3D
- #define occTextureCube textureCube
- #if !defined(GL_ES) || defined(textureCubeLod)
- #define occTextureCubeLod textureCubeLod
- #else // fallback
- #define occTextureCubeLod(theSampl,theCoord,theLod) textureCube(theSampl,theCoord)
- #endif
-#endif
-
-#ifdef GL_ES
-#if (__VERSION__ >= 300)
- #define THE_PREC_ENUM highp // lowp should be enough for enums but triggers driver bugs
-#else
- #define THE_PREC_ENUM lowp
-#endif
-#else
- #define THE_PREC_ENUM
-#endif
-
-// Vertex attributes
-#ifdef VERTEX_SHADER
- THE_ATTRIBUTE vec4 occVertex;
- THE_ATTRIBUTE vec3 occNormal;
- THE_ATTRIBUTE vec4 occTexCoord;
- THE_ATTRIBUTE vec4 occVertColor;
-#elif defined(FRAGMENT_SHADER)
- #if (__VERSION__ >= 130)
- #ifdef OCC_ENABLE_draw_buffers
- out vec4 occFragColorArray[THE_NB_FRAG_OUTPUTS];
- #define occFragColorArrayAlias occFragColorArray
- #define occFragColor0 occFragColorArray[0]
- #else
- out vec4 occFragColor0;
- #endif
- #else
- #ifdef OCC_ENABLE_draw_buffers
- #define occFragColorArrayAlias gl_FragData
- #define occFragColor0 gl_FragData[0]
- #else
- #define occFragColor0 gl_FragColor
- #endif
- #endif
-
- #if (THE_NB_FRAG_OUTPUTS >= 2)
- #define occFragColor1 occFragColorArrayAlias[1]
- #else
- vec4 occFragColor1;
- #endif
- #if (THE_NB_FRAG_OUTPUTS >= 3)
- #define occFragColor2 occFragColorArrayAlias[2]
- #else
- vec4 occFragColor2;
- #endif
- #if (THE_NB_FRAG_OUTPUTS >= 4)
- #define occFragColor3 occFragColorArrayAlias[3]
- #else
- vec4 occFragColor3;
- #endif
-
- // Built-in outputs notation
- #define occFragColor occFragColor0
- #define occFragCoverage occFragColor1
-
- #define occPeelDepth occFragColor0
- #define occPeelFrontColor occFragColor1
- #define occPeelBackColor occFragColor2
-
- //! Define the main Fragment Shader early return procedure.
- bool occFragEarlyReturn();
-
- //! Define the main Fragment Shader output - color value.
- void occSetFragColor (in vec4 theColor);
-#endif
-
-// Pi number definitions
-#define PI 3.141592654
-#define PI_2 6.283185307
-#define PI_DIV_2 1.570796327
-#define PI_DIV_3 1.047197551
-#define PI_DIV_4 0.785398163
-#define INV_PI 0.318309886
-#define INV_PI_2 0.159154943
-
-// Matrix state
-uniform mat4 occWorldViewMatrix; //!< World-view matrix
-uniform mat4 occProjectionMatrix; //!< Projection matrix
-uniform mat4 occModelWorldMatrix; //!< Model-world matrix
-
-uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix
-uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix
-uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix
-
-uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix
-uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix
-uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix
-
-uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix
-uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix
-uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix
-
-#if defined(THE_IS_PBR)
-uniform sampler2D occEnvLUT; //!< Environment Lookup Table
-uniform sampler2D occDiffIBLMapSHCoeffs; //!< Packed diffuse (irradiance) IBL map's spherical harmonics coefficients
-uniform samplerCube occSpecIBLMap; //!< Specular IBL map
-uniform int occNbSpecIBLLevels; //!< Number of mipmap levels used in occSpecIBLMap to store different roughness values maps
-
-vec3 occDiffIBLMap (in vec3 theNormal); //!< Unpacks spherical harmonics coefficients to diffuse IBL map's values
-#endif
-
-// light type enumeration (same as Graphic3d_TypeOfLightSource)
-const int OccLightType_Direct = 1; //!< directional light source
-const int OccLightType_Point = 2; //!< isotropic point light source
-const int OccLightType_Spot = 3; //!< spot light source
-
-// Light sources
-uniform vec4 occLightAmbient; //!< Cumulative ambient color
-#if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
-#if (THE_MAX_LIGHTS > 1)
- #define occLight_Index(theId) theId
-#else
- #define occLight_Index(theId) 0
-#endif
-uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources
-
-//! Type of light source, int (see OccLightType enum).
-#define occLight_Type(theId) occLightSourcesTypes[occLight_Index(theId)]
-
-//! Specular intensity (equals to diffuse), vec3.
-#define occLight_Specular(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
-
-//! Intensity of light source (>= 0), float.
-#define occLight_Intensity(theId) occLightSources[occLight_Index(theId) * 4 + 0].a
-
-//! Is light a headlight, bool? DEPRECATED method.
-#define occLight_IsHeadlight(theId) false
-
-//! Position of specified light source or direction of directional light source, vec3.
-#define occLight_Position(theId) occLightSources[occLight_Index(theId) * 4 + 1].xyz
-
-//! Direction of specified spot light source, vec3.
-#define occLight_SpotDirection(theId) occLightSources[occLight_Index(theId) * 4 + 2].xyz
-
-//! Range on which point light source (positional or spot) can affect (>= 0), float.
-#define occLight_Range(theId) occLightSources[occLight_Index(theId) * 4 + 2].w
-
-//! Maximum spread angle of the spot light (in radians), float.
-#define occLight_SpotCutOff(theId) occLightSources[occLight_Index(theId) * 4 + 3].z
-
-//! Attenuation of the spot light intensity (from 0 to 1), float.
-#define occLight_SpotExponent(theId) occLightSources[occLight_Index(theId) * 4 + 3].w
-
-#if !defined(THE_IS_PBR)
-//! Diffuse intensity (equals to Specular), vec3.
-#define occLight_Diffuse(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
-
-//! Const attenuation factor of positional light source, float.
-#define occLight_ConstAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].x
-
-//! Linear attenuation factor of positional light source, float.
-#define occLight_LinearAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].y
-#endif
-#endif
-
-#if defined(THE_IS_PBR)
-//! Converts roughness value from range [0, 1] to real value for calculations
-float occRoughness (in float theNormalizedRoughness);
-
-// Front/back material properties accessors
-vec4 occPBRMaterial_Color(in bool theIsFront); //!< Base color of PBR material
-float occPBRMaterial_Metallic(in bool theIsFront); //!< Metallic coefficient
-float occPBRMaterial_NormalizedRoughness(in bool theIsFront); //!< Normalized roughness coefficient
-vec3 occPBRMaterial_Emission(in bool theIsFront); //!< Light intensity emitted by material
-float occPBRMaterial_IOR(in bool theIsFront); //!< Index of refraction
-#define occMaterial_Emission occPBRMaterial_Emission
-#define occMaterial_Color occPBRMaterial_Color
-#else
-vec4 occMaterial_Diffuse(in bool theIsFront); //!< Diffuse reflection
-vec3 occMaterial_Specular(in bool theIsFront); //!< Specular reflection
-float occMaterial_Shininess(in bool theIsFront); //!< Specular exponent
-vec3 occMaterial_Ambient(in bool theIsFront); //!< Ambient reflection
-vec3 occMaterial_Emission(in bool theIsFront); //!< Emission color
-#define occMaterial_Color occMaterial_Diffuse
-#endif
-
-#ifdef THE_HAS_DEFAULT_SAMPLER
-#define occActiveSampler occSampler0 //!< alias for backward compatibility
-#define occSamplerBaseColor occSampler0 //!< alias to a base color texture
-uniform sampler2D occSampler0; //!< current active sampler;
-#endif //! occSampler1, occSampler2,... should be defined in GLSL program body for multitexturing
-
-#if defined(THE_HAS_TEXTURE_COLOR) && defined(FRAGMENT_SHADER)
-#define occMaterialBaseColor(theIsFront, theTexCoord) (occMaterial_Color(theIsFront) * occTexture2D(occSamplerBaseColor, theTexCoord))
-#else
-#define occMaterialBaseColor(theIsFront, theTexCoord) occMaterial_Color(theIsFront)
-#endif
-
-#if defined(THE_HAS_TEXTURE_OCCLUSION) && defined(FRAGMENT_SHADER)
-uniform sampler2D occSamplerOcclusion; //!< R occlusion texture sampler
-#define occMaterialOcclusion(theColor, theTexCoord) theColor *= occTexture2D(occSamplerOcclusion, theTexCoord).r;
-#else
-#define occMaterialOcclusion(theColor, theTexCoord)
-#endif
-
-#if defined(THE_HAS_TEXTURE_EMISSIVE) && defined(FRAGMENT_SHADER)
-uniform sampler2D occSamplerEmissive; //!< RGB emissive texture sampler
-#define occMaterialEmission(theIsFront, theTexCoord) (occMaterial_Emission(theIsFront) * occTexture2D(occSamplerEmissive, theTexCoord).rgb)
-#else
-#define occMaterialEmission(theIsFront, theTexCoord) occMaterial_Emission(theIsFront)
-#endif
-
-#if defined(THE_HAS_TEXTURE_NORMAL) && defined(FRAGMENT_SHADER)
-uniform sampler2D occSamplerNormal; //!< XYZ normal texture sampler with W==0 indicating no texture
-#define occTextureNormal(theTexCoord) occTexture2D(occSamplerNormal, theTexCoord)
-#else
-#define occTextureNormal(theTexCoord) vec4(0.0) // no normal map
-#endif
-
-#if defined(THE_HAS_TEXTURE_METALROUGHNESS) && defined(FRAGMENT_SHADER)
-uniform sampler2D occSamplerMetallicRoughness; //!< BG metallic-roughness texture sampler
-#define occMaterialRoughness(theIsFront, theTexCoord) (occPBRMaterial_NormalizedRoughness(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).g)
-#define occMaterialMetallic(theIsFront, theTexCoord) (occPBRMaterial_Metallic(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).b)
-#else
-#define occMaterialRoughness(theIsFront, theTexCoord) occPBRMaterial_NormalizedRoughness(theIsFront)
-#define occMaterialMetallic(theIsFront, theTexCoord) occPBRMaterial_Metallic(theIsFront)
-#endif
-
-uniform vec4 occColor; //!< color value (in case of disabled lighting)
-uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?
-uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?
-uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters
-uniform float occPointSize; //!< point size
-
-//! Parameters of blended order-independent transparency rendering algorithm
-uniform int occOitOutput; //!< Enable bit for writing output color buffers for OIT (occFragColor, occFragCoverage)
-uniform float occOitDepthFactor; //!< Influence of the depth component to the coverage of the accumulated fragment
-uniform float occAlphaCutoff; //!< alpha test cutoff value
-
-//! Parameters of clipping planes
-#if defined(THE_MAX_CLIP_PLANES) && (THE_MAX_CLIP_PLANES > 0)
-uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];
-uniform THE_PREC_ENUM int occClipPlaneChains[THE_MAX_CLIP_PLANES]; //! Indicating the number of planes in the Chain
-uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes
-#endif
-//! @endfile Declarations.glsl
+++ /dev/null
-
-//! @file DeclarationsImpl.glsl includes implementation of common functions and properties accessors
-#if defined(FRAGMENT_SHADER)
-
-#if defined(OCC_DEPTH_PEEL_OIT)
-uniform sampler2D occDepthPeelingDepth;
-uniform sampler2D occDepthPeelingFrontColor;
-int IsFrontPeelLayer = -1;
-bool occFragEarlyReturn()
-{
- #define THE_DEPTH_CLEAR_VALUE -1e15f
- ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
- vec2 aLastDepth = texelFetch (occDepthPeelingDepth, aFragCoord, 0).rg;
- occPeelFrontColor = texelFetch (occDepthPeelingFrontColor, aFragCoord, 0);
- occPeelDepth.rg = vec2 (THE_DEPTH_CLEAR_VALUE); // depth value always increases, so that MAX blend equation can be used
- occPeelBackColor = vec4 (0.0); // back color is blend after each peeling pass
-
- float aNearDepth = -aLastDepth.x;
- float aFarDepth = aLastDepth.y;
- float aFragDepth = gl_FragCoord.z; // 0 - 1
- if (aFragDepth < aNearDepth || aFragDepth > aFarDepth)
- {
- return true; // skip peeled depth
- }
- else if (aFragDepth > aNearDepth && aFragDepth < aFarDepth)
- {
- // to be rendered at next peeling pass
- occPeelDepth.rg = vec2 (-aFragDepth, aFragDepth);
- return true;
- }
-
- IsFrontPeelLayer = (gl_FragCoord.z == aNearDepth) ? 1 : 0;
- return false;
-}
-#else
-bool occFragEarlyReturn() { return false; }
-#endif
-
-void occSetFragColor (in vec4 theColor)
-{
-#if defined(OCC_ALPHA_TEST)
- if (theColor.a < occAlphaCutoff) discard;
-#endif
-#if defined(OCC_WRITE_WEIGHT_OIT_COVERAGE)
- float aWeight = theColor.a * clamp (1e+2 * pow (1.0 - gl_FragCoord.z * occOitDepthFactor, 3.0), 1e-2, 1e+2);
- occFragCoverage.r = theColor.a * aWeight;
- occFragColor = vec4 (theColor.rgb * theColor.a * aWeight, theColor.a);
-#elif defined(OCC_DEPTH_PEEL_OIT)
- if (IsFrontPeelLayer == 1) // front is blended directly
- {
- vec4 aLastColor = occPeelFrontColor;
- float anAlphaMult = 1.0 - aLastColor.a;
- occPeelFrontColor.rgb = aLastColor.rgb + theColor.rgb * theColor.a * anAlphaMult;
- occPeelFrontColor.a = 1.0 - anAlphaMult * (1.0 - theColor.a);
- }
- else if (IsFrontPeelLayer == 0) // back is blended afterwards
- {
- occPeelBackColor = theColor;
- }
-#else
- occFragColor = theColor;
-#endif
-}
-#endif
-
-#if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
-// arrays of light sources
-uniform vec4 occLightSources[THE_MAX_LIGHTS * 4]; //!< packed light sources parameters
-uniform THE_PREC_ENUM int occLightSourcesTypes[THE_MAX_LIGHTS]; //!< packed light sources types
-#endif
-
-#if defined(THE_IS_PBR)
-vec3 occDiffIBLMap (in vec3 theNormal)
-{
- vec3 aSHCoeffs[9];
- for (int i = 0; i < 9; ++i)
- {
- aSHCoeffs[i] = occTexture2D (occDiffIBLMapSHCoeffs, vec2 ((float(i) + 0.5) / 9.0, 0.0)).rgb;
- }
- return aSHCoeffs[0]
-
- + aSHCoeffs[1] * theNormal.x
- + aSHCoeffs[2] * theNormal.y
- + aSHCoeffs[3] * theNormal.z
-
- + aSHCoeffs[4] * theNormal.x * theNormal.z
- + aSHCoeffs[5] * theNormal.y * theNormal.z
- + aSHCoeffs[6] * theNormal.x * theNormal.y
-
- + aSHCoeffs[7] * (3.0 * theNormal.z * theNormal.z - 1.0)
- + aSHCoeffs[8] * (theNormal.x * theNormal.x - theNormal.y * theNormal.y);
-}
-#endif
-
-// front and back material properties accessors
-#if defined(THE_IS_PBR)
-uniform vec4 occPbrMaterial[3 * 2];
-
-#define MIN_ROUGHNESS 0.01
-float occRoughness (in float theNormalizedRoughness) { return theNormalizedRoughness * (1.0 - MIN_ROUGHNESS) + MIN_ROUGHNESS; }
-vec4 occPBRMaterial_Color(in bool theIsFront) { return theIsFront ? occPbrMaterial[0] : occPbrMaterial[3]; }
-vec3 occPBRMaterial_Emission(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].rgb : occPbrMaterial[4].rgb; }
-float occPBRMaterial_IOR(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].w : occPbrMaterial[4].w; }
-float occPBRMaterial_Metallic(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].b : occPbrMaterial[5].b; }
-float occPBRMaterial_NormalizedRoughness(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].g : occPbrMaterial[5].g; }
-#else
-uniform vec4 occCommonMaterial[4 * 2];
-
-vec4 occMaterial_Diffuse(in bool theIsFront) { return theIsFront ? occCommonMaterial[0] : occCommonMaterial[4]; }
-vec3 occMaterial_Emission(in bool theIsFront) { return theIsFront ? occCommonMaterial[1].rgb : occCommonMaterial[5].rgb; }
-vec3 occMaterial_Specular(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].rgb : occCommonMaterial[6].rgb; }
-float occMaterial_Shininess(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].a : occCommonMaterial[6].a; }
-vec3 occMaterial_Ambient(in bool theIsFront) { return theIsFront ? occCommonMaterial[3].rgb : occCommonMaterial[7].rgb; }
-#endif
-
-// 2D texture coordinates transformation
-vec2 occTextureTrsf_Translation(void) { return occTexTrsf2d[0].xy; }
-vec2 occTextureTrsf_Scale(void) { return occTexTrsf2d[0].zw; }
-float occTextureTrsf_RotationSin(void) { return occTexTrsf2d[1].x; }
-float occTextureTrsf_RotationCos(void) { return occTexTrsf2d[1].y; }
-//! @endfile DeclarationsImpl.glsl
+++ /dev/null
-#ifdef ADAPTIVE_SAMPLING
-
- #extension GL_ARB_shader_image_load_store : require
-
- #extension GL_ARB_shader_image_size : enable
-
- //! OpenGL image used for accumulating rendering result.
- volatile restrict layout(r32f) uniform image2D uRenderImage;
-
- //! OpenGL image storing variance of sampled pixels blocks.
- volatile restrict layout(r32i) uniform iimage2D uVarianceImage;
-
- //! Scale factor used to quantize visual error (float) into signed integer.
- uniform float uVarianceScaleFactor;
-
- //! Screen space tile size.
- uniform ivec2 uTileSize;
-
-#else // ADAPTIVE_SAMPLING
-
- //! Input image.
- uniform sampler2D uInputTexture;
-
- //! Ray tracing depth image.
- uniform sampler2D uDepthTexture;
-
-#endif // ADAPTIVE_SAMPLING
-
-//! Number of accumulated frames.
-uniform int uAccumFrames;
-
-//! Is debug mode enabled for importance screen sampling.
-uniform int uDebugAdaptive;
-
-//! Exposure value for tone mapping.
-uniform float uExposure;
-
-#ifdef TONE_MAPPING_FILMIC
-
-//! White point value for filmic tone mapping.
-uniform float uWhitePoint;
-
-#endif // TONE_MAPPING
-
-//! Output pixel color.
-out vec4 OutColor;
-
-//! RGB weight factors to calculate luminance.
-#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)
-
-// =======================================================================
-// function : ToneMappingFilmic
-// purpose :
-// =======================================================================
-vec4 ToneMappingFilmic(vec4 theColor, float theWhitePoint)
-{
- vec4 aPackColor = vec4 (theColor.rgb, theWhitePoint);
- vec4 aFilmicCurve = 1.425f * aPackColor + vec4 (0.05f);
- vec4 aResultColor = (aPackColor * aFilmicCurve + vec4 (0.004f)) / (aPackColor * (aFilmicCurve + vec4 (0.55f)) + vec4 (0.0491f)) - vec4 (0.0821f);
- return vec4 (aResultColor.rgb / aResultColor.www, 1.0);
-}
-
-// =======================================================================
-// function : main
-// purpose :
-// =======================================================================
-void main (void)
-{
-#ifndef ADAPTIVE_SAMPLING
-
- vec4 aColor = texelFetch (uInputTexture, ivec2 (gl_FragCoord.xy), 0);
-
-#ifdef PATH_TRACING
- float aDepth = aColor.w; // path tracing uses averaged depth
-#else
- float aDepth = texelFetch (uDepthTexture, ivec2 (gl_FragCoord.xy), 0).r;
-#endif
-
- gl_FragDepth = aDepth;
-
-#else // ADAPTIVE_SAMPLING
-
- ivec2 aPixel = ivec2 (gl_FragCoord.xy);
-
- vec4 aColor = vec4 (0.0);
-
- // fetch accumulated color and total number of samples
- aColor.x = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,
- 2 * aPixel.y + 0)).x;
- aColor.y = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,
- 2 * aPixel.y + 0)).x;
- aColor.z = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 1,
- 2 * aPixel.y + 1)).x;
- aColor.w = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 0,
- 2 * aPixel.y + 1)).x;
-
- // calculate normalization factor
- float aSampleWeight = 1.f / max (1.0, aColor.w);
-
- // calculate averaged depth value
- gl_FragDepth = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,
- 2 * aPixel.y + 1)).x * aSampleWeight;
-
- // calculate averaged radiance for all samples and even samples only
- float aHalfRad = imageLoad (uRenderImage, ivec2 (3 * aPixel.x + 2,
- 2 * aPixel.y + 0)).x * aSampleWeight * 2.f;
-
- float aAverRad = dot (aColor.rgb, LUMA) * aSampleWeight;
-
- // apply our 'tone mapping' operator (gamma correction and clamping)
- aHalfRad = min (1.f, sqrt (aHalfRad));
- aAverRad = min (1.f, sqrt (aAverRad));
-
- // calculate visual error
- float anError = (aAverRad - aHalfRad) * (aAverRad - aHalfRad);
-
- // accumulate visual error to current block; estimated error is written only
- // after the first 40 samples and path length has reached 10 bounces or more
- imageAtomicAdd (uVarianceImage, aPixel / uTileSize,
- int (mix (uVarianceScaleFactor, anError * uVarianceScaleFactor, aColor.w > 40.f)));
-
- if (uDebugAdaptive == 0) // normal rendering
- {
- aColor = vec4 (aColor.rgb * aSampleWeight, 1.0);
- }
- else // showing number of samples
- {
- vec2 aRatio = vec2 (1.f, 1.f);
-#ifdef GL_ARB_shader_image_size
- aRatio = vec2 (imageSize (uRenderImage)) / vec2 (3.f * 512.f, 2.f * 512.f);
-#endif
- aColor = vec4 (0.5f * aColor.rgb * aSampleWeight + vec3 (0.f, sqrt (aRatio.x * aRatio.y) * aColor.w / uAccumFrames * 0.35f, 0.f), 1.0);
- }
-
-#endif // ADAPTIVE_SAMPLING
-
-#ifdef PATH_TRACING
-
- aColor *= pow (2.0, uExposure);
-
-#ifdef TONE_MAPPING_FILMIC
- aColor = ToneMappingFilmic (aColor, uWhitePoint);
-#endif // TONE_MAPPING
-
-#ifdef THE_SHIFT_sRGB
- // apply gamma correction (we use gamma = 2)
- OutColor = vec4 (sqrt (aColor.rgb), 0.f);
-#else
- OutColor = vec4 (aColor.rgb, 0.f);
-#endif
-
-#else // not PATH_TRACING
-
- OutColor = aColor;
-
-#endif
-}
-srcinc:::Declarations.glsl
-srcinc:::DeclarationsImpl.glsl
-srcinc:::LightShadow.glsl
-srcinc:::PBRCookTorrance.glsl
-srcinc:::PBRDirectionalLight.glsl
-srcinc:::PBRDistribution.glsl
-srcinc:::PBREnvBaking.fs
-srcinc:::PBREnvBaking.vs
-srcinc:::PBRFresnel.glsl
-srcinc:::PBRGeometry.glsl
-srcinc:::PBRIllumination.glsl
-srcinc:::PBRPointLight.glsl
-srcinc:::PBRSpotLight.glsl
-srcinc:::PhongShading.fs
-srcinc:::PhongShading.vs
-srcinc:::PhongDirectionalLight.glsl
-srcinc:::PhongPointLight.glsl
-srcinc:::PhongSpotLight.glsl
-srcinc:::PointLightAttenuation.glsl
-srcinc:::Display.fs
-srcinc:::RaytraceBase.fs
-srcinc:::RaytraceRender.fs
-srcinc:::PathtraceBase.fs
-srcinc:::RaytraceBase.vs
-srcinc:::RaytraceSmooth.fs
-srcinc:::TangentSpaceNormal.glsl
-srcinc:::SkydomBackground.fs
Shaders_Declarations_glsl.pxx
Shaders_DeclarationsImpl_glsl.pxx
Shaders_LightShadow_glsl.pxx
+++ /dev/null
-#if (__VERSION__ >= 120)
-//! Coefficients for gathering close samples for antialiasing.
-//! Use only with decent OpenGL (array constants cannot be initialized with GLSL 1.1 / GLSL ES 1.1)
-const vec2 occPoissonDisk16[16] = vec2[](
- vec2(-0.94201624,-0.39906216), vec2( 0.94558609,-0.76890725), vec2(-0.09418410,-0.92938870), vec2( 0.34495938, 0.29387760),
- vec2(-0.91588581, 0.45771432), vec2(-0.81544232,-0.87912464), vec2(-0.38277543, 0.27676845), vec2( 0.97484398, 0.75648379),
- vec2( 0.44323325,-0.97511554), vec2( 0.53742981,-0.47373420), vec2(-0.26496911,-0.41893023), vec2( 0.79197514, 0.19090188),
- vec2(-0.24188840, 0.99706507), vec2(-0.81409955, 0.91437590), vec2( 0.19984126, 0.78641367), vec2( 0.14383161,-0.14100790)
-);
-#endif
-
-//! Function computes directional and spot light shadow attenuation (1.0 means no shadow).
-float occLightShadow (in sampler2D theShadow,
- in int theId,
- in vec3 theNormal)
-{
- vec4 aPosLightSpace = PosLightSpace[occLight_Index(theId)];
- vec3 aLightDir = occLight_Position (theId);
- vec3 aProjCoords = (aPosLightSpace.xyz / aPosLightSpace.w);
-#ifdef THE_ZERO_TO_ONE_DEPTH
- aProjCoords.xy = aProjCoords.xy * 0.5 + vec2 (0.5);
-#else
- aProjCoords = aProjCoords * 0.5 + vec3 (0.5);
-#endif
- float aCurrentDepth = aProjCoords.z;
- if (aProjCoords.x < 0.0 || aProjCoords.x > 1.0
- || aProjCoords.y < 0.0 || aProjCoords.y > 1.0
- || aCurrentDepth > 1.0)
- {
- return 1.0;
- }
-
- vec2 aTexelSize = vec2 (occShadowMapSizeBias.x);
- float aBias = max (occShadowMapSizeBias.y * (1.0 - dot (theNormal, aLightDir)), occShadowMapSizeBias.y * 0.1);
-#if (__VERSION__ >= 120)
- float aShadow = 0.0;
- for (int aPosIter = 0; aPosIter < 16; ++aPosIter)
- {
- float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy + occPoissonDisk16[aPosIter] * aTexelSize).r;
- aShadow += (aCurrentDepth - aBias) > aClosestDepth ? 1.0 : 0.0;
- }
- return 1.0 - aShadow / 16.0;
-#else
- float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy).r;
- float aShadow = (aCurrentDepth - aBias) > aClosestDepth ? 1.0 : 0.0;
- return 1.0 - aShadow;
-#endif
-}
+++ /dev/null
-//! Calculates Cook-Torrance BRDF.
-vec3 occPBRCookTorrance (in vec3 theView,
- in vec3 theLight,
- in vec3 theNormal,
- in vec3 theBaseColor,
- in float theMetallic,
- in float theRoughness,
- in float theIOR)
-{
- vec3 aHalf = normalize (theView + theLight);
- float aCosV = max(dot(theView, theNormal), 0.0);
- float aCosL = max(dot(theLight, theNormal), 0.0);
- float aCosH = max(dot(aHalf, theNormal), 0.0);
- float aCosVH = max(dot(aHalf, theView), 0.0);
- vec3 aCookTorrance = occPBRDistribution (aCosH, theRoughness)
- * occPBRGeometry (aCosV, aCosL, theRoughness)
- * occPBRFresnel (theBaseColor, theMetallic, theIOR, aCosVH);
- aCookTorrance /= 4.0;
- return aCookTorrance;
-}
+++ /dev/null
-//! Function computes contribution of directional light source
-//! into global variable DirectLighting (PBR shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param theIsFront front/back face flag
-//! @param theShadow shadow attenuation
-void occDirectionalLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in bool theIsFront,
- in float theShadow)
-{
- vec3 aLight = occLight_Position (theId);
- theNormal = theIsFront ? theNormal : -theNormal;
- DirectLighting += occPBRIllumination (theView, aLight, theNormal,
- BaseColor, Metallic, Roughness, IOR,
- occLight_Specular (theId),
- occLight_Intensity(theId)) * theShadow;
-}
+++ /dev/null
-//! Calculates micro facet normals distribution.
-float occPBRDistribution (in float theCosH,
- in float theRoughness)
-{
- float aDistribution = theRoughness * theRoughness;
- aDistribution = aDistribution / (theCosH * theCosH * (aDistribution * aDistribution - 1.0) + 1.0);
- aDistribution = INV_PI * aDistribution * aDistribution;
- return aDistribution;
-}
+++ /dev/null
-THE_SHADER_IN vec3 ViewDirection; //!< direction of fetching from environment cubemap
-
-#if (__VERSION__ >= 120)
-uniform int uSamplesNum; //!< number of samples in Monte-Carlo integration
-#else
-const int uSamplesNum = 256;
-#endif
-uniform samplerCube uEnvMap; //!< source of baking (environment cubemap)
-
-#ifdef THE_TO_BAKE_DIFFUSE
-uniform int uYCoeff; //!< coefficient of Y controlling horizontal flip of cubemap
-uniform int uZCoeff; //!< coefficient of Z controlling vertical flip of cubemap
-#endif
-
-#ifdef THE_TO_BAKE_SPECULAR
-uniform int uCurrentLevel; //!< current level of specular IBL map (ignored in case of diffuse map's processing)
-uniform float uEnvSolidAngleSource; //!< source solid angle sample computed from one edge's size of source environment map's zero mipmap level
-#endif
-
-//! Returns coordinates of point theNumber from Hammersley point set having size theSize.
-vec2 hammersley (in int theNumber,
- in int theSize)
-{
- int aDenominator = 2;
- int aNumber = theNumber;
- float aVanDerCorput = 0.0;
- for (int i = 0; i < 32; ++i)
- {
- if (aNumber > 0)
- {
- aVanDerCorput += mod(float(aNumber), 2.0) / float(aDenominator);
- aNumber /= 2;
- aDenominator *= 2;
- }
- }
- return vec2(float(theNumber) / float(theSize), aVanDerCorput);
-}
-
-//! This function does importance sampling on hemisphere surface using GGX normal distribution function
-//! in tangent space (positive z axis is surface normal direction).
-vec3 importanceSample (in vec2 theHammersleyPoint,
- in float theRoughness)
-{
- float aPhi = PI_2 * theHammersleyPoint.x;
- theRoughness *= theRoughness;
- theRoughness *= theRoughness;
- float aCosTheta = sqrt((1.0 - theHammersleyPoint.y) / (1.0 + (theRoughness - 1.0) * theHammersleyPoint.y));
- float aSinTheta = sqrt(1.0 - aCosTheta * aCosTheta);
- return vec3(aSinTheta * cos(aPhi),
- aSinTheta * sin(aPhi),
- aCosTheta);
-}
-
-//! This function uniformly generates samples on whole sphere.
-vec3 sphereUniformSample (in vec2 theHammersleyPoint)
-{
- float aPhi = PI_2 * theHammersleyPoint.x;
- float aCosTheta = 2.0 * theHammersleyPoint.y - 1.0;
- float aSinTheta = sqrt(1.0 - aCosTheta * aCosTheta);
- return vec3(aSinTheta * cos(aPhi),
- aSinTheta * sin(aPhi),
- aCosTheta);
-}
-
-//! Transforms resulted sampled direction from tangent space to world space considering the surface normal.
-vec3 fromTangentSpace (in vec3 theVector,
- in vec3 theNormal)
-{
- vec3 anUp = (abs(theNormal.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
- vec3 anX = normalize(cross(anUp, theNormal));
- vec3 anY = cross(theNormal, anX);
- return anX * theVector.x + anY * theVector.y + theNormal * theVector.z;
-}
-
-#ifdef THE_TO_BAKE_DIFFUSE
-#if (__VERSION__ >= 120)
-const float aSHBasisFuncCoeffs[9] = float[9]
-(
- 0.282095 * 0.282095,
- 0.488603 * 0.488603,
- 0.488603 * 0.488603,
- 0.488603 * 0.488603,
- 1.092548 * 1.092548,
- 1.092548 * 1.092548,
- 1.092548 * 1.092548,
- 0.315392 * 0.315392,
- 0.546274 * 0.546274
-);
-const float aSHCosCoeffs[9] = float[9]
-(
- 3.141593,
- 2.094395,
- 2.094395,
- 2.094395,
- 0.785398,
- 0.785398,
- 0.785398,
- 0.785398,
- 0.785398
-);
-#else
-uniform float aSHBasisFuncCoeffs[9];
-uniform float aSHCosCoeffs[9];
-#endif
-
-//! Bakes diffuse IBL map's spherical harmonics coefficients.
-vec3 bakeDiffuseSH()
-{
- int anId = int(gl_FragCoord.x);
- float aCoef;
-#if (__VERSION__ >= 120)
- aCoef = aSHCosCoeffs[anId] * aSHBasisFuncCoeffs[anId];
-#else
- if (anId == 0) { aCoef = aSHCosCoeffs[0] * aSHBasisFuncCoeffs[0]; }
- else if (anId == 1) { aCoef = aSHCosCoeffs[1] * aSHBasisFuncCoeffs[1]; }
- else if (anId == 2) { aCoef = aSHCosCoeffs[2] * aSHBasisFuncCoeffs[2]; }
- else if (anId == 3) { aCoef = aSHCosCoeffs[3] * aSHBasisFuncCoeffs[3]; }
- else if (anId == 4) { aCoef = aSHCosCoeffs[4] * aSHBasisFuncCoeffs[4]; }
- else if (anId == 5) { aCoef = aSHCosCoeffs[5] * aSHBasisFuncCoeffs[5]; }
- else if (anId == 6) { aCoef = aSHCosCoeffs[6] * aSHBasisFuncCoeffs[6]; }
- else if (anId == 7) { aCoef = aSHCosCoeffs[7] * aSHBasisFuncCoeffs[7]; }
- else { aCoef = aSHCosCoeffs[8] * aSHBasisFuncCoeffs[8]; }
-#endif
- vec3 aRes = vec3 (0.0);
- for (int aSampleIter = 0; aSampleIter < uSamplesNum; ++aSampleIter)
- {
- vec2 aHammersleyPoint = hammersley (aSampleIter, uSamplesNum);
- vec3 aDir = sphereUniformSample (aHammersleyPoint);
-
- vec3 aVal = occTextureCube (uEnvMap, cubemapVectorTransform (aDir, uYCoeff, uZCoeff)).rgb;
- #if (__VERSION__ >= 120)
- float aFunc[9];
- aFunc[0] = 1.0;
-
- aFunc[1] = aDir.x;
- aFunc[2] = aDir.y;
- aFunc[3] = aDir.z;
-
- aFunc[4] = aDir.x * aDir.z;
- aFunc[5] = aDir.y * aDir.z;
- aFunc[6] = aDir.x * aDir.y;
-
- aFunc[7] = 3.0 * aDir.z * aDir.z - 1.0;
- aFunc[8] = aDir.x * aDir.x - aDir.y * aDir.y;
-
- aRes += aVal * aFunc[anId];
- #else
- if (anId == 0) { aRes += aVal * 1.0; }
- else if (anId == 1) { aRes += aVal * aDir.x; }
- else if (anId == 2) { aRes += aVal * aDir.y; }
- else if (anId == 3) { aRes += aVal * aDir.z; }
- else if (anId == 4) { aRes += aVal * (aDir.x * aDir.z); }
- else if (anId == 5) { aRes += aVal * (aDir.y * aDir.z); }
- else if (anId == 6) { aRes += aVal * (aDir.x * aDir.y); }
- else if (anId == 7) { aRes += aVal * (3.0 * aDir.z * aDir.z - 1.0); }
- else { aRes += aVal * (aDir.x * aDir.x - aDir.y * aDir.y); }
- #endif
- }
-
- return 4.0 * aRes * aCoef / float(uSamplesNum);
-}
-#endif
-
-#ifdef THE_TO_BAKE_SPECULAR
-//! Computes a single sample for specular IBL map.
-vec4 specularMapSample (in vec3 theNormal,
- in float theRoughness,
- in int theNumber,
- in int theSize)
-{
- vec2 aHammersleyPoint = hammersley (theNumber, theSize);
- vec3 aHalf = importanceSample (aHammersleyPoint, occRoughness (theRoughness));
- float aHdotV = aHalf.z;
- aHalf = fromTangentSpace (aHalf, theNormal);
- vec3 aLight = -reflect (theNormal, aHalf);
- float aNdotL = dot (aLight, theNormal);
- if (aNdotL > 0.0)
- {
- float aSolidAngleSample = 1.0 / (float(theSize) * (occPBRDistribution (aHdotV, theRoughness) * 0.25 + 0.0001) + 0.0001);
- float aLod = (theRoughness == 0.0) ? 0.0 : 0.5 * log2 (aSolidAngleSample / uEnvSolidAngleSource);
- return vec4 (occTextureCubeLod (uEnvMap, aLight, aLod).rgb * aNdotL, aNdotL);
- }
- return vec4 (0.0);
-}
-
-//! Bakes specular IBL map.
-vec3 bakeSpecularMap (in vec3 theNormal,
- in float theRoughness)
-{
- vec4 aResult = vec4(0.0);
- if (theRoughness == 0.0)
- {
- aResult = specularMapSample (theNormal, theRoughness, 0, 1);
- }
- else
- {
- for (int aSampleIter = 0; aSampleIter < uSamplesNum; ++aSampleIter)
- {
- aResult += specularMapSample (theNormal, theRoughness, aSampleIter, uSamplesNum);
- }
- }
- return aResult.xyz / aResult.w;
-}
-#endif
-
-void main()
-{
- vec3 aViewDirection = normalize (ViewDirection);
-#ifdef THE_TO_BAKE_DIFFUSE
- vec4 aRes = vec4 (bakeDiffuseSH(), 1.0);
-#ifdef THE_TO_PACK_FLOAT
- int aCompIndex = int(gl_FragCoord.y);
- float aComp = aCompIndex == 0 ? aRes.x : (aCompIndex == 1 ? aRes.y : aRes.z);
- int aFixedPrec = int(aComp * 2147483647.0);
- int aFixedDiv1 = aFixedPrec / 256;
- int aFixedDiv2 = aFixedDiv1 / 256;
- int aFixedDiv3 = aFixedDiv2 / 256;
- vec4 aPacked = vec4(float(aFixedPrec), float(aFixedDiv1), float(aFixedDiv2), float(aFixedDiv3));
- aRes = fract (aPacked * (1.0 / 256.0));
-#endif
- occFragColor = aRes;
-#else
- float aRoughness = float(uCurrentLevel) / float(occNbSpecIBLLevels - 1);
- occFragColor = vec4 (bakeSpecularMap (aViewDirection, aRoughness), 1.0);
-#endif
-}
+++ /dev/null
-THE_SHADER_OUT vec3 ViewDirection; //!< direction of fetching from environment cubemap
-
-uniform int uCurrentSide; //!< current side of cubemap
-uniform int uYCoeff; //!< coefficient of Y controlling horizontal flip of cubemap
-uniform int uZCoeff; //!< coefficient of Z controlling vertical flip of cubemap
-
-void main()
-{
- vec3 aDir;
- vec2 aCoord;
- if (uCurrentSide == 0)
- {
- aCoord = mat2( 0,-1,-1, 0) * occVertex.xy;
- aDir.x = 1.0;
- aDir.y = aCoord.x;
- aDir.z = aCoord.y;
- }
- else if (uCurrentSide == 1)
- {
- aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;
- aDir.x = -1.0;
- aDir.y = aCoord.x;
- aDir.z = aCoord.y;
- }
- else if (uCurrentSide == 2)
- {
- aCoord = mat2( 0, 1, 1, 0) * occVertex.xy;
- aDir.x = aCoord.y;
- aDir.y = 1.0;
- aDir.z = aCoord.x;
- }
- else if (uCurrentSide == 3)
- {
- aCoord = mat2( 0, 1,-1, 0) * occVertex.xy;
- aDir.x = aCoord.y;
- aDir.y = -1.0;
- aDir.z = aCoord.x;
- }
- else if (uCurrentSide == 4)
- {
- aCoord = mat2( 1, 0, 0,-1) * occVertex.xy;
- aDir.x = aCoord.x;
- aDir.y = aCoord.y;
- aDir.z = 1.0;
- }
- else //if (uCurrentSide == 5)
- {
- aCoord = mat2(-1, 0, 0,-1) * occVertex.xy;
- aDir.x = aCoord.x;
- aDir.y = aCoord.y;
- aDir.z = -1.0;
- }
- ViewDirection = cubemapVectorTransform (aDir, uYCoeff, uZCoeff);
- gl_Position = vec4 (occVertex.xy, 0.0, 1.0);
-}
+++ /dev/null
-//! Functions to calculate fresnel coefficient and approximate zero fresnel value.
-vec3 occPBRFresnel (in vec3 theBaseColor,
- in float theMetallic,
- in float theIOR)
-{
- theIOR = (1.0 - theIOR) / (1.0 + theIOR);
- theIOR *= theIOR;
- vec3 f0 = vec3(theIOR);
- f0 = mix (f0, theBaseColor.rgb, theMetallic);
- return f0;
-}
-
-vec3 occPBRFresnel (in vec3 theBaseColor,
- in float theMetallic,
- in float theIOR,
- in float theCosVH)
-{
- vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);
- theCosVH = 1.0 - theCosVH;
- theCosVH *= theCosVH;
- theCosVH *= theCosVH * theCosVH * theCosVH * theCosVH;
- return f0 + (vec3 (1.0) - f0) * theCosVH;
-}
-
-vec3 occPBRFresnel (in vec3 theBaseColor,
- in float theMetallic,
- in float theRoughness,
- in float theIOR,
- in float theCosV)
-{
- vec3 f0 = occPBRFresnel (theBaseColor, theMetallic, theIOR);
- theCosV = 1.0 - theCosV;
- theCosV *= theCosV;
- theCosV *= theCosV * theCosV * theCosV * theCosV;
- return f0 + (max(vec3(1.0 - theRoughness), f0) - f0) * theCosV;
-}
+++ /dev/null
-//! Calculates geometry factor for Cook-Torrance BRDF.
-float occPBRGeometry (in float theCosV,
- in float theCosL,
- in float theRoughness)
-{
- float k = theRoughness + 1.0;
- k *= 0.125 * k;
- float g1 = 1.0;
- g1 /= theCosV * (1.0 - k) + k;
- float g2 = 1.0;
- g2 /= theCosL * (1.0 - k) + k;
- return g1 * g2;
-}
+++ /dev/null
-//! Calculates direct illumination using Cook-Torrance BRDF.
-vec3 occPBRIllumination (in vec3 theView,
- in vec3 theLight,
- in vec3 theNormal,
- in vec4 theBaseColor,
- in float theMetallic,
- in float theRoughness,
- in float theIOR,
- in vec3 theLightColor,
- in float theLightIntensity)
-{
- vec3 aHalf = normalize (theView + theLight);
- float aCosVH = max(dot(theView, aHalf), 0.0);
- vec3 aFresnel = occPBRFresnel (theBaseColor.rgb, theMetallic, theIOR, aCosVH);
- vec3 aSpecular = occPBRCookTorrance (theView,
- theLight,
- theNormal,
- theBaseColor.rgb,
- theMetallic,
- theRoughness,
- theIOR);
- vec3 aDiffuse = vec3(1.0) - aFresnel;
- aDiffuse *= 1.0 - theMetallic;
- aDiffuse *= INV_PI;
- aDiffuse *= theBaseColor.rgb;
- aDiffuse = mix (vec3(0.0), aDiffuse, theBaseColor.a);
- return (aDiffuse + aSpecular) * theLightColor * theLightIntensity * max(0.0, dot(theLight, theNormal));
-}
+++ /dev/null
-//! Function computes contribution of isotropic point light source
-//! into global variable DirectLighting (PBR shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param thePoint 3D position (world space)
-//! @param theIsFront front/back face flag
-void occPointLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint,
- in bool theIsFront)
-{
- vec3 aLight = occLight_Position (theId) - thePoint;
-
- float aDist = length (aLight);
- float aRange = occLight_Range (theId);
- float anAtten = occPointLightAttenuation (aDist, aRange);
- if (anAtten <= 0.0) return;
- aLight /= aDist;
-
- theNormal = theIsFront ? theNormal : -theNormal;
- DirectLighting += occPBRIllumination (theView, aLight, theNormal,
- BaseColor, Metallic, Roughness, IOR,
- occLight_Specular (theId),
- occLight_Intensity(theId) * anAtten);
-}
+++ /dev/null
-//! Function computes contribution of spotlight source
-//! into global variable DirectLighting (PBR shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param thePoint 3D position (world space)
-//! @param theIsFront front/back face flag
-void occSpotLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint,
- in bool theIsFront,
- in float theShadow)
-{
- vec3 aLight = occLight_Position (theId) - thePoint;
-
- float aDist = length (aLight);
- float aRange = occLight_Range (theId);
- float anAtten = occPointLightAttenuation (aDist, aRange);
- if (anAtten <= 0.0) return;
- aLight /= aDist;
-
- vec3 aSpotDir = occLight_SpotDirection (theId);
- // light cone
- float aCosA = dot (aSpotDir, -aLight);
- float aRelativeAngle = 2.0 * acos(aCosA) / occLight_SpotCutOff(theId);
- if (aCosA >= 1.0 || aRelativeAngle > 1.0)
- {
- return;
- }
- float anExponent = occLight_SpotExponent (theId);
- if ((1.0 - aRelativeAngle) <= anExponent)
- {
- float anAngularAttenuationOffset = cos(0.5 * occLight_SpotCutOff(theId));
- float anAngularAttenuationScale = 1.0 / max(0.001, cos(0.5 * occLight_SpotCutOff(theId) * (1.0 - anExponent)) - anAngularAttenuationOffset);
- anAngularAttenuationOffset *= -anAngularAttenuationScale;
- float anAngularAttenuantion = clamp(aCosA * anAngularAttenuationScale + anAngularAttenuationOffset, 0.0, 1.0);
- anAtten *= anAngularAttenuantion * anAngularAttenuantion;
- }
- theNormal = theIsFront ? theNormal : -theNormal;
- DirectLighting += occPBRIllumination (theView, aLight, theNormal,
- BaseColor, Metallic, Roughness, IOR,
- occLight_Specular(theId),
- occLight_Intensity(theId) * anAtten) * theShadow;
-}
+++ /dev/null
-#ifdef _MSC_VER
- #define PATH_TRACING // just for editing in MS VS
-
- #define in
- #define out
- #define inout
-
- typedef struct { float x; float y; } vec2;
- typedef struct { float x; float y; float z; } vec3;
- typedef struct { float x; float y; float z; float w; } vec4;
-#endif
-
-#ifdef PATH_TRACING
-
-///////////////////////////////////////////////////////////////////////////////////////
-// Specific data types
-
-//! Describes local space at the hit point (visualization space).
-struct SLocalSpace
-{
- //! Local X axis.
- vec3 AxisX;
-
- //! Local Y axis.
- vec3 AxisY;
-
- //! Local Z axis.
- vec3 AxisZ;
-};
-
-//! Describes material properties (BSDF).
-struct SBSDF
-{
- //! Weight of coat specular/glossy BRDF.
- vec4 Kc;
-
- //! Weight of base diffuse BRDF + base color texture index in W.
- vec4 Kd;
-
- //! Weight of base specular/glossy BRDF.
- vec4 Ks;
-
- //! Weight of base specular/glossy BTDF + metallic-roughness texture index in W.
- vec4 Kt;
-
- //! Fresnel coefficients of coat layer.
- vec3 FresnelCoat;
-
- //! Fresnel coefficients of base layer + normal map texture index in W.
- vec4 FresnelBase;
-};
-
-///////////////////////////////////////////////////////////////////////////////////////
-// Support subroutines
-
-//=======================================================================
-// function : buildLocalSpace
-// purpose : Generates local space for the given normal
-//=======================================================================
-SLocalSpace buildLocalSpace (in vec3 theNormal)
-{
- vec3 anAxisX = vec3 (theNormal.z, 0.f, -theNormal.x);
- vec3 anAxisY = vec3 (0.f, -theNormal.z, theNormal.y);
-
- float aSqrLenX = dot (anAxisX, anAxisX);
- float aSqrLenY = dot (anAxisY, anAxisY);
-
- if (aSqrLenX > aSqrLenY)
- {
- anAxisX *= inversesqrt (aSqrLenX);
- anAxisY = cross (anAxisX, theNormal);
- }
- else
- {
- anAxisY *= inversesqrt (aSqrLenY);
- anAxisX = cross (anAxisY, theNormal);
- }
-
- return SLocalSpace (anAxisX, anAxisY, theNormal);
-}
-
-//=======================================================================
-// function : toLocalSpace
-// purpose : Transforms the vector to local space from world space
-//=======================================================================
-vec3 toLocalSpace (in vec3 theVector, in SLocalSpace theSpace)
-{
- return vec3 (dot (theVector, theSpace.AxisX),
- dot (theVector, theSpace.AxisY),
- dot (theVector, theSpace.AxisZ));
-}
-
-//=======================================================================
-// function : fromLocalSpace
-// purpose : Transforms the vector from local space to world space
-//=======================================================================
-vec3 fromLocalSpace (in vec3 theVector, in SLocalSpace theSpace)
-{
- return theVector.x * theSpace.AxisX +
- theVector.y * theSpace.AxisY +
- theVector.z * theSpace.AxisZ;
-}
-
-//=======================================================================
-// function : convolve
-// purpose : Performs a linear convolution of the vector components
-//=======================================================================
-float convolve (in vec3 theVector, in vec3 theFactor)
-{
- return dot (theVector, theFactor) * (1.f / max (theFactor.x + theFactor.y + theFactor.z, 1e-15f));
-}
-
-//=======================================================================
-// function : fresnelSchlick
-// purpose : Computes the Fresnel reflection formula using
-// Schlick's approximation.
-//=======================================================================
-vec3 fresnelSchlick (in float theCosI, in vec3 theSpecularColor)
-{
- return theSpecularColor + (UNIT - theSpecularColor) * pow (1.f - theCosI, 5.f);
-}
-
-//=======================================================================
-// function : fresnelDielectric
-// purpose : Computes the Fresnel reflection formula for dielectric in
-// case of circularly polarized light (Based on PBRT code).
-//=======================================================================
-float fresnelDielectric (in float theCosI,
- in float theCosT,
- in float theEtaI,
- in float theEtaT)
-{
- float aParl = (theEtaT * theCosI - theEtaI * theCosT) /
- (theEtaT * theCosI + theEtaI * theCosT);
-
- float aPerp = (theEtaI * theCosI - theEtaT * theCosT) /
- (theEtaI * theCosI + theEtaT * theCosT);
-
- return (aParl * aParl + aPerp * aPerp) * 0.5f;
-}
-
-#define ENVIRONMENT_IOR 1.f
-
-//=======================================================================
-// function : fresnelDielectric
-// purpose : Computes the Fresnel reflection formula for dielectric in
-// case of circularly polarized light (based on PBRT code)
-//=======================================================================
-float fresnelDielectric (in float theCosI, in float theIndex)
-{
- float aFresnel = 1.f;
-
- float anEtaI = theCosI > 0.f ? 1.f : theIndex;
- float anEtaT = theCosI > 0.f ? theIndex : 1.f;
-
- float aSinT2 = (anEtaI * anEtaI) / (anEtaT * anEtaT) * (1.f - theCosI * theCosI);
-
- if (aSinT2 < 1.f)
- {
- aFresnel = fresnelDielectric (abs (theCosI), sqrt (1.f - aSinT2), anEtaI, anEtaT);
- }
-
- return aFresnel;
-}
-
-//=======================================================================
-// function : fresnelConductor
-// purpose : Computes the Fresnel reflection formula for conductor in case
-// of circularly polarized light (based on PBRT source code)
-//=======================================================================
-float fresnelConductor (in float theCosI, in float theEta, in float theK)
-{
- float aTmp = 2.f * theEta * theCosI;
-
- float aTmp1 = theEta * theEta + theK * theK;
-
- float aSPerp = (aTmp1 - aTmp + theCosI * theCosI) /
- (aTmp1 + aTmp + theCosI * theCosI);
-
- float aTmp2 = aTmp1 * theCosI * theCosI;
-
- float aSParl = (aTmp2 - aTmp + 1.f) /
- (aTmp2 + aTmp + 1.f);
-
- return (aSPerp + aSParl) * 0.5f;
-}
-
-#define FRESNEL_SCHLICK -0.5f
-#define FRESNEL_CONSTANT -1.5f
-#define FRESNEL_CONDUCTOR -2.5f
-#define FRESNEL_DIELECTRIC -3.5f
-
-//=======================================================================
-// function : fresnelMedia
-// purpose : Computes the Fresnel reflection formula for general medium
-// in case of circularly polarized light.
-//=======================================================================
-vec3 fresnelMedia (in float theCosI, in vec3 theFresnel)
-{
- vec3 aFresnel;
-
- if (theFresnel.x > FRESNEL_SCHLICK)
- {
- aFresnel = fresnelSchlick (abs (theCosI), theFresnel);
- }
- else if (theFresnel.x > FRESNEL_CONSTANT)
- {
- aFresnel = vec3 (theFresnel.z);
- }
- else if (theFresnel.x > FRESNEL_CONDUCTOR)
- {
- aFresnel = vec3 (fresnelConductor (abs (theCosI), theFresnel.y, theFresnel.z));
- }
- else
- {
- aFresnel = vec3 (fresnelDielectric (theCosI, theFresnel.y));
- }
-
- return aFresnel;
-}
-
-//=======================================================================
-// function : transmitted
-// purpose : Computes transmitted direction in tangent space
-// (in case of TIR returned result is undefined!)
-//=======================================================================
-void transmitted (in float theIndex, in vec3 theIncident, out vec3 theTransmit)
-{
- // Compute relative index of refraction
- float anEta = (theIncident.z > 0.f) ? 1.f / theIndex : theIndex;
-
- // Handle total internal reflection (TIR)
- float aSinT2 = anEta * anEta * (1.f - theIncident.z * theIncident.z);
-
- // Compute direction of transmitted ray
- float aCosT = sqrt (1.f - min (aSinT2, 1.f)) * sign (-theIncident.z);
-
- theTransmit = normalize (vec3 (-anEta * theIncident.x,
- -anEta * theIncident.y,
- aCosT));
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-// Handlers and samplers for materials
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-//=======================================================================
-// function : EvalLambertianReflection
-// purpose : Evaluates Lambertian BRDF, with cos(N, PSI)
-//=======================================================================
-float EvalLambertianReflection (in vec3 theWi, in vec3 theWo)
-{
- return (theWi.z <= 0.f || theWo.z <= 0.f) ? 0.f : theWi.z * (1.f / M_PI);
-}
-
-#define FLT_EPSILON 1.0e-5f
-
-//=======================================================================
-// function : SmithG1
-// purpose :
-//=======================================================================
-float SmithG1 (in vec3 theDirection, in vec3 theM, in float theRoughness)
-{
- float aResult = 0.f;
-
- if (dot (theDirection, theM) * theDirection.z > 0.f)
- {
- float aTanThetaM = sqrt (1.f - theDirection.z * theDirection.z) / theDirection.z;
-
- if (aTanThetaM == 0.f)
- {
- aResult = 1.f;
- }
- else
- {
- float aVal = 1.f / (theRoughness * aTanThetaM);
-
- // Use rational approximation to shadowing-masking function (from Mitsuba)
- aResult = (3.535f + 2.181f * aVal) / (1.f / aVal + 2.276f + 2.577f * aVal);
- }
- }
-
- return min (aResult, 1.f);
-}
-
-//=======================================================================
-// function : EvalBlinnReflection
-// purpose : Evaluates Blinn glossy BRDF, with cos(N, PSI)
-//=======================================================================
-vec3 EvalBlinnReflection (in vec3 theWi, in vec3 theWo, in vec3 theFresnel, in float theRoughness)
-{
- // calculate the reflection half-vec
- vec3 aH = normalize (theWi + theWo);
-
- // roughness value -> Blinn exponent
- float aPower = max (2.f / (theRoughness * theRoughness) - 2.f, 0.f);
-
- // calculate microfacet distribution
- float aD = (aPower + 2.f) * (1.f / M_2_PI) * pow (aH.z, aPower);
-
- // calculate shadow-masking function
- float aG = SmithG1 (theWo, aH, theRoughness) *
- SmithG1 (theWi, aH, theRoughness);
-
- // return total amount of reflection
- return (theWi.z <= 0.f || theWo.z <= 0.f) ? ZERO :
- aD * aG / (4.f * theWo.z) * fresnelMedia (dot (theWo, aH), theFresnel);
-}
-
-//=======================================================================
-// function : EvalBsdfLayered
-// purpose : Evaluates BSDF for specified material, with cos(N, PSI)
-//=======================================================================
-vec3 EvalBsdfLayered (in SBSDF theBSDF, in vec3 theWi, in vec3 theWo)
-{
-#ifdef TWO_SIDED_BXDF
- theWi.z *= sign (theWi.z);
- theWo.z *= sign (theWo.z);
-#endif
-
- vec3 aBxDF = theBSDF.Kd.rgb * EvalLambertianReflection (theWi, theWo);
-
- if (theBSDF.Ks.w > FLT_EPSILON)
- {
- aBxDF += theBSDF.Ks.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelBase.rgb, theBSDF.Ks.w);
- }
-
- aBxDF *= UNIT - fresnelMedia (theWo.z, theBSDF.FresnelCoat);
-
- if (theBSDF.Kc.w > FLT_EPSILON)
- {
- aBxDF += theBSDF.Kc.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelCoat, theBSDF.Kc.w);
- }
-
- return aBxDF;
-}
-
-//=======================================================================
-// function : SampleLambertianReflection
-// purpose : Samples Lambertian BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)
-//=======================================================================
-vec3 SampleLambertianReflection (in vec3 theWo, out vec3 theWi, inout float thePDF)
-{
- float aKsi1 = RandFloat();
- float aKsi2 = RandFloat();
-
- theWi = vec3 (cos (M_2_PI * aKsi1),
- sin (M_2_PI * aKsi1),
- sqrt (1.f - aKsi2));
-
- theWi.xy *= sqrt (aKsi2);
-
-#ifdef TWO_SIDED_BXDF
- theWi.z *= sign (theWo.z);
-#endif
-
- thePDF *= theWi.z * (1.f / M_PI);
-
-#ifdef TWO_SIDED_BXDF
- return UNIT;
-#else
- return UNIT * step (0.f, theWo.z);
-#endif
-}
-
-//=======================================================================
-// function : SampleGlossyBlinnReflection
-// purpose : Samples Blinn BRDF, W = BRDF * cos(N, PSI) / PDF(PSI)
-// The BRDF is a product of three main terms, D, G, and F,
-// which is then divided by two cosine terms. Here we perform
-// importance sample the D part of the Blinn model; trying to
-// develop a sampling procedure that accounted for all of the
-// terms would be complex, and it is the D term that accounts
-// for most of the variation.
-//=======================================================================
-vec3 SampleGlossyBlinnReflection (in vec3 theWo, out vec3 theWi, in vec3 theFresnel, in float theRoughness, inout float thePDF)
-{
- float aKsi1 = RandFloat();
- float aKsi2 = RandFloat();
-
- // roughness value --> Blinn exponent
- float aPower = max (2.f / (theRoughness * theRoughness) - 2.f, 0.f);
-
- // normal from microface distribution
- float aCosThetaM = pow (aKsi1, 1.f / (aPower + 2.f));
-
- vec3 aM = vec3 (cos (M_2_PI * aKsi2),
- sin (M_2_PI * aKsi2),
- aCosThetaM);
-
- aM.xy *= sqrt (1.f - aCosThetaM * aCosThetaM);
-
- // calculate PDF of sampled direction
- thePDF *= (aPower + 2.f) * (1.f / M_2_PI) * pow (aCosThetaM, aPower + 1.f);
-
-#ifdef TWO_SIDED_BXDF
- bool toFlip = theWo.z < 0.f;
-
- if (toFlip)
- theWo.z = -theWo.z;
-#endif
-
- float aCosDelta = dot (theWo, aM);
-
- // pick input based on half direction
- theWi = -theWo + 2.f * aCosDelta * aM;
-
- if (theWi.z <= 0.f || theWo.z <= 0.f)
- {
- return ZERO;
- }
-
- // Jacobian of half-direction mapping
- thePDF /= 4.f * aCosDelta;
-
- // compute shadow-masking coefficient
- float aG = SmithG1 (theWo, aM, theRoughness) *
- SmithG1 (theWi, aM, theRoughness);
-
-#ifdef TWO_SIDED_BXDF
- if (toFlip)
- theWi.z = -theWi.z;
-#endif
-
- return (aG * aCosDelta) / (theWo.z * aM.z) * fresnelMedia (aCosDelta, theFresnel);
-}
-
-//=======================================================================
-// function : BsdfPdfLayered
-// purpose : Calculates BSDF of sampling input knowing output
-//=======================================================================
-float BsdfPdfLayered (in SBSDF theBSDF, in vec3 theWo, in vec3 theWi, in vec3 theWeight)
-{
- float aPDF = 0.f; // PDF of sampling input direction
-
- // We choose whether the light is reflected or transmitted
- // by the coating layer according to the Fresnel equations
- vec3 aCoatF = fresnelMedia (theWo.z, theBSDF.FresnelCoat);
-
- // Coat BRDF is scaled by its Fresnel reflectance term. For
- // reasons of simplicity we scale base BxDFs only by coat's
- // Fresnel transmittance term
- vec3 aCoatT = UNIT - aCoatF;
-
- float aPc = dot (theBSDF.Kc.rgb * aCoatF, theWeight);
- float aPd = dot (theBSDF.Kd.rgb * aCoatT, theWeight);
- float aPs = dot (theBSDF.Ks.rgb * aCoatT, theWeight);
- float aPt = dot (theBSDF.Kt.rgb * aCoatT, theWeight);
-
- if (theWi.z * theWo.z > 0.f)
- {
- vec3 aH = normalize (theWi + theWo);
-
- aPDF = aPd * abs (theWi.z / M_PI);
-
- if (theBSDF.Kc.w > FLT_EPSILON)
- {
- float aPower = max (2.f / (theBSDF.Kc.w * theBSDF.Kc.w) - 2.f, 0.f); // roughness --> exponent
-
- aPDF += aPc * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);
- }
-
- if (theBSDF.Ks.w > FLT_EPSILON)
- {
- float aPower = max (2.f / (theBSDF.Ks.w * theBSDF.Ks.w) - 2.f, 0.f); // roughness --> exponent
-
- aPDF += aPs * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);
- }
- }
-
- return aPDF / (aPc + aPd + aPs + aPt);
-}
-
-//! Tool macro to handle sampling of particular BxDF
-#define PICK_BXDF_LAYER(p, k) aPDF = p / aTotalR; theWeight *= k / aPDF;
-
-//=======================================================================
-// function : SampleBsdfLayered
-// purpose : Samples specified composite material (BSDF)
-//=======================================================================
-float SampleBsdfLayered (in SBSDF theBSDF, in vec3 theWo, out vec3 theWi, inout vec3 theWeight, inout bool theInside)
-{
- // NOTE: OCCT uses two-layer material model. We have base diffuse, glossy, or transmissive
- // layer, covered by one glossy/specular coat. In the current model, the layers themselves
- // have no thickness; they can simply reflect light or transmits it to the layer under it.
- // We use actual BRDF model only for direct reflection by the coat layer. For transmission
- // through this layer, we approximate it as a flat specular surface.
-
- float aPDF = 0.f; // PDF of sampled direction
-
- // We choose whether the light is reflected or transmitted
- // by the coating layer according to the Fresnel equations
- vec3 aCoatF = fresnelMedia (theWo.z, theBSDF.FresnelCoat);
-
- // Coat BRDF is scaled by its Fresnel term. According to
- // Wilkie-Weidlich layered BSDF model, transmission term
- // for light passing through the coat at direction I and
- // leaving it in O is T = ( 1 - F (O) ) x ( 1 - F (I) ).
- // For reasons of simplicity, we discard the second term
- // and scale base BxDFs only by the first term.
- vec3 aCoatT = UNIT - aCoatF;
-
- float aPc = dot (theBSDF.Kc.rgb * aCoatF, theWeight);
- float aPd = dot (theBSDF.Kd.rgb * aCoatT, theWeight);
- float aPs = dot (theBSDF.Ks.rgb * aCoatT, theWeight);
- float aPt = dot (theBSDF.Kt.rgb * aCoatT, theWeight);
-
- // Calculate total reflection probability
- float aTotalR = (aPc + aPd) + (aPs + aPt);
-
- // Generate random variable to select BxDF
- float aKsi = aTotalR * RandFloat();
-
- if (aKsi < aPc) // REFLECTION FROM COAT
- {
- PICK_BXDF_LAYER (aPc, theBSDF.Kc.rgb)
-
- if (theBSDF.Kc.w < FLT_EPSILON)
- {
- theWeight *= aCoatF;
-
- theWi = vec3 (-theWo.x,
- -theWo.y,
- theWo.z);
- }
- else
- {
- theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelCoat, theBSDF.Kc.w, aPDF);
- }
-
- aPDF = mix (aPDF, MAXFLOAT, theBSDF.Kc.w < FLT_EPSILON);
- }
- else if (aKsi < aTotalR) // REFLECTION FROM BASE
- {
- theWeight *= aCoatT;
-
- if (aKsi < aPc + aPd) // diffuse BRDF
- {
- PICK_BXDF_LAYER (aPd, theBSDF.Kd.rgb)
-
- theWeight *= SampleLambertianReflection (theWo, theWi, aPDF);
- }
- else if (aKsi < (aPc + aPd) + aPs) // specular/glossy BRDF
- {
- PICK_BXDF_LAYER (aPs, theBSDF.Ks.rgb)
-
- if (theBSDF.Ks.w < FLT_EPSILON)
- {
- theWeight *= fresnelMedia (theWo.z, theBSDF.FresnelBase.rgb);
-
- theWi = vec3 (-theWo.x,
- -theWo.y,
- theWo.z);
- }
- else
- {
- theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelBase.rgb, theBSDF.Ks.w, aPDF);
- }
-
- aPDF = mix (aPDF, MAXFLOAT, theBSDF.Ks.w < FLT_EPSILON);
- }
- else // specular transmission
- {
- PICK_BXDF_LAYER (aPt, theBSDF.Kt.rgb)
-
- // refracted direction should exist if we are here
- transmitted (theBSDF.FresnelCoat.y, theWo, theWi);
-
- theInside = !theInside; aPDF = MAXFLOAT;
- }
- }
-
- // path termination for extra small weights
- theWeight = mix (ZERO, theWeight, step (FLT_EPSILON, aTotalR));
-
- return aPDF;
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-// Handlers and samplers for light sources
-//////////////////////////////////////////////////////////////////////////////////////////////
-
-//=======================================================================
-// function : SampleLight
-// purpose : General sampling function for directional and point lights
-//=======================================================================
-vec3 SampleLight (in vec3 theToLight, inout float theDistance, in bool isInfinite, in float theSmoothness, inout float thePDF)
-{
- SLocalSpace aSpace = buildLocalSpace (theToLight * (1.f / theDistance));
-
- // for point lights smoothness defines radius
- float aCosMax = isInfinite ? theSmoothness :
- inversesqrt (1.f + theSmoothness * theSmoothness / (theDistance * theDistance));
-
- float aKsi1 = RandFloat();
- float aKsi2 = RandFloat();
-
- float aTmp = 1.f - aKsi2 * (1.f - aCosMax);
-
- vec3 anInput = vec3 (cos (M_2_PI * aKsi1),
- sin (M_2_PI * aKsi1),
- aTmp);
-
- anInput.xy *= sqrt (1.f - aTmp * aTmp);
-
- thePDF = (aCosMax < 1.f) ? (thePDF / M_2_PI) / (1.f - aCosMax) : MAXFLOAT;
-
- return normalize (fromLocalSpace (anInput, aSpace));
-}
-
-//=======================================================================
-// function : HandlePointLight
-// purpose :
-//=======================================================================
-float HandlePointLight (in vec3 theInput, in vec3 theToLight, in float theRadius, in float theDistance, inout float thePDF)
-{
- float aCosMax = inversesqrt (1.f + theRadius * theRadius / (theDistance * theDistance));
-
- float aVisibility = step (aCosMax, dot (theInput, theToLight));
-
- thePDF *= step (-1.f, -aCosMax) * aVisibility * (1.f / M_2_PI) / (1.f - aCosMax);
-
- return aVisibility;
-}
-
-//=======================================================================
-// function : HandleDistantLight
-// purpose :
-//=======================================================================
-float HandleDistantLight (in vec3 theInput, in vec3 theToLight, in float theCosMax, inout float thePDF)
-{
- float aVisibility = step (theCosMax, dot (theInput, theToLight));
-
- thePDF *= step (-1.f, -theCosMax) * aVisibility * (1.f / M_2_PI) / (1.f - theCosMax);
-
- return aVisibility;
-}
-
-// =======================================================================
-// function: IntersectLight
-// purpose : Checks intersections with light sources
-// =======================================================================
-vec3 IntersectLight (in SRay theRay, in int theDepth, in float theHitDistance, out float thePDF)
-{
- vec3 aTotalRadiance = ZERO;
- thePDF = 0.f; // PDF of sampling light sources
- for (int aLightIdx = 0; aLightIdx < uLightCount; ++aLightIdx)
- {
- vec4 aLight = texelFetch (uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
- vec4 aParam = texelFetch (uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));
-
- // W component: 0 for infinite light and 1 for point light
- aLight.xyz -= mix (ZERO, theRay.Origin, aLight.w);
- float aPDF = 1.0 / float(uLightCount);
- if (aLight.w != 0.f) // point light source
- {
- float aCenterDst = length (aLight.xyz);
- if (aCenterDst < theHitDistance)
- {
- float aVisibility = HandlePointLight (
- theRay.Direct, normalize (aLight.xyz), aParam.w /* radius */, aCenterDst, aPDF);
-
- if (aVisibility > 0.f)
- {
- theHitDistance = aCenterDst;
- aTotalRadiance = aParam.rgb;
-
- thePDF = aPDF;
- }
- }
- }
- else if (theHitDistance == MAXFLOAT) // directional light source
- {
- aTotalRadiance += aParam.rgb * HandleDistantLight (
- theRay.Direct, aLight.xyz, aParam.w /* angle cosine */, aPDF);
-
- thePDF += aPDF;
- }
- }
-
- if (thePDF == 0.f && theHitDistance == MAXFLOAT) // light source not found
- {
- if (theDepth + uEnvMapForBack == 0) // view ray and map is hidden
- {
- aTotalRadiance = BackgroundColor().rgb;
- }
- else
- {
- #ifdef BACKGROUND_CUBEMAP
- if (theDepth == 0)
- {
- vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;
- vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;
- vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));
- vec3 aDirect = uEyeView * aLocalDir.z +
- uEyeSide * aLocalDir.x +
- uEyeVert * aLocalDir.y;
- aTotalRadiance = FetchEnvironment (aDirect, 1.0, true).rgb;
- }
- else
- {
- aTotalRadiance = FetchEnvironment (theRay.Direct, 1.0, false).rgb;
- }
- #else
- aTotalRadiance = FetchEnvironment (theRay.Direct, 1.0, theDepth == 0).rgb;
- #endif
- }
- #ifdef THE_SHIFT_sRGB
- aTotalRadiance = pow (aTotalRadiance, vec3 (2.f));
- #endif
- }
-
- return aTotalRadiance;
-}
-
-#define MIN_THROUGHPUT vec3 (1.0e-3f)
-#define MIN_CONTRIBUTION vec3 (1.0e-2f)
-
-#define MATERIAL_KC(index) (19 * index + 11)
-#define MATERIAL_KD(index) (19 * index + 12)
-#define MATERIAL_KS(index) (19 * index + 13)
-#define MATERIAL_KT(index) (19 * index + 14)
-#define MATERIAL_LE(index) (19 * index + 15)
-#define MATERIAL_FRESNEL_COAT(index) (19 * index + 16)
-#define MATERIAL_FRESNEL_BASE(index) (19 * index + 17)
-#define MATERIAL_ABSORPT_BASE(index) (19 * index + 18)
-
-//! Enables experimental Russian roulette sampling path termination.
-//! In most cases, it provides faster image convergence with minimal
-//! bias, so it is enabled by default.
-#define RUSSIAN_ROULETTE
-
-//! Frame step to increase number of bounces. This mode is used
-//! for interaction with the model, when path length is limited
-//! for the first samples, and gradually increasing when camera
-//! is stabilizing.
-#ifdef ADAPTIVE_SAMPLING
- #define FRAME_STEP 4
-#else
- #define FRAME_STEP 5
-#endif
-
-//=======================================================================
-// function : IsNotZero
-// purpose : Checks whether BSDF reflects direct light
-//=======================================================================
-bool IsNotZero (in SBSDF theBSDF, in vec3 theThroughput)
-{
- vec3 aGlossy = theBSDF.Kc.rgb * step (FLT_EPSILON, theBSDF.Kc.w) +
- theBSDF.Ks.rgb * step (FLT_EPSILON, theBSDF.Ks.w);
-
- return convolve (theBSDF.Kd.rgb + aGlossy, theThroughput) > FLT_EPSILON;
-}
-
-//=======================================================================
-// function : NormalAdaptation
-// purpose : Adapt smooth normal (which may be different from geometry normal) in order to avoid black areas in render
-//=======================================================================
-bool NormalAdaptation (in vec3 theView, in vec3 theGeometryNormal, inout vec3 theSmoothNormal)
-{
- float aMinCos = dot(theView, theGeometryNormal);
- aMinCos = 0.5 * (sqrt(1.0 - aMinCos) + sqrt(1.0 + aMinCos));
- float aCos = dot(theGeometryNormal, theSmoothNormal);
- if (aCos < aMinCos)
- {
- theSmoothNormal = aMinCos * theGeometryNormal + normalize(theSmoothNormal - aCos * theGeometryNormal) * sqrt(1.0 - aMinCos * aMinCos);
- return true;
- }
- return false;
-}
-
-//=======================================================================
-// function : PathTrace
-// purpose : Calculates radiance along the given ray
-//=======================================================================
-vec4 PathTrace (in SRay theRay, in vec3 theInverse, in int theNbSamples)
-{
- float aRaytraceDepth = MAXFLOAT;
-
- vec3 aRadiance = ZERO;
- vec3 aThroughput = UNIT;
-
- int aTransfID = 0; // ID of object transformation
- bool aInMedium = false; // is the ray inside an object
-
- float aExpPDF = 1.f;
- float aImpPDF = 1.f;
-
- for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)
- {
- SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);
-
- STriangle aTriangle = SceneNearestHit (theRay, theInverse, aHit, aTransfID);
-
- // check implicit path
- vec3 aLe = IntersectLight (theRay, aDepth, aHit.Time, aExpPDF);
-
- if (any (greaterThan (aLe, ZERO)) || aTriangle.TriIndex.x == -1)
- {
- float aMIS = (aDepth == 0 || aImpPDF == MAXFLOAT) ? 1.f :
- aImpPDF * aImpPDF / (aExpPDF * aExpPDF + aImpPDF * aImpPDF);
-
- aRadiance += aThroughput * aLe * aMIS; break; // terminate path
- }
-
- vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTransfID + 0).xyz;
- vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTransfID + 1).xyz;
- vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTransfID + 2).xyz;
-
- // compute geometrical normal
- aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),
- dot (aInvTransf1, aHit.Normal),
- dot (aInvTransf2, aHit.Normal)));
-
- theRay.Origin += theRay.Direct * aHit.Time; // get new intersection point
-
- // evaluate depth on first hit
- if (aDepth == 0)
- {
- vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);
-
- float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);
- #ifdef THE_ZERO_TO_ONE_DEPTH
- aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);
- #else
- aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;
- #endif
- }
-
- SBSDF aBSDF;
-
- // fetch BxDF weights
- aBSDF.Kc = texelFetch (uRaytraceMaterialTexture, MATERIAL_KC (aTriangle.TriIndex.w));
- aBSDF.Kd = texelFetch (uRaytraceMaterialTexture, MATERIAL_KD (aTriangle.TriIndex.w));
- aBSDF.Ks = texelFetch (uRaytraceMaterialTexture, MATERIAL_KS (aTriangle.TriIndex.w));
- aBSDF.Kt = texelFetch (uRaytraceMaterialTexture, MATERIAL_KT (aTriangle.TriIndex.w));
-
- // fetch Fresnel reflectance for both layers
- aBSDF.FresnelCoat = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_COAT (aTriangle.TriIndex.w)).xyz;
- aBSDF.FresnelBase = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_BASE (aTriangle.TriIndex.w));
-
- vec4 anLE = texelFetch (uRaytraceMaterialTexture, MATERIAL_LE (aTriangle.TriIndex.w));
-
- // compute smooth normal (in parallel with fetch)
- vec3 aNormal = SmoothNormal (aHit.UV, aTriangle.TriIndex);
- aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),
- dot (aInvTransf1, aNormal),
- dot (aInvTransf2, aNormal)));
-
-#ifdef USE_TEXTURES
- if (aBSDF.Kd.w >= 0.0 || aBSDF.Kt.w >= 0.0 || aBSDF.FresnelBase.w >=0.0 || anLE.w >= 0.0)
- {
- vec2 aUVs[3];
- vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriangle.TriIndex, aUVs), 0.f, 1.f);
- vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriangle.TriIndex.w));
- vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriangle.TriIndex.w));
- aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),
- dot (aTrsfRow2, aTexCoord));
-
- if (anLE.w >= 0.0)
- {
- anLE.rgb *= textureLod (sampler2D (uTextureSamplers[int (anLE.w)]), aTexCoord.st, 0.0).rgb;
- }
- if (aBSDF.Kt.w >= 0.0)
- {
- vec2 aTexMetRough = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kt.w)]), aTexCoord.st, 0.0).bg;
- float aPbrMetal = aTexMetRough.x;
- float aPbrRough2 = aTexMetRough.y * aTexMetRough.y;
- aBSDF.Ks.a *= aPbrRough2;
- // when using metal-roughness texture, global metalness of material (encoded in FresnelBase) is expected to be 1.0 so that Kd will be 0.0
- aBSDF.Kd.rgb = aBSDF.FresnelBase.rgb * (1.0 - aPbrMetal);
- aBSDF.FresnelBase.rgb *= aPbrMetal;
- }
- if (aBSDF.Kd.w >= 0.0)
- {
- vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.0);
- vec3 aDiff = aTexColor.rgb * aTexColor.a;
- aBSDF.Kd.rgb *= aDiff;
- aBSDF.FresnelBase.rgb *= aDiff;
- if (aTexColor.a != 1.0)
- {
- // mix transparency BTDF with texture alpha-channel
- aBSDF.Ks.rgb *= aTexColor.a;
- aBSDF.Kt.rgb = (UNIT - aTexColor.aaa) + aTexColor.a * aBSDF.Kt.rgb;
- }
- }
- #ifndef IGNORE_NORMAL_MAP
- if (aBSDF.FresnelBase.w >= 0.0)
- {
- for (int i = 0 ; i < 3; ++i)
- {
- aUVs[i] = vec2 (dot (aTrsfRow1, vec4(aUVs[i], 0.0, 1.0)),
- dot (aTrsfRow2, vec4(aUVs[i], 0.0, 1.0)));
- }
- vec3 aMapNormalValue = textureLod (sampler2D (uTextureSamplers[int (aBSDF.FresnelBase.w)]), aTexCoord.st, 0.0).xyz;
- mat2 aDeltaUVMatrix = mat2 (aUVs[1] - aUVs[0], aUVs[1] - aUVs[2]);
- mat2x3 aDeltaVectorMatrix = mat2x3 (aTriangle.Points[1] - aTriangle.Points[0], aTriangle.Points[1] - aTriangle.Points[2]);
- aNormal = TangentSpaceNormal (aDeltaUVMatrix, aDeltaVectorMatrix, aMapNormalValue, aNormal, true);
- }
- #endif
- }
-#endif
- NormalAdaptation (-theRay.Direct, aHit.Normal, aNormal);
- aHit.Normal = aNormal;
- SLocalSpace aSpace = buildLocalSpace (aNormal);
-
- if (uLightCount > 0 && IsNotZero (aBSDF, aThroughput))
- {
- aExpPDF = 1.0 / float(uLightCount);
-
- int aLightIdx = min (int (floor (RandFloat() * float(uLightCount))), uLightCount - 1);
-
- vec4 aLight = texelFetch (uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
- vec4 aParam = texelFetch (uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx));
-
- // 'w' component is 0 for infinite light and 1 for point light
- aLight.xyz -= mix (ZERO, theRay.Origin, aLight.w);
-
- float aDistance = length (aLight.xyz);
-
- aLight.xyz = SampleLight (aLight.xyz, aDistance,
- aLight.w == 0.f /* is infinite */, aParam.w /* max cos or radius */, aExpPDF);
-
- aImpPDF = BsdfPdfLayered (aBSDF,
- toLocalSpace (-theRay.Direct, aSpace), toLocalSpace (aLight.xyz, aSpace), aThroughput);
-
- // MIS weight including division by explicit PDF
- float aMIS = (aExpPDF == MAXFLOAT) ? 1.f : aExpPDF / (aExpPDF * aExpPDF + aImpPDF * aImpPDF);
-
- vec3 aContrib = aMIS * aParam.rgb /* Le */ * EvalBsdfLayered (
- aBSDF, toLocalSpace (aLight.xyz, aSpace), toLocalSpace (-theRay.Direct, aSpace));
-
- if (any (greaterThan (aContrib, MIN_CONTRIBUTION))) // check if light source is important
- {
- SRay aShadow = SRay (theRay.Origin + aLight.xyz * uSceneEpsilon, aLight.xyz);
-
- aShadow.Origin += aHit.Normal * mix (
- -uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, aLight.xyz)));
-
- float aVisibility = SceneAnyHit (aShadow,
- InverseDirection (aLight.xyz), aLight.w == 0.f ? MAXFLOAT : aDistance);
-
- aRadiance += aVisibility * (aThroughput * aContrib);
- }
- }
-
- // account for self-emission
- aRadiance += aThroughput * anLE.rgb;
-
- if (aInMedium) // handle attenuation
- {
- vec4 aScattering = texelFetch (uRaytraceMaterialTexture, MATERIAL_ABSORPT_BASE (aTriangle.TriIndex.w));
-
- aThroughput *= exp (-aHit.Time * aScattering.w * (UNIT - aScattering.rgb));
- }
-
- vec3 anInput = UNIT; // sampled input direction
-
- aImpPDF = SampleBsdfLayered (aBSDF,
- toLocalSpace (-theRay.Direct, aSpace), anInput, aThroughput, aInMedium);
-
- float aSurvive = float (any (greaterThan (aThroughput, MIN_THROUGHPUT)));
-
-#ifdef RUSSIAN_ROULETTE
- aSurvive = aDepth < 3 ? aSurvive : min (dot (LUMA, aThroughput), 0.95f);
-#endif
-
- // here, we additionally increase path length for non-diffuse bounces
- if (RandFloat() > aSurvive
- || all (lessThan (aThroughput, MIN_THROUGHPUT))
- || aDepth >= (theNbSamples / FRAME_STEP + int(step (1.0 / M_PI, aImpPDF))))
- {
- aDepth = INVALID_BOUNCES; // terminate path
- }
-
-#ifdef RUSSIAN_ROULETTE
- aThroughput /= aSurvive;
-#endif
-
- anInput = normalize (fromLocalSpace (anInput, aSpace));
-
- theRay = SRay (theRay.Origin + anInput * uSceneEpsilon +
- aHit.Normal * mix (-uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, anInput))), anInput);
-
- theInverse = InverseDirection (anInput);
- }
-
- gl_FragDepth = aRaytraceDepth;
-
- return vec4 (aRadiance, aRaytraceDepth);
-}
-
-#endif
+++ /dev/null
-//! Function computes contribution of directional light source
-//! into global variables Diffuse and Specular (Phong shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param theIsFront front/back face flag
-//! @param theShadow shadow attenuation
-void occDirectionalLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in bool theIsFront,
- in float theShadow)
-{
- vec3 aLight = occLight_Position (theId);
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
- }
-
- Diffuse += occLight_Diffuse (theId) * aNdotL * theShadow;
- Specular += occLight_Specular (theId) * aSpecl * theShadow;
-}
+++ /dev/null
-//! Function computes contribution of isotropic point light source
-//! into global variables Diffuse and Specular (Phong shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param thePoint 3D position (world space)
-//! @param theIsFront front/back face flag
-void occPointLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint,
- in bool theIsFront)
-{
- vec3 aLight = occLight_Position (theId) - thePoint;
-
- float aDist = length (aLight);
- float aRange = occLight_Range (theId);
- float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));
- if (anAtten <= 0.0) return;
- aLight /= aDist;
-
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
- }
-
- Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten;
- Specular += occLight_Specular(theId) * aSpecl * anAtten;
-}
+++ /dev/null
-// Created on: 2013-10-10
-// Created by: Denis BOGOLEPOV
-// Copyright (c) 2013-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-varying vec3 View; //!< Direction to the viewer
-varying vec3 Normal; //!< Vertex normal in view space
-varying vec4 Position; //!< Vertex position in view space.
-varying vec4 PositionWorld; //!< Vertex position in world space
-
-vec3 Ambient; //!< Ambient contribution of light sources
-vec3 Diffuse; //!< Diffuse contribution of light sources
-vec3 Specular; //!< Specular contribution of light sources
-
-//! Computes contribution of isotropic point light source
-void pointLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint)
-{
- vec3 aLight = occLight_Position (theId).xyz;
- if (!occLight_IsHeadlight (theId))
- {
- aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));
- }
- aLight -= thePoint;
-
- float aDist = length (aLight);
- aLight = aLight * (1.0 / aDist);
-
- float anAtten = 1.0 / (occLight_ConstAttenuation (theId)
- + occLight_LinearAttenuation (theId) * aDist);
-
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
- }
-
- Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;
- Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;
-}
-
-//! Computes contribution of spotlight source
-void spotLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint)
-{
- vec3 aLight = occLight_Position (theId).xyz;
- vec3 aSpotDir = occLight_SpotDirection (theId).xyz;
- if (!occLight_IsHeadlight (theId))
- {
- aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));
- aSpotDir = vec3 (occWorldViewMatrix * vec4 (aSpotDir, 0.0));
- }
- aLight -= thePoint;
-
- float aDist = length (aLight);
- aLight = aLight * (1.0 / aDist);
-
- aSpotDir = normalize (aSpotDir);
-
- // light cone
- float aCosA = dot (aSpotDir, -aLight);
- if (aCosA >= 1.0 || aCosA < cos (occLight_SpotCutOff (theId)))
- {
- return;
- }
-
- float anExponent = occLight_SpotExponent (theId);
- float anAtten = 1.0 / (occLight_ConstAttenuation (theId)
- + occLight_LinearAttenuation (theId) * aDist);
- if (anExponent > 0.0)
- {
- anAtten *= pow (aCosA, anExponent * 128.0);
- }
-
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
- }
-
- Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;
- Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;
-}
-
-//! Computes contribution of directional light source
-void directionalLight (in int theId,
- in vec3 theNormal,
- in vec3 theView)
-{
- vec3 aLight = normalize (occLight_Position (theId).xyz);
- if (!occLight_IsHeadlight (theId))
- {
- aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 0.0));
- }
-
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));
- }
-
- Diffuse += occLight_Diffuse (theId).rgb * aNdotL;
- Specular += occLight_Specular (theId).rgb * aSpecl;
-}
-
-//! Computes illumination from light sources
-vec4 computeLighting (in vec3 theNormal,
- in vec3 theView,
- in vec4 thePoint)
-{
- // Clear the light intensity accumulators
- Ambient = occLightAmbient.rgb;
- Diffuse = vec3 (0.0);
- Specular = vec3 (0.0);
- vec3 aPoint = thePoint.xyz / thePoint.w;
- for (int anIndex = 0; anIndex < occLightSourcesCount; ++anIndex)
- {
- int aType = occLight_Type (anIndex);
- if (aType == OccLightType_Direct)
- {
- directionalLight (anIndex, theNormal, theView);
- }
- else if (aType == OccLightType_Point)
- {
- pointLight (anIndex, theNormal, theView, aPoint);
- }
- else if (aType == OccLightType_Spot)
- {
- spotLight (anIndex, theNormal, theView, aPoint);
- }
- }
-
- vec3 aMatAmbient = occMaterial_Ambient (gl_FrontFacing);
- vec4 aMatDiffuse = occMaterial_Diffuse (gl_FrontFacing);
- vec3 aMatSpecular = occMaterial_Specular(gl_FrontFacing);
- vec3 aMatEmission = occMaterial_Emission(gl_FrontFacing);
- vec3 aColor = Ambient * aMatAmbient.rgb
- + Diffuse * aMatDiffuse.rgb
- + Specular * aMatSpecular.rgb
- + aMatEmission.rgb;
- return vec4 (aColor, aMatDiffuse.a);
-}
-
-//! Entry point to the Fragment Shader
-void main()
-{
- // process clipping planes
- for (int anIndex = 0; anIndex < occClipPlaneCount; ++anIndex)
- {
- vec4 aClipEquation = occClipPlaneEquations[anIndex];
- if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0)
- {
- discard;
- }
- }
-
- vec4 aColor = computeLighting (normalize (Normal), normalize (View), Position);
- occSetFragColor (aColor);
-}
+++ /dev/null
-// Created on: 2013-10-10
-// Created by: Denis BOGOLEPOV
-// Copyright (c) 2013-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-varying vec3 View; //!< Direction to the viewer
-varying vec3 Normal; //!< Vertex normal in view space
-varying vec4 Position; //!< Vertex position in view space
-varying vec4 PositionWorld; //!< Vertex position in world space
-
-//! Computes the normal in view space
-vec3 TransformNormal (in vec3 theNormal)
-{
- vec4 aResult = occWorldViewMatrixInverseTranspose
- * occModelWorldMatrixInverseTranspose
- * vec4 (theNormal, 0.0);
- return normalize (aResult.xyz);
-}
-
-//! Entry point to the Vertex Shader
-void main()
-{
- PositionWorld = occModelWorldMatrix * occVertex;
- Position = occWorldViewMatrix * PositionWorld;
- Normal = TransformNormal (occNormal);
-
- // Note: The specified view vector is absolutely correct only for the orthogonal projection.
- // For perspective projection it will be approximate, but it is in good agreement with the OpenGL calculations.
- View = vec3 (0.0, 0.0, 1.0);
-
- // Do fixed functionality vertex transform
- gl_Position = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;
-}
+++ /dev/null
-//! Function computes contribution of spotlight source
-//! into global variables Diffuse and Specular (Phong shading).
-//! @param theId light source index
-//! @param theNormal surface normal
-//! @param theView view direction
-//! @param thePoint 3D position (world space)
-//! @param theIsFront front/back face flag
-//! @param theShadow the value from shadow map
-void occSpotLight (in int theId,
- in vec3 theNormal,
- in vec3 theView,
- in vec3 thePoint,
- in bool theIsFront,
- in float theShadow)
-{
- vec3 aLight = occLight_Position (theId) - thePoint;
-
- float aDist = length (aLight);
- float aRange = occLight_Range (theId);
- float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));
- if (anAtten <= 0.0) return;
- aLight /= aDist;
-
- vec3 aSpotDir = occLight_SpotDirection (theId);
- // light cone
- float aCosA = dot (aSpotDir, -aLight);
- if (aCosA >= 1.0 || aCosA < cos (occLight_SpotCutOff (theId)))
- {
- return;
- }
-
- float anExponent = occLight_SpotExponent (theId);
- if (anExponent > 0.0)
- {
- anAtten *= pow (aCosA, anExponent * 128.0);
- }
-
- vec3 aHalf = normalize (aLight + theView);
-
- vec3 aFaceSideNormal = theIsFront ? theNormal : -theNormal;
- float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));
- float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));
-
- float aSpecl = 0.0;
- if (aNdotL > 0.0)
- {
- aSpecl = pow (aNdotH, occMaterial_Shininess (theIsFront));
- }
-
- Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten * theShadow;
- Specular += occLight_Specular(theId) * aSpecl * anAtten * theShadow;
-}
+++ /dev/null
-//! Returns point light source attenuation factor
-float occRangedPointLightAttenuation (in float theDistance, in float theRange)
-{
- if (theDistance <= theRange)
- {
- float aResult = theDistance / theRange;
- aResult *= aResult;
- aResult *= aResult;
- aResult = 1.0 - aResult;
- aResult = clamp(aResult, 0.0, 1.0);
- aResult /= max(0.0001, theDistance * theDistance);
- return aResult;
- }
- return -1.0;
-}
-
-//! Returns point light source attenuation factor with quadratic attenuation in case of zero range.
-float occPointLightAttenuation (in float theDistance, in float theRange)
-{
- if (theRange == 0.0)
- {
- return 1.0 / max(0.0001, theDistance * theDistance);
- }
- return occRangedPointLightAttenuation (theDistance, theRange);
-}
-
-//! Returns point light source attenuation factor with linear attenuation in case of zero range.
-float occPointLightAttenuation (in float theDistance, in float theRange, in float theLinearAttenuation, in float theConstAttenuation)
-{
- if (theRange == 0.0)
- {
- return 1.0 / (theConstAttenuation + theLinearAttenuation * theDistance);
- }
- return occRangedPointLightAttenuation (theDistance, theRange);
-}
+++ /dev/null
-#ifdef ADAPTIVE_SAMPLING
- #extension GL_ARB_shader_image_load_store : require
-#endif
-#ifdef ADAPTIVE_SAMPLING_ATOMIC
- #extension GL_NV_shader_atomic_float : require
-#endif
-
-#ifdef USE_TEXTURES
- #extension GL_ARB_bindless_texture : require
-#endif
-
-//! Normalized pixel coordinates.
-in vec2 vPixel;
-
-//! Sub-pixel offset in for FSAA.
-uniform vec2 uFsaaOffset;
-//! Sub-pixel offset in Y direction for FSAA.
-uniform float uOffsetY;
-
-//! Origin of viewing ray in left-top corner.
-uniform vec3 uOriginLT;
-//! Origin of viewing ray in left-bottom corner.
-uniform vec3 uOriginLB;
-//! Origin of viewing ray in right-top corner.
-uniform vec3 uOriginRT;
-//! Origin of viewing ray in right-bottom corner.
-uniform vec3 uOriginRB;
-
-//! Width of the rendering window.
-uniform int uWinSizeX;
-//! Height of the rendering window.
-uniform int uWinSizeY;
-
-//! Direction of viewing ray in left-top corner.
-uniform vec3 uDirectLT;
-//! Direction of viewing ray in left-bottom corner.
-uniform vec3 uDirectLB;
-//! Direction of viewing ray in right-top corner.
-uniform vec3 uDirectRT;
-//! Direction of viewing ray in right-bottom corner.
-uniform vec3 uDirectRB;
-
-//! Inverse model-view-projection matrix.
-uniform mat4 uUnviewMat;
-
-//! Model-view-projection matrix.
-uniform mat4 uViewMat;
-
-//! Texture buffer of data records of bottom-level BVH nodes.
-uniform isamplerBuffer uSceneNodeInfoTexture;
-//! Texture buffer of minimum points of bottom-level BVH nodes.
-uniform samplerBuffer uSceneMinPointTexture;
-//! Texture buffer of maximum points of bottom-level BVH nodes.
-uniform samplerBuffer uSceneMaxPointTexture;
-//! Texture buffer of transformations of high-level BVH nodes.
-uniform samplerBuffer uSceneTransformTexture;
-
-//! Texture buffer of vertex coords.
-uniform samplerBuffer uGeometryVertexTexture;
-//! Texture buffer of vertex normals.
-uniform samplerBuffer uGeometryNormalTexture;
-#ifdef USE_TEXTURES
- //! Texture buffer of per-vertex UV-coordinates.
- uniform samplerBuffer uGeometryTexCrdTexture;
-#endif
-//! Texture buffer of triangle indices.
-uniform isamplerBuffer uGeometryTriangTexture;
-
-//! Texture buffer of material properties.
-uniform samplerBuffer uRaytraceMaterialTexture;
-//! Texture buffer of light source properties.
-uniform samplerBuffer uRaytraceLightSrcTexture;
-
-#ifdef BACKGROUND_CUBEMAP
- //! Environment cubemap texture.
- uniform samplerCube uEnvMapTexture;
- //! Coefficient of Y controlling horizontal flip of cubemap
- uniform int uYCoeff;
- //! Coefficient of Z controlling vertical flip of cubemap
- uniform int uZCoeff;
-#else
- //! Environment map texture.
- uniform sampler2D uEnvMapTexture;
-#endif
-
-//! Total number of light sources.
-uniform int uLightCount;
-//! Intensity of global ambient light.
-uniform vec4 uGlobalAmbient;
-
-//! Enables/disables hard shadows.
-uniform int uShadowsEnabled;
-//! Enables/disables specular reflections.
-uniform int uReflectEnabled;
-//! Enables/disables environment map lighting.
-uniform int uEnvMapEnabled;
-//! Enables/disables environment map background.
-uniform int uEnvMapForBack;
-
-//! Radius of bounding sphere of the scene.
-uniform float uSceneRadius;
-//! Scene epsilon to prevent self-intersections.
-uniform float uSceneEpsilon;
-
-#ifdef USE_TEXTURES
- //! Unique 64-bit handles of OpenGL textures.
- uniform uvec2 uTextureSamplers[MAX_TEX_NUMBER];
-#endif
-
-#ifdef ADAPTIVE_SAMPLING
- //! OpenGL image used for accumulating rendering result.
- volatile restrict layout(r32f) uniform image2D uRenderImage;
-
-#ifdef ADAPTIVE_SAMPLING_ATOMIC
- //! OpenGL image storing offsets of sampled pixels blocks.
- coherent restrict layout(rg32i) uniform iimage2D uOffsetImage;
-#else
- //! OpenGL image defining per-tile amount of samples.
- volatile restrict layout(r32i) uniform iimage2D uTilesImage;
-#endif
-
- //! Screen space tile size.
- uniform ivec2 uTileSize;
-#endif
-
-//! Top color of gradient background.
-uniform vec4 uBackColorTop;
-//! Bottom color of gradient background.
-uniform vec4 uBackColorBot;
-
-//! Aperture radius of camera used for depth-of-field
-uniform float uApertureRadius;
-
-//! Focal distance of camera used for depth-of field
-uniform float uFocalPlaneDist;
-
-//! Camera position used for projective mode
-uniform vec3 uEyeOrig;
-
-//! Camera view direction used for projective mode
-uniform vec3 uEyeView;
-
-//! Camera's screen vertical direction used for projective mode
-uniform vec3 uEyeVert;
-
-//! Camera's screen horizontal direction used for projective mode
-uniform vec3 uEyeSide;
-
-//! Camera's screen size used for projective mode
-uniform vec2 uEyeSize;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Specific data types
-
-//! Stores ray parameters.
-struct SRay
-{
- vec3 Origin;
- vec3 Direct;
-};
-
-//! Stores intersection parameters.
-struct SIntersect
-{
- float Time;
- vec2 UV;
- vec3 Normal;
-};
-
-//! Stores triangle's vertex indexes and vertexes itself
-struct STriangle
-{
- ivec4 TriIndex;
- vec3 Points[3];
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Some useful constants
-
-#define MAXFLOAT 1e15f
-
-#define SMALL vec3 (exp2 (-80.0f))
-
-#define ZERO vec3 (0.0f, 0.0f, 0.0f)
-#define UNIT vec3 (1.0f, 1.0f, 1.0f)
-
-#define AXIS_X vec3 (1.0f, 0.0f, 0.0f)
-#define AXIS_Y vec3 (0.0f, 1.0f, 0.0f)
-#define AXIS_Z vec3 (0.0f, 0.0f, 1.0f)
-
-#define M_PI 3.141592653f
-#define M_2_PI 6.283185307f
-#define M_PI_2 1.570796327f
-
-#define LUMA vec3 (0.2126f, 0.7152f, 0.0722f)
-
-// =======================================================================
-// function : MatrixRowMultiplyDir
-// purpose : Multiplies a vector by matrix
-// =======================================================================
-vec3 MatrixRowMultiplyDir (in vec3 v,
- in vec4 m0,
- in vec4 m1,
- in vec4 m2)
-{
- return vec3 (dot (m0.xyz, v),
- dot (m1.xyz, v),
- dot (m2.xyz, v));
-}
-
-//! 32-bit state of random number generator.
-uint RandState;
-
-// =======================================================================
-// function : SeedRand
-// purpose : Applies hash function by Thomas Wang to randomize seeds
-// (see http://www.burtleburtle.net/bob/hash/integer.html)
-// =======================================================================
-void SeedRand (in int theSeed, in int theSizeX, in int theRadius)
-{
- RandState = uint (int (gl_FragCoord.y) / theRadius * theSizeX + int (gl_FragCoord.x) / theRadius + theSeed);
-
- RandState = (RandState + 0x479ab41du) + (RandState << 8);
- RandState = (RandState ^ 0xe4aa10ceu) ^ (RandState >> 5);
- RandState = (RandState + 0x9942f0a6u) - (RandState << 14);
- RandState = (RandState ^ 0x5aedd67du) ^ (RandState >> 3);
- RandState = (RandState + 0x17bea992u) + (RandState << 7);
-}
-
-// =======================================================================
-// function : RandInt
-// purpose : Generates integer using Xorshift algorithm by G. Marsaglia
-// =======================================================================
-uint RandInt()
-{
- RandState ^= (RandState << 13);
- RandState ^= (RandState >> 17);
- RandState ^= (RandState << 5);
-
- return RandState;
-}
-
-// =======================================================================
-// function : RandFloat
-// purpose : Generates a random float in 0 <= x < 1 range
-// =======================================================================
-float RandFloat()
-{
- return float (RandInt()) * (1.f / 4294967296.f);
-}
-
-// =======================================================================
-// function : MatrixColMultiplyPnt
-// purpose : Multiplies a vector by matrix
-// =======================================================================
-vec3 MatrixColMultiplyPnt (in vec3 v,
- in vec4 m0,
- in vec4 m1,
- in vec4 m2,
- in vec4 m3)
-{
- return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z + m3.x,
- m0.y * v.x + m1.y * v.y + m2.y * v.z + m3.y,
- m0.z * v.x + m1.z * v.y + m2.z * v.z + m3.z);
-}
-
-// =======================================================================
-// function : MatrixColMultiplyDir
-// purpose : Multiplies a vector by matrix
-// =======================================================================
-vec3 MatrixColMultiplyDir (in vec3 v,
- in vec4 m0,
- in vec4 m1,
- in vec4 m2)
-{
- return vec3 (m0.x * v.x + m1.x * v.y + m2.x * v.z,
- m0.y * v.x + m1.y * v.y + m2.y * v.z,
- m0.z * v.x + m1.z * v.y + m2.z * v.z);
-}
-
-//=======================================================================
-// function : InverseDirection
-// purpose : Returns safely inverted direction of the given one
-//=======================================================================
-vec3 InverseDirection (in vec3 theInput)
-{
- vec3 anInverse = 1.f / max (abs (theInput), SMALL);
-
- return mix (-anInverse, anInverse, step (ZERO, theInput));
-}
-
-//=======================================================================
-// function : BackgroundColor
-// purpose : Returns color of gradient background
-//=======================================================================
-vec4 BackgroundColor()
-{
-#ifdef ADAPTIVE_SAMPLING_ATOMIC
-
- ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
-
- ivec2 aTileXY = imageLoad (uOffsetImage, aFragCoord / uTileSize).xy * uTileSize;
-
- aTileXY.y += aFragCoord.y % min (uWinSizeY - aTileXY.y, uTileSize.y);
-
- return mix (uBackColorBot, uBackColorTop, float (aTileXY.y) / uWinSizeY);
-
-#else
-
- return mix (uBackColorBot, uBackColorTop, vPixel.y);
-
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Functions for compute ray-object intersection
-
-//=======================================================================
-// function : sampleUniformDisk
-// purpose :
-//=======================================================================
-vec2 sampleUniformDisk ()
-{
- vec2 aPoint;
-
- float aKsi1 = 2.f * RandFloat () - 1.f;
- float aKsi2 = 2.f * RandFloat () - 1.f;
-
- if (aKsi1 > -aKsi2)
- {
- if (aKsi1 > aKsi2)
- aPoint = vec2 (aKsi1, (M_PI / 4.f) * (0.f + aKsi2 / aKsi1));
- else
- aPoint = vec2 (aKsi2, (M_PI / 4.f) * (2.f - aKsi1 / aKsi2));
- }
- else
- {
- if (aKsi1 < aKsi2)
- aPoint = vec2 (-aKsi1, (M_PI / 4.f) * (4.f + aKsi2 / aKsi1));
- else
- aPoint = vec2 (-aKsi2, (M_PI / 4.f) * (6.f - aKsi1 / aKsi2));
- }
-
- return vec2 (sin (aPoint.y), cos (aPoint.y)) * aPoint.x;
-}
-
-// =======================================================================
-// function : GenerateRay
-// purpose :
-// =======================================================================
-SRay GenerateRay (in vec2 thePixel)
-{
-#ifndef DEPTH_OF_FIELD
-
- vec3 aP0 = mix (uOriginLB, uOriginRB, thePixel.x);
- vec3 aP1 = mix (uOriginLT, uOriginRT, thePixel.x);
-
- vec3 aD0 = mix (uDirectLB, uDirectRB, thePixel.x);
- vec3 aD1 = mix (uDirectLT, uDirectRT, thePixel.x);
-
- vec3 aDirection = normalize (mix (aD0, aD1, thePixel.y));
-
- return SRay (mix (aP0, aP1, thePixel.y), aDirection);
-
-#else
-
- vec2 aPixel = uEyeSize * (thePixel - vec2 (0.5f)) * 2.f;
-
- vec2 aAperturePnt = sampleUniformDisk () * uApertureRadius;
-
- vec3 aLocalDir = normalize (vec3 (
- aPixel * uFocalPlaneDist - aAperturePnt, uFocalPlaneDist));
-
- vec3 aOrigin = uEyeOrig +
- uEyeSide * aAperturePnt.x +
- uEyeVert * aAperturePnt.y;
-
- vec3 aDirect = uEyeView * aLocalDir.z +
- uEyeSide * aLocalDir.x +
- uEyeVert * aLocalDir.y;
-
- return SRay (aOrigin, aDirect);
-
-#endif
-}
-
-// =======================================================================
-// function : IntersectSphere
-// purpose : Computes ray-sphere intersection
-// =======================================================================
-float IntersectSphere (in SRay theRay, in float theRadius)
-{
- float aDdotD = dot (theRay.Direct, theRay.Direct);
- float aDdotO = dot (theRay.Direct, theRay.Origin);
- float aOdotO = dot (theRay.Origin, theRay.Origin);
-
- float aD = aDdotO * aDdotO - aDdotD * (aOdotO - theRadius * theRadius);
-
- if (aD > 0.0f)
- {
- float aTime = (sqrt (aD) - aDdotO) * (1.0f / aDdotD);
-
- return aTime > 0.0f ? aTime : MAXFLOAT;
- }
-
- return MAXFLOAT;
-}
-
-// =======================================================================
-// function : IntersectTriangle
-// purpose : Computes ray-triangle intersection (branchless version)
-// =======================================================================
-void IntersectTriangle (in SRay theRay,
- in vec3 thePnt0,
- in vec3 thePnt1,
- in vec3 thePnt2,
- out vec3 theUVT,
- out vec3 theNorm)
-{
- vec3 aToTrg = thePnt0 - theRay.Origin;
-
- vec3 aEdge0 = thePnt1 - thePnt0;
- vec3 aEdge1 = thePnt0 - thePnt2;
-
- theNorm = cross (aEdge1, aEdge0);
-
- vec3 theVect = cross (theRay.Direct, aToTrg);
-
- theUVT = vec3 (dot (theNorm, aToTrg),
- dot (theVect, aEdge1),
- dot (theVect, aEdge0)) * (1.f / dot (theNorm, theRay.Direct));
-
- theUVT.x = any (lessThan (theUVT, ZERO)) || (theUVT.y + theUVT.z) > 1.f ? MAXFLOAT : theUVT.x;
-}
-
-#define EMPTY_ROOT ivec4(0)
-
-//! Utility structure containing information about
-//! currently traversing sub-tree of scene's BVH.
-struct SSubTree
-{
- //! Transformed ray.
- SRay TrsfRay;
-
- //! Inversed ray direction.
- vec3 Inverse;
-
- //! Parameters of sub-root node.
- ivec4 SubData;
-};
-
-#define MATERIAL_AMBN(index) (19 * index + 0)
-#define MATERIAL_DIFF(index) (19 * index + 1)
-#define MATERIAL_SPEC(index) (19 * index + 2)
-#define MATERIAL_EMIS(index) (19 * index + 3)
-#define MATERIAL_REFL(index) (19 * index + 4)
-#define MATERIAL_REFR(index) (19 * index + 5)
-#define MATERIAL_TRAN(index) (19 * index + 6)
-#define MATERIAL_TRS1(index) (19 * index + 7)
-#define MATERIAL_TRS2(index) (19 * index + 8)
-#define MATERIAL_TRS3(index) (19 * index + 9)
-
-#define TRS_OFFSET(treelet) treelet.SubData.x
-#define BVH_OFFSET(treelet) treelet.SubData.y
-#define VRT_OFFSET(treelet) treelet.SubData.z
-#define TRG_OFFSET(treelet) treelet.SubData.w
-
-//! Identifies the absence of intersection.
-#define INVALID_HIT ivec4 (-1)
-
-//! Global stack shared between traversal functions.
-int Stack[STACK_SIZE];
-
-// =======================================================================
-// function : pop
-// purpose :
-// =======================================================================
-int pop (inout int theHead)
-{
- int aData = Stack[theHead];
-
- int aMask = aData >> 26;
- int aNode = aMask & 0x3;
-
- aMask >>= 2;
-
- if ((aMask & 0x3) == aNode)
- {
- --theHead;
- }
- else
- {
- aMask |= (aMask << 2) & 0x30;
-
- Stack[theHead] = (aData & 0x03FFFFFF) | (aMask << 26);
- }
-
- return (aData & 0x03FFFFFF) + aNode;
-}
-
-// =======================================================================
-// function : SceneNearestHit
-// purpose : Finds intersection with nearest scene triangle
-// =======================================================================
-STriangle SceneNearestHit (in SRay theRay, in vec3 theInverse, inout SIntersect theHit, out int theTrsfId)
-{
- STriangle aTriangle = STriangle (INVALID_HIT, vec3[](vec3(0.0), vec3(0.0), vec3(0.0)));
-
- int aNode = 0; // node to traverse
- int aHead = -1; // pointer of stack
- int aStop = -1; // BVH level switch
-
- SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
-
- for (bool toContinue = true; toContinue; /* none */)
- {
- ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);
-
- if (aData.x == 0) // if inner node
- {
- aData.y += BVH_OFFSET (aSubTree);
-
- vec4 aHitTimes = vec4 (MAXFLOAT,
- MAXFLOAT,
- MAXFLOAT,
- MAXFLOAT);
-
- vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;
-
- vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
-
- vec3 aTimeMax = max (aNodeMin0, aNodeMax0);
- vec3 aTimeMin = min (aNodeMin0, aNodeMax0);
-
- float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin1, aNodeMax1);
- aTimeMin = min (aNodeMin1, aNodeMax1);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin2, aNodeMax2);
- aTimeMin = min (aNodeMin2, aNodeMax2);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin3, aNodeMax3);
- aTimeMin = min (aNodeMin3, aNodeMax3);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;
-
- ivec4 aChildren = ivec4 (0, 1, 2, 3);
-
- aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;
- aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;
- aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;
- aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;
- aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;
- aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;
- aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;
- aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;
- aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;
- aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;
-
- if (aHitTimes.x != MAXFLOAT)
- {
- int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2
- | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);
-
- if (aHitTimes.y != MAXFLOAT)
- Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;
-
- aNode = aData.y + aChildren.x;
- }
- else
- {
- toContinue = (aHead >= 0);
-
- if (aHead == aStop) // go to top-level BVH
- {
- aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
- }
-
- if (aHead >= 0)
- aNode = pop (aHead);
- }
- }
- else if (aData.x < 0) // leaf node (contains triangles)
- {
- vec3 aNormal;
- vec3 aTimeUV;
-
- for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)
- {
- ivec4 aTriIndex = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));
- vec3 aPoints[3];
-
- aPoints[0] = texelFetch (uGeometryVertexTexture, aTriIndex.x += VRT_OFFSET (aSubTree)).xyz;
- aPoints[1] = texelFetch (uGeometryVertexTexture, aTriIndex.y += VRT_OFFSET (aSubTree)).xyz;
- aPoints[2] = texelFetch (uGeometryVertexTexture, aTriIndex.z += VRT_OFFSET (aSubTree)).xyz;
-
- IntersectTriangle (aSubTree.TrsfRay, aPoints[0], aPoints[1], aPoints[2], aTimeUV, aNormal);
-
- if (aTimeUV.x < theHit.Time)
- {
- aTriangle.TriIndex = aTriIndex;
- for (int i = 0; i < 3; ++i)
- {
- aTriangle.Points[i] = aPoints[i];
- }
-
- theTrsfId = TRS_OFFSET (aSubTree);
-
- theHit = SIntersect (aTimeUV.x, aTimeUV.yz, aNormal);
- }
- }
-
- toContinue = (aHead >= 0);
-
- if (aHead == aStop) // go to top-level BVH
- {
- aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
- }
-
- if (aHead >= 0)
- aNode = pop (aHead);
- }
- else if (aData.x > 0) // switch node
- {
- aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root
-
- vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);
- vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);
- vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);
- vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);
-
- aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,
- aInvTransf0,
- aInvTransf1,
- aInvTransf2);
-
- aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) /
- max (abs (aSubTree.TrsfRay.Direct), SMALL);
-
- aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,
- aInvTransf0,
- aInvTransf1,
- aInvTransf2,
- aInvTransf3);
-
- aNode = BVH_OFFSET (aSubTree); // go to sub-root node
-
- aStop = aHead; // store current stack pointer
- }
- }
-
- return aTriangle;
-}
-
-// =======================================================================
-// function : SceneAnyHit
-// purpose : Finds intersection with any scene triangle
-// =======================================================================
-float SceneAnyHit (in SRay theRay, in vec3 theInverse, in float theDistance)
-{
- float aFactor = 1.f;
-
- int aNode = 0; // node to traverse
- int aHead = -1; // pointer of stack
- int aStop = -1; // BVH level switch
-
- SSubTree aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
-
- for (bool toContinue = true; toContinue; /* none */)
- {
- ivec4 aData = texelFetch (uSceneNodeInfoTexture, aNode);
-
- if (aData.x == 0) // if inner node
- {
- aData.y += BVH_OFFSET (aSubTree);
-
- vec4 aHitTimes = vec4 (MAXFLOAT,
- MAXFLOAT,
- MAXFLOAT,
- MAXFLOAT);
-
- vec3 aRayOriginInverse = -aSubTree.TrsfRay.Origin * aSubTree.Inverse;
-
- vec3 aNodeMin0 = texelFetch (uSceneMinPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin1 = texelFetch (uSceneMinPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin2 = texelFetch (uSceneMinPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMin3 = texelFetch (uSceneMinPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax0 = texelFetch (uSceneMaxPointTexture, aData.y + 0).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax1 = texelFetch (uSceneMaxPointTexture, aData.y + 1).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax2 = texelFetch (uSceneMaxPointTexture, aData.y + min (2, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
- vec3 aNodeMax3 = texelFetch (uSceneMaxPointTexture, aData.y + min (3, aData.z)).xyz * aSubTree.Inverse + aRayOriginInverse;
-
- vec3 aTimeMax = max (aNodeMin0, aNodeMax0);
- vec3 aTimeMin = min (aNodeMin0, aNodeMax0);
-
- float aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- float aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin1, aNodeMax1);
- aTimeMin = min (aNodeMin1, aNodeMax1);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin2, aNodeMax2);
- aTimeMin = min (aNodeMin2, aNodeMax2);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;
-
- aTimeMax = max (aNodeMin3, aNodeMax3);
- aTimeMin = min (aNodeMin3, aNodeMax3);
-
- aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));
- aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));
-
- aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;
-
- ivec4 aChildren = ivec4 (0, 1, 2, 3);
-
- aChildren.xy = aHitTimes.y < aHitTimes.x ? aChildren.yx : aChildren.xy;
- aHitTimes.xy = aHitTimes.y < aHitTimes.x ? aHitTimes.yx : aHitTimes.xy;
- aChildren.zw = aHitTimes.w < aHitTimes.z ? aChildren.wz : aChildren.zw;
- aHitTimes.zw = aHitTimes.w < aHitTimes.z ? aHitTimes.wz : aHitTimes.zw;
- aChildren.xz = aHitTimes.z < aHitTimes.x ? aChildren.zx : aChildren.xz;
- aHitTimes.xz = aHitTimes.z < aHitTimes.x ? aHitTimes.zx : aHitTimes.xz;
- aChildren.yw = aHitTimes.w < aHitTimes.y ? aChildren.wy : aChildren.yw;
- aHitTimes.yw = aHitTimes.w < aHitTimes.y ? aHitTimes.wy : aHitTimes.yw;
- aChildren.yz = aHitTimes.z < aHitTimes.y ? aChildren.zy : aChildren.yz;
- aHitTimes.yz = aHitTimes.z < aHitTimes.y ? aHitTimes.zy : aHitTimes.yz;
-
- if (aHitTimes.x != MAXFLOAT)
- {
- int aHitMask = (aHitTimes.w != MAXFLOAT ? aChildren.w : aChildren.z) << 2
- | (aHitTimes.z != MAXFLOAT ? aChildren.z : aChildren.y);
-
- if (aHitTimes.y != MAXFLOAT)
- Stack[++aHead] = aData.y | (aHitMask << 2 | aChildren.y) << 26;
-
- aNode = aData.y + aChildren.x;
- }
- else
- {
- toContinue = (aHead >= 0);
-
- if (aHead == aStop) // go to top-level BVH
- {
- aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
- }
-
- if (aHead >= 0)
- aNode = pop (aHead);
- }
- }
- else if (aData.x < 0) // leaf node
- {
- vec3 aNormal;
- vec3 aTimeUV;
-
- for (int anIdx = aData.y; anIdx <= aData.z; ++anIdx)
- {
- ivec4 aTriangle = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));
-
- vec3 aPoint0 = texelFetch (uGeometryVertexTexture, aTriangle.x += VRT_OFFSET (aSubTree)).xyz;
- vec3 aPoint1 = texelFetch (uGeometryVertexTexture, aTriangle.y += VRT_OFFSET (aSubTree)).xyz;
- vec3 aPoint2 = texelFetch (uGeometryVertexTexture, aTriangle.z += VRT_OFFSET (aSubTree)).xyz;
-
- IntersectTriangle (aSubTree.TrsfRay, aPoint0, aPoint1, aPoint2, aTimeUV, aNormal);
-
-#ifdef TRANSPARENT_SHADOWS
- if (aTimeUV.x < theDistance)
- {
- aFactor *= 1.f - texelFetch (uRaytraceMaterialTexture, MATERIAL_TRAN (aTriangle.w)).x;
- }
-#else
- if (aTimeUV.x < theDistance)
- {
- aFactor = 0.f;
- }
-#endif
- }
-
- toContinue = (aHead >= 0) && (aFactor > 0.1f);
-
- if (aHead == aStop) // go to top-level BVH
- {
- aStop = -1; aSubTree = SSubTree (theRay, theInverse, EMPTY_ROOT);
- }
-
- if (aHead >= 0)
- aNode = pop (aHead);
- }
- else if (aData.x > 0) // switch node
- {
- aSubTree.SubData = ivec4 (4 * aData.x - 4, aData.yzw); // store BVH sub-root
-
- vec4 aInvTransf0 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 0);
- vec4 aInvTransf1 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 1);
- vec4 aInvTransf2 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 2);
- vec4 aInvTransf3 = texelFetch (uSceneTransformTexture, TRS_OFFSET (aSubTree) + 3);
-
- aSubTree.TrsfRay.Direct = MatrixColMultiplyDir (theRay.Direct,
- aInvTransf0,
- aInvTransf1,
- aInvTransf2);
-
- aSubTree.TrsfRay.Origin = MatrixColMultiplyPnt (theRay.Origin,
- aInvTransf0,
- aInvTransf1,
- aInvTransf2,
- aInvTransf3);
-
- aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) / max (abs (aSubTree.TrsfRay.Direct), SMALL);
-
- aNode = BVH_OFFSET (aSubTree); // go to sub-root node
-
- aStop = aHead; // store current stack pointer
- }
- }
-
- return aFactor;
-}
-
-#define PI 3.1415926f
-
-// =======================================================================
-// function : Latlong
-// purpose : Converts world direction to environment texture coordinates
-// =======================================================================
-vec2 Latlong (in vec3 thePoint, in float theRadius)
-{
- float aPsi = acos (-thePoint.z / theRadius);
-
- float aPhi = atan (thePoint.y, thePoint.x) + PI;
-
- return vec2 (aPhi * 0.1591549f,
- aPsi * 0.3183098f);
-}
-
-#ifdef BACKGROUND_CUBEMAP
-//! Transform texture coordinates for cubemap lookup.
-vec3 cubemapVectorTransform (in vec3 theVec, in float theRadius)
-{
- vec3 aVec = theVec.yzx;
- aVec.y *= float(uYCoeff);
- aVec.z *= float(uZCoeff);
- return aVec;
-}
-#endif
-
-// =======================================================================
-// function : SmoothNormal
-// purpose : Interpolates normal across the triangle
-// =======================================================================
-vec3 SmoothNormal (in vec2 theUV, in ivec4 theTriangle)
-{
- vec3 aNormal0 = texelFetch (uGeometryNormalTexture, theTriangle.x).xyz;
- vec3 aNormal1 = texelFetch (uGeometryNormalTexture, theTriangle.y).xyz;
- vec3 aNormal2 = texelFetch (uGeometryNormalTexture, theTriangle.z).xyz;
-
- return normalize (aNormal1 * theUV.x +
- aNormal2 * theUV.y +
- aNormal0 * (1.0f - theUV.x - theUV.y));
-}
-
-#define POLYGON_OFFSET_UNIT 0.f
-#define POLYGON_OFFSET_FACTOR 1.f
-#define POLYGON_OFFSET_SCALE 0.006f
-
-// =======================================================================
-// function : PolygonOffset
-// purpose : Computes OpenGL polygon offset
-// =======================================================================
-float PolygonOffset (in vec3 theNormal, in vec3 thePoint)
-{
- vec4 aProjectedNorm = vec4 (theNormal, -dot (theNormal, thePoint)) * uUnviewMat;
-
- float aPolygonOffset = POLYGON_OFFSET_UNIT;
-
- if (aProjectedNorm.z * aProjectedNorm.z > 1e-20f)
- {
- aProjectedNorm.xy *= 1.f / aProjectedNorm.z;
-
- aPolygonOffset += POLYGON_OFFSET_FACTOR * max (abs (aProjectedNorm.x),
- abs (aProjectedNorm.y));
- }
-
- return aPolygonOffset;
-}
-
-// =======================================================================
-// function : SmoothUV
-// purpose : Interpolates UV coordinates across the triangle
-// =======================================================================
-#ifdef USE_TEXTURES
-vec2 SmoothUV (in vec2 theUV, in ivec4 theTriangle, out vec2[3] theUVs)
-{
- theUVs[0] = texelFetch (uGeometryTexCrdTexture, theTriangle.x).st;
- theUVs[1] = texelFetch (uGeometryTexCrdTexture, theTriangle.y).st;
- theUVs[2] = texelFetch (uGeometryTexCrdTexture, theTriangle.z).st;
-
- return theUVs[1] * theUV.x +
- theUVs[2] * theUV.y +
- theUVs[0] * (1.0f - theUV.x - theUV.y);
-}
-
-vec2 SmoothUV (in vec2 theUV, in ivec4 theTriangle)
-{
- vec2 aUVs[3];
- return SmoothUV (theUV, theTriangle, aUVs);
-}
-#endif
-
-// =======================================================================
-// function : FetchEnvironment
-// purpose :
-// =======================================================================
-vec4 FetchEnvironment (in vec3 theTexCoord, in float theRadius, in bool theIsBackground)
-{
- if (uEnvMapEnabled == 0)
- {
-#ifdef PATH_TRACING
- return theIsBackground ? vec4 (0.0, 0.0, 0.0, 1.0) : uGlobalAmbient;
-#else
- return vec4 (0.0, 0.0, 0.0, 1.0);
-#endif
- }
-
- vec4 anAmbScale = theIsBackground ? vec4(1.0) : uGlobalAmbient;
- vec4 anEnvColor =
-#ifdef BACKGROUND_CUBEMAP
- textureLod (uEnvMapTexture, cubemapVectorTransform (theTexCoord, theRadius), 0.0);
-#else
- textureLod (uEnvMapTexture, Latlong (theTexCoord, theRadius), 0.0);
-#endif
- return anEnvColor * anAmbScale;
-}
-
-// =======================================================================
-// function : Refract
-// purpose : Computes refraction ray (also handles TIR)
-// =======================================================================
-#ifndef PATH_TRACING
-vec3 Refract (in vec3 theInput,
- in vec3 theNormal,
- in float theRefractIndex,
- in float theInvRefractIndex)
-{
- float aNdotI = dot (theInput, theNormal);
-
- float anIndex = aNdotI < 0.0f
- ? theInvRefractIndex
- : theRefractIndex;
-
- float aSquare = anIndex * anIndex * (1.0f - aNdotI * aNdotI);
-
- if (aSquare > 1.0f)
- {
- return reflect (theInput, theNormal);
- }
-
- float aNdotT = sqrt (1.0f - aSquare);
-
- return normalize (anIndex * theInput -
- (anIndex * aNdotI + (aNdotI < 0.0f ? aNdotT : -aNdotT)) * theNormal);
-}
-#endif
-
-#define MIN_SLOPE 0.0001f
-#define EPS_SCALE 8.0000f
-
-#define THRESHOLD vec3 (0.1f)
-
-#define INVALID_BOUNCES 1000
-
-#define LIGHT_POS(index) (2 * index + 1)
-#define LIGHT_PWR(index) (2 * index + 0)
-
-// =======================================================================
-// function : Radiance
-// purpose : Computes color along the given ray
-// =======================================================================
-#ifndef PATH_TRACING
-vec4 Radiance (in SRay theRay, in vec3 theInverse)
-{
- vec3 aResult = vec3 (0.0f);
- vec4 aWeight = vec4 (1.0f);
-
- int aTrsfId;
-
- float aRaytraceDepth = MAXFLOAT;
- float aRefractionIdx = 0.0;
-
- for (int aDepth = 0; aDepth < NB_BOUNCES; ++aDepth)
- {
- SIntersect aHit = SIntersect (MAXFLOAT, vec2 (ZERO), ZERO);
-
- ivec4 aTriIndex = SceneNearestHit (theRay, theInverse, aHit, aTrsfId).TriIndex;
-
- if (aTriIndex.x == -1)
- {
- vec4 aColor = vec4 (0.0);
-
- if (bool(uEnvMapForBack) || aWeight.w == 0.0 /* reflection */)
- {
- float aRadius = uSceneRadius;
- vec3 aTexCoord = vec3 (0.0);
-
- if (aDepth == 0 || (aRefractionIdx == 1.0 && aWeight.w != 0.0))
- {
- vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;
- vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;
- vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));
- vec3 aDirect = uEyeView * aLocalDir.z +
- uEyeSide * aLocalDir.x +
- uEyeVert * aLocalDir.y;
-
- aTexCoord = aDirect * uSceneRadius;
- aRadius = length (aTexCoord);
- }
- else
- {
- float aTime = IntersectSphere (theRay, uSceneRadius);
- aTexCoord = theRay.Direct * aTime + theRay.Origin;
- }
-
- aColor = FetchEnvironment (aTexCoord, aRadius, aWeight.w != 0.0);
- }
- else
- {
- aColor = BackgroundColor();
- }
-
- aResult += aWeight.xyz * aColor.xyz; aWeight.w *= aColor.w;
-
- break; // terminate path
- }
-
- vec3 aInvTransf0 = texelFetch (uSceneTransformTexture, aTrsfId + 0).xyz;
- vec3 aInvTransf1 = texelFetch (uSceneTransformTexture, aTrsfId + 1).xyz;
- vec3 aInvTransf2 = texelFetch (uSceneTransformTexture, aTrsfId + 2).xyz;
-
- aHit.Normal = normalize (vec3 (dot (aInvTransf0, aHit.Normal),
- dot (aInvTransf1, aHit.Normal),
- dot (aInvTransf2, aHit.Normal)));
-
- theRay.Origin += theRay.Direct * aHit.Time; // intersection point
-
- // Evaluate depth on first hit
- if (aDepth == 0)
- {
- vec4 aNDCPoint = uViewMat * vec4 (theRay.Origin, 1.f);
-
- float aPolygonOffset = PolygonOffset (aHit.Normal, theRay.Origin);
- #ifdef THE_ZERO_TO_ONE_DEPTH
- aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);
- #else
- aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;
- #endif
- }
-
- vec3 aNormal = SmoothNormal (aHit.UV, aTriIndex);
-
- aNormal = normalize (vec3 (dot (aInvTransf0, aNormal),
- dot (aInvTransf1, aNormal),
- dot (aInvTransf2, aNormal)));
-
- vec3 aAmbient = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_AMBN (aTriIndex.w)).rgb;
- vec4 aDiffuse = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_DIFF (aTriIndex.w));
- vec4 aSpecular = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_SPEC (aTriIndex.w));
- vec4 aOpacity = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_TRAN (aTriIndex.w));
-
-#ifdef USE_TEXTURES
- if (aDiffuse.w >= 0.f)
- {
- vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriIndex), 0.f, 1.f);
-
- vec4 aTrsfRow1 = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriIndex.w));
- vec4 aTrsfRow2 = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriIndex.w));
-
- aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),
- dot (aTrsfRow2, aTexCoord));
-
- vec4 aTexColor = textureLod (
- sampler2D (uTextureSamplers[int(aDiffuse.w)]), aTexCoord.st, 0.f);
-
- aDiffuse.rgb *= aTexColor.rgb;
- aAmbient.rgb *= aTexColor.rgb;
-
- // keep refractive index untouched (Z component)
- aOpacity.xy = vec2 (aTexColor.w * aOpacity.x, 1.0f - aTexColor.w * aOpacity.x);
- }
-#endif
-
- vec3 aEmission = texelFetch (
- uRaytraceMaterialTexture, MATERIAL_EMIS (aTriIndex.w)).rgb;
-
- float aGeomFactor = dot (aNormal, theRay.Direct);
-
- aResult.xyz += aWeight.xyz * aOpacity.x * (
- uGlobalAmbient.xyz * aAmbient * max (abs (aGeomFactor), 0.5f) + aEmission);
-
- vec3 aSidedNormal = mix (aNormal, -aNormal, step (0.0f, aGeomFactor));
-
- for (int aLightIdx = 0; aLightIdx < uLightCount; ++aLightIdx)
- {
- vec4 aLight = texelFetch (
- uRaytraceLightSrcTexture, LIGHT_POS (aLightIdx));
-
- float aDistance = MAXFLOAT;
-
- if (aLight.w != 0.0f) // point light source
- {
- aDistance = length (aLight.xyz -= theRay.Origin);
-
- aLight.xyz *= 1.0f / aDistance;
- }
-
- float aLdotN = dot (aLight.xyz, aSidedNormal);
-
- if (aLdotN > 0.0f) // first check if light source is important
- {
- float aVisibility = 1.0f;
-
- if (bool(uShadowsEnabled))
- {
- SRay aShadow = SRay (theRay.Origin, aLight.xyz);
-
- aShadow.Origin += uSceneEpsilon * (aLight.xyz +
- mix (-aHit.Normal, aHit.Normal, step (0.0f, dot (aHit.Normal, aLight.xyz))));
-
- vec3 aInverse = 1.0f / max (abs (aLight.xyz), SMALL);
-
- aVisibility = SceneAnyHit (
- aShadow, mix (-aInverse, aInverse, step (ZERO, aLight.xyz)), aDistance);
- }
-
- if (aVisibility > 0.0f)
- {
- vec3 aIntensity = min (UNIT, vec3 (texelFetch (
- uRaytraceLightSrcTexture, LIGHT_PWR (aLightIdx))));
-
- float aRdotV = dot (reflect (aLight.xyz, aSidedNormal), theRay.Direct);
-
- aResult.xyz += aWeight.xyz * (aOpacity.x * aVisibility) * aIntensity *
- (aDiffuse.xyz * aLdotN + aSpecular.xyz * pow (max (0.f, aRdotV), aSpecular.w));
- }
- }
- }
-
- if (aOpacity.x != 1.0f)
- {
- aWeight *= aOpacity.y;
- aRefractionIdx = aOpacity.z;
-
- if (aOpacity.z != 1.0f)
- {
- theRay.Direct = Refract (theRay.Direct, aNormal, aOpacity.z, aOpacity.w);
- }
- }
- else
- {
- aWeight *= bool(uReflectEnabled) ?
- texelFetch (uRaytraceMaterialTexture, MATERIAL_REFL (aTriIndex.w)) : vec4 (0.0f);
-
- vec3 aReflect = reflect (theRay.Direct, aNormal);
-
- if (dot (aReflect, aHit.Normal) * dot (theRay.Direct, aHit.Normal) > 0.0f)
- {
- aReflect = reflect (theRay.Direct, aHit.Normal);
- }
-
- theRay.Direct = aReflect;
- }
-
- if (all (lessThanEqual (aWeight.xyz, THRESHOLD)))
- {
- aDepth = INVALID_BOUNCES;
- }
- else if (aOpacity.x == 1.0f || aOpacity.z != 1.0f) // if no simple transparency
- {
- theRay.Origin += aHit.Normal * mix (
- -uSceneEpsilon, uSceneEpsilon, step (0.0f, dot (aHit.Normal, theRay.Direct)));
-
- theInverse = 1.0f / max (abs (theRay.Direct), SMALL);
-
- theInverse = mix (-theInverse, theInverse, step (ZERO, theRay.Direct));
- }
-
- theRay.Origin += theRay.Direct * uSceneEpsilon;
- }
-
- gl_FragDepth = aRaytraceDepth;
-
- return vec4 (aResult.x,
- aResult.y,
- aResult.z,
- aWeight.w);
-}
-#endif
+++ /dev/null
-in vec4 occVertex;
-
-//! Normalized pixel coordinates.
-out vec2 vPixel;
-
-void main (void)
-{
- vPixel = vec2 ((occVertex.x + 1.f) * 0.5f,
- (occVertex.y + 1.f) * 0.5f);
-
- gl_Position = occVertex;
-}
+++ /dev/null
-out vec4 OutColor;
-
-// Seed for random number generator (generated on CPU).
-uniform int uFrameRndSeed;
-
-//! Enables/disables using of single RNG seed for 16x16 image
-//! blocks. Increases performance up to 4x, but the noise has
-//! become structured. Can be used fo final rendering.
-uniform int uBlockedRngEnabled;
-
-//! Number of previously rendered frames (used in non-ISS mode).
-uniform int uAccumSamples;
-
-#ifndef ADAPTIVE_SAMPLING
- //! Input image with previously accumulated samples.
- uniform sampler2D uAccumTexture;
-#endif
-
-//! Maximum radiance that can be added to the pixel.
-//! Decreases noise level, but introduces some bias.
-uniform float uMaxRadiance;
-
-#ifdef ADAPTIVE_SAMPLING
-//! Wrapper over imageLoad()+imageStore() having similar syntax as imageAtomicAdd().
-//! Modifies one component of 3Wx2H uRenderImage:
-//! |RGL| Red, Green, Luminance
-//! |SBH| Samples, Blue, Hit time transformed into OpenGL NDC space
-//! Returns previous value of the component.
-float addRenderImageComp (in ivec2 theFrag, in ivec2 theComp, in float theVal)
-{
- ivec2 aCoord = ivec2 (3 * theFrag.x + theComp.x,
- 2 * theFrag.y + theComp.y);
-#ifdef ADAPTIVE_SAMPLING_ATOMIC
- return imageAtomicAdd (uRenderImage, aCoord, theVal);
-#else
- float aVal = imageLoad (uRenderImage, aCoord).x;
- imageStore (uRenderImage, aCoord, vec4 (aVal + theVal));
- return aVal;
-#endif
-}
-#endif
-
-// =======================================================================
-// function : main
-// purpose :
-// =======================================================================
-void main (void)
-{
- SeedRand (uFrameRndSeed, uWinSizeX, uBlockedRngEnabled == 0 ? 1 : 16);
-
-#ifndef PATH_TRACING
-
- SRay aRay = GenerateRay (vPixel);
-
-#else
-
- ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
-
-#ifdef ADAPTIVE_SAMPLING
-
-#ifdef ADAPTIVE_SAMPLING_ATOMIC
- ivec2 aTileXY = imageLoad (uOffsetImage, aFragCoord / uTileSize).xy * uTileSize;
- if (aTileXY.x < 0) { discard; }
-
- ivec2 aRealBlockSize = ivec2 (min (uWinSizeX - aTileXY.x, uTileSize.x),
- min (uWinSizeY - aTileXY.y, uTileSize.y));
-
- aFragCoord.x = aTileXY.x + (aFragCoord.x % aRealBlockSize.x);
- aFragCoord.y = aTileXY.y + (aFragCoord.y % aRealBlockSize.y);
-#else
- int aNbTileSamples = imageAtomicAdd (uTilesImage, aFragCoord / uTileSize, int(-1));
- if (aNbTileSamples <= 0)
- {
- discard;
- }
-#endif
-
-#endif // ADAPTIVE_SAMPLING
-
- vec2 aPnt = vec2 (float(aFragCoord.x) + RandFloat(),
- float(aFragCoord.y) + RandFloat());
-
- SRay aRay = GenerateRay (aPnt / vec2 (uWinSizeX, uWinSizeY));
-
-#endif // PATH_TRACING
-
- vec3 aInvDirect = InverseDirection (aRay.Direct);
-
-#ifdef PATH_TRACING
-
-#ifndef ADAPTIVE_SAMPLING
- vec4 aColor = PathTrace (aRay, aInvDirect, uAccumSamples);
-#else
- float aNbSamples = addRenderImageComp (aFragCoord, ivec2 (0, 1), 1.0);
- vec4 aColor = PathTrace (aRay, aInvDirect, int (aNbSamples));
-#endif
-
- if (any (isnan (aColor.rgb)))
- {
- aColor.rgb = ZERO;
- }
- aColor.rgb = min (aColor.rgb, vec3 (uMaxRadiance));
-
-#ifdef ADAPTIVE_SAMPLING
-
- // accumulate RGB color and depth
- addRenderImageComp (aFragCoord, ivec2 (0, 0), aColor.r);
- addRenderImageComp (aFragCoord, ivec2 (1, 0), aColor.g);
- addRenderImageComp (aFragCoord, ivec2 (1, 1), aColor.b);
- addRenderImageComp (aFragCoord, ivec2 (2, 1), aColor.w);
- if (int (aNbSamples) % 2 == 0) // accumulate luminance for even samples only
- {
- addRenderImageComp (aFragCoord, ivec2 (2, 0), dot (LUMA, aColor.rgb));
- }
-
-#else
-
- if (uAccumSamples == 0)
- {
- OutColor = aColor;
- }
- else
- {
- OutColor = mix (texture (uAccumTexture, vPixel), aColor, 1.0 / float(uAccumSamples + 1));
- }
-
-#endif // ADAPTIVE_SAMPLING
-
-#else
-
- OutColor = clamp (Radiance (aRay, aInvDirect), 0.f, 1.f);
-
-#endif // PATH_TRACING
-}
+++ /dev/null
-//! Input ray-traced image.
-uniform sampler2D uFSAAInputTexture;
-
-//! Number of accumulated FSAA samples.
-uniform int uSamples;
-
-//! Output pixel color.
-out vec4 OutColor;
-
-#define LUM_DIFFERENCE 0.085f
-
-// =======================================================================
-// function : main
-// purpose :
-// =======================================================================
-void main (void)
-{
-#ifndef PATH_TRACING
-
- int aPixelX = int (gl_FragCoord.x);
- int aPixelY = int (gl_FragCoord.y);
-
- // Adjust FLIPTRI pattern used for adaptive FSAA
- float anOffsetX = mix (uFsaaOffset.x, -uFsaaOffset.x, float (aPixelX % 2));
- float anOffsetY = mix (uFsaaOffset.y, -uFsaaOffset.y, float (aPixelY % 2));
-
- vec4 aClr0 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 0), 0);
- vec4 aClr1 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY - 1), 0);
- vec4 aClr2 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 0, aPixelY + 1), 0);
-
- vec4 aClr3 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 0), 0);
- vec4 aClr4 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY - 1), 0);
- vec4 aClr5 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX + 1, aPixelY + 1), 0);
-
- vec4 aClr6 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 0), 0);
- vec4 aClr7 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY - 1), 0);
- vec4 aClr8 = texelFetch (uFSAAInputTexture, ivec2 (aPixelX - 1, aPixelY + 1), 0);
-
- float aLum = dot (LUMA, aClr0.xyz);
-
- bool aRender = abs (aClr1.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr2.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr3.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr4.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr5.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr6.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr7.w - aClr0.w) > LUM_DIFFERENCE ||
- abs (aClr8.w - aClr0.w) > LUM_DIFFERENCE;
-
- if (!aRender)
- {
- aRender = abs (dot (LUMA, aClr1.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr2.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr3.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr4.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr5.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr6.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr7.xyz) - aLum) > LUM_DIFFERENCE ||
- abs (dot (LUMA, aClr8.xyz) - aLum) > LUM_DIFFERENCE;
- }
-
- vec4 aColor = aClr0;
-
- if (aRender)
- {
- SRay aRay = GenerateRay (vPixel + vec2 (anOffsetX, anOffsetY));
-
- vec3 aInvDirect = 1.f / max (abs (aRay.Direct), SMALL);
-
- aInvDirect = vec3 (aRay.Direct.x < 0.f ? -aInvDirect.x : aInvDirect.x,
- aRay.Direct.y < 0.f ? -aInvDirect.y : aInvDirect.y,
- aRay.Direct.z < 0.f ? -aInvDirect.z : aInvDirect.z);
-
- aColor = mix (aClr0, clamp (Radiance (aRay, aInvDirect), 0.0, 1.0), 1.0 / float(uSamples));
- }
-
- OutColor = aColor;
-
-#endif
-}
-// This file has been automatically generated from resource file src/Shaders/DeclarationsImpl.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/DeclarationsImpl.glsl
static const char Shaders_DeclarationsImpl_glsl[] =
"\n"
- "//! @file DeclarationsImpl.glsl includes implementation of common functions and properties "
- "accessors\n"
+ "//! @file DeclarationsImpl.glsl includes implementation of common functions and properties accessors\n"
"#if defined(FRAGMENT_SHADER)\n"
"\n"
"#if defined(OCC_DEPTH_PEEL_OIT)\n"
" ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);\n"
" vec2 aLastDepth = texelFetch (occDepthPeelingDepth, aFragCoord, 0).rg;\n"
" occPeelFrontColor = texelFetch (occDepthPeelingFrontColor, aFragCoord, 0);\n"
- // clang-format off
" occPeelDepth.rg = vec2 (THE_DEPTH_CLEAR_VALUE); // depth value always increases, so that MAX blend equation can be used\n"
- // clang-format on
" occPeelBackColor = vec4 (0.0); // back color is blend after each peeling pass\n"
"\n"
" float aNearDepth = -aLastDepth.x;\n"
" if (theColor.a < occAlphaCutoff) discard;\n"
"#endif\n"
"#if defined(OCC_WRITE_WEIGHT_OIT_COVERAGE)\n"
- " float aWeight = theColor.a * clamp (1e+2 * pow (1.0 - gl_FragCoord.z * occOitDepthFactor, "
- "3.0), 1e-2, 1e+2);\n"
+ " float aWeight = theColor.a * clamp (1e+2 * pow (1.0 - gl_FragCoord.z * occOitDepthFactor, 3.0), 1e-2, 1e+2);\n"
" occFragCoverage.r = theColor.a * aWeight;\n"
" occFragColor = vec4 (theColor.rgb * theColor.a * aWeight, theColor.a);\n"
"#elif defined(OCC_DEPTH_PEEL_OIT)\n"
"\n"
"#if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)\n"
"// arrays of light sources\n"
- // clang-format off
"uniform vec4 occLightSources[THE_MAX_LIGHTS * 4]; //!< packed light sources parameters\n"
"uniform THE_PREC_ENUM int occLightSourcesTypes[THE_MAX_LIGHTS]; //!< packed light sources types\n"
- // clang-format on
"#endif\n"
"\n"
"#if defined(THE_IS_PBR)\n"
" vec3 aSHCoeffs[9];\n"
" for (int i = 0; i < 9; ++i)\n"
" {\n"
- " aSHCoeffs[i] = occTexture2D (occDiffIBLMapSHCoeffs, vec2 ((float(i) + 0.5) / 9.0, "
- "0.0)).rgb;\n"
+ " aSHCoeffs[i] = occTexture2D (occDiffIBLMapSHCoeffs, vec2 ((float(i) + 0.5) / 9.0, 0.0)).rgb;\n"
" }\n"
" return aSHCoeffs[0]\n"
"\n"
"uniform vec4 occPbrMaterial[3 * 2];\n"
"\n"
"#define MIN_ROUGHNESS 0.01\n"
- "float occRoughness (in float theNormalizedRoughness) { return theNormalizedRoughness * (1.0 - "
- "MIN_ROUGHNESS) + MIN_ROUGHNESS; }\n"
- "vec4 occPBRMaterial_Color(in bool theIsFront) { return theIsFront ? occPbrMaterial[0] "
- ": occPbrMaterial[3]; }\n"
- "vec3 occPBRMaterial_Emission(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].rgb "
- ": occPbrMaterial[4].rgb; }\n"
- "float occPBRMaterial_IOR(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].w "
- ": occPbrMaterial[4].w; }\n"
- "float occPBRMaterial_Metallic(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].b "
- ": occPbrMaterial[5].b; }\n"
- "float occPBRMaterial_NormalizedRoughness(in bool theIsFront) { return theIsFront ? "
- "occPbrMaterial[2].g : occPbrMaterial[5].g; }\n"
+ "float occRoughness (in float theNormalizedRoughness) { return theNormalizedRoughness * (1.0 - MIN_ROUGHNESS) + MIN_ROUGHNESS; }\n"
+ "vec4 occPBRMaterial_Color(in bool theIsFront) { return theIsFront ? occPbrMaterial[0] : occPbrMaterial[3]; }\n"
+ "vec3 occPBRMaterial_Emission(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].rgb : occPbrMaterial[4].rgb; }\n"
+ "float occPBRMaterial_IOR(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].w : occPbrMaterial[4].w; }\n"
+ "float occPBRMaterial_Metallic(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].b : occPbrMaterial[5].b; }\n"
+ "float occPBRMaterial_NormalizedRoughness(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].g : occPbrMaterial[5].g; }\n"
"#else\n"
"uniform vec4 occCommonMaterial[4 * 2];\n"
"\n"
- "vec4 occMaterial_Diffuse(in bool theIsFront) { return theIsFront ? occCommonMaterial[0] "
- ": occCommonMaterial[4]; }\n"
- "vec3 occMaterial_Emission(in bool theIsFront) { return theIsFront ? occCommonMaterial[1].rgb "
- ": occCommonMaterial[5].rgb; }\n"
- "vec3 occMaterial_Specular(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].rgb "
- ": occCommonMaterial[6].rgb; }\n"
- "float occMaterial_Shininess(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].a "
- ": occCommonMaterial[6].a; }\n"
- "vec3 occMaterial_Ambient(in bool theIsFront) { return theIsFront ? occCommonMaterial[3].rgb "
- ": occCommonMaterial[7].rgb; }\n"
+ "vec4 occMaterial_Diffuse(in bool theIsFront) { return theIsFront ? occCommonMaterial[0] : occCommonMaterial[4]; }\n"
+ "vec3 occMaterial_Emission(in bool theIsFront) { return theIsFront ? occCommonMaterial[1].rgb : occCommonMaterial[5].rgb; }\n"
+ "vec3 occMaterial_Specular(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].rgb : occCommonMaterial[6].rgb; }\n"
+ "float occMaterial_Shininess(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].a : occCommonMaterial[6].a; }\n"
+ "vec3 occMaterial_Ambient(in bool theIsFront) { return theIsFront ? occCommonMaterial[3].rgb : occCommonMaterial[7].rgb; }\n"
"#endif\n"
"\n"
"// 2D texture coordinates transformation\n"
"float occTextureTrsf_RotationSin(void) { return occTexTrsf2d[1].x; }\n"
"float occTextureTrsf_RotationCos(void) { return occTexTrsf2d[1].y; }\n"
"//! @endfile DeclarationsImpl.glsl\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/Declarations.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/Declarations.glsl
static const char Shaders_Declarations_glsl[] =
"\n"
- "//! @file Declarations.glsl includes definition of common uniform variables in OCCT GLSL "
- "programs\n"
+ "//! @file Declarations.glsl includes definition of common uniform variables in OCCT GLSL programs\n"
"//! @def THE_MAX_LIGHTS\n"
"//! Specifies the length of array of lights, which is 8 by default. Defined by Shader Manager.\n"
"// #define THE_MAX_LIGHTS 8\n"
"\n"
"//! @def THE_MAX_CLIP_PLANES\n"
- "//! Specifies the length of array of clipping planes, which is 8 by default. Defined by Shader "
- "Manager.\n"
+ "//! Specifies the length of array of clipping planes, which is 8 by default. Defined by Shader Manager.\n"
"// #define THE_MAX_CLIP_PLANES 8\n"
"\n"
"//! @def THE_NB_FRAG_OUTPUTS\n"
- "//! Specifies the length of array of Fragment Shader outputs, which is 1 by default. Defined by "
- "Shader Manager.\n"
+ "//! Specifies the length of array of Fragment Shader outputs, which is 1 by default. Defined by Shader Manager.\n"
"// #define THE_NB_FRAG_OUTPUTS 1\n"
"\n"
"// compatibility macros\n"
"uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix\n"
"uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix\n"
"\n"
- // clang-format off
"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"
"uniform int occNbSpecIBLLevels; //!< Number of mipmap levels used in occSpecIBLMap to store different roughness values maps\n"
"\n"
"vec3 occDiffIBLMap (in vec3 theNormal); //!< Unpacks spherical harmonics coefficients to diffuse IBL map's values\n"
- // clang-format on
"#endif\n"
"\n"
"// light type enumeration (same as Graphic3d_TypeOfLightSource)\n"
"// Front/back material properties accessors\n"
"vec4 occPBRMaterial_Color(in bool theIsFront); //!< Base color of PBR material\n"
"float occPBRMaterial_Metallic(in bool theIsFront); //!< Metallic coefficient\n"
- // clang-format off
"float occPBRMaterial_NormalizedRoughness(in bool theIsFront); //!< Normalized roughness coefficient\n"
- // clang-format on
"vec3 occPBRMaterial_Emission(in bool theIsFront); //!< Light intensity emitted by material\n"
"float occPBRMaterial_IOR(in bool theIsFront); //!< Index of refraction\n"
"#define occMaterial_Emission occPBRMaterial_Emission\n"
"#define occActiveSampler occSampler0 //!< alias for backward compatibility\n"
"#define occSamplerBaseColor occSampler0 //!< alias to a base color texture\n"
"uniform sampler2D occSampler0; //!< current active sampler;\n"
- "#endif //! occSampler1, occSampler2,... should be defined in "
- "GLSL program body for multitexturing\n"
+ "#endif //! occSampler1, occSampler2,... should be defined in GLSL program body for multitexturing\n"
"\n"
"#if defined(THE_HAS_TEXTURE_COLOR) && defined(FRAGMENT_SHADER)\n"
- "#define occMaterialBaseColor(theIsFront, theTexCoord) (occMaterial_Color(theIsFront) * "
- "occTexture2D(occSamplerBaseColor, theTexCoord))\n"
+ "#define occMaterialBaseColor(theIsFront, theTexCoord) (occMaterial_Color(theIsFront) * occTexture2D(occSamplerBaseColor, theTexCoord))\n"
"#else\n"
"#define occMaterialBaseColor(theIsFront, theTexCoord) occMaterial_Color(theIsFront)\n"
"#endif\n"
"\n"
"#if defined(THE_HAS_TEXTURE_OCCLUSION) && defined(FRAGMENT_SHADER)\n"
"uniform sampler2D occSamplerOcclusion; //!< R occlusion texture sampler\n"
- "#define occMaterialOcclusion(theColor, theTexCoord) theColor *= "
- "occTexture2D(occSamplerOcclusion, theTexCoord).r;\n"
+ "#define occMaterialOcclusion(theColor, theTexCoord) theColor *= occTexture2D(occSamplerOcclusion, theTexCoord).r;\n"
"#else\n"
"#define occMaterialOcclusion(theColor, theTexCoord)\n"
"#endif\n"
"\n"
"#if defined(THE_HAS_TEXTURE_EMISSIVE) && defined(FRAGMENT_SHADER)\n"
"uniform sampler2D occSamplerEmissive; //!< RGB emissive texture sampler\n"
- "#define occMaterialEmission(theIsFront, theTexCoord) (occMaterial_Emission(theIsFront) * "
- "occTexture2D(occSamplerEmissive, theTexCoord).rgb)\n"
+ "#define occMaterialEmission(theIsFront, theTexCoord) (occMaterial_Emission(theIsFront) * occTexture2D(occSamplerEmissive, theTexCoord).rgb)\n"
"#else\n"
"#define occMaterialEmission(theIsFront, theTexCoord) occMaterial_Emission(theIsFront)\n"
"#endif\n"
"\n"
"#if defined(THE_HAS_TEXTURE_NORMAL) && defined(FRAGMENT_SHADER)\n"
- // clang-format off
"uniform sampler2D occSamplerNormal; //!< XYZ normal texture sampler with W==0 indicating no texture\n"
- // clang-format on
"#define occTextureNormal(theTexCoord) occTexture2D(occSamplerNormal, theTexCoord)\n"
"#else\n"
"#define occTextureNormal(theTexCoord) vec4(0.0) // no normal map\n"
"\n"
"#if defined(THE_HAS_TEXTURE_METALROUGHNESS) && defined(FRAGMENT_SHADER)\n"
"uniform sampler2D occSamplerMetallicRoughness; //!< BG metallic-roughness texture sampler\n"
- "#define occMaterialRoughness(theIsFront, theTexCoord) "
- "(occPBRMaterial_NormalizedRoughness(theIsFront) * occTexture2D(occSamplerMetallicRoughness, "
- "theTexCoord).g)\n"
- "#define occMaterialMetallic(theIsFront, theTexCoord) (occPBRMaterial_Metallic(theIsFront) * "
- "occTexture2D(occSamplerMetallicRoughness, theTexCoord).b)\n"
+ "#define occMaterialRoughness(theIsFront, theTexCoord) (occPBRMaterial_NormalizedRoughness(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).g)\n"
+ "#define occMaterialMetallic(theIsFront, theTexCoord) (occPBRMaterial_Metallic(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).b)\n"
"#else\n"
- "#define occMaterialRoughness(theIsFront, theTexCoord) "
- "occPBRMaterial_NormalizedRoughness(theIsFront)\n"
+ "#define occMaterialRoughness(theIsFront, theTexCoord) occPBRMaterial_NormalizedRoughness(theIsFront)\n"
"#define occMaterialMetallic(theIsFront, theTexCoord) occPBRMaterial_Metallic(theIsFront)\n"
"#endif\n"
"\n"
- // clang-format off
"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"
"#if defined(THE_MAX_CLIP_PLANES) && (THE_MAX_CLIP_PLANES > 0)\n"
"uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];\n"
"uniform THE_PREC_ENUM int occClipPlaneChains[THE_MAX_CLIP_PLANES]; //! Indicating the number of planes in the Chain\n"
- // clang-format on
"uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes\n"
"#endif\n"
"//! @endfile Declarations.glsl\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/Display.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/Display.fs
static const char Shaders_Display_fs[] =
"#ifdef ADAPTIVE_SAMPLING\n"
"{\n"
" vec4 aPackColor = vec4 (theColor.rgb, theWhitePoint);\n"
" vec4 aFilmicCurve = 1.425f * aPackColor + vec4 (0.05f);\n"
- " vec4 aResultColor = (aPackColor * aFilmicCurve + vec4 (0.004f)) / (aPackColor * (aFilmicCurve "
- "+ vec4 (0.55f)) + vec4 (0.0491f)) - vec4 (0.0821f);\n"
+ " vec4 aResultColor = (aPackColor * aFilmicCurve + vec4 (0.004f)) / (aPackColor * (aFilmicCurve + vec4 (0.55f)) + vec4 (0.0491f)) - vec4 (0.0821f);\n"
" return vec4 (aResultColor.rgb / aResultColor.www, 1.0);\n"
"}\n"
"\n"
" // accumulate visual error to current block; estimated error is written only\n"
" // after the first 40 samples and path length has reached 10 bounces or more\n"
" imageAtomicAdd (uVarianceImage, aPixel / uTileSize,\n"
- " int (mix (uVarianceScaleFactor, anError * uVarianceScaleFactor, aColor.w > "
- "40.f)));\n"
+ " int (mix (uVarianceScaleFactor, anError * uVarianceScaleFactor, aColor.w > 40.f)));\n"
"\n"
" if (uDebugAdaptive == 0) // normal rendering\n"
" {\n"
"#ifdef GL_ARB_shader_image_size\n"
" aRatio = vec2 (imageSize (uRenderImage)) / vec2 (3.f * 512.f, 2.f * 512.f);\n"
"#endif\n"
- " aColor = vec4 (0.5f * aColor.rgb * aSampleWeight + vec3 (0.f, sqrt (aRatio.x * aRatio.y) * "
- "aColor.w / uAccumFrames * 0.35f, 0.f), 1.0);\n"
+ " aColor = vec4 (0.5f * aColor.rgb * aSampleWeight + vec3 (0.f, sqrt (aRatio.x * aRatio.y) * aColor.w / uAccumFrames * 0.35f, 0.f), 1.0);\n"
" }\n"
"\n"
"#endif // ADAPTIVE_SAMPLING\n"
"\n"
"#endif\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/LightShadow.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/LightShadow.glsl
static const char Shaders_LightShadow_glsl[] =
"#if (__VERSION__ >= 120)\n"
"//! Coefficients for gathering close samples for antialiasing.\n"
- "//! Use only with decent OpenGL (array constants cannot be initialized with GLSL 1.1 / GLSL ES "
- "1.1)\n"
+ "//! Use only with decent OpenGL (array constants cannot be initialized with GLSL 1.1 / GLSL ES 1.1)\n"
"const vec2 occPoissonDisk16[16] = vec2[](\n"
- " vec2(-0.94201624,-0.39906216), vec2( 0.94558609,-0.76890725), vec2(-0.09418410,-0.92938870), "
- "vec2( 0.34495938, 0.29387760),\n"
- " vec2(-0.91588581, 0.45771432), vec2(-0.81544232,-0.87912464), vec2(-0.38277543, 0.27676845), "
- "vec2( 0.97484398, 0.75648379),\n"
- " vec2( 0.44323325,-0.97511554), vec2( 0.53742981,-0.47373420), vec2(-0.26496911,-0.41893023), "
- "vec2( 0.79197514, 0.19090188),\n"
- " vec2(-0.24188840, 0.99706507), vec2(-0.81409955, 0.91437590), vec2( 0.19984126, 0.78641367), "
- "vec2( 0.14383161,-0.14100790)\n"
+ " vec2(-0.94201624,-0.39906216), vec2( 0.94558609,-0.76890725), vec2(-0.09418410,-0.92938870), vec2( 0.34495938, 0.29387760),\n"
+ " vec2(-0.91588581, 0.45771432), vec2(-0.81544232,-0.87912464), vec2(-0.38277543, 0.27676845), vec2( 0.97484398, 0.75648379),\n"
+ " vec2( 0.44323325,-0.97511554), vec2( 0.53742981,-0.47373420), vec2(-0.26496911,-0.41893023), vec2( 0.79197514, 0.19090188),\n"
+ " vec2(-0.24188840, 0.99706507), vec2(-0.81409955, 0.91437590), vec2( 0.19984126, 0.78641367), vec2( 0.14383161,-0.14100790)\n"
");\n"
"#endif\n"
"\n"
" }\n"
"\n"
" vec2 aTexelSize = vec2 (occShadowMapSizeBias.x);\n"
- " float aBias = max (occShadowMapSizeBias.y * (1.0 - dot (theNormal, aLightDir)), "
- "occShadowMapSizeBias.y * 0.1);\n"
+ " float aBias = max (occShadowMapSizeBias.y * (1.0 - dot (theNormal, aLightDir)), occShadowMapSizeBias.y * 0.1);\n"
"#if (__VERSION__ >= 120)\n"
" float aShadow = 0.0;\n"
" for (int aPosIter = 0; aPosIter < 16; ++aPosIter)\n"
" {\n"
- " float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy + occPoissonDisk16[aPosIter] "
- "* aTexelSize).r;\n"
+ " float aClosestDepth = occTexture2D (theShadow, aProjCoords.xy + occPoissonDisk16[aPosIter] * aTexelSize).r;\n"
" aShadow += (aCurrentDepth - aBias) > aClosestDepth ? 1.0 : 0.0;\n"
" }\n"
" return 1.0 - aShadow / 16.0;\n"
" return 1.0 - aShadow;\n"
"#endif\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRCookTorrance.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRCookTorrance.glsl
static const char Shaders_PBRCookTorrance_glsl[] =
"//! Calculates Cook-Torrance BRDF.\n"
" aCookTorrance /= 4.0;\n"
" return aCookTorrance;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file
-// src/Shaders/PBRDirectionalLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRDirectionalLight.glsl
static const char Shaders_PBRDirectionalLight_glsl[] =
"//! Function computes contribution of directional light source\n"
" occLight_Specular (theId),\n"
" occLight_Intensity(theId)) * theShadow;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRDistribution.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRDistribution.glsl
static const char Shaders_PBRDistribution_glsl[] =
"//! Calculates micro facet normals distribution.\n"
" in float theRoughness)\n"
"{\n"
" float aDistribution = theRoughness * theRoughness;\n"
- " aDistribution = aDistribution / (theCosH * theCosH * (aDistribution * aDistribution - 1.0) + "
- "1.0);\n"
+ " aDistribution = aDistribution / (theCosH * theCosH * (aDistribution * aDistribution - 1.0) + 1.0);\n"
" aDistribution = INV_PI * aDistribution * aDistribution;\n"
" return aDistribution;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBREnvBaking.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBREnvBaking.fs
static const char Shaders_PBREnvBaking_fs[] =
"THE_SHADER_IN vec3 ViewDirection; //!< direction of fetching from environment cubemap\n"
"#endif\n"
"\n"
"#ifdef THE_TO_BAKE_SPECULAR\n"
- // clang-format off
"uniform int uCurrentLevel; //!< current level of specular IBL map (ignored in case of diffuse map's processing)\n"
"uniform float uEnvSolidAngleSource; //!< source solid angle sample computed from one edge's size of source environment map's zero mipmap level\n"
- // clang-format on
"#endif\n"
"\n"
"//! Returns coordinates of point theNumber from Hammersley point set having size theSize.\n"
" return vec2(float(theNumber) / float(theSize), aVanDerCorput);\n"
"}\n"
"\n"
- "//! This function does importance sampling on hemisphere surface using GGX normal distribution "
- "function\n"
+ "//! This function does importance sampling on hemisphere surface using GGX normal distribution function\n"
"//! in tangent space (positive z axis is surface normal direction).\n"
"vec3 importanceSample (in vec2 theHammersleyPoint,\n"
" in float theRoughness)\n"
" float aPhi = PI_2 * theHammersleyPoint.x;\n"
" theRoughness *= theRoughness;\n"
" theRoughness *= theRoughness;\n"
- " float aCosTheta = sqrt((1.0 - theHammersleyPoint.y) / (1.0 + (theRoughness - 1.0) * "
- "theHammersleyPoint.y));\n"
+ " float aCosTheta = sqrt((1.0 - theHammersleyPoint.y) / (1.0 + (theRoughness - 1.0) * theHammersleyPoint.y));\n"
" float aSinTheta = sqrt(1.0 - aCosTheta * aCosTheta);\n"
" return vec3(aSinTheta * cos(aPhi),\n"
" aSinTheta * sin(aPhi),\n"
" aCosTheta);\n"
"}\n"
"\n"
- "//! Transforms resulted sampled direction from tangent space to world space considering the "
- "surface normal.\n"
+ "//! Transforms resulted sampled direction from tangent space to world space considering the surface normal.\n"
"vec3 fromTangentSpace (in vec3 theVector,\n"
" in vec3 theNormal)\n"
"{\n"
" float aNdotL = dot (aLight, theNormal);\n"
" if (aNdotL > 0.0)\n"
" {\n"
- " float aSolidAngleSample = 1.0 / (float(theSize) * (occPBRDistribution (aHdotV, "
- "theRoughness) * 0.25 + 0.0001) + 0.0001);\n"
- " float aLod = (theRoughness == 0.0) ? 0.0 : 0.5 * log2 (aSolidAngleSample / "
- "uEnvSolidAngleSource);\n"
+ " float aSolidAngleSample = 1.0 / (float(theSize) * (occPBRDistribution (aHdotV, theRoughness) * 0.25 + 0.0001) + 0.0001);\n"
+ " float aLod = (theRoughness == 0.0) ? 0.0 : 0.5 * log2 (aSolidAngleSample / uEnvSolidAngleSource);\n"
" return vec4 (occTextureCubeLod (uEnvMap, aLight, aLod).rgb * aNdotL, aNdotL);\n"
" }\n"
" return vec4 (0.0);\n"
" int aFixedDiv1 = aFixedPrec / 256;\n"
" int aFixedDiv2 = aFixedDiv1 / 256;\n"
" int aFixedDiv3 = aFixedDiv2 / 256;\n"
- " vec4 aPacked = vec4(float(aFixedPrec), float(aFixedDiv1), float(aFixedDiv2), "
- "float(aFixedDiv3));\n"
+ " vec4 aPacked = vec4(float(aFixedPrec), float(aFixedDiv1), float(aFixedDiv2), float(aFixedDiv3));\n"
" aRes = fract (aPacked * (1.0 / 256.0));\n"
"#endif\n"
" occFragColor = aRes;\n"
" occFragColor = vec4 (bakeSpecularMap (aViewDirection, aRoughness), 1.0);\n"
"#endif\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBREnvBaking.vs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBREnvBaking.vs
static const char Shaders_PBREnvBaking_vs[] =
"THE_SHADER_OUT vec3 ViewDirection; //!< direction of fetching from environment cubemap\n"
" ViewDirection = cubemapVectorTransform (aDir, uYCoeff, uZCoeff);\n"
" gl_Position = vec4 (occVertex.xy, 0.0, 1.0);\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRFresnel.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRFresnel.glsl
static const char Shaders_PBRFresnel_glsl[] =
"//! Functions to calculate fresnel coefficient and approximate zero fresnel value.\n"
" theCosV *= theCosV * theCosV * theCosV * theCosV;\n"
" return f0 + (max(vec3(1.0 - theRoughness), f0) - f0) * theCosV;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRGeometry.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRGeometry.glsl
static const char Shaders_PBRGeometry_glsl[] =
"//! Calculates geometry factor for Cook-Torrance BRDF.\n"
" g2 /= theCosL * (1.0 - k) + k;\n"
" return g1 * g2;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRIllumination.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRIllumination.glsl
static const char Shaders_PBRIllumination_glsl[] =
"//! Calculates direct illumination using Cook-Torrance BRDF.\n"
" aDiffuse *= INV_PI;\n"
" aDiffuse *= theBaseColor.rgb;\n"
" aDiffuse = mix (vec3(0.0), aDiffuse, theBaseColor.a);\n"
- " return (aDiffuse + aSpecular) * theLightColor * theLightIntensity * max(0.0, dot(theLight, "
- "theNormal));\n"
+ " return (aDiffuse + aSpecular) * theLightColor * theLightIntensity * max(0.0, dot(theLight, theNormal));\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRPointLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRPointLight.glsl
static const char Shaders_PBRPointLight_glsl[] =
"//! Function computes contribution of isotropic point light source\n"
" occLight_Specular (theId),\n"
" occLight_Intensity(theId) * anAtten);\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PBRSpotLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PBRSpotLight.glsl
static const char Shaders_PBRSpotLight_glsl[] =
"//! Function computes contribution of spotlight source\n"
" if ((1.0 - aRelativeAngle) <= anExponent)\n"
" {\n"
" float anAngularAttenuationOffset = cos(0.5 * occLight_SpotCutOff(theId));\n"
- " float anAngularAttenuationScale = 1.0 / max(0.001, cos(0.5 * occLight_SpotCutOff(theId) * "
- "(1.0 - anExponent)) - anAngularAttenuationOffset);\n"
+ " float anAngularAttenuationScale = 1.0 / max(0.001, cos(0.5 * occLight_SpotCutOff(theId) * (1.0 - anExponent)) - anAngularAttenuationOffset);\n"
" anAngularAttenuationOffset *= -anAngularAttenuationScale;\n"
- " float anAngularAttenuantion = clamp(aCosA * anAngularAttenuationScale + "
- "anAngularAttenuationOffset, 0.0, 1.0);\n"
+ " float anAngularAttenuantion = clamp(aCosA * anAngularAttenuationScale + anAngularAttenuationOffset, 0.0, 1.0);\n"
" anAtten *= anAngularAttenuantion * anAngularAttenuantion;\n"
" }\n"
" theNormal = theIsFront ? theNormal : -theNormal;\n"
" occLight_Specular(theId),\n"
" occLight_Intensity(theId) * anAtten) * theShadow;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PathtraceBase.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PathtraceBase.fs
static const char Shaders_PathtraceBase_fs[] =
"#ifdef _MSC_VER\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"
+ " return dot (theVector, theFactor) * (1.f / max (theFactor.x + theFactor.y + theFactor.z, 1e-15f));\n"
"}\n"
"\n"
"//=======================================================================\n"
"// function : EvalBlinnReflection\n"
"// purpose : Evaluates Blinn glossy BRDF, with cos(N, PSI)\n"
"//=======================================================================\n"
- "vec3 EvalBlinnReflection (in vec3 theWi, in vec3 theWo, in vec3 theFresnel, in float "
- "theRoughness)\n"
+ "vec3 EvalBlinnReflection (in vec3 theWi, in vec3 theWo, in vec3 theFresnel, in float theRoughness)\n"
"{\n"
" // calculate the reflection half-vec\n"
" vec3 aH = normalize (theWi + theWo);\n"
"\n"
" if (theBSDF.Ks.w > FLT_EPSILON)\n"
" {\n"
- " aBxDF += theBSDF.Ks.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelBase.rgb, "
- "theBSDF.Ks.w);\n"
+ " aBxDF += theBSDF.Ks.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelBase.rgb, theBSDF.Ks.w);\n"
" }\n"
"\n"
" aBxDF *= UNIT - fresnelMedia (theWo.z, theBSDF.FresnelCoat);\n"
"\n"
" if (theBSDF.Kc.w > FLT_EPSILON)\n"
" {\n"
- " aBxDF += theBSDF.Kc.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelCoat, "
- "theBSDF.Kc.w);\n"
+ " aBxDF += theBSDF.Kc.rgb * EvalBlinnReflection (theWi, theWo, theBSDF.FresnelCoat, theBSDF.Kc.w);\n"
" }\n"
"\n"
" return aBxDF;\n"
"// terms would be complex, and it is the D term that accounts\n"
"// for most of the variation.\n"
"//=======================================================================\n"
- "vec3 SampleGlossyBlinnReflection (in vec3 theWo, out vec3 theWi, in vec3 theFresnel, in float "
- "theRoughness, inout float thePDF)\n"
+ "vec3 SampleGlossyBlinnReflection (in vec3 theWo, out vec3 theWi, in vec3 theFresnel, in float theRoughness, inout float thePDF)\n"
"{\n"
" float aKsi1 = RandFloat();\n"
" float aKsi2 = RandFloat();\n"
"\n"
" if (theBSDF.Kc.w > FLT_EPSILON)\n"
" {\n"
- " float aPower = max (2.f / (theBSDF.Kc.w * theBSDF.Kc.w) - 2.f, 0.f); // roughness --> "
- "exponent\n"
+ " float aPower = max (2.f / (theBSDF.Kc.w * theBSDF.Kc.w) - 2.f, 0.f); // roughness --> exponent\n"
"\n"
- " aPDF += aPc * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot "
- "(theWi, aH);\n"
+ " aPDF += aPc * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);\n"
" }\n"
"\n"
" if (theBSDF.Ks.w > FLT_EPSILON)\n"
" {\n"
- " float aPower = max (2.f / (theBSDF.Ks.w * theBSDF.Ks.w) - 2.f, 0.f); // roughness --> "
- "exponent\n"
+ " float aPower = max (2.f / (theBSDF.Ks.w * theBSDF.Ks.w) - 2.f, 0.f); // roughness --> exponent\n"
"\n"
- " aPDF += aPs * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot "
- "(theWi, aH);\n"
+ " aPDF += aPs * (aPower + 2.f) * (0.25f / M_2_PI) * pow (abs (aH.z), aPower + 1.f) / dot (theWi, aH);\n"
" }\n"
" }\n"
"\n"
"// function : SampleBsdfLayered\n"
"// purpose : Samples specified composite material (BSDF)\n"
"//=======================================================================\n"
- "float SampleBsdfLayered (in SBSDF theBSDF, in vec3 theWo, out vec3 theWi, inout vec3 theWeight, "
- "inout bool theInside)\n"
+ "float SampleBsdfLayered (in SBSDF theBSDF, in vec3 theWo, out vec3 theWi, inout vec3 theWeight, inout bool theInside)\n"
"{\n"
" // NOTE: OCCT uses two-layer material model. We have base diffuse, glossy, or transmissive\n"
" // layer, covered by one glossy/specular coat. In the current model, the layers themselves\n"
" }\n"
" else\n"
" {\n"
- " theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelCoat, "
- "theBSDF.Kc.w, aPDF);\n"
+ " theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelCoat, theBSDF.Kc.w, aPDF);\n"
" }\n"
"\n"
" aPDF = mix (aPDF, MAXFLOAT, theBSDF.Kc.w < FLT_EPSILON);\n"
" }\n"
" else\n"
" {\n"
- " theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelBase.rgb, "
- "theBSDF.Ks.w, aPDF);\n"
+ " theWeight *= SampleGlossyBlinnReflection (theWo, theWi, theBSDF.FresnelBase.rgb, theBSDF.Ks.w, aPDF);\n"
" }\n"
"\n"
" aPDF = mix (aPDF, MAXFLOAT, theBSDF.Ks.w < FLT_EPSILON);\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"
+ "vec3 SampleLight (in vec3 theToLight, inout float theDistance, in bool isInfinite, in float theSmoothness, inout float thePDF)\n"
"{\n"
" SLocalSpace aSpace = buildLocalSpace (theToLight * (1.f / theDistance));\n"
"\n"
"// function : HandlePointLight\n"
"// purpose :\n"
"//=======================================================================\n"
- "float HandlePointLight (in vec3 theInput, in vec3 theToLight, in float theRadius, in float "
- "theDistance, inout float thePDF)\n"
+ "float HandlePointLight (in vec3 theInput, in vec3 theToLight, in float theRadius, in float theDistance, inout float thePDF)\n"
"{\n"
" float aCosMax = inversesqrt (1.f + theRadius * theRadius / (theDistance * theDistance));\n"
"\n"
"// function : HandleDistantLight\n"
"// purpose :\n"
"//=======================================================================\n"
- "float HandleDistantLight (in vec3 theInput, in vec3 theToLight, in float theCosMax, inout float "
- "thePDF)\n"
+ "float HandleDistantLight (in vec3 theInput, in vec3 theToLight, in float theCosMax, inout float thePDF)\n"
"{\n"
" float aVisibility = step (theCosMax, dot (theInput, theToLight));\n"
"\n"
"// function: IntersectLight\n"
"// purpose : Checks intersections with light sources\n"
"// =======================================================================\n"
- "vec3 IntersectLight (in SRay theRay, in int theDepth, in float theHitDistance, out float "
- "thePDF)\n"
+ "vec3 IntersectLight (in SRay theRay, in int theDepth, in float theHitDistance, out float thePDF)\n"
"{\n"
" vec3 aTotalRadiance = ZERO;\n"
" thePDF = 0.f; // PDF of sampling light sources\n"
" {\n"
" vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;\n"
" vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;\n"
- " vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, "
- "uFocalPlaneDist));\n"
+ " vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));\n"
" vec3 aDirect = uEyeView * aLocalDir.z +\n"
" uEyeSide * aLocalDir.x +\n"
" uEyeVert * aLocalDir.y;\n"
"\n"
"//=======================================================================\n"
"// function : NormalAdaptation\n"
- "// purpose : Adapt smooth normal (which may be different from geometry normal) in order to "
- "avoid black areas in render\n"
+ "// purpose : Adapt smooth normal (which may be different from geometry normal) in order to avoid black areas in render\n"
"//=======================================================================\n"
"bool NormalAdaptation (in vec3 theView, in vec3 theGeometryNormal, inout vec3 theSmoothNormal)\n"
"{\n"
" float aCos = dot(theGeometryNormal, theSmoothNormal);\n"
" if (aCos < aMinCos)\n"
" {\n"
- " theSmoothNormal = aMinCos * theGeometryNormal + normalize(theSmoothNormal - aCos * "
- "theGeometryNormal) * sqrt(1.0 - aMinCos * aMinCos);\n"
+ " theSmoothNormal = aMinCos * theGeometryNormal + normalize(theSmoothNormal - aCos * theGeometryNormal) * sqrt(1.0 - aMinCos * aMinCos);\n"
" return true;\n"
" }\n"
" return false;\n"
" #ifdef THE_ZERO_TO_ONE_DEPTH\n"
" aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);\n"
" #else\n"
- " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * "
- "0.5f + 0.5f;\n"
+ " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;\n"
" #endif\n"
" }\n"
"\n"
" aBSDF.Kt = texelFetch (uRaytraceMaterialTexture, MATERIAL_KT (aTriangle.TriIndex.w));\n"
"\n"
" // fetch Fresnel reflectance for both layers\n"
- " aBSDF.FresnelCoat = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_COAT "
- "(aTriangle.TriIndex.w)).xyz;\n"
- " aBSDF.FresnelBase = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_BASE "
- "(aTriangle.TriIndex.w));\n"
+ " aBSDF.FresnelCoat = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_COAT (aTriangle.TriIndex.w)).xyz;\n"
+ " aBSDF.FresnelBase = texelFetch (uRaytraceMaterialTexture, MATERIAL_FRESNEL_BASE (aTriangle.TriIndex.w));\n"
"\n"
" vec4 anLE = texelFetch (uRaytraceMaterialTexture, MATERIAL_LE (aTriangle.TriIndex.w));\n"
"\n"
" {\n"
" vec2 aUVs[3];\n"
" vec4 aTexCoord = vec4 (SmoothUV (aHit.UV, aTriangle.TriIndex, aUVs), 0.f, 1.f);\n"
- " vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 "
- "(aTriangle.TriIndex.w));\n"
- " vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 "
- "(aTriangle.TriIndex.w));\n"
+ " vec4 aTrsfRow1 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS1 (aTriangle.TriIndex.w));\n"
+ " vec4 aTrsfRow2 = texelFetch (uRaytraceMaterialTexture, MATERIAL_TRS2 (aTriangle.TriIndex.w));\n"
" aTexCoord.st = vec2 (dot (aTrsfRow1, aTexCoord),\n"
" dot (aTrsfRow2, aTexCoord));\n"
"\n"
" if (anLE.w >= 0.0)\n"
" {\n"
- " anLE.rgb *= textureLod (sampler2D (uTextureSamplers[int (anLE.w)]), aTexCoord.st, "
- "0.0).rgb;\n"
+ " anLE.rgb *= textureLod (sampler2D (uTextureSamplers[int (anLE.w)]), aTexCoord.st, 0.0).rgb;\n"
" }\n"
" if (aBSDF.Kt.w >= 0.0)\n"
" {\n"
- " vec2 aTexMetRough = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kt.w)]), "
- "aTexCoord.st, 0.0).bg;\n"
+ " vec2 aTexMetRough = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kt.w)]), aTexCoord.st, 0.0).bg;\n"
" float aPbrMetal = aTexMetRough.x;\n"
" float aPbrRough2 = aTexMetRough.y * aTexMetRough.y;\n"
" aBSDF.Ks.a *= aPbrRough2;\n"
- " // when using metal-roughness texture, global metalness of material (encoded in "
- "FresnelBase) is expected to be 1.0 so that Kd will be 0.0\n"
+ " // when using metal-roughness texture, global metalness of material (encoded in FresnelBase) is expected to be 1.0 so that Kd will be 0.0\n"
" aBSDF.Kd.rgb = aBSDF.FresnelBase.rgb * (1.0 - aPbrMetal);\n"
" aBSDF.FresnelBase.rgb *= aPbrMetal;\n"
" }\n"
" if (aBSDF.Kd.w >= 0.0)\n"
" {\n"
- " vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), "
- "aTexCoord.st, 0.0);\n"
+ " vec4 aTexColor = textureLod (sampler2D (uTextureSamplers[int (aBSDF.Kd.w)]), aTexCoord.st, 0.0);\n"
" vec3 aDiff = aTexColor.rgb * aTexColor.a;\n"
" aBSDF.Kd.rgb *= aDiff;\n"
" aBSDF.FresnelBase.rgb *= aDiff;\n"
" aUVs[i] = vec2 (dot (aTrsfRow1, vec4(aUVs[i], 0.0, 1.0)),\n"
" dot (aTrsfRow2, vec4(aUVs[i], 0.0, 1.0)));\n"
" }\n"
- " vec3 aMapNormalValue = textureLod (sampler2D (uTextureSamplers[int "
- "(aBSDF.FresnelBase.w)]), aTexCoord.st, 0.0).xyz;\n"
+ " vec3 aMapNormalValue = textureLod (sampler2D (uTextureSamplers[int (aBSDF.FresnelBase.w)]), aTexCoord.st, 0.0).xyz;\n"
" mat2 aDeltaUVMatrix = mat2 (aUVs[1] - aUVs[0], aUVs[1] - aUVs[2]);\n"
- " mat2x3 aDeltaVectorMatrix = mat2x3 (aTriangle.Points[1] - aTriangle.Points[0], "
- "aTriangle.Points[1] - aTriangle.Points[2]);\n"
- " aNormal = TangentSpaceNormal (aDeltaUVMatrix, aDeltaVectorMatrix, aMapNormalValue, "
- "aNormal, true);\n"
+ " mat2x3 aDeltaVectorMatrix = mat2x3 (aTriangle.Points[1] - aTriangle.Points[0], aTriangle.Points[1] - aTriangle.Points[2]);\n"
+ " aNormal = TangentSpaceNormal (aDeltaUVMatrix, aDeltaVectorMatrix, aMapNormalValue, aNormal, true);\n"
" }\n"
" #endif\n"
" }\n"
" aLight.w == 0.f /* is infinite */, aParam.w /* max cos or radius */, aExpPDF);\n"
"\n"
" aImpPDF = BsdfPdfLayered (aBSDF,\n"
- " toLocalSpace (-theRay.Direct, aSpace), toLocalSpace (aLight.xyz, aSpace), "
- "aThroughput);\n"
+ " toLocalSpace (-theRay.Direct, aSpace), toLocalSpace (aLight.xyz, aSpace), aThroughput);\n"
"\n"
" // MIS weight including division by explicit PDF\n"
- " float aMIS = (aExpPDF == MAXFLOAT) ? 1.f : aExpPDF / (aExpPDF * aExpPDF + aImpPDF * "
- "aImpPDF);\n"
+ " float aMIS = (aExpPDF == MAXFLOAT) ? 1.f : aExpPDF / (aExpPDF * aExpPDF + aImpPDF * aImpPDF);\n"
"\n"
" vec3 aContrib = aMIS * aParam.rgb /* Le */ * EvalBsdfLayered (\n"
" aBSDF, toLocalSpace (aLight.xyz, aSpace), toLocalSpace (-theRay.Direct, aSpace));\n"
"\n"
- " if (any (greaterThan (aContrib, MIN_CONTRIBUTION))) // check if light source is "
- "important\n"
+ " if (any (greaterThan (aContrib, MIN_CONTRIBUTION))) // check if light source is important\n"
" {\n"
" SRay aShadow = SRay (theRay.Origin + aLight.xyz * uSceneEpsilon, aLight.xyz);\n"
"\n"
"\n"
" if (aInMedium) // handle attenuation\n"
" {\n"
- " vec4 aScattering = texelFetch (uRaytraceMaterialTexture, MATERIAL_ABSORPT_BASE "
- "(aTriangle.TriIndex.w));\n"
+ " vec4 aScattering = texelFetch (uRaytraceMaterialTexture, MATERIAL_ABSORPT_BASE (aTriangle.TriIndex.w));\n"
"\n"
" aThroughput *= exp (-aHit.Time * aScattering.w * (UNIT - aScattering.rgb));\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"
+ " aHit.Normal * mix (-uSceneEpsilon, uSceneEpsilon, step (0.f, dot (aHit.Normal, anInput))), anInput);\n"
"\n"
" theInverse = InverseDirection (anInput);\n"
" }\n"
"}\n"
"\n"
"#endif\n";
+
+// clang-format on
-// This file has been automatically generated from resource file
-// src/Shaders/PhongDirectionalLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PhongDirectionalLight.glsl
static const char Shaders_PhongDirectionalLight_glsl[] =
"//! Function computes contribution of directional light source\n"
" Diffuse += occLight_Diffuse (theId) * aNdotL * theShadow;\n"
" Specular += occLight_Specular (theId) * aSpecl * theShadow;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PhongPointLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PhongPointLight.glsl
static const char Shaders_PhongPointLight_glsl[] =
"//! Function computes contribution of isotropic point light source\n"
"\n"
" float aDist = length (aLight);\n"
" float aRange = occLight_Range (theId);\n"
- " float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), "
- "occLight_ConstAttenuation (theId));\n"
+ " float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));\n"
" if (anAtten <= 0.0) return;\n"
" aLight /= aDist;\n"
"\n"
" Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten;\n"
" Specular += occLight_Specular(theId) * aSpecl * anAtten;\n"
"}\n";
+
+// clang-format on
--- /dev/null
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PhongShading.fs
+
+static const char Shaders_PhongShading_fs[] =
+ "// 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"
+ "varying vec3 View; //!< Direction to the viewer\n"
+ "varying vec3 Normal; //!< Vertex normal in view space\n"
+ "varying vec4 Position; //!< Vertex position in view space.\n"
+ "varying vec4 PositionWorld; //!< Vertex position in world space\n"
+ "\n"
+ "vec3 Ambient; //!< Ambient contribution of light sources\n"
+ "vec3 Diffuse; //!< Diffuse contribution of light sources\n"
+ "vec3 Specular; //!< Specular contribution of light sources\n"
+ "\n"
+ "//! Computes contribution of isotropic point light source\n"
+ "void pointLight (in int theId,\n"
+ " in vec3 theNormal,\n"
+ " in vec3 theView,\n"
+ " in vec3 thePoint)\n"
+ "{\n"
+ " vec3 aLight = occLight_Position (theId).xyz;\n"
+ " if (!occLight_IsHeadlight (theId))\n"
+ " {\n"
+ " aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));\n"
+ " }\n"
+ " aLight -= thePoint;\n"
+ "\n"
+ " float aDist = length (aLight);\n"
+ " aLight = aLight * (1.0 / aDist);\n"
+ "\n"
+ " float anAtten = 1.0 / (occLight_ConstAttenuation (theId)\n"
+ " + occLight_LinearAttenuation (theId) * aDist);\n"
+ "\n"
+ " vec3 aHalf = normalize (aLight + theView);\n"
+ "\n"
+ " vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;\n"
+ " float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));\n"
+ " float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));\n"
+ "\n"
+ " float aSpecl = 0.0;\n"
+ " if (aNdotL > 0.0)\n"
+ " {\n"
+ " aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));\n"
+ " }\n"
+ "\n"
+ " Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;\n"
+ " Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;\n"
+ "}\n"
+ "\n"
+ "//! Computes contribution of spotlight source\n"
+ "void spotLight (in int theId,\n"
+ " in vec3 theNormal,\n"
+ " in vec3 theView,\n"
+ " in vec3 thePoint)\n"
+ "{\n"
+ " vec3 aLight = occLight_Position (theId).xyz;\n"
+ " vec3 aSpotDir = occLight_SpotDirection (theId).xyz;\n"
+ " if (!occLight_IsHeadlight (theId))\n"
+ " {\n"
+ " aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 1.0));\n"
+ " aSpotDir = vec3 (occWorldViewMatrix * vec4 (aSpotDir, 0.0));\n"
+ " }\n"
+ " aLight -= thePoint;\n"
+ "\n"
+ " float aDist = length (aLight);\n"
+ " aLight = aLight * (1.0 / aDist);\n"
+ "\n"
+ " aSpotDir = normalize (aSpotDir);\n"
+ "\n"
+ " // light cone\n"
+ " float aCosA = dot (aSpotDir, -aLight);\n"
+ " if (aCosA >= 1.0 || aCosA < cos (occLight_SpotCutOff (theId)))\n"
+ " {\n"
+ " return;\n"
+ " }\n"
+ "\n"
+ " float anExponent = occLight_SpotExponent (theId);\n"
+ " float anAtten = 1.0 / (occLight_ConstAttenuation (theId)\n"
+ " + occLight_LinearAttenuation (theId) * aDist);\n"
+ " if (anExponent > 0.0)\n"
+ " {\n"
+ " anAtten *= pow (aCosA, anExponent * 128.0);\n"
+ " }\n"
+ "\n"
+ " vec3 aHalf = normalize (aLight + theView);\n"
+ "\n"
+ " vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;\n"
+ " float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));\n"
+ " float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));\n"
+ "\n"
+ " float aSpecl = 0.0;\n"
+ " if (aNdotL > 0.0)\n"
+ " {\n"
+ " aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));\n"
+ " }\n"
+ "\n"
+ " Diffuse += occLight_Diffuse (theId).rgb * aNdotL * anAtten;\n"
+ " Specular += occLight_Specular (theId).rgb * aSpecl * anAtten;\n"
+ "}\n"
+ "\n"
+ "//! Computes contribution of directional light source\n"
+ "void directionalLight (in int theId,\n"
+ " in vec3 theNormal,\n"
+ " in vec3 theView)\n"
+ "{\n"
+ " vec3 aLight = normalize (occLight_Position (theId).xyz);\n"
+ " if (!occLight_IsHeadlight (theId))\n"
+ " {\n"
+ " aLight = vec3 (occWorldViewMatrix * vec4 (aLight, 0.0));\n"
+ " }\n"
+ "\n"
+ " vec3 aHalf = normalize (aLight + theView);\n"
+ "\n"
+ " vec3 aFaceSideNormal = gl_FrontFacing ? theNormal : -theNormal;\n"
+ " float aNdotL = max (0.0, dot (aFaceSideNormal, aLight));\n"
+ " float aNdotH = max (0.0, dot (aFaceSideNormal, aHalf ));\n"
+ "\n"
+ " float aSpecl = 0.0;\n"
+ " if (aNdotL > 0.0)\n"
+ " {\n"
+ " aSpecl = pow (aNdotH, occMaterial_Shininess (gl_FrontFacing));\n"
+ " }\n"
+ "\n"
+ " Diffuse += occLight_Diffuse (theId).rgb * aNdotL;\n"
+ " Specular += occLight_Specular (theId).rgb * aSpecl;\n"
+ "}\n"
+ "\n"
+ "//! Computes illumination from light sources\n"
+ "vec4 computeLighting (in vec3 theNormal,\n"
+ " in vec3 theView,\n"
+ " in vec4 thePoint)\n"
+ "{\n"
+ " // Clear the light intensity accumulators\n"
+ " Ambient = occLightAmbient.rgb;\n"
+ " Diffuse = vec3 (0.0);\n"
+ " Specular = vec3 (0.0);\n"
+ " vec3 aPoint = thePoint.xyz / thePoint.w;\n"
+ " for (int anIndex = 0; anIndex < occLightSourcesCount; ++anIndex)\n"
+ " {\n"
+ " int aType = occLight_Type (anIndex);\n"
+ " if (aType == OccLightType_Direct)\n"
+ " {\n"
+ " directionalLight (anIndex, theNormal, theView);\n"
+ " }\n"
+ " else if (aType == OccLightType_Point)\n"
+ " {\n"
+ " pointLight (anIndex, theNormal, theView, aPoint);\n"
+ " }\n"
+ " else if (aType == OccLightType_Spot)\n"
+ " {\n"
+ " spotLight (anIndex, theNormal, theView, aPoint);\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " vec3 aMatAmbient = occMaterial_Ambient (gl_FrontFacing);\n"
+ " vec4 aMatDiffuse = occMaterial_Diffuse (gl_FrontFacing);\n"
+ " vec3 aMatSpecular = occMaterial_Specular(gl_FrontFacing);\n"
+ " vec3 aMatEmission = occMaterial_Emission(gl_FrontFacing);\n"
+ " vec3 aColor = Ambient * aMatAmbient.rgb\n"
+ " + Diffuse * aMatDiffuse.rgb\n"
+ " + Specular * aMatSpecular.rgb\n"
+ " + aMatEmission.rgb;\n"
+ " return vec4 (aColor, aMatDiffuse.a);\n"
+ "}\n"
+ "\n"
+ "//! Entry point to the Fragment Shader\n"
+ "void main()\n"
+ "{\n"
+ " // process clipping planes\n"
+ " for (int anIndex = 0; anIndex < occClipPlaneCount; ++anIndex)\n"
+ " {\n"
+ " vec4 aClipEquation = occClipPlaneEquations[anIndex];\n"
+ " if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0)\n"
+ " {\n"
+ " discard;\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " vec4 aColor = computeLighting (normalize (Normal), normalize (View), Position);\n"
+ " occSetFragColor (aColor);\n"
+ "}\n";
+
+// clang-format on
--- /dev/null
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PhongShading.vs
+
+static const char Shaders_PhongShading_vs[] =
+ "// 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"
+ "varying vec3 View; //!< Direction to the viewer\n"
+ "varying vec3 Normal; //!< Vertex normal in view space\n"
+ "varying vec4 Position; //!< Vertex position in view space\n"
+ "varying vec4 PositionWorld; //!< Vertex position in world space\n"
+ "\n"
+ "//! Computes the normal in view space\n"
+ "vec3 TransformNormal (in vec3 theNormal)\n"
+ "{\n"
+ " vec4 aResult = occWorldViewMatrixInverseTranspose\n"
+ " * occModelWorldMatrixInverseTranspose\n"
+ " * vec4 (theNormal, 0.0);\n"
+ " return normalize (aResult.xyz);\n"
+ "}\n"
+ "\n"
+ "//! Entry point to the Vertex Shader\n"
+ "void main()\n"
+ "{\n"
+ " PositionWorld = occModelWorldMatrix * occVertex;\n"
+ " Position = occWorldViewMatrix * PositionWorld;\n"
+ " Normal = TransformNormal (occNormal);\n"
+ "\n"
+ " // Note: The specified view vector is absolutely correct only for the orthogonal projection.\n"
+ " // For perspective projection it will be approximate, but it is in good agreement with the OpenGL calculations.\n"
+ " View = vec3 (0.0, 0.0, 1.0);\n"
+ "\n"
+ " // Do fixed functionality vertex transform\n"
+ " gl_Position = occProjectionMatrix * occWorldViewMatrix * occModelWorldMatrix * occVertex;\n"
+ "}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/PhongSpotLight.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PhongSpotLight.glsl
static const char Shaders_PhongSpotLight_glsl[] =
"//! Function computes contribution of spotlight source\n"
"\n"
" float aDist = length (aLight);\n"
" float aRange = occLight_Range (theId);\n"
- " float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), "
- "occLight_ConstAttenuation (theId));\n"
+ " float anAtten = occPointLightAttenuation (aDist, aRange, occLight_LinearAttenuation (theId), occLight_ConstAttenuation (theId));\n"
" if (anAtten <= 0.0) return;\n"
" aLight /= aDist;\n"
"\n"
" Diffuse += occLight_Diffuse (theId) * aNdotL * anAtten * theShadow;\n"
" Specular += occLight_Specular(theId) * aSpecl * anAtten * theShadow;\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file
-// src/Shaders/PointLightAttenuation.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/PointLightAttenuation.glsl
static const char Shaders_PointLightAttenuation_glsl[] =
"//! Returns point light source attenuation factor\n"
" return -1.0;\n"
"}\n"
"\n"
- "//! Returns point light source attenuation factor with quadratic attenuation in case of zero "
- "range.\n"
+ "//! Returns point light source attenuation factor with quadratic attenuation in case of zero range.\n"
"float occPointLightAttenuation (in float theDistance, in float theRange)\n"
"{\n"
" if (theRange == 0.0)\n"
" return occRangedPointLightAttenuation (theDistance, theRange);\n"
"}\n"
"\n"
- "//! Returns point light source attenuation factor with linear attenuation in case of zero "
- "range.\n"
- "float occPointLightAttenuation (in float theDistance, in float theRange, in float "
- "theLinearAttenuation, in float theConstAttenuation)\n"
+ "//! Returns point light source attenuation factor with linear attenuation in case of zero range.\n"
+ "float occPointLightAttenuation (in float theDistance, in float theRange, in float theLinearAttenuation, in float theConstAttenuation)\n"
"{\n"
" if (theRange == 0.0)\n"
" {\n"
" }\n"
" return occRangedPointLightAttenuation (theDistance, theRange);\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/RaytraceBase.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/RaytraceBase.fs
static const char Shaders_RaytraceBase_fs[] =
"#ifdef ADAPTIVE_SAMPLING\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"
+ " 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"
" 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"
+ " theUVT.x = any (lessThan (theUVT, ZERO)) || (theUVT.y + theUVT.z) > 1.f ? MAXFLOAT : theUVT.x;\n"
"}\n"
"\n"
"#define EMPTY_ROOT ivec4(0)\n"
"// function : SceneNearestHit\n"
"// purpose : Finds intersection with nearest scene triangle\n"
"// =======================================================================\n"
- "STriangle SceneNearestHit (in SRay theRay, in vec3 theInverse, inout SIntersect theHit, out int "
- "theTrsfId)\n"
+ "STriangle SceneNearestHit (in SRay theRay, in vec3 theInverse, inout SIntersect theHit, out int theTrsfId)\n"
"{\n"
" STriangle aTriangle = STriangle (INVALID_HIT, vec3[](vec3(0.0), vec3(0.0), vec3(0.0)));\n"
"\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"
+ " 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"
" 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 = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= "
- "0.f) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin1, aNodeMax1);\n"
" aTimeMin = min (aNodeMin1, aNodeMax1);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= "
- "0.f) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin2, aNodeMax2);\n"
" aTimeMin = min (aNodeMin2, aNodeMax2);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f "
- "&& aData.z > 1) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin3, aNodeMax3);\n"
" aTimeMin = min (aNodeMin3, aNodeMax3);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f "
- "&& aData.z > 2) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theHit.Time && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" ivec4 aChildren = ivec4 (0, 1, 2, 3);\n"
"\n"
" ivec4 aTriIndex = texelFetch (uGeometryTriangTexture, anIdx + TRG_OFFSET (aSubTree));\n"
" vec3 aPoints[3];\n"
"\n"
- " aPoints[0] = texelFetch (uGeometryVertexTexture, aTriIndex.x += VRT_OFFSET "
- "(aSubTree)).xyz;\n"
- " aPoints[1] = texelFetch (uGeometryVertexTexture, aTriIndex.y += VRT_OFFSET "
- "(aSubTree)).xyz;\n"
- " aPoints[2] = texelFetch (uGeometryVertexTexture, aTriIndex.z += VRT_OFFSET "
- "(aSubTree)).xyz;\n"
+ " aPoints[0] = texelFetch (uGeometryVertexTexture, aTriIndex.x += VRT_OFFSET (aSubTree)).xyz;\n"
+ " aPoints[1] = texelFetch (uGeometryVertexTexture, aTriIndex.y += VRT_OFFSET (aSubTree)).xyz;\n"
+ " aPoints[2] = texelFetch (uGeometryVertexTexture, aTriIndex.z += VRT_OFFSET (aSubTree)).xyz;\n"
"\n"
- " IntersectTriangle (aSubTree.TrsfRay, aPoints[0], aPoints[1], aPoints[2], aTimeUV, "
- "aNormal);\n"
+ " IntersectTriangle (aSubTree.TrsfRay, aPoints[0], aPoints[1], aPoints[2], aTimeUV, aNormal);\n"
"\n"
" if (aTimeUV.x < theHit.Time)\n"
" {\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"
+ " 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"
" 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 = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= "
- "0.f) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.x = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin1, aNodeMax1);\n"
" aTimeMin = min (aNodeMin1, aNodeMax1);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= "
- "0.f) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.y = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin2, aNodeMax2);\n"
" aTimeMin = min (aNodeMin2, aNodeMax2);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f "
- "&& aData.z > 1) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.z = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 1) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" aTimeMax = max (aNodeMin3, aNodeMax3);\n"
" aTimeMin = min (aNodeMin3, aNodeMax3);\n"
" aTimeLeave = min (aTimeMax.x, min (aTimeMax.y, aTimeMax.z));\n"
" aTimeEnter = max (aTimeMin.x, max (aTimeMin.y, aTimeMin.z));\n"
"\n"
- " aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f "
- "&& aData.z > 2) ? aTimeEnter : MAXFLOAT;\n"
+ " aHitTimes.w = (aTimeEnter <= aTimeLeave && aTimeEnter <= theDistance && aTimeLeave >= 0.f && aData.z > 2) ? aTimeEnter : MAXFLOAT;\n"
"\n"
" ivec4 aChildren = ivec4 (0, 1, 2, 3);\n"
"\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"
+ " 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"
+ " aFactor *= 1.f - texelFetch (uRaytraceMaterialTexture, MATERIAL_TRAN (aTriangle.w)).x;\n"
" }\n"
"#else\n"
" if (aTimeUV.x < theDistance)\n"
" aInvTransf2,\n"
" aInvTransf3);\n"
"\n"
- " aSubTree.Inverse = mix (-UNIT, UNIT, step (ZERO, aSubTree.TrsfRay.Direct)) / max (abs "
- "(aSubTree.TrsfRay.Direct), SMALL);\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"
" {\n"
" vec2 aPixel = uEyeSize * (vPixel - vec2 (0.5)) * 2.0;\n"
" vec2 anAperturePnt = sampleUniformDisk() * uApertureRadius;\n"
- " vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, "
- "uFocalPlaneDist));\n"
+ " vec3 aLocalDir = normalize (vec3 (aPixel * uFocalPlaneDist - anAperturePnt, uFocalPlaneDist));\n"
" vec3 aDirect = uEyeView * aLocalDir.z +\n"
" uEyeSide * aLocalDir.x +\n"
" uEyeVert * aLocalDir.y;\n"
" #ifdef THE_ZERO_TO_ONE_DEPTH\n"
" aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE);\n"
" #else\n"
- " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * "
- "0.5f + 0.5f;\n"
+ " aRaytraceDepth = (aNDCPoint.z / aNDCPoint.w + aPolygonOffset * POLYGON_OFFSET_SCALE) * 0.5f + 0.5f;\n"
" #endif\n"
" }\n"
"\n"
" aWeight.w);\n"
"}\n"
"#endif\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/RaytraceBase.vs
+// clang-format off
+// This file has been automatically generated from resource file resources/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";
+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";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/RaytraceRender.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/RaytraceRender.fs
static const char Shaders_RaytraceRender_fs[] =
"out vec4 OutColor;\n"
"\n"
"#endif // PATH_TRACING\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/RaytraceSmooth.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/RaytraceSmooth.fs
static const char Shaders_RaytraceSmooth_fs[] =
"//! Input ray-traced image.\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.0, 1.0), 1.0 / "
- "float(uSamples));\n"
+ " aColor = mix (aClr0, clamp (Radiance (aRay, aInvDirect), 0.0, 1.0), 1.0 / float(uSamples));\n"
" }\n"
"\n"
" OutColor = aColor;\n"
"\n"
"#endif\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/SkydomBackground.fs
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/SkydomBackground.fs
static const char Shaders_SkydomBackground_fs[] =
"// Constants\n"
"const float THE_G2 = THE_G * THE_G;\n"
"const float THE_HR = 8000.0; // Thickness of the atmosphere\n"
"const float THE_HM = 1000.0; // Same as above but for Mie\n"
- // clang-format off
"const vec3 THE_BETA_R = vec3 (5.8e-6, 13.5e-6, 33.1e-6); // Reyleigh scattering normal earth\n"
"const vec3 THE_BETA_M = vec3 (21e-6); // Normal Mie scattering\n"
"\n"
"const float THE_HorizonWidth = 0.002;\n"
"const int THE_NbSamples = 8;\n"
"const int THE_NbSamplesLight = 8; // integral sampling rate (might highly hit performance)\n"
- // clang-format on
"const float THE_SunPower = 5.0;\n"
"const float THE_StarTreshold = 0.98;\n"
"\n"
"\n"
" occFragColor = computeIncidentLight (normalize (aRayDirection), anUv, uTime);\n"
"}\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/Shaders/TangentSpaceNormal.glsl
+// clang-format off
+// This file has been automatically generated from resource file resources/Shaders/TangentSpaceNormal.glsl
static const char Shaders_TangentSpaceNormal_glsl[] =
- "//! Calculates transformation from tangent space and apply it to value from normal map to get "
- "normal in object space\n"
+ "//! Calculates transformation from tangent space and apply it to value from normal map to get normal in object space\n"
"vec3 TangentSpaceNormal (in mat2 theDeltaUVMatrix,\n"
" in mat2x3 theDeltaVectorMatrix,\n"
" in vec3 theNormalMapValue,\n"
"{\n"
" theNormalMapValue = normalize(theNormalMapValue * 2.0 - vec3(1.0));\n"
" // Inverse matrix\n"
- " theDeltaUVMatrix = mat2 (theDeltaUVMatrix[1][1], -theDeltaUVMatrix[0][1], "
- "-theDeltaUVMatrix[1][0], theDeltaUVMatrix[0][0]);\n"
+ " theDeltaUVMatrix = mat2 (theDeltaUVMatrix[1][1], -theDeltaUVMatrix[0][1], -theDeltaUVMatrix[1][0], theDeltaUVMatrix[0][0]);\n"
" theDeltaVectorMatrix = theDeltaVectorMatrix * theDeltaUVMatrix;\n"
" // Gram-Schmidt orthogonalization\n"
- " theDeltaVectorMatrix[1] = normalize(theDeltaVectorMatrix[1] - dot(theNormal, "
- "theDeltaVectorMatrix[1]) * theNormal);\n"
+ " theDeltaVectorMatrix[1] = normalize(theDeltaVectorMatrix[1] - dot(theNormal, theDeltaVectorMatrix[1]) * theNormal);\n"
" theDeltaVectorMatrix[0] = cross(theDeltaVectorMatrix[1], theNormal);\n"
" float aDirection = theIsInverse ? -1.0 : 1.0;\n"
- " return mat3 (aDirection * theDeltaVectorMatrix[0], aDirection * theDeltaVectorMatrix[1], "
- "theNormal) * theNormalMapValue;\n"
+ " return mat3 (aDirection * theDeltaVectorMatrix[0], aDirection * theDeltaVectorMatrix[1], theNormal) * theNormalMapValue;\n"
"}\n";
+
+// clang-format on
+++ /dev/null
-// Constants
-const float M_PI = 3.1415926535;
-const float THE_EARTH_RADIUS = 6360e3;
-const vec3 THE_EARTH_CENTER = vec3 (0.0, -THE_EARTH_RADIUS, 0.0);
-const float THE_ATMO_RADIUS = 6380e3; // atmosphere radius (6420e3?)
-const float THE_G = 0.76; // anisotropy of the medium (papers use 0.76)
-const float THE_G2 = THE_G * THE_G;
-const float THE_HR = 8000.0; // Thickness of the atmosphere
-const float THE_HM = 1000.0; // Same as above but for Mie
-const vec3 THE_BETA_R = vec3 (5.8e-6, 13.5e-6, 33.1e-6); // Reyleigh scattering normal earth
-const vec3 THE_BETA_M = vec3 (21e-6); // Normal Mie scattering
-
-// Parameters
-const float THE_SunAttenuation = 1.0; // sun intensity
-const float THE_EyeHeight = 100.0; // viewer height
-const float THE_HorizonWidth = 0.002;
-const int THE_NbSamples = 8;
-const int THE_NbSamplesLight = 8; // integral sampling rate (might highly hit performance)
-const float THE_SunPower = 5.0;
-const float THE_StarTreshold = 0.98;
-
-// Uniforms
-uniform vec3 uSunDir;
-uniform float uTime;
-uniform float uCloudy;
-uniform float uFog;
-
-float hash13 (in vec3 p3)
-{
- p3 = fract (p3 * 0.1031);
- p3 += dot (p3, p3.zyx + 31.32);
- return fract ((p3.x + p3.y) * p3.z);
-}
-
-float hash12 (in vec2 p)
-{
- vec3 p3 = fract (vec3(p.xyx) * .1031);
- p3 += dot (p3, p3.yzx + 33.33);
- return fract ((p3.x + p3.y) * p3.z);
-}
-
-float smoothStarField (in vec2 theSamplePos)
-{
- vec2 aFract = fract (theSamplePos);
- vec2 aFloorSample = floor (theSamplePos);
- float v1 = hash12 (aFloorSample);
- float v2 = hash12 (aFloorSample + vec2( 0.0, 1.0 ));
- float v3 = hash12 (aFloorSample + vec2( 1.0, 0.0 ));
- float v4 = hash12 (aFloorSample + vec2( 1.0, 1.0 ));
-
- vec2 u = aFract * aFract * (3.0 - 2.0 * aFract);
-
- return mix(v1, v2, u.x) +
- (v3 - v1) * u.y * (1.0 - u.x) +
- (v4 - v2) * u.x * u.y;
-}
-
-float noisyStarField (in vec2 theSamplePos)
-{
- float aStarVal = smoothStarField (theSamplePos);
- if (aStarVal >= THE_StarTreshold)
- {
- aStarVal = pow ((aStarVal - THE_StarTreshold) / (1.0 - THE_StarTreshold), 6.0);
- }
- else
- {
- aStarVal = 0.0;
- }
- return aStarVal;
-}
-
-float smoothNoise (in vec3 theCoord)
-{
- vec3 anInt = floor (theCoord);
- vec3 anFract = fract (theCoord);
- anFract = anFract * anFract * (3.0 - (2.0 * anFract));
- return mix(mix(mix(hash13(anInt ),
- hash13(anInt + vec3(1.0, 0.0, 0.0)), anFract.x),
- mix(hash13(anInt + vec3(0.0, 1.0, 0.0)),
- hash13(anInt + vec3(1.0, 1.0, 0.0)), anFract.x), anFract.y),
- mix(mix(hash13(anInt + vec3(0.0, 0.0, 1.0)),
- hash13(anInt + vec3(1.0, 0.0, 1.0)), anFract.x),
- mix(hash13(anInt + vec3(0.0, 1.0, 1.0)),
- hash13(anInt + vec3(1.0, 1.0, 1.0)), anFract.x), anFract.y), anFract.z);
-}
-
-float fnoise (in vec3 theCoord, in float theTime)
-{
- theCoord *= .25;
- float aNoise;
-
- aNoise = 0.5000 * smoothNoise (theCoord);
- theCoord = theCoord * 3.02; theCoord.y -= theTime * 0.2;
- aNoise += 0.2500 * smoothNoise (theCoord);
- theCoord = theCoord * 3.03; theCoord.y += theTime * 0.06;
- aNoise += 0.1250 * smoothNoise (theCoord);
- theCoord = theCoord * 3.01;
- aNoise += 0.0625 * smoothNoise (theCoord);
- theCoord = theCoord * 3.03;
- aNoise += 0.03125 * smoothNoise (theCoord);
- theCoord = theCoord * 3.02;
- aNoise += 0.015625 * smoothNoise (theCoord);
- return aNoise;
-}
-
-float clouds (in vec3 theTs, in float theTime)
-{
- float aCloud = fnoise (theTs * 2e-4, theTime) + uCloudy * 0.1;
- aCloud = smoothstep (0.44, 0.64, aCloud);
- aCloud *= 70.0;
- return aCloud + uFog;
-}
-
-void densities (in vec3 thePos, out float theRayleigh, out float theMie, in float theTime)
-{
- float aHeight = length (thePos - THE_EARTH_CENTER) - THE_EARTH_RADIUS;
- theRayleigh = exp (-aHeight / THE_HR);
-
- float aCloud = 0.0;
- if (aHeight > 5000.0 && aHeight < 8000.0)
- {
- aCloud = clouds (thePos + vec3 (0.0, 0.,-theTime*3e3), theTime);
- aCloud *= sin (M_PI*(aHeight - 5e3) / 5e3) * uCloudy;
- }
-
- float aCloud2 = 0.0;
- if (aHeight > 12e3 && aHeight < 15.5e3)
- {
- aCloud2 = fnoise (thePos * 3e-4, theTime) * clouds (thePos * 32.0, theTime);
- aCloud2 *= sin (M_PI * (aHeight - 12e3) / 12e3) * 0.05;
- aCloud2 = clamp (aCloud2, 0.0, 1.0);
- }
-
- theMie = exp (-aHeight / THE_HM) + aCloud + uFog;
- theMie += aCloud2;
-}
-
-// ray with sphere intersection problem is reduced to solving the equation
-// (P - C)^2 = r^2 <--- sphere equation
-// where P is P(t) = A + t*B <--- point on ray
-// t^2*dot(B, B) + t*2*dot(B, A-C) + dot(A-C, A-C) - r^2 = 0
-// [ A ] [ B ] [ C ]
-// We just need to solve the above quadratic equation
-float raySphereIntersect (in vec3 theOrig, in vec3 theDir, in float theRadius)
-{
- theOrig = theOrig - THE_EARTH_CENTER;
- // A coefficient will be always 1 (theDir is normalized)
- float B = dot (theOrig, theDir);
- float C = dot (theOrig, theOrig) - theRadius * theRadius;
- // optimized version of classic (-b +- sqrt(b^2 - 4ac)) / 2a
- float aDet2 = B * B - C;
- if (aDet2 < 0.0) { return -1.0; }
- float aDet = sqrt (aDet2);
- float aT1 = -B - aDet;
- float aT2 = -B + aDet;
- return aT1 >= 0.0 ? aT1 : aT2;
-}
-
-void scatter (in vec3 theEye, in vec3 theRay, in vec3 theSun,
- out vec3 theCol, out float theScat, in float theTime)
-{
- float aRayLen = raySphereIntersect (theEye, theRay, THE_ATMO_RADIUS);
- float aMu = dot (theRay, theSun);
- float aMu2 = 1.0 + aMu*aMu;
- // The Raleigh phase function looks like this:
- float aPhaseR = 3.0/(16.0 * M_PI) * aMu2;
- // And the Mie phase function equation is:
- float aPhaseM = (3.0 / (8.0 * M_PI) * (1.0 - THE_G2) * aMu2)
- / ((2.0 + THE_G2) * pow (1.0 + THE_G2 - 2.0 * THE_G * aMu, 1.5));
-
- float anOpticalDepthR = 0.0;
- float anOpticalDepthM = 0.0;
- vec3 aSumR = vec3 (0.0);
- vec3 aSumM = vec3 (0.0); // Mie and Rayleigh contribution
-
- float dl = aRayLen / float (THE_NbSamples);
- for (int i = 0; i < THE_NbSamples; ++i)
- {
- float l = float(i) * dl;
- vec3 aSamplePos = theEye + theRay * l;
-
- float dR, dM;
- densities (aSamplePos, dR, dM, theTime);
- dR *= dl;
- dM *= dl;
- anOpticalDepthR += dR;
- anOpticalDepthM += dM;
-
- float aSegmentLengthLight = raySphereIntersect (aSamplePos, theSun, THE_ATMO_RADIUS);
- if (aSegmentLengthLight > 0.0)
- {
- float dls = aSegmentLengthLight / float (THE_NbSamplesLight);
- float anOpticalDepthRs = 0.0;
- float anOpticalDepthMs = 0.0;
- for (int j = 0; j < THE_NbSamplesLight; ++j)
- {
- float ls = float (j) * dls;
- vec3 aSamplePosS = aSamplePos + theSun * ls;
- float dRs, dMs;
- densities (aSamplePosS, dRs, dMs, theTime);
- anOpticalDepthRs += dRs * dls;
- anOpticalDepthMs += dMs * dls;
- }
-
- vec3 anAttenuation = exp (-(THE_BETA_R * (anOpticalDepthR + anOpticalDepthRs)
- + THE_BETA_M * (anOpticalDepthM + anOpticalDepthMs)));
- aSumR += anAttenuation * dR;
- aSumM += anAttenuation * dM;
- }
- }
-
- theCol = THE_SunPower * (aSumR * THE_BETA_R * aPhaseR + aSumM * THE_BETA_M * aPhaseM);
- theScat = 1.0 - clamp (anOpticalDepthM*1e-5, 0.0, 1.0);
-}
-
-// This is where all the magic happens. We first raymarch along the primary ray
-// (from the camera origin to the point where the ray exits the atmosphere).
-// For each sample along the primary ray,
-// we then "cast" a light ray and raymarch along that ray as well.
-// We basically shoot a ray in the direction of the sun.
-vec4 computeIncidentLight (in vec3 theRayDirection, in vec2 theUv, in float theTime)
-{
- float aSunAttenuation = THE_SunAttenuation;
- vec3 aSunDir = uSunDir;
- // conversion to moon
- float aStarAttenuation = 0.0;
- if (aSunDir.y < 0.0)
- {
- aSunDir *= -1.0;
- aSunAttenuation = aSunAttenuation * 0.1;
- aStarAttenuation = sqrt (aSunDir.y);
- }
-
- vec3 anEyePosition = vec3(0.0, THE_EyeHeight, 0.0);
-
- // draw a water surface horizontally symmetrically to the sky
- if (theRayDirection.y <= -THE_HorizonWidth / 2.0)
- {
- theRayDirection.y = -THE_HorizonWidth - theRayDirection.y;
- }
-
- float aScattering = 0.0;
- vec3 aColor = vec3 (0.0);
-
- scatter (anEyePosition, theRayDirection, aSunDir, aColor, aScattering, theTime);
- aColor *= aSunAttenuation;
- float aStarIntensity = noisyStarField (theUv * 2048.0);
- vec3 aStarColor = vec3 (aScattering * aStarIntensity * aStarAttenuation);
- aColor += aStarColor;
-
- return vec4 (1.18 * pow (aColor, vec3(0.7)), 1.0);
-}
-
-uniform int uSide;
-
-void main()
-{
- vec2 anUv = vec2 (2.0 * TexCoord.x - 1.0,
- 2.0 * TexCoord.y - 1.0);
- vec3 aPlanes[6];
- aPlanes[0] = vec3 (+1.0, 0.0, 0.0);
- aPlanes[1] = vec3 (-1.0, 0.0, 0.0);
- aPlanes[2] = vec3 ( 0.0,+1.0, 0.0);
- aPlanes[3] = vec3 ( 0.0,-1.0, 0.0);
- aPlanes[4] = vec3 ( 0.0, 0.0,+1.0);
- aPlanes[5] = vec3 ( 0.0, 0.0,-1.0);
- vec3 aRayDirection;
- if (uSide == 0)
- {
- // Positive X side
- aRayDirection = aPlanes[0] + vec3 (0.0, +anUv.y, -anUv.x);
- }
- else if (uSide == 1)
- {
- // Negative X side
- aRayDirection = aPlanes[1] + vec3 (0.0, +anUv.y, +anUv.x);
- }
- else if (uSide == 2)
- {
- // Positive Y side
- aRayDirection = aPlanes[2] + vec3 (+anUv.x, 0.0, +anUv.y);
- }
- else if (uSide == 3)
- {
- // Negative Y side
- aRayDirection = aPlanes[3] + vec3 (+anUv.x, 0.0, -anUv.y);
- }
- else if (uSide == 4)
- {
- // Positive Z side
- aRayDirection = aPlanes[4] + vec3 (+anUv.x, +anUv.y, 0.0);
- }
- else if (uSide == 5)
- {
- // Negative Z side
- aRayDirection = aPlanes[5] + vec3 (-anUv.x, +anUv.y, 0.0);
- }
-
- occFragColor = computeIncidentLight (normalize (aRayDirection), anUv, uTime);
-}
+++ /dev/null
-//! Calculates transformation from tangent space and apply it to value from normal map to get normal in object space
-vec3 TangentSpaceNormal (in mat2 theDeltaUVMatrix,
- in mat2x3 theDeltaVectorMatrix,
- in vec3 theNormalMapValue,
- in vec3 theNormal,
- in bool theIsInverse)
-{
- theNormalMapValue = normalize(theNormalMapValue * 2.0 - vec3(1.0));
- // Inverse matrix
- theDeltaUVMatrix = mat2 (theDeltaUVMatrix[1][1], -theDeltaUVMatrix[0][1], -theDeltaUVMatrix[1][0], theDeltaUVMatrix[0][0]);
- theDeltaVectorMatrix = theDeltaVectorMatrix * theDeltaUVMatrix;
- // Gram-Schmidt orthogonalization
- theDeltaVectorMatrix[1] = normalize(theDeltaVectorMatrix[1] - dot(theNormal, theDeltaVectorMatrix[1]) * theNormal);
- theDeltaVectorMatrix[0] = cross(theDeltaVectorMatrix[1], theNormal);
- float aDirection = theIsInverse ? -1.0 : 1.0;
- return mat3 (aDirection * theDeltaVectorMatrix[0], aDirection * theDeltaVectorMatrix[1], theNormal) * theNormalMapValue;
-}
+++ /dev/null
-appresource:::Standard
-appresource:::StandardLite
-appresource:::TObj
-appresource:::XCAF
-appresource:::MigrationSheet.txt
-loginfile:::Plugin
+++ /dev/null
-TDataStd_Shape TDataXtd_Shape
-TDataStd_Constraint TDataXtd_Constraint
-TDataStd_Geometry TDataXtd_Geometry
-TDataStd_Axis TDataXtd_Axis
-TDataStd_Point TDataXtd_Point
-TDataStd_Plane TDataXtd_Plane
-TDataStd_Position TDataXtd_Position
-TDataStd_Placement TDataXtd_Placement
-TDataStd_PatternStd TDataXtd_PatternStd
-TPrsStd_AISPresentation TDataXtd_Presentation
-PDataStd_Shape PDataXtd_Shape
-PDataStd_Constraint PDataXtd_Constraint
-PDataStd_Geometry PDataXtd_Geometry
-PDataStd_Axis PDataXtd_Axis
-PDataStd_Point PDataXtd_Point
-PDataStd_Plane PDataXtd_Plane
-PDataStd_Position PDataXtd_Position
-PDataStd_Placement PDataXtd_Placement
-PDataStd_PatternStd PDataXtd_PatternStd
-
-
+++ /dev/null
-! Description of available plugins
-! ********************************
-!
-! standard attribute drivers plugin
-!
-ad696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStd
-!
-! standard attribute drivers plugin
-!
-bd696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdL
-!
-! XmlOcaf Document Plugin
-!
-03a56820-8269-11d5-aab2-0050044b1af1.Location: TKXml
-03a56822-8269-11d5-aab2-0050044b1af1.Location: TKXml
-03a56824-8269-11d5-aab2-0050044b1af1.Location: TKXml
-!
-! XmlLOcaf Document Plugin
-!
-13a56820-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
-13a56822-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
-13a56824-8269-11d5-aab2-0050044b1af1.Location: TKXmlL
-!
-! BinOcaf Document Plugin
-!
-03a56835-8269-11d5-aab2-0050044b1af1.Location: TKBin
-03a56836-8269-11d5-aab2-0050044b1af1.Location: TKBin
-!
-! BinLOcaf Document Plugin
-!
-13a56835-8269-11d5-aab2-0050044b1af1.Location: TKBinL
-13a56836-8269-11d5-aab2-0050044b1af1.Location: TKBinL
-!
-! XmlXCAF Document Plugin
-!
-f78ff496-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
-f78ff497-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
-!
-! BinXCAF Document Plugin
-!
-a78ff496-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF
-a78ff497-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF
-!
-! TObjXml Document Plugin
-!
-f78ff4a0-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj
-f78ff4a1-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj
-!
-! TObjBin Document Plugin
-!
-f78ff4a2-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj
-f78ff4a3-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj
+++ /dev/null
-formatlist:MDTV-Standard|XmlOcaf|BinOcaf
-!
-! Default format
-xml.FileFormat: XmlOcaf
-cbf.FileFormat: BinOcaf
-!
-! standard attributes
-!
-MDTV-Standard.Description: Standard Document Version 1.0
-MDTV-Standard.FileExtension: std
-MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
-!
-! XmlOcaf format
-!
-XmlOcaf.Description: Xml Document Version 1.0
-XmlOcaf.FileExtension: xml
-XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1
-XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1
-!
-! BinOcaf format
-!
-BinOcaf.Description: Bin Ocaf Document Version 1.0
-BinOcaf.FileExtension: cbf
-BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1
-BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1
+++ /dev/null
-formatlist:OCC-StdLite|BinLOcaf|XmlLOcaf
-!
-!
-! Lite attributes
-!
-OCC-StdLite.Description: Lite Document Version 1.0
-OCC-StdLite.FileExtension: stdl
-OCC-StdLite.RetrievalPlugin: bd696001-5b34-11d1-b5ba-00a0c9064368
-!
-! BinLOcaf format
-!
-BinLOcaf.Description: Lite Bin Ocaf Document Version 1.0
-BinLOcaf.FileExtension: cbfl
-BinLOcaf.StoragePlugin: 13a56835-8269-11d5-aab2-0050044b1af1
-BinLOcaf.RetrievalPlugin: 13a56836-8269-11d5-aab2-0050044b1af1
-!
-! XmlLOcaf format
-!
-XmlLOcaf.Description: Lite Xml Document Version 1.0
-XmlLOcaf.FileExtension: xmll
-XmlLOcaf.StoragePlugin: 13a56820-8269-11d5-aab2-0050044b1af1
-XmlLOcaf.RetrievalPlugin: 13a56822-8269-11d5-aab2-0050044b1af1
+++ /dev/null
-formatlist: TObjXml|TObjBin
-!
-! Default format
-xml.FileFormat: TObjXml
-cbf.FileFormat: TObjBin
-!
-! TObjXml format
-TObjXml.Description: TObj XML Document Version 1.0
-TObjXml.FileExtension: xml
-TObjXml.StoragePlugin: f78ff4a0-a779-11d5-aab4-0050044b1af1
-TObjXml.RetrievalPlugin: f78ff4a1-a779-11d5-aab4-0050044b1af1
-!
-! TObjBin format
-TObjBin.Description: TObj BIN Document Version 1.0
-TObjBin.FileExtension: cbf
-TObjBin.StoragePlugin: f78ff4a2-a779-11d5-aab4-0050044b1af1
-TObjBin.RetrievalPlugin: f78ff4a3-a779-11d5-aab4-0050044b1af1
+++ /dev/null
-formatlist: MDTV-XCAF XmlXCAF BinXCAF MDTV-Standard XmlOcaf BinOcaf
-!
-! Default format
-xml.FileFormat: XmlXCAF
-!
-! XCAF attributes
-!
-MDTV-XCAF.Description: XCAF Document Version 1.0
-MDTV-XCAF.FileExtension: dxc
-MDTV-XCAF.StoragePlugin: ed8793f8-3142-11d4-b9b5-0060b0ee281b
-MDTV-XCAF.RetrievalPlugin: ed8793f9-3142-11d4-b9b5-0060b0ee281b
-MDTV-XCAFSchema: ed8793fa-3142-11d4-b9b5-0060b0ee281b
-!
-! XmlXCAF format
-!
-XmlXCAF.Description: XmlXCAF Document Version 1.0
-XmlXCAF.FileExtension: xml
-XmlXCAF.StoragePlugin: f78ff496-a779-11d5-aab4-0050044b1af1
-XmlXCAF.RetrievalPlugin: f78ff497-a779-11d5-aab4-0050044b1af1
-!
-! BinXCAF format
-!
-BinXCAF.Description: BinXCAF Document Version 1.0
-BinXCAF.FileExtension: xbf
-BinXCAF.StoragePlugin: a78ff496-a779-11d5-aab4-0050044b1af1
-BinXCAF.RetrievalPlugin: a78ff497-a779-11d5-aab4-0050044b1af1
-!
-! standard attributes
-!
-MDTV-Standard.Description: Standard Document Version 1.0
-MDTV-Standard.FileExtension: std
-MDTV-Standard.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
-MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
-MDTV-StandardSchema: ad696002-5b34-11d1-b5ba-00a0c9064368
-MDTV-Standard.AttributeStoragePlugin: 47b0b826-d931-11d1-b5da-00a0c9064368
-MDTV-Standard.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c9064368
-!
-! XmlOcaf format
-!
-XmlOcaf.Description: Xml Document Version 1.0
-XmlOcaf.FileExtension: xml
-XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1
-XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1
-!
-! BinOcaf format
-!
-BinOcaf.Description: Bin Ocaf Document Version 1.0
-BinOcaf.FileExtension: cbf
-BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1
-BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1
-TObj.msg
TObj_Application.cxx
TObj_Application.hxx
TObj_Assistant.cxx
+++ /dev/null
-!!!!!!!!!! ----- Messages file for TObj packages --------- !!!!!!!!!
-! Syntax for keywords: NameOfPackage_NameOfClass_NameOfMessage
-! where NameOfClass is optional or abbreviated
-!!!!!!!!!! --------------------------------------------------- !!!!!!!!!
-
-.TObj_Appl_SDriverFailure
- Error saving document %s : driver failure. Check presence of resource files.
-
-.TObj_Appl_SWriteFailure
- Error saving document %s : write failure
-
-.TObj_Appl_SFailure
- Error saving document %s : general failure of persistence driver
-
-.TObj_Appl_SDocIsNull
- Error saving document %s : No document to save
-
-.TObj_Appl_SNoObj
- Error saving document %s : No objects written
-
-.TObj_Appl_SInfoSectionError
- Error saving document %s : Write info section failure
-
-.TObj_Appl_SUnknownFailure
- Error saving document %s : unknown failure
-
-.TObj_Appl_RUnknownDocument
- Error loading document %s : unknown document
-
-.TObj_Appl_RAlreadyRetrieved
- Error loading document %s : already retrieved
-
-.TObj_Appl_RAlreadyRetrievedAndModified
- Error loading document %s : already retrieved and modified
-
-.TObj_Appl_RNoDriver
- Error loading document %s : no appropriate driver was found
-
-.TObj_Appl_ROpenError
- Error loading document %s : cannot open file
-
-.TObj_Appl_RNoVersion
- Error loading document %s : no version
-
-.TObj_Appl_RNoModel
- Error loading document %s : no model
-
-.TObj_Appl_RNoDocument
- Error loading document %s : no document
-
-.TObj_Appl_RFormatFailure
- Error loading document %s : format failure
-
-.TObj_Appl_RTypeNotFound
- Error loading document %s : type not found in schema
-
-.TObj_Appl_RBadFileFormat
- Error loading document %s : unrecognized file format
-
-.TObj_Appl_RMakeFailure
- Error loading document %s : failure making document
-
-.TObj_Appl_RPermissionDenied
- Error loading document %s : permission denied
-
-.TObj_Appl_RDriverFailure
- Error loading document %s : driver failure
-
-.TObj_Appl_RUnknownFail
- Error loading document %s : unknown failure
-
-.TObj_Appl_RException
- Error loading document %s : the file is probably corrupted
-
-.TObj_Appl_Exception
- An exception was caught: %s
-
-.TObj_M_LoadDocument
- +++++ Load document %s
-
-.TObj_M_WrongFile
- File %s has wrong content
-
-.TObj_M_NoWriteAccess
- Cannot write the file %s, check permissions
-// This file has been automatically generated from resource file src/TObj/TObj.msg
+// clang-format off
+// This file has been automatically generated from resource file resources/TObj/TObj.msg
static const char TObj_TObj_msg[] =
"!!!!!!!!!! ----- Messages file for TObj packages --------- !!!!!!!!!\n"
"\n"
".TObj_M_NoWriteAccess\n"
" Cannot write the file %s, check permissions\n";
+
+// clang-format on
-icon:::1d_elevation.rgb
-icon:::2d_alienskin.rgb
-icon:::2d_aluminum.rgb
-icon:::2d_blue_rock.rgb
-icon:::2d_bluewhite_paper.rgb
-icon:::2d_brushed.rgb
-icon:::2d_bubbles.rgb
-icon:::2d_bumps.rgb
-icon:::2d_cast.rgb
-icon:::2d_chipbd.rgb
-icon:::2d_clouds.rgb
-icon:::2d_flesh.rgb
-icon:::2d_floor.rgb
-icon:::2d_galvnisd.rgb
-icon:::2d_grass.rgb
-icon:::2d_knurl.rgb
-icon:::2d_maple.rgb
-icon:::2d_marble.rgb
-icon:::2d_MatraDatavision.rgb
-icon:::2d_mottled.rgb
-icon:::2d_rain.rgb
-icon:::2d_rock.rgb
-icon:::2d_chess.rgba
-icon:::env_clouds.rgb
-icon:::env_cv.rgb
-icon:::env_lines.rgb
-icon:::env_medit.rgb
-icon:::env_pearl.rgb
-icon:::env_road.rgb
-icon:::env_sky1.rgb
-icon:::env_sky2.rgb
Textures_EnvLUT.pxx
+++ /dev/null
-MASS: kg
-LENGTH: m
-TIME: s
-ELECTRIC CURRENT: A
-THERMODYNAMIC TEMPERATURE: °K
-AMOUNT OF SUBSTANCE: mol
-PLANE ANGLE: rad
-SOLID ANGLE: sr
-AREA: m²
-VOLUME: m³
-INERTIA: m**4
-ANGULAR SPEED: rad/s
-SPEED: m/s
-ACCELERATION: m/s²
-FREQUENCY: Hz
-VOLUMIC MASS: kg/m³
-MASS FLOW: kg/s
-VOLUME FLOW: m³/s
-CONSUMPTION: m²
-QUANTITY OF MOVEMENT: kg*m/s
-KINETIC MOMENT: kg*m²/s
-MOMENT OF INERTIA: kg*m²
-FORCE: N
-MOMENT OF A FORCE: N*m
-LINEIC FORCE: N/m
-PRESSURE: Pa
-DYNAMIC VISCOSITY: Pa/s
-KINETIC VISCOSITY: m²/s
-TENSION SUPERFICIELLE: m/s²
-ELECTRIC POTENTIAL: V
-ENERGY: J
-POWER: W
-LINEIC POWER: W/m
-SURFACIC POWER: W/m²
-VOLUMIC POWER: W/m³
-COEFFICIENT OF LINEAR INFLATION: 1./°K
-THERMICAL CONDUCTIVITY: W/m/°K
-THERMICAL CONVECTIVITY: W/m²/°K
-THERMICAL MASSIC CAPACITY: J/kg/°K
-ENTROPY: J/°K
-ENTHALPY: J
-LUMINOUS FLUX: Lu
-LUMINANCE: cd/m²
-EXITANCE: lx
-LUMINOUS INTENSITY: cd
-LUMINOUS EXPOSITION: lx*s
-LUMINOUS EFFICACITY: Lu/W
-LUMINOUS FLUX: Lu
-ILLUMINANCE: lx
-ELECTRIC CHARGE: C
-ELECTRIC FIELD: V/m
-ELECTRIC CAPACITANCE: F
-MAGNETIC FIELD: A/m
-MAGNETIC FLUX DENSITY: T
-MAGNETIC FLUX: Wb
-INDUCTANCE: H
-RELUCTANCE: 1./H
-ELECTRIC RESISTANCE: O
-ELECTRIC CONDUCTANCE: S
-RESISTIVITY: O*m
-CONDUCTIVITY: S/m
-MOLAR MASS: kg/mol
-MOLAR VOLUME: m³/mol
-CONCENTRATION: kg/m³
-MOLAR CONCENTRATION: mol/m³
-MOLARITY: mol/kg
-ACCOUSTIC INTENSITY: B
-DOSE EQUIVALENT: Si
-ABSORBED DOSE: Gr
-ACTIVITY (OF A RADIONUCLEIDE): Be
-FLUX OF MAGNETIC INDUCTION: kg*m²/s²/A
-ROTATION ACCELERATION: rad/s²
-TRANSLATION STIFFNESS: N/m
-ROTATION STIFFNESS: N*m/rad
-CurrentUnits
-MDTVBaseUnits
-MDTVCurrentUnits
-Units.dat
UnitsAPI.cxx
UnitsAPI.hxx
UnitsAPI_SystemUnits.hxx
+++ /dev/null
-MASS: kg
-LENGTH: mm
-TIME: s
-ELECTRIC CURRENT: A
-THERMODYNAMIC TEMPERATURE: °K
-AMOUNT OF SUBSTANCE: mol
-PLANE ANGLE: rad
-SOLID ANGLE: sr
-AREA: mm²
-VOLUME: mm³
-INERTIA: mm**4
-ANGULAR SPEED: rad/s
-SPEED: mm/s
-ACCELERATION: mm/s²
-FREQUENCY: Hz
-VOLUMIC MASS: kg/mm³
-MASS FLOW: kg/s
-VOLUME FLOW: mm³/s
-CONSUMPTION: mm²
-QUANTITY OF MOVEMENT: kg*mm/s
-KINETIC MOMENT: kg*mm²/s
-MOMENT OF INERTIA: kg*mm²
-FORCE: kg*mm/s²
-MOMENT OF A FORCE: kg*mm²/s²
-PRESSURE: kg/(mm*s²)
-DYNAMIC VISCOSITY: kg/(mm*s)
-KINETIC VISCOSITY: mm²/s
-TENSION SUPERFICIELLE: mm/s²
-ELECTRIC POTENTIAL: V
-ENERGY: kg*mm²/s²
-POWER: kg*mm²/s³
-LINEIC POWER: kg*mm/s³
-SURFACIC POWER: kg/s³
-VOLUMIC POWER: kg/(mm*s³)
-COEFFICIENT OF LINEAR INFLATION: 1./°K
-THERMICAL CONDUCTIVITY: kg*mm/(s³*°K)
-THERMICAL CONVECTIVITY: kg/(s³*°K)
-THERMICAL MASSIC CAPACITY: mm²/(s²*°K)
-ENTROPY: kg*mm²/(s²*°K)
-ENTHALPY: kg*mm²/s²
-LUMINOUS FLUX: Lu
-LUMINANCE: cd/mm²
-EXITANCE: lx
-LUMINOUS INTENSITY: cd
-LUMINOUS EXPOSITION: lx*s
-LUMINOUS EFFICACITY: s³*Lu/(kg*mm²)
-LUMINOUS FLUX: Lu
-ILLUMINANCE: lx
-ELECTRIC CHARGE: C
-ELECTRIC FIELD: V/mm
-ELECTRIC CAPACITANCE: s**4*A²/(kg*mm²)
-MAGNETIC FIELD: A/mm
-MAGNETIC FLUX DENSITY: T
-MAGNETIC FLUX: kg*mm²/(s²*A)
-INDUCTANCE: kg*mm²/(s²*A²)
-RELUCTANCE: s²*A²/(kg*mm²)
-ELECTRIC RESISTANCE: O
-ELECTRIC CONDUCTANCE: S
-RESISTIVITY: O*mm
-CONDUCTIVITY: S/mm
-MOLAR MASS: kg/mol
-MOLAR VOLUME: mm³/mol
-CONCENTRATION: kg/mm³
-MOLAR CONCENTRATION: mol/mm³
-MOLARITY: mol/kg
-ACCOUSTIC INTENSITY: mm/A²
-DOSE EQUIVALENT: mm²/s²
-ABSORBED DOSE: mm²/s²
-ACTIVITY (OF A RADIONUCLEIDE): Be
-FLUX OF MAGNETIC INDUCTION: kg*mm\062/(s\062*A)
+++ /dev/null
-MASS: kg
-LENGTH: mm
-TIME: s
-ELECTRIC CURRENT: A
-THERMODYNAMIC TEMPERATURE: °K
-AMOUNT OF SUBSTANCE: mol
-PLANE ANGLE: rad
-SOLID ANGLE: sr
-AREA: mm²
-VOLUME: mm³
-INERTIA: mm**4
-ANGULAR SPEED: rad/s
-SPEED: mm/s
-ACCELERATION: mm/s²
-FREQUENCY: Hz
-VOLUMIC MASS: kg/mm³
-MASS FLOW: kg/s
-VOLUME FLOW: mm³/s
-CONSUMPTION: mm²
-QUANTITY OF MOVEMENT: kg*mm/s
-KINETIC MOMENT: kg*mm²/s
-MOMENT OF INERTIA: kg*mm²
-FORCE: kg*mm/s²
-MOMENT OF A FORCE: kg*mm²/s²
-LINEIC FORCE: kg/s²
-PRESSURE: kg/(mm*s²)
-DYNAMIC VISCOSITY: kg/(mm*s)
-KINETIC VISCOSITY: mm²/s
-TENSION SUPERFICIELLE: mm/s²
-ELECTRIC POTENTIAL: V
-ENERGY: kg*mm²/s²
-POWER: kg*mm²/s³
-LINEIC POWER: kg*mm/s³
-SURFACIC POWER: kg/s³
-VOLUMIC POWER: kg/(mm*s³)
-COEFFICIENT OF LINEAR INFLATION: 1./°K
-THERMICAL CONDUCTIVITY: kg*mm/(s³*°K)
-THERMICAL CONVECTIVITY: kg/(s³*°K)
-THERMICAL MASSIC CAPACITY: mm²/(s²*°K)
-ENTROPY: kg*mm²/(s²*°K)
-ENTHALPY: kg*mm²/s²
-LUMINOUS FLUX: Lu
-LUMINANCE: cd/mm²
-EXITANCE: lx
-LUMINOUS INTENSITY: cd
-LUMINOUS EXPOSITION: lx*s
-LUMINOUS EFFICACITY: s³*Lu/(kg*mm²)
-LUMINOUS FLUX: Lu
-ILLUMINANCE: lx
-ELECTRIC CHARGE: C
-ELECTRIC FIELD: V/mm
-ELECTRIC CAPACITANCE: s**4*A²/(kg*mm²)
-MAGNETIC FIELD: A/mm
-MAGNETIC FLUX DENSITY: T
-MAGNETIC FLUX: kg*mm²/(s²*A)
-INDUCTANCE: kg*mm²/(s²*A²)
-RELUCTANCE: s²*A²/(kg*mm²)
-ELECTRIC RESISTANCE: O
-ELECTRIC CONDUCTANCE: S
-RESISTIVITY: O*mm
-CONDUCTIVITY: S/mm
-MOLAR MASS: kg/mol
-MOLAR VOLUME: mm³/mol
-CONCENTRATION: kg/mm³
-MOLAR CONCENTRATION: mol/mm³
-MOLARITY: mol/kg
-ACCOUSTIC INTENSITY: mm/A²
-DOSE EQUIVALENT: mm²/s²
-ABSORBED DOSE: mm²/s²
-ACTIVITY (OF A RADIONUCLEIDE): Be
-FLUX OF MAGNETIC INDUCTION: kg*mm²/(s²*A)
-ROTATION ACCELERATION: rad/s²
-TRANSLATION STIFFNESS: kg/s²
-ROTATION STIFFNESS: kg*mm²/(s²*rad)
+++ /dev/null
-....................................................................................................................................
- M L T I K N J P S
-DIMENSIONLESS 0 0 0 0 0 0 0 0 0
-....................................................................................................................................
-no unit K 1.
-percent % 0.01 K
-
-....................................................................................................................................
- M L T I K N J P S
-MASS 1 0 0 0 0 0 0 0 0
-....................................................................................................................................
-gram g .001
-metric carat ct .2 g
-quintal q 100 kg
-tonne t 1000 kg
-
-grain gr .06479891 g
-apothecaries'dram (U.S.) dram_ap 3.88793E-03 kg
-apothecaries'ounce oz_apoth(U.K.) 3.11035E-02 kg
- oz_ap(U.S.)
-ounce oz 437.5 gr
-pound lb 16 oz
-cental cental 100 lb
-short hundredweight sh.cwt 100 lb
-hundredweight cwt 112 lb
-short ton sh.ton 2000 lb
-ton ton 2240 lb
-....................................................................................................................................
- M L T I K N J P S
-LENGTH 0 1 0 0 0 0 0 0 0
-....................................................................................................................................
-meter m
-angstrom \xC5 1.E-10 m
- angstrom
-brasse brasse 1.8288 m
-arpent (Quebec) arpent_longueur 58.47131 m
-micron \xB5 10000 \xC5
- micron
-
-mille mille 1852 m
-light year Al 9.46053E+15 m
-
-inch in. 0.0254 m
- in
-caliber caliber 1 in.
-foot ft. 12 in
- ft
-
-yard yd. 3 ft.
- yd
-
-statute mile stat.mile 1760 yd.
-nautical mile naut.mile 1852 m
-....................................................................................................................................
- M L T I K N J P S
-TIME 0 0 1 0 0 0 0 0 0
-....................................................................................................................................
-second of time s
-minute of time min 60 s
- mn
-
-hour h 60 min
-day j 24 h
-year y 365.25 j
-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*\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 \260K
- deg.K
-
-Celsius degree of temperature \260C [273.15] \260K
- deg.C
-
-Rankine degree of temperature \260R (5/9) \260K
- deg.R
-
-Fahrenheit degree of temperature \260F [(1379/3)] \260R
- deg.F
-....................................................................................................................................
- M L T I K N J P S
-AMOUNT OF SUBSTANCE 0 0 0 0 0 1 0 0 0
-....................................................................................................................................
-mole mol
-....................................................................................................................................
- M L T I K N J P S
-LUMINOUS INTENSITY 0 0 0 0 0 0 1 0 0
-....................................................................................................................................
-candela cd
-bougie nouvelle bougie_nouvelle 1 cd
-....................................................................................................................................
- M L T I K N J P S
-PLANE ANGLE 0 0 0 0 0 0 0 1 0
-....................................................................................................................................
-radian rad
-second of angle "
-minute of angle ' 60 "
-
-degre of angle \xB0 60 '
- deg
-
-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*\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\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\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\xB3
-baril (U.S.) baril(U.S.) 42 gal(U.S.)
-barrel (U.S.) barrel(U.S.) .158987 m\xB3
-
-dry barrel (U.S.) bbl .115627 m\xB3
-
-pint (U.K.) pt. 34.67636 cu.in.
- 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\xB3
-baril (U.K.) baril(U.K.) 36 gal(U.K.)
-
-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
-....................................................................................................................................
- M L T I K N J P S
-INERTIA 0 4 0 0 0 0 0 0 0
-....................................................................................................................................
-
-
-....................................................................................................................................
- M L T I K N J P S
-ANGULAR SPEED 0 0 -1 0 0 0 0 1 0
-....................................................................................................................................
-revolution per minute r.p.m. 1 tr/min
-....................................................................................................................................
- M L T I K N J P S
-SPEED 0 1 -1 0 0 0 0 0 0
-....................................................................................................................................
-knot(U.K.) kn 1 naut.mile/h
-mile per hour m.p.h. 1 stat.mile/h
-noeud noeud 1 mille/h
-....................................................................................................................................
- M L T I K N J P S
-ACCELERATION 0 1 -2 0 0 0 0 0 0
-....................................................................................................................................
-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
-....................................................................................................................................
-hertz Hz
-baud baud 1 Hz
-....................................................................................................................................
- M L T I K N J P S
-ACTIVITY (OF A RADIONUCLEIDE) 0 0 -1 0 0 0 0 0 0
-....................................................................................................................................
-becquerel Be
-....................................................................................................................................
- M L T I K N J P S
-VOLUMIC MASS 1 -3 0 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MASS FLOW 1 0 -1 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-VOLUME FLOW 0 3 -1 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-CONSUMPTION 0 2 0 0 0 0 0 0 0
-....................................................................................................................................
-litre aux 100 kilometers l/100km
-mile per gallon (U.S.) m.p.g.(U.S.) 235.2 l/100km
-mile per gallon (U.K.) m.p.g.(U.K.) 282.5 l/100km
-....................................................................................................................................
- M L T I K N J P S
-QUANTITY OF MOVEMENT 1 1 -1 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-KINETIC MOMENT 1 2 -1 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MOMENT OF INERTIA 1 2 0 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-FORCE 1 1 -2 0 0 0 0 0 0
-....................................................................................................................................
-newton N
-dyne dyn 1.E-05 N
-gram-force gf .00980665 N
-poundal pdl 0.138255 N
-pound-force lbf 4.44822 N
-sthene sn 1000 N
-....................................................................................................................................
- M L T I K N J P S
-MOMENT OF A FORCE 1 2 -2 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-LINEIC FORCE 1 0 -2 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-PRESSURE 1 -1 -2 0 0 0 0 0 0
-....................................................................................................................................
-pascal Pa
-athmosphere atm 101325 Pa
-athmosphere technique at 98066.5 Pa
-bar bar 100000 Pa
-barye barye 0.1 Pa
-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\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 g/cm/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\xB2/s
-....................................................................................................................................
- M L T I K N J P S
-TENSION SUPERFICIELLE 1 0 -2 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC POTENTIAL 1 2 -3 -1 0 0 0 0 0
-....................................................................................................................................
-volt V
-....................................................................................................................................
- M L T I K N J P S
-ENERGY 1 2 -2 0 0 0 0 0 0
-....................................................................................................................................
-joule J
-electron-volt eV 1.59E-19 J
-erg erg 1.E-07 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
-
-horse-power-hour HP-h 2684500 J
-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 (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
-....................................................................................................................................
-watt W
-cheval-vapeur ch 735.5 W
-poncelet poncelet 100 kgfm/s
-var var 1 V.A
-
-horse-power HP 1.025 ch
-ton of refrigeration ton_of_ref. 3516 W
-british commercial ton of refrigeration brit.comm.ton_of_ref. 3883 W
-....................................................................................................................................
- M L T I K N J P S
-LINEIC POWER 1 1 -3 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-SURFACIC POWER 1 0 -3 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-VOLUMIC POWER 1 -1 -3 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-COEFFICIENT OF LINEAR INFLATION 0 0 0 0 -1 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-THERMICAL CONDUCTIVITY 1 1 -3 0 -1 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-THERMICAL CONVECTIVITY 1 0 -3 0 -1 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-THERMICAL MASSIC CAPACITY 0 2 -2 0 -1 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ENTROPY 1 2 -2 0 -1 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ENTHALPY 1 2 -2 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-LUMINOUS FLUX 0 0 0 0 0 0 1 0 1
-....................................................................................................................................
-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\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
-....................................................................................................................................
-lux lx
-phot ph 1.E+04 lx
-....................................................................................................................................
- M L T I K N J P S
-LUMINOUS EXPOSITION 0 -2 1 0 0 0 1 0 1
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-LUMINOUS EFFICACITY -1 -2 3 0 0 0 1 0 1
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC CHARGE 0 0 1 1 0 0 0 0 0
-....................................................................................................................................
-coulomb C
-ampere-hour Ah 3.6E+03 C
-franklin Fr 333.563E-12 C
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC FIELD 1 1 -3 -1 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC CAPACITANCE -1 -2 4 2 0 0 0 0 0
-....................................................................................................................................
-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*\xB6) A/m
-....................................................................................................................................
- M L T I K N J P S
-MAGNETIC FLUX 1 2 -2 -1 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MAGNETIC FLUX DENSITY 1 0 -2 -1 0 0 0 0 0
-....................................................................................................................................
-tesla T
-gauss Gs 1.E-04 T
-....................................................................................................................................
- M L T I K N J P S
-FLUX OF MAGNETIC INDUCTION 1 2 -2 -1 0 0 0 0 0
-....................................................................................................................................
-weber Wb
-maxwell Mx 1.E-08 Wb
-....................................................................................................................................
- M L T I K N J P S
-INDUCTANCE 1 2 -2 -2 0 0 0 0 0
-....................................................................................................................................
-henry H
-....................................................................................................................................
- M L T I K N J P S
-RELUCTANCE -1 -2 2 2 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC RESISTANCE 1 2 -3 -2 0 0 0 0 0
-....................................................................................................................................
-ohm O
-....................................................................................................................................
- M L T I K N J P S
-ELECTRIC CONDUCTANCE -1 -2 3 2 0 0 0 0 0
-....................................................................................................................................
-siemens S
-....................................................................................................................................
- M L T I K N J P S
-RESISTIVITY 1 3 -3 -2 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-CONDUCTIVITY -1 -3 3 2 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MOLAR MASS 1 0 0 0 0 -1 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MOLAR VOLUME 0 3 0 0 0 -1 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-CONCENTRATION 1 -3 0 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MOLAR CONCENTRATION 0 -3 0 0 0 1 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-MOLARITY -1 0 0 0 0 1 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ACOUSTIC INTENSITY 0 1 0 -2 0 0 0 0 0
-....................................................................................................................................
-bel B
-neper Np 0.869 B
-....................................................................................................................................
- M L T I K N J P S
-ABSORBED DOSE 0 2 -2 0 0 0 0 0 0
-....................................................................................................................................
-gray Gr
-....................................................................................................................................
- M L T I K N J P S
-DOSE EQUIVALENT 0 2 -2 0 0 0 0 0 0
-....................................................................................................................................
-sievert Si
-....................................................................................................................................
- M L T I K N J P S
-ROTATION ACCELERATION 0 0 -2 0 0 0 0 1 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-TRANSLATION STIFFNESS 1 0 -2 0 0 0 0 0 0
-....................................................................................................................................
-....................................................................................................................................
- M L T I K N J P S
-ROTATION STIFFNESS 1 2 -2 0 0 0 0 -1 0
-....................................................................................................................................
-// This file has been automatically generated from resource file src/UnitsAPI/Units.dat
+// clang-format off
+// This file has been automatically generated from resource file resources/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"
+ "....................................................................................................................................\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"
+ "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"
+ "....................................................................................................................................\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"
+ "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"
+ "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"
+ "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 \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"
+ "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"
+ "mille mille 1852 m\n"
+ "light year Al 9.46053E+15 m\n"
"\n"
- "inch in. 0.0254 "
- " m\n"
+ "inch in. 0.0254 m\n"
" in\n"
- "caliber caliber 1 "
- " in.\n"
- "foot ft. 12 "
- " in\n"
+ "caliber caliber 1 in.\n"
+ "foot ft. 12 in\n"
" ft\n"
"\n"
- "yard yd. 3 "
- " ft.\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"
+ "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"
+ "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"
+ "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"
+ "Celsius degree of temperature \260C [273.15] \260K\n"
" deg.C\n"
"\n"
- "Rankine degree of temperature \260R (5/9) "
- " \260K\n"
+ "Rankine degree of temperature \260R (5/9) \260K\n"
" deg.R\n"
"\n"
- "Fahrenheit degree of temperature \260F [(1379/3)] "
- " \260R\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"
+ "....................................................................................................................................\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"
+ "....................................................................................................................................\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"
+ "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"
+ "minute of angle ' 60 \"\n"
"\n"
- "degre of angle \xB0 60 "
- " '\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"
+ "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"
+ "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"
+ "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"
+ "dry barrel (U.S.) bbl .115627 m\xB3\n"
"\n"
- "pint (U.K.) pt. 34.67636 "
- " cu.in.\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"
+ "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"
+ "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"
+ "....................................................................................................................................\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"
+ "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"
+ "....................................................................................................................................\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"
+ "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"
+ "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 "
- " g/cm/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"
+ "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 g/cm/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"
+ "....................................................................................................................................\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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "....................................................................................................................................\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"
+ "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"
+ "....................................................................................................................................\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"
+ "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"
+ "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"
+ "....................................................................................................................................\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"
- "ACOUSTIC INTENSITY 0 1 0 -2 0 "
- " 0 0 0 0\n"
- "................................................................................................"
- "....................................\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"
+ "ACOUSTIC 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"
+ "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"
+ "....................................................................................................................................\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";
+ "....................................................................................................................................\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";
+
+// clang-format on
+++ /dev/null
-srcinc:::occtvr_actions.json
-srcinc:::occtvr_bindings_generic.json
-srcinc:::occtvr_bindings_holographic_hmd.json
-srcinc:::occtvr_bindings_index_hmd.json
-srcinc:::occtvr_bindings_rift.json
-srcinc:::occtvr_bindings_touch.json
-srcinc:::occtvr_bindings_vive.json
-srcinc:::occtvr_bindings_vive_controller.json
-srcinc:::occtvr_bindings_vive_cosmos.json
-srcinc:::occtvr_bindings_vive_pro.json
+++ /dev/null
-{
- "actions": [
- {
- "name": "/actions/generic_head/in/headset_on_head",
- "type": "boolean",
- "requirement": "optional"
- },
- {
- "name": "/actions/generic_left/in/pose_base",
- "type": "pose"
- },
- {
- "name": "/actions/generic_right/in/pose_base",
- "type": "pose"
- },
- {
- "name": "/actions/generic_left/in/pose_front",
- "type": "pose"
- },
- {
- "name": "/actions/generic_right/in/pose_front",
- "type": "pose"
- },
- {
- "name": "/actions/generic_left/in/pose_handgrip",
- "type": "pose"
- },
- {
- "name": "/actions/generic_right/in/pose_handgrip",
- "type": "pose"
- },
- {
- "name": "/actions/generic_left/in/pose_tip",
- "type": "pose"
- },
- {
- "name": "/actions/generic_right/in/pose_tip",
- "type": "pose"
- },
- {
- "name": "/actions/generic_left/out/haptic",
- "type": "vibration"
- },
- {
- "name": "/actions/generic_right/out/haptic",
- "type": "vibration"
- },
- {
- "name": "/actions/generic_left/in/appmenu_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/appmenu_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/sysmenu_click",
- "type": "boolean",
- "requirement": "optional"
- },
- {
- "name": "/actions/generic_right/in/sysmenu_click",
- "type": "boolean",
- "requirement": "optional"
- },
- {
- "name": "/actions/generic_left/in/trigger_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/trigger_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/trigger_pull",
- "type": "vector1"
- },
- {
- "name": "/actions/generic_right/in/trigger_pull",
- "type": "vector1"
- },
- {
- "name": "/actions/generic_left/in/grip_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/grip_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/trackpad_position",
- "type": "vector2"
- },
- {
- "name": "/actions/generic_right/in/trackpad_position",
- "type": "vector2"
- },
- {
- "name": "/actions/generic_left/in/trackpad_touch",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/trackpad_touch",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/trackpad_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/trackpad_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/thumbstick_position",
- "type": "vector2"
- },
- {
- "name": "/actions/generic_right/in/thumbstick_position",
- "type": "vector2"
- },
- {
- "name": "/actions/generic_left/in/thumbstick_touch",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/thumbstick_touch",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_left/in/thumbstick_click",
- "type": "boolean"
- },
- {
- "name": "/actions/generic_right/in/thumbstick_click",
- "type": "boolean"
- }
- ],
- "action_sets": [
- {
- "name": "/actions/generic_head",
- "usage": "single"
- },
- {
- "name": "/actions/generic_left",
- "usage": "leftright"
- },
- {
- "name": "/actions/generic_right",
- "usage": "leftright"
- }
- ],
- "default_bindings": [
- {
- "controller_type": "vive_controller",
- "binding_url": "occtvr_bindings_vive_controller.json"
- },
- {
- "controller_type": "generic",
- "binding_url": "occtvr_bindings_generic.json"
- },
- {
- "controller_type": "holographic_controller",
- "binding_url": "occtvr_bindings_holographic_hmd.json"
- },
- {
- "controller_type": "indexhmd",
- "binding_url": "occtvr_bindings_index_hmd.json"
- },
- {
- "controller_type": "rift",
- "binding_url": "occtvr_bindings_rift.json"
- },
- {
- "controller_type": "vive",
- "binding_url": "occtvr_bindings_vive.json"
- },
- {
- "controller_type": "vive_cosmos",
- "binding_url": "occtvr_bindings_vive_cosmos.json"
- },
- {
- "controller_type": "vive_pro",
- "binding_url": "occtvr_bindings_vive_pro.json"
- }
- ],
- "localization": [
- {
- "language_tag": "en_US",
- "/actions/generic_head/in/headset_on_head": "Headset is on head",
- "/actions/generic_left/in/appmenu_click": "Left app menu",
- "/actions/generic_left/in/sysmenu_click": "Left system menu",
- "/actions/generic_left/in/trigger_click": "Left trigger click",
- "/actions/generic_left/in/trigger_pull": "Left trigger squeeze",
- "/actions/generic_left/in/grip_click": "Left hand full grip",
- "/actions/generic_left/in/pose_base": "Left hand base",
- "/actions/generic_left/in/pose_front": "Left hand front",
- "/actions/generic_left/in/pose_handgrip": "Left handgrip pose",
- "/actions/generic_left/in/pose_tip": "Left forefinger tip",
- "/actions/generic_left/in/trackpad_position": "Left trackpad position",
- "/actions/generic_left/in/trackpad_touch": "Left trackpad touch",
- "/actions/generic_left/in/trackpad_click": "Left trackpad click",
- "/actions/generic_left/in/thumbstick_position": "Left thumbstick position",
- "/actions/generic_left/in/thumbstick_touch": "Left thumbstick touch",
- "/actions/generic_left/in/thumbstick_click": "Left thumbstick click",
- "/actions/generic_left/out/haptic": "Left hand haptic",
- "/actions/generic_right/in/appmenu_click": "Right app menu",
- "/actions/generic_right/in/sysmenu_click": "Right system menu",
- "/actions/generic_right/in/trigger_click": "Right trigger click",
- "/actions/generic_right/in/trigger_pull": "Right trigger squeeze",
- "/actions/generic_right/in/grip_click": "Right hand full grip",
- "/actions/generic_right/in/pose_base": "Right hand base",
- "/actions/generic_right/in/pose_front": "Right hand front",
- "/actions/generic_right/in/pose_handgrip": "Right handgrip pose",
- "/actions/generic_right/in/pose_tip": "Right forefinger tip",
- "/actions/generic_right/in/trackpad_position": "Right trackpad position",
- "/actions/generic_right/in/trackpad_touch": "Right trackpad touch",
- "/actions/generic_right/in/trackpad_click": "Right trackpad click",
- "/actions/generic_right/in/thumbstick_position": "Right thumbstick position",
- "/actions/generic_right/in/thumbstick_touch": "Right thumbstick touch",
- "/actions/generic_right/in/thumbstick_click": "Right thumbstick click",
- "/actions/generic_right/out/haptic": "Right hand haptic"
- }
- ]
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_left": {
- "haptics": [
- {
- "output": "/actions/generic_left/out/haptic",
- "path": "/user/hand/left/output/haptic"
- }
- ],
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/appmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/application_menu"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/trigger_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/trigger"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/trackpad_click" },
- "touch": { "output": "/actions/generic_left/in/trackpad_touch" },
- "position": { "output": "/actions/generic_left/in/trackpad_position" }
- },
- "mode": "trackpad",
- "path": "/user/hand/left/input/trackpad"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/grip_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/grip"
- }
- ]
- },
- "/actions/generic_right": {
- "haptics": [
- {
- "output": "/actions/generic_right/out/haptic",
- "path": "/user/hand/right/output/haptic"
- }
- ],
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/appmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/application_menu"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/trigger_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/trigger"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/trackpad_click" },
- "touch": { "output": "/actions/generic_right/in/trackpad_touch" },
- "position": { "output": "/actions/generic_right/in/trackpad_position" }
- },
- "mode": "trackpad",
- "path": "/user/hand/right/input/trackpad"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/grip_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/grip"
- }
- ]
- }
- },
- "controller_type": "generic",
- "description": "Standard Open CASCADE Technology VR bindings for a generic controller",
- "name": "OCCT VR bindings for a generic controller"
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "holographic_hmd",
- "description": "",
- "name": "holographic_hmd defaults"
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "indexhmd",
- "description": "",
- "name": "index hmd defaults"
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "rift",
- "description": "",
- "name": "rift defaults"
-}
+++ /dev/null
-{
- "action_manifest_version" : 0,
- "alias_info" : {},
- "bindings" : {
- "/actions/generic_left" : {
- "haptics" : [
- {
- "output" : "/actions/generic_left/out/haptic",
- "path" : "/user/hand/left/output/haptic"
- }
- ],
- "sources" : [
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/appmenu_click"
- }
- },
- "mode" : "button",
- "path" : "/user/hand/left/input/application_menu"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/trackpad_click"
- },
- "position" : {
- "output" : "/actions/generic_left/in/trackpad_position"
- },
- "touch" : {
- "output" : "/actions/generic_left/in/trackpad_touch"
- }
- },
- "mode" : "trackpad",
- "path" : "/user/hand/left/input/trackpad"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/sysmenu_click"
- }
- },
- "mode" : "button",
- "path" : "/user/hand/left/input/system"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/trigger_click"
- },
- "pull" : {
- "output" : "/actions/generic_left/in/trigger_pull"
- }
- },
- "mode" : "trigger",
- "path" : "/user/hand/left/input/trigger"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/appmenu_click"
- }
- },
- "mode" : "button",
- "path" : "/user/hand/left/input/x"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_left/in/trackpad_click"
- },
- "position" : {
- "output" : "/actions/generic_left/in/trackpad_position"
- },
- "touch" : {
- "output" : "/actions/generic_left/in/trackpad_touch"
- }
- },
- "mode" : "joystick",
- "path" : "/user/hand/left/input/joystick"
- }
- ]
- },
- "/actions/generic_right" : {
- "haptics" : [
- {
- "output" : "/actions/generic_right/out/haptic",
- "path" : "/user/hand/right/output/haptic"
- }
- ],
- "sources" : [
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_right/in/appmenu_click"
- }
- },
- "mode" : "button",
- "path" : "/user/hand/right/input/application_menu"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_right/in/trackpad_click"
- },
- "position" : {
- "output" : "/actions/generic_right/in/trackpad_position"
- },
- "touch" : {
- "output" : "/actions/generic_right/in/trackpad_touch"
- }
- },
- "mode" : "trackpad",
- "path" : "/user/hand/right/input/trackpad"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_right/in/trigger_click"
- },
- "pull" : {
- "output" : "/actions/generic_right/in/trigger_pull"
- }
- },
- "mode" : "trigger",
- "path" : "/user/hand/right/input/trigger"
- },
- {
- "inputs" : {
- "click" : {
- "output" : "/actions/generic_right/in/thumbstick_click"
- },
- "position" : {
- "output" : "/actions/generic_right/in/thumbstick_position"
- },
- "touch" : {
- "output" : "/actions/generic_right/in/thumbstick_touch"
- }
- },
- "mode" : "joystick",
- "path" : "/user/hand/right/input/joystick"
- },
- {
- "inputs" : {
- "touch" : {
- "output" : "/actions/generic_right/in/grip_click"
- }
- },
- "mode" : "trigger",
- "path" : "/user/hand/right/input/grip"
- }
- ]
- }
- },
- "category" : "steamvr_input",
- "controller_type" : "oculus_touch",
- "description" : "Standard Open CASCADE Technology VR bindings for an oculus touch controller",
- "options" : {},
- "simulated_actions" : []
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "vive",
- "description": "",
- "name": "vive defaults"
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_left": {
- "haptics": [
- {
- "output": "/actions/generic_left/out/haptic",
- "path": "/user/hand/left/output/haptic"
- }
- ],
- "poses": [
- {
- "output": "/actions/generic_left/in/pose_base",
- "path": "/user/hand/left/pose/base"
- },
- {
- "output": "/actions/generic_left/in/pose_front",
- "path": "/user/hand/left/pose/front"
- },
- {
- "output": "/actions/generic_left/in/pose_handgrip",
- "path": "/user/hand/left/pose/handgrip"
- },
- {
- "output": "/actions/generic_left/in/pose_tip",
- "path": "/user/hand/left/pose/tip"
- }
- ],
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/appmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/application_menu"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/trigger_click" },
- "pull": { "output": "/actions/generic_left/in/trigger_pull" }
- },
- "mode": "trigger",
- "path": "/user/hand/left/input/trigger"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/trackpad_click" },
- "touch": { "output": "/actions/generic_left/in/trackpad_touch" },
- "position": { "output": "/actions/generic_left/in/trackpad_position" }
- },
- "mode": "trackpad",
- "path": "/user/hand/left/input/trackpad"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/grip_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/grip"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_left/in/sysmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/left/input/system"
- }
- ]
- },
- "/actions/generic_right": {
- "haptics": [
- {
- "output": "/actions/generic_right/out/haptic",
- "path": "/user/hand/right/output/haptic"
- }
- ],
- "poses": [
- {
- "output": "/actions/generic_right/in/pose_base",
- "path": "/user/hand/right/pose/base"
- },
- {
- "output": "/actions/generic_right/in/pose_front",
- "path": "/user/hand/right/pose/front"
- },
- {
- "output": "/actions/generic_right/in/pose_handgrip",
- "path": "/user/hand/right/pose/handgrip"
- },
- {
- "output": "/actions/generic_right/in/pose_tip",
- "path": "/user/hand/right/pose/tip"
- }
- ],
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/appmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/application_menu"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/trigger_click" },
- "pull": { "output": "/actions/generic_right/in/trigger_pull" }
- },
- "mode": "trigger",
- "path": "/user/hand/right/input/trigger"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/trackpad_click" },
- "touch": { "output": "/actions/generic_right/in/trackpad_touch" },
- "position": { "output": "/actions/generic_right/in/trackpad_position" }
- },
- "mode": "trackpad",
- "path": "/user/hand/right/input/trackpad"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/grip_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/grip"
- },
- {
- "inputs": {
- "click": { "output": "/actions/generic_right/in/sysmenu_click" }
- },
- "mode": "button",
- "path": "/user/hand/right/input/system"
- }
- ]
- }
- },
- "controller_type": "vive_controller",
- "description": "Standard Open CASCADE Technology VR bindings for the Vive controller",
- "name": "OCCT VR bindings for the Vive controller"
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "vive_cosmos",
- "description": "",
- "name": "vive cosmos hmd defaults",
-}
+++ /dev/null
-{
- "bindings": {
- "/actions/generic_head": {
- "sources": [
- {
- "inputs": {
- "click": { "output": "/actions/generic_head/in/headset_on_head" }
- },
- "mode": "button",
- "path": "/user/head/proximity"
- }
- ]
- }
- },
- "controller_type": "vive_pro",
- "description": "",
- "name": "vive_pro defaults"
-}
-msgfile:::XSTEP.fr
-msgfile:::XSTEP.us
XSMessage_XSTEP_us.pxx
--- /dev/null
+// clang-format off
+// This file has been automatically generated from resource file resources/XSMessage/XSTEP.fr
+
+static const char XSMessage_XSTEP_fr[] =
+ "!LOADING PHASE\n"
+ ".XSTEP_1\n"
+ " Debut du chargement en memoire du fichier IGES.\n"
+ "!\n"
+ ".XSTEP_2\n"
+ " Erreur d'ouverture du fichier IGES.\n"
+ "!\n"
+ ".XSTEP_3\n"
+ " Raison : Le fichier n'existe pas.\n"
+ "!\n"
+ ".XSTEP_4\n"
+ " Raison : Espace memoire insuffisant.\n"
+ "!\n"
+ ".XSTEP_5\n"
+ " Raison : Ce fichier est protege en lecture.\n"
+ "!\n"
+ ".XSTEP_6\n"
+ " Raison : Trop de fichiers ouverts.\n"
+ "!\n"
+ ".XSTEP_7\n"
+ " Raison : Inconnue.\n"
+ "!\n"
+ ".XSTEP_8\n"
+ " Fin du chargement du fichier IGES (Temps ecoule : %s).\n"
+ "\n"
+ "!\n"
+ ".XSTEP_9\n"
+ "Debut de lecture du fichier IGES.\n"
+ "!\n"
+ ".XSTEP_10\n"
+ "Fin de lecture du fichier IGES.\n"
+ "!\n"
+ ".XSTEP_11\n"
+ " Erreur interne pendant la lecture de l'entete : le processus continue.\n"
+ "!\n"
+ ".XSTEP_12\n"
+ "Entete et contenu du fichier IGES ont ete charges.\n"
+ "!\n"
+ ".XSTEP_13\n"
+ " Erreur interne durant la lecture de l'entite %d.\n"
+ "!\n"
+ ".XSTEP_14\n"
+ " Erreur interne durant la lecture de l'entite %d parametre %d.\n"
+ "!\n"
+ ".XSTEP_15\n"
+ " Nombre total d'entites chargees : %d.\n"
+ "!\n"
+ ".XSTEP_16\n"
+ " Debut du chargement du modele.\n"
+ "!\n"
+ ".XSTEP_17\n"
+ " Fin du chargement du modele.\n"
+ "!\n"
+ ".XSTEP_18\n"
+ " Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s.\n"
+ "!\n"
+ ".XSTEP_19\n"
+ " Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s (numero de ligne peut etre incorrecte).\n"
+ "!\n"
+ ".XSTEP_20\n"
+ " Il n'y a pas de Terminate Section : le processus continue.\n"
+ "!\n"
+ ".XSTEP_21\n"
+ "Nombre d'entites nulles ignorees : %d.\n"
+ "!\n"
+ ".XSTEP_22\n"
+ " Entite inconnue %s.\n"
+ "!\n"
+ ".XSTEP_23\n"
+ " Entite recuperee %s.\n"
+ "!\n"
+ ".XSTEP_24\n"
+ "Resume : %d entites inconnues.\n"
+ "!\n"
+ ".XSTEP_25\n"
+ " Nombre de fails pendant le chargement en memoire : %d.\n"
+ "!\n"
+ ".XSTEP_26\n"
+ " Nombre de warnings pendant le chargement en memoire : %d.\n"
+ "!\n"
+ ".XSTEP_27\n"
+ " Directory Entry : Il n'y a pas de parametre. le transfer continue.\n"
+ "!\n"
+ ".XSTEP_28\n"
+ " Directory Entry : Le parametre 1 (Type de l'entite) est incorrect.\n"
+ "!\n"
+ ".XSTEP_29\n"
+ " Directory Entry : Le champ 4 (Line Font Pattern) est incorrect (Un pointeur non nul ou un entier entre 0 et 5 est attendu).\n"
+ "!\n"
+ ".XSTEP_30\n"
+ " Directory Entry : Le champ 5 (Level) est incorrect (Un pointeur ou un entier non nul est attendu).\n"
+ "!\n"
+ ".XSTEP_31\n"
+ " Directory Entry : Le champ 6 (View) est incorrect (Un pointeur non nul est attendu).\n"
+ "!\n"
+ ".XSTEP_32\n"
+ ": Directory Entry : Le champ 7 (Transformation Matrix) est incorrect (Un pointeur non nul est attendu).\n"
+ "!\n"
+ ".XSTEP_33\n"
+ " Entity %s, Type %d : Directory Entry : Le champ 8 (Label Display Associativity) est incorrect (Un pointeur non nul est attendu).\n"
+ "!\n"
+ ".XSTEP_34\n"
+ " Directory Entry : Le champ 13 (Color Number) est incorrect (Un pointeur non nul ou un entier entre 0 et 8 est attendu).\n"
+ "!\n"
+ ".XSTEP_35\n"
+ " Entite nulle %s.\n"
+ "!\n"
+ ".XSTEP_36\n"
+ " Entite inconnue %s.\n"
+ "!\n"
+ ".XSTEP_37\n"
+ " La liste d'associativites est incorrecte.\n"
+ "!\n"
+ ".XSTEP_38\n"
+ " La liste de proprietes est incorrecte.\n"
+ "! ANALYSIS PHASE\n"
+ ".XSTEP_39\n"
+ " Global Section : Nombre de parametres invalides (%d ou %d parametres attendus).\n"
+ "!\n"
+ ".XSTEP_40\n"
+ " Global Section (Parametres 1 et 2) : Parameter Delimiter Character et Record Delimiter Character doivent etre differents.\n"
+ "!\n"
+ ".XSTEP_41\n"
+ " Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Virgule pris par defaut.\n"
+ "!\n"
+ ".XSTEP_42\n"
+ " Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Point Virgule pris par defaut.\n"
+ "!\n"
+ ".XSTEP_43\n"
+ " Global Section (Parametre 8) : Le parametre Single Precision Magnitude est invalide (Entier Positif attendu). Valeur 38 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_44\n"
+ " Global Section (Parametre 9) : Le parametre Single Precision Significance est invalide (Entier Positif attendu). Valeur 6 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_45\n"
+ " Global Section (Parametre 10) : Le parametre Double Precision Magnitude est invalide (Entier Positif attendu). Valeur 308 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_46\n"
+ " Global Section (Parametre 11) : Le parametre Double Precision Significance est invalide (Entier Positif attendu). Valeur 15 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_47\n"
+ " Global Section (Parametre 13) : Le parametre Model Space Scale est invalide (Positif attendu). Valeur 1.0 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_48\n"
+ " Global Section (Parametre 14) : Le parametre Unit Flag est invalide (Entier entre 1 et 11 attendu). Valeur 2 prise pas defaut : Millimeters.\n"
+ "!\n"
+ ".XSTEP_49\n"
+ " Global Section (Parametre 15) : Le parametre Unit Name n'est pas traite.Valeur 2 prise pas defaut : Millimeters.\n"
+ "!\n"
+ ".XSTEP_50\n"
+ " Global Section (Parametre 15) : Le parametre Unit Name n'est pas defini, ignore.\n"
+ "!\n"
+ ".XSTEP_51\n"
+ " Global Section (Parametre 14 et 15) : Le parametre Unit Flag ne correspond pas au parametre Unit Name : Unit Name ignore.\n"
+ "!\n"
+ ".XSTEP_52\n"
+ " Global Section i)(Parametre 19) : Le parametre Minimum Resolution est invalide (Reel Positif attendu). Valeur 0.0 prise pas defaut.\n"
+ "!\n"
+ ".XSTEP_53\n"
+ " Global Section (Parametre 23) : Le parametre Version Flag est invalide (Entier entre 1 et 11 attendu). Valeur 3 prise pas defaut : Version 2.0.\n"
+ "!\n"
+ ".XSTEP_54\n"
+ " Global Section (Parametre 24) : Le parametre Drafting Standard Flag est invalide (Entier entre 0 et 7 attendu). Valeur 0 prise pas defaut : No standard.\n"
+ "!\n"
+ ".XSTEP_55\n"
+ " Global Section (Parametre 25) : Le parametre Last change Date n'est pas defini.\n"
+ "!\n"
+ ".XSTEP_56\n"
+ " Global Section (Parametre 18) : Le parametre Date n'est pas defini.\n"
+ "!\n"
+ ".XSTEP_57\n"
+ " Global Section (Parametre %d) : Format de date invalide.\n"
+ "!\n"
+ ".XSTEP_58\n"
+ " Directory Entry (Champ 1) : Le champ Entity Type Number est invalide \n"
+ "!\n"
+ ".XSTEP_59\n"
+ " Directory Entry (Champ 3) : Le champ Structure est indefini.\n"
+ "!\n"
+ ".XSTEP_60\n"
+ " Directory Entry (Champ 4) : Le champ Line Font Pattern est invalide (Pointeur ou Entier entre 0 et 5 attendu). Valeur 0 prise par defaut.\n"
+ "!\n"
+ ".XSTEP_61\n"
+ " Directory Entry (Champ 5) : Le champ Level est invalide (Pointeur ou Entier attendu). Valeur 0 prise par defaut.\n"
+ "!\n"
+ ".XSTEP_62\n"
+ " Directory Entry (Champ 6) : Le champ View est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.\n"
+ "!\n"
+ ".XSTEP_63\n"
+ " Directory Entry (Champ 7): Le champ Transformation Matrix est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.\n"
+ "!\n"
+ ".XSTEP_64\n"
+ " Directory Entry (Champ 8): Le champ Label Display Entity est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.\n"
+ "!\n"
+ ".XSTEP_65\n"
+ " Directory Entry (Champ 9) : Le champ Blank Status est invalide (Entier attendu : 0 ou 1). \n"
+ "!\n"
+ ".XSTEP_66\n"
+ " Directory Entry (Champ 9) : Le champ Subordinate Entity Switch est invalide (Entier entre 0 et 3 attendu). \n"
+ "!\n"
+ ".XSTEP_67\n"
+ " Directory Entry (Champ 9) : Le champ Entity Use Flag est invalide (Entier entre 0 et 6 attendu). \n"
+ "!\n"
+ ".XSTEP_68\n"
+ " Directory Entry (Champ 9) : Le champ Hierarchy est invalide (Entier entre 0 et 2 attendu).\n"
+ "!\n"
+ ".XSTEP_69\n"
+ " Directory Entry (Champ 12) : Le champ Line Weight Number n'est pas defini. \n"
+ "!\n"
+ ".XSTEP_70\n"
+ " Directory Entry (Champ 13) : Le champ Color Number est invalide (Pointeur ou Entier entre 0 et 8 attendu). \n"
+ "!\n"
+ ".XSTEP_71\n"
+ " Directory Entry (Champ 15) : Le champ Form Number est invalide.\n"
+ "!\n"
+ ".XSTEP_72\n"
+ " Directory Entry (Champ 19): Le champ Entity Subscript Number est invalide (Entier attendu).\n"
+ "!Type 116\n"
+ ".XSTEP_73\n"
+ " Parameter Data : Le parametre %d (Coordinate of Point) est invalide (Reel attendu).\n"
+ "!Type 116\n"
+ ".XSTEP_74\n"
+ " Parameter Data : Le parametre %d (Display Symbol) est invalide (Entite Subfigure Definition, Type 308 attendue).\n"
+ "!Type 100\n"
+ ".XSTEP_75\n"
+ " Parameter Data : Le parametre 1 ( ZT displacement of Arc) est invalide (Reel attendu).\n"
+ "!Type 100\n"
+ ".XSTEP_76\n"
+ " Parameter Data : Le parametre %d (Arc Center ) est invalide (Reel attendu).\n"
+ "!Type 100\n"
+ ".XSTEP_77\n"
+ " Parameter Data : Le parametre %d (Start Point) est invalide (Reel attendu).\n"
+ "!Type 100\n"
+ ".XSTEP_78\n"
+ " Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).\n"
+ "!Type 102\n"
+ ".XSTEP_79\n"
+ " Parameter Data : Le parametre 1 (Number of Entities) est invalide :%d (Entier Positif attendu).\n"
+ "!Type 102\n"
+ ".XSTEP_80\n"
+ " Parameter Data : Certains pointeurs de liste d'entites sont nuls ou negatifs : ignores (Entites Point, Connect Point ou Paramerterized Curve attendues).\n"
+ "!Type 104\n"
+ ".XSTEP_81\n"
+ " Parameter Data : Le parametre %d (Conic Coefficient) est invalide (Reel attendu).\n"
+ "!Type 104\n"
+ ".XSTEP_82\n"
+ " Parameter Data : Le parametre 7 (Coordinate of Plane) est invalide (Reel attendu).\n"
+ "!Type 104\n"
+ ".XSTEP_83\n"
+ " Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).\n"
+ "!Type 104\n"
+ ".XSTEP_84\n"
+ " Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).\n"
+ "!Type 106\n"
+ ".XSTEP_85\n"
+ " Parameter Data : Le parametre 1 (Interpretation Flag) est invalide (Entier attendu : %d).\n"
+ "!Type 106\n"
+ ".XSTEP_86\n"
+ " Parameter Data : Le parametre 2 (Number of n-tuples) est invalide (Entier Positif attendu).\n"
+ "!Type 106\n"
+ ".XSTEP_87\n"
+ " Parameter Data : Le parametre 3 (Common Z Displacement) est invalide (Reel attendu).\n"
+ "!Type 106\n"
+ ".XSTEP_88\n"
+ " Parameter Data : Tous les parametres Data Point ne sont pas de type Reel.\n"
+ "!Type 110\n"
+ ".XSTEP_89\n"
+ " Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).\n"
+ "!Type 110\n"
+ ".XSTEP_90\n"
+ " Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).\n"
+ "!Type 112\n"
+ ".XSTEP_91\n"
+ " Parameter Data : Le parametre 1 (Spline Type) est invalide (Entier entre 1 et 6 attendu).\n"
+ "!Type 112\n"
+ ".XSTEP_92\n"
+ " Parameter Data : Le parametre 2 (Degree of Continuity) est invalide (Entier attendu).\n"
+ "!Type 112\n"
+ ".XSTEP_93\n"
+ " Parameter Data : Le parametre 3 (Number of Dimensions) est invalide (Entier attendu : 2 ou 3).\n"
+ "!Type 112\n"
+ ".XSTEP_94\n"
+ " Parameter Data : Le parametre 4 (Number of Segments) est invalide (Entier Positif attendu).\n"
+ "!Type 112\n"
+ ".XSTEP_95\n"
+ " Parameter Data : Tous les parametres Break Point ne sont pas de type Reel.\n"
+ "!Type 112\n"
+ ".XSTEP_96\n"
+ " Parameter Data : L'entite est plane mais les parametres BZ, CZ. DZ ne sont pas nuls\n"
+ "!Type 126\n"
+ ".XSTEP_97\n"
+ " Parameter Data : Le parametre %d (Upper Index of Sum) est invalide (Entier Positif attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_98\n"
+ " Parameter Data : Le parametre %d (Degree of Basis Functions) est invalide (Entier attendu) : Valeur 0 prise par defaut.\n"
+ "!Type 126\n"
+ ".XSTEP_99\n"
+ " Parameter Data : Le parametre %d (Planar/Non Planar Flag) est invalide (Booleen attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_100\n"
+ " Parameter Data : Le parametre %d (Open/Closed Flag) est invalide (Booleen attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_101\n"
+ " Parameter Data : Le parametre %d (Rational/Polynomial Flag) est invalide (Booleen attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_102\n"
+ " Parameter Data : Le parametre %d (NonPeriodic/Periodic Flag) est invalide (Booleen attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_103\n"
+ " Parameter Data : Tous les parametres Knot Sequence ne sont pas de type Reel.\n"
+ "!Type 126\n"
+ ".XSTEP_104\n"
+ " Parameter Data : Tous les parametres Weight ne sont pas de type Reel Positif.\n"
+ "!Type 126\n"
+ ".XSTEP_105\n"
+ " Parameter Data : Le parametre %d (Control Point) est invalide (Reel attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_106\n"
+ " Parameter Data : Le parametre %d (Starting Value) est invalide (Reel attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_107\n"
+ " Parameter Data : Le parametre %d (Ending Value) est invalide (Reel attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_108\n"
+ " Parameter Data : Le parametre %d (Unit Normal) est invalide (Reel attendu).\n"
+ "!Type 126\n"
+ ".XSTEP_109\n"
+ " Parameter Data : Le parametre %d (Unit Normal) n'est pas defini pour une courbe plane.\n"
+ "!Type 130\n"
+ ".XSTEP_110\n"
+ " Parameter Data : Le parametre 1 (Curve Entity to be offset) est invalide (Entite Curve attendue). \n"
+ "!Type 130\n"
+ ".XSTEP_111\n"
+ " Parameter Data : Le parametre 2 (Offset Distance Flag) est invalide (Entier entre 1 et 3 attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_112\n"
+ " Parameter Data : Le parametre 3 (Curve Entity whose coordinate describes the offset) est invalide (Entite Curve attendue). \n"
+ "!Type 130\n"
+ ".XSTEP_113\n"
+ " Parameter Data : Le parametre 4 (Particular Coordinate) est invalide (Entier attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_114\n"
+ " Parameter Data : Le parametre 5 (Tapered Offset Type Flag) est invalide (Entier attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_115\n"
+ " Parameter Data : Le parametre 6 (First Offset distance) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_116\n"
+ " Parameter Data : Le parametre 7 (Arc Length of Fisrt Offset Distance) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_117\n"
+ " Parameter Data : Le parametre 8 (Second Offset Distance) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_118\n"
+ " Parameter Data : Le parametre 9 (Arc Length of Second Offset Distance) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_119\n"
+ " Parameter Data : Le parametre 13 (Offset Curve Starting Parameter Value) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_120\n"
+ " Parameter Data : Le parametre 14 (Offset Curve Ending Parameter Value) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_121\n"
+ " Parameter Data : Le parametre %d (Unit Vector Normal to plane) est invalide (Reel attendu).\n"
+ "!Type 130\n"
+ ".XSTEP_122\n"
+ " Parameter Data : Le parametre 1 (Type of Bounded Surface Representation) est invalide (Entier attendu : 0 ou 1 ).\n"
+ "!Type 141\n"
+ ".XSTEP_123\n"
+ " Parameter Data : Le parametre 2 (Trimming Curves Representation) est invalide (Entier entre 0 et 3 attendu).\n"
+ "!Type 141\n"
+ ".XSTEP_124\n"
+ " Parameter Data : Le parametre 3 (Untrimmed Surface) est invalide (Entite Untrimmed Surface attendue). \n"
+ "!Type 141\n"
+ ".XSTEP_125\n"
+ " Parameter Data : Surface %d non parametrique (parametre 3).\n"
+ "!Type 141\n"
+ ".XSTEP_126\n"
+ " Parameter Data : Le parametre 4 (Number of Curves est invalide (Positif attendu).\n"
+ "!Type 141\n"
+ ".XSTEP_127\n"
+ " Parameter Data : Le parametre 5 (Model Space Curve) est invalide (Entite Curve attendue). \n"
+ "!Type 141\n"
+ ".XSTEP_128\n"
+ " Parameter Data : Le parametre 6 (Orientation Flag) est invalide (Entier attendu : 1 ou 2).\n"
+ "!Type 141\n"
+ ".XSTEP_129\n"
+ " Parameter Data : Le parametre 7 (Number of Associated Parameter Space Curves) est invalide (Entier attendu : 0).\n"
+ "!Type 141\n"
+ ".XSTEP_130\n"
+ " Parameter Data : Certains pointeurs de la liste d'entites Parameter Space Curve sont nuls ou negatifs : ignores (Entites Curve attendues).\n"
+ "!Type 142\n"
+ ".XSTEP_131\n"
+ " Parameter Data : Le parametre 2 (Surface on which the curve lies) est invalide (Entite Surface attendue).\n"
+ "!Type 142\n"
+ ".XSTEP_132\n"
+ " Parameter Data : Le parametre 3 (Curve 2D) est invalide (Entite Curve attendue).\n"
+ "!Type 142\n"
+ ".XSTEP_133\n"
+ " Parameter Data : Le parametre 4 (Curve 3D) est invalide (Entite Curve attendue).\n"
+ "!Type 142\n"
+ ".XSTEP_134\n"
+ " Parameter Data : Les pointeurs sur les courbes 2D et sont nuls (parameter 3 et 4) (Entites Curve attendues).\n"
+ "!Type 108\n"
+ ".XSTEP_135\n"
+ " Parameter Data : Le parametre %d (Coefficient Of Plane) est invalide (Reel attendu).\n"
+ "!Type 108\n"
+ ".XSTEP_136\n"
+ " Parameter Data : Le parametre 5 (Closed Curve) est invalide (Entite Curve attendue).\n"
+ "!Type 108\n"
+ ".XSTEP_137\n"
+ " Parameter Data : Le parametre 5 est invalide (Pointeur nul attendu lorsque le champ Form Number est 0).\n"
+ "!Type 108\n"
+ ".XSTEP_138\n"
+ " Parameter Data : Le parametre 9 (DisplaySymbol Size) est invalide (Reel attendu).\n"
+ "!Type 108\n"
+ ".XSTEP_139\n"
+ " Parameter Data : Le parametre %d (Coordinate of Display Symbol) est invalide (Reel attendu).\n"
+ "!Type 114\n"
+ ".XSTEP_140\n"
+ " Parameter Data : Le parametre 1 (Spline Boundary Type) est invalide (Entier entre 1 et 6 attendu).\n"
+ "!Type 114\n"
+ ".XSTEP_141\n"
+ " Parameter Data : Le parametre 3 (Number of U Segments) est invalide (Entier Positif attendu).\n"
+ "!Type 114\n"
+ ".XSTEP_142\n"
+ " Parameter Data : Le parametre 4 (Number of V Segments) est invalide (Entier Positif attendu).\n"
+ "!Type 114\n"
+ ".XSTEP_143\n"
+ " Parameter Data : Tous les parametres Breakpoint in U ne sont de type Reel.\n"
+ "!Type 114\n"
+ ".XSTEP_144\n"
+ " Parameter Data : Tous les parametres Breakpoint in V ne sont pas de type Reel.\n"
+ "!Type 114\n"
+ ".XSTEP_145\n"
+ " Parameter Data : Tous les parametres %s Coefficient of Patch ne sont pas de type Reel.\n"
+ "!Type 114\n"
+ ".XSTEP_146\n"
+ " Parameter Data : Le parametre %d (Last Z Coefficient of Patch) est invalide (Reel attendu).\n"
+ "!Type 114\n"
+ ".XSTEP_147\n"
+ " Parameter Data : Le nombre de parametres %c Coefficient of Patch est invalide (Entier attendu : 16).\n"
+ "!Type 118\n"
+ ".XSTEP_148\n"
+ " Parameter Data : Le parametre 1 (First Curve) est invalide (Entite Curve attendue).\n"
+ "!Type 118\n"
+ ".XSTEP_149\n"
+ " Parameter Data : Le parametre 2 (Second Curve) est invalide (Entite Curve attendue).\n"
+ "!Type 118\n"
+ ".XSTEP_150\n"
+ " Parameter Data : Le parametre 3 (Direction Flag) est invalide (Entier 0 ou 1 attendu).\n"
+ "!Type 118\n"
+ ".XSTEP_151\n"
+ " Parameter Data : Le parametre 4 (Developable Surface Flag) est invalide (Entier 0 ou 1 attendu).\n"
+ "!Type 120\n"
+ ".XSTEP_152\n"
+ " Parameter Data : Le parametre 1 (Axis of Revolution) est invalide (Entite attendue).\n"
+ "!Type 120\n"
+ ".XSTEP_153\n"
+ " Parameter Data : Le parametre 2 (Generatrix Entity) est invalide (Entite attendue).\n"
+ "!Type 120\n"
+ ".XSTEP_154\n"
+ " Parameter Data : Le parametre 3 (Start Angle) est invalide (Reel attendu).\n"
+ "!Type 120\n"
+ ".XSTEP_155\n"
+ " Parameter Data : Le parametre 4 (Terminate Angle est invalide (Reel attendu).\n"
+ "!Type 122\n"
+ ".XSTEP_156\n"
+ " Parameter Data : Le parametre 1 (Generatrix Entity) est invalide (Entite Curve attendue).\n"
+ "!Type 122\n"
+ ".XSTEP_157\n"
+ " Parameter Data : Le parametre %d (Coordinate of the Terminate Point) est invalide (Reel attendu).\n"
+ "!Type 128\n"
+ ".XSTEP_158\n"
+ " Parameter Data : Valeur supplementaire invalide (Reel attendu).\n"
+ "!Type 128\n"
+ ".XSTEP_159\n"
+ " Parameter Data : Valeur Reelle supplementaire : ignoree.\n"
+ "!Type 128\n"
+ ".XSTEP_160\n"
+ " Parameter Data : Invalid Number of First Knots sequence (Nombre attendu : %d).\n"
+ "!Type 128\n"
+ ".XSTEP_161\n"
+ " Parameter Data : Invalid Number of Second Knots Sequence (Nombre attendu : %d).\n"
+ "!Type 140\n"
+ ".XSTEP_162\n"
+ " Parameter Data : Le parametre %d (Coordinate of Offset Indicator) est invalide (Reel attendu).\n"
+ "!Type 140\n"
+ ".XSTEP_163\n"
+ " Parameter Data : Le parametre 4 (Offset Distance) est invalide (Reel attendu).\n"
+ "!Type 140\n"
+ ".XSTEP_164\n"
+ " Parameter Data : Le parametre 5 (Surface Entity to be offset) est invalide (Entite Surface attendue).\n"
+ "!Type 143\n"
+ ".XSTEP_165\n"
+ " Parameter Data : Le parametre 1 (Bounded Surface Representation Type) est invalide (Entier 0 ou 1 attendu).\n"
+ "!Type 143\n"
+ ".XSTEP_166\n"
+ " Parameter Data : Le parametre 2(Surface Entity to be Bounded) est invalide (Entite Surface attendue).\n"
+ "!Type 143\n"
+ ".XSTEP_167\n"
+ " Parameter Data : Le parametre 3 (Number of Boundary Entities) est invalide (Entier Positif attendu).\n"
+ "!Type 143\n"
+ ".XSTEP_168\n"
+ " Parameter Data : Le parametre %d (Boundary Entity) est invalide (Entite Boundary, Type 141 attendue).\n"
+ "!Type 144\n"
+ ".XSTEP_169\n"
+ " Parameter Data : Le parametre 1 (Surface to be trimmed) est invalide (Entite Surface attendue).\n"
+ "!Type 144\n"
+ ".XSTEP_170\n"
+ " Parameter Data : Le parametre 2 (Outer Boundary Type) est invalide (Entier 0 ou 1 attendu).\n"
+ "!Type 144\n"
+ ".XSTEP_171\n"
+ " Parameter Data : Le parametre 3 ( Number of Inner Boundary Closed Curves) est invalide (Entier Positif attendu).\n"
+ "!Type 144\n"
+ ".XSTEP_172\n"
+ " Parameter Data : Le parametre 4 (Outer Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).\n"
+ "!Type 144\n"
+ ".XSTEP_173\n"
+ " Parameter Data : Le parametre %d (Inner Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).\n"
+ "!Type 190\n"
+ ".XSTEP_174\n"
+ " Parameter Data : Le parametre 1 (Point on the Surface) est invalide (Entite Point, Type 116 attendue).\n"
+ "!Type 190\n"
+ ".XSTEP_175\n"
+ " Parameter Data : Le parametre 2 (Surface Normal Direction) est invalide (Entite Direction attendue).\n"
+ "!Type 190\n"
+ ".XSTEP_176\n"
+ " Parameter Data : Le parametre 3 (Reference Direction) est invalide (Entite Direction attendue).\n"
+ "!Type 190\n"
+ ".XSTEP_177\n"
+ " Parameter Data : Le parametre 3 est invalide (Pointeur nul attendu lorsque le champ Form Number est 1).\n"
+ "!Type 186\n"
+ ".XSTEP_178\n"
+ " Parameter Data : Le parametre 1 (Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).\n"
+ "!Type 186\n"
+ ".XSTEP_179\n"
+ " Parameter Data : Le parametre %d (Void Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).\n"
+ "!Type 186\n"
+ ".XSTEP_180\n"
+ " Parameter Data : Le parametre %d (Orientation Flag) est invalide (Booleen attendu).\n"
+ "!Type 186\n"
+ ".XSTEP_181\n"
+ " Parameter Data : Le parametre 3 (Number of Void Shells) est invalide (Entier Positif attendu).\n"
+ "!Type 502\n"
+ ".XSTEP_182\n"
+ " Parameter Data : Le parametre 1 (Number of Vertex Tuples) est invalide (Entier Positif attendu).\n"
+ "!Type 502\n"
+ ".XSTEP_183\n"
+ " Parameter Data : Le parametre % (Coordinate of Vertex) est invalide (Reel attendu).\n"
+ "!Type 504\n"
+ ".XSTEP_184\n"
+ " Parameter Data : Le parametre 1 (Number of Edge Tuples) est invalide (Entier Positif attendu).\n"
+ "!Type 504\n"
+ ".XSTEP_185\n"
+ " Parameter Data : Le parametre 2 (Model Space Curve) est invalide (Entite Curve attendue).\n"
+ "!Type 504\n"
+ ".XSTEP_186\n"
+ " Parameter Data : Le parametre %d (Start Vertex Index) est invalide (Entier attendu).\n"
+ "!Type 504\n"
+ ".XSTEP_187\n"
+ " Parameter Data : Le parametre %d (Terminate Vertex Index) est invalide (Entier attendu).\n"
+ "!Type 504\n"
+ ".XSTEP_188\n"
+ " Parameter Data : Le parametre %d (Start Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).\n"
+ "!Type 504\n"
+ ".XSTEP_189\n"
+ " Parameter Data : Le parametre %d (Terminate Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).!T\n"
+ "!Type 508\n"
+ ".XSTEP_190\n"
+ " Parameter Data : Le parametre %d (Edge Type) est invalide (Entier 0 ou 1 attendu).\n"
+ "!Type 508\n"
+ ".XSTEP_191\n"
+ " Parameter Data : Le parametre %d (List Index) est invalide (Entier attendu).\n"
+ "!Type 508\n"
+ ".XSTEP_192\n"
+ " Parameter Data : Le parametre %d (Number of Parameter Curves) est invalide (Entier Positif attendu).\n"
+ "!Type 508\n"
+ ".XSTEP_193\n"
+ " Parameter Data : Le parametre % Vertex or Edge List Entity) est invalide (Entite Vertex List ou Edge List Entity, Type 502 ou 504 attendue).\n"
+ "!Type 508\n"
+ ".XSTEP_194\n"
+ " Parameter Data : Le parametre % (Parameter Space Curve) est invalide (Entite Curve attendue).\n"
+ "!Type 508\n"
+ ".XSTEP_195\n"
+ " Parameter Data : Le parametre %d (Isoparametric Flag) est invalide (Booleen attendu).\n"
+ "!Type 510\n"
+ ".XSTEP_196\n"
+ " Parameter Data : Le parametre 1 (Surface) est invalide (Entite Surface attendue).\n"
+ "!Type 510\n"
+ ".XSTEP_197\n"
+ " Parameter Data : Le parametre 2 (Number of Loops) est invalide (Entier Positif attendu).\n"
+ "!Type 510\n"
+ ".XSTEP_198\n"
+ " Parameter Data : Le parametre 3 (Outer Loop flag) est invalide (Booleen attendu).\n"
+ "!Type 510\n"
+ ".XSTEP_199\n"
+ " Parameter Data : Le parametre %d (Loop of the Face) est invalide (Entite Loop, Type 508 attendue).\n"
+ "!Type 514\n"
+ ".XSTEP_200\n"
+ " Parameter Data : Le parametre 1 (Number of Faces) est invalide (Entier Positif attendu).\n"
+ "!Type 514\n"
+ ".XSTEP_201\n"
+ " Parameter Data : Le parametre 2 (Face) est invalide (Entite Face, Type 510 attendue).\n"
+ "!Type 402, Form 1 ou 7\n"
+ ".XSTEP_202\n"
+ " Form %d : Parameter Data : Le parametre 1 (Number of Entries) est invalide (Entier attendu).\n"
+ "!Type 402, Form 1 ou 7\n"
+ ".XSTEP_203\n"
+ " Form %d : Parameter Data : Certains pointeurs de la liste d'entites sont nuls ou negatifs : ignores (Entites attendues).\n"
+ "!Type 402\n"
+ ".XSTEP_204\n"
+ " Form 9 : Parameter Data : Le parametre 1 (Number of Parent Entity) est invalide (Entier attendu : 1).\n"
+ "!Type 402\n"
+ ".XSTEP_205\n"
+ " Form 9 : Parameter Data : Le parametre 2 (Number of children) est invalide (Entier Positif attendu).\n"
+ "!Type 402\n"
+ ".XSTEP_206\n"
+ " Form 9 : Parameter Data : Le parametre 3 (Parent Entity) est invalide (Entite attendue).\n"
+ "!Type 402\n"
+ ".XSTEP_207\n"
+ " Form 9 : Parameter Data : Certains pointeurs de la liste d'entites filles sont nuls ou negatifs (Entites attendues).\n"
+ "!Type 308\n"
+ ".XSTEP_208\n"
+ " Parameter Data : Le parametre 1 (Depth of Subfigure) est invalide (Entier attendu).\n"
+ "!Type 308\n"
+ ".XSTEP_209\n"
+ " Parameter Data : Le parametre 2 (Subfigure Name) est invalide (Chaine au format Hollerith attendue).\n"
+ "!Type 308\n"
+ ".XSTEP_210\n"
+ " Parameter Data : Le parametre 3 (Number of Entities) est invalide (Entie Positif attendu).\n"
+ "!Type 308\n"
+ ".XSTEP_211\n"
+ " Parameter Data : Certains pointeurs de la liste d'entites associees sont nuls ou negatifs : ignores (Entites attendues).\n"
+ "!Type 408\n"
+ ".XSTEP_212\n"
+ " Parameter Data : Le parametre 1 (Subfigure definition entity) est invalide (Entite Subfigure Definition Entity, Type 308 attendue).\n"
+ "!Type 408\n"
+ ".XSTEP_213\n"
+ " Parameter Data : Le parametre %d (Translation data) est invalide (Reel attendu).\n"
+ "!Type 408\n"
+ ".XSTEP_214\n"
+ " Parameter Data : Le parametre 5 (Scale Factor) est invalide (Reel attendu). Valeur 1.0 prise par defaut.\n"
+ "!Type 124\n"
+ ".XSTEP_215\n"
+ " Parameter Data : Tous les elements de la matrice ne sont pas de type Reel.\n"
+ "!ADDED MESSAGES\n"
+ ".XSTEP_246\n"
+ " Parameter Data : le parametre 4 (Number of segments) est inferieur a 1.\n"
+ "!\n"
+ "!\n"
+ "! DCE 6/11/98 Add in Load phase\n"
+ "!\n"
+ ".XSTEP_276\n"
+ "Parameter Data : le parametre 1 (Curve creation mode) est invalide \n"
+ "!\n"
+ ".XSTEP_277\n"
+ "Parameter Data : le parametre 5 (Representation preference) est invalide (entier attendu).\n"
+ "!\n"
+ ".XSTEP_278\n"
+ "Exception durant le chargement de l'entite %s\n"
+ "!\n"
+ "!\n"
+ "!\n"
+ "! ===================================================================\n"
+ "!\n"
+ "!\n"
+ "!\n"
+ "! New translation messages ( S3767 )\n"
+ "!\n"
+ ".IGES_1000\n"
+ " L'Entite %s n'a pas ete chargee en memoire\n"
+ "!\n"
+ ".IGES_1005\n"
+ "Erreur logicielle : transfert d'entite impossible.\n"
+ "!\n"
+ "!.IGES_1006 the same as 1015\n"
+ "! exception raising during the transfer.\n"
+ "!\n"
+ ".IGES_1001\n"
+ "Form %d : Type d'entite non implemente : conversion impossible.\n"
+ "!\n"
+ ".IGES_1010\n"
+ " Le TopoDS_Shape resultat n'a pas le meme parametrage 2D et 3D.\n"
+ "!\n"
+ ".IGES_1015\n"
+ " Erreur logicielle : conversion interrompue.\n"
+ "!\n"
+ ".IGES_1020\n"
+ " Parameter data : le pointeur %d de la liste d'entite associees est nul ou negatif: ignore.\n"
+ "!\n"
+ ".IGES_1025\n"
+ " Erreur de conversion sur l'entite %d : entite ignoree.\n"
+ "!\n"
+ ".IGES_1030\n"
+ " Forme %d: Erreur de conversion sur l'entite IGES %d : entite ignoree.\n"
+ "!\n"
+ ".IGES_1035\n"
+ " La matrice de transformation est invalide : non appliquee.\n"
+ "!\n"
+ ".IGES_1036\n"
+ " Erreur logicielle : entite ignoree.\n"
+ "!\n"
+ ".IGES_1040\n"
+ " Parameter data : le pointeur %d de la liste d'entites est nul ou de type invalide : ignore.\n"
+ "!\n"
+ ".IGES_1045\n"
+ " Deux entites consecutives sont identiques (rang :%d) : une seule est convertie.\n"
+ "!\n"
+ ".IGES_1050\n"
+ " La courbe %dD a ete inversee.\n"
+ "!\n"
+ ".IGES_1051\n"
+ " Toutes le courbes %dD avant le rang %d ont ete inversees.\n"
+ "!\n"
+ ".IGES_1055\n"
+ " La courbe %dD de rang %d etait legerement deconnectee : reparee.\n"
+ "!\n"
+ ".IGES_1060\n"
+ " La courbe %dD de rang %d est trop deconnectee : reparee.\n"
+ "!\n"
+ ".IGES_1061\n"
+ " La surface est converti en TopoDS_Shell pour des problemes de continuite : entite ignoree.\n"
+ "!\n"
+ ".IGES_1062\n"
+ " Le cas des CurveOnSurface sur Composite Surface n'est pas implemente : la representation 3D est retournee.\n"
+ "!\n"
+ ".IGES_1066\n"
+ " Erreur de conversion sur la surface support de la courbe.\n"
+ "!\n"
+ ".IGES_1070\n"
+ " Les representations sont inconstante dans le fichier : Recomputation from %dD.\n"
+ "!\n"
+ ".IGES_1090\n"
+ " La courbe s'auto-intersectait : reparee.\n"
+ "!\n"
+ ".IGES_1095\n"
+ " Les representations 2D et 3D des courbes sont invalides : entite ignoree.\n"
+ "!\n"
+ ".IGES_1100\n"
+ " parameter data : le parametre 2 (Offset Distance Flag) est different de 1 : cas non implemente.\n"
+ "!\n"
+ ".IGES_1105\n"
+ " Le parametre de fin est hors de la courbe : entite ignoree.\n"
+ "!\n"
+ ".IGES_1110\n"
+ " Erreur de transfert sur la courbe de base : entite ignoree.\n"
+ "!\n"
+ ".IGES_1115\n"
+ " Courbe de continuite C0, ne peut etre decoupee en Geom_SplineCurve C1 plus petite que Precision::Confusion().\n"
+ "!\n"
+ ".IGES_1120\n"
+ " Courbe de continuite C0, a ete decoupe en Geom_BSplineCurve continue C1.\n"
+ "!\n"
+ ".IGES_1125\n"
+ " Parameter data : le parametre 1 (Type of Bounded Surface Representation) vaut 0 : cas non implemente. \n"
+ "!\n"
+ ".IGES_1130\n"
+ " Boundary sur Composite Surface : cas non implemente. \n"
+ "!\n"
+ ".IGES_1135\n"
+ " La representation %dD de la courbe n'est pas definie : calculee a partir de la representation %dD.\n"
+ "! 2D curve representation is not defined : computed from 3D curve representation.\n"
+ "!\n"
+ ".IGES_1140\n"
+ " Erreur pendant la conversion de la courbe 3D : recalcul a partir de la courbe 2D.\n"
+ "!\n"
+ ".IGES_1145\n"
+ " Erreur pendant la conversion de la courbe %dD : recalcul a partir de la representation %dD.\n"
+ "! error during 2D curve transfer : recomputed from 3D.\n"
+ "!\n"
+ ".IGES_1150\n"
+ " %s trop deconnecte :recalcul a partir de la representation %dD.\n"
+ "! 2D TopoDS_Wire too disconnected :recomputed from 3D.\n"
+ "!\n"
+ ".IGES_1155\n"
+ " Parameter data : (parametres 1 to 6) les coefficients ne satisfont pas a l'equation d'une conique.\n"
+ "!\n"
+ ".IGES_1156\n"
+ " La conversion de %s %s a echoue : Entite ignoree.\n"
+ "! (type IGES) (DE:Number) transfer failed : Entity skipped.\n"
+ "!\n"
+ ".IGES_1160\n"
+ " Parameter data (Parametres 8 to 11) : Les coordonnees de debut et de fin de l'arc sont les memes : entite non bornee.\n"
+ "!\n"
+ ".IGES_1165 \n"
+ " La transformation n'est pas plane : non appliquee.\n"
+ "!\n"
+ ".IGES_1170\n"
+ "L'equation polynomiale est incorrecte.\n"
+ "!\n"
+ ".IGES_1175\n"
+ " Erreur pendant la creation des points de controle.\n"
+ "!\n"
+ ".IGES_1180\n"
+ " Parameter data : le parametre 1 (Spline Type >3) : cas non implemente.\n"
+ "!\n"
+ ".IGES_1190\n"
+ " Parameter data : le parametre 2 (Degree of basis functions ) est plus petit que 0 ou plus grand que maxdegree : conversion interrompue.\n"
+ "!\n"
+ ".IGES_1195\n"
+ " Parameter data : nombre incorrect de points de controle (au moins deux points sont requis).\n"
+ "!\n"
+ ".IGES_1200\n"
+ " Erreur de conversion : %s multiplicite initiale > degre %s +1.\n"
+ "!\n"
+ ".IGES_1201\n"
+ " Erreur de conversion : %s multiplicite finale > degre %s +1.\n"
+ "!\n"
+ ".IGES_1210\n"
+ " La somme des %s multiplicites n'est pas egale a la somme (nombre de poles + %s degre +1).\n"
+ "!\n"
+ ".IGES_1215\n"
+ " Parameter data : des parametres de poids ne sont pas reels positifs : entite ignoree.\n"
+ "!\n"
+ ".IGES_1220\n"
+ " La %s BSpline rationelle est en fait polynomiale.\n"
+ "!\n"
+ ".IGES_1221\n"
+ " La surface est fait periodique.\n"
+ "!\n"
+ ".IGES_1225\n"
+ " Les points de depart et d'arrivee sont les memes.\n"
+ "!\n"
+ "! 1230 is the same as 1195\n"
+ "!\n"
+ ".IGES_1235\n"
+ " La courbe est trop courte pour etre convertie : entite ignoree.\n"
+ "!\n"
+ ".IGES_1240\n"
+ " Vecteur inutile pour cette forme : ignore.\n"
+ "!\n"
+ ".IGES_1250\n"
+ " La Geom_Surface resultante est continue C0.\n"
+ "!\n"
+ ".IGES_1255\n"
+ " Le reglage a echoue : entite ignoree.\n"
+ "!\n"
+ ".IGES_1265\n"
+ " La surface de base n'est pas continue C0 : construction de l'offset surface impossible.\n"
+ "!\n"
+ ".IGES_1266\n"
+ " La surface de base est continue C0 et ne peut pas etre corrigee en continue C1.\n"
+ "!\n"
+ ".IGES_1267\n"
+ " La surface de base est continue C0 mais a ete corrigee en continue C1.\n"
+ "!\n"
+ ".IGES_1270\n"
+ " La surface de base est continue C0 et a ete convertie en TopoDS_Shell : seule la premiere face sera decalee.\n"
+ "!\n"
+ ".IGES_1275\n"
+ " Model Space Representation 0 cas no implemente : le resultat est la surface de base.\n"
+ "!\n"
+ ".IGES_1280\n"
+ " Direction invalide: entite ignoree.\n"
+ "!\n"
+ ".IGES_1285\n"
+ " Parameter data : le pointeur %d de la liste d'entite fille est nul ou negatif : ignore.\n"
+ "!\n"
+ ".IGES_1295\n"
+ " Le trou %d et le plan ne sont pas coplanaires.\n"
+ "!\n"
+ ".IGES_1300\n"
+ " La courbe contour est invalide : le plan n'est pas borne.\n"
+ "!\n"
+ ".IGES_1305\n"
+ " Parameter data : parametre 3 or 4 (nombre de segments) est inferieur a 1.\n"
+ "!\n"
+ ".IGES_1306\n"
+ " Type invalide pour la courbe numero %d.\n"
+ " \n"
+ ".IGES_1310\n"
+ " Parameter data : le parametre 3 or 4 (degree of basis function) est inferieur a 1 ou superieur a max degree.\n"
+ "!\n"
+ ".IGES_1325\n"
+ " Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).\n"
+ "!\n"
+ ".IGES_1345\n"
+ " Parameter data : le parametre %d (parameter space curve) est incorrect.\n"
+ "!\n"
+ ".IGES_1360\n"
+ " Le TopoDS_Shell resultat n'est pas ferme.\n"
+ "!\n"
+ ".IGES_1365\n"
+ " Numero d'edge invalide %d.\n"
+ "!\n"
+ ".IGES_1370\n"
+ " Arete de couture manquante, ajoutee\n"
+ "!\n"
+ ".IGES_1371\n"
+ " TopoDS_Face creee avec bords naturels\n"
+ "!\n"
+ ".IGES_1372\n"
+ " Un ou plusieurs TopoDS_Wire(s) sur TopoDS_Face inverse(s)\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 sur la conversion du fichier IGES : %s\n"
+ "!\n"
+ ".IGES_2005\n"
+ "Niveau de trace : %d\n"
+ "\n"
+ "!\n"
+ ".IGES_2010\n"
+ "Debut de l'analyse du fichier IGES.\n"
+ "!\n"
+ ".IGES_2015\n"
+ "Nombre de warning pendant l'analyse : %d.\n"
+ "!\n"
+ ".IGES_2020\n"
+ "Nombre de fail pendant l'analyse : %d.\n"
+ "!\n"
+ ".IGES_2025\n"
+ "Fin de l'analyse du fichier (Temps ecoule : %s).\n"
+ "\n"
+ "!\n"
+ ".IGES_2030\n"
+ "Debut de la conversion de donnees.\n"
+ "!\n"
+ ".IGES_2031\n"
+ "Le fichier n'a pas ete charge en memoire.\n"
+ "\n"
+ "!\n"
+ ".IGES_2032\n"
+ "L'entite IGES %d n'existe pas.\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"
+ "Nombre de warnings pendant la conversion : %d.\n"
+ "!\n"
+ ".IGES_2060\n"
+ "Nombre de fails pendant la conversion : %d\n"
+ "!\n"
+ ".IGES_2065\n"
+ "Fin de la conversion des donnees (Temps ecoule : %s).\n"
+ "!\n"
+ ".IGES_2070\n"
+ "Conversion de l'entite IGES DE:%d Type:%d\n"
+ "!\n"
+ ".IGES_2075\n"
+ "\n"
+ "Resultat : %s.\n"
+ "!\n"
+ ".IGES_2076\n"
+ "Pas de TopoDS_Shape resultat.\n"
+ "\n"
+ "!Messages pour TPSTAT.\n"
+ ".IGES_3000\n"
+ "********************************************************************************\n"
+ ".IGES_3005\n"
+ "Statistiques generale de conversion :\n"
+ "!\n"
+ ".IGES_3010\n"
+ " Nombre d'entites IGES selectionnees : %d\n"
+ "!\n"
+ ".IGES_3011\n"
+ " Nombre d'entites IGES racines : %d\n"
+ "!\n"
+ ".IGES_3015\n"
+ " Nombre de Shapes CasCade produites : %d\n"
+ "!\n"
+ ".IGES_3020\n"
+ " Nombre de warnings : %d\n"
+ "!\n"
+ ".IGES_3025\n"
+ " Nombre de fails : %d\n"
+ "!\n"
+ ".IGES_3030\n"
+ "Nombre W/F Type Forme Message affecte\n"
+ "------ --- ---- ----- ---------------\n"
+ "!\n"
+ ".IGES_3035\n"
+ "Sur les entites IGES (DE) :\n"
+ "!\n"
+ ".IGES_3040\n"
+ "Compte des shapes CasCade resultat \n"
+ "\n"
+ "!\n"
+ ".IGES_3045\n"
+ "\n"
+ "Nombre Shapes CasCade\n"
+ "------ --------------\n"
+ "!\n"
+ ".IGES_3050\n"
+ "Mapping de toutes les entites IGES\n"
+ ".IGES_3055\n"
+ "\n"
+ "Type Forme Nombre Shapes CasCade\n"
+ "---- ----- ------ --------------\n"
+ "!\n"
+ "!\n"
+ "!\n"
+ "!\n"
+ "! Debug messages\n"
+ ".IGES_10005\n"
+ "Little edge removed\n"
+ ".IGES_10010\n"
+ "Degenerated edge detected\n"
+ ".IGES_10015\n"
+ "Small lacking edge inserted\n"
+ "!\n"
+ "!\n"
+ ".IGES_10020\n"
+ " Null area wire was detected, wire skipped.\n";
+
+// clang-format on
-// This file has been automatically generated from resource file src/XSMessage/XSTEP.us
+// clang-format off
+// This file has been automatically generated from resource file resources/XSMessage/XSTEP.us
static const char XSMessage_XSTEP_us[] =
"!LOADING PHASE\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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
"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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
" 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ " 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"
+ "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"
"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"
+ "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"
+ "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"
"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"
+ "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"
+ "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"
"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"
+ "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"
"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"
+ "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"
+ "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"
+ "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"
"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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
"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"
+ "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"
+ "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"
+ "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"
+ "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"
"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"
+ "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"
"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"
+ "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"
+ "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"
"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"
+ "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"
"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"
+ "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"
"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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
"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"
+ "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"
"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"
+ " 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"
+ " 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"
"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"
+ "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"
+ "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"
+ "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"
"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"
+ "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"
"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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
+ "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"
" Transfer error on basic curve : entity skipped.\n"
"!\n"
".IGES_1115\n"
- " With C0 continuity can not be split into Geom_BSplineCurve C1 lower than "
- "Precision::Confusion().\n"
+ " With C0 continuity can not be split into Geom_BSplineCurve C1 lower than Precision::Confusion().\n"
"!\n"
".IGES_1120\n"
" With C0 continuity was split into C1 continuity Geom_BSplineCurve.\n"
"!\n"
".IGES_1125\n"
- " Parameter data : parameter 1 (Type of Bounded Surface Representation = 0) : case not "
- "implemented. \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"
"! (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"
+ " 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"
" 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"
+ " 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"
" 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 "
- "offsetted.\n"
+ " Basis surface is C0-continuous and is transferred into a TopoDS_Shell. Only first face was offsetted.\n"
"!\n"
".IGES_1275\n"
" Model Space Representation 0 case not implemented : result is a basis surface.\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"
+ " Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.\n"
"!\n"
".IGES_1325\n"
" Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).\n"
"!\n"
".IGES_10020\n"
" Null area wire was detected, wire skipped.\n";
+
+// clang-format on
+++ /dev/null
-!LOADING PHASE
-.XSTEP_1
- Debut du chargement en memoire du fichier IGES.
-!
-.XSTEP_2
- Erreur d'ouverture du fichier IGES.
-!
-.XSTEP_3
- Raison : Le fichier n'existe pas.
-!
-.XSTEP_4
- Raison : Espace memoire insuffisant.
-!
-.XSTEP_5
- Raison : Ce fichier est protege en lecture.
-!
-.XSTEP_6
- Raison : Trop de fichiers ouverts.
-!
-.XSTEP_7
- Raison : Inconnue.
-!
-.XSTEP_8
- Fin du chargement du fichier IGES (Temps ecoule : %s).
-
-!
-.XSTEP_9
-Debut de lecture du fichier IGES.
-!
-.XSTEP_10
-Fin de lecture du fichier IGES.
-!
-.XSTEP_11
- Erreur interne pendant la lecture de l'entete : le processus continue.
-!
-.XSTEP_12
-Entete et contenu du fichier IGES ont ete charges.
-!
-.XSTEP_13
- Erreur interne durant la lecture de l'entite %d.
-!
-.XSTEP_14
- Erreur interne durant la lecture de l'entite %d parametre %d.
-!
-.XSTEP_15
- Nombre total d'entites chargees : %d.
-!
-.XSTEP_16
- Debut du chargement du modele.
-!
-.XSTEP_17
- Fin du chargement du modele.
-!
-.XSTEP_18
- Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s.
-!
-.XSTEP_19
- Erreur de syntaxe dans le fichier IGES a la ligne %d de la section %s (numero de ligne peut etre incorrecte).
-!
-.XSTEP_20
- Il n'y a pas de Terminate Section : le processus continue.
-!
-.XSTEP_21
-Nombre d'entites nulles ignorees : %d.
-!
-.XSTEP_22
- Entite inconnue %s.
-!
-.XSTEP_23
- Entite recuperee %s.
-!
-.XSTEP_24
-Resume : %d entites inconnues.
-!
-.XSTEP_25
- Nombre de fails pendant le chargement en memoire : %d.
-!
-.XSTEP_26
- Nombre de warnings pendant le chargement en memoire : %d.
-!
-.XSTEP_27
- Directory Entry : Il n'y a pas de parametre. le transfer continue.
-!
-.XSTEP_28
- Directory Entry : Le parametre 1 (Type de l'entite) est incorrect.
-!
-.XSTEP_29
- Directory Entry : Le champ 4 (Line Font Pattern) est incorrect (Un pointeur non nul ou un entier entre 0 et 5 est attendu).
-!
-.XSTEP_30
- Directory Entry : Le champ 5 (Level) est incorrect (Un pointeur ou un entier non nul est attendu).
-!
-.XSTEP_31
- Directory Entry : Le champ 6 (View) est incorrect (Un pointeur non nul est attendu).
-!
-.XSTEP_32
-: Directory Entry : Le champ 7 (Transformation Matrix) est incorrect (Un pointeur non nul est attendu).
-!
-.XSTEP_33
- Entity %s, Type %d : Directory Entry : Le champ 8 (Label Display Associativity) est incorrect (Un pointeur non nul est attendu).
-!
-.XSTEP_34
- Directory Entry : Le champ 13 (Color Number) est incorrect (Un pointeur non nul ou un entier entre 0 et 8 est attendu).
-!
-.XSTEP_35
- Entite nulle %s.
-!
-.XSTEP_36
- Entite inconnue %s.
-!
-.XSTEP_37
- La liste d'associativites est incorrecte.
-!
-.XSTEP_38
- La liste de proprietes est incorrecte.
-! ANALYSIS PHASE
-.XSTEP_39
- Global Section : Nombre de parametres invalides (%d ou %d parametres attendus).
-!
-.XSTEP_40
- Global Section (Parametres 1 et 2) : Parameter Delimiter Character et Record Delimiter Character doivent etre differents.
-!
-.XSTEP_41
- Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Virgule pris par defaut.
-!
-.XSTEP_42
- Global Section (Parametre 2) : Le parametre Record Delimiter Character est invalide. Caractere Point Virgule pris par defaut.
-!
-.XSTEP_43
- Global Section (Parametre 8) : Le parametre Single Precision Magnitude est invalide (Entier Positif attendu). Valeur 38 prise pas defaut.
-!
-.XSTEP_44
- Global Section (Parametre 9) : Le parametre Single Precision Significance est invalide (Entier Positif attendu). Valeur 6 prise pas defaut.
-!
-.XSTEP_45
- Global Section (Parametre 10) : Le parametre Double Precision Magnitude est invalide (Entier Positif attendu). Valeur 308 prise pas defaut.
-!
-.XSTEP_46
- Global Section (Parametre 11) : Le parametre Double Precision Significance est invalide (Entier Positif attendu). Valeur 15 prise pas defaut.
-!
-.XSTEP_47
- Global Section (Parametre 13) : Le parametre Model Space Scale est invalide (Positif attendu). Valeur 1.0 prise pas defaut.
-!
-.XSTEP_48
- Global Section (Parametre 14) : Le parametre Unit Flag est invalide (Entier entre 1 et 11 attendu). Valeur 2 prise pas defaut : Millimeters.
-!
-.XSTEP_49
- Global Section (Parametre 15) : Le parametre Unit Name n'est pas traite.Valeur 2 prise pas defaut : Millimeters.
-!
-.XSTEP_50
- Global Section (Parametre 15) : Le parametre Unit Name n'est pas defini, ignore.
-!
-.XSTEP_51
- Global Section (Parametre 14 et 15) : Le parametre Unit Flag ne correspond pas au parametre Unit Name : Unit Name ignore.
-!
-.XSTEP_52
- Global Section i)(Parametre 19) : Le parametre Minimum Resolution est invalide (Reel Positif attendu). Valeur 0.0 prise pas defaut.
-!
-.XSTEP_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.
-!
-.XSTEP_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.
-!
-.XSTEP_55
- Global Section (Parametre 25) : Le parametre Last change Date n'est pas defini.
-!
-.XSTEP_56
- Global Section (Parametre 18) : Le parametre Date n'est pas defini.
-!
-.XSTEP_57
- Global Section (Parametre %d) : Format de date invalide.
-!
-.XSTEP_58
- Directory Entry (Champ 1) : Le champ Entity Type Number est invalide
-!
-.XSTEP_59
- Directory Entry (Champ 3) : Le champ Structure est indefini.
-!
-.XSTEP_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.
-!
-.XSTEP_61
- Directory Entry (Champ 5) : Le champ Level est invalide (Pointeur ou Entier attendu). Valeur 0 prise par defaut.
-!
-.XSTEP_62
- Directory Entry (Champ 6) : Le champ View est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
-!
-.XSTEP_63
- Directory Entry (Champ 7): Le champ Transformation Matrix est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
-!
-.XSTEP_64
- Directory Entry (Champ 8): Le champ Label Display Entity est invalide (Pointeur ou Zero attendu). Valeur 0 prise par defaut.
-!
-.XSTEP_65
- Directory Entry (Champ 9) : Le champ Blank Status est invalide (Entier attendu : 0 ou 1).
-!
-.XSTEP_66
- Directory Entry (Champ 9) : Le champ Subordinate Entity Switch est invalide (Entier entre 0 et 3 attendu).
-!
-.XSTEP_67
- Directory Entry (Champ 9) : Le champ Entity Use Flag est invalide (Entier entre 0 et 6 attendu).
-!
-.XSTEP_68
- Directory Entry (Champ 9) : Le champ Hierarchy est invalide (Entier entre 0 et 2 attendu).
-!
-.XSTEP_69
- Directory Entry (Champ 12) : Le champ Line Weight Number n'est pas defini.
-!
-.XSTEP_70
- Directory Entry (Champ 13) : Le champ Color Number est invalide (Pointeur ou Entier entre 0 et 8 attendu).
-!
-.XSTEP_71
- Directory Entry (Champ 15) : Le champ Form Number est invalide.
-!
-.XSTEP_72
- Directory Entry (Champ 19): Le champ Entity Subscript Number est invalide (Entier attendu).
-!Type 116
-.XSTEP_73
- Parameter Data : Le parametre %d (Coordinate of Point) est invalide (Reel attendu).
-!Type 116
-.XSTEP_74
- Parameter Data : Le parametre %d (Display Symbol) est invalide (Entite Subfigure Definition, Type 308 attendue).
-!Type 100
-.XSTEP_75
- Parameter Data : Le parametre 1 ( ZT displacement of Arc) est invalide (Reel attendu).
-!Type 100
-.XSTEP_76
- Parameter Data : Le parametre %d (Arc Center ) est invalide (Reel attendu).
-!Type 100
-.XSTEP_77
- Parameter Data : Le parametre %d (Start Point) est invalide (Reel attendu).
-!Type 100
-.XSTEP_78
- Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
-!Type 102
-.XSTEP_79
- Parameter Data : Le parametre 1 (Number of Entities) est invalide :%d (Entier Positif attendu).
-!Type 102
-.XSTEP_80
- Parameter Data : Certains pointeurs de liste d'entites sont nuls ou negatifs : ignores (Entites Point, Connect Point ou Paramerterized Curve attendues).
-!Type 104
-.XSTEP_81
- Parameter Data : Le parametre %d (Conic Coefficient) est invalide (Reel attendu).
-!Type 104
-.XSTEP_82
- Parameter Data : Le parametre 7 (Coordinate of Plane) est invalide (Reel attendu).
-!Type 104
-.XSTEP_83
- Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).
-!Type 104
-.XSTEP_84
- Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
-!Type 106
-.XSTEP_85
- Parameter Data : Le parametre 1 (Interpretation Flag) est invalide (Entier attendu : %d).
-!Type 106
-.XSTEP_86
- Parameter Data : Le parametre 2 (Number of n-tuples) est invalide (Entier Positif attendu).
-!Type 106
-.XSTEP_87
- Parameter Data : Le parametre 3 (Common Z Displacement) est invalide (Reel attendu).
-!Type 106
-.XSTEP_88
- Parameter Data : Tous les parametres Data Point ne sont pas de type Reel.
-!Type 110
-.XSTEP_89
- Parameter Data : Le parametre %d (Starting Point) est invalide (Reel attendu).
-!Type 110
-.XSTEP_90
- Parameter Data : Le parametre %d (Terminate Point) est invalide (Reel attendu).
-!Type 112
-.XSTEP_91
- Parameter Data : Le parametre 1 (Spline Type) est invalide (Entier entre 1 et 6 attendu).
-!Type 112
-.XSTEP_92
- Parameter Data : Le parametre 2 (Degree of Continuity) est invalide (Entier attendu).
-!Type 112
-.XSTEP_93
- Parameter Data : Le parametre 3 (Number of Dimensions) est invalide (Entier attendu : 2 ou 3).
-!Type 112
-.XSTEP_94
- Parameter Data : Le parametre 4 (Number of Segments) est invalide (Entier Positif attendu).
-!Type 112
-.XSTEP_95
- Parameter Data : Tous les parametres Break Point ne sont pas de type Reel.
-!Type 112
-.XSTEP_96
- Parameter Data : L'entite est plane mais les parametres BZ, CZ. DZ ne sont pas nuls
-!Type 126
-.XSTEP_97
- Parameter Data : Le parametre %d (Upper Index of Sum) est invalide (Entier Positif attendu).
-!Type 126
-.XSTEP_98
- Parameter Data : Le parametre %d (Degree of Basis Functions) est invalide (Entier attendu) : Valeur 0 prise par defaut.
-!Type 126
-.XSTEP_99
- Parameter Data : Le parametre %d (Planar/Non Planar Flag) est invalide (Booleen attendu).
-!Type 126
-.XSTEP_100
- Parameter Data : Le parametre %d (Open/Closed Flag) est invalide (Booleen attendu).
-!Type 126
-.XSTEP_101
- Parameter Data : Le parametre %d (Rational/Polynomial Flag) est invalide (Booleen attendu).
-!Type 126
-.XSTEP_102
- Parameter Data : Le parametre %d (NonPeriodic/Periodic Flag) est invalide (Booleen attendu).
-!Type 126
-.XSTEP_103
- Parameter Data : Tous les parametres Knot Sequence ne sont pas de type Reel.
-!Type 126
-.XSTEP_104
- Parameter Data : Tous les parametres Weight ne sont pas de type Reel Positif.
-!Type 126
-.XSTEP_105
- Parameter Data : Le parametre %d (Control Point) est invalide (Reel attendu).
-!Type 126
-.XSTEP_106
- Parameter Data : Le parametre %d (Starting Value) est invalide (Reel attendu).
-!Type 126
-.XSTEP_107
- Parameter Data : Le parametre %d (Ending Value) est invalide (Reel attendu).
-!Type 126
-.XSTEP_108
- Parameter Data : Le parametre %d (Unit Normal) est invalide (Reel attendu).
-!Type 126
-.XSTEP_109
- Parameter Data : Le parametre %d (Unit Normal) n'est pas defini pour une courbe plane.
-!Type 130
-.XSTEP_110
- Parameter Data : Le parametre 1 (Curve Entity to be offset) est invalide (Entite Curve attendue).
-!Type 130
-.XSTEP_111
- Parameter Data : Le parametre 2 (Offset Distance Flag) est invalide (Entier entre 1 et 3 attendu).
-!Type 130
-.XSTEP_112
- Parameter Data : Le parametre 3 (Curve Entity whose coordinate describes the offset) est invalide (Entite Curve attendue).
-!Type 130
-.XSTEP_113
- Parameter Data : Le parametre 4 (Particular Coordinate) est invalide (Entier attendu).
-!Type 130
-.XSTEP_114
- Parameter Data : Le parametre 5 (Tapered Offset Type Flag) est invalide (Entier attendu).
-!Type 130
-.XSTEP_115
- Parameter Data : Le parametre 6 (First Offset distance) est invalide (Reel attendu).
-!Type 130
-.XSTEP_116
- Parameter Data : Le parametre 7 (Arc Length of Fisrt Offset Distance) est invalide (Reel attendu).
-!Type 130
-.XSTEP_117
- Parameter Data : Le parametre 8 (Second Offset Distance) est invalide (Reel attendu).
-!Type 130
-.XSTEP_118
- Parameter Data : Le parametre 9 (Arc Length of Second Offset Distance) est invalide (Reel attendu).
-!Type 130
-.XSTEP_119
- Parameter Data : Le parametre 13 (Offset Curve Starting Parameter Value) est invalide (Reel attendu).
-!Type 130
-.XSTEP_120
- Parameter Data : Le parametre 14 (Offset Curve Ending Parameter Value) est invalide (Reel attendu).
-!Type 130
-.XSTEP_121
- Parameter Data : Le parametre %d (Unit Vector Normal to plane) est invalide (Reel attendu).
-!Type 130
-.XSTEP_122
- Parameter Data : Le parametre 1 (Type of Bounded Surface Representation) est invalide (Entier attendu : 0 ou 1 ).
-!Type 141
-.XSTEP_123
- Parameter Data : Le parametre 2 (Trimming Curves Representation) est invalide (Entier entre 0 et 3 attendu).
-!Type 141
-.XSTEP_124
- Parameter Data : Le parametre 3 (Untrimmed Surface) est invalide (Entite Untrimmed Surface attendue).
-!Type 141
-.XSTEP_125
- Parameter Data : Surface %d non parametrique (parametre 3).
-!Type 141
-.XSTEP_126
- Parameter Data : Le parametre 4 (Number of Curves est invalide (Positif attendu).
-!Type 141
-.XSTEP_127
- Parameter Data : Le parametre 5 (Model Space Curve) est invalide (Entite Curve attendue).
-!Type 141
-.XSTEP_128
- Parameter Data : Le parametre 6 (Orientation Flag) est invalide (Entier attendu : 1 ou 2).
-!Type 141
-.XSTEP_129
- Parameter Data : Le parametre 7 (Number of Associated Parameter Space Curves) est invalide (Entier attendu : 0).
-!Type 141
-.XSTEP_130
- Parameter Data : Certains pointeurs de la liste d'entites Parameter Space Curve sont nuls ou negatifs : ignores (Entites Curve attendues).
-!Type 142
-.XSTEP_131
- Parameter Data : Le parametre 2 (Surface on which the curve lies) est invalide (Entite Surface attendue).
-!Type 142
-.XSTEP_132
- Parameter Data : Le parametre 3 (Curve 2D) est invalide (Entite Curve attendue).
-!Type 142
-.XSTEP_133
- Parameter Data : Le parametre 4 (Curve 3D) est invalide (Entite Curve attendue).
-!Type 142
-.XSTEP_134
- Parameter Data : Les pointeurs sur les courbes 2D et sont nuls (parameter 3 et 4) (Entites Curve attendues).
-!Type 108
-.XSTEP_135
- Parameter Data : Le parametre %d (Coefficient Of Plane) est invalide (Reel attendu).
-!Type 108
-.XSTEP_136
- Parameter Data : Le parametre 5 (Closed Curve) est invalide (Entite Curve attendue).
-!Type 108
-.XSTEP_137
- Parameter Data : Le parametre 5 est invalide (Pointeur nul attendu lorsque le champ Form Number est 0).
-!Type 108
-.XSTEP_138
- Parameter Data : Le parametre 9 (DisplaySymbol Size) est invalide (Reel attendu).
-!Type 108
-.XSTEP_139
- Parameter Data : Le parametre %d (Coordinate of Display Symbol) est invalide (Reel attendu).
-!Type 114
-.XSTEP_140
- Parameter Data : Le parametre 1 (Spline Boundary Type) est invalide (Entier entre 1 et 6 attendu).
-!Type 114
-.XSTEP_141
- Parameter Data : Le parametre 3 (Number of U Segments) est invalide (Entier Positif attendu).
-!Type 114
-.XSTEP_142
- Parameter Data : Le parametre 4 (Number of V Segments) est invalide (Entier Positif attendu).
-!Type 114
-.XSTEP_143
- Parameter Data : Tous les parametres Breakpoint in U ne sont de type Reel.
-!Type 114
-.XSTEP_144
- Parameter Data : Tous les parametres Breakpoint in V ne sont pas de type Reel.
-!Type 114
-.XSTEP_145
- Parameter Data : Tous les parametres %s Coefficient of Patch ne sont pas de type Reel.
-!Type 114
-.XSTEP_146
- Parameter Data : Le parametre %d (Last Z Coefficient of Patch) est invalide (Reel attendu).
-!Type 114
-.XSTEP_147
- Parameter Data : Le nombre de parametres %c Coefficient of Patch est invalide (Entier attendu : 16).
-!Type 118
-.XSTEP_148
- Parameter Data : Le parametre 1 (First Curve) est invalide (Entite Curve attendue).
-!Type 118
-.XSTEP_149
- Parameter Data : Le parametre 2 (Second Curve) est invalide (Entite Curve attendue).
-!Type 118
-.XSTEP_150
- Parameter Data : Le parametre 3 (Direction Flag) est invalide (Entier 0 ou 1 attendu).
-!Type 118
-.XSTEP_151
- Parameter Data : Le parametre 4 (Developable Surface Flag) est invalide (Entier 0 ou 1 attendu).
-!Type 120
-.XSTEP_152
- Parameter Data : Le parametre 1 (Axis of Revolution) est invalide (Entite attendue).
-!Type 120
-.XSTEP_153
- Parameter Data : Le parametre 2 (Generatrix Entity) est invalide (Entite attendue).
-!Type 120
-.XSTEP_154
- Parameter Data : Le parametre 3 (Start Angle) est invalide (Reel attendu).
-!Type 120
-.XSTEP_155
- Parameter Data : Le parametre 4 (Terminate Angle est invalide (Reel attendu).
-!Type 122
-.XSTEP_156
- Parameter Data : Le parametre 1 (Generatrix Entity) est invalide (Entite Curve attendue).
-!Type 122
-.XSTEP_157
- Parameter Data : Le parametre %d (Coordinate of the Terminate Point) est invalide (Reel attendu).
-!Type 128
-.XSTEP_158
- Parameter Data : Valeur supplementaire invalide (Reel attendu).
-!Type 128
-.XSTEP_159
- Parameter Data : Valeur Reelle supplementaire : ignoree.
-!Type 128
-.XSTEP_160
- Parameter Data : Invalid Number of First Knots sequence (Nombre attendu : %d).
-!Type 128
-.XSTEP_161
- Parameter Data : Invalid Number of Second Knots Sequence (Nombre attendu : %d).
-!Type 140
-.XSTEP_162
- Parameter Data : Le parametre %d (Coordinate of Offset Indicator) est invalide (Reel attendu).
-!Type 140
-.XSTEP_163
- Parameter Data : Le parametre 4 (Offset Distance) est invalide (Reel attendu).
-!Type 140
-.XSTEP_164
- Parameter Data : Le parametre 5 (Surface Entity to be offset) est invalide (Entite Surface attendue).
-!Type 143
-.XSTEP_165
- Parameter Data : Le parametre 1 (Bounded Surface Representation Type) est invalide (Entier 0 ou 1 attendu).
-!Type 143
-.XSTEP_166
- Parameter Data : Le parametre 2(Surface Entity to be Bounded) est invalide (Entite Surface attendue).
-!Type 143
-.XSTEP_167
- Parameter Data : Le parametre 3 (Number of Boundary Entities) est invalide (Entier Positif attendu).
-!Type 143
-.XSTEP_168
- Parameter Data : Le parametre %d (Boundary Entity) est invalide (Entite Boundary, Type 141 attendue).
-!Type 144
-.XSTEP_169
- Parameter Data : Le parametre 1 (Surface to be trimmed) est invalide (Entite Surface attendue).
-!Type 144
-.XSTEP_170
- Parameter Data : Le parametre 2 (Outer Boundary Type) est invalide (Entier 0 ou 1 attendu).
-!Type 144
-.XSTEP_171
- Parameter Data : Le parametre 3 ( Number of Inner Boundary Closed Curves) est invalide (Entier Positif attendu).
-!Type 144
-.XSTEP_172
- Parameter Data : Le parametre 4 (Outer Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).
-!Type 144
-.XSTEP_173
- Parameter Data : Le parametre %d (Inner Boundary) est invalide (Entite Curve on a Parametric Surface, Type 142 attendue).
-!Type 190
-.XSTEP_174
- Parameter Data : Le parametre 1 (Point on the Surface) est invalide (Entite Point, Type 116 attendue).
-!Type 190
-.XSTEP_175
- Parameter Data : Le parametre 2 (Surface Normal Direction) est invalide (Entite Direction attendue).
-!Type 190
-.XSTEP_176
- Parameter Data : Le parametre 3 (Reference Direction) est invalide (Entite Direction attendue).
-!Type 190
-.XSTEP_177
- Parameter Data : Le parametre 3 est invalide (Pointeur nul attendu lorsque le champ Form Number est 1).
-!Type 186
-.XSTEP_178
- Parameter Data : Le parametre 1 (Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).
-!Type 186
-.XSTEP_179
- Parameter Data : Le parametre %d (Void Shell) est invalide (Entite Closed Shell, Type 514, Form 1 attendue).
-!Type 186
-.XSTEP_180
- Parameter Data : Le parametre %d (Orientation Flag) est invalide (Booleen attendu).
-!Type 186
-.XSTEP_181
- Parameter Data : Le parametre 3 (Number of Void Shells) est invalide (Entier Positif attendu).
-!Type 502
-.XSTEP_182
- Parameter Data : Le parametre 1 (Number of Vertex Tuples) est invalide (Entier Positif attendu).
-!Type 502
-.XSTEP_183
- Parameter Data : Le parametre % (Coordinate of Vertex) est invalide (Reel attendu).
-!Type 504
-.XSTEP_184
- Parameter Data : Le parametre 1 (Number of Edge Tuples) est invalide (Entier Positif attendu).
-!Type 504
-.XSTEP_185
- Parameter Data : Le parametre 2 (Model Space Curve) est invalide (Entite Curve attendue).
-!Type 504
-.XSTEP_186
- Parameter Data : Le parametre %d (Start Vertex Index) est invalide (Entier attendu).
-!Type 504
-.XSTEP_187
- Parameter Data : Le parametre %d (Terminate Vertex Index) est invalide (Entier attendu).
-!Type 504
-.XSTEP_188
- Parameter Data : Le parametre %d (Start Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).
-!Type 504
-.XSTEP_189
- Parameter Data : Le parametre %d (Terminate Vertex List Entity) est invalide (Entite Vertex List, Type 502 attendue).!T
-!Type 508
-.XSTEP_190
- Parameter Data : Le parametre %d (Edge Type) est invalide (Entier 0 ou 1 attendu).
-!Type 508
-.XSTEP_191
- Parameter Data : Le parametre %d (List Index) est invalide (Entier attendu).
-!Type 508
-.XSTEP_192
- Parameter Data : Le parametre %d (Number of Parameter Curves) est invalide (Entier Positif attendu).
-!Type 508
-.XSTEP_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
-.XSTEP_194
- Parameter Data : Le parametre % (Parameter Space Curve) est invalide (Entite Curve attendue).
-!Type 508
-.XSTEP_195
- Parameter Data : Le parametre %d (Isoparametric Flag) est invalide (Booleen attendu).
-!Type 510
-.XSTEP_196
- Parameter Data : Le parametre 1 (Surface) est invalide (Entite Surface attendue).
-!Type 510
-.XSTEP_197
- Parameter Data : Le parametre 2 (Number of Loops) est invalide (Entier Positif attendu).
-!Type 510
-.XSTEP_198
- Parameter Data : Le parametre 3 (Outer Loop flag) est invalide (Booleen attendu).
-!Type 510
-.XSTEP_199
- Parameter Data : Le parametre %d (Loop of the Face) est invalide (Entite Loop, Type 508 attendue).
-!Type 514
-.XSTEP_200
- Parameter Data : Le parametre 1 (Number of Faces) est invalide (Entier Positif attendu).
-!Type 514
-.XSTEP_201
- Parameter Data : Le parametre 2 (Face) est invalide (Entite Face, Type 510 attendue).
-!Type 402, Form 1 ou 7
-.XSTEP_202
- Form %d : Parameter Data : Le parametre 1 (Number of Entries) est invalide (Entier attendu).
-!Type 402, Form 1 ou 7
-.XSTEP_203
- Form %d : Parameter Data : Certains pointeurs de la liste d'entites sont nuls ou negatifs : ignores (Entites attendues).
-!Type 402
-.XSTEP_204
- Form 9 : Parameter Data : Le parametre 1 (Number of Parent Entity) est invalide (Entier attendu : 1).
-!Type 402
-.XSTEP_205
- Form 9 : Parameter Data : Le parametre 2 (Number of children) est invalide (Entier Positif attendu).
-!Type 402
-.XSTEP_206
- Form 9 : Parameter Data : Le parametre 3 (Parent Entity) est invalide (Entite attendue).
-!Type 402
-.XSTEP_207
- Form 9 : Parameter Data : Certains pointeurs de la liste d'entites filles sont nuls ou negatifs (Entites attendues).
-!Type 308
-.XSTEP_208
- Parameter Data : Le parametre 1 (Depth of Subfigure) est invalide (Entier attendu).
-!Type 308
-.XSTEP_209
- Parameter Data : Le parametre 2 (Subfigure Name) est invalide (Chaine au format Hollerith attendue).
-!Type 308
-.XSTEP_210
- Parameter Data : Le parametre 3 (Number of Entities) est invalide (Entie Positif attendu).
-!Type 308
-.XSTEP_211
- Parameter Data : Certains pointeurs de la liste d'entites associees sont nuls ou negatifs : ignores (Entites attendues).
-!Type 408
-.XSTEP_212
- Parameter Data : Le parametre 1 (Subfigure definition entity) est invalide (Entite Subfigure Definition Entity, Type 308 attendue).
-!Type 408
-.XSTEP_213
- Parameter Data : Le parametre %d (Translation data) est invalide (Reel attendu).
-!Type 408
-.XSTEP_214
- Parameter Data : Le parametre 5 (Scale Factor) est invalide (Reel attendu). Valeur 1.0 prise par defaut.
-!Type 124
-.XSTEP_215
- Parameter Data : Tous les elements de la matrice ne sont pas de type Reel.
-!ADDED MESSAGES
-.XSTEP_246
- Parameter Data : le parametre 4 (Number of segments) est inferieur a 1.
-!
-!
-! DCE 6/11/98 Add in Load phase
-!
-.XSTEP_276
-Parameter Data : le parametre 1 (Curve creation mode) est invalide
-!
-.XSTEP_277
-Parameter Data : le parametre 5 (Representation preference) est invalide (entier attendu).
-!
-.XSTEP_278
-Exception durant le chargement de l'entite %s
-!
-!
-!
-! ===================================================================
-!
-!
-!
-! New translation messages ( S3767 )
-!
-.IGES_1000
- L'Entite %s n'a pas ete chargee en memoire
-!
-.IGES_1005
-Erreur logicielle : transfert d'entite impossible.
-!
-!.IGES_1006 the same as 1015
-! exception raising during the transfer.
-!
-.IGES_1001
-Form %d : Type d'entite non implemente : conversion impossible.
-!
-.IGES_1010
- Le TopoDS_Shape resultat n'a pas le meme parametrage 2D et 3D.
-!
-.IGES_1015
- Erreur logicielle : conversion interrompue.
-!
-.IGES_1020
- Parameter data : le pointeur %d de la liste d'entite associees est nul ou negatif: ignore.
-!
-.IGES_1025
- Erreur de conversion sur l'entite %d : entite ignoree.
-!
-.IGES_1030
- Forme %d: Erreur de conversion sur l'entite IGES %d : entite ignoree.
-!
-.IGES_1035
- La matrice de transformation est invalide : non appliquee.
-!
-.IGES_1036
- Erreur logicielle : entite ignoree.
-!
-.IGES_1040
- Parameter data : le pointeur %d de la liste d'entites est nul ou de type invalide : ignore.
-!
-.IGES_1045
- Deux entites consecutives sont identiques (rang :%d) : une seule est convertie.
-!
-.IGES_1050
- La courbe %dD a ete inversee.
-!
-.IGES_1051
- Toutes le courbes %dD avant le rang %d ont ete inversees.
-!
-.IGES_1055
- La courbe %dD de rang %d etait legerement deconnectee : reparee.
-!
-.IGES_1060
- La courbe %dD de rang %d est trop deconnectee : reparee.
-!
-.IGES_1061
- La surface est converti en TopoDS_Shell pour des problemes de continuite : entite ignoree.
-!
-.IGES_1062
- Le cas des CurveOnSurface sur Composite Surface n'est pas implemente : la representation 3D est retournee.
-!
-.IGES_1066
- Erreur de conversion sur la surface support de la courbe.
-!
-.IGES_1070
- Les representations sont inconstante dans le fichier : Recomputation from %dD.
-!
-.IGES_1090
- La courbe s'auto-intersectait : reparee.
-!
-.IGES_1095
- Les representations 2D et 3D des courbes sont invalides : entite ignoree.
-!
-.IGES_1100
- parameter data : le parametre 2 (Offset Distance Flag) est different de 1 : cas non implemente.
-!
-.IGES_1105
- Le parametre de fin est hors de la courbe : entite ignoree.
-!
-.IGES_1110
- Erreur de transfert sur la courbe de base : entite ignoree.
-!
-.IGES_1115
- Courbe de continuite C0, ne peut etre decoupee en Geom_SplineCurve C1 plus petite que Precision::Confusion().
-!
-.IGES_1120
- Courbe de continuite C0, a ete decoupe en Geom_BSplineCurve continue C1.
-!
-.IGES_1125
- Parameter data : le parametre 1 (Type of Bounded Surface Representation) vaut 0 : cas non implemente.
-!
-.IGES_1130
- Boundary sur Composite Surface : cas non implemente.
-!
-.IGES_1135
- La representation %dD de la courbe n'est pas definie : calculee a partir de la representation %dD.
-! 2D curve representation is not defined : computed from 3D curve representation.
-!
-.IGES_1140
- Erreur pendant la conversion de la courbe 3D : recalcul a partir de la courbe 2D.
-!
-.IGES_1145
- Erreur pendant la conversion de la courbe %dD : recalcul a partir de la representation %dD.
-! error during 2D curve transfer : recomputed from 3D.
-!
-.IGES_1150
- %s trop deconnecte :recalcul a partir de la representation %dD.
-! 2D TopoDS_Wire too disconnected :recomputed from 3D.
-!
-.IGES_1155
- Parameter data : (parametres 1 to 6) les coefficients ne satisfont pas a l'equation d'une conique.
-!
-.IGES_1156
- La conversion de %s %s a echoue : Entite ignoree.
-! (type IGES) (DE:Number) transfer failed : Entity skipped.
-!
-.IGES_1160
- Parameter data (Parametres 8 to 11) : Les coordonnees de debut et de fin de l'arc sont les memes : entite non bornee.
-!
-.IGES_1165
- La transformation n'est pas plane : non appliquee.
-!
-.IGES_1170
-L'equation polynomiale est incorrecte.
-!
-.IGES_1175
- Erreur pendant la creation des points de controle.
-!
-.IGES_1180
- Parameter data : le parametre 1 (Spline Type >3) : cas non implemente.
-!
-.IGES_1190
- Parameter data : le parametre 2 (Degree of basis functions ) est plus petit que 0 ou plus grand que maxdegree : conversion interrompue.
-!
-.IGES_1195
- Parameter data : nombre incorrect de points de controle (au moins deux points sont requis).
-!
-.IGES_1200
- Erreur de conversion : %s multiplicite initiale > degre %s +1.
-!
-.IGES_1201
- Erreur de conversion : %s multiplicite finale > degre %s +1.
-!
-.IGES_1210
- La somme des %s multiplicites n'est pas egale a la somme (nombre de poles + %s degre +1).
-!
-.IGES_1215
- Parameter data : des parametres de poids ne sont pas reels positifs : entite ignoree.
-!
-.IGES_1220
- La %s BSpline rationelle est en fait polynomiale.
-!
-.IGES_1221
- La surface est fait periodique.
-!
-.IGES_1225
- Les points de depart et d'arrivee sont les memes.
-!
-! 1230 is the same as 1195
-!
-.IGES_1235
- La courbe est trop courte pour etre convertie : entite ignoree.
-!
-.IGES_1240
- Vecteur inutile pour cette forme : ignore.
-!
-.IGES_1250
- La Geom_Surface resultante est continue C0.
-!
-.IGES_1255
- Le reglage a echoue : entite ignoree.
-!
-.IGES_1265
- La surface de base n'est pas continue C0 : construction de l'offset surface impossible.
-!
-.IGES_1266
- La surface de base est continue C0 et ne peut pas etre corrigee en continue C1.
-!
-.IGES_1267
- La surface de base est continue C0 mais a ete corrigee en continue C1.
-!
-.IGES_1270
- La surface de base est continue C0 et a ete convertie en TopoDS_Shell : seule la premiere face sera decalee.
-!
-.IGES_1275
- Model Space Representation 0 cas no implemente : le resultat est la surface de base.
-!
-.IGES_1280
- Direction invalide: entite ignoree.
-!
-.IGES_1285
- Parameter data : le pointeur %d de la liste d'entite fille est nul ou negatif : ignore.
-!
-.IGES_1295
- Le trou %d et le plan ne sont pas coplanaires.
-!
-.IGES_1300
- La courbe contour est invalide : le plan n'est pas borne.
-!
-.IGES_1305
- Parameter data : parametre 3 or 4 (nombre de segments) est inferieur a 1.
-!
-.IGES_1306
- Type invalide pour la courbe numero %d.
-
-.IGES_1310
- Parameter data : le parametre 3 or 4 (degree of basis function) est inferieur a 1 ou superieur a max degree.
-!
-.IGES_1325
- Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
-!
-.IGES_1345
- Parameter data : le parametre %d (parameter space curve) est incorrect.
-!
-.IGES_1360
- Le TopoDS_Shell resultat n'est pas ferme.
-!
-.IGES_1365
- Numero d'edge invalide %d.
-!
-.IGES_1370
- Arete de couture manquante, ajoutee
-!
-.IGES_1371
- TopoDS_Face creee avec bords naturels
-!
-.IGES_1372
- Un ou plusieurs TopoDS_Wire(s) sur TopoDS_Face inverse(s)
-!
-.IGES_1373
- Knots are not in ascending order
-!
-.IGES_1374
- Difference between weights is too big.
-!
-!
-!
-!
-! Trace File messages
-.IGES_2000
-Diagnostics sur la conversion du fichier IGES : %s
-!
-.IGES_2005
-Niveau de trace : %d
-
-!
-.IGES_2010
-Debut de l'analyse du fichier IGES.
-!
-.IGES_2015
-Nombre de warning pendant l'analyse : %d.
-!
-.IGES_2020
-Nombre de fail pendant l'analyse : %d.
-!
-.IGES_2025
-Fin de l'analyse du fichier (Temps ecoule : %s).
-
-!
-.IGES_2030
-Debut de la conversion de donnees.
-!
-.IGES_2031
-Le fichier n'a pas ete charge en memoire.
-
-!
-.IGES_2032
-L'entite IGES %d n'existe pas.
-
-!
-.IGES_2035
-read.precision.mode : %d
-!
-.IGES_2040
-read.precision.val : %f
-!
-.IGES_2045
-read.iges.bspline.continuity : %d
-!
-.IGES_2050
-read.surfacecurve.mode : %d
-
-!
-.IGES_2055
-Nombre de warnings pendant la conversion : %d.
-!
-.IGES_2060
-Nombre de fails pendant la conversion : %d
-!
-.IGES_2065
-Fin de la conversion des donnees (Temps ecoule : %s).
-!
-.IGES_2070
-Conversion de l'entite IGES DE:%d Type:%d
-!
-.IGES_2075
-
-Resultat : %s.
-!
-.IGES_2076
-Pas de TopoDS_Shape resultat.
-
-!Messages pour TPSTAT.
-.IGES_3000
-********************************************************************************
-.IGES_3005
-Statistiques generale de conversion :
-!
-.IGES_3010
- Nombre d'entites IGES selectionnees : %d
-!
-.IGES_3011
- Nombre d'entites IGES racines : %d
-!
-.IGES_3015
- Nombre de Shapes CasCade produites : %d
-!
-.IGES_3020
- Nombre de warnings : %d
-!
-.IGES_3025
- Nombre de fails : %d
-!
-.IGES_3030
-Nombre W/F Type Forme Message affecte
------- --- ---- ----- ---------------
-!
-.IGES_3035
-Sur les entites IGES (DE) :
-!
-.IGES_3040
-Compte des shapes CasCade resultat
-
-!
-.IGES_3045
-
-Nombre Shapes CasCade
------- --------------
-!
-.IGES_3050
-Mapping de toutes les entites IGES
-.IGES_3055
-
-Type Forme Nombre Shapes CasCade
----- ----- ------ --------------
-!
-!
-!
-!
-! Debug messages
-.IGES_10005
-Little edge removed
-.IGES_10010
-Degenerated edge detected
-.IGES_10015
-Small lacking edge inserted
-!
-!
-.IGES_10020
- Null area wire was detected, wire skipped.
+++ /dev/null
-!LOADING PHASE
-.XSTEP_1
-Beginning of IGES file memory loading.
-!
-.XSTEP_2
-IGES file opening error.
-!
-.XSTEP_3
-Reason : No such file or directory.
-!
-.XSTEP_4
-Reason : Not enough space.
-!
-.XSTEP_5
-Reason : Permission denied.
-!
-.XSTEP_6
-Reason : Too many open files.
-!
-.XSTEP_7
-Reason : No determined.
-!
-.XSTEP_8
-End of loading IGES file to memory (Elapsed time : %s).
-
-!
-.XSTEP_9
-Beginning of IGES file reading.
-!
-.XSTEP_10
-End of IGES file reading.
-!
-.XSTEP_11
-Internal error during file header reading. Process continues.
-!
-.XSTEP_12
-Header and content of IGES file are loaded.
-!
-.XSTEP_13
-Internal error during reading of entity %d.
-!
-.XSTEP_14
-Internal error during reading of entity %d (parameter %d).
-!
-.XSTEP_15
-Total number of loaded entities %d.
-!
-.XSTEP_16
-Beginning of model loading.
-!
-.XSTEP_17
-End of model loading.
-!
-.XSTEP_18
-Syntax error in IGES file at line %d in section %s.
-!
-.XSTEP_19
-Syntax error in IGES file at line %d in section %s (line number may be incorrect).
-!
-.XSTEP_20
-There is no Terminate Section, please check end of IGES file. Process continues.
-!
-.XSTEP_21
-Number of ignored Null Entities : %d.
-!
-.XSTEP_22
- Unknown entity %s.
-!
-.XSTEP_23
- Recovered entity %s.
-!
-.XSTEP_24
-Report : %d unknown entities.
-!
-.XSTEP_25
-Number of fails in memory loading : %d.
-!
-.XSTEP_26
-Number of warnings in memory loading : %d.
-!
-.XSTEP_27
- Directory Entry : there is no parameter. Process continues.
-!
-.XSTEP_28
- Directory Entry : parameter 1 (entity type) is incorrect.
-!
-.XSTEP_29
- Directory Entry : Field 4 (Line Font Pattern) is incorrect (Non null pointer or Integer between 0 and 5 was expected).
-!
-.XSTEP_30
- Directory Entry : Field 5 (Level) isincorrect (Not null pointer or not null Integer was expected).
-!
-.XSTEP_31
- Directory Entry : Field 6 (View) is incorrect (Not null pointer or Integer Zero was expected).
-!
-.XSTEP_32
- Directory Entry : Field 7 (Transformation Matrix) is incorrect (Not null pointer or Integer Zero was expected).
-!
-.XSTEP_33
- Directory Entry : Field 8 (Label Display Associativity) is incorrect (Not null pointer or Integer Zero was expected).
-!
-.XSTEP_34
- Directory Entry : Field 13 (Color Number) is incorrect (Not null pointer or Integer between 0 and 8 was expected).
-!
-.XSTEP_35
- Null entity %s.
-!
-.XSTEP_36
- Unknown entity %s.
-!
-.XSTEP_37
- Associativity list is incorrect.
-!
-.XSTEP_38
- Property list is incorrect.
-! ANALYSIS PHASE
-.XSTEP_39
-Global Section : Incorrect number of parameters (%d or %d parameters were expected).
-!
-.XSTEP_40
-Global Section (Parameters 1 and 2) : Parameter Delimiter Character and Record Delimiter Character must not have the same value.
-!
-.XSTEP_41
-Global Section (Parameter 2) : Parameter Delimiter Character is incorrect. Default character comma taken.
-!
-.XSTEP_42
-Global Section (Parameter 2) : Character Record Delimiter parameter is incorrect. Default character Semicolon taken.
-!
-.XSTEP_43
-Global Section (Parameter 8) : Single Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 38 taken.
-!
-.XSTEP_44
-Global Section (Parameter 9) : Single Precision Significance parameter is incorrect (Expected positive Integer). Default value 6 taken.
-!
-.XSTEP_45
-Global Section (Parameter 10) : Double Precision Magnitude parameter is incorrect (Expected positive Integer). Default value 308 taken.
-!
-.XSTEP_46
-Global Section (Parameter 11) : Double Precision Significance parameter is incorrect (Expected positive Integer). Default value 15 taken.
-!
-.XSTEP_47
-Global Section (Parameter 13) : Model Space Scale parameter is incorrect (Expected positive Real). Default value 1.0 taken.
-!
-.XSTEP_48
-Global Section (Parameter 14) : Unit Flag parameter is incorrect (Integer between 1 et 11 was expected). Default value 2 taken : Millimeters.
-!
-.XSTEP_49
-Global Section (Parameter 15): Unit Name parameter is not recognized. Default value 2 taken : Millimeters.srl
-!
-.XSTEP_50
-Global Section (Parameter 15) : Unit Name parameter is undefined : Unit Name ignored.
-!
-.XSTEP_51
-Global Section (Parameter 14 and 15) : Unit Flag parameter does not correspond to Unit Name parameter : Unit Name ignored.
-!
-.XSTEP_52
-Global Section (Parameter 19) : (Expected positive Real). Default value 0.0 taken.
-!
-.XSTEP_53
-Global Section (Parameter 23) : Version Flag parameter is incorrect (Integer between 1 et 11 was expected. Default value 3 taken : Version 2.0.
-!
-.XSTEP_54
-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.
-!
-.XSTEP_55
-Global Section (Parameter 25) : Last Change Date parameter is undefined.
-!
-.XSTEP_56
-Global Section (Parameter %d) : Date parameter is undefined.
-!
-.XSTEP_57
-Global Section (Parameter %d) : Incorrect Date Format.
-!
-.XSTEP_58
- Directory Entry (Field 1) : entity type number field is incorrect (Expected Integer : %d).
-!
-.XSTEP_59
- Directory Entry (Field 3) : Structure field is undefined.
-!
-.XSTEP_60
- Directory Entry (Field 4) : Line Font Pattern field is incorrect (Pointer or Integer between 0 and 5 was expected). Default value 0 taken.
-!
-.XSTEP_61
- Directory Entry (Field 5) : Level field is incorrect (Pointer or Integer were expected). Default value 0 taken.
-!
-.XSTEP_62
- Directory Entry (Field 6) : View field is incorrect (Pointer or Zero were expected). Default value 0 taken.
-!
-.XSTEP_63
- Directory Entry (Field 7): Transformation Matrix field is incorrect (Pointer or Zero were expected). Default value 0 taken.
-!
-.XSTEP_64
- Directory Entry (Field 8): Label Display entity field is incorrect (Pointer or Zero were expected). Default value 0 taken.
-!
-.XSTEP_65
- Directory Entry (Field 9) : Blank Status field is incorrect (Expected Integer : 0 or 1).
-!
-.XSTEP_66
- Directory Entry (Field 9) : Subordinate entity Switch field is incorrect (Integer between 0 and 3 was expected).
-!
-.XSTEP_67
- Directory Entry (Field 9) : entity Use Flag is incorrect (Integer between 0 and 6 was expected).
-!
-.XSTEP_68
- Directory Entry (Field 9) : Hierarchy field is incorrect (Integer between 0 and 2 was expected).
-!
-.XSTEP_69
- Directory Entry (Field 12) : Line Weight Number is undefined.
-!
-.XSTEP_70
- Directory Entry (Field 13) : Color Number field is incorrect (Pointer or Integer between 0 and 8 was expected).
-!
-.XSTEP_71
- Directory Entry (Field 15) : Form Number field is incorrect.
-!
-.XSTEP_72
- Directory Entry (Field 19): entity Subscript Number field is incorrect (Integer was expected).
-!Type 116
-.XSTEP_73
-Parameter Data : parameter %d (Coordinate of Point) is incorrect (Real was expected).
-!Type 116
-.XSTEP_74
-Parameter Data : parameter %d (Display Symbol) is incorrect (Subfigure Definition entity, Type 308 was expected).
-!Type 100
-.XSTEP_75
-Parameter Data : parameter 1 (ZT displacement of Arc) is incorrect (Real was expected).
-!Type 100
-.XSTEP_76
-Parameter Data : parameter %d (Arc Center) is incorrect (Real was expected).
-!Type 100
-.XSTEP_77
-Parameter Data : parameter %d (Start Point) is incorrect (Real was expected).
-!Type 100
-.XSTEP_78
-Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
-!Type 102
-.XSTEP_79
-Parameter Data : parameter 1 (Number of Entities) is incorrect : %d (Expected positive Integer).
-!Type 102
-.XSTEP_80
-Parameter Data : Some pointers in entity list are null or negative : ignored (Point, Connect Point or Parameterized Curve Entities were expected).
-!Type 104
-.XSTEP_81
-Parameter Data : parameter %d (Conic Coefficient) is incorrect (Real was expected).
-!Type 104
-.XSTEP_82
-Parameter Data : parameter 7 (Coordinate of Plane) is incorrect (Real was expected).
-!Type 104
-.XSTEP_83
-Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).
-!Type 104
-.XSTEP_84
-Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
-!Type 106
-.XSTEP_85
-Parameter Data : parameter 1 (Interpretation Flag) is incorrect (Expected Integer : %d).
-!Type 106
-.XSTEP_86
-Parameter Data : parameter 2 (Number of n-tuples) is incorrect (Expected positive Integer).
-!Type 106
-.XSTEP_87
-Parameter Data : parameter 3 (Common Z Displacement) is incorrect (Real was expected).
-!Type 106
-.XSTEP_88
-Parameter Data : not all Data Point parameters are of Real type.
-!Type 110
-.XSTEP_89
-Parameter Data : parameter %d (Starting Point) is incorrect (Real was expected).
-!Type 110
-.XSTEP_90
-Parameter Data : parameter %d (Terminate Point) is incorrect (Real was expected).
-!Type 112
-.XSTEP_91
-Parameter Data : parameter 1 (Spline Type) is incorrect (Integer between 1 and 6 was expected).
-!Type 112
-.XSTEP_92
-Parameter Data (Parameter 2) : parameter 2 (Degree of Continuity) is incorrect (Expected Integer).
-!Type 112
-.XSTEP_93
-Parameter Data : parameter 3 (Number of Dimensions) is incorrect (Expected Integer : 2 or 3).
-!Type 112
-.XSTEP_94
-Parameter Data : parameter 4 (Number of Segments) is incorrect (Expected positive Integer).
-!Type 112
-.XSTEP_95
-Parameter Data : not all Break Point parameters are of Real type.
-!Type 112
-.XSTEP_96
-Parameter Data : entity is planar but parameters BZ, CZ. DZ are not null.
-!Type 126
-.XSTEP_97
-Parameter Data : parameter %d (Upper Index of Sum) is incorrect (Expected positive Integer).
-!Type 126
-.XSTEP_98
-Parameter Data : parameter %d (Degree of Basis Functions) is incorrect (Expected Integer) : Default value 0 taken.
-!Type 126
-.XSTEP_99
-Parameter Data : parameter %d (Planar/Non Planar Flag) is incorrect (Expected Boolean).
-!Type 126
-.XSTEP_100
-Parameter Data : parameter %d (Open/Closed Flag) is incorrect (Expected Boolean).
-!Type 126
-.XSTEP_101
-Parameter Data : parameter %d (Rational/Polynomial Flag) is incorrect (Expected Boolean).
-!Type 126
-.XSTEP_102
-Parameter Data : parameter %d (NonPeriodic/Periodic Flag) is incorrect (Expected Boolean).
-!Type 126
-.XSTEP_103
-Parameter Data : not all Knot Sequence parameters are of Real type.
-!Type 126
-.XSTEP_104
-Parameter Data : not all Weight parameters are of positive Real type.
-!Type 126
-.XSTEP_105
-Parameter Data : parameter %d (Control Point) is incorrect (Real was expected).
-!Type 126
-.XSTEP_106
-Parameter Data : parameter %d (Starting Value) is incorrect (Real was expected).
-!Type 126
-.XSTEP_107
-Parameter Data : parameter %d (Ending Value) is incorrect (Real was expected).
-!Type 126
-.XSTEP_108
-Parameter Data : parameter %d (Unit Normal) is incorrect (Real was expected).
-!Type 126
-.XSTEP_109
-Parameter Data : parameter %d (Unit Normal) is undefined for a planar curve.
-!Type 130
-.XSTEP_110
-Parameter Data : parameter 1 (Curve entity to be offset) is incorrect (Curve entity was expected).
-!Type 130
-.XSTEP_111
-Parameter Data : parameter 2 (Offset Distance Flag) is incorrect (Integer between 1 and 3 was expected).
-!Type 130
-.XSTEP_112
-Parameter Data : parameter 3 (Curve entity whose coordinate describes offset) is incorrect (Curve entity was expected).
-!Type 130
-.XSTEP_113
-Parameter Data : parameter 4 (Particular Coordinate) is incorrect (Expected Integer).
-!Type 130
-.XSTEP_114
-Parameter Data : parameter 5 (Tapered Offset Type Flag) is incorrect (Expected Integer).
-!Type 130
-.XSTEP_115
-Parameter Data : parameter 6 (First Offset distance) is incorrect (Real was expected).
-!Type 130
-.XSTEP_116
-Parameter Data : parameter 7 (Arc Length of First Offset Distance) is incorrect (Real was expected).
-!Type 130
-.XSTEP_117
-Parameter Data : parameter 8 (Second Offset Distance) is incorrect (Real was expected).
-!Type 130
-.XSTEP_118
-Parameter Data : parameter 9 (Arc Length of Second Offset Distance) is incorrect (Real was expected).
-!Type 130
-.XSTEP_119
-Parameter Data : parameter 13 (Offset Curve Starting Parameter Value) is incorrect (Real was expected).
-!Type 130
-.XSTEP_120
-Parameter Data : parameter 14 (Offset Curve Ending Parameter Value) is incorrect (Real was expected).
-!Type 130
-.XSTEP_121
-Parameter Data : parameter %d (Unit Vector Normal to plane) is incorrect (Real was expected).
-!Type 141
-.XSTEP_122
-Parameter Data : parameter 1 (Type of Bounded Surface Representation) is incorrect (Expected Integer : 0 or 1).
-!Type 141
-.XSTEP_123
-Parameter Data : parameter 2 (Trimming Curves Representation) is incorrect (Integer between 0 and 3 was expected).
-!Type 141
-.XSTEP_124
-Parameter Data : parameter 3 (Untrimmed Surface) is incorrect (Untrimmed Surface entity was expected).
-!Type 141
-.XSTEP_125
-Parameter Data : Not parametric Surface %d (parameter 3).
-!Type 141
-.XSTEP_126
-Parameter Data : parameter 4 (Number of Curves) is incorrect (Expected positive).
-!Type 141
-.XSTEP_127
-Parameter Data : parameter 5 (Model Space Curve) is incorrect (Curve entity was expected).
-!Type 141
-.XSTEP_128
-Parameter Data (Parameter 6) : Orientation Flag parameter is incorrect (Expected Integer : 1 or 2).
-!Type 141
-.XSTEP_129
-Parameter Data : parameter 7 (Number of Associated Parameter Space Curves) is incorrect (Expected Integer : 0).
-!Type 141
-.XSTEP_130
-Parameter Data : Some pointers in Parameter Space Curve list are null or negative : ignored (Curve Entities were expected).
-!Type 142
-.XSTEP_131
-Parameter Data : parameter 2 (Surface on which the curve lies) is incorrect (Surface entity was expected).
-!Type 142
-.XSTEP_132
-Parameter Data : parameter 3 (Curve 2D) is incorrect (Curve entity was expected).
-!Type 142
-.XSTEP_133
-Parameter Data : parameter 4 (Curve 3D) is incorrect (Curve entity was expected).
-!Type 142
-.XSTEP_134
-Parameter Data : pointers of Curve 2D and 3D are null (parameter 3 and 4) (Curve Entities were expected).
-!Type 108
-.XSTEP_135
-Parameter Data : parameter %d (Coefficient Of Plane) is incorrect (Real was expected).
-!Type 108
-.XSTEP_136
-Parameter Data : parameter 5 (Closed Curve) is incorrect (Curve entity was expected).
-!Type 108
-.XSTEP_137
-Parameter Data : parameter 5 (Null pointer in Form Number 0 was Expected).
-!Type 108
-.XSTEP_138
-Parameter Data : parameter 9 (Display Symbol Size) is incorrect (Real was expected).
-!Type 108
-.XSTEP_139
-Parameter Data : parameter %d (Coordinate of Display Symbol) is incorrect (Real was expected).
-!Type 114
-.XSTEP_140
-Parameter Data : parameter 1 (Spline Boundary Type) is incorrect (Integer between 1 and 6 was expected).
-!Type 114
-.XSTEP_141
-Parameter Data : parameter 3 (Number of U Segments) is incorrect (Expected positive Integer).
-!Type 114
-.XSTEP_142
-Parameter Data : parameter 4 (Number of V Segments) is incorrect (Expected positive Integer).
-!Type 114
-.XSTEP_143
-Parameter Data : not all Breakpoints in U parameters are of Real type.
-!Type 114
-.XSTEP_144
-Parameter Data : not all Breakpoints in V parameters are of Real type.
-!Type 114
-.XSTEP_145
-Parameter Data : not all %s Coefficient of Patch parameter(s) are of Real type.
-!Type 114
-.XSTEP_146
-Parameter Data : parameter %d (Last Z Coefficient of Patch) is incorrect.
-!Type 114
-.XSTEP_147
-Parameter Data : %s Coefficient of Patch parameters are incorrect (Expected Integer : 16).
-!Type 118
-.XSTEP_148
-Parameter Data : parameter 1 (First Curve) is incorrect.
-!Type 118
-.XSTEP_149
-EParameter Data : parameter 2 (Second Curve) is incorrect.
-!Type 118
-.XSTEP_150
-Parameter Data : parameter 3 (Direction Flag) is incorrect (Integer 0 or 1 was expected).
-!Type 118
-.XSTEP_151
-Parameter Data : parameter 4 (Developable Surface Flag) is incorrect (Integer 0 or 1 was expected).
-!Type 120
-.XSTEP_152
-Parameter Data : parameter 1 (Axis of Revolution) is incorrect.
-!Type 120
-.XSTEP_153
-Parameter Data : parameter 2 (Generatrix entity) is incorrect.
-!Type 120
-.XSTEP_154
-Parameter Data : parameter 3 (Start Angle) is incorrect.
-!Type 120
-.XSTEP_155
-Parameter Data : parameter 4 (Terminate Angle) is incorrect.
-!Type 122
-.XSTEP_156
-Parameter Data : parameter 1 (Generatrix entity) is incorrect.
-!Type 122
-.XSTEP_157
-Parameter Data : parameter %d (Coordinate of Terminate Point) is incorrect.
-!Type 128
-.XSTEP_158
-Parameter Data : Incorrect Additional value.
-!Type 128
-.XSTEP_159
-Parameter Data : Additional Real value : ignored.
-!Type 128
-.XSTEP_160
-Parameter Data : Invalid Number in First Knots sequence.
-!Type 128
-.XSTEP_161
-Parameter Data : Invalid Number in Second Knots sequence.
-!Type 140
-.XSTEP_162
-Parameter Data : parameter %d (Coordinate of Offset Indicator) is incorrect.
-!Type 140
-.XSTEP_163
-Parameter Data : parameter 4 (Offset Distance) is incorrect.
-!Type 140
-.XSTEP_164
-Parameter Data : parameter 5 (Surface entity to be offset) is incorrect.
-!Type 143
-.XSTEP_165
-Parameter Data : parameter 1 (Bounded Surface Representation type) is incorrect (Integer 0 or 1 was expected).
-!Type 143
-.XSTEP_166
-Parameter Data : parameter 2 (Surface entity to be bounded) is incorrect.
-!Type 143
-.XSTEP_167
-Parameter Data : parameter 3 (Number of Boundary entities) is incorrect.
-!Type 143
-.XSTEP_168
-Parameter Data : parameter %d (Boundary entity) is incorrect.
-!Type 144
-.XSTEP_169
-Parameter Data : parameter 1 (Surface to be trimmed) is incorrect.
-!Type 144
-.XSTEP_170
-Parameter Data : parameter 2 (Outer Boundary type) is incorrect (Integer 0 or 1 was expected).
-!Type 144
-.XSTEP_171
-Parameter Data : parameter 3 (Number of Inner Boundary Closed Curves) is incorrect (Expected positive Integer).
-!Type 144
-.XSTEP_172
-Parameter Data : parameter 4 (Outer Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).
-!Type 144
-.XSTEP_173
-Parameter Data : parameter %d (Inner Boundary) is incorrect (Curve on a Parametric Surface entity, Type 142 was expected).
-!Type 190
-.XSTEP_174
-Parameter Data : parameter 1 (Point on Surface) is incorrect (Point entity, Type 116 was expected).
-!Type 190
-.XSTEP_175
-Parameter Data : parameter 2 ( Surface Normal Direction) is incorrect (Direction entity was expected).
-!Type 190
-.XSTEP_176
-Parameter Data : parameter 3 (Reference Direction) is incorrect (Direction entity was expected).
-!Type 190
-.XSTEP_177
-Parameter Data : parameter 3 (Null pointer was expected when Form Number field is 1).
-!Type 186
-.XSTEP_178
-Parameter Data : parameter 1 (Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).
-!Type 186
-.XSTEP_179
-Parameter Data : parameter %d (Void Shell) is incorrect (Closed Shell entity, Type 514, Form 1 was expected).
-!Type 186
-.XSTEP_180
-Parameter Data : parameter %d (Orientation Flag) is incorrect (Expected Boolean).
-!Type 186
-.XSTEP_181
-Parameter Data : parameter 3 (Number of Void Shells) is incorrect (Expected positive Integer)
-!Type 502
-.XSTEP_182
-Parameter Data : parameter 1 (Number of Vertex Tuples) is incorrect (Expected positive Integer).
-!Type 502
-.XSTEP_183
-Parameter Data : parameter %d (Coordinate of Vertex) is incorrect (Real was expected).
-!Type 504
-.XSTEP_184
-Parameter Data : parameter 1 (Number of Edge Tuples) is incorrect (Expected positive Integer).
-!Type 504
-.XSTEP_185
-Parameter Data : parameter 2 (Model Space Curve) is incorrect (Curve entity was expected).
-!Type 504
-.XSTEP_186
-Parameter Data : parameter %d (Start Vertex Index) is incorrect (Expected Integer).
-!Type 504
-.XSTEP_187
-Parameter Data : parameter %d (Terminate Vertex Index) is incorrect (Expected Integer).
-!Type 504
-.XSTEP_188
- Parameter Data : parameter %d (Start Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).
-!Type 504
-.XSTEP_189
- Parameter Data : parameter %d (Terminate Vertex List entity) is incorrect (Vertex List entity, Type 502 was expected).
-!Type 508
-.XSTEP_190
-Parameter Da ta : parameter %d (Edge Type) is incorrect (Integer 0 or 1 was expected).
-!Type 508
-.XSTEP_191
-Parameter Data : parameter %d (List Index) is incorrect (Expected Integer).
-!Type 508
-.XSTEP_192
-Parameter Data : parameter %d (Number of Parameter Curves) is incorrect (Expected positive Integer).
-!Type 508
-.XSTEP_193
-Parameter Data : parameter %d (Vertex or Edge List entity) is incorrect (Vertex List or Edge List entity, Type 502 or 504 was expected).
-!Type 508
-.XSTEP_194
-Parameter Data : parameter %d (Parameter Space Curve) is incorrect (Curve entity was expected).
-!Type 508
-.XSTEP_195
-Parameter Data : parameter %d (Isoparametric Flag) is incorrect (Expected Boolean).
-!Type 510
-.XSTEP_196
-Parameter Data : parameter 1 (Surface) is incorrect.
-!Type 510
-.XSTEP_197
-Parameter Data : parameter 2 (Number of Loops) is incorrect (Expected positive Integer).
-!Type 510
-.XSTEP_198
-Parameter Data : parameter 3 (Outer Loop flag) is incorrect (Expected Boolean).
-!Type 510
-.XSTEP_199
-Parameter Data : parameter %d (Loop of the Face) is incorrect (Loop entity, Type 508 was expected).
-!Type 514
-.XSTEP_200
-Parameter Data : parameter 1 (Number of Faces) is incorrect (Expected positive Integer).
-!Type 514
-.XSTEP_201
-Parameter Data : parameter 2 (Face) is incorrect (Face entity, Type 510 was expected).
-!Type 402, Form 1 or 7
-.XSTEP_202
-Form %d : Parameter Data : parameter 1 (Number of Entries) is incorrect (expected positive integer).
-!Type 402, Form 1 or 7
-.XSTEP_203
-Form %d : Parameter Data : some pointers of entity list are null or negative : ignored (Entities were expected).
-!Type 402
-.XSTEP_204
-Form 9 : Parameter Data : parameter 1 (Number of Parent entity) is incorrect (Expected Integer : 1).
-!Type 402
-.XSTEP_205
-Form 9 : Parameter Data : parameter 2 (Number of Children) is incorrect (expected positive integer).
-!Type 402
-.XSTEP_206
-Form 9 : Parameter Data : parameter 3 (Parent entity) is incorrect (entity expected).
-!Type 402
-.XSTEP_207
-Form 9 : Parameter Data : some pointers in Child Entity List are null or negative : ignored (Entities were expected).
-!Type 308
-.XSTEP_208
-Parameter Data : parameter 1 (Depth of Subfigure) is incorrect (Expected Integer).
-!Type 308
-.XSTEP_209
-Parameter Data : parameter 2 (Subfigure Name) is incorrect : %s (Expected String in hollerith Form).
-!Type 308
-.XSTEP_210
-Parameter Data : parameter 3 (Number of Entities) is incorrect (Expected positive Integer).
-!Type 308
-.XSTEP_211
-Parameter Data : Some pointers of Associated entity List are null or negative : ignored (Entities were expected).
-!Type 408
-.XSTEP_212
-Parameter Data : parameter 1 (Subfigure definition entity) is incorrect (Subfigure definition entity, Type 308 expected).
-!Type 408
-.XSTEP_213
-Parameter Data : parameter %d (Translation data) is incorrect (Real was expected).
-!Type 408
-.XSTEP_214
-Parameter Data : parameter 5 (Scale Factor) is incorrect (Real was expected). Default value 1.0 taken.
-!Type 124
-.XSTEP_215
-Parameter Data : not all parameters are of Real type.
-!
-!ADDED MESSAGES
-.XSTEP_246
- Parameter Data : parameter 4 (Number of segments) is less than 1.
-!
-!
-! DCE 6/11/98 Add in Load phase
-!
-.XSTEP_276
-Parameter Data : Parameter 1 (Curve creation mode) is invalid (integer expected).
-!
-.XSTEP_277
-Parameter Data : Parameter 5 (Representation preference) is invalid (integer expected).
-!
-.XSTEP_278
-Exception during loading entity %s
-!
-!
-!
-! ===================================================================
-!
-!
-!
-! New translation messages ( S3767 )
-!
-.IGES_1000
- Entity %s has not been loaded into memory
-!
-.IGES_1001
- Form %d : Not an implemented entity type : cannot transfer.
-!
-.IGES_1005
- Software error : impossible entity transfer.
-!
-!.IGES_1006 same as 1015
-! exception raising during transfer.
-!
-.IGES_1010
- Resulting TopoDS_Shape has not same 2D and 3D parametrization.
-!
-.IGES_1015
- Software error : transfer interrupted !
-
-.IGES_1020
- Parameter data : pointer %d in associated entity list is null or negative and ignored.
-!
-.IGES_1025
- Transfer error on IGES entity %d : entity skipped.
-!
-.IGES_1030
- Form %d: problems during translation some items in the group.
-!
-.IGES_1035
- Transformation matrix is invalid : not applied.
-!
-.IGES_1036
- Software error : entity skipped.
-!
-.IGES_1040
- Parameter data : pointer %d in entity list is null or has an invalid type and ignored.
-!
-.IGES_1045
- Two consecutives entities are identical (rank %d): only one is transferred.
-!
-.IGES_1050
- %dD curve of rank %d was reversed.
-!
-.IGES_1051
- All %dD curves before rank %d were reversed.
-!
-.IGES_1055
- %dD curves of rank %d were slightly disconnected : repaired.
-!
-.IGES_1060
- %dD curves of rank %d were too disconnected : entity skipped.
-!
-.IGES_1061
- Surface is translated to TopoDS_Shell : entity skipped.
-!
-.IGES_1062
- CurveOnSurface on Composite Surface case not implemented : 3D representation returned.
-!
-.IGES_1066
- Transfer error on surface where curve lies.
-!
-.IGES_1070
- Representations in file are inconsistent : recomputated from %dD.
-!
-.IGES_1090
- Curve was slightly self-intersecting : repaired.
-!
-.IGES_1095
- 3D and 2D curve representations are invalid : entity skipped.
-!
-.IGES_1100
- Parameter data : value of parameter 2 (Offset Distance Flag) is not 1 : case not implemented.
-!
-.IGES_1105
- Ending parameter is beyond end of curve : entity skipped.
-!
-.IGES_1110
- Transfer error on basic curve : entity skipped.
-!
-.IGES_1115
- With C0 continuity can not be split into Geom_BSplineCurve C1 lower than Precision::Confusion().
-!
-.IGES_1120
- With C0 continuity was split into C1 continuity Geom_BSplineCurve.
-!
-.IGES_1125
- Parameter data : parameter 1 (Type of Bounded Surface Representation = 0) : case not implemented.
-!
-.IGES_1130
- Boundary on Composite Surface : case not implemented.
-!
-.IGES_1135
- %dD curve representation is not defined : computed from %dD curve representation.
-! 2D curve representation is not defined : computed from 3D curve representation.
-!
-.IGES_1140
- Error during 3D curve transfer : recomputed from 2D.
-!
-.IGES_1145
- Error during %dD curve transfer : recomputed from %dD.
-! error during 2D curve transfer : recomputed from 3D.
-!
-.IGES_1150
- %s too disconnected :recomputed from %dD.
-! 2D TopoDS_Wire too disconnected :recomputed from 3D.
-!
-.IGES_1155
- Parameter data : (parameter 1 to 6) coefficients do not satisfy a conic equation.
-!
-.IGES_1156
- %s %s transfer failed : entity skipped.
-! (type IGES) (DE:Number) transfer failed : entity skipped.
-!
-.IGES_1160
- Parameter data (Parameters 8 to 11) : start and terminate coordinates of arc are the same : entity not trimmed.
-!
-.IGES_1165
- Transformation is not planar : not applied.
-!
-.IGES_1170
- Polynomial equation is incorrect.
-!
-.IGES_1175
- Error during creation of control points.
-!
-.IGES_1180
- Parameter data : parameter 1 (Spline Type >3) : case not implemented.
-!
-.IGES_1190
- Parameter data : parameter 2 (Degree of basis functions) is lower than 0 or greater than max degree : transfer interrupted.
-!
-.IGES_1195
- Parameter data : incorrect number of control points (2 or more are required).
-!
-.IGES_1200
- %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.
-!
-.IGES_1201
- %s multiplicity > degree %s (or degree %s + 1 at end) : corrected.
-!
-.IGES_1210
- Sum of %s multiplicities is not equal to sum (number of poles + %s degree +1).
-!
-.IGES_1215
- Parameter data : some weight parameters are not of positive real type : entity skipped.
-!
-.IGES_1220
- Rational BSpline %s is in fact polynomial.
-!
-.IGES_1221
- Surface is made periodic.
-!
-.IGES_1225
- Start and terminate points are the same.
-!
-! 1230 is the same as 1195
-!
-.IGES_1235
- Curve is too small to be transferred : entity skipped.
-!
-.IGES_1240
- Vector is not for this form : ignored.
-!
-.IGES_1250
- Resulting Geom_Surface is C0-continuous.
-!
-.IGES_1255
- Ruling failed : entity skipped.
-!
-.IGES_1265
- Basis surface is not C0-continuous : offset surface construction impossible.
-!
-.IGES_1266
- Basis surface is C0-continuous and cannot be corrected to C1-continuous.
-!
-.IGES_1267
- Basis surface is C0-continuous but was corrected to C1-continuous.
-!
-.IGES_1270
- Basis surface is C0-continuous and is transferred into a TopoDS_Shell. Only first face was offsetted.
-!
-.IGES_1275
- Model Space Representation 0 case not implemented : result is a basis surface.
-!
-.IGES_1280
- Invalid direction : entity skipped.constituent
-!
-.IGES_1285
- Parameter data : pointer %d of child entity list is null or negative : skipped.
-!
-.IGES_1295
- Hole %d and plane are not coplanar.
-!
-.IGES_1300
- Bounding curve is invalid : plane is not trimmed.
-!
-.IGES_1305
- Parameter data : parameter 3 or 4 (number of segments) is less than one.
-!
-.IGES_1306
- Improper type for underlying curve number %d.
-
-.IGES_1310
- Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.
-!
-.IGES_1325
- Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
-!
-.IGES_1345
- Parameter data : parameter %d (parameter space curve) is incorrect.
-!
-.IGES_1360
- TopoDS_Shell is not closed.
-!
-.IGES_1365
- Incorrect edge number %d.
-!
-.IGES_1370
- Missing seam-edge was added
-!
-.IGES_1371
- TopoDS_Face was created with natural bounds
-!
-.IGES_1372
- One or more TopoDS_Wire(s) on TopoDS_Face was reversed
-!
-.IGES_1373
- Knots are not in ascending order
-!
-.IGES_1374
- Difference between weights is too big.
-!
-!
-!
-!
-! Trace File messages
-.IGES_2000
-Diagnostics for IGES file read : %s
-!
-.IGES_2005
-Trace level : %d
-
-!
-.IGES_2010
-Beginning of IGES file check.
-!
-.IGES_2015
-Number of warnings in check : %d.
-!
-.IGES_2020
-Number of fails in check : %d
-!
-.IGES_2025
-End of file check(Elapsed time : %s).
-!
-.IGES_2030
-Beginning of IGES data translation.
-!
-.IGES_2031
-File has not been loaded.
-
-!
-.IGES_2032
-IGES entity %d does not exist.
-
-!
-.IGES_2035
-read.precision.mode : %d
-!
-.IGES_2040
-read.precision.val : %f
-!
-.IGES_2045
-read.iges.bspline.continuity : %d
-!
-.IGES_2050
-read.surfacecurve.mode : %d
-
-!
-.IGES_2055
-Number of warnings in transfer : %d.
-!
-.IGES_2060
-Number of fails in transfer : %d
-!
-.IGES_2065
-End of IGES data translation (Elapsed time : %s).
-!
-.IGES_2070
-Translating IGES entity DE:%d Type:%d
-!
-.IGES_2075
-
-%s produced.
-!
-.IGES_2076
-No TopoDS_Shape produced.
-
-!Messages for TPSTAT.
-.IGES_3000
-********************************************************************************
-.IGES_3005
-General statistics for transfer :
-!
-.IGES_3010
- Number of selected IGES entities : %d
-!
-.IGES_3011
- Number of roots IGES entities : %d
-!
-.IGES_3015
- Number of CasCade resulting Shapes : %d
-!
-.IGES_3020
- Number of warnings : %d
-!
-.IGES_3025
- Number of fails : %d
-!
-.IGES_3030
-Count W/F Type Form Message on IGES entity
------ --- ---- ---- ----------------------
-!
-.IGES_3035
-On IGES entities (DE) :
-!
-.IGES_3040
-Count of CasCade resulting shapes
-
-!
-.IGES_3045
-
-Count CasCade Shapes
------ --------------
-!
-.IGES_3050
-Mapping of all IGES entities
-.IGES_3055
-
-Type Form Count CasCade Shapes
----- ---- ----- --------------
-!
-! Debug messages
-.IGES_10005
- Small edge removed
-.IGES_10010
- Degenerated edge detected
-.IGES_10015
- Lacking edge inserted
-!
-!
-.IGES_10020
- Null area wire was detected, wire skipped.
+++ /dev/null
-srcinc:::IGES
-srcinc:::STEP
+++ /dev/null
-
-! Resource file for data exchange ...
-!
-! For meaning of parameters refer to the end of the file
-
-! ==============================================================================
-!
-
-ToIGES.exec.op: DirectFaces
-
-FromIGES.exec.op : FixShape
-
-FromIGES.FixShape.Tolerance3d : &Runtime.Tolerance
-FromIGES.FixShape.MaxTolerance3d : &Runtime.MaxTolerance
-FromIGES.FixShape.MinTolerance3d : 1.e-7
-FromIGES.FixShape.FixFreeShellMode : -1
-FromIGES.FixShape.FixFreeFaceMode : -1
-FromIGES.FixShape.FixFreeWireMode : -1
-FromIGES.FixShape.FixSameParameterMode : -1
-
-FromIGES.FixShape.FixSolidMode : -1
-FromSTEP.FixShape.FixShellOrientationMode : -1
-FromIGES.FixShape.CreateOpenSolidMode : 1
-
-FromIGES.FixShape.FixShellMode : -1
-FromSTEP.FixShape.FixFaceOrientationMode : -1
-
-FromIGES.FixShape.FixFaceMode : -1
-FromIGES.FixShape.FixWireMode : -1
-FromIGES.FixShape.FixOrientationMode : -1
-FromIGES.FixShape.FixAddNaturalBoundMode : -1
-FromIGES.FixShape.FixMissingSeamMode : -1
-FromIGES.FixShape.FixSmallAreaWireMode : -1
-FromIGES.FixShape.RemoveSmallAreaFaceMode : -1
-FromIGES.FixShape.FixIntersectingWiresMode : -1
-FromIGES.FixShape.FixLoopWiresMode : -1
-FromIGES.FixShape.FixSplitFaceMode : -1
-FromIGES.FixShape.AutoCorrectPrecisionMode : 1
-FromIGES.FixShape.ModifyTopologyMode : 0
-FromIGES.FixShape.ModifyGeometryMode : 1
-FromIGES.FixShape.ClosedWireMode : 1
-FromIGES.FixShape.PreferencePCurveMode : 1
-FromIGES.FixShape.FixReorderMode : -1
-FromIGES.FixShape.FixSmallMode : -1
-FromIGES.FixShape.FixConnectedMode : -1
-FromIGES.FixShape.FixEdgeCurvesMode : -1
-FromIGES.FixShape.FixDegeneratedMode : -1
-FromIGES.FixShape.FixLackingMode : -1
-FromIGES.FixShape.FixSelfIntersectionMode : -1
-FromIGES.FixShape.RemoveLoopMode : -1
-FromIGES.FixShape.FixReversed2dMode : -1
-FromIGES.FixShape.FixRemovePCurveMode : -1
-FromIGES.FixShape.FixRemoveCurve3dMode : -1
-FromIGES.FixShape.FixAddPCurveMode : -1
-FromIGES.FixShape.FixAddCurve3dMode : -1
-FromIGES.FixShape.FixSeamMode : -1
-FromIGES.FixShape.FixShiftedMode : -1
-FromIGES.FixShape.FixEdgeSameParameterMode : 0
-FromIGES.FixShape.FixNotchedEdgesMode : -1
-FromIGES.FixShape.FixSelfIntersectingEdgeMode : -1
-FromIGES.FixShape.FixIntersectingEdgesMode : -1
-FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
-
-FromIGES.FixShape.FixVertexPositionMode : 0
-FromIGES.FixShape.FixVertexToleranceMode : -1
+++ /dev/null
-
-! Resource file for data exchange ...
-!
-! For meaning of parameters refer to the end of the file
-
-! ==============================================================================
-!
-
-ToSTEP.exec.op : SplitCommonVertex,DirectFaces
-
-FromSTEP.exec.op : FixShape
-
-FromSTEP.FixShape.Tolerance3d : &Runtime.Tolerance
-FromSTEP.FixShape.MaxTolerance3d : &Runtime.MaxTolerance
-FromSTEP.FixShape.MinTolerance3d : 1.e-7
-FromSTEP.FixShape.FixFreeShellMode : -1
-FromSTEP.FixShape.FixFreeFaceMode : -1
-FromSTEP.FixShape.FixFreeWireMode : -1
-FromSTEP.FixShape.FixSameParameterMode : -1
-
-FromSTEP.FixShape.FixSolidMode : -1
-FromSTEP.FixShape.FixShellOrientationMode : -1
-FromSTEP.FixShape.CreateOpenSolidMode : 0
-
-FromSTEP.FixShape.FixShellMode : -1
-FromSTEP.FixShape.FixFaceOrientationMode : -1
-
-FromSTEP.FixShape.FixFaceMode : -1
-FromSTEP.FixShape.FixWireMode : -1
-FromSTEP.FixShape.FixOrientationMode : -1
-FromSTEP.FixShape.FixAddNaturalBoundMode : -1
-FromSTEP.FixShape.FixMissingSeamMode : -1
-FromSTEP.FixShape.FixSmallAreaWireMode : -1
-FromSTEP.FixShape.RemoveSmallAreaFaceMode : -1
-FromSTEP.FixShape.FixIntersectingWiresMode : -1
-FromSTEP.FixShape.FixLoopWiresMode : -1
-FromSTEP.FixShape.FixSplitFaceMode : -1
-FromSTEP.FixShape.AutoCorrectPrecisionMode : 1
-FromSTEP.FixShape.ModifyTopologyMode : 0
-FromSTEP.FixShape.ModifyGeometryMode : 1
-FromSTEP.FixShape.ClosedWireMode : 1
-FromSTEP.FixShape.PreferencePCurveMode : 1
-FromSTEP.FixShape.FixReorderMode : -1
-FromSTEP.FixShape.FixSmallMode : -1
-FromSTEP.FixShape.FixConnectedMode : -1
-FromSTEP.FixShape.FixEdgeCurvesMode : -1
-FromSTEP.FixShape.FixDegeneratedMode : -1
-FromSTEP.FixShape.FixLackingMode : -1
-FromSTEP.FixShape.FixSelfIntersectionMode : -1
-FromSTEP.FixShape.RemoveLoopMode : -1
-FromSTEP.FixShape.FixReversed2dMode : -1
-FromSTEP.FixShape.FixRemovePCurveMode : -1
-FromSTEP.FixShape.FixRemoveCurve3dMode : -1
-FromSTEP.FixShape.FixAddPCurveMode : -1
-FromSTEP.FixShape.FixAddCurve3dMode : -1
-FromSTEP.FixShape.FixSeamMode : -1
-FromSTEP.FixShape.FixShiftedMode : -1
-FromSTEP.FixShape.FixEdgeSameParameterMode : 0
-FromSTEP.FixShape.FixNotchedEdgesMode : -1
-FromSTEP.FixShape.FixTailMode : 0
-FromSTEP.FixShape.MaxTailAngle : 0
-FromSTEP.FixShape.MaxTailWidth : -1
-FromSTEP.FixShape.FixSelfIntersectingEdgeMode : -1
-FromSTEP.FixShape.FixIntersectingEdgesMode : -1
-FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
-
-FromSTEP.FixShape.FixVertexPositionMode : 0
-FromSTEP.FixShape.FixVertexToleranceMode : -1
+++ /dev/null
-srcinc:::XmlOcaf.xsd
-srcinc:::XmlOcaf_SmallTypes.xsd
-srcinc:::XmlOcaf_TDataStd.xsd
-srcinc:::XmlOcaf_TDataStd_Name.xsd
-srcinc:::XmlOcaf_TDF.xsd
-srcinc:::XmlOcaf_TDocStd.xsd
-srcinc:::XmlOcaf_TFunction.xsd
-srcinc:::XmlOcaf_TNaming.xsd
-srcinc:::XmlOcaf_TNaming_NamedShape.xsd
-srcinc:::XmlOcaf_TPrsStd.xsd
-srcinc:::XmlXcaf.xsd
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-<include schemaLocation="XmlOcaf_SmallTypes.xsd"/>
-<include schemaLocation="XmlOcaf_TDataStd.xsd"/>
-<include schemaLocation="XmlOcaf_TDF.xsd"/>
-<include schemaLocation="XmlOcaf_TDocStd.xsd"/>
-<include schemaLocation="XmlOcaf_TFunction.xsd"/>
-<include schemaLocation="XmlOcaf_TNaming.xsd"/>
-<include schemaLocation="XmlOcaf_TPrsStd.xsd"/>
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of XmlOcaf Persistence format.
- This Schema definition resides at: $(CASROOT)/src/XmlOcafResource/XmlOcaf.xsd
- </documentation>
-</annotation>
-
-<complexType name="LabelType">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="ocaf:AbstractStringAtt"/>
- <element ref="ocaf:AbstractIntegerAtt"/>
- <element ref="ocaf:AbstractRealAtt"/>
- <element ref="ocaf:AbstractListIntegerAtt"/>
- <element ref="ocaf:AbstractListRealAtt"/>
- <element ref="ocaf:AbstractAttribute"/>
- <element ref="ocaf:AbstractXPathLabel"/>
- <element ref="ocaf:AbstractList3RealAtt"/>
- </choice>
- <element name="label" type="ocaf:LabelType" minOccurs="0" maxOccurs="unbounded">
-<!-- This type of uniqueness does not allow recursive structures
- <unique name="LabelUniqueness">
- <selector xpath="ocaf:label"/>
- <field xpath="@tag"/>
- </unique> -->
- </element>
- </sequence>
- <attribute name="tag" type="positiveInteger" use="required"/>
-</complexType>
-
-<!-- Declaration of document element +++++++++++++++++++++++++++ -->
-<element name="document">
- <complexType>
- <sequence>
-
-<!-- Declaration of element 'info' +++++++++++++++++++++++++++++ -->
- <element name="info">
- <complexType>
- <sequence>
- <element name="iitem" type="string" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="date" type="date" use="required"/>
- <attribute name="schemav" type="nonNegativeInteger" use="required"/>
- <attribute name="DocVersion" type="nonNegativeInteger" use="required"/>
- <attribute name="objnb" type="nonNegativeInteger" use="required"/>
- </complexType>
- </element> <!-- END 'info' -->
-
-<!-- Declaration of element 'comments' ++++++++++++++++++++++++++ -->
- <element name="comments">
- <complexType>
- <sequence>
- <element name="citem" type="string" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- </element> <!-- END 'comments' -->
-
-<!-- Declaration of element 'label' +++++++++++++++++++++++++++++ -->
- <element name="label">
- <!-- Local type redefinition from ocaf:LabelType by restriction -->
- <complexType>
- <complexContent>
- <restriction base="ocaf:LabelType">
- <sequence>
- <choice minOccurs="0" maxOccurs="unbounded">
- <element ref="ocaf:AbstractStringAtt"/>
- <element ref="ocaf:AbstractIntegerAtt"/>
- <element ref="ocaf:AbstractRealAtt"/>
- <element ref="ocaf:AbstractListIntegerAtt"/>
- <element ref="ocaf:AbstractListRealAtt"/>
- <element ref="ocaf:AbstractAttribute"/>
- <element ref="ocaf:AbstractXPathLabel"/>
- <element ref="ocaf:AbstractList3RealAtt"/>
- </choice>
- <element name="label" type="ocaf:LabelType" minOccurs="0" maxOccurs="unbounded">
- <unique name="Label1Uniqueness">
- <selector xpath="ocaf:label"/>
- <field xpath="@tag"/> <!-- label tags -->
- </unique>
- </element>
- </sequence>
- <!-- Difference from ocaf:LabelType is FIXEDNESS of tag attribute -->
- <attribute name="tag" type="nonNegativeInteger" fixed="0"/>
- </restriction>
- </complexContent>
- </complexType>
-<!-- Uniqueness of tags in sub-labels -->
- <unique name="Label0Uniqueness">
- <selector xpath="ocaf:label"/>
- <field xpath="@tag"/>
- </unique>
-<!-- Uniqueness of 'id' values of shareable objects -->
- <unique name="ShareableIdUniqueness">
- <selector xpath=".//ocaf:*"/>
- <field xpath="@id"/>
- </unique>
- </element> <!-- END 'label 0' -->
-
-<!-- Declaration of element 'shapes' +++++++++++++++++++++++++++ -->
- <element name="shapes" type="string" minOccurs="0"/>
-
- </sequence>
- <attribute name="format" type="string" use="required"/>
- </complexType>
-</element> <!-- END 'document' -->
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of basic types
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_SmallTypes.xsd
- </documentation>
-</annotation>
-
-<!-- DEFINITIONS OF SIMPLE BASIC TYPES -->
-
-<simpleType name="ListOfInteger">
- <list itemType="int"/>
-</simpleType>
-
-<simpleType name="ListOfReal">
- <list itemType="double"/>
-</simpleType>
-
-<simpleType name="ListOf3Real">
- <restriction base="ocaf:ListOfReal">
- <length value="3"/>
- </restriction>
-</simpleType>
-
-<simpleType name="GuidType">
- <restriction base="string">
- <length value="36"/>
- <pattern value="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"/>
- </restriction>
-</simpleType>
-
-<simpleType name="XPathLabel">
- <restriction base="string">
- <pattern value='/document/label(/label\[@tag=\"[1-9][0-9]*\"\])*'/>
- </restriction>
-</simpleType>
-
-<!-- DEFINITIONS OF BASIC TYPES FOR OCAF ATTRIBUTES -->
-
-<complexType name="AbsStringAttributeType">
- <simpleContent>
- <extension base="string">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsIntegerAttributeType">
- <simpleContent>
- <extension base="int">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsRealAttributeType">
- <simpleContent>
- <extension base="double">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsListIntegerAttributeType">
- <simpleContent>
- <extension base="ocaf:ListOfInteger">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsListRealAttributeType">
- <simpleContent>
- <extension base="ocaf:ListOfReal">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsXPathLabelType">
- <simpleContent>
- <extension base="ocaf:XPathLabel">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<complexType name="AbsList3RealAttributeType">
- <simpleContent>
- <extension base="ocaf:ListOf3Real">
- <attribute name="id" type="positiveInteger" use="required"/>
- </extension>
- </simpleContent>
-</complexType>
-
-<!-- DECLARATIONS OF ABSTRACT XML ELEMENTS FOR OCAF ATTRIBUTES -->
-
-<element name="AbstractStringAtt" type="ocaf:AbsStringAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with String content
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractIntegerAtt" type="ocaf:AbsIntegerAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with Integer content
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractRealAtt" type="ocaf:AbsRealAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with Real content
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractListIntegerAtt"
- type="ocaf:AbsListIntegerAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with List-Of-Integer content
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractListRealAtt"
- type="ocaf:AbsListRealAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with List-Of-Real content
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractXPathLabel" type="ocaf:AbsXPathLabelType" abstract="true">
- <annotation>
- <documentation>
- Abstract type representing XPath reference to OCAF label
- </documentation>
- </annotation>
-</element>
-
-<element name="AbstractList3RealAtt"
- type="ocaf:AbsList3RealAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute with List-Of-3-Real content
- </documentation>
- </annotation>
-</element>
-
-<!-- DECLARATION OF ABSTRACT XML ELEMENT FOR OCAF ATTRIBUTES WITH NO SIMPLE CONTENT -->
-
-<complexType name="AbstractAttributeType">
- <complexContent>
- <restriction base="anyType">
- <attribute name="id" type="positiveInteger" use="required"/>
- </restriction>
- </complexContent>
-</complexType>
-
-<element name="AbstractAttribute" type="ocaf:AbstractAttributeType" abstract="true">
- <annotation>
- <documentation>
- Abstract type corresponding to TDF_Attribute (the ancestor of all OCAF Attributes)
- </documentation>
- </annotation>
-</element>
-
-<!-- ELEMENT **LOCATION** -->
-
-<complexType name="Location">
- <sequence>
- <element name="datum" minOccurs="0">
- <complexType>
- <attribute name="id" type="positiveInteger" use="required"/>
- <attribute name="trsf" use="required">
- <simpleType>
- <restriction base="ocaf:ListOfReal">
- <length value="14"/>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
- <element name="location" type="ocaf:Location" minOccurs="0"/>
- </sequence>
- <attribute name="power" type="positiveInteger" use="required"/>
- <attribute name="datum" type="positiveInteger" use="required"/>
-</complexType>
-
-<element name="location" type="ocaf:Location"/>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TDF
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDF.xsd
- </documentation>
-</annotation>
-
-<element name="TDF_TagSource" type="ocaf:AbsIntegerAttributeType"
- substitutionGroup="ocaf:AbstractIntegerAtt"/>
-
-<element name="TDF_Reference" type="ocaf:AbsXPathLabelType"
- substitutionGroup="ocaf:AbstractXPathLabel"/>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TDataStd
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDataStd.xsd
- </documentation>
-</annotation>
-
-<element name="TDataStd_Position" type="ocaf:AbsList3RealAttributeType"
- substitutionGroup="ocaf:AbstractList3RealAtt"/>
-
-<element name="TDataStd_Name" type="ocaf:AbsStringAttributeType"
- substitutionGroup="ocaf:AbstractStringAtt"/>
-
-<element name="TDataStd_Comment" type="ocaf:AbsStringAttributeType"
- substitutionGroup="ocaf:AbstractStringAtt"/>
-
-<element name="TDataStd_Integer" type="ocaf:AbsIntegerAttributeType"
- substitutionGroup="ocaf:AbstractIntegerAtt"/>
-
-<element name="TDataStd_Real" type="ocaf:AbsRealAttributeType"
- substitutionGroup="ocaf:AbstractRealAtt"/>
-
-<element name="TDataStd_Point" type="ocaf:AbstractAttributeType"
- substitutionGroup="ocaf:AbstractAttribute"/>
-
-<element name="TDataStd_Axis" type="ocaf:AbstractAttributeType"
- substitutionGroup="ocaf:AbstractAttribute"/>
-
-<element name="TDataStd_Plane" type="ocaf:AbstractAttributeType"
- substitutionGroup="ocaf:AbstractAttribute"/>
-
-<element name="TDataStd_Shape" type="ocaf:AbstractAttributeType"
- substitutionGroup="ocaf:AbstractAttribute"/>
-
-<element name="TDataStd_Directory" type="ocaf:AbstractAttributeType"
- substitutionGroup="ocaf:AbstractAttribute"/>
-
-<element name="TDataStd_IntegerArray" substitutionGroup="ocaf:AbstractListIntegerAtt">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbsListIntegerAttributeType">
- <attribute name="first" type="int" default="1"/>
- <attribute name="last" type="int" use="required"/>
- <attribute name="delta" type="int" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_RealArray" substitutionGroup="ocaf:AbstractListRealAtt">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbsListRealAttributeType">
- <attribute name="first" type="int" default="1"/>
- <attribute name="last" type="int" use="required"/>
- <attribute name="delta" type="int" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_UAttribute" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="guid" type="ocaf:GuidType" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_TreeNode" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="treeid" type="ocaf:GuidType" use="required"/>
- <attribute name="children" type="ocaf:ListOfInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_Geometry" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="geomtype" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="any"/>
- <enumeration value="point"/>
- <enumeration value="line"/>
- <enumeration value="circle"/>
- <enumeration value="ellipse"/>
- </restriction>
- </simpleType>
- </attribute>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_Constraint" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="contype" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="radius"/>
- <enumeration value="diameter"/>
- <enumeration value="minorradius"/>
- <enumeration value="majorradius"/>
- <enumeration value="tangent"/>
- <enumeration value="parallel"/>
- <enumeration value="perpendicular"/>
- <enumeration value="concentric"/>
- <enumeration value="coincident"/>
- <enumeration value="distance"/>
- <enumeration value="angle"/>
- <enumeration value="equalradius"/>
- <enumeration value="symmetry"/>
- <enumeration value="midpoint"/>
- <enumeration value="equaldist"/>
- <enumeration value="fix"/>
- <enumeration value="rigid"/>
- <enumeration value="from"/>
- <enumeration value="axis"/>
- <enumeration value="mate"/>
- <enumeration value="alignfaces"/>
- <enumeration value="alignaxes"/>
- <enumeration value="axesangle"/>
- <enumeration value="facesangle"/>
- <enumeration value="round"/>
- <enumeration value="offset"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="valueref" type="positiveInteger"/>
- <attribute name="geometries">
- <simpleType>
- <restriction base="ocaf:ListOfInteger">
- <minLength value="1"/>
- <maxLength value="4"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="plane" type="positiveInteger"/>
- <attribute name="flags" use="required">
- <simpleType>
- <restriction base="string">
- <pattern value="[+-]{3}"/>
- </restriction>
- </simpleType>
- </attribute>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_Variable" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="isconst" type="boolean" default="false"/>
- <attribute name="unit" type="string" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_PatternStd" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="signature" type="int" use="required"/>
- <attribute name="axis1reversed" type="boolean" default="false"/>
- <attribute name="axis2reversed" type="boolean" default="false"/>
- <attribute name="nbinstances1" type="positiveInteger"/>
- <attribute name="value1ref" type="positiveInteger"/>
- <attribute name="axis1" type="positiveInteger"/>
- <attribute name="nbinstances2" type="positiveInteger"/>
- <attribute name="value2ref" type="positiveInteger"/>
- <attribute name="axis2" type="positiveInteger"/>
- <attribute name="mirror" type="positiveInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_Relation" substitutionGroup="ocaf:AbstractStringAtt">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbsStringAttributeType">
- <attribute name="variables" type="ocaf:ListOfInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="TDataStd_Expression" substitutionGroup="ocaf:AbstractStringAtt">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbsStringAttributeType">
- <attribute name="variables" type="ocaf:ListOfInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attribute TDataStd_Name
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd
- </documentation>
-</annotation>
-
-<element name="TDataStd_Name" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="extstring" type="string" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TDocStd
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TDocStd.xsd
- </documentation>
-</annotation>
-
-<element name="TDocStd_XLink" substitutionGroup="ocaf:AbstractXPathLabel">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbsXPathLabelType">
- <attribute name="documentEntry" type="string" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TFunction
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TFunction.xsd
- </documentation>
-</annotation>
-
-<element name="TFunction_Function" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="guid" type="ocaf:GuidType" use="required"/>
- <attribute name="failure" type="int"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TNaming package
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TNaming.xsd
- </documentation>
-</annotation>
-
-<complexType name="ArrayOfShapes">
- <sequence>
- <element name="shape" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <attribute name="tshape" use="required">
- <simpleType>
- <restriction base="string">
- <pattern value="[+-ie]\d+"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="location" type="positiveInteger"/>
- <attribute name="index" type="positiveInteger" use="required"/>
- <attribute name="x" type="float"/>
- <attribute name="y" type="float"/>
- <attribute name="z" type="float"/>
- </complexType>
- </element> <!-- end of 'shape' -->
- </sequence>
- <attribute name="lower" type="positiveInteger" default="1"/>
- <attribute name="upper" type="positiveInteger" default="1"/>
-</complexType>
-
-<element name="TNaming_NamedShape" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- <element name="olds" type="ocaf:ArrayOfShapes" minOccurs="0"/>
- <element name="news" type="ocaf:ArrayOfShapes" minOccurs="0"/>
- </sequence>
- <attribute name="evolution" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="primitive"/>
- <enumeration value="generated"/>
- <enumeration value="modify"/>
- <enumeration value="delete"/>
- <enumeration value="selected"/>
- <enumeration value="replace"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="version" type="positiveInteger" default="0"/>
- </extension>
- </complexContent>
- </complexType>
- <unique name="OldShapeIndexUniq">
- <selector xpath="."/>
- <field xpath="@id"/>
- <field xpath="ocaf:olds/ocaf:shape/@index"/>
- </unique>
- <unique name="NewShapeIndexUniq">
- <selector xpath="."/>
- <field xpath="@id"/>
- <field xpath="ocaf:news/ocaf:shape/@index"/>
- </unique>
-</element>
-
-<element name="TNaming_Naming" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="index" type="int" use="required"/>
- <attribute name="stopNS" type="positiveInteger"/>
- <attribute name="nametype" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="unknown"/>
- <enumeration value="identity"/>
- <enumeration value="modifuntil"/>
- <enumeration value="generation"/>
- <enumeration value="intersection"/>
- <enumeration value="union"/>
- <enumeration value="subtraction"/>
- <enumeration value="constshape"/>
- <enumeration value="filterbyneigh"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="shapetype" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="compound"/>
- <enumeration value="compsolid"/>
- <enumeration value="solid"/>
- <enumeration value="shell"/>
- <enumeration value="face"/>
- <enumeration value="wire"/>
- <enumeration value="edge"/>
- <enumeration value="vertex"/>
- <enumeration value="shape"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="arguments" type="ocaf:ListOfInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attribute TNaming_NamedShape
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd
- </documentation>
-</annotation>
-
-<complexType name="Location">
- <sequence>
- <element name="datum" minOccurs="0">
- <complexType>
- <attribute name="id" type="positiveInteger" use="required"/>
- <attribute name="trsf" use="required">
- <simpleType>
- <restriction base="ocaf:ListOfReal">
- <length value="14"/>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
- <element name="location" type="ocaf:Location" minOccurs="0"/>
- </sequence>
- <attribute name="power" type="positiveInteger" use="required"/>
- <attribute name="datum" type="positiveInteger" use="required"/>
-</complexType>
-
-<element name="TNaming_NamedShape" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- <element name="array" minOccurs="0" maxOccurs="2">
- <complexType>
- <sequence>
- <element name="shape" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="location" type="ocaf:Location" minOccurs="0"/>
- </sequence>
- <attribute name="tshape" use="required">
- <simpleType>
- <restriction base="string">
- <pattern value="[+-ie]\d+"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="index" type="positiveInteger" use="required"/>
- </complexType>
- </element>
- </sequence>
- <attribute name="id" type="positiveInteger" use="required"/>
- <attribute name="lower" type="positiveInteger"/>
- <attribute name="upper" type="positiveInteger"/>
- </complexType>
- </element>
- </sequence>
- <attribute name="olds" type="positiveInteger"/>
- <attribute name="news" type="positiveInteger"/>
- <attribute name="evolution" use="required">
- <simpleType>
- <restriction base="string">
- <enumeration value="primitive"/>
- <enumeration value="generated"/>
- <enumeration value="modify"/>
- <enumeration value="delete"/>
- <enumeration value="selected"/>
- <enumeration value="replace"/>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="version" type="positiveInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from TPrsStd
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_TPrsStd.xsd
- </documentation>
-</annotation>
-
-<element name="TPrsStd_AISPresentation" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="guid" type="ocaf:GuidType" use="required"/>
- <attribute name="isdisplayed" type="boolean" default="false"/>
- <attribute name="color" type="int"/>
- <attribute name="material" type="int"/>
- <attribute name="transparency" type="double"/>
- <attribute name="width" type="double"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>
+++ /dev/null
-<schema targetNamespace="http://www.opencascade.org/OCAF/XML/XCAF"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ocaf="http://www.opencascade.org/OCAF/XML"
- elementFormDefault="qualified">
-<import namespace="http://www.opencascade.org/OCAF/XML"
- schemaLocation="XmlOcaf.xsd"/>
-
-<annotation>
- <documentation xml:lang="en">
- Copyright (c) 2001-2014 OPEN CASCADE SAS
-
- This file is part of Open CASCADE Technology software library.
-
- This library is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License version 2.1 as published
- by the Free Software Foundation, with special exception defined in the file
- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
- distribution for complete text of the license and disclaimer of any warranty.
-
- Alternatively, this file may be used under the terms of Open CASCADE
- commercial license or contractual agreement.
-
- Open Cascade Application Framework: Definition of attributes from XCAFDoc
- This file is included in XmlOcaf.xsd
- URL: $(CASROOT)/src/XmlOcafResource/XmlOcaf_XCAFDoc.xsd
- </documentation>
-</annotation>
-
-<element name="Area" type="ocaf:AbsRealAttributeType"
- substitutionGroup="ocaf:AbstractRealAtt"/>
-
-<element name="Volume" type="ocaf:AbsRealAttributeType"
- substitutionGroup="ocaf:AbstractRealAtt"/>
-
-<element name="Color" type="ocaf:AbsIntegerAttributeType"
- substitutionGroup="ocaf:AbstractIntegerAtt"/>
-
-<element name="Centroid" type="ocaf:AbsList3RealAttributeType"
- substitutionGroup="ocaf:AbstractList3RealAtt"/>
-
-<element name="GraphNode" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <attribute name="treeid" type="ocaf:GuidType" use="required"/>
- <attribute name="children" type="ocaf:ListOfInteger"/>
- <attribute name="fathers" type="ocaf:ListOfInteger"/>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="Location" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- <element ref="ocaf:location" minOccurs="0" maxOccurs="1"/>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="DocumentTool" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="ColorTool" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="ShapeTool" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-<element name="LayerTool" substitutionGroup="ocaf:AbstractAttribute">
- <complexType>
- <complexContent>
- <extension base="ocaf:AbstractAttributeType">
- <sequence>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-</element>
-
-</schema>