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

Compare commits

..

1 Commits

Author SHA1 Message Date
kgv
704bb74d93 0031482: OpenGl_LayerList::renderLayer() - keep shadowmap from global list 2021-03-22 10:20:07 +03:00
2174 changed files with 11583 additions and 11119 deletions

View File

@@ -366,14 +366,10 @@ endif()
# whether use optional 3rdparty or not
if (APPLE)
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
else()
set (USE_GLX OFF)
endif()
if (WIN32)
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
else()
set (USE_D3D OFF)
endif()
# Enable/Disable the floating point exceptions (FPE) during runtime.
@@ -387,15 +383,6 @@ else()
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER 0)
endif()
# OpenGL
if (ANDROID OR IOS OR EMSCRIPTEN OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_OPENGL OFF)
set (USE_GLES2 ON)
else()
set (USE_OPENGL ON CACHE BOOL "${USE_OPENGL_DESCR}")
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
# include the patched or original list of modules
# list <MODULENAME>_TOOLKITS is created foreach module and contains its toolkits
# list <OCCT_MODULES> will contain all modules
@@ -427,6 +414,10 @@ if (NOT DEFINED BUILD_DOC_Overview)
set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
endif()
if (NOT USE_D3D)
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
@@ -494,8 +485,7 @@ endif()
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
@@ -542,6 +532,14 @@ else()
endif()
endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
endif()
# GLX
if (USE_GLX)
add_definitions (-DMACOSX_USE_GLX)
@@ -549,6 +547,7 @@ if (USE_GLX)
endif()
# FREEIMAGE
if (CAN_USE_FREEIMAGE)
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
@@ -607,31 +606,23 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
endif()
# OpenGL
if (CAN_USE_OPENGL)
if (USE_OPENGL)
add_definitions (-DHAVE_OPENGL_EXT)
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGl)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlTest)
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_OPENGL")
endif()
# OpenGL ES 2.0
if (CAN_USE_GLES2)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
set (USE_GLES2 ON)
else()
set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
endif()
if (USE_GLES2)
add_definitions (-DHAVE_GLES2_EXT)
add_definitions (-DHAVE_GLES2)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGles)
list (REMOVE_ITEM BUILD_TOOLKITS TKOpenGlesTest)
endif()
else()
OCCT_CHECK_AND_UNSET ("USE_GLES2")
@@ -642,17 +633,6 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
endif()
# D3D
if (USE_D3D)
add_definitions (-DHAVE_D3D)
#if(MSVC_VERSION LESS 1700)
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
#endif()
else()
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHost)
list (REMOVE_ITEM BUILD_TOOLKITS TKD3DHostTest)
endif()
# TBB
if (NOT DEFINED ANDROID AND CAN_USE_TBB)
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
@@ -1159,9 +1139,6 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
endforeach()
list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
# these macros are defined for specific tookits, not globalwise
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_OPENGL)
list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_GLES2)
# export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})

View File

@@ -1,7 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE

View File

@@ -207,7 +207,6 @@ n Image
n Media
n MeshVS
n OpenGl
n OpenGles
n D3DHost
n Prs3d
n PrsMgr
@@ -225,7 +224,6 @@ r Shaders
r XRResources
t TKMeshVS
t TKOpenGl
t TKOpenGles
t TKD3DHost
t TKService
t TKV3d
@@ -404,9 +402,6 @@ n HLRTest
n MeshTest
n SWDRAW
n TObjDRAW
n OpenGlTest
n OpenGlesTest
n D3DHostTest
n ViewerTest
n XDEDRAW
n XSDRAW
@@ -418,9 +413,6 @@ t TKDCAF
t TKDraw
t TKTObjDRAW
t TKTopTest
t TKOpenGlTest
t TKOpenGlesTest
t TKD3DHostTest
t TKViewerTest
t TKXDEDRAW
t TKXSDRAW

View File

@@ -1,3 +1,3 @@
# EGL
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlesLibs" "")
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlLibs" "")

View File

@@ -1,3 +1,3 @@
# OpenGL ES 2.0
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlesLibs" "")
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlLibs" "")

View File

@@ -74,8 +74,12 @@ if (WIN32)
set (CSF_psapi "psapi.lib")
set (CSF_winmm "winmm.lib")
set (CSF_d3d9 "D3D9.lib")
set (CSF_OpenGlLibs "opengl32.lib")
set (CSF_OpenGlesLibs "libEGL libGLESv2")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
set (CSF_OpenGlLibs "libEGL libGLESv2")
else()
set (CSF_OpenGlLibs "opengl32.lib")
endif()
else()
if (APPLE)
@@ -96,9 +100,9 @@ else()
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS)
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
find_library (OpenGlLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
elseif (USE_GLX)
set (CSF_OpenGlLibs GL)
set (CSF_XwLibs "X11 Xext Xmu Xi")
@@ -107,15 +111,18 @@ else()
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
elseif (ANDROID)
set (CSF_ThreadLibs "c")
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_OpenGlLibs "EGL GLESv2")
set (CSF_androidlog "log")
elseif (UNIX)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlLibs "GL")
set (CSF_OpenGlesLibs "EGL GLESv2")
if (USE_GLES2)
set (CSF_OpenGlLibs "EGL GLESv2")
else()
set (CSF_OpenGlLibs "GL")
endif()
set (CSF_XwLibs "X11 Xext Xmu Xi")
set (CSF_dl "dl")
set (CSF_fontconfig "fontconfig")

View File

@@ -303,13 +303,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
else() # get CSF_ value
set (CURRENT_CSF ${${USED_ITEM}})
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
add_definitions (-DHAVE_OPENGL)
endif()
if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
add_definitions (-DHAVE_GLES2)
endif()
set (LIBRARY_FROM_CACHE 0)
separate_arguments (CURRENT_CSF)
foreach (CSF_LIBRARY ${CURRENT_CSF})

View File

@@ -174,10 +174,9 @@ set (USE_EGL_DESCR
"Indicates whether EGL should be used in OCCT visualization
module instead of conventional OpenGL context creation APIs")
set (USE_OPENGL_DESCR
"Indicates whether OpenGL desktop should be used in OCCT visualization module")
set (USE_GLES2_DESCR
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization module")
"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
module instead of desktop OpenGL")
set (USE_TBB_DESCR
"Indicates whether TBB is used or not. TBB stands for Threading Building Blocks,

View File

@@ -1461,7 +1461,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_winmm) "winmm"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
set aLibsMap(CSF_OpenGlesLibs) "libEGL libGLESv2"
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
}
set aLibsMap(CSF_psapi) "Psapi"
set aLibsMap(CSF_d3d9) "d3d9"
@@ -1482,18 +1484,14 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
}
} else {
set aLibsMap(CSF_dl) "dl"
set aLibsMap(CSF_OpenGlLibs) "GL"
set aLibsMap(CSF_OpenGlesLibs) "EGL GLESv2"
if { "$theOS" == "mac" || "$theOS" == "ios" } {
set aLibsMap(CSF_objc) "objc"
set aLibsMap(CSF_OpenGlLibs) ""
set aLibsMap(CSF_OpenGlesLibs) ""
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
set aFrmsMap(CSF_OpenGlesLibs) "OpenGLES"
set aLibsMap(CSF_objc) "objc"
if { "$theOS" == "ios" } {
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_Appkit) "UIKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGLES"
} else {
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_Appkit) "AppKit"
set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
}
set aFrmsMap(CSF_IOKit) "IOKit"
set aFrmsMap(CSF_TclLibs) "Tcl"
@@ -1502,17 +1500,24 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
set aLibsMap(CSF_TclTkLibs) ""
set aLibsMap(CSF_QT) "QtCore QtGui"
} elseif { "$theOS" == "android" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
set aLibsMap(CSF_androidlog) "log"
} else {
set aLibsMap(CSF_fontconfig) "fontconfig"
if { "$theOS" == "qnx" } {
# CSF_ThreadLibs - pthread API is part of libc on QNX
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
} else {
set aLibsMap(CSF_ThreadLibs) "pthread rt"
set aLibsMap(CSF_OpenGlLibs) "GL"
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
if { "$::HAVE_GLES2" == "true" } {
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
}
}
}
}
@@ -1780,14 +1785,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
global path
set aHasQtDep "false"
set aTkDefines ""
foreach aCsfElem [osutils:tk:csfInExternlib "$path/$theSrcDir/${theToolKit}/EXTERNLIB"] {
if { "$aCsfElem" == "CSF_QT" } {
set aHasQtDep "true"
} elseif { "$aCsfElem" == "CSF_OpenGlLibs" } {
set aTkDefines "$aTkDefines;HAVE_OPENGL"
} elseif { "$aCsfElem" == "CSF_OpenGlesLibs" } {
set aTkDefines "$aTkDefines;HAVE_GLES2"
}
}
set theProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 0]
@@ -1822,9 +1822,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
# depending on VC version
regsub -all -- {__TKDEP__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] theProjTmpl
regsub -all -- {__TKDEFINES__} $theProjTmpl $aTkDefines theProjTmpl
set anIncPaths "..\\..\\..\\inc"
# set aTKDefines ""
set aFilesSection ""
set aVcFilesCxx(units) ""
set aVcFilesHxx(units) ""
@@ -2108,7 +2108,6 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
set aVCRTVer [string range $theVcVer 0 3]
regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
set aFilesSection ""
set aVcFilesCxx(units) ""

View File

@@ -153,4 +153,5 @@ win32 {
}
}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}

View File

@@ -15,14 +15,8 @@ for (aModuleIter, aModuleList) {
equals (aToolKit, $$OCC_MODULE_NAME) { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtk") { toSkipToolkit = 1 }
!HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGl") { toSkipToolkit = 1 }
#!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGles") { toSkipToolkit = 1 }
!HAVE_GLES2: equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHost") { toSkipToolkit = 1 }
!win32: equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
equals (toSkipToolkit, 0) {
#warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
eval(occtkgen_$${aToolKit}.input = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)

View File

@@ -36,7 +36,7 @@ win32 {
CSF_wsock32 = -lwsock32
CSF_netapi32 = -lnetapi32
CSF_OpenGlLibs = -lopengl32
CSF_OpenGlesLibs = -llibEGL -llibGLESv2
HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
CSF_psapi = -lPsapi
CSF_winmm = -lwinmm
CSF_d3d9 = -ld3d9
@@ -46,12 +46,12 @@ win32 {
} else:mac {
CSF_dl = -ldl
CSF_objc = -lobjc
CSF_OpenGlLibs = -framework OpenGL
CSF_OpenGlesLibs = -framework OpenGLES
iphoneos {
CSF_Appkit = -framework UIKit
CSF_OpenGlLibs = -framework OpenGLES
} else {
CSF_Appkit = -framework AppKit
CSF_OpenGlLibs = -framework OpenGL
}
CSF_IOKit = -framework IOKit
CSF_TclLibs = -framework Tcl
@@ -60,19 +60,17 @@ win32 {
CSF_dl = -ldl
CSF_ThreadLibs = -lpthread -lrt
CSF_OpenGlLibs = -lGL
CSF_OpenGlesLibs = -lEGL -lGLESv2
CSF_TclTkLibs = -lX11 -ltk8.6
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
CSF_MotifLibs = -lX11
CSF_fontconfig = -lfontconfig
HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
}
for (aCfgIter, CONFIG) {
aRes = $$find(aCfgIter, "^HAVE_")
!equals(aCfgIter, "HAVE_GLES2") {
count(aRes, 1) {
DEFINES += $$aCfgIter
}
count(aRes, 1) {
DEFINES += $$aCfgIter
}
}
@@ -105,12 +103,6 @@ for (anExternLib, anExternLibs) {
count(hasCsf, 1) {
aList = $$split($$anExternLib, "\n")
LIBS += $$aList
equals(anExternLib, "CSF_OpenGlLibs") {
DEFINES += "HAVE_OPENGL"
}
equals(anExternLib, "CSF_OpenGlesLibs") {
DEFINES += "HAVE_GLES2"
}
} else {
LIBS += -l$$anExternLib
}

View File

@@ -185,7 +185,7 @@ if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_FFMPEG%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG" & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK" & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2_EXT" & set "CSF_DEFINES=HAVE_GLES2_EXT;%CSF_DEFINES%"
if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2" & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D" & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"

View File

@@ -102,7 +102,7 @@ if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
if [ "$HAVE_FFMPEG" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2_EXT"; fi
if [ "$HAVE_GLES2" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi

View File

@@ -90,7 +90,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -107,7 +107,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -138,7 +138,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -156,7 +156,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -186,7 +186,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -203,7 +203,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -234,7 +234,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
@@ -252,7 +252,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -85,7 +85,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -100,7 +100,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -130,7 +130,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -146,7 +146,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
@@ -175,7 +175,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -190,7 +190,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP__</AdditionalDependencies>
@@ -219,7 +219,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
@@ -235,7 +235,7 @@
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>

View File

@@ -2211,29 +2211,8 @@ BRep and Binary BRep Shape formats (only in case of triangulation-only Faces, wi
Versions of formats have been changed (11 for BinOCAF, 10 for XmlOCAF, 4 for BRep Shape and 3 for Binary BRep Shape).
Files written with the new version will not be readable by applications of old versions.
@subsection upgrade_occt760_poly Changes in *Poly* package and *Poly_Triangulation* class
@subsection upgrade_occt760_poly Changes in *Poly* package and *Poly_Triangulation* class:
*Poly_Triangulation* does no more provide access to internal array structures: methods Nodes(), ChangeNode(), Triangles(), ChangeTriangle(), UVNodes(), ChangeUVNode(), Normals() have been removed.
Methods of *Poly_Triangulation* for accessing individual nodal properties / triangles by index and implementing copy semantics should be used instead.
The same is applicable to *Poly_PolygonOnTriangulation* interface.
@subsection upgrade_occt760_glsl Custom GLSL programs
Accessors to standard materials have been modified within *Declarations.glsl* (*occFrontMaterial_Diffuse()* -> *occMaterial_Diffuse(bool)* and similar).
Applications defining custom GLSL programs should take into account syntax changes.
@subsection upgrade_occt760_noral_colors Nodal color modulation
Nodal color vertex attribute is now modulated in the same way as a color texture - color is multiplied by material coefficients (diffuse/ambient/specular in case of a common material definition).
Existing code defining nodal colors should be updated to:
- Use *Graphic3d_TOSM_UNLIT* shading model when lighting is not needed.
- Adjust diffuse/ambient material coefficients, which have been previously ignored.
- Remove code multiplying nodal colors, intended to compensate over-brightness due to addition of specular color from material definition, as specular component is now also modulated by a vertex color.
@subsection upgrade_occt760_tkopengles TKOpenGles library
OCCT now provides two separate toolkits - *TKOpenGl* depending on desktop OpenGL and *TKOpenGles* depending on OpenGL ES.
Both libraries can be now built simultaneously on systems providing both APIs (like desktop Linux).
Existing applications depending on OpenGL ES (mobile projects first of all) should be adjusted to link against *TKOpenGles*.
Note that both *TKOpenGl* and *TKOpenGles* keep exporting classes with the same name, so applications should not attempt to link both libraries simultaneously.

View File

@@ -32,7 +32,7 @@
0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */; };
0A7DEE371E2D2AE000267B9B /* libTKXDESTEP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE171E2D2AC700267B9B /* libTKXDESTEP.a */; };
0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */; };
0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */; };
0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */; };
0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0F1E2D2AAB00267B9B /* libTKSTEP209.a */; };
0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */; };
0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */ = {isa = PBXBuildFile; fileRef = 0AAE0DE51EAF816D00C1F65B /* screw.step */; };
@@ -82,7 +82,7 @@
0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKIGES.a; path = ../occt/lib/libTKIGES.a; sourceTree = "<group>"; };
0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMeshVS.a; path = ../occt/lib/libTKMeshVS.a; sourceTree = "<group>"; };
0A7DEE081E2D2A9300267B9B /* libTKOffset.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOffset.a; path = ../occt/lib/libTKOffset.a; sourceTree = "<group>"; };
0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGles.a; path = ../occt/lib/libTKOpenGles.a; sourceTree = "<group>"; };
0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGl.a; path = ../occt/lib/libTKOpenGl.a; sourceTree = "<group>"; };
0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKPrim.a; path = ../occt/lib/libTKPrim.a; sourceTree = "<group>"; };
0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKService.a; path = ../occt/lib/libTKService.a; sourceTree = "<group>"; };
0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStd.a; path = ../occt/lib/libTKStd.a; sourceTree = "<group>"; };
@@ -135,7 +135,7 @@
0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */,
0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */,
0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */,
0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */,
0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */,
0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */,
0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */,
0A7DEE2E1E2D2AE000267B9B /* libTKSTEP.a in Frameworks */,
@@ -234,7 +234,7 @@
0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */,
0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */,
0A7DEE081E2D2A9300267B9B /* libTKOffset.a */,
0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */,
0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */,
0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */,
0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */,
0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */,

View File

@@ -147,7 +147,7 @@ public class OcctJniActivity extends Activity implements OnClickListener
|| !loadLibVerbose ("TKService", aLoaded, aFailed)
|| !loadLibVerbose ("TKHLR", aLoaded, aFailed)
|| !loadLibVerbose ("TKV3d", aLoaded, aFailed)
|| !loadLibVerbose ("TKOpenGles", aLoaded, aFailed)
|| !loadLibVerbose ("TKOpenGl", aLoaded, aFailed)
// application code
|| !loadLibVerbose ("TKJniSample", aLoaded, aFailed))
{

View File

@@ -11,7 +11,7 @@ set (anOcctLibs
TKIGES
TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP
# OCCT Visualization
TKService TKHLR TKV3d TKOpenGles
TKService TKHLR TKV3d TKOpenGl
)
set(aLibDeps "")

View File

@@ -38,7 +38,7 @@ LIBS += -lTKernel \
-lTKMesh \
-lTKHLR \
-lTKV3d \
-lTKOpenGles
-lTKOpenGl
# IMPORTANT. load libraries in a proper order
ANDROID_EXTRA_LIBS = $$3rdparty_lib_path/libfreeimage.so \
@@ -56,4 +56,4 @@ ANDROID_EXTRA_LIBS = $$3rdparty_lib_path/libfreeimage.so \
$$occt_lib_path/libTKMesh.so \
$$occt_lib_path/libTKHLR.so \
$$occt_lib_path/libTKV3d.so \
$$occt_lib_path/libTKOpenGles.so
$$occt_lib_path/libTKOpenGl.so

View File

@@ -3,7 +3,7 @@
#Category: Modeling
#Title: Snowflake - creation of 2d drawing
pload MODELING VISUALIZATION
pload MODELING AISV
puts "Generating sample drawing of snowflake..."

View File

@@ -64,7 +64,7 @@ else()
set(OCCT_BIN_DIR)
endif()
set(OpenCASCADE_LIBS TKRWMesh TKBinXCAF TKBin TKBinL TKOpenGles TKXCAF TKVCAF TKCAF TKV3d TKHLR TKMesh TKService TKShHealing TKPrim TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKLCAF TKCDF TKernel)
set(OpenCASCADE_LIBS TKRWMesh TKBinXCAF TKBin TKBinL TKOpenGl TKXCAF TKVCAF TKCAF TKV3d TKHLR TKMesh TKService TKShHealing TKPrim TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKLCAF TKCDF TKernel)
add_executable(${APP_TARGET} ${SOURCES})
target_link_libraries(

View File

@@ -710,7 +710,7 @@ EM_BOOL WasmOcctView::onTouchEvent (int theEventType, const EmscriptenTouchEvent
myDoubleTapTimer.Stop();
myDoubleTapTimer.Reset();
myDoubleTapTimer.Start();
SelectInViewer (Graphic3d_Vec2i (myClickTouch.From), AIS_SelectionScheme_Replace);
SelectInViewer (Graphic3d_Vec2i (myClickTouch.From), false);
}
}
hasUpdates = true;

View File

@@ -133,7 +133,7 @@ void AIS_Triangulation::Compute (const Handle(PrsMgr_PresentationManager)& ,
Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup();
Handle(Graphic3d_AspectFillArea3d) anAspect = myDrawer->ShadingAspect()->Aspect();
const Standard_Real anAmbient = 1.0;
const Standard_Real anAmbient = 0.2;
if (hasVNormals)
{
gp_Vec3f aNormal;

View File

@@ -27,7 +27,6 @@
#include <Message_Messenger.hxx>
#include <gp_Quaternion.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
#include <WNT_HIDSpaceMouse.hxx>
// =======================================================================

View File

@@ -16,6 +16,7 @@
#include <Aspect_DisplayConnectionDefinitionError.hxx>
#include <OSD_Environment.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient)
// =======================================================================
@@ -26,8 +27,6 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
myDisplay = NULL;
myDefVisualInfo = NULL;
myDefFBConfig = NULL;
myIsOwnDisplay = false;
OSD_Environment anEnv ("DISPLAY");
myDisplayName = anEnv.Value();
@@ -42,10 +41,6 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
Aspect_DisplayConnection::~Aspect_DisplayConnection()
{
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
if (myDefVisualInfo != NULL)
{
XFree (myDefVisualInfo);
}
if (myDisplay != NULL
&& myIsOwnDisplay)
{
@@ -61,8 +56,6 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
// =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiString& theDisplayName)
: myDisplay (NULL),
myDefVisualInfo (NULL),
myDefFBConfig (NULL),
myIsOwnDisplay (false)
{
myDisplayName = theDisplayName;
@@ -75,28 +68,11 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiStrin
// =======================================================================
Aspect_DisplayConnection::Aspect_DisplayConnection (Display* theDisplay)
: myDisplay (NULL),
myDefVisualInfo (NULL),
myDefFBConfig (NULL),
myIsOwnDisplay (false)
{
Init (theDisplay);
}
// =======================================================================
// function : SetDefaultVisualInfo
// purpose :
// =======================================================================
void Aspect_DisplayConnection::SetDefaultVisualInfo (XVisualInfo* theVisual,
Aspect_FBConfig theFBConfig)
{
if (myDefVisualInfo != NULL)
{
XFree (myDefVisualInfo);
}
myDefVisualInfo = theVisual;
myDefFBConfig = theFBConfig;
}
// =======================================================================
// function : Init
// purpose :

View File

@@ -22,7 +22,6 @@
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
#include <InterfaceGraphic.hxx>
#include <Aspect_FBConfig.hxx>
#endif
//! This class creates and provides connection with X server.
@@ -73,21 +72,9 @@ public:
//! @param theDisplay external pointer to allocated Display, or NULL if new connection should be created
void Init (Display* theDisplay);
//! Return default window visual or NULL when undefined.
XVisualInfo* GetDefaultVisualInfo() const { return myDefVisualInfo; }
//! @return native Window FB config (GLXFBConfig on Xlib)
Aspect_FBConfig GetDefaultFBConfig() const { return myDefFBConfig; }
//! Set default window visual; the visual will be deallocated using XFree().
Standard_EXPORT void SetDefaultVisualInfo (XVisualInfo* theVisual,
Aspect_FBConfig theFBConfig);
private:
Display* myDisplay;
XVisualInfo* myDefVisualInfo;
Aspect_FBConfig myDefFBConfig;
NCollection_DataMap<Aspect_XAtom, Atom> myAtoms;
TCollection_AsciiString myDisplayName;
Standard_Boolean myIsOwnDisplay;

View File

@@ -49,9 +49,9 @@ void Aspect_VKeySet::KeyDown (Aspect_VKey theKey,
double thePressure)
{
Standard_Mutex::Sentry aLock (myLock);
if (myKeys[theKey].KStatus != KeyStatus_Pressed)
if (myKeys[theKey].Status != KeyStatus_Pressed)
{
myKeys[theKey].KStatus = KeyStatus_Pressed;
myKeys[theKey].Status = KeyStatus_Pressed;
myKeys[theKey].TimeDown = theTime;
}
myKeys[theKey].Pressure = thePressure;
@@ -68,9 +68,9 @@ void Aspect_VKeySet::KeyUp (Aspect_VKey theKey,
double theTime)
{
Standard_Mutex::Sentry aLock (myLock);
if (myKeys[theKey].KStatus == KeyStatus_Pressed)
if (myKeys[theKey].Status == KeyStatus_Pressed)
{
myKeys[theKey].KStatus = KeyStatus_Released;
myKeys[theKey].Status = KeyStatus_Released;
myKeys[theKey].TimeUp = theTime;
}
@@ -97,18 +97,18 @@ void Aspect_VKeySet::KeyFromAxis (Aspect_VKey theNegative,
const Aspect_VKey aKeyUp = thePressure < 0 ? thePositive : theNegative;
KeyDown (aKeyDown, theTime, Abs (thePressure));
if (myKeys[aKeyUp].KStatus == KeyStatus_Pressed)
if (myKeys[aKeyUp].Status == KeyStatus_Pressed)
{
KeyUp (aKeyUp, theTime);
}
}
else
{
if (myKeys[theNegative].KStatus == KeyStatus_Pressed)
if (myKeys[theNegative].Status == KeyStatus_Pressed)
{
KeyUp (theNegative, theTime);
}
if (myKeys[thePositive].KStatus == KeyStatus_Pressed)
if (myKeys[thePositive].Status == KeyStatus_Pressed)
{
KeyUp (thePositive, theTime);
}
@@ -125,7 +125,7 @@ bool Aspect_VKeySet::HoldDuration (Aspect_VKey theKey,
double& thePressure)
{
Standard_Mutex::Sentry aLock (myLock);
switch (myKeys[theKey].KStatus)
switch (myKeys[theKey].Status)
{
case KeyStatus_Free:
{
@@ -134,7 +134,7 @@ bool Aspect_VKeySet::HoldDuration (Aspect_VKey theKey,
}
case KeyStatus_Released:
{
myKeys[theKey].KStatus = KeyStatus_Free;
myKeys[theKey].Status = KeyStatus_Free;
theDuration = myKeys[theKey].TimeUp - myKeys[theKey].TimeDown;
thePressure = myKeys[theKey].Pressure;
return true;

View File

@@ -55,14 +55,14 @@ public:
bool IsFreeKey (Aspect_VKey theKey) const
{
Standard_Mutex::Sentry aLock (myLock);
return myKeys[theKey].KStatus == KeyStatus_Free;
return myKeys[theKey].Status == KeyStatus_Free;
}
//! Return TRUE if key is in Pressed state.
bool IsKeyDown (Aspect_VKey theKey) const
{
Standard_Mutex::Sentry aLock (myLock);
return myKeys[theKey].KStatus == KeyStatus_Pressed;
return myKeys[theKey].Status == KeyStatus_Pressed;
}
//! Return mutex for thread-safe updates.
@@ -131,10 +131,10 @@ private:
//! Structure defining key state.
struct KeyState
{
KeyState() : TimeDown (0.0), TimeUp (0.0), Pressure (1.0), KStatus (KeyStatus_Free) {}
KeyState() : TimeDown (0.0), TimeUp (0.0), Pressure (1.0), Status (KeyStatus_Free) {}
void Reset()
{
KStatus = KeyStatus_Free;
Status = KeyStatus_Free;
TimeDown = 0.0;
TimeUp = 0.0;
Pressure = 1.0;
@@ -143,7 +143,7 @@ private:
double TimeDown; //!< time of key press event
double TimeUp; //!< time of key release event
double Pressure; //!< key pressure
KeyStatus KStatus; //!< key status
KeyStatus Status; //!< key status
};
private:

View File

@@ -648,8 +648,8 @@ void BOPAlgo_PaveFiller::MakeBlocks()
// check if the pave block has a valid range
Standard_Real aFirst, aLast;
if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aTolR3D,
aT1, BRep_Tool::Pnt(aV1), Max (aTolR3D, BRep_Tool::Tolerance(aV1)),
aT2, BRep_Tool::Pnt(aV2), Max (aTolR3D, BRep_Tool::Tolerance(aV2)),
aT1, BRep_Tool::Pnt(aV1), BRep_Tool::Tolerance(aV1),
aT2, BRep_Tool::Pnt(aV2), BRep_Tool::Tolerance(aV2),
aFirst, aLast))
{
// If the pave block does not have valid range, i.e. it is completely

View File

@@ -41,11 +41,7 @@ static Standard_Integer ClearRepetitions(Draw_Interpretor&, Standard_Integer, co
namespace
{
static BOPAlgo_MakeConnected& getMakeConnectedTool()
{
static BOPAlgo_MakeConnected TheMakeConnectedTool;
return TheMakeConnectedTool;
}
static BOPAlgo_MakeConnected TheMakeConnectedTool;
}
//=======================================================================
@@ -108,7 +104,7 @@ Standard_Integer MakeConnected(Draw_Interpretor& theDI,
return 1;
}
getMakeConnectedTool().Clear();
TheMakeConnectedTool.Clear();
for (Standard_Integer i = 2; i < theArgc; ++i)
{
@@ -118,24 +114,24 @@ Standard_Integer MakeConnected(Draw_Interpretor& theDI,
theDI << "Error: " << theArgv[i] << " is a null shape. Skip it.\n";
continue;
}
getMakeConnectedTool().AddArgument(aS);
TheMakeConnectedTool.AddArgument(aS);
}
getMakeConnectedTool().SetRunParallel(BOPTest_Objects::RunParallel());
TheMakeConnectedTool.SetRunParallel(BOPTest_Objects::RunParallel());
getMakeConnectedTool().Perform();
TheMakeConnectedTool.Perform();
// Print Error/Warning messages
BOPTest::ReportAlerts(getMakeConnectedTool().GetReport());
BOPTest::ReportAlerts(TheMakeConnectedTool.GetReport());
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getMakeConnectedTool().History());
BRepTest_Objects::SetHistory(TheMakeConnectedTool.History());
if (getMakeConnectedTool().HasErrors())
if (TheMakeConnectedTool.HasErrors())
return 0;
// Draw the result shape
const TopoDS_Shape& aResult = getMakeConnectedTool().Shape();
const TopoDS_Shape& aResult = TheMakeConnectedTool.Shape();
DBRep::Set(theArgv[1], aResult);
return 0;
@@ -155,7 +151,7 @@ Standard_Integer MakePeriodic(Draw_Interpretor& theDI,
return 1;
}
if (getMakeConnectedTool().Shape().IsNull() || getMakeConnectedTool().HasErrors())
if (TheMakeConnectedTool.Shape().IsNull() || TheMakeConnectedTool.HasErrors())
{
theDI << "Make the shapes connected first.\n";
return 1;
@@ -214,19 +210,19 @@ Standard_Integer MakePeriodic(Draw_Interpretor& theDI,
}
}
getMakeConnectedTool().MakePeriodic(aParams);
TheMakeConnectedTool.MakePeriodic(aParams);
// Print Error/Warning messages
BOPTest::ReportAlerts(getMakeConnectedTool().GetReport());
BOPTest::ReportAlerts(TheMakeConnectedTool.GetReport());
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getMakeConnectedTool().History());
BRepTest_Objects::SetHistory(TheMakeConnectedTool.History());
if (getMakeConnectedTool().HasErrors())
if (TheMakeConnectedTool.HasErrors())
return 0;
// Draw the result shape
const TopoDS_Shape& aResult = getMakeConnectedTool().PeriodicShape();
const TopoDS_Shape& aResult = TheMakeConnectedTool.PeriodicShape();
DBRep::Set(theArgv[1], aResult);
return 0;
@@ -246,7 +242,7 @@ Standard_Integer RepeatShape(Draw_Interpretor& theDI,
return 1;
}
if (getMakeConnectedTool().PeriodicityTool().HasErrors())
if (TheMakeConnectedTool.PeriodicityTool().HasErrors())
{
theDI << "The shapes have not been made periodic yet.\n";
return 1;
@@ -280,20 +276,20 @@ Standard_Integer RepeatShape(Draw_Interpretor& theDI,
return 1;
}
getMakeConnectedTool().RepeatShape(aDirID, aTimes);
TheMakeConnectedTool.RepeatShape(aDirID, aTimes);
}
// Print Error/Warning messages
BOPTest::ReportAlerts(getMakeConnectedTool().GetReport());
BOPTest::ReportAlerts(TheMakeConnectedTool.GetReport());
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getMakeConnectedTool().History());
BRepTest_Objects::SetHistory(TheMakeConnectedTool.History());
if (getMakeConnectedTool().HasErrors())
if (TheMakeConnectedTool.HasErrors())
return 0;
// Draw the result shape
const TopoDS_Shape& aResult = getMakeConnectedTool().PeriodicShape();
const TopoDS_Shape& aResult = TheMakeConnectedTool.PeriodicShape();
DBRep::Set(theArgv[1], aResult);
return 0;
@@ -335,8 +331,8 @@ Standard_Integer MaterialsOn(Draw_Interpretor& theDI,
}
const TopTools_ListOfShape& aLS = bPositive ?
getMakeConnectedTool().MaterialsOnPositiveSide(aShape) :
getMakeConnectedTool().MaterialsOnNegativeSide(aShape);
TheMakeConnectedTool.MaterialsOnPositiveSide(aShape) :
TheMakeConnectedTool.MaterialsOnNegativeSide(aShape);
TopoDS_Shape aResult;
if (aLS.IsEmpty())
@@ -377,7 +373,7 @@ Standard_Integer GetTwins(Draw_Interpretor& theDI,
return 1;
}
const TopTools_ListOfShape& aTwins = getMakeConnectedTool().PeriodicityTool().GetTwins(aShape);
const TopTools_ListOfShape& aTwins = TheMakeConnectedTool.PeriodicityTool().GetTwins(aShape);
TopoDS_Shape aCTwins;
if (aTwins.IsEmpty())
@@ -405,15 +401,13 @@ Standard_Integer ClearRepetitions(Draw_Interpretor&,
const char **theArgv)
{
// Clear all previous repetitions
getMakeConnectedTool().ClearRepetitions();
TheMakeConnectedTool.ClearRepetitions();
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getMakeConnectedTool().History());
BRepTest_Objects::SetHistory(TheMakeConnectedTool.History());
if (theArgc > 1)
{
DBRep::Set(theArgv[1], getMakeConnectedTool().PeriodicShape());
}
DBRep::Set(theArgv[1], TheMakeConnectedTool.PeriodicShape());
return 0;
}

View File

@@ -37,11 +37,7 @@ static Standard_Integer ClearRepetitions(Draw_Interpretor&, Standard_Integer, co
namespace
{
static BOPAlgo_MakePeriodic& getPeriodicityMaker()
{
static BOPAlgo_MakePeriodic ThePeriodicityMaker;
return ThePeriodicityMaker;
}
static BOPAlgo_MakePeriodic ThePeriodicityMaker;
}
//=======================================================================
@@ -103,8 +99,8 @@ Standard_Integer MakePeriodic(Draw_Interpretor& theDI,
return 1;
}
getPeriodicityMaker().Clear();
getPeriodicityMaker().SetShape(aShape);
ThePeriodicityMaker.Clear();
ThePeriodicityMaker.SetShape(aShape);
for (Standard_Integer i = 3; i < theArgc;)
{
@@ -135,7 +131,7 @@ Standard_Integer MakePeriodic(Draw_Interpretor& theDI,
Standard_Real aPeriod = Draw::Atof(theArgv[++i]);
getPeriodicityMaker().MakePeriodic(aDirID, Standard_True, aPeriod);
ThePeriodicityMaker.MakePeriodic(aDirID, Standard_True, aPeriod);
++i;
if (theArgc > i + 1)
@@ -150,30 +146,28 @@ Standard_Integer MakePeriodic(Draw_Interpretor& theDI,
}
Standard_Real aFirst = Draw::Atof(theArgv[++i]);
getPeriodicityMaker().SetTrimmed(aDirID, Standard_False, aFirst);
ThePeriodicityMaker.SetTrimmed(aDirID, Standard_False, aFirst);
++i;
}
}
}
getPeriodicityMaker().SetRunParallel(BOPTest_Objects::RunParallel());
ThePeriodicityMaker.SetRunParallel(BOPTest_Objects::RunParallel());
// Perform operation
getPeriodicityMaker().Perform();
ThePeriodicityMaker.Perform();
// Print Error/Warning messages
BOPTest::ReportAlerts(getPeriodicityMaker().GetReport());
BOPTest::ReportAlerts(ThePeriodicityMaker.GetReport());
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getPeriodicityMaker().History());
BRepTest_Objects::SetHistory(ThePeriodicityMaker.History());
if (getPeriodicityMaker().HasErrors())
{
if (ThePeriodicityMaker.HasErrors())
return 0;
}
// Draw the result shape
const TopoDS_Shape& aResult = getPeriodicityMaker().Shape();
const TopoDS_Shape& aResult = ThePeriodicityMaker.Shape();
DBRep::Set(theArgv[1], aResult);
return 0;
@@ -201,7 +195,7 @@ Standard_Integer GetTwins(Draw_Interpretor& theDI,
return 1;
}
const TopTools_ListOfShape& aTwins = getPeriodicityMaker().GetTwins(aShape);
const TopTools_ListOfShape& aTwins = ThePeriodicityMaker.GetTwins(aShape);
TopoDS_Shape aCTwins;
if (aTwins.IsEmpty())
@@ -262,22 +256,20 @@ Standard_Integer RepeatShape(Draw_Interpretor& theDI,
return 1;
}
getPeriodicityMaker().RepeatShape(aDirID, aTimes);
ThePeriodicityMaker.RepeatShape(aDirID, aTimes);
}
// Print Error/Warning messages
BOPTest::ReportAlerts(getPeriodicityMaker().GetReport());
BOPTest::ReportAlerts(ThePeriodicityMaker.GetReport());
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getPeriodicityMaker().History());
BRepTest_Objects::SetHistory(ThePeriodicityMaker.History());
if (getPeriodicityMaker().HasErrors())
{
if (ThePeriodicityMaker.HasErrors())
return 0;
}
// Draw the result shape
const TopoDS_Shape& aResult = getPeriodicityMaker().RepeatedShape();
const TopoDS_Shape& aResult = ThePeriodicityMaker.RepeatedShape();
DBRep::Set(theArgv[1], aResult);
return 0;
@@ -292,15 +284,13 @@ Standard_Integer ClearRepetitions(Draw_Interpretor&,
const char **theArgv)
{
// Clear all previous repetitions
getPeriodicityMaker().ClearRepetitions();
ThePeriodicityMaker.ClearRepetitions();
// Set the history of the operation in session
BRepTest_Objects::SetHistory(getPeriodicityMaker().History());
BRepTest_Objects::SetHistory(ThePeriodicityMaker.History());
if (theArgc > 1)
{
DBRep::Set(theArgv[1], getPeriodicityMaker().Shape());
}
DBRep::Set(theArgv[1], ThePeriodicityMaker.Shape());
return 0;
}

View File

@@ -469,34 +469,19 @@ void BRep_Builder::MakeFace(TopoDS_Face& F,
//function : MakeFace
//purpose :
//=======================================================================
void BRep_Builder::MakeFace(TopoDS_Face& theFace,
const Handle(Poly_Triangulation)& theTriangulation) const
void BRep_Builder::MakeFace(TopoDS_Face& F,
const Handle(Poly_Triangulation)& T) const
{
Handle(BRep_TFace) aTFace = new BRep_TFace();
if(!theFace.IsNull() && theFace.Locked())
Handle(BRep_TFace) TF = new BRep_TFace();
if(!F.IsNull() && F.Locked())
{
throw TopoDS_LockedShape("BRep_Builder::MakeFace");
}
aTFace->Triangulation (theTriangulation);
MakeShape (theFace, aTFace);
TF->Triangulation(T);
MakeShape(F, TF);
}
//=======================================================================
//function : MakeFace
//purpose :
//=======================================================================
void BRep_Builder::MakeFace (TopoDS_Face& theFace,
const Poly_ListOfTriangulation& theTriangulations,
const Handle(Poly_Triangulation)& theActiveTriangulation) const
{
Handle(BRep_TFace) aTFace = new BRep_TFace();
if(!theFace.IsNull() && theFace.Locked())
{
throw TopoDS_LockedShape ("BRep_Builder::MakeFace");
}
aTFace->Triangulations (theTriangulations, theActiveTriangulation);
MakeShape (theFace, aTFace);
}
//=======================================================================
//function : MakeFace
@@ -546,19 +531,20 @@ void BRep_Builder::UpdateFace(const TopoDS_Face& F,
//function : UpdateFace
//purpose :
//=======================================================================
void BRep_Builder::UpdateFace (const TopoDS_Face& theFace,
const Handle(Poly_Triangulation)& theTriangulation,
const Standard_Boolean theToReset) const
void BRep_Builder::UpdateFace(const TopoDS_Face& F,
const Handle(Poly_Triangulation)& T) const
{
const Handle(BRep_TFace)& aTFace = *((Handle(BRep_TFace)*) &theFace.TShape());
if(aTFace->Locked())
const Handle(BRep_TFace)& TF = *((Handle(BRep_TFace)*) &F.TShape());
if(TF->Locked())
{
throw TopoDS_LockedShape("BRep_Builder::UpdateFace");
}
aTFace->Triangulation (theTriangulation, theToReset);
theFace.TShape()->Modified (Standard_True);
TF->Triangulation(T);
F.TShape()->Modified(Standard_True);
}
//=======================================================================
//function : UpdateFace
//purpose :

View File

@@ -28,7 +28,7 @@
#include <GeomAbs_Shape.hxx>
#include <Poly_Polygon3D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_ListOfTriangulation.hxx>
#include <Poly_Triangulation.hxx>
class Standard_NullObject;
class Standard_DomainError;
@@ -79,26 +79,19 @@ public:
//! Makes a Face with a surface and a location.
Standard_EXPORT void MakeFace (TopoDS_Face& F, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
//! Makes a theFace with a single triangulation. The triangulation
//! Makes a Face with a triangulation. The triangulation
//! is in the same reference system than the TFace.
Standard_EXPORT void MakeFace (TopoDS_Face& theFace, const Handle(Poly_Triangulation)& theTriangulation) const;
//! Makes a Face with a list of triangulations and active one.
//! Use NULL active triangulation to set the first triangulation in list as active.
//! The triangulations is in the same reference system than the TFace.
Standard_EXPORT void MakeFace (TopoDS_Face& theFace, const Poly_ListOfTriangulation& theTriangulations, const Handle(Poly_Triangulation)& theActiveTriangulation = Handle(Poly_Triangulation)()) const;
Standard_EXPORT void MakeFace (TopoDS_Face& F, const Handle(Poly_Triangulation)& T) const;
//! Updates the face F using the tolerance value Tol,
//! surface S and location Location.
Standard_EXPORT void UpdateFace (const TopoDS_Face& F, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real Tol) const;
//! Changes a face triangulation.
//! A NULL theTriangulation removes face triangulations.
//! If theToReset is TRUE face triangulations will be reset to new list with only one input triangulation that will be active.
//! Else if theTriangulation is contained in internal triangulations list it will be made active,
//! else the active triangulation will be replaced to theTriangulation one.
Standard_EXPORT void UpdateFace (const TopoDS_Face& theFace, const Handle(Poly_Triangulation)& theTriangulation, const Standard_Boolean theToReset = true) const;
//! Changes a face triangulation.
//!
//! A null Triangulation removes the triangulation.
Standard_EXPORT void UpdateFace (const TopoDS_Face& F, const Handle(Poly_Triangulation)& T) const;
//! Updates the face Tolerance.
Standard_EXPORT void UpdateFace (const TopoDS_Face& F, const Standard_Real Tol) const;

View File

@@ -51,131 +51,6 @@ Handle(TopoDS_TShape) BRep_TFace::EmptyCopy() const
return TF;
}
//=======================================================================
//function : Triangulation
//purpose :
//=======================================================================
const Handle(Poly_Triangulation)& BRep_TFace::Triangulation (const Poly_MeshPurpose thePurpose) const
{
if (thePurpose == Poly_MeshPurpose_NONE)
{
return ActiveTriangulation();
}
for (Poly_ListOfTriangulation::Iterator anIter(myTriangulations); anIter.More(); anIter.Next())
{
const Handle(Poly_Triangulation)& aTriangulation = anIter.Value();
if ((aTriangulation->MeshPurpose() & thePurpose) != 0)
{
return aTriangulation;
}
}
if ((thePurpose & Poly_MeshPurpose_AnyFallback) != 0
&& !myTriangulations.IsEmpty())
{
// if none matching other criteria was found return the first defined triangulation
return myTriangulations.First();
}
static const Handle(Poly_Triangulation) anEmptyTriangulation;
return anEmptyTriangulation;
}
//=======================================================================
//function : Triangulation
//purpose :
//=======================================================================
void BRep_TFace::Triangulation (const Handle(Poly_Triangulation)& theTriangulation,
const Standard_Boolean theToReset)
{
if (theToReset || theTriangulation.IsNull())
{
if (!myActiveTriangulation.IsNull())
{
// Reset Active bit
myActiveTriangulation->SetMeshPurpose (myActiveTriangulation->MeshPurpose() & ~Poly_MeshPurpose_Active);
myActiveTriangulation.Nullify();
}
myTriangulations.Clear();
if (!theTriangulation.IsNull())
{
// Reset list of triangulations to new list with only one input triangulation that will be active
myTriangulations.Append (theTriangulation);
myActiveTriangulation = theTriangulation;
// Set Active bit
theTriangulation->SetMeshPurpose (theTriangulation->MeshPurpose() | Poly_MeshPurpose_Active);
}
return;
}
for (Poly_ListOfTriangulation::Iterator anIter(myTriangulations); anIter.More(); anIter.Next())
{
// Make input triangulation active if it is already contained in list of triangulations
if (anIter.Value() == theTriangulation)
{
if (!myActiveTriangulation.IsNull())
{
// Reset Active bit
myActiveTriangulation->SetMeshPurpose (myActiveTriangulation->MeshPurpose() & ~Poly_MeshPurpose_Active);
}
myActiveTriangulation = theTriangulation;
// Set Active bit
theTriangulation->SetMeshPurpose (theTriangulation->MeshPurpose() | Poly_MeshPurpose_Active);
return;
}
}
for (Poly_ListOfTriangulation::Iterator anIter(myTriangulations); anIter.More(); anIter.Next())
{
// Replace active triangulation to input one
if (anIter.Value() == myActiveTriangulation)
{
// Reset Active bit
myActiveTriangulation->SetMeshPurpose (myActiveTriangulation->MeshPurpose() & ~Poly_MeshPurpose_Active);
anIter.ChangeValue() = theTriangulation;
myActiveTriangulation = theTriangulation;
// Set Active bit
theTriangulation->SetMeshPurpose (theTriangulation->MeshPurpose() | Poly_MeshPurpose_Active);
return;
}
}
}
//=======================================================================
//function : Triangulations
//purpose :
//=======================================================================
void BRep_TFace::Triangulations (const Poly_ListOfTriangulation& theTriangulations,
const Handle(Poly_Triangulation)& theActiveTriangulation)
{
if (theTriangulations.IsEmpty())
{
myActiveTriangulation.Nullify();
myTriangulations.Clear();
return;
}
Standard_Boolean anActiveInList = false;
for (Poly_ListOfTriangulation::Iterator anIter(theTriangulations); anIter.More(); anIter.Next())
{
const Handle(Poly_Triangulation)& aTriangulation = anIter.Value();
Standard_ASSERT_RAISE (!aTriangulation.IsNull(), "Try to set list with NULL triangulation to the face");
if (aTriangulation == theActiveTriangulation)
{
anActiveInList = true;
}
// Reset Active bit
aTriangulation->SetMeshPurpose (aTriangulation->MeshPurpose() & ~Poly_MeshPurpose_Active);
}
Standard_ASSERT_RAISE (theActiveTriangulation.IsNull() || anActiveInList, "Active triangulation isn't part of triangulations list");
myTriangulations = theTriangulations;
if (theActiveTriangulation.IsNull())
{
// Save the first one as active
myActiveTriangulation = myTriangulations.First();
}
else
{
myActiveTriangulation = theActiveTriangulation;
}
myActiveTriangulation->SetMeshPurpose (myActiveTriangulation->MeshPurpose() | Poly_MeshPurpose_Active);
}
//=======================================================================
//function : DumpJson
//purpose :
@@ -186,16 +61,10 @@ void BRep_TFace::DumpJson (Standard_OStream& theOStream, Standard_Integer theDep
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TopoDS_TFace)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myActiveTriangulation.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, mySurface.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myTriangulation.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myLocation)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTolerance)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNaturalRestriction)
for (Poly_ListOfTriangulation::Iterator anIter(myTriangulations); anIter.More(); anIter.Next())
{
const Handle(Poly_Triangulation)& aTriangulation = anIter.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aTriangulation.get())
}
}

View File

@@ -20,15 +20,16 @@
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Poly_ListOfTriangulation.hxx>
#include <TopLoc_Location.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
#include <TopoDS_TFace.hxx>
class Geom_Surface;
class Poly_Triangulation;
class TopLoc_Location;
class TopoDS_TShape;
class BRep_TFace;
DEFINE_STANDARD_HANDLE(BRep_TFace, TopoDS_TFace)
@@ -41,8 +42,8 @@ DEFINE_STANDARD_HANDLE(BRep_TFace, TopoDS_TFace)
//! True the boundary of the face is known to be the
//! parametric space (Umin, UMax, VMin, VMax).
//!
//! * An optional list of triangulations. If there are any
//! triangulations the surface can be absent.
//! * An optional Triangulation. If there is a
//! triangulation the surface can be absent.
//!
//! The Location is used for the Surface.
//!
@@ -59,51 +60,30 @@ class BRep_TFace : public TopoDS_TFace
public:
//! Creates an empty TFace.
Standard_EXPORT BRep_TFace();
//! Returns face surface.
const Handle(Geom_Surface)& Surface() const { return mySurface; }
//! Sets surface for this face.
void Surface (const Handle(Geom_Surface)& theSurface) { mySurface = theSurface;}
//! Returns the face location.
const TopLoc_Location& Location() const { return myLocation; }
//! Sets the location for this face.
void Location (const TopLoc_Location& theLocation) { myLocation = theLocation; }
//! Returns the face tolerance.
Standard_Real Tolerance() const { return myTolerance; }
//! Sets the tolerance for this face.
void Tolerance (const Standard_Real theTolerance) { myTolerance = theTolerance; }
//! Returns TRUE if the boundary of this face is known to be the parametric space (Umin, UMax, VMin, VMax).
Standard_Boolean NaturalRestriction() const { return myNaturalRestriction; }
//! Sets the flag that is TRUE if the boundary of this face is known to be the parametric space.
void NaturalRestriction (const Standard_Boolean theRestriction) { myNaturalRestriction = theRestriction; }
//! Returns the triangulation of this face according to the mesh purpose.
//! @param theMeshPurpose [in] a mesh purpose to find appropriate triangulation (NONE by default).
//! @return an active triangulation in case of NONE purpose,
//! the first triangulation appropriate for the input purpose,
//! just the first triangulation if none matching other criteria and input purpose is AnyFallback
//! or null handle if there is no any suitable triangulation.
Standard_EXPORT const Handle(Poly_Triangulation)& Triangulation (const Poly_MeshPurpose thePurpose = Poly_MeshPurpose_NONE) const;
//! Sets input triangulation for this face.
//! @param theTriangulation [in] triangulation to be set
//! @param theToReset [in] flag to reset triangulations list to new list with only one input triangulation.
//! If theTriangulation is NULL internal list of triangulations will be cleared and active triangulation will be nullified.
//! If theToReset is TRUE internal list of triangulations will be reset
//! to new list with only one input triangulation that will be active.
//! Else if input triangulation is contained in internal triangulations list it will be made active,
//! else the active triangulation will be replaced to input one.
Standard_EXPORT void Triangulation (const Handle(Poly_Triangulation)& theTriangulation, const Standard_Boolean theToReset = true);
const Handle(Geom_Surface)& Surface() const;
const Handle(Poly_Triangulation)& Triangulation() const;
const TopLoc_Location& Location() const;
Standard_Real Tolerance() const;
void Surface (const Handle(Geom_Surface)& S);
void Triangulation (const Handle(Poly_Triangulation)& T);
void Location (const TopLoc_Location& L);
void Tolerance (const Standard_Real T);
Standard_Boolean NaturalRestriction() const;
void NaturalRestriction (const Standard_Boolean N);
//! Returns a copy of the TShape with no sub-shapes.
//! The new Face has no triangulation.
Standard_EXPORT virtual Handle(TopoDS_TShape) EmptyCopy() const Standard_OVERRIDE;
@@ -111,35 +91,33 @@ public:
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
public:
//! Returns the list of available face triangulations.
const Poly_ListOfTriangulation& Triangulations() const { return myTriangulations; }
//! Sets input list of triangulations and currently active triangulation for this face.
//! If list is empty internal list of triangulations will be cleared and active triangulation will be nullified.
//! Else this list will be saved and the input active triangulation be saved as active.
//! Use NULL active triangulation to set the first triangulation in list as active.
//! Note: the method throws exception if there is any NULL triangulation in input list or
//! if this list doesn't contain input active triangulation.
Standard_EXPORT void Triangulations (const Poly_ListOfTriangulation& theTriangulations, const Handle(Poly_Triangulation)& theActiveTriangulation);
//! Returns number of available face triangulations.
Standard_Integer NbTriangulations() const { return myTriangulations.Size(); }
//! Returns current active triangulation.
const Handle(Poly_Triangulation)& ActiveTriangulation() const { return myActiveTriangulation; }
DEFINE_STANDARD_RTTIEXT(BRep_TFace,TopoDS_TFace)
protected:
private:
Poly_ListOfTriangulation myTriangulations;
Handle(Poly_Triangulation) myActiveTriangulation;
Handle(Geom_Surface) mySurface;
Handle(Poly_Triangulation) myTriangulation;
TopLoc_Location myLocation;
Standard_Real myTolerance;
Standard_Boolean myNaturalRestriction;
};
#include <BRep_TFace.lxx>
#endif // _BRep_TFace_HeaderFile

127
src/BRep/BRep_TFace.lxx Normal file
View File

@@ -0,0 +1,127 @@
// Created on: 1992-08-25
// Created by: Modelistation
// Copyright (c) 1992-1999 Matra Datavision
// 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.
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
inline const Handle(Geom_Surface)& BRep_TFace::Surface()const
{
return mySurface;
}
//=======================================================================
//function : Triangulation
//purpose :
//=======================================================================
inline const Handle(Poly_Triangulation)& BRep_TFace::Triangulation()const
{
return myTriangulation;
}
//=======================================================================
//function : Location
//purpose :
//=======================================================================
inline const TopLoc_Location& BRep_TFace::Location()const
{
return myLocation;
}
//=======================================================================
//function : Tolerance
//purpose :
//=======================================================================
inline Standard_Real BRep_TFace::Tolerance()const
{
return myTolerance;
}
//=======================================================================
//function : Surface
//purpose :
//=======================================================================
inline void BRep_TFace::Surface(const Handle(Geom_Surface)& S)
{
mySurface = S;
}
//=======================================================================
//function : Triangulation
//purpose :
//=======================================================================
inline void BRep_TFace::Triangulation(const Handle(Poly_Triangulation)& T)
{
myTriangulation = T;
}
//=======================================================================
//function : Location
//purpose :
//=======================================================================
inline void BRep_TFace::Location(const TopLoc_Location& L)
{
myLocation = L;
}
//=======================================================================
//function : Tolerance
//purpose :
//=======================================================================
inline void BRep_TFace::Tolerance(const Standard_Real T)
{
myTolerance = T;
}
//=======================================================================
//function : NaturalRestriction
//purpose :
//=======================================================================
inline Standard_Boolean BRep_TFace::NaturalRestriction()const
{
return myNaturalRestriction;
}
//=======================================================================
//function : NaturalRestriction
//purpose :
//=======================================================================
inline void BRep_TFace::NaturalRestriction(const Standard_Boolean N)
{
myNaturalRestriction = N;
}

View File

@@ -113,27 +113,16 @@ Handle(Geom_Surface) BRep_Tool::Surface(const TopoDS_Face& F)
//=======================================================================
//function : Triangulation
//purpose :
//purpose : Returns the Triangulation of the face. It is a
// null handle if there is no triangulation.
//=======================================================================
const Handle(Poly_Triangulation)& BRep_Tool::Triangulation (const TopoDS_Face& theFace,
TopLoc_Location& theLocation,
const Poly_MeshPurpose theMeshPurpose)
{
theLocation = theFace.Location();
const BRep_TFace* aTFace = static_cast<const BRep_TFace*>(theFace.TShape().get());
return aTFace->Triangulation (theMeshPurpose);
}
//=======================================================================
//function : Triangulations
//purpose :
//=======================================================================
const Poly_ListOfTriangulation& BRep_Tool::Triangulations (const TopoDS_Face& theFace,
TopLoc_Location& theLocation)
const Handle(Poly_Triangulation)& BRep_Tool::Triangulation(const TopoDS_Face& F,
TopLoc_Location& L)
{
theLocation = theFace.Location();
const BRep_TFace* aTFace = static_cast<const BRep_TFace*>(theFace.TShape().get());
return aTFace->Triangulations();
L = F.Location();
const BRep_TFace* TF = static_cast<const BRep_TFace*>(F.TShape().get());
return TF->Triangulation();
}
//=======================================================================

View File

@@ -27,7 +27,7 @@
#include <Geom2d_Curve.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Pnt.hxx>
#include <Poly_ListOfTriangulation.hxx>
#include <Poly_Triangulation.hxx>
#include <Poly_Polygon3D.hxx>
#include <Poly_Polygon2D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
@@ -63,24 +63,11 @@ public:
//! Returns the geometric surface of the face. It can
//! be a copy if there is a Location.
Standard_EXPORT static Handle(Geom_Surface) Surface (const TopoDS_Face& F);
//! Returns the triangulation of the face according to the mesh purpose.
//! @param theFace [in] the input face to find triangulation.
//! @param theLocation [out] the face location.
//! @param theMeshPurpose [in] a mesh purpose to find appropriate triangulation (NONE by default).
//! @return an active triangulation in case of NONE purpose,
//! the first triangulation appropriate for the input purpose,
//! just the first triangulation if none matching other criteria and input purpose is AnyFallback
//! or null handle if there is no any suitable triangulation.
Standard_EXPORT static const Handle(Poly_Triangulation)& Triangulation (const TopoDS_Face& theFace, TopLoc_Location& theLocation,
const Poly_MeshPurpose theMeshPurpose = Poly_MeshPurpose_NONE);
//! Returns all triangulations of the face.
//! @param theFace [in] the input face.
//! @param theLocation [out] the face location.
//! @return list of all available face triangulations.
Standard_EXPORT static const Poly_ListOfTriangulation& Triangulations (const TopoDS_Face& theFace, TopLoc_Location& theLocation);
//! Returns the Triangulation of the face. It is a
//! null handle if there is no triangulation.
Standard_EXPORT static const Handle(Poly_Triangulation)& Triangulation (const TopoDS_Face& F, TopLoc_Location& L);
//! Returns the tolerance of the face.
Standard_EXPORT static Standard_Real Tolerance (const TopoDS_Face& F);

View File

@@ -47,6 +47,7 @@ BRep_TEdge.hxx
BRep_TEdge.lxx
BRep_TFace.cxx
BRep_TFace.hxx
BRep_TFace.lxx
BRep_Tool.cxx
BRep_Tool.hxx
BRep_TVertex.cxx

View File

@@ -281,30 +281,11 @@ void BRepFill_TrimShellCorner::Perform()
}
}
Standard_Real aMaxTol = 0.;
TopExp_Explorer anExp(myShape1, TopAbs_VERTEX);
for (; anExp.More(); anExp.Next())
{
aMaxTol = Max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current())));
}
anExp.Init(myShape2, TopAbs_VERTEX);
for (; anExp.More(); anExp.Next())
{
aMaxTol = Max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current())));
}
Standard_Real aFuzzy = 4.*Precision::Confusion();
BOPAlgo_PaveFiller aPF;
TopTools_ListOfShape aLS;
aLS.Append(myShape1);
aLS.Append(myShape2);
aPF.SetArguments(aLS);
if (aMaxTol < 1.005 * Precision::Confusion())
{
aFuzzy = Max(aPF.FuzzyValue(), aFuzzy);
aPF.SetFuzzyValue(aFuzzy);
}
//
aPF.Perform();
if (aPF.HasErrors()) {
@@ -875,9 +856,6 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
TopoDS_Edge FirstEdge = FindEdgeCloseToBisectorPlane(theFirstVertex,
OldComp,
myAxeOfBisPlane.Axis());
if (FirstEdge.IsNull())
return Standard_False;
iter.Initialize(OldComp);
if (!iter.More())
{
@@ -887,9 +865,7 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
TopoDS_Edge LastEdge = FindEdgeCloseToBisectorPlane(theLastVertex,
OldComp,
myAxeOfBisPlane.Axis());
if (LastEdge.IsNull())
return Standard_False;
BB.Add(NewWire, FirstEdge);
if (!FirstEdge.IsSame(LastEdge))

View File

@@ -74,45 +74,17 @@
Standard_IMPORT Draw_Viewer dout;
#endif
static BRepFeat_MakeCylindricalHole& getHole()
{
static BRepFeat_MakeCylindricalHole theHole;
return theHole;
}
static BRepFeat_MakeCylindricalHole theHole;
static Standard_Boolean WithControl = Standard_True;
Standard_Boolean DownCastingEnforcing = Standard_False;
static BRepFeat_MakePrism& getPrism()
{
static BRepFeat_MakePrism thePrism;
return thePrism;
}
static BRepFeat_MakeDPrism& getDPrism()
{
static BRepFeat_MakeDPrism theDPrism;
return theDPrism;
}
static BRepFeat_MakeRevol& getRevol()
{
static BRepFeat_MakeRevol theRevol;
return theRevol;
}
static BRepFeat_MakePipe& getPipe()
{
static BRepFeat_MakePipe thePipe;
return thePipe;
}
static BRepFeat_MakeLinearForm& getLienarForm()
{
static BRepFeat_MakeLinearForm theLF;
return theLF;
}
static BRepFeat_MakeRevolutionForm& getRevolutionForm()
{
static BRepFeat_MakeRevolutionForm theRF;
return theRF;
}
static BRepFeat_MakePrism thePrism;
static BRepFeat_MakeDPrism theDPrism;
static BRepFeat_MakeRevol theRevol;
static BRepFeat_MakePipe thePipe;
static BRepFeat_MakeLinearForm theLF;
static BRepFeat_MakeRevolutionForm theRF;
//Input shapes for Prism, DPrism, Revol, Pipe
static TopoDS_Shape theSbase, thePbase;
@@ -259,27 +231,26 @@ static Standard_Integer HOLE1(Draw_Interpretor& theCommands,
Standard_Real Radius = Draw::Atof(a[9]);
getHole().Init(S, gp_Ax1(Or, Di));
theHole.Init(S, gp_Ax1(Or, Di));
if (narg <= 10) {
getHole().Perform(Radius);
theHole.Perform(Radius);
}
else {
Standard_Real pfrom = Draw::Atof(a[10]);
Standard_Real pto = Draw::Atof(a[11]);
getHole().Perform(Radius, pfrom, pto, WithControl);
theHole.Perform(Radius, pfrom, pto, WithControl);
}
getHole().Build();
if (!getHole().HasErrors())
{
theHole.Build();
if (!theHole.HasErrors()) {
// dout.Clear();
DBRep::Set(a[1], getHole().Shape());
DBRep::Set(a[1], theHole.Shape());
dout.Flush();
return 0;
}
theCommands << "Echec de MakeCylindricalHole";
Print(theCommands, getHole().Status());
Print(theCommands, theHole.Status());
return 1;
}
@@ -294,19 +265,18 @@ static Standard_Integer HOLE2(Draw_Interpretor& theCommands,
Standard_Real Radius = Draw::Atof(a[9]);
getHole().Init(S, gp_Ax1(Or, Di));
getHole().PerformThruNext(Radius, WithControl);
theHole.Init(S, gp_Ax1(Or, Di));
theHole.PerformThruNext(Radius, WithControl);
getHole().Build();
if (!getHole().HasErrors())
{
theHole.Build();
if (!theHole.HasErrors()) {
// dout.Clear();
DBRep::Set(a[1], getHole().Shape());
DBRep::Set(a[1], theHole.Shape());
dout.Flush();
return 0;
}
theCommands << "Echec de MakeCylindricalHole";
Print(theCommands, getHole().Status());
Print(theCommands, theHole.Status());
return 1;
}
@@ -321,17 +291,17 @@ static Standard_Integer HOLE3(Draw_Interpretor& theCommands,
Standard_Real Radius = Draw::Atof(a[9]);
getHole().Init(S, gp_Ax1(Or, Di));
getHole().PerformUntilEnd(Radius, WithControl);
getHole().Build();
if (!getHole().HasErrors()) {
theHole.Init(S, gp_Ax1(Or, Di));
theHole.PerformUntilEnd(Radius, WithControl);
theHole.Build();
if (!theHole.HasErrors()) {
// dout.Clear();
DBRep::Set(a[1], getHole().Shape());
DBRep::Set(a[1], theHole.Shape());
dout.Flush();
return 0;
}
theCommands << "Echec de MakeCylindricalHole";
Print(theCommands, getHole().Status());
Print(theCommands, theHole.Status());
return 1;
}
@@ -348,18 +318,17 @@ static Standard_Integer HOLE4(Draw_Interpretor& theCommands,
Standard_Real Radius = Draw::Atof(a[9]);
Standard_Real Length = Draw::Atof(a[10]);
getHole().Init(S, gp_Ax1(Or, Di));
getHole().PerformBlind(Radius, Length, WithControl);
getHole().Build();
if (!getHole().HasErrors())
{
theHole.Init(S, gp_Ax1(Or, Di));
theHole.PerformBlind(Radius, Length, WithControl);
theHole.Build();
if (!theHole.HasErrors()) {
// dout.Clear();
DBRep::Set(a[1], getHole().Shape());
DBRep::Set(a[1], theHole.Shape());
dout.Flush();
return 0;
}
theCommands << "Echec de MakeCylindricalHole";
Print(theCommands, getHole().Status());
Print(theCommands, theHole.Status());
return 1;
}
@@ -1661,7 +1630,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theSbase = Sbase;
thePbase = Pbase;
theSkface = Skface;
getPrism().Init(Sbase, Pbase, Skface, gp_Dir(X, Y, Z), Fuse, Modify);
thePrism.Init(Sbase, Pbase, Skface, gp_Dir(X, Y, Z), Fuse, Modify);
}
else if (narg == 14) {
rfdef = Standard_True;
@@ -1672,10 +1641,9 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
Standard_Real H1 = Draw::Atof(a[10]);
Standard_Real H2 = Draw::Atof(a[11]);
gp_Ax1 ax1(Or, gp_Dir(X, Y, Z));
getRevolutionForm().Init(Sbase, W, P, ax1, H1, H2, Fuse, Modify);
if (!getRevolutionForm().IsDone())
{
se = getRevolutionForm().CurrentStatusError();
theRF.Init(Sbase, W, P, ax1, H1, H2, Fuse, Modify);
if (!theRF.IsDone()) {
se = theRF.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
@@ -1692,7 +1660,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theSbase = Sbase;
thePbase = Pbase;
theSkface = Skface;
getRevol().Init(Sbase, Pbase, Skface, gp_Ax1(Or, gp_Dir(X, Y, Z)),
theRevol.Init(Sbase, Pbase, Skface, gp_Ax1(Or, gp_Dir(X, Y, Z)),
Fuse, Modify);
}
else {
@@ -1701,10 +1669,9 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
X = Draw::Atof(a[7]);
Y = Draw::Atof(a[8]);
Z = Draw::Atof(a[9]);
getLienarForm().Init(Sbase, W, P, Direct, gp_Vec(X, Y, Z), Fuse, Modify);
if (!getLienarForm().IsDone())
{
se = getLienarForm().CurrentStatusError();
theLF.Init(Sbase, W, P, Direct, gp_Vec(X, Y, Z), Fuse, Modify);
if (!theLF.IsDone()) {
se = theLF.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
@@ -1724,7 +1691,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theSbase = Sbase;
thePbase = Pbase;
theSkface = Skface;
getDPrism().Init(Sbase, TopoDS::Face(Pbase), Skface, Angle, Fuse, Modify);
theDPrism.Init(Sbase, TopoDS::Face(Pbase), Skface, Angle, Fuse, Modify);
}
else { // FEATPIPE
TopoDS_Shape aLocalShape(DBRep::Get(a[4], TopAbs_WIRE));
@@ -1744,7 +1711,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands,
theSbase = Sbase;
thePbase = Pbase;
theSkface = Skface;
getPipe().Init(Sbase, Pbase, Skface, Spine, Fuse, Modify);
thePipe.Init(Sbase, Pbase, Skface, Spine, Fuse, Modify);
}
}
return 0;
@@ -1776,7 +1743,7 @@ static Standard_Integer ADD(Draw_Interpretor&,
if (fac.IsNull()) {
return 1;
}
getPrism().Add(edg, fac);
thePrism.Add(edg, fac);
}
}
else if (!strcasecmp("REVOL", a[1])) {
@@ -1796,7 +1763,7 @@ static Standard_Integer ADD(Draw_Interpretor&,
if (fac.IsNull()) {
return 1;
}
getRevol().Add(edg, fac);
theRevol.Add(edg, fac);
}
}
else if (!strcasecmp("PIPE", a[1])) {
@@ -1816,7 +1783,7 @@ static Standard_Integer ADD(Draw_Interpretor&,
if (fac.IsNull()) {
return 1;
}
getPipe().Add(edg, fac);
thePipe.Add(edg, fac);
}
}
else {
@@ -1907,14 +1874,14 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
if (narg == 4) {
Standard_Real Val = Draw::Atof(a[3]);
if (Kas == 1) {
getPrism().Perform(Val);
thePrism.Perform(Val);
}
else if (Kas == 2) {
Val *= (M_PI / 180.);
getRevol().Perform(Val);
theRevol.Perform(Val);
}
else if (Kas == 4) {
getDPrism().Perform(Val);
theDPrism.Perform(Val);
}
else if (Kas == 5) {
theCommands << "invalid command for lf";
@@ -1929,14 +1896,14 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
Standard_Real Val = Draw::Atof(a[3]);
TopoDS_Shape FUntil = DBRep::Get(a[4], TopAbs_SHAPE);
if (Kas == 1) {
getPrism().PerformUntilHeight(FUntil, Val);
thePrism.PerformUntilHeight(FUntil, Val);
}
else if (Kas == 2) {
Val *= (M_PI / 180.);
getRevol().PerformUntilAngle(FUntil, Val);
theRevol.PerformUntilAngle(FUntil, Val);
}
else if (Kas == 4) {
getDPrism().PerformUntilHeight(FUntil, Val);
theDPrism.PerformUntilHeight(FUntil, Val);
}
else {
theCommands << "invalid command for ribs or slots";
@@ -1948,22 +1915,22 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
if (narg == 3) { // Thru all
switch (Kas) {
case 1:
getPrism().PerformThruAll();
thePrism.PerformThruAll();
break;
case 2:
getRevol().PerformThruAll();
theRevol.PerformThruAll();
break;
case 3:
getPipe().Perform();
thePipe.Perform();
break;
case 4:
getDPrism().PerformThruAll();
theDPrism.PerformThruAll();
break;
case 5:
getLienarForm().Perform();
theLF.Perform();
break;
case 6:
getRevolutionForm().Perform();
theRF.Perform();
break;
default:
@@ -1976,17 +1943,17 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
case 1:
{
if (Funtil.IsNull()) {
getPrism().PerformUntilEnd();
thePrism.PerformUntilEnd();
}
else {
getPrism().Perform(Funtil);
thePrism.Perform(Funtil);
}
}
break;
case 2:
{
if (!Funtil.IsNull()) {
getRevol().Perform(Funtil);
theRevol.Perform(Funtil);
}
else {
return 1;
@@ -1995,9 +1962,8 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
break;
case 3:
{
if (!Funtil.IsNull())
{
getPipe().Perform(Funtil);
if (!Funtil.IsNull()) {
thePipe.Perform(Funtil);
}
else {
theCommands << "invalid command for ribs pipe";
@@ -2008,10 +1974,10 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
case 4:
{
if (!Funtil.IsNull()) {
getDPrism().Perform(Funtil);
theDPrism.Perform(Funtil);
}
else {
getDPrism().PerformUntilEnd();
theDPrism.PerformUntilEnd();
}
}
break;
@@ -2040,13 +2006,11 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
switch (Kas) {
case 1:
{
if (Ffrom.IsNull())
{
getPrism().PerformFromEnd(Funtil);
if (Ffrom.IsNull()) {
thePrism.PerformFromEnd(Funtil);
}
else
{
getPrism().Perform(Ffrom, Funtil);
else {
thePrism.Perform(Ffrom, Funtil);
}
}
break;
@@ -2055,7 +2019,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
if (Ffrom.IsNull()) {
return 1;
}
getRevol().Perform(Ffrom, Funtil);
theRevol.Perform(Ffrom, Funtil);
}
break;
case 3:
@@ -2063,16 +2027,16 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
if (Ffrom.IsNull()) {
return 1;
}
getPipe().Perform(Ffrom, Funtil);
thePipe.Perform(Ffrom, Funtil);
}
break;
case 4:
{
if (Ffrom.IsNull()) {
getDPrism().PerformFromEnd(Funtil);
theDPrism.PerformFromEnd(Funtil);
}
else {
getDPrism().Perform(Ffrom, Funtil);
theDPrism.Perform(Ffrom, Funtil);
}
}
break;
@@ -2086,16 +2050,15 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
BRepFeat_StatusError se;
switch (Kas) {
case 1:
if (!getPrism().IsDone())
{
se = getPrism().CurrentStatusError();
if (!thePrism.IsDone()) {
se = thePrism.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
theCommands << aSStream << "\n";
return 1;
}
DBRep::Set(a[2], getPrism());
DBRep::Set(a[2], thePrism);
dout.Flush();
//History
if (BRepTest_Objects::IsHistoryNeeded())
@@ -2104,13 +2067,12 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
anArgs.Append(theSbase);
anArgs.Append(thePbase);
anArgs.Append(theSkface);
BRepTest_Objects::SetHistory(anArgs, getPrism());
BRepTest_Objects::SetHistory(anArgs, thePrism);
}
return 0;
case 2:
if (!getRevol().IsDone())
{
se = getRevol().CurrentStatusError();
if (!theRevol.IsDone()) {
se = theRevol.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
@@ -2124,15 +2086,14 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
anArgs.Append(theSbase);
anArgs.Append(thePbase);
anArgs.Append(theSkface);
BRepTest_Objects::SetHistory(anArgs, getRevol());
BRepTest_Objects::SetHistory(anArgs, theRevol);
}
DBRep::Set(a[2], getRevol());
DBRep::Set(a[2], theRevol);
dout.Flush();
return 0;
case 3:
if (!getPipe().IsDone())
{
se = getPipe().CurrentStatusError();
if (!thePipe.IsDone()) {
se = thePipe.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
@@ -2146,15 +2107,14 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
anArgs.Append(theSbase);
anArgs.Append(thePbase);
anArgs.Append(theSkface);
BRepTest_Objects::SetHistory(anArgs, getPipe());
BRepTest_Objects::SetHistory(anArgs, thePipe);
}
DBRep::Set(a[2], getPipe());
DBRep::Set(a[2], thePipe);
dout.Flush();
return 0;
case 4:
if (!getDPrism().IsDone())
{
se = getDPrism().CurrentStatusError();
if (!theDPrism.IsDone()) {
se = theDPrism.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
@@ -2168,35 +2128,33 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands,
anArgs.Append(theSbase);
anArgs.Append(thePbase);
anArgs.Append(theSkface);
BRepTest_Objects::SetHistory(anArgs, getDPrism());
BRepTest_Objects::SetHistory(anArgs, theDPrism);
}
DBRep::Set(a[2], getDPrism());
DBRep::Set(a[2], theDPrism);
dout.Flush();
return 0;
case 5:
if (!getLienarForm().IsDone())
{
se = getLienarForm().CurrentStatusError();
if (!theLF.IsDone()) {
se = theLF.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
theCommands << aSStream << "\n";
return 1;
}
DBRep::Set(a[2], getLienarForm());
DBRep::Set(a[2], theLF);
dout.Flush();
return 0;
case 6:
if (!getRevolutionForm().IsDone())
{
se = getRevolutionForm().CurrentStatusError();
if (!theRF.IsDone()) {
se = theRF.CurrentStatusError();
//BRepFeat::Print(se,std::cout) << std::endl;
Standard_SStream aSStream;
BRepFeat::Print(se, aSStream);
theCommands << aSStream << "\n";
return 1;
}
DBRep::Set(a[2], getRevolutionForm());
DBRep::Set(a[2], theRF);
dout.Flush();
return 0;
default:
@@ -2249,11 +2207,11 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
return 1;
}
getDPrism().BossEdges(dprsig);
theDPrism.BossEdges(dprsig);
TopTools_ListOfShape theTopEdges, theLatEdges;
theTopEdges = getDPrism().TopEdges();
theLatEdges = getDPrism().LatEdges();
theTopEdges = theDPrism.TopEdges();
theLatEdges = theDPrism.LatEdges();
TopTools_ListIteratorOfListOfShape it;
BRep_Builder B;
@@ -2287,7 +2245,7 @@ static Standard_Integer BOSS(Draw_Interpretor& theCommands,
V = DBRep::Get(a[2], TopAbs_SHAPE);
}
else if (Kas == 3) {
V = getDPrism();
V = theDPrism;
}
if (V.IsNull()) return 1;

View File

@@ -36,8 +36,6 @@
#include <Geom_Surface.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Vec2d.hxx>
#include <Message.hxx>
#include <OSD_FileSystem.hxx>
#include <OSD_OpenFile.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
@@ -1022,230 +1020,6 @@ Standard_Boolean BRepTools::Triangulation(const TopoDS_Shape& theShape,
return Standard_True;
}
//=======================================================================
//function : LoadTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools::LoadTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx,
const Standard_Boolean theToSetAsActive,
const Handle(OSD_FileSystem)& theFileSystem)
{
Standard_ASSERT_RAISE (theTriangulationIdx >= -1, "Invalid negative triangulation index!");
Standard_Boolean wasLoaded = false;
BRep_Builder aBuilder;
TopLoc_Location aDummyLoc;
const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem();
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
Handle(Poly_Triangulation) aTriangulation;
if (theTriangulationIdx == -1)
{
// load an active triangulation
aTriangulation = BRep_Tool::Triangulation (aFace, aDummyLoc);
}
else
{
const Poly_ListOfTriangulation& aTriangulations = BRep_Tool::Triangulations (aFace, aDummyLoc);
if (theTriangulationIdx >= aTriangulations.Size())
{
// triangulation index is out of range
continue;
}
Standard_Integer aTriangulationIdx = 0;
for (Poly_ListOfTriangulation::Iterator anIter(aTriangulations);
anIter.More(); anIter.Next(), aTriangulationIdx++)
{
if (aTriangulationIdx != theTriangulationIdx)
{
continue;
}
aTriangulation = anIter.Value();
break;
}
}
if (aTriangulation.IsNull() ||
!aTriangulation->HasDeferredData())
{
// NULL triangulation, already loaded triangulation or triangulation without deferred storage
// cannot be loaded
continue;
}
if (aTriangulation->LoadDeferredData (aFileSystem))
{
wasLoaded = true;
if (theToSetAsActive
&& (theTriangulationIdx != -1)) // triangulation is already active
{
aBuilder.UpdateFace (aFace, aTriangulation, false);
}
}
}
return wasLoaded;
}
//=======================================================================
//function : LoadAllTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools::LoadAllTriangulations (const TopoDS_Shape& theShape,
const Handle(OSD_FileSystem)& theFileSystem)
{
Standard_Boolean wasLoaded = false;
TopLoc_Location aDummyLoc;
const Handle(OSD_FileSystem)& aFileSystem = !theFileSystem.IsNull() ? theFileSystem : OSD_FileSystem::DefaultFileSystem();
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
for (Poly_ListOfTriangulation::Iterator anIter (BRep_Tool::Triangulations (aFace, aDummyLoc));
anIter.More(); anIter.Next())
{
const Handle(Poly_Triangulation)& aTriangulation = anIter.Value();
if (aTriangulation.IsNull() ||
!aTriangulation->HasDeferredData())
{
// NULL triangulation, already loaded triangulation or triangulation without deferred storage
// cannot be loaded
continue;
}
wasLoaded = aTriangulation->LoadDeferredData (aFileSystem);
}
}
return wasLoaded;
}
//=======================================================================
//function : UnloadTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools::UnloadTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx)
{
Standard_ASSERT_RAISE (theTriangulationIdx >= -1, "Invalid negative triangulation index!");
Standard_Boolean wasUnloaded = false;
TopLoc_Location aDummyLoc;
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
Handle(Poly_Triangulation) aTriangulation;
if (theTriangulationIdx == -1)
{
// unload an active triangulation
aTriangulation = BRep_Tool::Triangulation (aFace, aDummyLoc);
}
else
{
Standard_Integer aTriangulationIdx = 0;
const Poly_ListOfTriangulation& aTriangulations = BRep_Tool::Triangulations (aFace, aDummyLoc);
if (theTriangulationIdx >= aTriangulations.Size())
{
// triangulation index is out of range
continue;
}
for (Poly_ListOfTriangulation::Iterator anIter (aTriangulations);
anIter.More(); anIter.Next(), aTriangulationIdx++)
{
if (aTriangulationIdx != theTriangulationIdx)
{
continue;
}
aTriangulation = anIter.Value();
break;
}
}
if (aTriangulation.IsNull() ||
!aTriangulation->HasDeferredData())
{
// NULL triangulation or triangulation without deferred storage cannot be unloaded
continue;
}
wasUnloaded = aTriangulation->UnloadDeferredData();
}
return wasUnloaded;
}
//=======================================================================
//function : UnloadAllTriangulations
//purpose :
//=======================================================================
Standard_Boolean BRepTools::UnloadAllTriangulations (const TopoDS_Shape& theShape)
{
Standard_Boolean wasUnloaded = false;
TopLoc_Location aDummyLoc;
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
Handle(Poly_Triangulation) aTriangulation;
for (Poly_ListOfTriangulation::Iterator anIter (BRep_Tool::Triangulations (aFace, aDummyLoc));
anIter.More(); anIter.Next())
{
aTriangulation = anIter.Value();
if (aTriangulation.IsNull() ||
!aTriangulation->HasDeferredData())
{
// NULL triangulation or triangulation without deferred storage cannot be unloaded
continue;
}
wasUnloaded = aTriangulation->UnloadDeferredData();
}
}
return wasUnloaded;
}
//=======================================================================
//function : ActivateTriangulation
//purpose :
//=======================================================================
Standard_Boolean BRepTools::ActivateTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx,
const Standard_Boolean theToActivateStrictly)
{
Standard_ASSERT_RAISE (theTriangulationIdx > -1, "Invalid negative triangulation index!");
Standard_Boolean wasActivated = false;
BRep_Builder aBuilder;
TopLoc_Location aDummyLoc;
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
Standard_Integer aTriangulationIdx = theTriangulationIdx;
const Poly_ListOfTriangulation& aTriangulations = BRep_Tool::Triangulations (aFace, aDummyLoc);
const Standard_Integer aTriangulationsNb = aTriangulations.Size();
if (theTriangulationIdx >= aTriangulationsNb)
{
// triangulation index is out of range
if (theToActivateStrictly)
{
// skip activation
continue;
}
// use last available
aTriangulationIdx = aTriangulationsNb - 1;
}
Handle(Poly_Triangulation) anActiveTriangulation;
Standard_Integer aTriangulationIter = 0;
for (Poly_ListOfTriangulation::Iterator anIter (aTriangulations);
anIter.More(); anIter.Next(), aTriangulationIter++)
{
if (aTriangulationIter != aTriangulationIdx)
{
continue;
}
anActiveTriangulation = anIter.Value();
break;
}
if (anActiveTriangulation.IsNull())
{
continue;
}
aBuilder.UpdateFace (aFace, anActiveTriangulation, false);
wasActivated = true;
}
return wasActivated;
}
//=======================================================================
//function : IsReallyClosed

View File

@@ -54,7 +54,6 @@ class BRepTools_ReShape;
class Geom_Curve;
class Geom2d_Curve;
class Geom_Surface;
class OSD_FileSystem;
//! The BRepTools package provides utilities for BRep
@@ -166,9 +165,7 @@ public:
//! Removes all the pcurves of the edges of <S> that
//! refer to surfaces not belonging to any face of <S>
Standard_EXPORT static void RemoveUnusedPCurves (const TopoDS_Shape& S);
public:
//! Verifies that each Face from the shape has got a triangulation with a deflection smaller or equal to specified one
//! and the Edges a discretization on this triangulation.
//! @param theShape [in] shape to verify
@@ -181,60 +178,7 @@ public:
Standard_EXPORT static Standard_Boolean Triangulation (const TopoDS_Shape& theShape,
const Standard_Real theLinDefl,
const Standard_Boolean theToCheckFreeEdges = Standard_False);
//! Loads triangulation data for each face of the shape
//! from some deferred storage using specified shared input file system
//! @param theShape [in] shape to load triangulations
//! @param theTriangulationIdx [in] index defining what triangulation should be loaded. Starts from 0.
//! -1 is used in specific case to load currently already active triangulation.
//! If some face doesn't contain triangulation with this index, nothing will be loaded for it.
//! Exception will be thrown in case of invalid negative index
//! @param theToSetAsActive [in] flag to activate triangulation after its loading
//! @param theFileSystem [in] shared file system
//! @return TRUE if at least one triangulation is loaded.
Standard_EXPORT static Standard_Boolean LoadTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx = -1,
const Standard_Boolean theToSetAsActive = Standard_False,
const Handle(OSD_FileSystem)& theFileSystem = Handle(OSD_FileSystem)());
//! Releases triangulation data for each face of the shape if there is deferred storage to load it later
//! @param theShape [in] shape to unload triangulations
//! @param theTriangulationIdx [in] index defining what triangulation should be unloaded. Starts from 0.
//! -1 is used in specific case to unload currently already active triangulation.
//! If some face doesn't contain triangulation with this index, nothing will be unloaded for it.
//! Exception will be thrown in case of invalid negative index
//! @return TRUE if at least one triangulation is unloaded.
Standard_EXPORT static Standard_Boolean UnloadTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx = -1);
//! Activates triangulation data for each face of the shape
//! from some deferred storage using specified shared input file system
//! @param theShape [in] shape to activate triangulations
//! @param theTriangulationIdx [in] index defining what triangulation should be activated. Starts from 0.
//! Exception will be thrown in case of invalid negative index
//! @param theToActivateStrictly [in] flag to activate exactly triangulation with defined theTriangulationIdx index.
//! In TRUE case if some face doesn't contain triangulation with this index, active triangulation
//! will not be changed for it. Else the last available triangulation will be activated.
//! @return TRUE if at least one active triangulation was changed.
Standard_EXPORT static Standard_Boolean ActivateTriangulation (const TopoDS_Shape& theShape,
const Standard_Integer theTriangulationIdx,
const Standard_Boolean theToActivateStrictly = false);
//! Loads all available triangulations for each face of the shape
//! from some deferred storage using specified shared input file system
//! @param theShape [in] shape to load triangulations
//! @param theFileSystem [in] shared file system
//! @return TRUE if at least one triangulation is loaded.
Standard_EXPORT static Standard_Boolean LoadAllTriangulations (const TopoDS_Shape& theShape,
const Handle(OSD_FileSystem)& theFileSystem = Handle(OSD_FileSystem)());
//! Releases all available triangulations for each face of the shape if there is deferred storage to load them later
//! @param theShape [in] shape to unload triangulations
//! @return TRUE if at least one triangulation is unloaded.
Standard_EXPORT static Standard_Boolean UnloadAllTriangulations (const TopoDS_Shape& theShape);
public:
//! Returns True if the distance between the two
//! vertices is lower than their tolerance.
Standard_EXPORT static Standard_Boolean Compare (const TopoDS_Vertex& V1, const TopoDS_Vertex& V2);

View File

@@ -2062,18 +2062,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
}
// declaration for plate
//GeomPlate_BuildPlateSurface PSurf(3,10,3,tol2d,tolesp,angular);
//
//Sence of Plate parameters and their preferable values :
// degree is total order of ordinary or mixed derivatives:
// dS/dU, dS/dV have degree 1, d2S/dU2, d2S/dV2, d2S/(dUdV) have degree 2
// nbiter - number of iterations, when surface from previous iteration uses as initial surface for next one
// practically this process does not converge, using "bad" initial surface leads to much more "bad" solution.
// constr is order of constraint: 0 - G0, 1 - G1 ...
// Using constraint order > 0 very often causes unpredicable undulations of solution
Standard_Integer degree = 3, nbcurvpnt = 10, nbiter = 1;
Standard_Integer constr = 1; //G1
GeomPlate_BuildPlateSurface PSurf(degree, nbcurvpnt, nbiter, tol2d, tolesp, angular);
GeomPlate_BuildPlateSurface PSurf(3,10,3,tol2d,tolesp,angular);
// calculation of curves on surface for each stripe
for (ic=0;ic<nedge;ic++) {
gp_Pnt2d p2d1, p2d2;
@@ -2098,10 +2088,9 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex,
Adaptor3d_CurveOnSurface CurvOnS (Acurv,Asurf);
Handle(Adaptor3d_CurveOnSurface) HCons =
new Adaptor3d_CurveOnSurface(CurvOnS);
//Order.SetValue(ic,1);
Order.SetValue(ic, constr);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(ic), nbcurvpnt,tolesp,angular,0.1);
Order.SetValue(ic,1);
Handle(GeomPlate_CurveConstraint) Cont =
new GeomPlate_CurveConstraint(HCons,Order.Value(ic),10,tolesp,angular,0.1);
PSurf.Add(Cont);
// calculate indexes of points and of the curve for the DS

View File

@@ -245,7 +245,6 @@ Standard_Boolean D3DHost_FrameBuffer::registerD3dBuffer (const Handle(OpenGl_Con
return Standard_False;
}
myIsOwnColor = true;
myColorTextures (0)->Release (theCtx.operator->());
myColorTextures (0)->Create (theCtx);

View File

@@ -1,39 +0,0 @@
// Copyright (c) 2021 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.
#include <D3DHost_GraphicDriverFactory.hxx>
#include <D3DHost_GraphicDriver.hxx>
IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriverFactory, OpenGl_GraphicDriverFactory)
// =======================================================================
// function : D3DHost_GraphicDriverFactory
// purpose :
// =======================================================================
D3DHost_GraphicDriverFactory::D3DHost_GraphicDriverFactory()
{
myName = "TKD3DHost";
}
// =======================================================================
// function : CreateDriver
// purpose :
// =======================================================================
Handle(Graphic3d_GraphicDriver) D3DHost_GraphicDriverFactory::CreateDriver (const Handle(Aspect_DisplayConnection)& )
{
Handle(D3DHost_GraphicDriver) aDriver = new D3DHost_GraphicDriver();
aDriver->ChangeOptions() = *myDefaultCaps;
aDriver->InitContext();
return aDriver;
}

View File

@@ -1,33 +0,0 @@
// Copyright (c) 2021 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.
#ifndef _D3DHost_GraphicDriverFactory_Header
#define _D3DHost_GraphicDriverFactory_Header
#include <OpenGl_GraphicDriverFactory.hxx>
//! This class for creation of D3DHost_GraphicDriver.
class D3DHost_GraphicDriverFactory : public OpenGl_GraphicDriverFactory
{
DEFINE_STANDARD_RTTIEXT(D3DHost_GraphicDriverFactory, OpenGl_GraphicDriverFactory)
public:
//! Empty constructor.
Standard_EXPORT D3DHost_GraphicDriverFactory();
//! Creates new empty graphic driver.
Standard_EXPORT virtual Handle(Graphic3d_GraphicDriver) CreateDriver (const Handle(Aspect_DisplayConnection)& theDisp) Standard_OVERRIDE;
};
#endif //_D3DHost_GraphicDriverFactory_Header

View File

@@ -87,7 +87,11 @@ D3DHost_View::D3DHost_View (const Handle(Graphic3d_StructureManager)& theMgr,
// =======================================================================
D3DHost_View::~D3DHost_View()
{
ReleaseGlResources (NULL);
if (!myD3dWglFbo.IsNull())
{
myD3dWglFbo->Release (myWorkspace->GetGlContext().operator->());
myD3dWglFbo.Nullify();
}
if (myD3dDevice != NULL)
{
myD3dDevice->Release();
@@ -100,20 +104,6 @@ D3DHost_View::~D3DHost_View()
}
}
// =======================================================================
// function : ReleaseGlResources
// purpose :
// =======================================================================
void D3DHost_View::ReleaseGlResources (const Handle(OpenGl_Context)& theCtx)
{
if (!myD3dWglFbo.IsNull())
{
myD3dWglFbo->Release (theCtx.get());
myD3dWglFbo.Nullify();
}
OpenGl_View::ReleaseGlResources (theCtx);
}
// =======================================================================
// function : D3dColorSurface
// purpose :

View File

@@ -40,9 +40,6 @@ public:
//! Default destructor.
Standard_EXPORT virtual ~D3DHost_View();
//! Release OpenGL resources.
Standard_EXPORT virtual void ReleaseGlResources (const Handle(OpenGl_Context)& theCtx) Standard_OVERRIDE;
//! Creates and maps rendering window to the view.
//! @param theWindow [in] the window.
//! @param theContext [in] the rendering context. If NULL the context will be created internally.

View File

@@ -1,7 +1,5 @@
D3DHost_GraphicDriver.hxx
D3DHost_GraphicDriver.cxx
D3DHost_GraphicDriverFactory.hxx
D3DHost_GraphicDriverFactory.cxx
D3DHost_FrameBuffer.hxx
D3DHost_FrameBuffer.cxx
D3DHost_View.hxx

View File

@@ -1,33 +0,0 @@
// Copyright (c) 2021 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.
#include <D3DHostTest.hxx>
#include <Draw_PluginMacro.hxx>
#include <D3DHost_GraphicDriverFactory.hxx>
// ======================================================================
// function : Factory
// purpose :
// ======================================================================
void D3DHostTest::Factory (Draw_Interpretor& )
{
static const Handle(D3DHost_GraphicDriverFactory) aFactory = new D3DHost_GraphicDriverFactory();
Graphic3d_GraphicDriverFactory::RegisterFactory (aFactory);
#ifdef DEB
theDI << "Draw Plugin : D3DHost commands are loaded.\n";
#endif
}
// Declare entry point PLUGINFACTORY
DPLUGIN(D3DHostTest)

View File

@@ -1,2 +0,0 @@
D3DHostTest.cxx
D3DHostTest.hxx

View File

@@ -358,11 +358,10 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
#else
di << "FFmpeg disabled\n";
#endif
#ifdef HAVE_OPENGL_EXT
di << "OpenGL: enabled (HAVE_OPENGL_EXT)\n";
#endif
#ifdef HAVE_GLES2_EXT
di << "OpenGL ES: enabled (HAVE_GLES2_EXT)\n";
#ifdef HAVE_GLES2
di << "OpenGL: ES2\n";
#else
di << "OpenGL: desktop\n";
#endif
#ifdef HAVE_OPENVR
di << "OpenVR enabled (HAVE_OPENVR)\n";

View File

@@ -934,12 +934,6 @@ help checktrinfo {
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.
@@ -967,8 +961,6 @@ proc checktrinfo {shape args} {
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
@@ -981,9 +973,7 @@ proc checktrinfo {shape args} {
set max_defl -1
set ref_info ""
set options {{"-face" ref_nb_faces ?}
{"-empty" ref_nb_empty_faces ?}
{"-tri" ref_nb_triangles ?}
set options {{"-tri" ref_nb_triangles ?}
{"-nod" ref_nb_nodes ?}
{"-defl" ref_deflection ?}
{"-tol_abs_defl" tol_abs_defl 1}
@@ -997,52 +987,20 @@ proc checktrinfo {shape args} {
_check_args ${args} ${options} "checktrinfo"
# get current number of faces, triangles and nodes, value of max deflection
# get current number of 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.*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]} {
set triinfo_pattern "(\[0-9\]+) +triangles.*\[^0-9]\(\[0-9\]+) +nodes.*deflection +(\[-0-9.+eE\]+)"
if {![regexp "${triinfo_pattern}" ${tri_info} dump 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]} {
if {![regexp "${triinfo_pattern}" ${ref_info} dump 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} } {

View File

@@ -42,11 +42,6 @@ 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

View File

@@ -1118,7 +1118,7 @@ proc testfile {filelist} {
# warn if shape contains triangulation
pload MODELING
if { "$format" != "STL" &&
[regexp {([0-9]+)\s+triangles} [uplevel trinfo a] res nbtriangles] &&
[regexp {contains\s+([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!"
@@ -1145,7 +1145,7 @@ proc testfile {filelist} {
file mkdir $tmpdir/$dir
# make snapshot
pload VISUALIZATION
pload AISV
uplevel vdisplay a
uplevel vsetdispmode 1
uplevel vfit

View File

@@ -82,22 +82,6 @@ public:
//! Return the Nth extremum on S.
Standard_EXPORT const Extrema_POnSurf& PointOnSurface (const Standard_Integer N) const;
//! Change Sequence of SquareDistance
TColStd_SequenceOfReal& SquareDistances()
{
return mySqDist;
}
//! Change Sequence of PointOnCurv
Extrema_SequenceOfPOnCurv& PointsOnCurve()
{
return myPoint1;
}
//! Change Sequence of PointOnSurf
Extrema_SequenceOfPOnSurf& PointsOnSurf()
{
return myPoint2;
}
private:
const Adaptor3d_Curve* myC;

View File

@@ -107,8 +107,8 @@ Standard_Boolean Extrema_FuncPSDist::IsInside(const math_Vector& X)
{
if (X(1) < mySurf.FirstUParameter() ||
X(1) > mySurf.LastUParameter() ||
X(2) < mySurf.FirstVParameter() ||
X(2) > mySurf.LastVParameter() )
X(2) < mySurf.FirstUParameter() ||
X(2) > mySurf.LastUParameter() )
{
// Point out of borders.
return Standard_False;

View File

@@ -304,83 +304,33 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C,
Tol(2) = mytol2;
Tol(3) = mytol2;
//
TUVinf(1) = mytmin;
TUVinf(2) = trimumin;
TUVinf(3) = trimvmin;
//
TUVsup(1) = mytsup;
TUVsup(2) = trimusup;
TUVsup(3) = trimvsup;
//
// Number of particles used in PSO algorithm (particle swarm optimization).
const Standard_Integer aNbParticles = 48;
Standard_Integer aNbIntC = 1;
if (C.IsClosed() || C.IsPeriodic())
//
if (aNbVar == 3)
{
Standard_Real aPeriod = C.Period();
if (C.LastParameter() - C.FirstParameter() > 2. * aPeriod / 3.)
{
aNbIntC = 2;
}
GlobMinGenCS(C, aNbParticles, TUVinf, TUVsup, TUV);
}
else if (aNbVar == 2)
{
GlobMinConicS(C, aNbParticles, TUVinf, TUVsup, TUV);
}
else
{
GlobMinCQuadric(C, aNbParticles, TUVinf, TUVsup, TUV);
}
Standard_Integer anInt;
Standard_Real dT = (mytsup - mytmin) / aNbIntC;
for (anInt = 1; anInt <= aNbIntC; anInt++)
{
TUVinf(1) = mytmin + (anInt - 1) * dT;
TUVinf(2) = trimumin;
TUVinf(3) = trimvmin;
//
TUVsup(1) = TUVinf(1) + dT; // mytsup;
TUVsup(2) = trimusup;
TUVsup(3) = trimvsup;
//
if (aNbVar == 3)
{
GlobMinGenCS(C, aNbParticles, TUVinf, TUVsup, TUV);
}
else if (aNbVar == 2)
{
GlobMinConicS(C, aNbParticles, TUVinf, TUVsup, TUV);
}
else
{
GlobMinCQuadric(C, aNbParticles, TUVinf, TUVsup, TUV);
}
// Find min approximation
math_FunctionSetRoot anA(myF, Tol);
anA.Perform(myF, TUV, TUVinf, TUVsup);
}
if (aNbIntC > 1 && myF.NbExt() > 1)
{
//Try to remove "false" extrema caused by dividing curve interval
TColStd_SequenceOfReal& aSqDists = myF.SquareDistances();
Extrema_SequenceOfPOnCurv& aPntsOnCrv = myF.PointsOnCurve();
Extrema_SequenceOfPOnSurf& aPntsOnSurf = myF.PointsOnSurf();
TColStd_SequenceOfReal aSqDists1(aSqDists);
Extrema_SequenceOfPOnCurv aPntsOnCrv1(aPntsOnCrv);
Extrema_SequenceOfPOnSurf aPntsOnSurf1(aPntsOnSurf);
Standard_Real aMinDist = aSqDists(1);
Standard_Integer i;
for (i = 2; i <= aSqDists.Length(); ++i)
{
Standard_Real aDist = aSqDists(i);
if (aDist < aMinDist)
{
aMinDist = aDist;
}
}
aSqDists.Clear();
aPntsOnCrv.Clear();
aPntsOnSurf.Clear();
Standard_Real aTol = Precision::SquareConfusion();
for (i = 1; i <= aSqDists1.Length(); ++i)
{
Standard_Real aDist = aSqDists1(i);
if (Abs(aDist - aMinDist) <= aTol)
{
aSqDists.Append(aDist);
aPntsOnCrv.Append(aPntsOnCrv1(i));
aPntsOnSurf.Append(aPntsOnSurf1(i));
}
}
}
// Find min approximation
math_FunctionSetRoot anA(myF, Tol);
anA.Perform(myF, TUV, TUVinf, TUVsup);
myDone = Standard_True;
}

View File

@@ -23,84 +23,10 @@
#include <Extrema_POnSurf.hxx>
#include <gp_Pnt.hxx>
#include <math_FunctionSetRoot.hxx>
#include <math_NewtonFunctionSetRoot.hxx>
#include <math_BFGS.hxx>
#include <math_BFGS.hxx>
#include <math_FRPR.hxx>
#include <math_Vector.hxx>
#include <StdFail_NotDone.hxx>
static void CorrectTol(const Standard_Real theU0, const Standard_Real theV0,
math_Vector& theTol)
{
//Correct tolerance for large values of UV parameters
Standard_Real aTolRef = Precision::PConfusion();
Standard_Real anEpsRef = Epsilon(1.);
Standard_Real epsu = Epsilon(theU0);
const Standard_Real tolog10 = 0.43429;
if (epsu > anEpsRef)
{
Standard_Integer n = RealToInt(tolog10 * Log(epsu / anEpsRef) + 1) + 1;
Standard_Integer i;
Standard_Real tol = aTolRef;
for (i = 1; i <= n; ++i)
{
tol *= 10.;
}
theTol(1) = Max(theTol(1), tol);
}
Standard_Real epsv = Epsilon(theV0);
if (epsv > anEpsRef)
{
Standard_Integer n = RealToInt(tolog10 * Log(epsv / anEpsRef) + 1) + 1;
Standard_Integer i;
Standard_Real tol = aTolRef;
for (i = 1; i <= n; ++i)
{
tol *= 10.;
}
theTol(2) = Max(theTol(2), tol);
}
}
//=======================================================================
//function : IsMinDist
//purpose :
//=======================================================================
Standard_Boolean Extrema_GenLocateExtPS::IsMinDist(const gp_Pnt& theP, const Adaptor3d_Surface& theS,
const Standard_Real theU0, const Standard_Real theV0)
{
Standard_Real du = Max(theS.UResolution(10.*Precision::Confusion()), 10.*Precision::PConfusion());
Standard_Real dv = Max(theS.VResolution(10.*Precision::Confusion()), 10.*Precision::PConfusion());
Standard_Real u, v;
gp_Pnt aP0 = theS.Value(theU0, theV0);
Standard_Real d0 = theP.SquareDistance(aP0);
Standard_Integer iu, iv;
for (iu = -1; iu <= 1; ++iu)
{
u = theU0 + iu * du;
if (!theS.IsUPeriodic())
{
u = Max(u, theS.FirstUParameter());
u = Min(u, theS.LastUParameter());
}
for (iv = -1; iv <= 1; ++iv)
{
if (iu == 0 && iv == 0)
continue;
v = theV0 + iv * dv;
if (!theS.IsVPeriodic())
{
v = Max(v, theS.FirstVParameter());
v = Min(v, theS.LastVParameter());
}
Standard_Real d = theP.SquareDistance(theS.Value(u, v));
if (d < d0)
return Standard_False;
}
}
return Standard_True;
}
//=======================================================================
//function : Extrema_GenLocateExtPS
//purpose :
@@ -143,84 +69,36 @@ void Extrema_GenLocateExtPS::Perform(const gp_Pnt& theP,
aBoundSup(1) = mySurf.LastUParameter();
aBoundSup(2) = mySurf.LastVParameter();
if (isDistanceCriteria)
if (isDistanceCriteria == Standard_False)
{
// Distance criteria.
Standard_Real aRelTol = 1.e-8;
math_Vector aResPnt(1, 2);
// Normal projection criteria.
Extrema_FuncPSNorm F(theP,mySurf);
Extrema_FuncPSDist F(mySurf, theP);
math_FunctionSetRoot SR (F, aTol);
SR.Perform(F, aStart, aBoundInf, aBoundSup);
if (!SR.IsDone())
return;
math_BFGS aSolver(2, aRelTol);
aSolver.Perform(F, aStart);
if (!aSolver.IsDone())
{
//Try another method
math_FRPR aSolver1(F, aRelTol);
aSolver1.Perform(F, aStart);
if(!aSolver1.IsDone())
return;
aSolver1.Location(aResPnt);
mySqDist = aSolver1.Minimum();
}
else
{
aSolver.Location(aResPnt);
mySqDist = aSolver.Minimum();
}
myPoint.SetParameters(aResPnt(1), aResPnt(2), mySurf.Value(aResPnt(1), aResPnt(2)));
mySqDist = F.SquareDistance(1);
myPoint = F.Point(1);
myDone = Standard_True;
}
else
{
// Normal projection criteria.
Extrema_FuncPSNorm F(theP, mySurf);
// Distance criteria.
Extrema_FuncPSDist F(mySurf, theP);
math_BFGS aSolver(2);
aSolver.Perform(F, aStart);
if (mySurf.GetType() == GeomAbs_BSplineSurface)
{
aTol(1) = myTolU;
aTol(2) = myTolV;
CorrectTol(theU0, theV0, aTol);
}
if (!aSolver.IsDone())
return;
Standard_Boolean isCorrectTol = (Abs(aTol(1) - myTolU) > Precision::PConfusion() ||
Abs(aTol(2) - myTolV) > Precision::PConfusion());
math_FunctionSetRoot aSR(F, aTol);
aSR.Perform(F, aStart, aBoundInf, aBoundSup);
if (!aSR.IsDone() || isCorrectTol)
{
if (isCorrectTol)
{
aTol(1) = myTolU;
aTol(2) = myTolV;
}
math_NewtonFunctionSetRoot aNSR(F, aTol, Precision::Confusion());
aNSR.Perform(F, aStart, aBoundInf, aBoundSup);
if (!aSR.IsDone() && !aNSR.IsDone())
{
return;
}
}
Standard_Real aNbExt = F.NbExt();
mySqDist = F.SquareDistance(1);
myPoint = F.Point(1);
Standard_Integer i;
for (i = 2; i <= aNbExt; ++i)
{
if (F.SquareDistance(i) < mySqDist)
{
mySqDist = F.SquareDistance(i);
myPoint = F.Point(i);
}
}
math_Vector aResPnt(1,2);
aSolver.Location(aResPnt);
mySqDist = aSolver.Minimum();
myPoint.SetParameters(aResPnt(1), aResPnt(2), mySurf.Value(aResPnt(1), aResPnt(2)));
myDone = Standard_True;
}
}
//=======================================================================

View File

@@ -63,11 +63,6 @@ public:
//! Returns the point of the extremum distance.
Standard_EXPORT const Extrema_POnSurf& Point() const;
//! Returns True if UV point theU0, theV0 is point of local minimum of square distance between
//! point theP and points theS(U, V), U, V are in small area around theU0, theV0
Standard_EXPORT static Standard_Boolean IsMinDist(const gp_Pnt& theP, const Adaptor3d_Surface& theS,
const Standard_Real theU0, const Standard_Real theV0);
private:
const Extrema_GenLocateExtPS& operator=(const Extrema_GenLocateExtPS&);

View File

@@ -136,7 +136,7 @@ static Standard_Integer proj (Draw_Interpretor& di, Standard_Integer n, const ch
const gp_XY aP2d(Draw::Atof(a[5]), Draw::Atof(a[6]));
GeomAdaptor_Surface aGAS(GS);
Extrema_GenLocateExtPS aProjector(aGAS, Precision::PConfusion(), Precision::PConfusion());
aProjector.Perform(P, aP2d.X(), aP2d.Y(), Standard_False);
aProjector.Perform(P, aP2d.X(), aP2d.Y());
if (!aProjector.IsDone())
{
di << "projection failed.";

View File

@@ -48,6 +48,7 @@ Graphic3d_ClipPlane.cxx
Graphic3d_ClipPlane.hxx
Graphic3d_CStructure.cxx
Graphic3d_CStructure.hxx
Graphic3d_CTexture.hxx
Graphic3d_CubeMap.cxx
Graphic3d_CubeMap.hxx
Graphic3d_CubeMapOrder.cxx
@@ -73,14 +74,13 @@ Graphic3d_FrameStatsTimer.hxx
Graphic3d_GraduatedTrihedron.hxx
Graphic3d_GraphicDriver.cxx
Graphic3d_GraphicDriver.hxx
Graphic3d_GraphicDriverFactory.cxx
Graphic3d_GraphicDriverFactory.hxx
Graphic3d_Group.cxx
Graphic3d_Group.hxx
Graphic3d_GroupAspect.hxx
Graphic3d_GroupDefinitionError.hxx
Graphic3d_HatchStyle.hxx
Graphic3d_HatchStyle.cxx
Graphic3d_HighlightStyle.hxx
Graphic3d_PresentationAttributes.hxx
Graphic3d_PresentationAttributes.cxx
Graphic3d_HorizontalTextAlignment.hxx
@@ -93,6 +93,7 @@ Graphic3d_MapOfAspectsToAspects.hxx
Graphic3d_MapIteratorOfMapOfStructure.hxx
Graphic3d_MapOfObject.hxx
Graphic3d_MapOfStructure.hxx
Graphic3d_MapOfZLayerSettings.hxx
Graphic3d_MarkerImage.cxx
Graphic3d_MarkerImage.hxx
Graphic3d_MarkerImage.pxx
@@ -171,6 +172,7 @@ Graphic3d_TextureSet.cxx
Graphic3d_TextureSet.hxx
Graphic3d_TextureSetBits.hxx
Graphic3d_ToneMappingMethod.hxx
Graphic3d_TransformError.hxx
Graphic3d_TransformPers.hxx
Graphic3d_TransformPers.cxx
Graphic3d_TransformUtils.hxx
@@ -178,6 +180,7 @@ Graphic3d_TransModeFlags.hxx
Graphic3d_TypeOfAnswer.hxx
Graphic3d_TypeOfBackfacingModel.hxx
Graphic3d_TypeOfBackground.hxx
Graphic3d_TypeOfComposition.hxx
Graphic3d_TypeOfConnection.hxx
Graphic3d_TypeOfLightSource.hxx
Graphic3d_TypeOfLimit.hxx

View File

@@ -20,6 +20,7 @@
#include <Graphic3d_PresentationAttributes.hxx>
#include <Graphic3d_SequenceOfGroup.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Graphic3d_TypeOfComposition.hxx>
#include <Graphic3d_ViewAffinity.hxx>
#include <Graphic3d_TransformPers.hxx>
#include <Graphic3d_Vec3.hxx>

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021 OPEN CASCADE SAS
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -11,23 +11,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _OpenGlTest_HeaderFile
#define _OpenGlTest_HeaderFile
#ifndef _Graphic3d_CTexture_HeaderFile
#define _Graphic3d_CTexture_HeaderFile
#include <Draw_Interpretor.hxx>
#include <Graphic3d_TextureMap.hxx>
//! This package defines a set of Draw commands for testing of TKOpenGl library.
class OpenGlTest
class Graphic3d_CTexture
{
public:
DEFINE_STANDARD_ALLOC
Graphic3d_CTexture()
: doTextureMap (0)
{
//
}
//! Adds Draw commands to the draw interpretor.
Standard_EXPORT static void Commands (Draw_Interpretor& theDI);
public:
Handle(Graphic3d_TextureMap) TextureMap; //!< handle to texture
int doTextureMap; //!< flag indicates to use texture or not
//! Plugin entry point function.
Standard_EXPORT static void Factory (Draw_Interpretor& theDI);
};
#endif // _OpenGlTest_HeaderFile
#endif // Graphic3d_CTexture_HeaderFile

View File

@@ -32,6 +32,7 @@ Graphic3d_CView::Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theM
myIsInComputedMode (Standard_False),
myIsActive (Standard_False),
myIsRemoved (Standard_False),
myShadingModel (Graphic3d_TOSM_FRAGMENT),
myBackfacing (Graphic3d_TypeOfBackfacingModel_Auto),
myVisualization (Graphic3d_TOV_WIREFRAME),
myUnitFactor (1.0)
@@ -1097,7 +1098,7 @@ void Graphic3d_CView::SetShadingModel (Graphic3d_TypeOfShadingModel theModel)
throw Standard_ProgramError ("Graphic3d_CView::SetShadingModel() - attempt to set invalid Shading Model!");
}
myRenderParams.ShadingModel = theModel;
myShadingModel = theModel;
}
// =======================================================================
@@ -1440,6 +1441,7 @@ void Graphic3d_CView::DumpJson (Standard_OStream& theOStream, Standard_Integer t
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackXRCamera.get())

View File

@@ -100,7 +100,7 @@ public:
public:
//! Returns default Shading Model of the view; Graphic3d_TOSM_FRAGMENT by default.
Graphic3d_TypeOfShadingModel ShadingModel() const { return myRenderParams.ShadingModel; }
Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; }
//! Sets default Shading Model of the view.
//! Will throw an exception on attempt to set Graphic3d_TOSM_DEFAULT.
@@ -570,6 +570,7 @@ protected:
Standard_Boolean myIsInComputedMode;
Standard_Boolean myIsActive;
Standard_Boolean myIsRemoved;
Graphic3d_TypeOfShadingModel myShadingModel;
Graphic3d_TypeOfBackfacingModel myBackfacing;
Graphic3d_TypeOfVisualization myVisualization;

View File

@@ -17,21 +17,47 @@
#ifndef _Graphic3d_GraphicDriver_HeaderFile
#define _Graphic3d_GraphicDriver_HeaderFile
#include <Aspect_GenId.hxx>
#include <Graphic3d_Vec3.hxx>
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Transient.hxx>
#include <Graphic3d_CView.hxx>
#include <Graphic3d_CStructure.hxx>
#include <Aspect_GradientFillMethod.hxx>
#include <Standard_CString.hxx>
#include <Aspect_FillMethod.hxx>
#include <Standard_Size.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Standard_Real.hxx>
#include <Aspect_TypeOfTriedronPosition.hxx>
#include <Graphic3d_GraduatedTrihedron.hxx>
#include <Graphic3d_Vec3.hxx>
#include <Standard_ShortReal.hxx>
#include <Standard_Address.hxx>
#include <Image_PixMap.hxx>
#include <Graphic3d_BufferType.hxx>
#include <Aspect_GenId.hxx>
#include <Aspect_Handle.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Graphic3d_ZLayerSettings.hxx>
#include <Graphic3d_MapOfZLayerSettings.hxx>
#include <Graphic3d_CLight.hxx>
#include <Graphic3d_TypeOfLimit.hxx>
#include <Standard_CString.hxx>
#include <Standard_Size.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
class Aspect_DisplayConnection;
class Aspect_Window;
class Graphic3d_CView;
class Graphic3d_GraphicDriver;
class Graphic3d_Layer;
class Graphic3d_TransformError;
class Graphic3d_Structure;
class Graphic3d_StructureManager;
class Graphic3d_ViewManager;
class Quantity_Color;
class TCollection_AsciiString;
DEFINE_STANDARD_HANDLE(Graphic3d_GraphicDriver, Standard_Transient)
@@ -69,14 +95,8 @@ public:
//! Removes view from graphic driver and releases its resources.
virtual void RemoveView (const Handle(Graphic3d_CView)& theView) = 0;
//! enables/disables usage of OpenGL vertex buffer arrays while drawing primitive arrays
//! enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
virtual void EnableVBO (const Standard_Boolean status) = 0;
//! Returns TRUE if vertical synchronization with display refresh rate (VSync) should be used; TRUE by default.
virtual bool IsVerticalSync() const = 0;
//! Set if vertical synchronization with display refresh rate (VSync) should be used.
virtual void SetVerticalSync (bool theToEnable) = 0;
//! Returns information about GPU memory usage.
virtual Standard_Boolean MemoryInfo (Standard_Size& theFreeBytes, TCollection_AsciiString& theInfo) const = 0;

View File

@@ -1,104 +0,0 @@
// Copyright (c) 2021 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.
#include <Graphic3d_GraphicDriverFactory.hxx>
#include <Graphic3d_GraphicDriver.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_GraphicDriverFactory, Standard_Transient)
namespace
{
static Graphic3d_GraphicDriverFactoryList& getDriverFactories()
{
static Graphic3d_GraphicDriverFactoryList TheFactories;
return TheFactories;
}
}
// =======================================================================
// function : DriverFactories
// purpose :
// =======================================================================
const Graphic3d_GraphicDriverFactoryList& Graphic3d_GraphicDriverFactory::DriverFactories()
{
return getDriverFactories();
}
// =======================================================================
// function : RegisterFactory
// purpose :
// =======================================================================
void Graphic3d_GraphicDriverFactory::RegisterFactory (const Handle(Graphic3d_GraphicDriverFactory)& theFactory,
bool theIsPreferred)
{
const TCollection_AsciiString aName = theFactory->Name();
Graphic3d_GraphicDriverFactoryList& aFactories = getDriverFactories();
if (theIsPreferred)
{
UnregisterFactory (aName);
aFactories.Prepend (theFactory);
return;
}
for (Graphic3d_GraphicDriverFactoryList::Iterator anIter (aFactories); anIter.More(); anIter.Next())
{
if (TCollection_AsciiString::IsSameString (anIter.Value()->Name(), aName, false))
{
return;
}
}
aFactories.Append (theFactory);
}
// =======================================================================
// function : UnregisterFactory
// purpose :
// =======================================================================
void Graphic3d_GraphicDriverFactory::UnregisterFactory (const TCollection_AsciiString& theName)
{
Graphic3d_GraphicDriverFactoryList& aFactories = getDriverFactories();
for (Graphic3d_GraphicDriverFactoryList::Iterator anIter (aFactories); anIter.More();)
{
if (TCollection_AsciiString::IsSameString (anIter.Value()->Name(), theName, false))
{
aFactories.Remove (anIter);
}
else
{
anIter.Next();
}
}
}
// =======================================================================
// function : DefaultDriverFactory
// purpose :
// =======================================================================
Handle(Graphic3d_GraphicDriverFactory) Graphic3d_GraphicDriverFactory::DefaultDriverFactory()
{
const Graphic3d_GraphicDriverFactoryList& aMap = getDriverFactories();
return !aMap.IsEmpty()
? aMap.First()
: Handle(Graphic3d_GraphicDriverFactory)();
}
// =======================================================================
// function : Graphic3d_GraphicDriverFactory
// purpose :
// =======================================================================
Graphic3d_GraphicDriverFactory::Graphic3d_GraphicDriverFactory (const TCollection_AsciiString& theName)
: myName (theName)
{
//
}

View File

@@ -1,66 +0,0 @@
// Copyright (c) 2021 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.
#ifndef _Graphic3d_GraphicDriverFactory_HeaderFile
#define _Graphic3d_GraphicDriverFactory_HeaderFile
#include <NCollection_List.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx>
class Aspect_DisplayConnection;
class Graphic3d_GraphicDriver;
class Graphic3d_GraphicDriverFactory;
typedef NCollection_List<Handle(Graphic3d_GraphicDriverFactory)> Graphic3d_GraphicDriverFactoryList;
//! This class for creation of Graphic3d_GraphicDriver.
class Graphic3d_GraphicDriverFactory : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_GraphicDriverFactory, Standard_Transient)
public:
//! Registers factory.
//! @param theFactory [in] factory to register
//! @param theIsPreferred [in] add to the beginning of the list when TRUE, or add to the end otherwise
Standard_EXPORT static void RegisterFactory (const Handle(Graphic3d_GraphicDriverFactory)& theFactory,
bool theIsPreferred = false);
//! Unregisters factory.
Standard_EXPORT static void UnregisterFactory (const TCollection_AsciiString& theName);
//! Return default driver factory or NULL if no one was registered.
Standard_EXPORT static Handle(Graphic3d_GraphicDriverFactory) DefaultDriverFactory();
//! Return the global map of registered driver factories.
Standard_EXPORT static const Graphic3d_GraphicDriverFactoryList& DriverFactories();
public:
//! Creates new empty graphic driver.
virtual Handle(Graphic3d_GraphicDriver) CreateDriver (const Handle(Aspect_DisplayConnection)& theDisp) = 0;
//! Return driver factory name.
const TCollection_AsciiString& Name() const { return myName; }
protected:
//! Empty constructor.
Standard_EXPORT Graphic3d_GraphicDriverFactory (const TCollection_AsciiString& theName);
protected:
TCollection_AsciiString myName;
};
#endif // _Graphic3d_GraphicDriverFactory_HeaderFile

View File

@@ -125,6 +125,9 @@ public:
//! Adds an array of primitives for display
Standard_EXPORT void AddPrimitiveArray (const Handle(Graphic3d_ArrayOfPrimitives)& thePrim, const Standard_Boolean theToEvalMinMax = Standard_True);
//! Creates a primitive array with single marker using AddPrimitiveArray().
Standard_EXPORT void Marker (const Graphic3d_Vertex& thePoint, const Standard_Boolean theToEvalMinMax = Standard_True);
public:
//! sets the stencil test to theIsEnabled state;
@@ -170,9 +173,6 @@ public:
//! @name obsolete methods
public:
Standard_DEPRECATED("Deprecated method Marker(), pass Graphic3d_ArrayOfPoints to AddPrimitiveArray() instead")
Standard_EXPORT void Marker (const Graphic3d_Vertex& thePoint, const Standard_Boolean theToEvalMinMax = Standard_True);
//! Creates the string <AText> at position <APoint>.
//! The 3D point of attachment is projected. The text is
//! written in the plane of projection.

View File

@@ -0,0 +1,22 @@
// Created on: 2016-08-24
// Created by: Varvara POSKONINA
// 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.
#ifndef _Graphic3d_HighlightStyle_HeaderFile
#define _Graphic3d_HighlightStyle_HeaderFile
// header file for deprecated type Graphic3d_HighlightStyle
#include <Prs3d_Drawer.hxx>
#endif // _Graphic3d_HighlightStyle_HeaderFile

View File

@@ -0,0 +1,24 @@
// Copyright (c) 2019 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.
#ifndef _Vulkan_MapOfZLayerSettings_HeaderFile
#define _Vulkan_MapOfZLayerSettings_HeaderFile
#include <Standard_TypeDef.hxx>
#include <NCollection_Map.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Graphic3d_ZLayerSettings.hxx>
typedef NCollection_DataMap<Graphic3d_ZLayerId, Graphic3d_ZLayerSettings> Graphic3d_MapOfZLayerSettings;
#endif // _Vulkan_MapOfZLayerSettings_HeaderFile

View File

@@ -24,7 +24,6 @@
void Graphic3d_RenderingParams::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Method)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, ShadingModel)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, TransparencyMethod)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, LineFeather)

View File

@@ -22,7 +22,6 @@
#include <Graphic3d_RenderingMode.hxx>
#include <Graphic3d_StereoMode.hxx>
#include <Graphic3d_ToneMappingMethod.hxx>
#include <Graphic3d_TypeOfShadingModel.hxx>
#include <Graphic3d_Vec4.hxx>
//! Helper class to store rendering parameters.
@@ -95,7 +94,6 @@ public:
//! Creates default rendering parameters.
Graphic3d_RenderingParams()
: Method (Graphic3d_RM_RASTERIZATION),
ShadingModel (Graphic3d_TOSM_FRAGMENT),
TransparencyMethod (Graphic3d_RTM_BLEND_UNORDERED),
LineFeather (1.0f),
// PBR parameters
@@ -188,7 +186,6 @@ public:
public:
Graphic3d_RenderingMode Method; //!< specifies rendering mode, Graphic3d_RM_RASTERIZATION by default
Graphic3d_TypeOfShadingModel ShadingModel; //!< specified default shading model, Graphic3d_TOSM_FRAGMENT by default
Graphic3d_RenderTransparentMethod TransparencyMethod; //!< specifies rendering method for transparent graphics
Standard_ShortReal LineFeather; //!< line feater width in pixels (> 0.0), 1.0 by default;
//! high values produce blurred results, small values produce sharp (aliased) edges

View File

@@ -107,7 +107,7 @@ const char THE_FUNC_directionalLightFirst[] =
EOL" in bool theIsFront,"
EOL" in float theShadow)"
EOL"{"
EOL" vec3 aLight = occLight_Position (0);"
EOL" vec3 aLight = vec3 (occWorldViewMatrix * vec4 (occLight_Position (0), 0.0));"
EOL
EOL" vec3 aHalf = normalize (aLight + theView);"
EOL
@@ -118,7 +118,7 @@ const char THE_FUNC_directionalLightFirst[] =
EOL" float aSpecl = 0.0;"
EOL" if (aNdotL > 0.0)"
EOL" {"
EOL" aSpecl = pow (aNdotH, occMaterial_Shininess(theIsFront));"
EOL" aSpecl = pow (aNdotH, theIsFront ? occFrontMaterial_Shininess() : occBackMaterial_Shininess());"
EOL" }"
EOL
EOL" Diffuse += occLight_Diffuse(0) * aNdotL * theShadow;"
@@ -1025,8 +1025,10 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramUnlit (Sta
if ((theBits & Graphic3d_ShaderFlags_ClipPlanesN) != 0)
{
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 PositionWorld", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 Position", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aSrcVertExtraMain +=
EOL" PositionWorld = occModelWorldMatrix * occVertex;";
EOL" PositionWorld = occModelWorldMatrix * occVertex;"
EOL" Position = occWorldViewMatrix * PositionWorld;";
if ((theBits & Graphic3d_ShaderFlags_ClipPlanesN) == Graphic3d_ShaderFlags_ClipPlanesN)
{
@@ -1152,7 +1154,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
const Handle(Graphic3d_LightSet)& theLights,
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Boolean theHasEmissive,
Standard_Integer theNbShadowMaps) const
{
TCollection_AsciiString aLightsFunc, aLightsLoop;
@@ -1294,6 +1296,14 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
}
}
TCollection_AsciiString aGetMatAmbient = "theIsFront ? occFrontMaterial_Ambient() : occBackMaterial_Ambient();";
TCollection_AsciiString aGetMatDiffuse = "theIsFront ? occFrontMaterial_Diffuse() : occBackMaterial_Diffuse();";
if (theHasVertColor)
{
aGetMatAmbient = "getVertColor();";
aGetMatDiffuse = "getVertColor();";
}
if (!theIsPBR)
{
return TCollection_AsciiString()
@@ -1311,20 +1321,15 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
EOL" Specular = vec3 (0.0);"
EOL" vec3 aPoint = thePoint.xyz / thePoint.w;"
+ aLightsLoop
+ EOL" vec3 aMatAmbient = occMaterial_Ambient(theIsFront);"
EOL" vec4 aMatDiffuse = occMaterial_Diffuse(theIsFront);"
EOL" vec3 aMatSpecular = occMaterial_Specular(theIsFront);"
EOL" vec4 aColor = vec4(Ambient * aMatAmbient + Diffuse * aMatDiffuse.rgb + Specular * aMatSpecular, aMatDiffuse.a);"
+ (theHasVertColor ?
EOL" aColor *= getVertColor();" : "")
+ (theHasTexColor ?
EOL"#if defined(THE_HAS_TEXTURE_COLOR) && defined(FRAGMENT_SHADER)"
EOL" aColor *= occTexture2D(occSamplerBaseColor, TexCoord.st / TexCoord.w);"
EOL"#endif" : "")
+ EOL" occMaterialOcclusion(aColor.rgb, TexCoord.st / TexCoord.w);"
EOL" vec3 aMatEmission = occMaterialEmission(theIsFront, TexCoord.st / TexCoord.w);"
EOL" aColor.rgb += aMatEmission.rgb;"
EOL" return aColor;"
+ EOL" vec4 aMatAmbient = " + aGetMatAmbient
+ EOL" vec4 aMatDiffuse = " + aGetMatDiffuse
+ EOL" vec4 aMatSpecular = theIsFront ? occFrontMaterial_Specular() : occBackMaterial_Specular();"
EOL" vec3 aColor = Ambient * aMatAmbient.rgb + Diffuse * aMatDiffuse.rgb + Specular * aMatSpecular.rgb;"
EOL" occTextureOcclusion(aColor, TexCoord.st);"
+ (theHasEmissive
? EOL" vec4 aMatEmission = theIsFront ? occFrontMaterial_Emission() : occBackMaterial_Emission();"
EOL" aColor += aMatEmission.rgb;" : "")
+ EOL" return vec4 (aColor, aMatDiffuse.a);"
EOL"}";
}
else
@@ -1340,10 +1345,10 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
EOL" in bool theIsFront)"
EOL"{"
EOL" DirectLighting = vec3(0.0);"
EOL" BaseColor = occMaterialBaseColor(theIsFront, TexCoord.st / TexCoord.w)" + (theHasVertColor ? " * getVertColor()" : "") + ";"
+ EOL" Emission = occMaterialEmission(theIsFront, TexCoord.st / TexCoord.w);"
EOL" Metallic = occMaterialMetallic(theIsFront, TexCoord.st / TexCoord.w);"
EOL" NormalizedRoughness = occMaterialRoughness(theIsFront, TexCoord.st / TexCoord.w);"
EOL" BaseColor = " + (theHasVertColor ? "getVertColor();" : "occTextureColor(occPBRMaterial_Color (theIsFront), TexCoord.st / TexCoord.w);")
+ EOL" Emission = occTextureEmissive(occPBRMaterial_Emission (theIsFront), TexCoord.st / TexCoord.w);"
EOL" Metallic = occTextureMetallic(occPBRMaterial_Metallic (theIsFront), TexCoord.st / TexCoord.w);"
EOL" NormalizedRoughness = occTextureRoughness(occPBRMaterial_NormalizedRoughness (theIsFront), TexCoord.st / TexCoord.w);"
EOL" Roughness = occRoughness (NormalizedRoughness);"
EOL" IOR = occPBRMaterial_IOR (theIsFront);"
EOL" vec3 aPoint = thePoint.xyz / thePoint.w;"
@@ -1360,7 +1365,7 @@ TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting (Standard_In
EOL" anIndirectLightingDiff *= occDiffIBLMap (theNormal).rgb;"
EOL" aColor += occLightAmbient.rgb * (anIndirectLightingDiff + anIndirectLightingSpec);"
EOL" aColor += Emission;"
EOL" occMaterialOcclusion(aColor, TexCoord.st / TexCoord.w);"
EOL" occTextureOcclusion(aColor, TexCoord.st / TexCoord.w);"
EOL" return vec4 (aColor, mix(1.0, BaseColor.a, aRefractionCoeff.x));"
EOL"}";
}
@@ -1378,7 +1383,7 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
TCollection_AsciiString aSrcFrag, aSrcFragExtraMain;
TCollection_AsciiString aSrcFragGetColor = EOL"vec4 getColor(void) { return gl_FrontFacing ? FrontColor : BackColor; }";
Graphic3d_ShaderObject::ShaderVariableList aUniforms, aStageInOuts;
bool toUseTexColor = false;
if ((theBits & Graphic3d_ShaderFlags_IsPoint) != 0)
{
if (mySetPointSize)
@@ -1404,7 +1409,6 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
{
if ((theBits & Graphic3d_ShaderFlags_TextureRGB) != 0)
{
toUseTexColor = true;
aProgramSrc->SetTextureSetBits (Graphic3d_TextureSetBits_BaseColor);
aUniforms .Append (Graphic3d_ShaderObject::ShaderVariable ("sampler2D occSamplerBaseColor", Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 TexCoord", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
@@ -1428,8 +1432,10 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
if ((theBits & Graphic3d_ShaderFlags_ClipPlanesN) != 0)
{
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 PositionWorld", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 Position", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aSrcVertExtraMain +=
EOL" PositionWorld = aPositionWorld;";
EOL" PositionWorld = aPositionWorld;"
EOL" Position = aPosition;";
if ((theBits & Graphic3d_ShaderFlags_ClipPlanesN) == Graphic3d_ShaderFlags_ClipPlanesN)
{
@@ -1466,28 +1472,20 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud (c
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 BackColor", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
Standard_Integer aNbLights = 0;
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcVertColor.IsEmpty(), false, toUseTexColor, 0);
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcVertColor.IsEmpty(), false, true, 0);
aSrcVert = TCollection_AsciiString()
+ THE_FUNC_transformNormal_world
+ THE_FUNC_transformNormal_view
+ EOL
+ aSrcVertColor
+ aLights
+ EOL"void main()"
EOL"{"
EOL" vec4 aPositionWorld = occModelWorldMatrix * occVertex;"
EOL" vec4 aPosition = occWorldViewMatrix * aPositionWorld;"
EOL" vec3 aNormal = transformNormal (occNormal);"
EOL" vec3 aView;"
EOL" if (occProjectionMatrix[3][3] == 1.0)"
EOL" {"
EOL" aView = (occWorldViewMatrixInverse * vec4(0.0, 0.0, 1.0, 0.0)).xyz;"
EOL" }"
EOL" else"
EOL" {"
EOL" vec3 anEye = (occWorldViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0)).xyz;"
EOL" aView = normalize (anEye - aPositionWorld.xyz);"
EOL" }"
EOL" FrontColor = computeLighting (aNormal, aView, aPositionWorld, true);"
EOL" BackColor = computeLighting (aNormal, aView, aPositionWorld, false);"
EOL" vec3 aView = vec3 (0.0, 0.0, 1.0);"
EOL" FrontColor = computeLighting (aNormal, aView, aPosition, true);"
EOL" BackColor = computeLighting (aNormal, aView, aPosition, false);"
+ aSrcVertExtraMain
+ THE_VERT_gl_Position
+ EOL"}";
@@ -1530,11 +1528,11 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
const Standard_Boolean theIsPBR,
const Standard_Integer theNbShadowMaps) const
{
TCollection_AsciiString aPosition = theIsPBR ? "PositionWorld" : "Position";
TCollection_AsciiString aPhongCompLight = TCollection_AsciiString() +
"computeLighting (normalize (Normal), normalize (View), PositionWorld, gl_FrontFacing)";
"computeLighting (normalize (Normal), normalize (View), " + aPosition + ", gl_FrontFacing)";
const bool isFlatNormal = theIsFlatNormal && myHasFlatShading;
const char* aDFdxSignReversion = myToReverseDFdxSign ? "-" : "";
bool toUseTexColor = false;
if (isFlatNormal != theIsFlatNormal)
{
Message::SendWarning ("Warning: flat shading requires OpenGL ES 3.0+ or GL_OES_standard_derivatives extension");
@@ -1579,13 +1577,25 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
{
if ((theBits & Graphic3d_ShaderFlags_TextureRGB) != 0)
{
toUseTexColor = true;
aUniforms .Append (Graphic3d_ShaderObject::ShaderVariable ("sampler2D occSamplerBaseColor", Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 TexCoord", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aSrcVertExtraMain += THE_VARY_TexCoord_Trsf;
Standard_Integer aTextureBits = Graphic3d_TextureSetBits_BaseColor | Graphic3d_TextureSetBits_Occlusion | Graphic3d_TextureSetBits_Emissive;
if (theIsPBR)
if (!theIsPBR)
{
aSrcFragGetColor = TCollection_AsciiString() +
EOL"vec4 getColor(void)"
EOL"{"
EOL" vec2 aTexUV = TexCoord.st / TexCoord.w;"
EOL" vec4 aColor = " + aPhongCompLight + ";"
EOL" aColor *= occTexture2D(occSamplerBaseColor, aTexUV);"
EOL" vec3 anEmission = occTextureEmissive((gl_FrontFacing ? occFrontMaterial_Emission() : occBackMaterial_Emission()).rgb, aTexUV);"
EOL" aColor.rgb += anEmission;"
EOL" return aColor;"
EOL"}";
}
else
{
aTextureBits |= Graphic3d_TextureSetBits_MetallicRoughness;
}
@@ -1649,7 +1659,7 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
if (isFlatNormal)
{
aSrcFragExtraMain += TCollection_AsciiString()
+ EOL" Normal = " + aDFdxSignReversion + "normalize (cross (dFdx (PositionWorld.xyz / PositionWorld.w), dFdy (PositionWorld.xyz / PositionWorld.w)));"
+ EOL" Normal = " + aDFdxSignReversion + "normalize (cross (dFdx (" + aPosition + ".xyz / " + aPosition + ".w), dFdy (" + aPosition + ".xyz / " + aPosition + ".w)));"
EOL" if (!gl_FrontFacing) { Normal = -Normal; }";
}
else
@@ -1677,9 +1687,15 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
EOL" }"
EOL"#endif";
}
if (!theIsPBR)
{
aSrcFragExtraMain +=
EOL" Normal = normalize ((occWorldViewMatrixInverseTranspose * vec4 (Normal, 0.0)).xyz);";
}
}
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 PositionWorld", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec4 Position", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
aStageInOuts.Append (Graphic3d_ShaderObject::ShaderVariable ("vec3 View", Graphic3d_TOS_VERTEX | Graphic3d_TOS_FRAGMENT));
if (theNbShadowMaps > 0)
{
@@ -1700,15 +1716,16 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
+ EOL"void main()"
EOL"{"
EOL" PositionWorld = occModelWorldMatrix * occVertex;"
EOL" Position = occWorldViewMatrix * PositionWorld;"
EOL" if (occProjectionMatrix[3][3] == 1.0)"
EOL" {"
EOL" View = (occWorldViewMatrixInverse * vec4(0.0, 0.0, 1.0, 0.0)).xyz;"
EOL" View = vec3(0.0, 0.0, 1.0);"
EOL" }"
EOL" else"
EOL" {"
EOL" vec3 anEye = (occWorldViewMatrixInverse * vec4(0.0, 0.0, 0.0, 1.0)).xyz;"
EOL" View = normalize (anEye - PositionWorld.xyz);"
EOL" View = -Position.xyz;"
EOL" }"
+ (theIsPBR ? EOL" View = (occWorldViewMatrixInverse * vec4(View, 0.0)).xyz;" : "")
+ aSrcVertExtraMain
+ THE_VERT_gl_Position
+ EOL"}";
@@ -1719,8 +1736,10 @@ Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong (con
: EOL"#define getFinalColor getColor";
Standard_Integer aNbLights = 0;
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcFragGetVertColor.IsEmpty(),
theIsPBR, toUseTexColor, theNbShadowMaps);
const TCollection_AsciiString aLights = stdComputeLighting (aNbLights, theLights, !aSrcFragGetVertColor.IsEmpty(), theIsPBR,
(theBits & Graphic3d_ShaderFlags_TextureRGB) == 0
|| (theBits & Graphic3d_ShaderFlags_IsPoint) != 0,
theNbShadowMaps);
aSrcFrag += TCollection_AsciiString()
+ EOL
+ aSrcFragGetVertColor

View File

@@ -197,13 +197,13 @@ protected:
//! @param theLights [in] light sources list
//! @param theHasVertColor [in] flag to use getVertColor() instead of Ambient and Diffuse components of active material
//! @param theIsPBR [in] flag to activate PBR pipeline
//! @param theHasTexColor [in] flag to include color texturing
//! @param theHasEmissive [in] flag to include emissive
//! @param theNbShadowMaps [in] flag to include shadow map
Standard_EXPORT TCollection_AsciiString stdComputeLighting (Standard_Integer& theNbLights,
const Handle(Graphic3d_LightSet)& theLights,
Standard_Boolean theHasVertColor,
Standard_Boolean theIsPBR,
Standard_Boolean theHasTexColor,
Standard_Boolean theHasEmissive,
Standard_Integer theNbShadowMaps) const;
protected:

View File

@@ -25,6 +25,7 @@
#include <Graphic3d_PriorityDefinitionError.hxx>
#include <Graphic3d_StructureDefinitionError.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Graphic3d_TransformError.hxx>
#include <Quantity_Color.hxx>
#include "Graphic3d_Structure.pxx"

View File

@@ -23,10 +23,12 @@
#include <Graphic3d_MapOfStructure.hxx>
#include <Graphic3d_SequenceOfGroup.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Graphic3d_TypeOfComposition.hxx>
#include <Graphic3d_TypeOfConnection.hxx>
#include <Graphic3d_TypeOfStructure.hxx>
#include <Graphic3d_TransformPers.hxx>
#include <Graphic3d_TransModeFlags.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <NCollection_IndexedMap.hxx>

View File

@@ -16,6 +16,7 @@
#include <gp_Ax2.hxx>
#include <Graphic3d_Vertex.hxx>
#include <Font_TextFormatter.hxx>
#include <Graphic3d_HorizontalTextAlignment.hxx>
#include <Graphic3d_VerticalTextAlignment.hxx>

View File

@@ -0,0 +1,37 @@
// Created on: 1993-03-31
// Created by: NW,JPB,CAL
// Copyright (c) 1993-1999 Matra Datavision
// 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.
#ifndef _Graphic3d_TransformError_HeaderFile
#define _Graphic3d_TransformError_HeaderFile
#include <Standard_Type.hxx>
#include <Standard_DefineException.hxx>
#include <Standard_SStream.hxx>
#include <Standard_OutOfRange.hxx>
class Graphic3d_TransformError;
DEFINE_STANDARD_HANDLE(Graphic3d_TransformError, Standard_OutOfRange)
#if !defined No_Exception && !defined No_Graphic3d_TransformError
#define Graphic3d_TransformError_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) throw Graphic3d_TransformError(MESSAGE);
#else
#define Graphic3d_TransformError_Raise_if(CONDITION, MESSAGE)
#endif
DEFINE_STANDARD_EXCEPTION(Graphic3d_TransformError, Standard_OutOfRange)
#endif // _Graphic3d_TransformError_HeaderFile

View File

@@ -1,4 +1,7 @@
// Copyright (c) 2021 OPEN CASCADE SAS
// Created on: 1993-03-31
// Created by: NW,JPB,CAL
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -11,23 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _D3DHostTest_HeaderFile
#define _D3DHostTest_HeaderFile
#ifndef _Graphic3d_TypeOfComposition_HeaderFile
#define _Graphic3d_TypeOfComposition_HeaderFile
#include <Draw_Interpretor.hxx>
//! This package defines a set of Draw commands for testing of TKD3DHost library.
class D3DHostTest
//! To manage the transformation matrices of structures.
enum Graphic3d_TypeOfComposition
{
public:
DEFINE_STANDARD_ALLOC
//! Adds Draw commands to the draw interpretor.
Standard_EXPORT static void Commands (Draw_Interpretor& theDI);
//! Plugin entry point function.
Standard_EXPORT static void Factory (Draw_Interpretor& theDI);
Graphic3d_TOC_REPLACE,
Graphic3d_TOC_POSTCONCATENATE
};
#endif // _D3DHostTest_HeaderFile
#endif // _Graphic3d_TypeOfComposition_HeaderFile

View File

@@ -52,8 +52,6 @@
#include <BRepMesh_MeshAlgoFactory.hxx>
#include <BRepMesh_DelabellaMeshAlgoFactory.hxx>
#include <algorithm>
//epa Memory leaks test
//OAN: for triepoints
#ifdef _WIN32
@@ -430,329 +428,33 @@ static Standard_Integer MemLeakTest(Draw_Interpretor&, Standard_Integer /*nbarg*
return 0;
}
//=======================================================================
//function : TrLateLoad
//purpose :
//=======================================================================
static Standard_Integer TrLateLoad (Draw_Interpretor& theDI, Standard_Integer theNbArgs, const char** theArgVec)
{
if (theNbArgs < 3)
{
theDI << "Syntax error: not enough arguments\n";
return 1;
}
TopoDS_Shape aShape = DBRep::Get (theArgVec[1]);
if (aShape.IsNull())
{
theDI << "Syntax error: '" << theArgVec[1] << "' is not a shape\n";
return 1;
}
for (Standard_Integer anArgIter = 2; anArgIter < theNbArgs; ++anArgIter)
{
TCollection_AsciiString anArgCase(theArgVec[anArgIter]);
anArgCase.LowerCase();
if (anArgCase == "-load")
{
if (anArgIter + 1 < theNbArgs)
{
TCollection_AsciiString aLoadArg(theArgVec[anArgIter + 1]);
aLoadArg.LowerCase();
if (aLoadArg == "all"
|| aLoadArg == "*")
{
// Load all triangulations
anArgIter++;
if (BRepTools::LoadAllTriangulations (aShape))
{
theDI << "All triangulations of shape " << theArgVec[1] << " were loaded\n";
}
continue;
}
if (aLoadArg.IsIntegerValue())
{
// Load defined triangulation
anArgIter++;
Standard_Integer anIndexToLoad = aLoadArg.IntegerValue();
if (anIndexToLoad < -1)
{
Message::SendWarning ("Invalid negative triangulation index to be loaded");
continue;
}
if (BRepTools::LoadTriangulation (aShape, anIndexToLoad))
{
theDI << "The " << anIndexToLoad << " triangulation of shape " << theArgVec[1] << " was loaded\n";
}
continue;
}
}
// Load active triangulation
if (BRepTools::LoadTriangulation (aShape))
{
theDI << "The active triangulation of shape " << theArgVec[1] << " was loaded\n";
}
continue;
}
else if (anArgCase == "-unload")
{
if (anArgIter + 1 < theNbArgs)
{
TCollection_AsciiString anUnloadArg(theArgVec[anArgIter + 1]);
anUnloadArg.LowerCase();
if (anUnloadArg == "all"
|| anUnloadArg == "*")
{
// Unload all triangulations
anArgIter++;
if (BRepTools::UnloadAllTriangulations (aShape))
{
theDI << "All triangulations of shape " << theArgVec[1] << " were unloaded\n";
}
continue;
}
if (anUnloadArg.IsIntegerValue())
{
// Unload defined triangulation
anArgIter++;
Standard_Integer anIndexToUnload = anUnloadArg.IntegerValue();
if (anIndexToUnload < -1)
{
Message::SendWarning ("Invalid negative triangulation index to be unloaded");
continue;
}
if (BRepTools::UnloadTriangulation (aShape, anIndexToUnload))
{
theDI << "The " << anIndexToUnload << " triangulation of shape " << theArgVec[1] << " was unloaded\n";
}
continue;
}
}
// Unload active triangulation
if (BRepTools::UnloadTriangulation (aShape))
{
theDI << "The active triangulation of shape " << theArgVec[1] << " was unloaded\n";
}
continue;
}
else if (anArgIter + 1 < theNbArgs
&& anArgCase == "-activate"
&& TCollection_AsciiString(theArgVec[anArgIter + 1]).IsIntegerValue())
{
Standard_Integer anIndexToActivate = TCollection_AsciiString(theArgVec[++anArgIter]).IntegerValue();
if (anIndexToActivate < 0)
{
Message::SendWarning ("Invalid negative triangulation index to be activated");
continue;
}
if (BRepTools::ActivateTriangulation (aShape, anIndexToActivate, false))
{
theDI << "The " << anIndexToActivate << " triangulation of shape " << theArgVec[1] << " was activated\n";
}
}
else if (anArgIter + 1 < theNbArgs
&& (anArgCase == "-activatestrict" || anArgCase == "-activateexact")
&& TCollection_AsciiString(theArgVec[anArgIter + 1]).IsIntegerValue())
{
Standard_Integer anIndexToActivate = TCollection_AsciiString(theArgVec[++anArgIter]).IntegerValue();
if (anIndexToActivate < 0)
{
Message::SendWarning ("Invalid negative triangulation index to be activated");
continue;
}
if (BRepTools::ActivateTriangulation (aShape, anIndexToActivate, true))
{
theDI << "The " << anIndexToActivate << " triangulation of shape " << theArgVec[1] << " was activated\n";
}
}
else if (anArgCase == "-loadsingle")
{
Standard_Integer anIndexToSingleLoad = -1;
if (anArgIter + 1 < theNbArgs
&& TCollection_AsciiString(theArgVec[anArgIter + 1]).IsIntegerValue())
{
anIndexToSingleLoad = TCollection_AsciiString(theArgVec[++anArgIter]).IntegerValue();
}
if (anIndexToSingleLoad < -1)
{
Message::SendWarning ("Invalid negative triangulation index to be single loaded");
continue;
}
// Unload all triangulations
if (BRepTools::UnloadAllTriangulations (aShape))
{
theDI << "All triangulations of shape " << theArgVec[1] << " were unloaded\n";
}
// Activate required triangulation
if (anIndexToSingleLoad > -1
&& BRepTools::ActivateTriangulation (aShape, anIndexToSingleLoad))
{
theDI << "The " << anIndexToSingleLoad << " triangulation of shape " << theArgVec[1] << " was activated\n";
}
// Load active triangulation
if (BRepTools::LoadTriangulation (aShape))
{
theDI << "The " << anIndexToSingleLoad << " triangulation of shape " << theArgVec[1] << " was loaded\n";
}
continue;
}
else if (anArgCase == "-loadsingleexact" ||
anArgCase == "-loadsinglestrict")
{
Standard_Integer anIndexToSingleLoad = -1;
if (anArgIter + 1 < theNbArgs
&& TCollection_AsciiString(theArgVec[anArgIter + 1]).IsIntegerValue())
{
anIndexToSingleLoad = TCollection_AsciiString(theArgVec[++anArgIter]).IntegerValue();
}
if (anIndexToSingleLoad <= -1)
{
Message::SendWarning ("Invalid negative triangulation index to be single loaded");
continue;
}
// Unload all triangulations
if (BRepTools::UnloadAllTriangulations (aShape))
{
theDI << "All triangulations of shape " << theArgVec[1] << " were unloaded\n";
}
// Load required triangulation
if (BRepTools::LoadTriangulation (aShape, anIndexToSingleLoad, true))
{
theDI << "The " << anIndexToSingleLoad << " triangulation of shape " << theArgVec[1] << " was loaded and activated\n";
}
continue;
}
else
{
theDI << "Syntax error: incorrect arguments";
return 1;
}
}
return 0;
}
//=======================================================================
//function : trianglesinfo
//purpose :
//=======================================================================
static Standard_Integer trianglesinfo (Draw_Interpretor& theDI, Standard_Integer theNbArgs, const char** theArgVec)
static Standard_Integer trianglesinfo(Draw_Interpretor& di, Standard_Integer n, const char** a)
{
if (theNbArgs < 2)
{
Message::SendFail ("Syntax error: not enough arguments");
return 1;
}
TopoDS_Shape aShape = DBRep::Get (theArgVec[1]);
if (aShape.IsNull())
{
theDI << theArgVec[1] << " is not a shape\n";
return 1;
}
if (n != 2) return 1;
TopoDS_Shape S = DBRep::Get(a[1]);
if (S.IsNull()) return 1;
TopExp_Explorer ex;
Handle(Poly_Triangulation) T;
TopLoc_Location L;
struct TriangulationStat
{
TriangulationStat()
: NbFaces (0),
NbEmptyFaces (0),
NbTriangles(0),
NbDeferredFaces (0),
NbUnloadedFaces (0),
NbUnloadedTriangles (0) {}
NCollection_IndexedDataMap<Handle(Standard_Type), Standard_Integer> TypeMap;
Standard_Integer NbFaces;
Standard_Integer NbEmptyFaces;
Standard_Integer NbTriangles;
Standard_Integer NbDeferredFaces;
Standard_Integer NbUnloadedFaces;
Standard_Integer NbUnloadedTriangles;
};
Standard_Boolean toPrintLODs = false;
if (theNbArgs > 2)
{
TCollection_AsciiString anArgCase(theArgVec[2]);
anArgCase.LowerCase();
if (anArgCase == "-lods")
{
toPrintLODs = true;
}
}
TopExp_Explorer anExp;
Handle(Poly_Triangulation) aTriangulation;
TopLoc_Location aLoc;
Standard_Real aMaxDeflection = 0.0;
Standard_Integer aNbFaces = 0, aNbEmptyFaces = 0, aNbTriangles = 0, aNbNodes = 0, aNbRepresentations = 0;
NCollection_IndexedDataMap<Standard_Integer, TriangulationStat> aLODsStat;
NCollection_Vector<Standard_Integer> aNbLODs;
for (anExp.Init (aShape, TopAbs_FACE); anExp.More(); anExp.Next())
{
TopoDS_Face aFace = TopoDS::Face (anExp.Current());
aNbFaces++;
aTriangulation = BRep_Tool::Triangulation (aFace, aLoc);
if (!aTriangulation.IsNull())
{
aNbTriangles += aTriangulation->NbTriangles();
aNbNodes += aTriangulation->NbNodes();
if (aTriangulation->Deflection() > aMaxDeflection)
{
aMaxDeflection = aTriangulation->Deflection();
}
}
else
{
aNbEmptyFaces++;
}
if (toPrintLODs)
{
// Collect LODs information
const Poly_ListOfTriangulation& aLODs = BRep_Tool::Triangulations (aFace, aLoc);
if (aLODs.Size() != 0)
{
aNbLODs.Append (aLODs.Size());
}
Standard_Integer aTriangIndex = 0;
for (Poly_ListOfTriangulation::Iterator anIter(aLODs); anIter.More(); anIter.Next(), ++aTriangIndex)
{
TriangulationStat* aStats = aLODsStat.ChangeSeek (aTriangIndex);
if (aStats == NULL)
{
Standard_Integer aNewIndex = aLODsStat.Add (aTriangIndex, TriangulationStat());
aStats = &aLODsStat.ChangeFromIndex (aNewIndex);
}
aStats->NbFaces++;
const Handle(Poly_Triangulation)& aLOD = anIter.Value();
if (aLOD.IsNull())
{
aStats->NbEmptyFaces++;
continue;
}
Standard_Integer* aDynTypeCounter = aStats->TypeMap.ChangeSeek (aLOD->DynamicType());
if (aDynTypeCounter == NULL)
{
Standard_Integer aNewIndex = aStats->TypeMap.Add (aLOD->DynamicType(), 0);
aDynTypeCounter = &aStats->TypeMap.ChangeFromIndex (aNewIndex);
}
(*aDynTypeCounter)++;
aStats->NbTriangles += aLOD->NbTriangles();
if (aLOD->HasDeferredData())
{
aStats->NbDeferredFaces++;
if (!aLOD->HasGeometry())
{
aStats->NbUnloadedFaces++;
aStats->NbUnloadedTriangles += aLOD->NbDeferredTriangles();
}
}
else if (!aLOD->HasGeometry())
{
aStats->NbEmptyFaces++;
}
}
Standard_Real MaxDeflection = 0.0;
Standard_Integer nbtriangles = 0, nbnodes = 0, nbrepresentations = 0;
for (ex.Init(S, TopAbs_FACE); ex.More(); ex.Next()) {
TopoDS_Face F = TopoDS::Face(ex.Current());
T = BRep_Tool::Triangulation(F, L);
if (!T.IsNull()) {
nbtriangles += T->NbTriangles();
nbnodes += T->NbNodes();
if (T->Deflection() > MaxDeflection)
MaxDeflection = T->Deflection();
}
}
TopTools_IndexedMapOfShape anEdges;
TopExp::MapShapes (aShape, TopAbs_EDGE, anEdges);
TopExp::MapShapes(S, TopAbs_EDGE, anEdges);
for (int i = 1; i<=anEdges.Extent(); ++i)
{
const TopoDS_Edge& anEdge = TopoDS::Edge(anEdges(i));
@@ -765,105 +467,19 @@ static Standard_Integer trianglesinfo (Draw_Interpretor& theDI, Standard_Integer
aCR = anIterCR.Value();
if (aCR->IsPolygonOnTriangulation())
{
aNbRepresentations++;
nbrepresentations++;
}
anIterCR.Next();
}
}
theDI <<"\n";
theDI << "This shape contains " << aNbFaces << " faces.\n";
if (aNbEmptyFaces > 0)
{
theDI << " " << aNbEmptyFaces << " empty faces.\n";
}
theDI << " " << aNbTriangles << " triangles.\n";
theDI << " " << aNbNodes << " nodes.\n";
theDI << " " << aNbRepresentations << " polygons on triangulation.\n";
theDI << "Maximal deflection " << aMaxDeflection << "\n";
if (aNbLODs.Size() > 0)
{
// Find all different numbers of triangulation LODs and their average value per face
if (aNbLODs.Size() > 1)
{
std::sort (aNbLODs.begin(), aNbLODs.end());
}
NCollection_IndexedMap<Standard_Integer> aLODsRange;
for (NCollection_Vector<Standard_Integer>::Iterator aNbIter(aNbLODs); aNbIter.More(); aNbIter.Next())
{
if (!aLODsRange.Contains (aNbIter.Value()))
{
aLODsRange.Add (aNbIter.Value());
}
}
TCollection_AsciiString aLODsRangeStr;
Standard_Integer anIndex = 0;
for (NCollection_IndexedMap<Standard_Integer>::Iterator aRangeIter(aLODsRange); aRangeIter.More(); aRangeIter.Next(), anIndex++)
{
aLODsRangeStr += TCollection_AsciiString(aRangeIter.Value());
if (anIndex < aLODsRange.Size() - 1)
{
aLODsRangeStr += " ";
}
}
theDI << TCollection_AsciiString("Number of triangulation LODs [") + aLODsRangeStr + "]\n";
if (aLODsRange.Size() > 1)
{
// Find average number of triangulation LODs per face
Standard_Integer aMedian = aNbLODs.Value (aNbLODs.Lower() + aNbLODs.Size() / 2);
if ((aNbLODs.Size() % 2) == 0)
{
aMedian += aNbLODs.Value (aNbLODs.Lower() + aNbLODs.Size() / 2 - 1);
aMedian /= 2;
}
theDI << TCollection_AsciiString(" [average per face: ") + aMedian + "]\n";
}
}
if (!aLODsStat.IsEmpty())
{
TCollection_AsciiString aLODsStatStr;
for (NCollection_IndexedDataMap<Standard_Integer, TriangulationStat>::Iterator anIter(aLODsStat);
anIter.More(); anIter.Next())
{
const TriangulationStat& aLodStat = anIter.Value();
aLODsStatStr += TCollection_AsciiString("LOD #") + anIter.Key() + ". ";
//aLODsStatStr += TCollection_AsciiString("NbFaces: ") + aLodStat.NbFaces;
if (aLodStat.NbEmptyFaces > 0 || aLodStat.NbFaces < aNbFaces)
{
const Standard_Integer aNbEmpty = aLodStat.NbEmptyFaces + (aNbFaces - aLodStat.NbFaces);
aLODsStatStr += TCollection_AsciiString("NbEmpty: ") + aNbEmpty + ", ";
}
aLODsStatStr += TCollection_AsciiString("NbTris: ") + aLodStat.NbTriangles;
if (aLodStat.NbDeferredFaces > 0)
{
aLODsStatStr += TCollection_AsciiString(", NbDeferred: ") + aLodStat.NbDeferredFaces;
if (aLodStat.NbUnloadedFaces > 0)
{
aLODsStatStr += TCollection_AsciiString(", NbUnloaded: ") + aLodStat.NbUnloadedFaces + ", NbUnloadedTris: " + aLodStat.NbUnloadedTriangles;
}
}
aLODsStatStr += ".\n";
// Add types
aLODsStatStr += TCollection_AsciiString(" Types: ");
Standard_Integer aCounter = 0;
for (NCollection_IndexedDataMap<Handle(Standard_Type), Standard_Integer>::Iterator aTypeIter(aLodStat.TypeMap);
aTypeIter.More(); aTypeIter.Next(), aCounter++)
{
aLODsStatStr += TCollection_AsciiString(aTypeIter.Key()->Name()) + " (" + aTypeIter.Value() + ")";
if (aCounter < aLodStat.TypeMap.Size() - 1)
{
aLODsStatStr += TCollection_AsciiString(", ");
}
}
aLODsStatStr += ".\n";
}
theDI << aLODsStatStr;
}
theDI << "\n";
di<<"\n";
di << "This shape contains " << nbtriangles << " triangles.\n";
di << " " << nbnodes << " nodes.\n";
di << " " << nbrepresentations << " polygons on triangulation .\n";;
di << "Maximal deflection " << MaxDeflection << "\n";
di<<"\n";
#ifdef OCCT_DEBUG_MESH_CHRONO
Standard_Real tot, addp, unif, contr, inter;
Standard_Real edges, mailledges, etuinter, lastcontrol, stock;
@@ -878,40 +494,40 @@ static Standard_Integer trianglesinfo (Draw_Interpretor& theDI, Standard_Integer
chPointValid.Show(pointvalid); chIsos.Show(isos); chPointsOnIsos.Show(pointsisos);
if (tot > 0.00001) {
theDI <<"temps total de maillage: "<<tot <<" seconds\n";
theDI <<"dont: \n";
theDI <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %\n";
theDI <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %\n";
theDI <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %\n";
theDI <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %\n";
theDI <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %\n";
theDI << "\n";
theDI <<"et plus precisement: \n";
theDI <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %\n";
theDI <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %\n";
theDI <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %\n";
theDI <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %\n";
theDI <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %\n";
theDI <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %\n";
theDI <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %\n";
theDI <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %\n";
theDI <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %\n";
theDI <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %\n";
theDI <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %\n";
theDI << "\n";
di <<"temps total de maillage: "<<tot <<" seconds\n";
di <<"dont: \n";
di <<"discretisation des edges: "<<edges <<" seconds---> "<< 100*edges/tot <<" %\n";
di <<"maillage des edges: "<<mailledges <<" seconds---> "<< 100*mailledges/tot <<" %\n";
di <<"controle et points internes: "<<etuinter <<" seconds---> "<< 100*etuinter/tot <<" %\n";
di <<"derniers controles: "<<lastcontrol<<" seconds---> "<< 100*lastcontrol/tot<<" %\n";
di <<"stockage dans la S.D. "<<stock <<" seconds---> "<< 100*stock/tot <<" %\n";
di << "\n";
di <<"et plus precisement: \n";
di <<"Add 11ere partie : "<<add11 <<" seconds---> "<<100*add11/tot <<" %\n";
di <<"Add 12ere partie : "<<add12 <<" seconds---> "<<100*add12/tot <<" %\n";
di <<"Add 2eme partie : "<<add2 <<" seconds---> "<<100*add2/tot <<" %\n";
di <<"Update : "<<upda <<" seconds---> "<<100*upda/tot <<" %\n";
di <<"AddPoint : "<<addp <<" seconds---> "<<100*addp/tot <<" %\n";
di <<"UniformDeflection "<<unif <<" seconds---> "<<100*unif/tot <<" %\n";
di <<"Controle : "<<contr <<" seconds---> "<<100*contr/tot <<" %\n";
di <<"Points Internes: "<<inter <<" seconds---> "<<100*inter/tot <<" %\n";
di <<"calcul des isos et du, dv: "<<isos <<" seconds---> "<<100*isos/tot <<" %\n";
di <<"calcul des points sur isos: "<<pointsisos<<" seconds---> "<<100*pointsisos/tot <<" %\n";
di <<"IsPointValid: "<<pointvalid<<" seconds---> "<<100*pointvalid/tot <<" %\n";
di << "\n";
theDI <<"nombre d'appels de controle apres points internes : "<< NbControls << "\n";
theDI <<"nombre de points sur restrictions : "<< D0Edges << "\n";
theDI <<"nombre de points calcules par UniformDeflection : "<< D0Unif << "\n";
theDI <<"nombre de points calcules dans InternalVertices : "<< D0Internal << "\n";
theDI <<"nombre de points calcules dans Control : "<< D0Control << "\n";
di <<"nombre d'appels de controle apres points internes : "<< NbControls << "\n";
di <<"nombre de points sur restrictions : "<< D0Edges << "\n";
di <<"nombre de points calcules par UniformDeflection : "<< D0Unif << "\n";
di <<"nombre de points calcules dans InternalVertices : "<< D0Internal << "\n";
di <<"nombre de points calcules dans Control : "<< D0Control << "\n";
if (nbnodes-D0Edges != 0) {
Standard_Real ratio = (Standard_Real)(D0Internal+D0Control)/ (Standard_Real)(nbnodes-D0Edges);
theDI <<"---> Ratio: (D0Internal+D0Control) / (nbNodes-nbOnEdges) : "<< ratio << "\n";
di <<"---> Ratio: (D0Internal+D0Control) / (nbNodes-nbOnEdges) : "<< ratio << "\n";
}
theDI << "\n";
di << "\n";
chTotal.Reset(); chAddPoint.Reset(); chUnif.Reset();
chControl.Reset(); chInternal.Reset();
@@ -1387,31 +1003,10 @@ void MeshTest::Commands(Draw_Interpretor& theCommands)
theCommands.Add("MemLeakTest","MemLeakTest",__FILE__, MemLeakTest, g);
theCommands.Add("tri2d", "tri2d facename",__FILE__, tri2d, g);
theCommands.Add("trinfo",
"trinfo shapeName [-lods], print triangles information on objects"
"\n\t\t: -lods Print detailed LOD information",
__FILE__,trianglesinfo,g);
theCommands.Add("trinfo","trinfo name, print triangles information on objects",__FILE__,trianglesinfo,g);
theCommands.Add("veriftriangles","veriftriangles name, verif triangles",__FILE__,veriftriangles,g);
theCommands.Add("wavefront","wavefront name",__FILE__, wavefront, g);
theCommands.Add("triepoints", "triepoints shape1 [shape2 ...]",__FILE__, triedgepoints, g);
theCommands.Add("trlateload",
"trlateload shapeName"
"\n\t\t: [-load {-1|Index|ALL}=-1] [-unload {-1|Index|ALL}=-1]"
"\n\t\t: [-activate Index] [-activateExact Index]"
"\n\t\t: [-loadSingle {-1|Index}=-1] [-loadSingleExact {Index}=-1]"
"\n\t\t: Interaction with deferred triangulations."
"\n\t\t: '-load' - load triangulation (-1 - currently active one, Index - with defined index,"
"\n\t\t: ALL - all available ones)"
"\n\t\t: '-unload' - unload triangulation (-1 - currently active one, Index - with defined index,"
"\n\t\t: ALL - all available ones)"
"\n\t\t: '-activate' - activate triangulation with defined index. If it doesn't exist -"
"\n\t\t: activate the last available triangulation."
"\n\t\t: '-activateExact' - activate exactly triangulation with defined index or do nothing."
"\n\t\t: '-loadSingle' - make loaded and active ONLY specified triangulation (-1 - currently active one,"
"\n\t\t: Index - with defined index or last available if it doesn't exist)."
"\n\t\t: All other triangulations will be unloaded."
"\n\t\t: '-loadSingleExact' - make loaded and active ONLY exactly specified triangulation. All other triangulations"
"\n\t\t: will be unloaded. If triangulation with such Index doesn't exist do nothing",
__FILE__, TrLateLoad, g);
theCommands.Add("correctnormals", "correctnormals shape",__FILE__, correctnormals, g);
}

View File

@@ -274,7 +274,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
gp_Dir aDefNorm( 0., 0., 1. );
// Prepare for scaling the incoming colors
const Standard_Real anColorRatio = 1.0;
const Standard_Real anColorRatio = !IsReflect ? 0.44f : 0.5f;
for (it.Reset(); it.More(); it.Next())
{
@@ -454,7 +454,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
// aStyle = (Aspect_InteriorStyle)aStyleInt;
anAsp = new Graphic3d_AspectFillArea3d (
Aspect_IS_SOLID, Quantity_NOC_WHITE, anEdgeColor,
Aspect_IS_SOLID, Quantity_NOC_GRAY, anEdgeColor,
anEdgeType, anEdgeWidth, aMaterial[ 0 ], aMaterial[ 1 ] );
}

View File

@@ -20,6 +20,7 @@
#include <Graphic3d_AspectText3d.hxx>
#include <Graphic3d_Text.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Vertex.hxx>
#include <MeshVS_Buffer.hxx>
#include <MeshVS_DataSource.hxx>
#include <MeshVS_DisplayModeFlags.hxx>

View File

@@ -35,11 +35,7 @@ static Message_DataMapOfExtendedString& msgsDataMap ()
}
// mutex used to prevent concurrent access to message registry
static Standard_Mutex& Message_MsgFile_Mutex()
{
static Standard_Mutex theMutex;
return theMutex;
}
static Standard_Mutex theMutex;
typedef enum
{
@@ -349,12 +345,13 @@ Standard_Boolean Message_MsgFile::LoadFromString (const Standard_CString theCont
//purpose : Add one message to the global table. Fails if the same keyword
// already exists in the table
//=======================================================================
Standard_Boolean Message_MsgFile::AddMsg (const TCollection_AsciiString& theKeyword,
const TCollection_ExtendedString& theMessage)
{
Message_DataMapOfExtendedString& aDataMap = ::msgsDataMap();
Standard_Mutex::Sentry aSentry (Message_MsgFile_Mutex());
Standard_Mutex::Sentry aSentry (theMutex);
aDataMap.Bind (theKeyword, theMessage);
return Standard_True;
}
@@ -363,19 +360,21 @@ Standard_Boolean Message_MsgFile::AddMsg (const TCollection_AsciiString& theKeyw
//function : getMsg
//purpose : retrieve the message previously defined for the given keyword
//=======================================================================
const TCollection_ExtendedString& Message_MsgFile::Msg (const Standard_CString theKeyword)
const TCollection_ExtendedString &Message_MsgFile::Msg (const Standard_CString theKeyword)
{
TCollection_AsciiString aKey (theKeyword);
TCollection_AsciiString aKey((char*)theKeyword);
return Msg (aKey);
}
//=======================================================================
//function : HasMsg
//purpose :
//purpose :
//=======================================================================
Standard_Boolean Message_MsgFile::HasMsg (const TCollection_AsciiString& theKeyword)
{
Standard_Mutex::Sentry aSentry (Message_MsgFile_Mutex());
Standard_Mutex::Sentry aSentry (theMutex);
return ::msgsDataMap().IsBound (theKeyword);
}
@@ -383,26 +382,24 @@ Standard_Boolean Message_MsgFile::HasMsg (const TCollection_AsciiString& theKeyw
//function : Msg
//purpose : retrieve the message previously defined for the given keyword
//=======================================================================
const TCollection_ExtendedString& Message_MsgFile::Msg (const TCollection_AsciiString& theKeyword)
const TCollection_ExtendedString &Message_MsgFile::Msg (const TCollection_AsciiString& theKeyword)
{
// find message in the map
Message_DataMapOfExtendedString& aDataMap = ::msgsDataMap();
Standard_Mutex::Sentry aSentry (Message_MsgFile_Mutex());
Standard_Mutex::Sentry aSentry (theMutex);
// if message is not found, generate error message and add it to the map to minimize overhead
// on consequent calls with the same key
const TCollection_ExtendedString* aValPtr = aDataMap.Seek (theKeyword);
if (aValPtr == NULL)
if (! aDataMap.IsBound(theKeyword))
{
// text of the error message can be itself defined in the map
static const TCollection_AsciiString aPrefixCode("Message_Msg_BadKeyword");
static const TCollection_ExtendedString aDefPrefix("Unknown message invoked with the keyword ");
const TCollection_ExtendedString* aPrefValPtr = aDataMap.Seek (aPrefixCode);
TCollection_AsciiString aErrorMessage = (aPrefValPtr != NULL ? *aPrefValPtr : aDefPrefix);
TCollection_AsciiString aErrorMessage = (aDataMap.IsBound(aPrefixCode) ? aDataMap(aPrefixCode) : aDefPrefix);
aErrorMessage += theKeyword;
aDataMap.Bind (theKeyword, aErrorMessage); // do not use AddMsg() here to avoid mutex deadlock
aValPtr = aDataMap.Seek (theKeyword);
}
return *aValPtr;
return aDataMap (theKeyword);
}

View File

@@ -15,26 +15,13 @@
;# Liste des toolkits WOK sous forme de full path
;#
proc Draw:toolkits { } {
set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
lappend aResult "TKOpenGlTest"
if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
lappend aResult "TKOpenGlesTest"
}
if { "$::tcl_platform(platform)" == "windows" } {
if { [info exists ::env(HAVE_D3D)] } {
if { "$::env(HAVE_D3D)" == "true" } {
lappend aResult "TKD3DHostTest"
}
} elseif { [info exists ::env(VCVER)] && "$::env(VCVER)" != "vc8" && "$::env(VCVER)" != "vc9" && "$::env(VCVER)" != "vc10" } {
lappend aResult "TKD3DHostTest"
if { [info exists ::env(HAVE_VTK)] && $::env(HAVE_VTK) == "true" } {
lappend aResult "TKIVtkDraw"
}
}
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
lappend aResult "TKIVtkDraw"
}
return $aResult
return $aResult
}
;#

View File

@@ -15,28 +15,27 @@
;# Liste des toolkits WOK sous forme de full path
;#
proc Visualization:toolkits { } {
set aResult [list TKService TKV3d TKMeshVS]
set aResult [list TKService \
TKV3d \
TKOpenGl \
TKMeshVS]
lappend aResult "TKOpenGl"
if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
lappend aResult "TKOpenGles"
}
if { "$::tcl_platform(platform)" == "windows" } {
if { [info exists ::env(HAVE_D3D)] } {
if { "$::env(HAVE_D3D)" == "true" } {
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
lappend aResult "TKIVtk"
}
if { "$::tcl_platform(platform)" == "windows" } {
if { [info exists ::env(HAVE_D3D)] } {
if { "$::env(HAVE_D3D)" == "true" } {
lappend aResult "TKD3DHost"
}
} elseif { [info exists ::env(VCVER)] && "$::env(VCVER)" != "vc8" && "$::env(VCVER)" != "vc9" && "$::env(VCVER)" != "vc10" } {
lappend aResult "TKD3DHost"
}
} elseif { [info exists ::env(VCVER)] && "$::env(VCVER)" != "vc8" && "$::env(VCVER)" != "vc9" && "$::env(VCVER)" != "vc10" } {
lappend aResult "TKD3DHost"
}
}
if { [info exists ::env(HAVE_VTK)] && "$::env(HAVE_VTK)" == "true" } {
lappend aResult "TKIVtk"
}
return $aResult
return $aResult
}
;#
;# Autres UDs a prendre.
;#

View File

@@ -99,13 +99,8 @@ Standard_Integer OSD_Process::ProcessId(){
TCollection_AsciiString OSD_Process::UserName()
{
#if defined(__EMSCRIPTEN__)
// Emscripten SDK raises TODO exception in runtime while calling getpwuid()
return TCollection_AsciiString();
#else
struct passwd *anInfos = getpwuid (getuid());
return TCollection_AsciiString (anInfos ? anInfos->pw_name : "");
#endif
}
Standard_Boolean OSD_Process::IsSuperUser (){

View File

@@ -108,8 +108,6 @@ OpenGl_LayerList.hxx
OpenGl_LayerFilter.hxx
OpenGl_GraphicDriver.cxx
OpenGl_GraphicDriver.hxx
OpenGl_GraphicDriverFactory.cxx
OpenGl_GraphicDriverFactory.hxx
OpenGl_IndexBuffer.cxx
OpenGl_IndexBuffer.hxx
OpenGl_Layer.hxx

View File

@@ -254,7 +254,7 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
}
if (theCtx->core20fwd != NULL
&& (!theCtx->caps->pntSpritesDisable || theCtx->core11ffp == NULL))
&& (!theCtx->caps->pntSpritesDisable || theCtx->core11 == NULL))
{
// Creating texture resource for using it with point sprites
Handle(Image_PixMap) anImage = aNewMarkerImage->GetImage();
@@ -272,11 +272,11 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
}
}
}
else if (theCtx->core11ffp != NULL)
else if (theCtx->core11 != NULL)
{
#if !defined(GL_ES_VERSION_2_0)
// Creating list with bitmap for using it in compatibility mode
GLuint aBitmapList = theCtx->core11ffp->glGenLists (1);
GLuint aBitmapList = glGenLists (1);
aSprite->SetDisplayList (theCtx, aBitmapList);
Handle(Image_PixMap) anImage = aNewMarkerImage->IsColoredImage()
@@ -295,20 +295,20 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
anImage = anImageCopy;
}
const GLint anAligment = Min ((GLint)anImage->MaxRowAligmentBytes(), 8);
theCtx->core11fwd->glPixelStorei (GL_UNPACK_ALIGNMENT, anAligment);
glPixelStorei (GL_UNPACK_ALIGNMENT, anAligment);
const GLint anExtraBytes = GLint (anImage->RowExtraBytes());
const GLint aPixelsWidth = GLint (anImage->SizeRowBytes() / anImage->SizePixelBytes());
const GLint aRowLength = (anExtraBytes >= anAligment) ? aPixelsWidth : 0;
theCtx->core11fwd->glPixelStorei (GL_UNPACK_ROW_LENGTH, aRowLength);
glPixelStorei (GL_UNPACK_ROW_LENGTH, aRowLength);
theCtx->core11ffp->glNewList (aBitmapList, GL_COMPILE);
glNewList (aBitmapList, GL_COMPILE);
const Standard_Integer aWidth = (Standard_Integer )anImage->Width(), aHeight = (Standard_Integer )anImage->Height();
theCtx->core11ffp->glBitmap (0, 0, 0, 0, GLfloat(-0.5f * aWidth), GLfloat(-0.5f * aHeight), NULL); // make offsets that will be added to the current raster position
theCtx->core11ffp->glDrawPixels (GLsizei(anImage->Width()), GLsizei(anImage->Height()), aFormat.PixelFormat(), aFormat.DataType(), anImage->Data());
theCtx->core11ffp->glEndList();
theCtx->core11fwd->glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
theCtx->core11fwd->glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
glBitmap (0, 0, 0, 0, GLfloat(-0.5f * aWidth), GLfloat(-0.5f * aHeight), NULL); // make offsets that will be added to the current raster position
glDrawPixels (GLsizei(anImage->Width()), GLsizei(anImage->Height()), aFormat.PixelFormat(), aFormat.DataType(), anImage->Data());
glEndList();
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}
if (!aFormat.IsValid() || !hadAlreadyAlpha)
@@ -323,10 +323,10 @@ void OpenGl_AspectsSprite::build (const Handle(OpenGl_Context)& theCtx,
aNewMarkerImage->GetTextureSize (aWidth, aHeight);
if (Handle(TColStd_HArray1OfByte) aBitMap = aNewMarkerImage->GetBitMapArray())
{
theCtx->core11ffp->glNewList (aBitmapList, GL_COMPILE);
theCtx->core11ffp->glBitmap ((GLsizei)aWidth, (GLsizei)aHeight, (GLfloat)(0.5f * aWidth), (GLfloat)(0.5f * aHeight),
0.f, 0.f, (const GLubyte*)&aBitMap->First());
theCtx->core11ffp->glEndList();
glNewList (aBitmapList, GL_COMPILE);
glBitmap ((GLsizei)aWidth, (GLsizei)aHeight, (GLfloat)(0.5f * aWidth), (GLfloat)(0.5f * aHeight),
0.f, 0.f, (const GLubyte*)&aBitMap->First());
glEndList();
}
}
#endif

View File

@@ -121,21 +121,30 @@ namespace
// purpose :
// =======================================================================
OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
: core11ffp (NULL),
: core11 (NULL),
core11fwd (NULL),
core15 (NULL),
core20 (NULL),
core30 (NULL),
core32 (NULL),
core33 (NULL),
core41 (NULL),
core42 (NULL),
core43 (NULL),
core44 (NULL),
core45 (NULL),
core46 (NULL),
core15fwd (NULL),
core20 (NULL),
core20fwd (NULL),
core30 (NULL),
core30fwd (NULL),
core32 (NULL),
core32back (NULL),
core33 (NULL),
core33back (NULL),
core41 (NULL),
core41back (NULL),
core42 (NULL),
core42back (NULL),
core43 (NULL),
core43back (NULL),
core44 (NULL),
core44back (NULL),
core45 (NULL),
core45back (NULL),
core46 (NULL),
core46back (NULL),
caps (!theCaps.IsNull() ? theCaps : new OpenGl_Caps()),
hasGetBufferData (Standard_False),
#if defined(GL_ES_VERSION_2_0)
@@ -590,7 +599,7 @@ void OpenGl_Context::FetchState()
{
#if !defined(GL_ES_VERSION_2_0)
// cache feedback mode state
if (core11ffp != NULL)
if (core11 != NULL)
{
::glGetIntegerv (GL_RENDER_MODE, &myRenderMode);
::glGetIntegerv (GL_SHADE_MODEL, &myShadeModel);
@@ -1517,7 +1526,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
#if defined(GL_ES_VERSION_2_0)
myShaderManager->SetUseRedAlpha (false);
#else
myShaderManager->SetUseRedAlpha (core11ffp == NULL);
myShaderManager->SetUseRedAlpha (core11 == NULL);
#endif
#define checkGlslExtensionShort(theName) myShaderManager->EnableGlslExtension (Graphic3d_GlslExtension_ ## theName, CheckExtension (#theName))
#if defined(GL_ES_VERSION_2_0)
@@ -1562,7 +1571,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &myMaxTexDim);
#if !defined(GL_ES_VERSION_2_0)
if (IsGlGreaterEqual (1, 3) && core11ffp != NULL)
if (IsGlGreaterEqual (1, 3) && core11 != NULL)
{
// this is a maximum of texture units for FFP functionality,
// usually smaller than combined texture units available for GLSL
@@ -1604,7 +1613,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
::glGetIntegerv (GL_MAX_SAMPLES, &myMaxMsaaSamples);
}
#else
if (core30 != NULL)
if (core30fwd != NULL)
{
// MSAA RenderBuffers have been defined in OpenGL 3.0,
// but MSAA Textures - only in OpenGL 3.2+
@@ -2202,7 +2211,7 @@ void OpenGl_Context::ReleaseDelayed()
continue;
}
// release resource if no one requested it more than 2 redraw calls
// release resource if no one requiested it more than 2 redraw calls
aRes->Release (this);
mySharedResources->UnBind (aKey);
aDeadList.Append (aKey);
@@ -2282,7 +2291,7 @@ Handle(OpenGl_TextureSet) OpenGl_Context::BindTextures (const Handle(OpenGl_Text
}
}
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
{
OpenGl_Sampler::applyGlobalTextureParams (aThisCtx, *aTextureNew, aTextureNew->Sampler()->Parameters());
}
@@ -2293,7 +2302,7 @@ Handle(OpenGl_TextureSet) OpenGl_Context::BindTextures (const Handle(OpenGl_Text
{
aTextureOld->Unbind (aThisCtx, aTexUnit);
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
{
OpenGl_Sampler::resetGlobalTextureParams (aThisCtx, *aTextureOld, aTextureOld->Sampler()->Parameters());
}
@@ -2408,22 +2417,32 @@ void OpenGl_Context::SetShadingMaterial (const OpenGl_Aspects* theAspect,
? anAspect->BackInteriorColor()
: aFrontIntColor;
myMaterial.Init (*this, aMatFrontSrc, aFrontIntColor, aMatBackSrc, aBackIntColor);
myMatFront.Init (*this, aMatFrontSrc, aFrontIntColor);
if (toDistinguish)
{
myMatBack.Init (*this, aMatBackSrc, aBackIntColor);
}
else
{
myMatBack = myMatFront;
}
if (!theHighlight.IsNull()
&& theHighlight->BasicFillAreaAspect().IsNull())
{
myMaterial.SetColor (theHighlight->ColorRGBA().GetRGB());
myMaterial.SetColor (theHighlight->ColorRGBA().GetRGB());
myMatFront.SetColor (theHighlight->ColorRGBA());
myMatBack .SetColor (theHighlight->ColorRGBA());
}
float anAlphaFront = 1.0f, anAlphaBack = 1.0f;
Standard_ShortReal anAlphaFront = 1.0f;
Standard_ShortReal anAlphaBack = 1.0f;
if (CheckIsTransparent (theAspect, theHighlight, anAlphaFront, anAlphaBack))
{
myMaterial.Common[0].Diffuse.a() = anAlphaFront;
myMaterial.Common[1].Diffuse.a() = anAlphaBack;
myMatFront.Common.Diffuse.a() = anAlphaFront;
myMatBack .Common.Diffuse.a() = anAlphaBack;
myMaterial.Pbr[0].BaseColor.a() = anAlphaFront;
myMaterial.Pbr[1].BaseColor.a() = anAlphaBack;
myMatFront.Pbr.BaseColor.a() = anAlphaFront;
myMatBack .Pbr.BaseColor.a() = anAlphaBack;
}
// do not update material properties in case of zero reflection mode,
@@ -2449,7 +2468,8 @@ void OpenGl_Context::SetShadingMaterial (const OpenGl_Aspects* theAspect,
return;
}
}
else if (myMaterial.IsEqual (aMatState.Material())
else if (myMatFront == aMatState.FrontMaterial()
&& myMatBack == aMatState.BackMaterial()
&& toDistinguish == aMatState.ToDistinguish()
&& toMapTexture == aMatState.ToMapTexture()
&& anAlphaCutoff == aMatState.AlphaCutoff())
@@ -2457,7 +2477,7 @@ void OpenGl_Context::SetShadingMaterial (const OpenGl_Aspects* theAspect,
return;
}
myShaderManager->UpdateMaterialStateTo (myMaterial, anAlphaCutoff, toDistinguish, toMapTexture);
myShaderManager->UpdateMaterialStateTo (myMatFront, myMatBack, anAlphaCutoff, toDistinguish, toMapTexture);
}
// =======================================================================
@@ -2515,9 +2535,9 @@ void OpenGl_Context::SetColor4fv (const OpenGl_Vec4& theColor)
}
}
#if !defined(GL_ES_VERSION_2_0)
else if (core11ffp != NULL)
else if (core11 != NULL)
{
core11ffp->glColor4fv (theColor.GetData());
core11->glColor4fv (theColor.GetData());
}
#endif
}
@@ -2564,17 +2584,17 @@ void OpenGl_Context::SetLineStipple (const Standard_ShortReal theFactor,
#if !defined(GL_ES_VERSION_2_0)
if (thePattern != 0xFFFF)
{
if (core11ffp != NULL)
if (core11 != NULL)
{
core11fwd->glEnable (GL_LINE_STIPPLE);
core11ffp->glLineStipple (static_cast<GLint> (theFactor),
static_cast<GLushort> (thePattern));
core11->glLineStipple (static_cast<GLint> (theFactor),
static_cast<GLushort> (thePattern));
}
}
else
{
if (core11ffp != NULL)
if (core11 != NULL)
{
core11fwd->glDisable (GL_LINE_STIPPLE);
}
@@ -2589,7 +2609,7 @@ void OpenGl_Context::SetLineStipple (const Standard_ShortReal theFactor,
void OpenGl_Context::SetLineWidth (const Standard_ShortReal theWidth)
{
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
#endif
{
// glLineWidth() is still defined within Core Profile, but has no effect with values != 1.0f
@@ -2638,12 +2658,12 @@ void OpenGl_Context::SetTextureMatrix (const Handle(Graphic3d_TextureParams)& th
}
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
{
GLint aMatrixMode = GL_TEXTURE;
::glGetIntegerv (GL_MATRIX_MODE, &aMatrixMode);
core11ffp->glMatrixMode (GL_TEXTURE);
core11->glMatrixMode (GL_TEXTURE);
OpenGl_Mat4 aTextureMat;
if (caps->isTopDownTextureUV != theIsTopDown)
{
@@ -2657,8 +2677,8 @@ void OpenGl_Context::SetTextureMatrix (const Handle(Graphic3d_TextureParams)& th
Graphic3d_TransformUtils::Translate (aTextureMat, -aTrans.x(), -aTrans.y(), 0.0f);
}
Graphic3d_TransformUtils::Rotate (aTextureMat, -theParams->Rotation(), 0.0f, 0.0f, 1.0f);
core11ffp->glLoadMatrixf (aTextureMat);
core11ffp->glMatrixMode (aMatrixMode);
core11->glLoadMatrixf (aTextureMat);
core11->glMatrixMode (aMatrixMode);
}
#endif
}
@@ -2721,17 +2741,19 @@ Standard_Boolean OpenGl_Context::SetGlNormalizeEnabled (Standard_Boolean isEnabl
}
Standard_Boolean anOldGlNormalize = myIsGlNormalizeEnabled;
myIsGlNormalizeEnabled = isEnabled;
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
{
if (isEnabled)
{
core11fwd->glEnable (GL_NORMALIZE);
::glEnable (GL_NORMALIZE);
}
else
{
core11fwd->glDisable (GL_NORMALIZE);
::glDisable (GL_NORMALIZE);
}
}
#endif
@@ -2746,7 +2768,7 @@ Standard_Boolean OpenGl_Context::SetGlNormalizeEnabled (Standard_Boolean isEnabl
void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel)
{
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp != NULL)
if (core11 != NULL)
{
const Standard_Integer aModel = theModel == Graphic3d_TOSM_FACET
|| theModel == Graphic3d_TOSM_PBR_FACET ? GL_FLAT : GL_SMOOTH;
@@ -2755,7 +2777,7 @@ void OpenGl_Context::SetShadeModel (Graphic3d_TypeOfShadingModel theModel)
return;
}
myShadeModel = aModel;
core11ffp->glShadeModel (aModel);
core11->glShadeModel (aModel);
}
#else
(void )theModel;
@@ -2790,7 +2812,7 @@ Standard_Integer OpenGl_Context::SetPolygonMode (const Standard_Integer theMode)
// =======================================================================
bool OpenGl_Context::SetPolygonHatchEnabled (const bool theIsEnabled)
{
if (core11ffp == NULL)
if (core11 == NULL)
{
return false;
}
@@ -2823,7 +2845,7 @@ Standard_Integer OpenGl_Context::SetPolygonHatchStyle (const Handle(Graphic3d_Ha
{
const Standard_Integer aNewStyle = !theStyle.IsNull() ? theStyle->HatchType() : Aspect_HS_SOLID;
if (myActiveHatchType == aNewStyle
|| core11ffp == NULL)
|| core11 == NULL)
{
return myActiveHatchType;
}
@@ -2872,11 +2894,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset)
{
if (toFillNew)
{
core11fwd->glEnable (GL_POLYGON_OFFSET_FILL);
glEnable (GL_POLYGON_OFFSET_FILL);
}
else
{
core11fwd->glDisable (GL_POLYGON_OFFSET_FILL);
glDisable (GL_POLYGON_OFFSET_FILL);
}
}
@@ -2887,11 +2909,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset)
{
if (toLineNew)
{
core11fwd->glEnable (GL_POLYGON_OFFSET_LINE);
glEnable (GL_POLYGON_OFFSET_LINE);
}
else
{
core11fwd->glDisable (GL_POLYGON_OFFSET_LINE);
glDisable (GL_POLYGON_OFFSET_LINE);
}
}
@@ -2901,11 +2923,11 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset)
{
if (toPointNew)
{
core11fwd->glEnable (GL_POLYGON_OFFSET_POINT);
glEnable (GL_POLYGON_OFFSET_POINT);
}
else
{
core11fwd->glDisable (GL_POLYGON_OFFSET_POINT);
glDisable (GL_POLYGON_OFFSET_POINT);
}
}
#endif
@@ -2913,7 +2935,7 @@ void OpenGl_Context::SetPolygonOffset (const Graphic3d_PolygonOffset& theOffset)
if (myPolygonOffset.Factor != theOffset.Factor
|| myPolygonOffset.Units != theOffset.Units)
{
core11fwd->glPolygonOffset (theOffset.Factor, theOffset.Units);
glPolygonOffset (theOffset.Factor, theOffset.Units);
}
myPolygonOffset = theOffset;
}
@@ -3006,24 +3028,24 @@ void OpenGl_Context::EnableFeatures() const
void OpenGl_Context::DisableFeatures() const
{
// Disable stuff that's likely to slow down glDrawPixels.
core11fwd->glDisable(GL_DITHER);
core11fwd->glDisable(GL_BLEND);
core11fwd->glDisable(GL_DEPTH_TEST);
core11fwd->glDisable(GL_STENCIL_TEST);
glDisable(GL_DITHER);
glDisable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glDisable(GL_STENCIL_TEST);
#if !defined(GL_ES_VERSION_2_0)
if (core11ffp == NULL)
if (core11 == NULL)
{
return;
}
core11fwd->glDisable(GL_TEXTURE_1D);
core11fwd->glDisable(GL_TEXTURE_2D);
glDisable(GL_TEXTURE_1D);
glDisable(GL_TEXTURE_2D);
core11fwd->glDisable(GL_LIGHTING);
core11fwd->glDisable(GL_ALPHA_TEST);
core11fwd->glDisable(GL_FOG);
core11fwd->glDisable(GL_LOGIC_OP);
glDisable(GL_LIGHTING);
glDisable(GL_ALPHA_TEST);
glDisable(GL_FOG);
glDisable(GL_LOGIC_OP);
glPixelTransferi(GL_MAP_COLOR, GL_FALSE);
glPixelTransferi(GL_RED_SCALE, 1);
@@ -3038,22 +3060,22 @@ void OpenGl_Context::DisableFeatures() const
if ((myGlVerMajor >= 1) && (myGlVerMinor >= 2))
{
if (CheckExtension ("GL_CONVOLUTION_1D_EXT"))
core11fwd->glDisable(GL_CONVOLUTION_1D_EXT);
glDisable(GL_CONVOLUTION_1D_EXT);
if (CheckExtension ("GL_CONVOLUTION_2D_EXT"))
core11fwd->glDisable(GL_CONVOLUTION_2D_EXT);
glDisable(GL_CONVOLUTION_2D_EXT);
if (CheckExtension ("GL_SEPARABLE_2D_EXT"))
core11fwd->glDisable(GL_SEPARABLE_2D_EXT);
glDisable(GL_SEPARABLE_2D_EXT);
if (CheckExtension ("GL_SEPARABLE_2D_EXT"))
core11fwd->glDisable(GL_HISTOGRAM_EXT);
glDisable(GL_HISTOGRAM_EXT);
if (CheckExtension ("GL_MINMAX_EXT"))
core11fwd->glDisable(GL_MINMAX_EXT);
glDisable(GL_MINMAX_EXT);
if (CheckExtension ("GL_TEXTURE_3D_EXT"))
core11fwd->glDisable(GL_TEXTURE_3D_EXT);
glDisable(GL_TEXTURE_3D_EXT);
}
#endif
}
@@ -3064,7 +3086,7 @@ void OpenGl_Context::DisableFeatures() const
// =======================================================================
void OpenGl_Context::SetColorMaskRGBA (const NCollection_Vec4<bool>& theVal)
{
core11fwd->glColorMask (theVal.r() ? GL_TRUE : GL_FALSE,
glColorMask (theVal.r() ? GL_TRUE : GL_FALSE,
theVal.g() ? GL_TRUE : GL_FALSE,
theVal.b() ? GL_TRUE : GL_FALSE,
theVal.a() ? GL_TRUE : GL_FALSE);
@@ -3080,7 +3102,7 @@ bool OpenGl_Context::SetColorMask (bool theToWriteColor)
const bool anOldValue = myColorMask.r();
myColorMask.SetValues (theToWriteColor, theToWriteColor, theToWriteColor, caps->buffersOpaqueAlpha ? false : theToWriteColor);
const GLboolean toWrite = theToWriteColor ? GL_TRUE : GL_FALSE;
core11fwd->glColorMask (toWrite, toWrite, toWrite, myColorMask.a() ? GL_TRUE : GL_FALSE);
glColorMask (toWrite, toWrite, toWrite, myColorMask.a() ? GL_TRUE : GL_FALSE);
return anOldValue;
}
@@ -3131,10 +3153,10 @@ bool OpenGl_Context::GetBufferSubData (GLenum theTarget, GLintptr theOffset, GLs
}, theTarget, theOffset, theData, theSize);
return true;
#elif defined(GL_ES_VERSION_2_0)
if (void* aData = core30->glMapBufferRange (theTarget, theOffset, theSize, GL_MAP_READ_BIT))
if (void* aData = core30fwd->glMapBufferRange (theTarget, theOffset, theSize, GL_MAP_READ_BIT))
{
memcpy (theData, aData, theSize);
core30->glUnmapBuffer (theTarget);
core30fwd->glUnmapBuffer (theTarget);
return true;
}
return false;

View File

@@ -73,23 +73,72 @@ struct OpenGl_ArbSamplerObject;
struct OpenGl_ArbTexBindless;
struct OpenGl_ExtGS;
struct OpenGl_GlCore12;
template<typename theBaseClass_t> struct OpenGl_TmplCore12;
typedef OpenGl_TmplCore12<OpenGl_GlCore11> OpenGl_GlCore12;
typedef OpenGl_TmplCore12<OpenGl_GlCore11Fwd> OpenGl_GlCore12Fwd;
struct OpenGl_GlCore13;
struct OpenGl_GlCore14;
struct OpenGl_GlCore15;
struct OpenGl_GlCore20;
struct OpenGl_GlCore21;
struct OpenGl_GlCore30;
struct OpenGl_GlCore31;
struct OpenGl_GlCore32;
struct OpenGl_GlCore33;
struct OpenGl_GlCore40;
struct OpenGl_GlCore41;
struct OpenGl_GlCore42;
struct OpenGl_GlCore43;
struct OpenGl_GlCore44;
struct OpenGl_GlCore45;
struct OpenGl_GlCore46;
struct OpenGl_GlCore13Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore14;
typedef OpenGl_TmplCore14<OpenGl_GlCore13> OpenGl_GlCore14;
typedef OpenGl_TmplCore14<OpenGl_GlCore13Fwd> OpenGl_GlCore14Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore15;
typedef OpenGl_TmplCore15<OpenGl_GlCore14> OpenGl_GlCore15;
typedef OpenGl_TmplCore15<OpenGl_GlCore14Fwd> OpenGl_GlCore15Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore20;
typedef OpenGl_TmplCore20<OpenGl_GlCore15> OpenGl_GlCore20;
typedef OpenGl_TmplCore20<OpenGl_GlCore15Fwd> OpenGl_GlCore20Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore21;
typedef OpenGl_TmplCore21<OpenGl_GlCore20> OpenGl_GlCore21;
typedef OpenGl_TmplCore21<OpenGl_GlCore20Fwd> OpenGl_GlCore21Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore30;
typedef OpenGl_TmplCore30<OpenGl_GlCore21> OpenGl_GlCore30;
typedef OpenGl_TmplCore30<OpenGl_GlCore21Fwd> OpenGl_GlCore30Fwd;
template<typename theBaseClass_t> struct OpenGl_TmplCore31;
typedef OpenGl_TmplCore31<OpenGl_GlCore30> OpenGl_GlCore31Back;
typedef OpenGl_TmplCore31<OpenGl_GlCore30Fwd> OpenGl_GlCore31;
template<typename theBaseClass_t> struct OpenGl_TmplCore32;
typedef OpenGl_TmplCore32<OpenGl_GlCore31Back> OpenGl_GlCore32Back;
typedef OpenGl_TmplCore32<OpenGl_GlCore31> OpenGl_GlCore32;
template<typename theBaseClass_t> struct OpenGl_TmplCore33;
typedef OpenGl_TmplCore33<OpenGl_GlCore32Back> OpenGl_GlCore33Back;
typedef OpenGl_TmplCore33<OpenGl_GlCore32> OpenGl_GlCore33;
template<typename theBaseClass_t> struct OpenGl_TmplCore40;
typedef OpenGl_TmplCore40<OpenGl_GlCore33Back> OpenGl_GlCore40Back;
typedef OpenGl_TmplCore40<OpenGl_GlCore33> OpenGl_GlCore40;
template<typename theBaseClass_t> struct OpenGl_TmplCore41;
typedef OpenGl_TmplCore41<OpenGl_GlCore40Back> OpenGl_GlCore41Back;
typedef OpenGl_TmplCore41<OpenGl_GlCore40> OpenGl_GlCore41;
template<typename theBaseClass_t> struct OpenGl_TmplCore42;
typedef OpenGl_TmplCore42<OpenGl_GlCore41Back> OpenGl_GlCore42Back;
typedef OpenGl_TmplCore42<OpenGl_GlCore41> OpenGl_GlCore42;
template<typename theBaseClass_t> struct OpenGl_TmplCore43;
typedef OpenGl_TmplCore43<OpenGl_GlCore42Back> OpenGl_GlCore43Back;
typedef OpenGl_TmplCore43<OpenGl_GlCore42> OpenGl_GlCore43;
template<typename theBaseClass_t> struct OpenGl_TmplCore44;
typedef OpenGl_TmplCore44<OpenGl_GlCore43Back> OpenGl_GlCore44Back;
typedef OpenGl_TmplCore44<OpenGl_GlCore43> OpenGl_GlCore44;
template<typename theBaseClass_t> struct OpenGl_TmplCore45;
typedef OpenGl_TmplCore45<OpenGl_GlCore44Back> OpenGl_GlCore45Back;
typedef OpenGl_TmplCore45<OpenGl_GlCore44> OpenGl_GlCore45;
template<typename theBaseClass_t> struct OpenGl_TmplCore46;
typedef OpenGl_TmplCore46<OpenGl_GlCore45Back> OpenGl_GlCore46Back;
typedef OpenGl_TmplCore46<OpenGl_GlCore45> OpenGl_GlCore46;
class Graphic3d_Camera;
class Graphic3d_PresentationAttributes;
@@ -125,15 +174,24 @@ DEFINE_STANDARD_HANDLE(OpenGl_Context, Standard_Transient)
//! }
//! @endcode
//!
//! Current implementation provide access to OpenGL core functionality up to 4.6 version (core12, core13, core14, etc.)
//! Current implementation provide access to OpenGL core functionality up to 4.4 version (core12, core13, core14, core15, fields core20)
//! as well as several extensions (arbTBO, arbFBO, etc.).
//!
//! OpenGL context might be initialized in Core Profile. In this case deprecated functionality become unavailable.
//! To make code easily adaptable to wide range of OpenGL versions, function sets related to each version has two kinds of suffixes:
//! - "back" for version 3.2+.
//! Represents function set for Backward-Compatible Profile.
//! Function sets without this suffix represents core profile.
//! - "fwd" for version 3.0-.
//! Represents non-deprecated function set of earlier OpenGL versions, which are still available within OpenGL 3.2 Core Profile.
//! Function sets without this suffix represents complete list of functions related to specific OpenGL version.
//!
//! To select which core** function set should be used in specific case:
//! - Determine the minimal OpenGL version required for implemented functionality and use it to access all functions.
//! For example, if algorithm requires OpenGL 2.1+, it is better to write core20fwd->glEnable() rather than core11fwd->glEnable() for uniformity.
//! - If functionality will work within Core Profile, use function sets with appropriate suffix.
//! - Validate minimal requirements at initialization/creation time and omit checks within code where algorithm should be already initialized.
//! Properly escape code incompatible with Core Profile. The simplest way to check Core Profile is "if (core11ffp == NULL)".
//! Properly escape code incompatible with Core Profile. The simplest way to check Core Profile is "if (core11 == NULL)".
//!
//! Simplified extensions classification:
//! - prefixed with NV, AMD, ATI are vendor-specific (however may be provided by other vendors in some cases);
@@ -151,7 +209,7 @@ DEFINE_STANDARD_HANDLE(OpenGl_Context, Standard_Transient)
//! model -> world -> view -> projection
//! These matrices might be changed for local transformation, transform persistent using direct access to
//! current matrix of ModelWorldState, WorldViewState and ProjectionState
//! After, these matrices should be applied using ApplyModelWorldMatrix, ApplyWorldViewMatrix,
//! After, these matrices should be applyed using ApplyModelWorldMatrix, ApplyWorldViewMatrix,
//! ApplyModelViewMatrix or ApplyProjectionMatrix.
class OpenGl_Context : public Standard_Transient
{
@@ -997,22 +1055,30 @@ private:
public: //! @name core profiles
OpenGl_GlCore11* core11ffp; //!< OpenGL 1.1 core functionality
OpenGl_GlCore11* core11; //!< OpenGL 1.1 core functionality
OpenGl_GlCore11Fwd* core11fwd; //!< OpenGL 1.1 without deprecated entry points
OpenGl_GlCore15* core15; //!< OpenGL 1.5 without deprecated entry points
OpenGl_GlCore20* core20; //!< OpenGL 2.0 without deprecated entry points
OpenGl_GlCore30* core30; //!< OpenGL 3.0 without deprecated entry points
OpenGl_GlCore15* core15; //!< OpenGL 1.5 core functionality
OpenGl_GlCore15Fwd* core15fwd; //!< OpenGL 1.5 without deprecated entry points
OpenGl_GlCore20* core20; //!< OpenGL 2.0 core functionality (includes 1.5)
OpenGl_GlCore20Fwd* core20fwd; //!< OpenGL 2.0 without deprecated entry points
OpenGl_GlCore30* core30; //!< OpenGL 3.0 core functionality
OpenGl_GlCore30Fwd* core30fwd; //!< OpenGL 3.0 without deprecated entry points
OpenGl_GlCore32* core32; //!< OpenGL 3.2 core profile
OpenGl_GlCore32Back* core32back; //!< OpenGL 3.2 backward compatibility profile
OpenGl_GlCore33* core33; //!< OpenGL 3.3 core profile
OpenGl_GlCore33Back* core33back; //!< OpenGL 3.3 backward compatibility profile
OpenGl_GlCore41* core41; //!< OpenGL 4.1 core profile
OpenGl_GlCore41Back* core41back; //!< OpenGL 4.1 backward compatibility profile
OpenGl_GlCore42* core42; //!< OpenGL 4.2 core profile
OpenGl_GlCore42Back* core42back; //!< OpenGL 4.2 backward compatibility profile
OpenGl_GlCore43* core43; //!< OpenGL 4.3 core profile
OpenGl_GlCore43Back* core43back; //!< OpenGL 4.3 backward compatibility profile
OpenGl_GlCore44* core44; //!< OpenGL 4.4 core profile
OpenGl_GlCore44Back* core44back; //!< OpenGL 4.4 backward compatibility profile
OpenGl_GlCore45* core45; //!< OpenGL 4.5 core profile
OpenGl_GlCore45Back* core45back; //!< OpenGL 4.5 backward compatibility profile
OpenGl_GlCore46* core46; //!< OpenGL 4.6 core profile
OpenGl_GlCore15* core15fwd; //!< obsolete entry left for code portability; core15 should be used instead
OpenGl_GlCore20* core20fwd; //!< obsolete entry left for code portability; core20 should be used instead
OpenGl_GlCore46Back* core46back; //!< OpenGL 4.6 backward compatibility profile
Handle(OpenGl_Caps) caps; //!< context options
@@ -1183,7 +1249,8 @@ private: //! @name fields tracking current state
Standard_ShortReal myLineFeather; //!< line feater width in pixels
Standard_ShortReal myRenderScale; //!< scaling factor for rendering resolution
Standard_ShortReal myRenderScaleInv; //!< scaling factor for rendering resolution (inverted value)
OpenGl_Material myMaterial; //!< current front/back material state (cached to reduce GL context updates)
OpenGl_Material myMatFront; //!< current front material state (cached to reduce GL context updates)
OpenGl_Material myMatBack; //!< current back material state
private:

File diff suppressed because it is too large Load Diff

View File

@@ -19,10 +19,9 @@
#include <OpenGl_GlCore11.hxx>
//! OpenGL 1.2 core based on 1.1 version.
struct OpenGl_GlCore12 : public OpenGl_GlCore11Fwd
template<typename theBaseClass_t>
struct OpenGl_TmplCore12 : public theBaseClass_t
{
private:
typedef OpenGl_GlCore11Fwd theBaseClass_t;
public: //! @name OpenGL 1.2 additives to 1.1
@@ -38,4 +37,10 @@ public: //! @name OpenGL 1.2 additives to 1.1
};
//! OpenGL 1.2 core based on 1.1 version.
typedef OpenGl_TmplCore12<OpenGl_GlCore11> OpenGl_GlCore12;
//! OpenGL 1.2 without deprecated entry points.
typedef OpenGl_TmplCore12<OpenGl_GlCore11Fwd> OpenGl_GlCore12Fwd;
#endif // _OpenGl_GlCore12_Header

View File

@@ -19,7 +19,7 @@
#include <OpenGl_GlCore12.hxx>
//! OpenGL 1.3 without deprecated entry points.
struct OpenGl_GlCore13 : public OpenGl_GlCore12
struct OpenGl_GlCore13Fwd : public OpenGl_GlCore12Fwd
{
public: //! @name OpenGL 1.3 additives to 1.2
@@ -39,4 +39,73 @@ public: //! @name OpenGL 1.3 additives to 1.2
};
//! OpenGL 1.3 core based on 1.2 version.
struct OpenGl_GlCore13 : public OpenGl_GlCore12
{
public: //! @name OpenGL 1.3 additives to 1.2
#if !defined(GL_ES_VERSION_2_0)
using OpenGl_GlFunctions::glCompressedTexImage3D;
using OpenGl_GlFunctions::glCompressedTexImage1D;
using OpenGl_GlFunctions::glCompressedTexSubImage3D;
using OpenGl_GlFunctions::glCompressedTexSubImage1D;
using OpenGl_GlFunctions::glGetCompressedTexImage;
#endif
using OpenGl_GlFunctions::glActiveTexture;
using OpenGl_GlFunctions::glSampleCoverage;
using OpenGl_GlFunctions::glCompressedTexImage2D;
using OpenGl_GlFunctions::glCompressedTexSubImage2D;
#if !defined(GL_ES_VERSION_2_0)
public: //! @name Begin/End primitive specification (removed since 3.1)
using OpenGl_GlFunctions::glMultiTexCoord1d;
using OpenGl_GlFunctions::glMultiTexCoord1dv;
using OpenGl_GlFunctions::glMultiTexCoord1f;
using OpenGl_GlFunctions::glMultiTexCoord1fv;
using OpenGl_GlFunctions::glMultiTexCoord1i;
using OpenGl_GlFunctions::glMultiTexCoord1iv;
using OpenGl_GlFunctions::glMultiTexCoord1s;
using OpenGl_GlFunctions::glMultiTexCoord1sv;
using OpenGl_GlFunctions::glMultiTexCoord2d;
using OpenGl_GlFunctions::glMultiTexCoord2dv;
using OpenGl_GlFunctions::glMultiTexCoord2f;
using OpenGl_GlFunctions::glMultiTexCoord2fv;
using OpenGl_GlFunctions::glMultiTexCoord2i;
using OpenGl_GlFunctions::glMultiTexCoord2iv;
using OpenGl_GlFunctions::glMultiTexCoord2s;
using OpenGl_GlFunctions::glMultiTexCoord2sv;
using OpenGl_GlFunctions::glMultiTexCoord3d;
using OpenGl_GlFunctions::glMultiTexCoord3dv;
using OpenGl_GlFunctions::glMultiTexCoord3f;
using OpenGl_GlFunctions::glMultiTexCoord3fv;
using OpenGl_GlFunctions::glMultiTexCoord3i;
using OpenGl_GlFunctions::glMultiTexCoord3iv;
using OpenGl_GlFunctions::glMultiTexCoord3s;
using OpenGl_GlFunctions::glMultiTexCoord3sv;
using OpenGl_GlFunctions::glMultiTexCoord4d;
using OpenGl_GlFunctions::glMultiTexCoord4dv;
using OpenGl_GlFunctions::glMultiTexCoord4f;
using OpenGl_GlFunctions::glMultiTexCoord4fv;
using OpenGl_GlFunctions::glMultiTexCoord4i;
using OpenGl_GlFunctions::glMultiTexCoord4iv;
using OpenGl_GlFunctions::glMultiTexCoord4s;
using OpenGl_GlFunctions::glMultiTexCoord4sv;
using OpenGl_GlFunctions::glClientActiveTexture;
public: //! @name Matrix operations (removed since 3.1)
using OpenGl_GlFunctions::glLoadTransposeMatrixf;
using OpenGl_GlFunctions::glLoadTransposeMatrixd;
using OpenGl_GlFunctions::glMultTransposeMatrixf;
using OpenGl_GlFunctions::glMultTransposeMatrixd;
#endif
};
#endif // _OpenGl_GlCore13_Header

View File

@@ -19,10 +19,9 @@
#include <OpenGl_GlCore13.hxx>
//! OpenGL 1.4 core based on 1.3 version.
struct OpenGl_GlCore14 : public OpenGl_GlCore13
template<typename theBaseClass_t>
struct OpenGl_TmplCore14 : public theBaseClass_t
{
private:
typedef OpenGl_GlCore13 theBaseClass_t;
public: //! @name OpenGL 1.4 additives to 1.3
@@ -39,4 +38,10 @@ public: //! @name OpenGL 1.4 additives to 1.3
};
//! OpenGL 1.4 core based on 1.3 version.
typedef OpenGl_TmplCore14<OpenGl_GlCore13> OpenGl_GlCore14;
//! OpenGL 1.4 without deprecated entry points.
typedef OpenGl_TmplCore14<OpenGl_GlCore13Fwd> OpenGl_GlCore14Fwd;
#endif // _OpenGl_GlCore14_Header

View File

@@ -18,11 +18,12 @@
#include <OpenGl_GlCore14.hxx>
//! OpenGL 1.5 core based on 1.4 version.
struct OpenGl_GlCore15 : public OpenGl_GlCore14
/**
* OpenGL 1.5 core based on 1.4 version.
*/
template<typename theBaseClass_t>
struct OpenGl_TmplCore15 : public theBaseClass_t
{
private:
typedef OpenGl_GlCore14 theBaseClass_t;
public: //! @name OpenGL 1.5 additives to 1.4
@@ -52,4 +53,10 @@ public: //! @name OpenGL 1.5 additives to 1.4
};
//! OpenGL 1.5 core based on 1.4 version.
typedef OpenGl_TmplCore15<OpenGl_GlCore14> OpenGl_GlCore15;
//! OpenGL 1.5 without deprecated entry points.
typedef OpenGl_TmplCore15<OpenGl_GlCore14Fwd> OpenGl_GlCore15Fwd;
#endif // _OpenGl_GlCore15_Header

Some files were not shown because too many files have changed in this diff Show More