mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
68d403eda6 |
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,8 +1,6 @@
|
||||
.gitattributes eol=lf
|
||||
.gitignore eol=lf
|
||||
*.txt eol=lf
|
||||
*.htm eol=lf
|
||||
*.html eol=lf
|
||||
*.h eol=lf
|
||||
*.c eol=lf
|
||||
*.inl eol=lf
|
||||
@@ -31,7 +29,6 @@
|
||||
*.xib eol=lf
|
||||
*.plist eol=lf
|
||||
*.java eol=lf
|
||||
*.js eol=lf
|
||||
*.igs eol=lf
|
||||
*.iges eol=lf
|
||||
*.stp eol=lf
|
||||
@@ -47,7 +44,6 @@
|
||||
FILES eol=lf
|
||||
PACKAGES eol=lf
|
||||
EXTERNLIB eol=lf
|
||||
EXTERNLIB_STATIC eol=lf
|
||||
UDLIST eol=lf
|
||||
tests/* eol=lf
|
||||
tests/*/* eol=lf
|
||||
|
@@ -364,21 +364,10 @@ if (MSVC)
|
||||
endif()
|
||||
|
||||
# whether use optional 3rdparty or not
|
||||
set (USE_TK ON CACHE BOOL "${USE_TK_DESCR}")
|
||||
set (USE_FREETYPE ON CACHE BOOL "${USE_FREETYPE_DESCR}")
|
||||
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
|
||||
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
|
||||
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
|
||||
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
|
||||
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
|
||||
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
|
||||
|
||||
if (WIN32 OR ANDROID OR IOS OR EMSCRIPTEN)
|
||||
# no Xlib
|
||||
elseif (APPLE)
|
||||
set (USE_XLIB OFF CACHE BOOL "${USE_XLIB_DESCR}")
|
||||
if (APPLE)
|
||||
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
|
||||
else()
|
||||
set (USE_XLIB ON CACHE BOOL "${USE_XLIB_DESCR}")
|
||||
set (USE_GLX OFF)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
@@ -447,6 +436,12 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# DRAWEXE excluded when library build is static
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
list (REMOVE_ITEM BUILD_TOOLKITS DRAWEXE)
|
||||
message (STATUS "Info: DRAWEXE is not included due to ${BUILD_LIBRARY_TYPE} build library type")
|
||||
endif()
|
||||
|
||||
# accumulate all used toolkits
|
||||
list (REMOVE_DUPLICATES BUILD_TOOLKITS)
|
||||
set (RAW_BUILD_TOOLKITS)
|
||||
@@ -498,9 +493,7 @@ endif()
|
||||
# search for CSF variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_TclTkLibs CAN_USE_TK)
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_XwLibs CAN_USE_XLIB)
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE CAN_USE_FREETYPE)
|
||||
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_TBB CAN_USE_TBB)
|
||||
@@ -509,59 +502,27 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
|
||||
# define CSF variable
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
|
||||
|
||||
# Tcl (mandatory for Draw Harness)
|
||||
if (USE_TCL)
|
||||
message (STATUS "Info: TCL is used by OCCT")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl")
|
||||
|
||||
message (STATUS "Info: TK is used by OCCT")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
|
||||
endif()
|
||||
|
||||
# Tk (optional for Draw Harness)
|
||||
if (CAN_USE_TK)
|
||||
if (USE_TK)
|
||||
message (STATUS "Info: TK is used by OCCT")
|
||||
add_definitions (-DHAVE_TK)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
||||
endif()
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("USE_TK")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
||||
endif()
|
||||
|
||||
# Xlib
|
||||
if (CAN_USE_XLIB)
|
||||
if (USE_XLIB)
|
||||
message (STATUS "Info: Xlib is used by OCCT")
|
||||
add_definitions (-DHAVE_XLIB)
|
||||
if (APPLE)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
|
||||
endif()
|
||||
endif()
|
||||
if (USE_FREETYPE)
|
||||
message (STATUS "Info: Freetype is used by OCCT")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("USE_XLIB")
|
||||
endif()
|
||||
|
||||
# FreeType
|
||||
if (CAN_USE_FREETYPE)
|
||||
if (USE_FREETYPE)
|
||||
message (STATUS "Info: FreeType is used by OCCT")
|
||||
add_definitions (-DHAVE_FREETYPE)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
|
||||
endif()
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("USE_FREETYPE")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2")
|
||||
OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREETYPE")
|
||||
endif()
|
||||
|
||||
@@ -581,8 +542,16 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# GLX
|
||||
if (USE_GLX)
|
||||
add_definitions (-DMACOSX_USE_GLX)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/glx")
|
||||
endif()
|
||||
|
||||
# FREEIMAGE
|
||||
if (CAN_USE_FREEIMAGE)
|
||||
set (USE_FREEIMAGE OFF CACHE BOOL "${USE_FREEIMAGE_DESCR}")
|
||||
|
||||
if (USE_FREEIMAGE)
|
||||
add_definitions (-DHAVE_FREEIMAGE)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
|
||||
@@ -601,6 +570,8 @@ endif()
|
||||
# search for CSF_OpenVR variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
|
||||
if (CAN_USE_OPENVR)
|
||||
set (USE_OPENVR OFF CACHE BOOL "${USE_OPENVR_DESCR}")
|
||||
|
||||
if (USE_OPENVR)
|
||||
add_definitions (-DHAVE_OPENVR)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
|
||||
@@ -620,6 +591,8 @@ endif()
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
|
||||
|
||||
if (CAN_USE_FFMPEG)
|
||||
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
|
||||
|
||||
if (USE_FFMPEG)
|
||||
add_definitions (-DHAVE_FFMPEG)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
|
||||
@@ -682,6 +655,8 @@ endif()
|
||||
|
||||
# TBB
|
||||
if (NOT DEFINED ANDROID AND CAN_USE_TBB)
|
||||
set (USE_TBB OFF CACHE BOOL "${USE_TBB_DESCR}")
|
||||
|
||||
if (USE_TBB)
|
||||
add_definitions (-DHAVE_TBB)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
|
||||
@@ -702,6 +677,8 @@ endif()
|
||||
# search for CSF_RapidJSON variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON)
|
||||
if (CAN_USE_RAPIDJSON)
|
||||
set (USE_RAPIDJSON OFF CACHE BOOL "${USE_RAPIDJSON_DESCR}")
|
||||
|
||||
if (USE_RAPIDJSON)
|
||||
add_definitions (-DHAVE_RAPIDJSON)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson")
|
||||
@@ -718,6 +695,8 @@ endif()
|
||||
|
||||
# EIGEN
|
||||
if (CAN_USE_EIGEN)
|
||||
set (USE_EIGEN OFF CACHE BOOL "${USE_EIGEN_DESCR}")
|
||||
|
||||
if (USE_EIGEN)
|
||||
add_definitions (-DHAVE_EIGEN)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
|
||||
@@ -1236,7 +1215,7 @@ if (WIN32)
|
||||
set (SET_OpenCASCADE_WITH_D3D "set (OpenCASCADE_WITH_D3D ${USE_D3D})")
|
||||
endif()
|
||||
if (APPLE)
|
||||
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_XLIB})")
|
||||
set (SET_OpenCASCADE_WITH_GLX "set (OpenCASCADE_WITH_GLX ${USE_GLX})")
|
||||
endif()
|
||||
|
||||
# Configure and install cmake config file
|
||||
|
@@ -197,6 +197,7 @@ t TKPrim
|
||||
t TKShHealing
|
||||
t TKTopAlgo
|
||||
t TKXMesh
|
||||
n InterfaceGraphic
|
||||
n AIS
|
||||
n Aspect
|
||||
n DsgPrs
|
||||
|
@@ -49,28 +49,18 @@ else()
|
||||
set (CSF_OpenVR)
|
||||
endif()
|
||||
|
||||
# TCL
|
||||
# TCL/TK
|
||||
if (USE_TCL)
|
||||
if (WIN32)
|
||||
set (CSF_TclLibs "tcl86")
|
||||
else()
|
||||
if(APPLE)
|
||||
set (CSF_TclLibs Tcl)
|
||||
elseif(UNIX)
|
||||
set (CSF_TclLibs "tcl8.6")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# TK
|
||||
if (USE_TK)
|
||||
if (WIN32)
|
||||
set (CSF_TclTkLibs "tk86")
|
||||
else()
|
||||
if(APPLE)
|
||||
set (CSF_TclTkLibs Tk)
|
||||
set (CSF_TclLibs Tcl)
|
||||
elseif(UNIX)
|
||||
set (CSF_TclTkLibs "tk8.6")
|
||||
set (CSF_TclLibs "tcl8.6")
|
||||
set (CSF_TclTkLibs "tk8.6")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -109,7 +99,7 @@ else()
|
||||
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
|
||||
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
|
||||
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
|
||||
elseif (USE_XLIB)
|
||||
elseif (USE_GLX)
|
||||
set (CSF_OpenGlLibs GL)
|
||||
set (CSF_XwLibs "X11 Xext Xmu Xi")
|
||||
else()
|
||||
@@ -118,26 +108,16 @@ else()
|
||||
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
|
||||
endif()
|
||||
|
||||
elseif (EMSCRIPTEN)
|
||||
set (CSF_ThreadLibs "pthread rt stdc++")
|
||||
set (CSF_OpenGlesLibs "EGL GLESv2")
|
||||
set (CSF_dl "dl")
|
||||
elseif (ANDROID)
|
||||
set (CSF_ThreadLibs "c")
|
||||
set (CSF_OpenGlesLibs "EGL GLESv2")
|
||||
set (CSF_androidlog "log")
|
||||
elseif (UNIX)
|
||||
set (CSF_ThreadLibs "pthread rt stdc++")
|
||||
if (USE_XLIB)
|
||||
set (CSF_OpenGlLibs "GL")
|
||||
set (CSF_XwLibs "X11 Xext Xmu Xi")
|
||||
else()
|
||||
set (CSF_OpenGlLibs "GL EGL")
|
||||
endif()
|
||||
set (CSF_OpenGlLibs "GL")
|
||||
set (CSF_OpenGlesLibs "EGL GLESv2")
|
||||
set (CSF_XwLibs "X11 Xext Xmu Xi")
|
||||
set (CSF_dl "dl")
|
||||
if (USE_FREETYPE)
|
||||
set (CSF_fontconfig "fontconfig")
|
||||
endif()
|
||||
set (CSF_fontconfig "fontconfig")
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -22,7 +22,7 @@ if ("${OCCT_TOOLKITS_NAME_SUFFIX}" STREQUAL "")
|
||||
set (OCCT_TOOLKITS_NAME_SUFFIX "TOOLKITS")
|
||||
endif()
|
||||
|
||||
# parse PACKAGES file
|
||||
# parce PACKAGES file
|
||||
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
|
||||
if ("${USED_PACKAGES}" STREQUAL "")
|
||||
set (USED_PACKAGES ${PROJECT_NAME})
|
||||
@@ -39,7 +39,7 @@ set (PRECOMPILED_DEFS)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
|
||||
if (WIN32 AND NOT EXECUTABLE_PROJECT)
|
||||
if (WIN32)
|
||||
list (APPEND PRECOMPILED_DEFS "-DOCCT_STATIC_BUILD")
|
||||
endif()
|
||||
endif()
|
||||
@@ -228,10 +228,6 @@ if (EXECUTABLE_PROJECT)
|
||||
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.wasm DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
else()
|
||||
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RESOURCE_FILES} ${${PROJECT_NAME}_MOC_FILES})
|
||||
|
||||
@@ -287,12 +283,8 @@ endif()
|
||||
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
|
||||
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
|
||||
|
||||
# parse EXTERNLIB file
|
||||
if (CUSTOM_EXTERNLIB)
|
||||
set (USED_EXTERNLIB_AND_TOOLKITS ${CUSTOM_EXTERNLIB})
|
||||
else()
|
||||
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
endif()
|
||||
# parce EXTERNLIB file
|
||||
FILE_TO_LIST ("${RELATIVE_SOURCES_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
|
||||
if (NOT COMMENT_FOUND)
|
||||
@@ -391,7 +383,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if(IS_VTK_9XX)
|
||||
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
|
||||
endif()
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# tcl
|
||||
|
||||
if (NOT DEFINED INSTALL_TCL)
|
||||
if (NOT DEFINED INSTALL_TCL AND BUILD_SHARED_LIBS)
|
||||
set (INSTALL_TCL OFF CACHE BOOL "${INSTALL_TCL_DESCR}")
|
||||
endif()
|
||||
|
||||
@@ -14,30 +14,30 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# tcl library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY OR NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "tcl library" FORCE)
|
||||
endif()
|
||||
# tcl library directory
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
||||
endif()
|
||||
|
||||
# tcl library directory
|
||||
if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
||||
endif()
|
||||
# tcl shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "tcl shared library" FORCE)
|
||||
# tcl shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
||||
endif()
|
||||
|
||||
|
||||
# search for tcl in user defined directory
|
||||
if (NOT 3RDPARTY_TCL_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tcl TCL_DIR_NAME)
|
||||
@@ -64,197 +64,203 @@ if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl dir and library
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
||||
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
|
||||
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# tcl dir and library
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
||||
if (TCL_LIBRARY AND EXISTS "${TCL_LIBRARY}")
|
||||
set (3RDPARTY_TCL_LIBRARY "${TCL_LIBRARY}" CACHE FILEPATH "TCL library" FORCE)
|
||||
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TCL_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TCL_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
elseif (3RDPARTY_TCL_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TCL_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TCL_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
elseif (3RDPARTY_TCL_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
find_library (3RDPARTY_TCL_DLL NAMES ${CSF_TclLibs}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
||||
|
||||
# tcl dir and library
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
||||
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
|
||||
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
|
||||
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# tcl dir and library
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY)
|
||||
set (3RDPARTY_TCL_LIBRARY "3RDPARTY_TCL_LIBRARY-NOTFOUND" CACHE FILEPATH "TCL library" FORCE)
|
||||
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
|
||||
PATHS "${3RDPARTY_TCL_LIBRARY_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# search in another place if previous search doesn't find anything
|
||||
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
||||
NO_DEFAULT_PATH)
|
||||
# search in another place if previous search doesn't find anything
|
||||
find_library (3RDPARTY_TCL_LIBRARY NAMES ${CSF_TclLibs}
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION "")
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
|
||||
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
|
||||
|
||||
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
|
||||
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
||||
message (STATUS "Info: TCL version isn't found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
|
||||
if (3RDPARTY_TCL_LIBRARY_VERSION)
|
||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TCL_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TCL_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
else()
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY OR NOT EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
set (3RDPARTY_TCL_LIBRARY "" CACHE FILEPATH "TCL library" FORCE)
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
|
||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
if (NOT 3RDPARTY_TCL_LIBRARY_DIR AND 3RDPARTY_TCL_LIBRARY)
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "${3RDPARTY_TCL_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TCL library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
|
||||
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
|
||||
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION "")
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
get_filename_component (TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)
|
||||
string(REGEX REPLACE "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY_NAME}")
|
||||
|
||||
if (NOT "${TCL_LIBRARY_VERSION}" STREQUAL "${TCL_LIBRARY_NAME}")
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION "${TCL_LIBRARY_VERSION}")
|
||||
else() # if the version isn't found - seek other library with 8.6 or 8.5 version in the same dir
|
||||
message (STATUS "Info: TCL version isn't found")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "")
|
||||
if (3RDPARTY_TCL_LIBRARY_VERSION)
|
||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TCL_MAJOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TCL_MINOR_VERSION "${3RDPARTY_TCL_LIBRARY_VERSION}")
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TCL_MAJOR_VERSION}.${3RDPARTY_TCL_MINOR_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install tcl
|
||||
if (INSTALL_TCL)
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
if (WIN32)
|
||||
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
|
||||
if (NOT 3RDPARTY_TCL_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
|
||||
|
||||
# collect and install all dlls from tcl dll dirs
|
||||
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TCL_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
else()
|
||||
get_filename_component (3RDPARTY_TCL_LIBRARY_DIR_PARENT "${3RDPARTY_TCL_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
|
||||
else()
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR_BIN}")
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_BIN}i")
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_BIN}d")
|
||||
set (3RDPARTY_TCL_DLL "3RDPARTY_TCL_DLL-NOTFOUND" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
find_library (3RDPARTY_TCL_DLL NAMES tcl${3RDPARTY_TCL_LIBRARY_VERSION}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_TCL_DLL OR NOT EXISTS "${3RDPARTY_TCL_DLL}")
|
||||
set (3RDPARTY_TCL_DLL "" CACHE FILEPATH "TCL shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
|
||||
else()
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR_LIB}")
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_LIB}i")
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_LIB}d")
|
||||
if (NOT 3RDPARTY_TCL_DLL_DIR AND 3RDPARTY_TCL_DLL)
|
||||
get_filename_component (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
|
||||
set (3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL_DIR}" CACHE FILEPATH "The directory containing TCL shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TCL_TCLSH_VERSION)
|
||||
# tcl is required to install in lib folder (without)
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_TCL_INCLUDE_DIR AND EXISTS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TCL_INCLUDE_DIR}")
|
||||
else()
|
||||
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.")
|
||||
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_TCL_DIR "")
|
||||
else()
|
||||
# the library directory for using by the executable
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
|
||||
else()
|
||||
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
|
||||
if (3RDPARTY_TCL_DLL OR EXISTS "${3RDPARTY_TCL_DLL}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TCL_DLL_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NO_DLLS 3RDPARTY_TCL_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
|
||||
# install tcl
|
||||
if (INSTALL_TCL)
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
if (WIN32)
|
||||
# tcl 8.6 requires zlib. install all dlls from tcl bin folder that may contain zlib also
|
||||
|
||||
# collect and install all dlls from tcl dll dirs
|
||||
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_DIR_BIN}")
|
||||
else()
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR_BIN}")
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_BIN}i")
|
||||
install (FILES ${TCL_DLLS}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_BIN}d")
|
||||
endif()
|
||||
else()
|
||||
get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH)
|
||||
|
||||
if (SINGLE_GENERATOR)
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_DIR_LIB}")
|
||||
else()
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR_LIB}")
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR_LIB}i")
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_LIB}d")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TCL_TCLSH_VERSION)
|
||||
# tcl is required to install in lib folder (without)
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR_LIB}")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR_LIB}")
|
||||
else()
|
||||
message (STATUS "\nWarning: tclX.X subdir won't be copied during the installation process.")
|
||||
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_TCL_DIR "")
|
||||
else()
|
||||
# the library directory for using by the executable
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_DLL_DIR})
|
||||
else()
|
||||
set (USED_3RDPARTY_TCL_DIR ${3RDPARTY_TCL_LIBRARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
|
||||
endif()
|
||||
|
||||
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
||||
|
||||
@@ -279,3 +285,10 @@ OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_LIBRARY_DIR)
|
||||
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL)
|
||||
OCCT_CHECK_AND_UNSET (3RDPARTY_TCL_DLL_DIR)
|
||||
OCCT_CHECK_AND_UNSET (INSTALL_TCL)
|
||||
endif()
|
||||
|
@@ -155,18 +155,12 @@ set (3RDPARTY_DIR_DESCR
|
||||
third-party product have been found - corresponding CMake variables will be specified
|
||||
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
|
||||
|
||||
set (USE_TK_DESCR
|
||||
"Indicates whether Tk product should be used by Draw Harness for user interface")
|
||||
|
||||
set (USE_FREETYPE_DESCR
|
||||
"Indicates whether FreeType product should be used in OCCT for text rendering using external font files")
|
||||
|
||||
set (USE_FFMPEG_DESCR
|
||||
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for
|
||||
multimedia data handling, open-source software libraries used for video encoding and decoding.")
|
||||
|
||||
set (USE_FREEIMAGE_DESCR
|
||||
"Indicates whether FreeImage product should be used in OCCT visualization
|
||||
"Indicates whether Freeimage product should be used in OCCT visualization
|
||||
module for support of popular graphics image formats (PNG, BMP etc)")
|
||||
|
||||
set (USE_OPENVR_DESCR
|
||||
@@ -196,7 +190,7 @@ ToolKit, the technology of Kitware Inc intended for general-purpose scientific
|
||||
visualization. OCCT comes with a bridge between CAD data representation and
|
||||
VTK by means of its dedicated VIS component (VTK Integration Services).")
|
||||
|
||||
set (USE_XLIB_DESCR "Indicates whether X11 is used or not")
|
||||
set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
|
||||
|
||||
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
|
||||
|
||||
|
@@ -175,9 +175,7 @@ proc wokdep:gui:UpdateList {} {
|
||||
set anBin32Errs {}
|
||||
set anBin64Errs {}
|
||||
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
if { "$::HAVE_FREETYPE" == "true" } {
|
||||
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
}
|
||||
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
if { "$::HAVE_GLES2" == "true" } {
|
||||
wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||
@@ -473,8 +471,6 @@ ttk::label .myFrame.myHxxChecks.myScutsLbl -text "Strategy for filling he
|
||||
ttk::label .myFrame.mySrchLbl -text "3rd-parties search path:" -padding {5 5 80 5}
|
||||
entry .myFrame.mySrchEntry -textvariable PRODUCTS_PATH_INPUT -width 80
|
||||
ttk::button .myFrame.mySrchBrowseBtn -text "Browse" -command wokdep:gui:BrowsePartiesRoot
|
||||
checkbutton .myFrame.myChecks.myFreeTypeCheck -offvalue "false" -onvalue "true" -variable HAVE_FREETYPE -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myFreeTypeLbl -text "Use FreeType"
|
||||
checkbutton .myFrame.myChecks.myFImageCheck -offvalue "false" -onvalue "true" -variable HAVE_FREEIMAGE -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myFImageLbl -text "Use FreeImage"
|
||||
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
|
||||
@@ -496,8 +492,8 @@ ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg"
|
||||
checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList
|
||||
ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON"
|
||||
|
||||
checkbutton .myFrame.myChecks.myXLibCheck -offvalue "false" -onvalue "true" -variable HAVE_XLIB
|
||||
ttk::label .myFrame.myChecks.myXLibLbl -text "Use X11 for windows drawing"
|
||||
checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX
|
||||
ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing"
|
||||
ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK"
|
||||
checkbutton .myFrame.myChecks.myVtkCheck -offvalue "false" -onvalue "true" -variable HAVE_VTK -command wokdep:gui:UpdateList
|
||||
|
||||
@@ -608,10 +604,10 @@ incr aRowIter
|
||||
|
||||
grid .myFrame.myChecks -row $aRowIter -column 0 -columnspan 10 -sticky w
|
||||
incr aRowIter
|
||||
grid .myFrame.myChecks.myFreeTypeCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myFreeTypeLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 2 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
|
||||
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
if { "$::tcl_platform(os)" != "Darwin" } {
|
||||
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
@@ -625,16 +621,16 @@ grid .myFrame.myChecks.myQtCheck -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myQtLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
|
||||
incr aCheckRowIter
|
||||
grid .myFrame.myChecks.myFImageCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myFImageLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
|
||||
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
|
||||
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
if { "$::tcl_platform(platform)" == "windows" } {
|
||||
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
} else {
|
||||
grid .myFrame.myChecks.myXLibCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myXLibLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
} elseif { "$::tcl_platform(os)" == "Darwin" } {
|
||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
}
|
||||
grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e
|
||||
grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w
|
||||
@@ -642,10 +638,8 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e
|
||||
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w
|
||||
|
||||
incr aCheckRowIter
|
||||
grid .myFrame.myChecks.myFFmpegCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myFFmpegLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
|
||||
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
||||
grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e
|
||||
grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w
|
||||
grid .myFrame.myChecks.myOpenVrCheck -row $aCheckRowIter -column 4 -sticky e
|
||||
grid .myFrame.myChecks.myOpenVrLbl -row $aCheckRowIter -column 5 -sticky w
|
||||
grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e
|
||||
|
@@ -68,12 +68,9 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } {
|
||||
}
|
||||
|
||||
# fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
|
||||
set THE_ENV_VARIABLES {HAVE_TK HAVE_FREETYPE HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENVR HAVE_OPENCL CHECK_QT4 CHECK_JDK HAVE_XLIB HAVE_RelWithDebInfo BUILD_Inspector}
|
||||
foreach anEnvIter $THE_ENV_VARIABLES { set ${anEnvIter} "false" }
|
||||
set HAVE_TK "true"
|
||||
set HAVE_FREETYPE "true"
|
||||
if { "$tcl_platform(os)" != "Darwin" } { set HAVE_XLIB "true" }
|
||||
set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENVR HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo BUILD_Inspector}
|
||||
foreach anEnvIter $THE_ENV_VARIABLES {
|
||||
set ${anEnvIter} "false"
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
set ${anEnvIter} "$::env(${anEnvIter})"
|
||||
}
|
||||
@@ -81,12 +78,12 @@ foreach anEnvIter $THE_ENV_VARIABLES {
|
||||
# do not export platform-specific variables
|
||||
if { "$::tcl_platform(os)" == "Darwin" } {
|
||||
set HAVE_GLES2 ""
|
||||
} else {
|
||||
set MACOSX_USE_GLX ""
|
||||
}
|
||||
if { "$tcl_platform(platform)" != "windows" } {
|
||||
set HAVE_D3D ""
|
||||
set HAVE_RelWithDebInfo ""
|
||||
} else {
|
||||
set HAVE_XLIB ""
|
||||
}
|
||||
foreach anEnvIter {ARCH VCVER VCVARS PRJFMT } {
|
||||
if { [info exists ::env(${anEnvIter})] } {
|
||||
@@ -1196,7 +1193,7 @@ proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64
|
||||
upvar $theErrBin64 anErrBin64
|
||||
|
||||
set isFound "true"
|
||||
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::HAVE_XLIB" != "true" ) } {
|
||||
if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
|
||||
return "$isFound"
|
||||
}
|
||||
|
||||
|
@@ -686,17 +686,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
||||
# Write specific options
|
||||
if { $docType == "REFMAN" } {
|
||||
|
||||
# always include optional components
|
||||
set aHaveD3dBack ""
|
||||
set aHaveGlesBack ""
|
||||
set aHaveVtkBack ""
|
||||
if { [info exists ::env(HAVE_D3D)] } { set aHaveD3dBack "$::env(HAVE_D3D)" }
|
||||
if { [info exists ::env(HAVE_GLES2)] } { set aHaveGlesBack "$::env(HAVE_GLES2)" }
|
||||
if { [info exists ::env(HAVE_VTK)] } { set aHaveVtkBack "$::env(HAVE_VTK)" }
|
||||
set ::env(HAVE_D3D) "true"
|
||||
set ::env(HAVE_GLES2) "true"
|
||||
set ::env(HAVE_VTK) "true"
|
||||
|
||||
# Load lists of modules scripts
|
||||
if { $productsPath == "" } {
|
||||
set modules_scripts [glob -nocomplain -type f -directory "[OCCDoc_GetSourceDir $productsPath]/OS/" *.tcl]
|
||||
@@ -822,11 +811,6 @@ proc OCCDoc_MakeDoxyfile {docType outDir tagFileDir {doxyFileName} {generatorMod
|
||||
|
||||
puts $doxyFile ""
|
||||
|
||||
# restore environment variables
|
||||
set ::env(HAVE_D3D) "$aHaveD3dBack"
|
||||
set ::env(HAVE_GLES2) "$aHaveGlesBack"
|
||||
set ::env(HAVE_VTK) "$aHaveVtkBack"
|
||||
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
|
||||
# Add common options for generation of Overview and User Guides
|
||||
|
@@ -129,7 +129,7 @@ proc osutils:isEqualContent { theContent1 theContent2 } {
|
||||
# Auxiliary function for writing new file content only if it has been actually changed
|
||||
# (e.g. to preserve file timestamp on no change).
|
||||
# Useful for automatically (re)generated files.
|
||||
proc osutils:writeTextFile { theFile theContent {theEol lf} {theToBackup false} } {
|
||||
proc osutils:writeTextFile { theFile theContent {theEol lf} } {
|
||||
if {[file exists "${theFile}"]} {
|
||||
set aFileOld [open "${theFile}" rb]
|
||||
fconfigure $aFileOld -translation crlf
|
||||
@@ -143,10 +143,6 @@ proc osutils:writeTextFile { theFile theContent {theEol lf} {theToBackup false}
|
||||
return false
|
||||
}
|
||||
|
||||
if { $theToBackup == true } {
|
||||
puts "Warning: file ${theFile} is updated. Old content is saved to ${theFile}.bak"
|
||||
file copy -force -- "${theFile}" "${theFile}.bak"
|
||||
}
|
||||
file delete -force "${theFile}"
|
||||
}
|
||||
|
||||
@@ -377,28 +373,29 @@ proc copy_with_warning {from to} {
|
||||
# Generate auxiliary scripts for launching IDE.
|
||||
proc genprojbat {theFormat thePlatform theSolution} {
|
||||
set aTargetPlatformExt sh
|
||||
set aTargetEol lf
|
||||
if { $thePlatform == "wnt" || $thePlatform == "uwp" } {
|
||||
set aTargetPlatformExt bat
|
||||
set aTargetEol crlf
|
||||
}
|
||||
|
||||
if { [file exists "$::path/src/OS/FoundationClasses.tcl"] || ![file exists "$::path/env.${aTargetPlatformExt}"] } {
|
||||
# generate env.bat/sh
|
||||
set anEnvTmplFilePath "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}"
|
||||
set anEnvTmplFile [open "$anEnvTmplFilePath" "r"]
|
||||
set anEnvTmpl [read $anEnvTmplFile]
|
||||
close $anEnvTmplFile
|
||||
if {"$theFormat" != "cmake"} {
|
||||
# copy env.bat/sh only if not yet present
|
||||
if { ! [file exists "$::path/env.${aTargetPlatformExt}"] } {
|
||||
set anEnvTmplFile [open "$::THE_CASROOT/adm/templates/env.${aTargetPlatformExt}" "r"]
|
||||
set anEnvTmpl [read $anEnvTmplFile]
|
||||
close $anEnvTmplFile
|
||||
|
||||
set aCasRoot ""
|
||||
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
|
||||
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
|
||||
set aCasRoot ""
|
||||
if { [file normalize "$::path"] != [file normalize "$::THE_CASROOT"] } {
|
||||
set aCasRoot [relativePath "$::path" "$::THE_CASROOT"]
|
||||
}
|
||||
|
||||
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
|
||||
|
||||
set anEnvFile [open "$::path/env.${aTargetPlatformExt}" "w"]
|
||||
puts $anEnvFile $anEnvTmpl
|
||||
close $anEnvFile
|
||||
}
|
||||
|
||||
regsub -all -- {__CASROOT__} $anEnvTmpl "$aCasRoot" anEnvTmpl
|
||||
set aLineList [split $anEnvTmpl "\n"]
|
||||
osutils:writeTextFile "$::path/env.${aTargetPlatformExt}" $aLineList $aTargetEol true
|
||||
|
||||
copy_with_warning "$::THE_CASROOT/adm/templates/draw.${aTargetPlatformExt}" "$::path/draw.${aTargetPlatformExt}"
|
||||
|
||||
if { "$::BUILD_Inspector" == "true" } {
|
||||
@@ -1412,13 +1409,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
|
||||
unset theCsfLibsMap
|
||||
unset theCsfFrmsMap
|
||||
|
||||
if { "$::HAVE_FREETYPE" == "true" } {
|
||||
set aLibsMap(CSF_FREETYPE) "freetype"
|
||||
}
|
||||
set aLibsMap(CSF_FREETYPE) "freetype"
|
||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
||||
if { "$::HAVE_TK" == "true" } {
|
||||
set aLibsMap(CSF_TclTkLibs) "tk8.6"
|
||||
}
|
||||
set aLibsMap(CSF_TclTkLibs) "tk8.6"
|
||||
if { "$::HAVE_FREEIMAGE" == "true" } {
|
||||
if { "$theOS" == "wnt" } {
|
||||
set aLibsMap(CSF_FreeImagePlus) "FreeImage"
|
||||
@@ -1474,9 +1467,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
|
||||
|
||||
# the naming is different on Windows
|
||||
set aLibsMap(CSF_TclLibs) "tcl86"
|
||||
if { "$::HAVE_TK" == "true" } {
|
||||
set aLibsMap(CSF_TclTkLibs) "tk86"
|
||||
}
|
||||
set aLibsMap(CSF_TclTkLibs) "tk86"
|
||||
if { "$theRelease" == "true" } {
|
||||
set aLibsMap(CSF_QT) "Qt5Gui Qt5Widgets Qt5Xml Qt5Core"
|
||||
} else {
|
||||
@@ -1491,11 +1482,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
|
||||
}
|
||||
} else {
|
||||
set aLibsMap(CSF_dl) "dl"
|
||||
if { "$::HAVE_XLIB" == "true" } {
|
||||
set aLibsMap(CSF_OpenGlLibs) "GL"
|
||||
} else {
|
||||
set aLibsMap(CSF_OpenGlLibs) "GL EGL"
|
||||
}
|
||||
set aLibsMap(CSF_OpenGlLibs) "GL"
|
||||
set aLibsMap(CSF_OpenGlesLibs) "EGL GLESv2"
|
||||
if { "$theOS" == "mac" || "$theOS" == "ios" } {
|
||||
set aLibsMap(CSF_objc) "objc"
|
||||
@@ -1509,30 +1496,22 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
|
||||
set aFrmsMap(CSF_Appkit) "AppKit"
|
||||
}
|
||||
set aFrmsMap(CSF_IOKit) "IOKit"
|
||||
set aLibsMap(CSF_TclLibs) ""
|
||||
set aLibsMap(CSF_TclTkLibs) ""
|
||||
set aFrmsMap(CSF_TclLibs) "Tcl"
|
||||
if { "$::HAVE_TK" == "true" } {
|
||||
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
||||
}
|
||||
set aLibsMap(CSF_TclLibs) ""
|
||||
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
||||
set aLibsMap(CSF_TclTkLibs) ""
|
||||
set aLibsMap(CSF_QT) "QtCore QtGui"
|
||||
} elseif { "$theOS" == "android" } {
|
||||
set aLibsMap(CSF_androidlog) "log"
|
||||
} else {
|
||||
if { "$::HAVE_FREETYPE" == "true" } {
|
||||
set aLibsMap(CSF_fontconfig) "fontconfig"
|
||||
}
|
||||
set aLibsMap(CSF_fontconfig) "fontconfig"
|
||||
if { "$theOS" == "qnx" } {
|
||||
# CSF_ThreadLibs - pthread API is part of libc on QNX
|
||||
} else {
|
||||
set aLibsMap(CSF_ThreadLibs) "pthread rt"
|
||||
if { "$::HAVE_TK" == "true" } {
|
||||
set aLibsMap(CSF_TclTkLibs) "tk8.6"
|
||||
}
|
||||
if { "$::HAVE_XLIB" == "true" } {
|
||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||
set aLibsMap(CSF_MotifLibs) "X11"
|
||||
}
|
||||
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
|
||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||
set aLibsMap(CSF_MotifLibs) "X11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ aHxxRoot = $$OccGitRoot/inc
|
||||
INCLUDEPATH += $$aHxxRoot
|
||||
|
||||
# CSF variables
|
||||
HAVE_FREETYPE { CSF_FREETYPE = -lfreetype }
|
||||
CSF_FREETYPE = -lfreetype
|
||||
CSF_TclLibs = -ltcl8.6
|
||||
CSF_TclTkLibs = -ltk8.6
|
||||
HAVE_FREEIMAGE { CSF_FreeImagePlus = -lfreeimage } else:win32 { CSF_FreeImagePlus = -lwindowscodecs -lole32 }
|
||||
@@ -59,16 +59,12 @@ win32 {
|
||||
} else {
|
||||
CSF_dl = -ldl
|
||||
CSF_ThreadLibs = -lpthread -lrt
|
||||
CSF_OpenGlLibs = -lGL
|
||||
CSF_OpenGlesLibs = -lEGL -lGLESv2
|
||||
CSF_TclTkLibs = -ltk8.6
|
||||
HAVE_XLIB {
|
||||
CSF_OpenGlLibs = -lGL
|
||||
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
|
||||
CSF_MotifLibs = -lX11
|
||||
} else {
|
||||
CSF_OpenGlLibs = -lGL -lEGL
|
||||
}
|
||||
HAVE_FREETYPE { CSF_fontconfig = -lfontconfig }
|
||||
CSF_TclTkLibs = -lX11 -ltk8.6
|
||||
CSF_XwLibs = -lX11 -lXext -lXmu -lXi
|
||||
CSF_MotifLibs = -lX11
|
||||
CSF_fontconfig = -lfontconfig
|
||||
}
|
||||
|
||||
for (aCfgIter, CONFIG) {
|
||||
|
@@ -9,10 +9,6 @@
|
||||
# - Open project in Qt Creator, and call "Run qmake".
|
||||
# - Close the project in Qt Creator, open it again so that you should see the sub-modules in Project tree; call "Run qmake" again.
|
||||
# - "Run qmake" and perform Build.
|
||||
#
|
||||
# Within Debian-based Linux repository Qt Creator can be installed like this:
|
||||
# > sudo apt-get install qtcreator qtbase5-dev
|
||||
|
||||
TEMPLATE = subdirs
|
||||
exists(custom.auto.pri) { include(custom.auto.pri) }
|
||||
exists(custom.pri) { include(custom.pri) }
|
||||
|
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorCodeStyle>
|
||||
<!-- Written by QtCreator 3.6.1, 2016-05-19T14:46:43. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>CodeStyleData</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="AlignAssignments">true</value>
|
||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="BindStarToIdentifier">false</value>
|
||||
<value type="bool" key="BindStarToLeftSpecifier">true</value>
|
||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
||||
<value type="bool" key="BindStarToTypeName">true</value>
|
||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
||||
<value type="bool" key="IndentBlockBody">true</value>
|
||||
<value type="bool" key="IndentBlockBraces">false</value>
|
||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentClassBraces">false</value>
|
||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
||||
<value type="bool" key="IndentEnumBraces">false</value>
|
||||
<value type="bool" key="IndentFunctionBody">true</value>
|
||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
||||
<value type="bool" key="IndentNamespaceBody">true</value>
|
||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
||||
<value type="int" key="IndentSize">2</value>
|
||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
||||
<value type="bool" key="IndentSwitchLabels">true</value>
|
||||
<value type="int" key="PaddingMode">2</value>
|
||||
<value type="bool" key="SpacesForTabs">true</value>
|
||||
<value type="int" key="TabSize">2</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>DisplayName</variable>
|
||||
<value type="QString">occt</value>
|
||||
</data>
|
||||
</qtcreator>
|
@@ -12,7 +12,6 @@ set VS=14
|
||||
set VSDATA=2015
|
||||
set VSPLATFORM=Win64
|
||||
set "BUILD_DIR=build-vs%VS%-%VSPLATFORM%"
|
||||
set "OCCT3RDPARTY="
|
||||
set "INSTALL_DIR=%SrcRoot%\install"
|
||||
|
||||
set BUILD_ADDITIONAL_TOOLKITS=
|
||||
|
@@ -13,7 +13,6 @@ rem Paths to 3rd-party tools and libraries
|
||||
set "aCmakeBin="
|
||||
set "aFreeType="
|
||||
set "aRapidJson="
|
||||
set "aTcl="
|
||||
|
||||
rem Build stages to perform
|
||||
set "toCMake=1"
|
||||
@@ -31,7 +30,6 @@ set "BUILD_ModelingAlgorithms=ON"
|
||||
set "BUILD_Visualization=ON"
|
||||
set "BUILD_ApplicationFramework=ON"
|
||||
set "BUILD_DataExchange=ON"
|
||||
set "BUILD_Draw=OFF"
|
||||
|
||||
rem Optional 3rd-party libraries to enable
|
||||
set "USE_RAPIDJSON=OFF"
|
||||
@@ -164,16 +162,11 @@ if ["%toCMake%"] == ["1"] (
|
||||
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
|
||||
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
|
||||
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
|
||||
-D BUILD_MODULE_Draw:BOOL="OFF" ^
|
||||
-D BUILD_DOC_Overview:BOOL="OFF" ^
|
||||
-D USE_RAPIDJSON:BOOL="%USE_RAPIDJSON%" ^
|
||||
-D 3RDPARTY_RAPIDJSON_DIR:PATH="%aRapidJson%" ^
|
||||
-D 3RDPARTY_RAPIDJSON_INCLUDE_DIR:PATH="%aRapidJson%/include" ^
|
||||
-D 3RDPARTY_TCL_DIR:PATH="%aTcl%" ^
|
||||
-D 3RDPARTY_TCL_INCLUDE_DIR:PATH="%aTcl%/include" ^
|
||||
-D 3RDPARTY_TCL_LIBRARY_DIR:PATH="%aTcl%/lib" ^
|
||||
-D 3RDPARTY_TCL_LIBRARY:FILEPATH="%aTcl%/lib/libtcl.a" ^
|
||||
-D USE_TK:BOOL="OFF" ^
|
||||
"%aCasSrc%"
|
||||
|
||||
if errorlevel 1 (
|
||||
|
@@ -17,8 +17,6 @@ set "ARCH=64"
|
||||
set "VCVARS="
|
||||
set "HAVE_TBB=false"
|
||||
set "HAVE_OPENCL=false"
|
||||
set "HAVE_TK=true"
|
||||
set "HAVE_FREETYPE=true"
|
||||
set "HAVE_FREEIMAGE=false"
|
||||
set "HAVE_FFMPEG=false"
|
||||
set "HAVE_VTK=false"
|
||||
@@ -58,9 +56,9 @@ rem Decode VCVER variable and define related ones:
|
||||
rem
|
||||
rem VCFMT - "vc" followed by full version number of Visual Studio toolset
|
||||
rem (same as VCVER without optional suffix "-uwp")
|
||||
rem VCLIB - name of folder containing binaries
|
||||
rem VCLIB - name of folder contining binaries
|
||||
rem (same as VCVER except without third version in number)
|
||||
rem VCPROP - name of required Visual Studio Workload (starting with VS 2017)
|
||||
rem VCPROP - name of required Visual Studion Workload (starting with VS 2017)
|
||||
rem
|
||||
rem Note that for VS before 2015 (vc14) always
|
||||
rem VCFMT=VCLIB=VCVER and VCPROP=NativeDesktop
|
||||
@@ -184,8 +182,6 @@ set "CSF_OPT_CMPL="
|
||||
set "PRODUCTS_DEFINES="
|
||||
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB" & set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
|
||||
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL" & set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
|
||||
if ["%HAVE_TK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TK" & set "CSF_DEFINES=HAVE_TK;%CSF_DEFINES%"
|
||||
if ["%HAVE_FREETYPE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREETYPE;%CSF_DEFINES%"
|
||||
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%"
|
||||
@@ -203,20 +199,20 @@ if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
|
||||
rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
|
||||
if not ["%PRODUCTS_DEFINES%"] == [""] set "CSF_OPT_CMPL=%CSF_OPT_CMPL% %PRODUCTS_DEFINES%"
|
||||
|
||||
rem ----- Collect 3rd-parties additional include paths into compiler options -----
|
||||
rem ----- Colect 3rd-parties additional include paths into compiler options -----
|
||||
for %%a in ("%CSF_OPT_INC:;=";"%") do (
|
||||
set "anItem=%%~a"
|
||||
if not ["%%~a"] == [""] call :concatCmplInc %%~a
|
||||
)
|
||||
|
||||
rem ----- Collect 3rd-parties additional library paths (32-bit) into linker options -----
|
||||
rem ----- Colect 3rd-parties additional library paths (32-bit) into linker options -----
|
||||
set "OPT_LIB32="
|
||||
for %%a in ("%CSF_OPT_LIB32:;=";"%") do (
|
||||
set "anItem=%%~a"
|
||||
if not ["%%~a"] == [""] call :concatLib32 %%~a
|
||||
)
|
||||
|
||||
rem ----- Collect 3rd-parties additional library paths (64-bit) into linker options -----
|
||||
rem ----- Colect 3rd-parties additional library paths (64-bit) into linker options -----
|
||||
set "OPT_LIB64="
|
||||
for %%a in ("%CSF_OPT_LIB64:;=";"%") do (
|
||||
set "anItem=%%~a"
|
||||
@@ -248,7 +244,7 @@ if ["%CASDEB%"] == ["d"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PAT
|
||||
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32I%;%PATH%"
|
||||
if ["%CASDEB%"] == ["i"] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64I%;%PATH%"
|
||||
|
||||
rem ----- Set environment variables used by OCCT -----
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
set MMGT_CLEAR=1
|
||||
set "CSF_SHMessage=%CSF_OCCTResourcePath%\SHMessage"
|
||||
|
@@ -3,16 +3,12 @@
|
||||
# go to the script directory
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
aSystem=`uname -s`
|
||||
|
||||
# Reset values
|
||||
export CASROOT="__CASROOT__"
|
||||
export CASDEB=""
|
||||
export PRJFMT="";
|
||||
export HAVE_TBB="false";
|
||||
export HAVE_OPENCL="false";
|
||||
export HAVE_TK="true";
|
||||
export HAVE_FREETYPE="true";
|
||||
export HAVE_FREEIMAGE="false";
|
||||
export HAVE_FFMPEG="false";
|
||||
export HAVE_VTK="false";
|
||||
@@ -22,10 +18,7 @@ export HAVE_LIBLZMA="false";
|
||||
export HAVE_RAPIDJSON="false";
|
||||
export HAVE_OPENVR="false";
|
||||
export HAVE_E57="false";
|
||||
export HAVE_XLIB="true";
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export HAVE_XLIB="false";
|
||||
fi
|
||||
export MACOSX_USE_GLX="false";
|
||||
export CSF_OPT_INC=""
|
||||
export CSF_OPT_LIB32=""
|
||||
export CSF_OPT_LIB64=""
|
||||
@@ -65,6 +58,7 @@ else
|
||||
export ARCH="64";
|
||||
fi
|
||||
|
||||
aSystem=`uname -s`
|
||||
if [ "$aSystem" == "Darwin" ]; then
|
||||
export WOKSTATION="mac";
|
||||
export ARCH="64";
|
||||
@@ -106,8 +100,6 @@ export CSF_OPT_CMPL=""
|
||||
# Optiona 3rd-parties should be enabled by HAVE macros
|
||||
if [ "$HAVE_TBB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"; fi
|
||||
if [ "$HAVE_OPENCL" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
|
||||
if [ "$HAVE_TK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TK"; fi
|
||||
if [ "$HAVE_FREETYPE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREETYPE"; 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
|
||||
@@ -117,7 +109,8 @@ if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
|
||||
if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi
|
||||
if [ "$HAVE_OPENVR" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENVR"; fi
|
||||
if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi
|
||||
if [ "$HAVE_XLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_XLIB"; fi
|
||||
# Option to compile OCCT with X11 libs on Mac OS X
|
||||
if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi
|
||||
|
||||
# To split string into array
|
||||
aDelimBack=$IFS
|
||||
|
25
dox/build/build_3rdparty/building_3rdparty.md
vendored
25
dox/build/build_3rdparty/building_3rdparty.md
vendored
@@ -265,18 +265,6 @@ There are two types of third-party products, which are necessary to build OCCT:
|
||||
* FreeImage 3.14.1 - 3.16.0;
|
||||
* VTK 6.1.0.
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
|
||||
|
||||
**Debian-based distributives**
|
||||
|
||||
All 3rd-party products required for building of OCCT could be installed
|
||||
from official repositories. You may install them from console using apt-get utility:
|
||||
|
||||
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libfreeimage-dev rapidjson-dev
|
||||
|
||||
Building is possible with C++ compliant compiler:
|
||||
|
||||
sudo apt-get install g++
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_2_1 Tcl/Tk
|
||||
|
||||
@@ -451,6 +439,19 @@ Download the necessary archive from https://www.vtk.org/VTK/resources/software.h
|
||||
|
||||
make install
|
||||
|
||||
@subsection dev_guides__building_3rdparty_linux_4 Installation From Official Repositories
|
||||
|
||||
**Debian-based distributives**
|
||||
|
||||
All 3rd-party products required for building of OCCT could be installed
|
||||
from official repositories. You may install them from console using apt-get utility:
|
||||
|
||||
sudo apt-get install tcllib tklib tcl-dev tk-dev libfreetype-dev libxt-dev libxmu-dev libxi-dev libgl1-mesa-dev libfreeimage-dev
|
||||
|
||||
Building is possible with C++ compliant compiler:
|
||||
|
||||
sudo apt-get install g++
|
||||
|
||||
@section build_3rdparty_macos Mac OS X
|
||||
|
||||
This document presents additional guidelines for building third-party products
|
||||
|
@@ -471,7 +471,7 @@ The environment is defined in the file *custom.sh* which can be edited directly:
|
||||
* "HardLink* - hard links to headers located in *src* will be created.
|
||||
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
|
||||
~~~~~
|
||||
export HAVE_FREEIMAGE=false
|
||||
export HAVE_GL2PS=false
|
||||
~~~~~
|
||||
|
||||
Alternatively, or when *custom.sh* does not exist, you can launch *genconf.sh* to configure environment interactively:
|
||||
@@ -544,7 +544,7 @@ directly:
|
||||
* "HardLink* - hard links to headers located in *src* will be created.
|
||||
* For optional third-party libraries, set corresponding environment variable <i>HAVE_<LIBRARY_NAME></i> to either *false*, e.g.:
|
||||
~~~~~
|
||||
export HAVE_FREEIMAGE=false
|
||||
export HAVE_GL2PS=false
|
||||
~~~~~
|
||||
|
||||
Alternatively, or when *custom.sh* or *custom.bat* does not exist, you can launch **genconf** tool to configure
|
||||
|
@@ -21,6 +21,7 @@ FILE_PATTERNS = *.md *.dox
|
||||
RECURSIVE = YES
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
GENERATE_DOCSET = NO
|
||||
GENERATE_CHI = NO
|
||||
GENERATE_QHP = NO
|
||||
|
@@ -21,6 +21,7 @@ FILE_PATTERNS = *.md *.dox
|
||||
RECURSIVE = YES
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = YES
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
GENERATE_DOCSET = NO
|
||||
GENERATE_CHI = NO
|
||||
GENERATE_QHP = NO
|
||||
|
@@ -180,7 +180,7 @@ drivers for a function driver table with the help of *TFunction_DriverTable* cl
|
||||
const TDF_LabelList& currentFunctions = iterator.Current();
|
||||
|
||||
//The list of current functions is iterated.
|
||||
TDF_ListIteratorOfLabelList currentterator( currentFunctions );
|
||||
TDF_ListIteratorOfLabelList currentterator( currentFucntions );
|
||||
for (; currentIterator.More(); currentIterator.Next())
|
||||
{
|
||||
// An interface for the function is created.
|
||||
|
@@ -11004,9 +11004,9 @@ Converts a surface of linear extrusion, revolution and offset surfaces into BSpl
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
DT_ToBspl res sh
|
||||
== error = 5.20375663162094e-08 spans = 10
|
||||
== Surface is approximated with continuity 2
|
||||
DT_ToBspl res sh
|
||||
== error = 5.20375663162094e-08 spans = 10
|
||||
== Surface is aproximated with continuity 2
|
||||
~~~~~
|
||||
|
||||
@section occt_draw_10 Performance evaluation commands
|
||||
|
@@ -1171,29 +1171,27 @@ It is possible to describe any model by means of standard OCAF attributes.
|
||||
|
||||
@subsubsection occt_ocaf_6_2_3 Comparison and analysis of approaches
|
||||
|
||||
Below are described two different model implementations:
|
||||
one is based on standard OCAF attributes and the other is based
|
||||
on the creation of a new attribute possessing all data of the model.
|
||||
|
||||
Below are described two different model implementations:
|
||||
one is based on standard OCAF attributes and the other is based
|
||||
on the creation of a new attribute possessing all data of the model.
|
||||
|
||||
A load is distributed through the shape.
|
||||
The measurements are taken at particular points defined by (x, y and z) coordinates.
|
||||
The load is represented as a projection onto X, Y and Z axes of the local coordinate system at each point of measurement.
|
||||
A matrix of transformation is needed to convert the local coordinate system to the global one, but this is optional.
|
||||
|
||||
So, we have 15 double values at each point of measurement.
|
||||
If the number of such points is 100 000, for example, it means
|
||||
that we have to store 1 500 000 double values in the OCAF document.
|
||||
|
||||
The first approach consists in using standard OCAF attributes.
|
||||
Besides, there are several variants of how the standard attributes may be used:
|
||||
The load is represented as a projection onto X, Y and Z axes of the local co-ordinate system at each point of measurement.
|
||||
A matrix of transformation is needed to convert the local co-ordinate system to the global one, but this is optional.
|
||||
|
||||
So, we have 15 double values at each point of measurement.
|
||||
If the number of such points is 100 000, for example, it means
|
||||
that we have to store 1 500 000 double values in the OCAF document.
|
||||
|
||||
The first approach consists in using standard OCAF attributes.
|
||||
Besides, there are several variants of how the standard attributes may be used:
|
||||
* Allocation of all 1 500 000 double values as one array of double values attached to one label;
|
||||
* Allocation of values of one measure of load (15 values) as one array of double values and attachment of one point of measure to one label;
|
||||
* Allocation of each point of measure as an array of 3 double values attached to one label,
|
||||
the projection of load onto the local coordinate system axes as another array of 3 double values attached to a sub-label,
|
||||
and the matrix of projection (9 values) as the third array also attached to a sub-label.
|
||||
|
||||
Certainly, other variants are also possible.
|
||||
|
||||
* Allocation of each point of measure as an array of 3 double values attached to one label, the projection of load onto the local co-ordinate system axes as another array of 3 double values attached to a sub-label, and the matrix of projection (9 values) as the third array also attached to a sub-label.
|
||||
|
||||
Certainly, other variants are also possible.
|
||||
|
||||
@figure{ocaf_tree_wp_image003.png,"Allocation of all data as one array of double values",350}
|
||||
|
||||
The first approach to allocation of all data represented as one array of double values
|
||||
@@ -1562,45 +1560,43 @@ To automatically erase the nail from the viewer and the data tree it is enough
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
|
||||
// The scope of functions is defined.
|
||||
Handle(TFunction_Scope) aScope = TFunction_Scope::Set (anyLabel);
|
||||
|
||||
// The information on modifications in the model is received.
|
||||
TFunction_Logbook& aLog = aScope->GetLogbook();
|
||||
|
||||
// The iterator is iInitialized by the scope of functions.
|
||||
TFunction_Iterator anIterator (anyLabel);
|
||||
anIterator.SetUsageOfExecutionOrder (true);
|
||||
|
||||
// The function is iterated, its dependency is checked on the modified data and executed if necessary.
|
||||
for (; anIterator.more(); anIterator.Next())
|
||||
{
|
||||
// The function iterator may return a list of current functions for execution.
|
||||
// It might be useful for multi-threaded execution of functions.
|
||||
const TDF_LabelList& aCurrentFunctions = anIterator.Current();
|
||||
|
||||
// The list of current functions is iterated.
|
||||
for (TDF_ListIteratorOfLabelList aCurrentIterator (aCurrentFunctions);
|
||||
aCurrentIterator.More(); aCurrentIterator.Next())
|
||||
{
|
||||
// An interface for the function is created.
|
||||
TFunction_IFunction anInterface (aCurrentIterator.Value());
|
||||
|
||||
// The function driver is retrieved.
|
||||
Handle(TFunction_Driver) aDriver = anInterface.GetDriver();
|
||||
|
||||
// The dependency of the function on the modified data is checked.
|
||||
if (aDriver->MustExecute (aLog))
|
||||
{
|
||||
// The function is executed.
|
||||
int aRes = aDriver->Execute (aLog);
|
||||
if (aRes)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// The scope of functions is defined.
|
||||
Handle(TFunction_Scope) scope = TFunction_Scope::Set( anyLabel );
|
||||
|
||||
// The information on modifications in the model is received.
|
||||
TFunction_Logbook& log = scope-GetLogbook();
|
||||
|
||||
// The iterator is iInitialized by the scope of functions.
|
||||
TFunction_Iterator iterator( anyLabel );
|
||||
Iterator.SetUsageOfExecutionOrder( true );
|
||||
|
||||
// The function is iterated, its dependency is checked on the modified data and executed if necessary.
|
||||
for (; iterator.more(); iterator.Next())
|
||||
{
|
||||
// The function iterator may return a list of current functions for execution.
|
||||
// It might be useful for multi-threaded execution of functions.
|
||||
const TDF_LabelList& currentFunctions = iterator.Current();
|
||||
|
||||
//The list of current functions is iterated.
|
||||
TDF_ListIteratorOfLabelList currentterator( currentFucntions );
|
||||
for (; currentIterator.More(); currentIterator.Next())
|
||||
{
|
||||
// An interface for the function is created.
|
||||
TFunction_IFunction interface( currentIterator.Value() );
|
||||
|
||||
// The function driver is retrieved.
|
||||
Handle(TFunction_Driver) driver = interface.GetDriver();
|
||||
|
||||
// The dependency of the function on the modified data is checked.
|
||||
If (driver-MustExecute( log ))
|
||||
{
|
||||
// The function is executed.
|
||||
int ret = driver-Execute( log );
|
||||
if ( ret )
|
||||
return false;
|
||||
} // end if check on modification
|
||||
} // end of iteration of current functions
|
||||
} // end of iteration of functions.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@@ -1,27 +0,0 @@
|
||||
<svg width="188" height="90" viewBox="0 0 188 90" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="188" height="90" fill="white"/>
|
||||
<rect x="6.5" y="6.5" width="75" height="21" stroke="#7C97DE"/>
|
||||
<path d="M8 8V16H13V26H21V16H26V8H8Z" fill="#DDDDDD"/>
|
||||
<path d="M42 15H41V16V25H35V9H51V15H42Z" fill="#DDDDDD" stroke="#5BD6B8" stroke-width="2"/>
|
||||
<path d="M71 18V8H63V18H60V26H80V18H71Z" fill="#DDDDDD"/>
|
||||
<rect x="6.5" y="34.5" width="75" height="21" stroke="#7C97DE"/>
|
||||
<path d="M8 36V44H13V54H21V44H26V36H8Z" fill="#DDDDDD"/>
|
||||
<path d="M42 43H41V44V53H35V37H51V43H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
|
||||
<path d="M71 46V36H63V46H60V54H80V46H71Z" fill="#DDDDDD"/>
|
||||
<rect x="6.5" y="62.5" width="75" height="21" stroke="#7C97DE"/>
|
||||
<path d="M8 64V72H13V82H21V72H26V64H8Z" fill="#3D3ACF"/>
|
||||
<path d="M42 71H41V72V81H35V65H51V71H42Z" fill="#3D3ACF" stroke="#5BD6B8" stroke-width="2"/>
|
||||
<path d="M71 74V64H63V74H60V82H80V74H71Z" fill="#3D3ACF"/>
|
||||
<path d="M93 10L100 17L93 24V20H84V14H93V10Z" fill="#7C97DE"/>
|
||||
<path d="M93 38L100 45L93 52V48H84V42H93V38Z" fill="#7C97DE"/>
|
||||
<path d="M93 66L100 73L93 80V76H84V70H93V66Z" fill="#7C97DE"/>
|
||||
<path d="M108 8V16H113V26H121V16H126V8H108Z" fill="#DDDDDD"/>
|
||||
<path d="M108 36V44H113V54H121V44H126V36H108Z" fill="#DDDDDD"/>
|
||||
<path d="M108 64V72H113V82H121V72H126V64H108Z" fill="#DDDDDD"/>
|
||||
<path d="M152 8H134V26H142V16H152V8Z" fill="#3D3ACF"/>
|
||||
<path d="M152 36H134V54H142V44H152V36Z" fill="#DDDDDD"/>
|
||||
<path d="M152 64H134V82H142V72H152V64Z" fill="#3D3ACF"/>
|
||||
<path d="M171 18V8H163V18H160V26H180V18H171Z" fill="#DDDDDD"/>
|
||||
<path d="M171 46V36H163V46H160V54H180V46H171Z" fill="#DDDDDD"/>
|
||||
<path d="M171 74V64H163V74H160V82H180V74H171Z" fill="#DDDDDD"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1040,7 +1040,7 @@ Select* methods of AIS_InteractiveContext accept some selection scheme as parame
|
||||
| :----- | :----- | :----- | :----- | :----- |
|
||||
| AIS_SelectionScheme_Replace | @figure{visualization_selection_scheme_replace.svg, ""} | | AIS_SelectionScheme_XOR | @figure{visualization_selection_scheme_XOR.svg, ""} |
|
||||
| AIS_SelectionScheme_Add | @figure{visualization_selection_scheme_add.svg, ""} | | AIS_SelectionScheme_Clear | @figure{visualization_selection_scheme_clear.svg, ""} |
|
||||
| AIS_SelectionScheme_Remove | @figure{visualization_selection_scheme_remove.svg, ""} | | AIS_SelectionScheme_ReplaceExtra | @figure{visualization_selection_scheme_replaceExtra.svg, ""} |
|
||||
| AIS_SelectionScheme_Remove | @figure{visualization_selection_scheme_remove.svg, ""} | | | |
|
||||
|
||||
|
||||
@subsection occt_visu_3_5 Standard Interactive Object Classes
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<Sample name="Clear" function="ClearGrid2dSample"/>
|
||||
</MenuItem>
|
||||
<MenuItem name="Image">
|
||||
<Sample name="Background Image" function="BackgroundImage2dSample"/>
|
||||
<Sample name="Backgroung Image" function="BackgroungImage2dSample"/>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
@@ -577,7 +577,7 @@ bool OcctJni_Viewer::saveSnapshot (const TCollection_AsciiString& thePath,
|
||||
}
|
||||
|
||||
Image_AlienPixMap anAlienImage;
|
||||
if (!anAlienImage.InitTrash (Image_Format_BGRA, theWidth, theHeight))
|
||||
if (!anAlienImage.InitTrash (Image_PixMap::ImgBGRA, theWidth, theHeight))
|
||||
{
|
||||
Message::DefaultMessenger()->Send (TCollection_AsciiString() + "RGBA image " + theWidth + "x" + theHeight + " allocation failed", Message_Fail);
|
||||
return false;
|
||||
@@ -586,7 +586,7 @@ bool OcctJni_Viewer::saveSnapshot (const TCollection_AsciiString& thePath,
|
||||
// OpenGL ES does not support fetching data in BGRA format
|
||||
// while FreeImage does not support RGBA format.
|
||||
Image_PixMap anImage;
|
||||
anImage.InitWrapper (Image_Format_RGBA,
|
||||
anImage.InitWrapper (Image_PixMap::ImgRGBA,
|
||||
anAlienImage.ChangeData(),
|
||||
anAlienImage.SizeX(),
|
||||
anAlienImage.SizeY(),
|
||||
|
@@ -217,7 +217,7 @@ void OCC_2dView::OnUpdateBUTTONGridCancel(CCmdUI* pCmdUI)
|
||||
void OCC_2dView::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
OCC_BaseView::OnSize (nType, cx, cy);
|
||||
// Take care : This function is called before OnInitialUpdate
|
||||
// Take care : This fonction is call before OnInitialUpdate
|
||||
if (!myView.IsNull())
|
||||
myView->MustBeResized();
|
||||
}
|
||||
|
@@ -1,87 +1,87 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang=en-us>
|
||||
<head>
|
||||
<meta charset=utf-8><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
|
||||
<link rel="shortcut icon" href="lamp.ico" type="image/x-icon" />
|
||||
<title>OCCT WebGL Viewer Sample</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>OCCT WebGL Viewer Sample</h2>
|
||||
<div>
|
||||
<canvas id=occViewerCanvas oncontextmenu=event.preventDefault() tabindex=-1 style="border:0 none;background-color:#000" width="409" height="409"></canvas>
|
||||
<img id=occlogo src="OCC_logo.png" style="position: absolute; left: 20px; top: 0px; z-index: 2;" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="fileInput">Choose BREP file to upload: </label><input type="file" id="fileInput" accept=".brep">
|
||||
<input type="button" value="Clear All" onclick="OccViewerModule.removeAllObjects()">
|
||||
<input type="button" value="Fit All" onclick="OccViewerModule.fitAllObjects(true)">
|
||||
</div>
|
||||
<h4>Console output:</h4>
|
||||
<p id="output"></p>
|
||||
<script>
|
||||
//! Resize canvas to fit into window.
|
||||
function updateCanvasSize()
|
||||
{
|
||||
// size of canvas in logical (density-independent) units
|
||||
var aSizeX = Math.min (window.innerWidth, window.screen.availWidth);
|
||||
var aSizeY = Math.min (window.innerHeight, window.screen.availHeight);
|
||||
aSizeX = Math.max (300, aSizeX - 30);
|
||||
aSizeY = Math.max (300, aSizeY / 2);
|
||||
occViewerCanvas.style.width = aSizeX + "px";
|
||||
occViewerCanvas.style.height = aSizeY + "px";
|
||||
|
||||
// drawing buffer size (aka backing store)
|
||||
var aDevicePixelRatio = window.devicePixelRatio || 1;
|
||||
occViewerCanvas.width = aSizeX * aDevicePixelRatio;
|
||||
occViewerCanvas.height = aSizeY * aDevicePixelRatio;
|
||||
|
||||
occlogo.style.top = (aSizeY - 30) + "px";
|
||||
}
|
||||
window.onresize = updateCanvasSize;
|
||||
updateCanvasSize();
|
||||
|
||||
//! Check browser support.
|
||||
function isWasmSupported()
|
||||
{
|
||||
try {
|
||||
if (typeof WebAssembly === "object"
|
||||
&& typeof WebAssembly.instantiate === "function") {
|
||||
const aDummyModule = new WebAssembly.Module (Uint8Array.of (0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
if (aDummyModule instanceof WebAssembly.Module)
|
||||
{
|
||||
return new WebAssembly.Instance(aDummyModule) instanceof WebAssembly.Instance;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
if (!isWasmSupported())
|
||||
{
|
||||
var anElement = document.getElementById('output');
|
||||
anElement.innerHTML += "Browser is too old - WebAssembly support is missing!<br>Please check updates or install a modern browser.<br>";
|
||||
}
|
||||
|
||||
//! Handle file uploading.
|
||||
fileInput.onchange = function()
|
||||
{
|
||||
if (fileInput.files.length == 0) { return; }
|
||||
// Warning! Entire file is pre-loaded into memory.
|
||||
var aFile = fileInput.files[0];
|
||||
var aReader = new FileReader();
|
||||
aReader.onload = function()
|
||||
{
|
||||
var aDataArray = new Uint8Array (aReader.result);
|
||||
const aDataBuffer = OccViewerModule._malloc (aDataArray.length);
|
||||
OccViewerModule.HEAPU8.set (aDataArray, aDataBuffer);
|
||||
OccViewerModule.openFromMemory (aFile.name, aDataBuffer, aDataArray.length, true);
|
||||
//OccViewerModule._free (aDataBuffer); will be freed by called method
|
||||
OccViewerModule.displayGround (true);
|
||||
};
|
||||
aReader.readAsArrayBuffer(aFile);
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="occt-webgl-sample.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html lang=en-us>
|
||||
<head>
|
||||
<meta charset=utf-8><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
|
||||
<link rel="shortcut icon" href="lamp.ico" type="image/x-icon" />
|
||||
<title>OCCT WebGL Viewer Sample</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>OCCT WebGL Viewer Sample</h2>
|
||||
<div>
|
||||
<canvas id=occViewerCanvas oncontextmenu=event.preventDefault() tabindex=-1 style="border:0 none;background-color:#000" width="409" height="409"></canvas>
|
||||
<img id=occlogo src="OCC_logo.png" style="position: absolute; left: 20px; top: 0px; z-index: 2;" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="fileInput">Choose BREP file to upload: </label><input type="file" id="fileInput" accept=".brep">
|
||||
<input type="button" value="Clear All" onclick="OccViewerModule.removeAllObjects()">
|
||||
<input type="button" value="Fit All" onclick="OccViewerModule.fitAllObjects(true)">
|
||||
</div>
|
||||
<h4>Console output:</h4>
|
||||
<p id="output"></p>
|
||||
<script>
|
||||
//! Resize canvas to fit into window.
|
||||
function updateCanvasSize()
|
||||
{
|
||||
// size of canvas in logical (density-independent) units
|
||||
var aSizeX = Math.min (window.innerWidth, window.screen.availWidth);
|
||||
var aSizeY = Math.min (window.innerHeight, window.screen.availHeight);
|
||||
aSizeX = Math.max (300, aSizeX - 30);
|
||||
aSizeY = Math.max (300, aSizeY / 2);
|
||||
occViewerCanvas.style.width = aSizeX + "px";
|
||||
occViewerCanvas.style.height = aSizeY + "px";
|
||||
|
||||
// drawing buffer size (aka backing store)
|
||||
var aDevicePixelRatio = window.devicePixelRatio || 1;
|
||||
occViewerCanvas.width = aSizeX * aDevicePixelRatio;
|
||||
occViewerCanvas.height = aSizeY * aDevicePixelRatio;
|
||||
|
||||
occlogo.style.top = (aSizeY - 30) + "px";
|
||||
}
|
||||
window.onresize = updateCanvasSize;
|
||||
updateCanvasSize();
|
||||
|
||||
//! Check browser support.
|
||||
function isWasmSupported()
|
||||
{
|
||||
try {
|
||||
if (typeof WebAssembly === "object"
|
||||
&& typeof WebAssembly.instantiate === "function") {
|
||||
const aDummyModule = new WebAssembly.Module (Uint8Array.of (0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
if (aDummyModule instanceof WebAssembly.Module)
|
||||
{
|
||||
return new WebAssembly.Instance(aDummyModule) instanceof WebAssembly.Instance;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
if (!isWasmSupported())
|
||||
{
|
||||
var anElement = document.getElementById('output');
|
||||
anElement.innerHTML += "Browser is too old - WebAssembly support is missing!<br>Please check updates or install a modern browser.<br>";
|
||||
}
|
||||
|
||||
//! Handle file uploading.
|
||||
fileInput.onchange = function()
|
||||
{
|
||||
if (fileInput.files.length == 0) { return; }
|
||||
// Warning! Entire file is pre-loaded into memory.
|
||||
var aFile = fileInput.files[0];
|
||||
var aReader = new FileReader();
|
||||
aReader.onload = function()
|
||||
{
|
||||
var aDataArray = new Uint8Array (aReader.result);
|
||||
const aDataBuffer = OccViewerModule._malloc (aDataArray.length);
|
||||
OccViewerModule.HEAPU8.set (aDataArray, aDataBuffer);
|
||||
OccViewerModule.openFromMemory (aFile.name, aDataBuffer, aDataArray.length, true);
|
||||
//OccViewerModule._free (aDataBuffer); will be freed by called method
|
||||
OccViewerModule.displayGround (true);
|
||||
};
|
||||
aReader.readAsArrayBuffer(aFile);
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="occt-webgl-sample.js" charset="utf-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,28 +1,28 @@
|
||||
var OccViewerModule =
|
||||
{
|
||||
print: (function() {
|
||||
var anElement = document.getElementById('output');
|
||||
return function(theText) { anElement.innerHTML += theText + "<br>"; };
|
||||
})(),
|
||||
printErr: function(theText) {
|
||||
//var anElement = document.getElementById('output');
|
||||
//anElement.innerHTML += theText + "<br>";
|
||||
console.warn(theText);
|
||||
},
|
||||
canvas: (function() {
|
||||
var aCanvas = document.getElementById('occViewerCanvas');
|
||||
var aGlCtx = aCanvas.getContext ('webgl2', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } );
|
||||
if (aGlCtx == null) { aGlCtx = aCanvas.getContext ('webgl', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); }
|
||||
return aCanvas;
|
||||
})(),
|
||||
|
||||
onRuntimeInitialized: function() {
|
||||
//console.log(" @@ onRuntimeInitialized()" + Object.getOwnPropertyNames(OccViewerModule));
|
||||
}
|
||||
};
|
||||
|
||||
const OccViewerModuleInitialized = createOccViewerModule(OccViewerModule);
|
||||
OccViewerModuleInitialized.then(function(Module) {
|
||||
//OccViewerModule.setCubemapBackground ("cubemap.jpg");
|
||||
OccViewerModule.openFromUrl ("ball", "samples/Ball.brep");
|
||||
});
|
||||
var OccViewerModule =
|
||||
{
|
||||
print: (function() {
|
||||
var anElement = document.getElementById('output');
|
||||
return function(theText) { anElement.innerHTML += theText + "<br>"; };
|
||||
})(),
|
||||
printErr: function(theText) {
|
||||
//var anElement = document.getElementById('output');
|
||||
//anElement.innerHTML += theText + "<br>";
|
||||
console.warn(theText);
|
||||
},
|
||||
canvas: (function() {
|
||||
var aCanvas = document.getElementById('occViewerCanvas');
|
||||
var aGlCtx = aCanvas.getContext ('webgl2', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } );
|
||||
if (aGlCtx == null) { aGlCtx = aCanvas.getContext ('webgl', { alpha: false, depth: true, antialias: false, preserveDrawingBuffer: true } ); }
|
||||
return aCanvas;
|
||||
})(),
|
||||
|
||||
onRuntimeInitialized: function() {
|
||||
//console.log(" @@ onRuntimeInitialized()" + Object.getOwnPropertyNames(OccViewerModule));
|
||||
}
|
||||
};
|
||||
|
||||
const OccViewerModuleInitialized = createOccViewerModule(OccViewerModule);
|
||||
OccViewerModuleInitialized.then(function(Module) {
|
||||
//OccViewerModule.setCubemapBackground ("cubemap.jpg");
|
||||
OccViewerModule.openFromUrl ("ball", "samples/Ball.brep");
|
||||
});
|
||||
|
@@ -140,7 +140,7 @@ public:
|
||||
protected:
|
||||
|
||||
//! The TypeOfPresention3d means that the interactive object
|
||||
//! may have a presentation dependent on the view of Display.
|
||||
//! may have a presentation dependant of the view of Display.
|
||||
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||
|
||||
//! Set presentation display status.
|
||||
|
@@ -196,7 +196,7 @@ public:
|
||||
Standard_EXPORT void StopTransform (const Standard_Boolean theToApply = Standard_True);
|
||||
|
||||
//! Apply transformation made from mouse moving from start position
|
||||
//! (save on the first Transform() call and reset on DeactivateCurrentMode() call.)
|
||||
//! (save on the first Tranform() call and reset on DeactivateCurrentMode() call.)
|
||||
//! to the in/out mouse position (theX, theY)
|
||||
Standard_EXPORT gp_Trsf Transform (const Standard_Integer theX, const Standard_Integer theY,
|
||||
const Handle(V3d_View)& theView);
|
||||
@@ -361,7 +361,7 @@ protected:
|
||||
|
||||
Standard_EXPORT void setTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers);
|
||||
|
||||
//! Redefines local transformation management method to inform user of improper use.
|
||||
//! Redefines local transformation management method to inform user of inproper use.
|
||||
//! @warning this interactive object does not support setting custom local transformation,
|
||||
//! this class solely uses this property to implement visual positioning of the manipulator
|
||||
//! without need for recomputing presentation.
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_TransformPersScaledAbove.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_DatumAspect.hxx>
|
||||
@@ -416,40 +415,6 @@ Standard_Boolean AIS_Plane::Size(Standard_Real& X,Standard_Real& Y) const
|
||||
return Abs(X-Y)<=Precision::Confusion();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMinimumSize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Plane::SetMinimumSize (const Standard_Real theValue)
|
||||
{
|
||||
if (theValue <= 0)
|
||||
{
|
||||
UnsetMinimumSize();
|
||||
return;
|
||||
}
|
||||
Standard_Real aX, anY;
|
||||
Size (aX, anY);
|
||||
SetTransformPersistence (new Graphic3d_TransformPersScaledAbove (Min (aX, anY) / theValue, myCenter));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UnsetMinimumSize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Plane::UnsetMinimumSize()
|
||||
{
|
||||
SetTransformPersistence (NULL);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasMinimumSize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean AIS_Plane::HasMinimumSize() const
|
||||
{
|
||||
return !Handle(Graphic3d_TransformPersScaledAbove)::DownCast (TransformPersistence()).IsNull();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
|
@@ -66,15 +66,6 @@ public:
|
||||
|
||||
Standard_Boolean HasOwnSize() const { return myHasOwnSize; }
|
||||
|
||||
//! Sets transform persistence for zoom with value of minimum size
|
||||
Standard_EXPORT void SetMinimumSize (const Standard_Real theValue);
|
||||
|
||||
//! Unsets transform persistence zoom
|
||||
Standard_EXPORT void UnsetMinimumSize();
|
||||
|
||||
//! Returns true if transform persistence for zoom is set
|
||||
Standard_EXPORT Standard_Boolean HasMinimumSize() const;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 7; }
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KindOfInteractive_Datum; }
|
||||
|
@@ -31,7 +31,7 @@ class TColStd_HPackedMapOfInteger;
|
||||
//! The presentation supports two display modes:
|
||||
//! - Points.
|
||||
//! - Bounding box for highlighting.
|
||||
//! Presentation provides selection by bounding box.
|
||||
//! Presentation provides selection by bouding box.
|
||||
//! Selection and consequently highlighting can disabled by
|
||||
//! setting default selection mode to -1. There will be no way
|
||||
//! to select object from interactive view. Any calls to
|
||||
|
@@ -27,7 +27,7 @@ DEFINE_STANDARD_HANDLE(AIS_RubberBand, AIS_InteractiveObject)
|
||||
//! Presentation for drawing rubber band selection.
|
||||
//! It supports rectangle and polygonal selection.
|
||||
//! It is constructed in 2d overlay.
|
||||
//! Default configuration is built without filling.
|
||||
//! Default configaration is built without filling.
|
||||
//! For rectangle selection use SetRectangle() method.
|
||||
//! For polygonal selection use AddPoint() and GetPoints() methods.
|
||||
class AIS_RubberBand : public AIS_InteractiveObject
|
||||
|
@@ -149,29 +149,6 @@ void AIS_Selection::SelectOwners (const AIS_NArray1OfEntityOwner& thePickedOwner
|
||||
{
|
||||
return;
|
||||
}
|
||||
case AIS_SelectionScheme_ReplaceExtra:
|
||||
{
|
||||
// If picked owners is equivalent to the selected then just clear selected
|
||||
// Else go to AIS_SelectionScheme_Replace
|
||||
if (thePickedOwners.Size() == myresult.Size())
|
||||
{
|
||||
Standard_Boolean isTheSame = Standard_True;
|
||||
for (AIS_NArray1OfEntityOwner::Iterator aSelIter (thePickedOwners); aSelIter.More(); aSelIter.Next())
|
||||
{
|
||||
if (!myResultMap.IsBound (aSelIter.Value()))
|
||||
{
|
||||
isTheSame = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isTheSame)
|
||||
{
|
||||
Clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Standard_FALLTHROUGH
|
||||
case AIS_SelectionScheme_Replace:
|
||||
{
|
||||
Clear();
|
||||
|
@@ -22,9 +22,7 @@ enum AIS_SelectionScheme
|
||||
AIS_SelectionScheme_Add, //!< adds detected object to current selection
|
||||
AIS_SelectionScheme_Remove, //!< removes detected object from the current selection
|
||||
AIS_SelectionScheme_XOR, //!< performs XOR for detected objects, other selected not touched
|
||||
AIS_SelectionScheme_Clear, //!< clears current selection
|
||||
AIS_SelectionScheme_ReplaceExtra, //!< replace with one difference: if result of replace is an empty,
|
||||
//!< and current selection contains detected element, it will be selected
|
||||
AIS_SelectionScheme_Clear //!< clears current selection
|
||||
};
|
||||
|
||||
#endif // _AIS_SelectionScheme_HeaderFile
|
||||
|
@@ -404,11 +404,9 @@ Standard_Boolean AIS_TextLabel::calculateLabelParams (const gp_Pnt& thePosition,
|
||||
{
|
||||
// Get width and height of text
|
||||
Handle(Prs3d_TextAspect) anAsp = myDrawer->TextAspect();
|
||||
const Graphic3d_RenderingParams& aRendParams = GetContext()->CurrentViewer()->DefaultRenderingParams();
|
||||
Font_FTFontParams aFontParams;
|
||||
aFontParams.PointSize = (unsigned int) anAsp->Height();
|
||||
aFontParams.Resolution = aRendParams.Resolution;
|
||||
aFontParams.FontHinting = aRendParams.FontHinting;
|
||||
aFontParams.Resolution = GetContext()->CurrentViewer()->DefaultRenderingParams().Resolution;
|
||||
|
||||
Handle(Font_FTFont) aFont = Font_FTFont::FindAndCreate (anAsp->Aspect()->Font(),
|
||||
anAsp->Aspect()->GetTextFontAspect(),
|
||||
|
@@ -82,6 +82,8 @@ AIS_ViewController::AIS_ViewController()
|
||||
myMouseActiveGesture (AIS_MouseGesture_NONE),
|
||||
myMouseActiveIdleRotation (false),
|
||||
myMouseClickCounter (0),
|
||||
myMousePressed (Aspect_VKeyMouse_NONE),
|
||||
myMouseModifiers (Aspect_VKeyFlags_NONE),
|
||||
myMouseSingleButton (-1),
|
||||
myMouseStopDragOnUnclick (false),
|
||||
//
|
||||
@@ -97,8 +99,16 @@ AIS_ViewController::AIS_ViewController()
|
||||
myUpdateStartPointRot (true),
|
||||
myUpdateStartPointZRot (true),
|
||||
//
|
||||
my3dMouseNoRotate (false, false, false),
|
||||
my3dMouseToReverse (true, false, false),
|
||||
my3dMouseAccelTrans (2.0f),
|
||||
my3dMouseAccelRotate (4.0f),
|
||||
my3dMouseIsQuadric (true),
|
||||
//
|
||||
myPanPnt3d (Precision::Infinite(), 0.0, 0.0)
|
||||
{
|
||||
memset(my3dMouseButtonState, 0, sizeof(my3dMouseButtonState));
|
||||
myEventTimer.Start();
|
||||
myViewAnimation->SetOwnDuration (0.5);
|
||||
|
||||
myAnchorPointPrs1 = new AIS_Point (new Geom_CartesianPoint (0.0, 0.0, 0.0));
|
||||
@@ -1109,11 +1119,104 @@ bool AIS_ViewController::Update3dMouse (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
bool toUpdate = false;
|
||||
toUpdate = update3dMouseTranslation (theEvent) || toUpdate;
|
||||
toUpdate = (myToAllowRotation && update3dMouseRotation (theEvent)) || toUpdate;
|
||||
toUpdate = update3dMouseRotation (theEvent) || toUpdate;
|
||||
toUpdate = update3dMouseKeys (theEvent) || toUpdate;
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseTranslation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool AIS_ViewController::update3dMouseTranslation (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
if (!theEvent.IsTranslation())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isIdle = true;
|
||||
const double aTimeStamp = EventTime();
|
||||
const Graphic3d_Vec3d aTrans = theEvent.Translation (isIdle, my3dMouseIsQuadric) * my3dMouseAccelTrans;
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavSlideLeft, Aspect_VKey_NavSlideRight, aTimeStamp, aTrans.x());
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavForward, Aspect_VKey_NavBackward, aTimeStamp, aTrans.y());
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavSlideUp, Aspect_VKey_NavSlideDown, aTimeStamp, aTrans.z());
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseRotation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool AIS_ViewController::update3dMouseRotation (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
if (!theEvent.IsRotation()
|
||||
|| !myToAllowRotation)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isIdle = true, toUpdate = false;
|
||||
const double aTimeStamp = EventTime();
|
||||
const Graphic3d_Vec3d aRot3 = theEvent.Rotation (isIdle, my3dMouseIsQuadric) * my3dMouseAccelRotate;
|
||||
if (!my3dMouseNoRotate.x())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavLookUp, Aspect_VKey_NavLookDown, aTimeStamp, !my3dMouseToReverse.x() ? aRot3.x() : -aRot3.x());
|
||||
toUpdate = true;
|
||||
}
|
||||
if (!my3dMouseNoRotate.y())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavRollCW, Aspect_VKey_NavRollCCW, aTimeStamp, !my3dMouseToReverse.y() ? aRot3.y() : -aRot3.y());
|
||||
toUpdate = true;
|
||||
}
|
||||
if (!my3dMouseNoRotate.z())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavLookLeft, Aspect_VKey_NavLookRight, aTimeStamp, !my3dMouseToReverse.z() ? aRot3.z() : -aRot3.z());
|
||||
toUpdate = true;
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseKeys
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool AIS_ViewController::update3dMouseKeys (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
bool toUpdate = false;
|
||||
const double aTimeStamp = EventTime();
|
||||
if (theEvent.IsKeyState())
|
||||
{
|
||||
const uint32_t aKeyState = theEvent.KeyState();
|
||||
for (unsigned short aKeyBit = 0; aKeyBit < 32; ++aKeyBit)
|
||||
{
|
||||
const bool isPressed = (aKeyState & (1 << aKeyBit)) != 0;
|
||||
const bool isReleased = my3dMouseButtonState[aKeyBit] && !isPressed;
|
||||
//const bool isRepeated = my3dMouseButtonState[aKeyBit] && isPressed;
|
||||
my3dMouseButtonState[aKeyBit] = isPressed;
|
||||
if (!isReleased && !isPressed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Aspect_VKey aVKey = theEvent.HidToSpaceKey (aKeyBit);
|
||||
if (aVKey != Aspect_VKey_UNKNOWN)
|
||||
{
|
||||
toUpdate = true;
|
||||
if (isPressed)
|
||||
{
|
||||
KeyDown (aVKey, aTimeStamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
KeyUp (aVKey, aTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetNavigationMode
|
||||
// purpose :
|
||||
@@ -1137,7 +1240,7 @@ void AIS_ViewController::KeyDown (Aspect_VKey theKey,
|
||||
double theTime,
|
||||
double thePressure)
|
||||
{
|
||||
Aspect_WindowInputListener::KeyDown (theKey, theTime, thePressure);
|
||||
myKeys.KeyDown (theKey, theTime, thePressure);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -1147,7 +1250,7 @@ void AIS_ViewController::KeyDown (Aspect_VKey theKey,
|
||||
void AIS_ViewController::KeyUp (Aspect_VKey theKey,
|
||||
double theTime)
|
||||
{
|
||||
Aspect_WindowInputListener::KeyUp (theKey, theTime);
|
||||
myKeys.KeyUp (theKey, theTime);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -1159,7 +1262,7 @@ void AIS_ViewController::KeyFromAxis (Aspect_VKey theNegative,
|
||||
double theTime,
|
||||
double thePressure)
|
||||
{
|
||||
Aspect_WindowInputListener::KeyFromAxis (theNegative, thePositive, theTime, thePressure);
|
||||
myKeys.KeyFromAxis (theNegative, thePositive, theTime, thePressure);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <Aspect_VKeySet.hxx>
|
||||
#include <Aspect_TouchMap.hxx>
|
||||
#include <Aspect_WindowInputListener.hxx>
|
||||
#include <Aspect_XRHapticActionData.hxx>
|
||||
#include <Aspect_XRTrackedDeviceRole.hxx>
|
||||
#include <AIS_DragAction.hxx>
|
||||
@@ -52,7 +51,7 @@ class WNT_HIDSpaceMouse;
|
||||
//! - Mapping mouse/multi-touch input to View camera manipulations (panning/rotating/zooming).
|
||||
//! - Input events are not applied immediately but queued for separate processing from two working threads
|
||||
//! UI thread receiving user input and Rendering thread for OCCT 3D Viewer drawing.
|
||||
class AIS_ViewController : public Aspect_WindowInputListener
|
||||
class AIS_ViewController
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -222,30 +221,30 @@ public: //! @name global parameters
|
||||
|
||||
public: //! @name keyboard input
|
||||
|
||||
using Aspect_WindowInputListener::Keys;
|
||||
using Aspect_WindowInputListener::ChangeKeys;
|
||||
//! Return keyboard state.
|
||||
const Aspect_VKeySet& Keys() const { return myKeys; }
|
||||
|
||||
//! Return keyboard state.
|
||||
Aspect_VKeySet& ChangeKeys() { return myKeys; }
|
||||
|
||||
//! Press key.
|
||||
//! Default implementation updates internal cache.
|
||||
//! @param theKey key pressed
|
||||
//! @param theTime event timestamp
|
||||
Standard_EXPORT virtual void KeyDown (Aspect_VKey theKey,
|
||||
double theTime,
|
||||
double thePressure = 1.0) Standard_OVERRIDE;
|
||||
double thePressure = 1.0);
|
||||
|
||||
//! Release key.
|
||||
//! Default implementation updates internal cache.
|
||||
//! @param theKey key pressed
|
||||
//! @param theTime event timestamp
|
||||
Standard_EXPORT virtual void KeyUp (Aspect_VKey theKey,
|
||||
double theTime) Standard_OVERRIDE;
|
||||
double theTime);
|
||||
|
||||
//! Simulate key up/down events from axis value.
|
||||
//! Default implementation updates internal cache.
|
||||
Standard_EXPORT virtual void KeyFromAxis (Aspect_VKey theNegative,
|
||||
Aspect_VKey thePositive,
|
||||
double theTime,
|
||||
double thePressure) Standard_OVERRIDE;
|
||||
double thePressure);
|
||||
|
||||
//! Fetch active navigation actions.
|
||||
Standard_EXPORT AIS_WalkDelta FetchNavigationKeys (Standard_Real theCrouchRatio,
|
||||
@@ -314,7 +313,7 @@ public: //! @name mouse input
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! @param theDelta mouse cursor position and delta
|
||||
//! @return TRUE if new event has been created or FALSE if existing one has been updated
|
||||
Standard_EXPORT virtual bool UpdateMouseScroll (const Aspect_ScrollDelta& theDelta) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual bool UpdateMouseScroll (const Aspect_ScrollDelta& theDelta);
|
||||
|
||||
//! Handle mouse button press/release event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
@@ -327,7 +326,7 @@ public: //! @name mouse input
|
||||
Standard_EXPORT virtual bool UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButtons,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated) Standard_OVERRIDE;
|
||||
bool theIsEmulated);
|
||||
|
||||
//! Handle mouse cursor movement event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
@@ -340,7 +339,40 @@ public: //! @name mouse input
|
||||
Standard_EXPORT virtual bool UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButtons,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated) Standard_OVERRIDE;
|
||||
bool theIsEmulated);
|
||||
|
||||
//! Handle mouse button press event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButton pressed button
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if View should be redrawn
|
||||
bool PressMouseButton (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated)
|
||||
{
|
||||
return UpdateMouseButtons (thePoint, myMousePressed | theButton, theModifiers, theIsEmulated);
|
||||
}
|
||||
|
||||
//! Handle mouse button release event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButton released button
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if View should be redrawn
|
||||
bool ReleaseMouseButton (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated)
|
||||
{
|
||||
Aspect_VKeyMouse aButtons = myMousePressed & (~theButton);
|
||||
return UpdateMouseButtons (thePoint, aButtons, theModifiers, theIsEmulated);
|
||||
}
|
||||
|
||||
//! Handle mouse button click event (emulated by UpdateMouseButtons() while releasing single button).
|
||||
//! Note that as this method is called by UpdateMouseButtons(), it should be executed from UI thread.
|
||||
@@ -356,12 +388,14 @@ public: //! @name mouse input
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick);
|
||||
|
||||
using Aspect_WindowInputListener::PressMouseButton;
|
||||
using Aspect_WindowInputListener::ReleaseMouseButton;
|
||||
//! Return currently pressed mouse buttons.
|
||||
Aspect_VKeyMouse PressedMouseButtons() const { return myMousePressed; }
|
||||
|
||||
using Aspect_WindowInputListener::PressedMouseButtons;
|
||||
using Aspect_WindowInputListener::LastMouseFlags;
|
||||
using Aspect_WindowInputListener::LastMousePosition;
|
||||
//! Return active key modifiers passed with last mouse event.
|
||||
Aspect_VKeyFlags LastMouseFlags() const { return myMouseModifiers; }
|
||||
|
||||
//! Return last mouse position.
|
||||
const Graphic3d_Vec2i& LastMousePosition() const { return myMousePositionLast; }
|
||||
|
||||
public: //! @name multi-touch input
|
||||
|
||||
@@ -402,40 +436,52 @@ public: //! @name multi-touch input
|
||||
|
||||
public: //! @name 3d mouse input
|
||||
|
||||
//! Return acceleration ratio for translation event; 2.0 by default.
|
||||
float Get3dMouseTranslationScale() const { return my3dMouseAccelTrans; }
|
||||
|
||||
//! Set acceleration ratio for translation event.
|
||||
void Set3dMouseTranslationScale (float theScale) { my3dMouseAccelTrans = theScale; }
|
||||
|
||||
//! Return acceleration ratio for rotation event; 4.0 by default.
|
||||
float Get3dMouseRotationScale() const { return my3dMouseAccelRotate; }
|
||||
|
||||
//! Set acceleration ratio for rotation event.
|
||||
void Set3dMouseRotationScale (float theScale) { my3dMouseAccelRotate = theScale; }
|
||||
|
||||
//! Return quadric acceleration flag; TRUE by default.
|
||||
bool To3dMousePreciseInput() const { return my3dMouseIsQuadric; }
|
||||
|
||||
//! Set quadric acceleration flag.
|
||||
void Set3dMousePreciseInput (bool theIsQuadric) { my3dMouseIsQuadric = theIsQuadric; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
||||
const NCollection_Vec3<bool>& Get3dMouseIsNoRotate() const { return my3dMouseNoRotate; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
||||
NCollection_Vec3<bool>& Change3dMouseIsNoRotate() { return my3dMouseNoRotate; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
||||
const NCollection_Vec3<bool>& Get3dMouseToReverse() const { return my3dMouseToReverse; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
||||
NCollection_Vec3<bool>& Change3dMouseToReverse() { return my3dMouseToReverse; }
|
||||
|
||||
//! Process 3d mouse input event (redirects to translation, rotation and keys).
|
||||
Standard_EXPORT virtual bool Update3dMouse (const WNT_HIDSpaceMouse& theEvent) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual bool Update3dMouse (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
public: //! @name resize events
|
||||
//! Process 3d mouse input translation event.
|
||||
Standard_EXPORT virtual bool update3dMouseTranslation (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
//! Handle expose event (window content has been invalidation and should be redrawn).
|
||||
//! Default implementation does nothing.
|
||||
virtual void ProcessExpose() Standard_OVERRIDE {}
|
||||
//! Process 3d mouse input rotation event.
|
||||
Standard_EXPORT virtual bool update3dMouseRotation (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
//! Handle window resize event.
|
||||
//! Default implementation does nothing.
|
||||
virtual void ProcessConfigure (bool theIsResized) Standard_OVERRIDE
|
||||
{
|
||||
(void )theIsResized;
|
||||
}
|
||||
|
||||
//! Handle window input event immediately.
|
||||
//! Default implementation does nothing - input events are accumulated in internal buffer until explicit FlushViewEvents() call.
|
||||
virtual void ProcessInput() Standard_OVERRIDE {}
|
||||
|
||||
//! Handle focus event.
|
||||
//! Default implementation does nothing.
|
||||
virtual void ProcessFocus (bool theIsActivated) Standard_OVERRIDE
|
||||
{
|
||||
(void )theIsActivated;
|
||||
}
|
||||
|
||||
//! Handle window close event.
|
||||
//! Default implementation does nothing.
|
||||
virtual void ProcessClose() Standard_OVERRIDE {}
|
||||
//! Process 3d mouse input keys event.
|
||||
Standard_EXPORT virtual bool update3dMouseKeys (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
public:
|
||||
|
||||
using Aspect_WindowInputListener::EventTime;
|
||||
//! Return event time (e.g. current time).
|
||||
double EventTime() const { return myEventTimer.ElapsedTime(); }
|
||||
|
||||
//! Reset input state (pressed keys, mouse buttons, etc.) e.g. on window focus loss.
|
||||
//! This method is expected to be called from UI thread.
|
||||
@@ -666,6 +712,7 @@ protected:
|
||||
AIS_ViewInputBuffer myUI; //!< buffer for UI thread
|
||||
AIS_ViewInputBuffer myGL; //!< buffer for rendering thread
|
||||
|
||||
OSD_Timer myEventTimer; //!< timer for timestamping events
|
||||
Standard_Real myLastEventsTime; //!< last fetched events timer value for computing delta/progress
|
||||
Standard_Boolean myToAskNextFrame; //!< flag indicating that another frame should be drawn right after this one
|
||||
|
||||
@@ -717,6 +764,10 @@ protected: //! @name XR input variables
|
||||
Standard_Boolean myToDisplayXRAuxDevices; //!< flag to display auxiliary tracked XR devices
|
||||
Standard_Boolean myToDisplayXRHands; //!< flag to display XR hands
|
||||
|
||||
protected: //! @name keyboard input variables
|
||||
|
||||
Aspect_VKeySet myKeys; //!< keyboard state
|
||||
|
||||
protected: //! @name mouse input variables
|
||||
|
||||
Standard_Real myMouseClickThreshold; //!< mouse click threshold in pixels; 3 by default
|
||||
@@ -728,10 +779,13 @@ protected: //! @name mouse input variables
|
||||
AIS_MouseSelectionSchemeMap
|
||||
myMouseSelectionSchemes; //!< map defining selection schemes bound to mouse + modifiers
|
||||
Standard_Boolean myMouseActiveIdleRotation; //!< flag indicating view idle rotation state
|
||||
Graphic3d_Vec2i myMousePositionLast; //!< last mouse position
|
||||
Graphic3d_Vec2i myMousePressPoint; //!< mouse position where active gesture was been initiated
|
||||
Graphic3d_Vec2i myMouseProgressPoint; //!< gesture progress
|
||||
OSD_Timer myMouseClickTimer; //!< timer for handling double-click event
|
||||
Standard_Integer myMouseClickCounter; //!< counter for handling double-click event
|
||||
Aspect_VKeyMouse myMousePressed; //!< active mouse buttons
|
||||
Aspect_VKeyFlags myMouseModifiers; //!< active key modifiers passed with last mouse event
|
||||
Standard_Integer myMouseSingleButton; //!< index of mouse button pressed alone (>0)
|
||||
Standard_Boolean myMouseStopDragOnUnclick; //!< queue stop dragging even with at next mouse unclick
|
||||
|
||||
@@ -752,6 +806,15 @@ protected: //! @name multi-touch input variables
|
||||
Standard_Boolean myUpdateStartPointRot; //!< flag indicating that new gravity point should be picked for starting rotation gesture
|
||||
Standard_Boolean myUpdateStartPointZRot; //!< flag indicating that new gravity point should be picked for starting Z-rotation gesture
|
||||
|
||||
protected: //! @name 3d mouse input variables
|
||||
|
||||
bool my3dMouseButtonState[32];//!< cached button state
|
||||
NCollection_Vec3<bool> my3dMouseNoRotate; //!< ignore 3d mouse rotation axes
|
||||
NCollection_Vec3<bool> my3dMouseToReverse; //!< reverse 3d mouse rotation axes
|
||||
float my3dMouseAccelTrans; //!< acceleration ratio for translation event
|
||||
float my3dMouseAccelRotate; //!< acceleration ratio for rotation event
|
||||
bool my3dMouseIsQuadric; //!< quadric acceleration
|
||||
|
||||
protected: //! @name rotation/panning transient state variables
|
||||
|
||||
Handle(AIS_Point) myAnchorPointPrs1; //!< anchor point presentation (Graphic3d_ZLayerId_Top)
|
||||
|
@@ -148,8 +148,8 @@ static void CompareBounds(gp_Pnt2d& P1,
|
||||
static void Hunt(const TColStd_Array1OfReal& Arr,
|
||||
const Standard_Real Coord,
|
||||
Standard_Integer& Iloc)
|
||||
{//Warning: Hunt is used to find number of knot which equals coordinate component,
|
||||
// when coordinate component definitly equals a knot only.
|
||||
{//Warning: Hunt is used to find number of knot which equals co-ordinate component,
|
||||
// when co-ordinate component definitly equals a knot only.
|
||||
Standard_Real Tol=Precision::PConfusion()/10;
|
||||
Standard_Integer i=1;
|
||||
while((i <= Arr.Upper()) && (Abs(Coord - Arr(i)) > Tol)){
|
||||
|
@@ -752,7 +752,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS,
|
||||
index += 1 ;
|
||||
}
|
||||
//
|
||||
// Output
|
||||
// Ouput
|
||||
//
|
||||
|
||||
Standard_Integer ErrorCode = 0,
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include <NCollection_Array1.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
|
||||
//! Class describing a continuous 3d and/or function f(u).
|
||||
//! Class describing a continous 3d and/or function f(u).
|
||||
//! This class must be provided by the user to use the approximation algorithm FittingCurve.
|
||||
class AppCont_Function
|
||||
{
|
||||
|
@@ -166,7 +166,7 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line)
|
||||
}
|
||||
else
|
||||
{
|
||||
// keep best decision
|
||||
// keep best decison
|
||||
if ((thetol3d + thetol2d) < (KeptT3d + KeptT2d))
|
||||
{
|
||||
KeptMultiCurve = TheMultiCurve;
|
||||
|
@@ -22,17 +22,13 @@
|
||||
#include <GeomAbs_Shape.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
//! Approximation of a Curve to make its parameter be its curvilinear abscissa.
|
||||
//! Approximation of a Curve to make its parameter be its
|
||||
//! curvilinear abscissa
|
||||
//! If the curve is a curve on a surface S, C2D is the corresponding Pcurve,
|
||||
//! we consider the curve is given by its representation
|
||||
//! @code
|
||||
//! S(C2D(u))
|
||||
//! @endcode
|
||||
//! If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are the two corresponding Pcurve,
|
||||
//! we consider the curve is given by its representation
|
||||
//! @code
|
||||
//! 1/2(S1(C2D1(u) + S2(C2D2(u)))
|
||||
//! @endcode
|
||||
//! we considere the curve is given by its representation S(C2D(u))
|
||||
//! If the curve is a curve on 2 surfaces S1 and S2 and C2D1 C2D2 are
|
||||
//! the two corresponding Pcurve, we considere the curve is given
|
||||
//! by its representation 1/2(S1(C2D1(u) + S2 (C2D2(u)))
|
||||
class Approx_CurvilinearParameter
|
||||
{
|
||||
public:
|
||||
@@ -76,11 +72,20 @@ public:
|
||||
//! print the maximum errors(s)
|
||||
Standard_EXPORT void Dump (Standard_OStream& o) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT static void ToleranceComputation (const Handle(Adaptor2d_Curve2d)& C2D, const Handle(Adaptor3d_Surface)& S, const Standard_Integer MaxNumber, const Standard_Real Tol, Standard_Real& TolV, Standard_Real& TolW);
|
||||
|
||||
private:
|
||||
|
||||
Standard_Integer myCase;
|
||||
Standard_Boolean myDone;
|
||||
@@ -92,6 +97,13 @@ private:
|
||||
Handle(Geom2d_BSplineCurve) myCurve2d2;
|
||||
Standard_Real myMaxError2d2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Approx_CurvilinearParameter_HeaderFile
|
||||
|
@@ -349,7 +349,7 @@ void ApproxInt_KnotTools::FilterKnots(NCollection_Sequence<Standard_Integer>& th
|
||||
}
|
||||
}
|
||||
|
||||
// II: Filter points with too small amount of points per knot interval.
|
||||
// II: Filter poins with too small amount of points per knot interval.
|
||||
i = 1;
|
||||
theLKnots.Append(theInds(i));
|
||||
Standard_Integer anIndsPrev = theInds(i);
|
||||
|
@@ -68,7 +68,7 @@ public:
|
||||
//! @param thePntsXYZ - Set of 3d points.
|
||||
//! @param thePntsU1V1 - Set of 2d points.
|
||||
//! @param thePntsU2V2 - Set of 2d points.
|
||||
//! @param thePars - Expected parameters associated with set.
|
||||
//! @param thePars - Expected parameters assoiated with set.
|
||||
//! @param theApproxXYZ - Flag, existence of 3d set.
|
||||
//! @param theApproxU1V1 - Flag existence of first 2d set.
|
||||
//! @param theApproxU2V2 - Flag existence of second 2d set.
|
||||
@@ -121,7 +121,7 @@ private:
|
||||
//!
|
||||
//! I: Filter too big number of points per knot interval.
|
||||
//!
|
||||
//! II: Filter points with too small amount of points per knot interval.
|
||||
//! II: Filter poins with too small amount of points per knot interval.
|
||||
//!
|
||||
//! III: Fill Last Knot.
|
||||
static void FilterKnots(NCollection_Sequence<Standard_Integer>& theInds,
|
||||
|
@@ -12,7 +12,7 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
/*============================================================================*/
|
||||
/*==== Title: Aspect_Display.hxx */
|
||||
/*==== Titre: Aspect_Display.hxx */
|
||||
/*==== Role : The header file of primitive type "Display" from package */
|
||||
/*==== "V3d" */
|
||||
/*==== Implementation: This is a primitive type implemented with typedef */
|
||||
|
@@ -16,12 +16,6 @@
|
||||
#include <Aspect_DisplayConnectionDefinitionError.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
#if defined(HAVE_XLIB)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#endif
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient)
|
||||
|
||||
// =======================================================================
|
||||
@@ -30,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient)
|
||||
// =======================================================================
|
||||
Aspect_DisplayConnection::Aspect_DisplayConnection()
|
||||
{
|
||||
#if defined(HAVE_XLIB)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
myDisplay = NULL;
|
||||
myDefVisualInfo = NULL;
|
||||
myDefFBConfig = NULL;
|
||||
@@ -47,7 +41,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
|
||||
// =======================================================================
|
||||
Aspect_DisplayConnection::~Aspect_DisplayConnection()
|
||||
{
|
||||
#if defined(HAVE_XLIB)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
if (myDefVisualInfo != NULL)
|
||||
{
|
||||
XFree (myDefVisualInfo);
|
||||
@@ -55,11 +49,12 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
|
||||
if (myDisplay != NULL
|
||||
&& myIsOwnDisplay)
|
||||
{
|
||||
XCloseDisplay ((Display* )myDisplay);
|
||||
XCloseDisplay (myDisplay);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
// =======================================================================
|
||||
// function : Aspect_DisplayConnection
|
||||
// purpose :
|
||||
@@ -78,7 +73,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiStrin
|
||||
// function : Aspect_DisplayConnection
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Aspect_DisplayConnection::Aspect_DisplayConnection (Aspect_XDisplay* theDisplay)
|
||||
Aspect_DisplayConnection::Aspect_DisplayConnection (Display* theDisplay)
|
||||
: myDisplay (NULL),
|
||||
myDefVisualInfo (NULL),
|
||||
myDefFBConfig (NULL),
|
||||
@@ -91,14 +86,12 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (Aspect_XDisplay* theDisplay)
|
||||
// function : SetDefaultVisualInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_DisplayConnection::SetDefaultVisualInfo (Aspect_XVisualInfo* theVisual,
|
||||
void Aspect_DisplayConnection::SetDefaultVisualInfo (XVisualInfo* theVisual,
|
||||
Aspect_FBConfig theFBConfig)
|
||||
{
|
||||
if (myDefVisualInfo != NULL)
|
||||
{
|
||||
#if defined(HAVE_XLIB)
|
||||
XFree (myDefVisualInfo);
|
||||
#endif
|
||||
}
|
||||
myDefVisualInfo = theVisual;
|
||||
myDefFBConfig = theFBConfig;
|
||||
@@ -108,18 +101,17 @@ void Aspect_DisplayConnection::SetDefaultVisualInfo (Aspect_XVisualInfo* theVisu
|
||||
// function : Init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_DisplayConnection::Init (Aspect_XDisplay* theDisplay)
|
||||
void Aspect_DisplayConnection::Init (Display* theDisplay)
|
||||
{
|
||||
#if defined(HAVE_XLIB)
|
||||
if (myDisplay != NULL
|
||||
&& myIsOwnDisplay)
|
||||
{
|
||||
XCloseDisplay ((Display* )myDisplay);
|
||||
XCloseDisplay (myDisplay);
|
||||
}
|
||||
myIsOwnDisplay = false;
|
||||
myAtoms.Clear();
|
||||
|
||||
myDisplay = theDisplay != NULL ? theDisplay : (Aspect_XDisplay* )XOpenDisplay (myDisplayName.ToCString());
|
||||
myDisplay = theDisplay != NULL ? theDisplay : XOpenDisplay (myDisplayName.ToCString());
|
||||
if (myDisplay == NULL)
|
||||
{
|
||||
TCollection_AsciiString aMessage;
|
||||
@@ -130,10 +122,18 @@ void Aspect_DisplayConnection::Init (Aspect_XDisplay* theDisplay)
|
||||
else
|
||||
{
|
||||
myIsOwnDisplay = theDisplay == NULL;
|
||||
myAtoms.Bind (Aspect_XA_DELETE_WINDOW, (uint64_t )XInternAtom((Display* )myDisplay, "WM_DELETE_WINDOW", False));
|
||||
myAtoms.Bind (Aspect_XA_DELETE_WINDOW, XInternAtom(myDisplay, "WM_DELETE_WINDOW", False));
|
||||
}
|
||||
#else
|
||||
myDisplay = theDisplay;
|
||||
myIsOwnDisplay = theDisplay == NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAtom
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Atom Aspect_DisplayConnection::GetAtom (const Aspect_XAtom theAtom) const
|
||||
{
|
||||
Atom anAtom = myAtoms.Find(theAtom);
|
||||
return anAtom;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -16,52 +16,51 @@
|
||||
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Aspect_XAtom.hxx>
|
||||
#include <Aspect_FBConfig.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
struct Aspect_XDisplay;
|
||||
struct Aspect_XVisualInfo;
|
||||
#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.
|
||||
//! Raises exception if can not connect to X server.
|
||||
//! On Windows and Mac OS X (in case when Cocoa used) platforms this class does nothing.
|
||||
//! WARRNING: Do not close display connection manually!
|
||||
//! On Windows and Mac OS X (in case when Cocoa used) platforms this class do nothing.
|
||||
//! WARRNING: Do not close display connection manualy!
|
||||
|
||||
class Aspect_DisplayConnection : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(Aspect_DisplayConnection, Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Default constructor. Creates connection with display name taken from "DISPLAY" environment variable
|
||||
Standard_EXPORT Aspect_DisplayConnection();
|
||||
|
||||
//! Destructor. Close opened connection.
|
||||
Standard_EXPORT virtual ~Aspect_DisplayConnection();
|
||||
Standard_EXPORT ~Aspect_DisplayConnection();
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
//! Constructor. Creates connection with display specified in theDisplayName.
|
||||
//! Display name should be in format "hostname:number" or "hostname:number.screen_number", where:
|
||||
//! hostname - Specifies the name of the host machine on which the display is physically attached.
|
||||
//! number - Specifies the number of the display server on that host machine.
|
||||
//! screen_number - Specifies the screen to be used on that server. Optional variable.
|
||||
Standard_EXPORT Aspect_DisplayConnection (const TCollection_AsciiString& theDisplayName);
|
||||
Aspect_DisplayConnection (const TCollection_AsciiString& theDisplayName);
|
||||
|
||||
//! Constructor wrapping existing Display instance.
|
||||
//! WARNING! it is a responsibility of application to keep this pointer
|
||||
//! valid while Aspect_DisplayConnection is alive and to close Display when it is no more needed.
|
||||
Standard_EXPORT Aspect_DisplayConnection (Aspect_XDisplay* theDisplay);
|
||||
Aspect_DisplayConnection (Display* theDisplay);
|
||||
|
||||
//! @return pointer to Display structure that serves as the connection to the X server.
|
||||
Aspect_XDisplay* GetDisplayAspect() { return myDisplay; }
|
||||
Display* GetDisplay() { return myDisplay; }
|
||||
|
||||
//! @return TRUE if X Display has been allocated by this class
|
||||
Standard_Boolean IsOwnDisplay() const { return myIsOwnDisplay; }
|
||||
|
||||
//! @return identifier(atom) for custom named property associated with windows that use current connection to X server.
|
||||
uint64_t GetAtom (const Aspect_XAtom theAtom) const
|
||||
{
|
||||
return myAtoms.Find (theAtom);
|
||||
}
|
||||
Atom GetAtom (const Aspect_XAtom theAtom) const;
|
||||
|
||||
//! @return display name for this connection.
|
||||
const TCollection_AsciiString& GetDisplayName() { return myDisplayName; }
|
||||
@@ -72,60 +71,27 @@ public:
|
||||
//! to keep this pointer valid while Aspect_DisplayConnection is alive
|
||||
//! and to close Display when it is no more needed.
|
||||
//! @param theDisplay external pointer to allocated Display, or NULL if new connection should be created
|
||||
Standard_EXPORT void Init (Aspect_XDisplay* theDisplay);
|
||||
void Init (Display* theDisplay);
|
||||
|
||||
//! Return default window visual or NULL when undefined.
|
||||
Aspect_XVisualInfo* GetDefaultVisualInfo() const { return myDefVisualInfo; }
|
||||
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 (Aspect_XVisualInfo* theVisual,
|
||||
Standard_EXPORT void SetDefaultVisualInfo (XVisualInfo* theVisual,
|
||||
Aspect_FBConfig theFBConfig);
|
||||
|
||||
#ifdef X_PROTOCOL
|
||||
//! Constructor wrapping existing Display instance.
|
||||
//! WARNING! it is a responsibility of application to keep this pointer
|
||||
//! valid while Aspect_DisplayConnection is alive and to close Display when it is no more needed.
|
||||
Aspect_DisplayConnection (Display* theDisplay)
|
||||
: Aspect_DisplayConnection ((Aspect_XDisplay* )theDisplay) {}
|
||||
|
||||
//! @return pointer to Display structure that serves as the connection to the X server.
|
||||
Display* GetDisplay() { return (Display* )myDisplay; }
|
||||
|
||||
//! Return default window visual or NULL when undefined.
|
||||
XVisualInfo* GetDefaultVisualInfoX() const { return (XVisualInfo* )myDefVisualInfo; }
|
||||
|
||||
//! Set default window visual; the visual will be deallocated using XFree().
|
||||
void SetDefaultVisualInfo (XVisualInfo* theVisual,
|
||||
Aspect_FBConfig theFBConfig)
|
||||
{
|
||||
SetDefaultVisualInfo ((Aspect_XVisualInfo* )theVisual, theFBConfig);
|
||||
}
|
||||
|
||||
//! @return identifier(atom) for custom named property associated with windows that use current connection to X server.
|
||||
Atom GetAtomX (const Aspect_XAtom theAtom) const
|
||||
{
|
||||
return (Atom )GetAtom (theAtom);
|
||||
}
|
||||
|
||||
//! Open connection with display specified in myDisplayName class field
|
||||
//! or takes theDisplay parameter when it is not NULL.
|
||||
void Init (Display* theDisplay)
|
||||
{
|
||||
Init ((Aspect_XDisplay* )theDisplay);
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
Aspect_XDisplay* myDisplay;
|
||||
Aspect_XVisualInfo* myDefVisualInfo;
|
||||
Display* myDisplay;
|
||||
XVisualInfo* myDefVisualInfo;
|
||||
Aspect_FBConfig myDefFBConfig;
|
||||
NCollection_DataMap<Aspect_XAtom, uint64_t> myAtoms;
|
||||
NCollection_DataMap<Aspect_XAtom, Atom> myAtoms;
|
||||
TCollection_AsciiString myDisplayName;
|
||||
Standard_Boolean myIsOwnDisplay;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -133,6 +99,10 @@ private:
|
||||
Aspect_DisplayConnection (const Aspect_DisplayConnection& );
|
||||
Aspect_DisplayConnection& operator= (const Aspect_DisplayConnection& );
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Aspect_DisplayConnection,Standard_Transient) // Type definition
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Aspect_DisplayConnection, Standard_Transient)
|
||||
|
@@ -12,7 +12,7 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
/*============================================================================*/
|
||||
/*==== Title: Aspect_Drawable.hxx */
|
||||
/*==== Titre: Aspect_Drawable.hxx */
|
||||
/*==== Role : The header file of primitive type "Handle" from packages */
|
||||
/*==== "Xw" & "WNT" */
|
||||
/*==== Implementation: This is a primitive type implemented with typedef */
|
||||
|
@@ -14,7 +14,11 @@
|
||||
#ifndef _Aspect_FBConfig_HeaderFile
|
||||
#define _Aspect_FBConfig_HeaderFile
|
||||
|
||||
typedef struct __GLXFBConfigRec* GLXFBConfig;
|
||||
typedef GLXFBConfig Aspect_FBConfig;
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
typedef struct __GLXFBConfigRec* GLXFBConfig;
|
||||
typedef GLXFBConfig Aspect_FBConfig; // GLXFBConfig* under UNIX
|
||||
#else
|
||||
typedef void* Aspect_FBConfig; // unused on other systems
|
||||
#endif
|
||||
|
||||
#endif // _Aspect_FBConfig_HeaderFile
|
||||
|
@@ -12,7 +12,7 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
/*============================================================================*/
|
||||
/*==== Title: Aspect_Handle.hxx */
|
||||
/*==== Titre: Aspect_Handle.hxx */
|
||||
/*==== Role : The header file of primitive type "Handle" from packages */
|
||||
/*==== "Xw" & "WNT" */
|
||||
/*==== Implementation: This is a primitive type implemented with typedef */
|
||||
|
@@ -12,9 +12,9 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
/*============================================================================*/
|
||||
/*==== Title: Aspect_RenderingContext.hxx */
|
||||
/*==== Role: The header file of primitive type "RenderingContext" from package*/
|
||||
/*==== "V3d" */
|
||||
/*==== Titre: Aspect_RenderingContext.hxx */
|
||||
/*==== Role : The header file of primitive type "RenderingContext" from package */
|
||||
/*==== "V3d" */
|
||||
/*==== Implementation: This is a primitive type implemented with typedef */
|
||||
/*============================================================================*/
|
||||
// To manage 2D or 3D graphic context
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef _Aspect_RenderingContext_HeaderFile
|
||||
#define _Aspect_RenderingContext_HeaderFile
|
||||
|
||||
#if defined(__APPLE__) && !defined(HAVE_XLIB)
|
||||
#if defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
||||
#import <TargetConditionals.h>
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
#ifdef __OBJC__
|
||||
|
@@ -1,168 +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 <Aspect_WindowInputListener.hxx>
|
||||
|
||||
#include <WNT_HIDSpaceMouse.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Aspect_WindowInputListener
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Aspect_WindowInputListener::Aspect_WindowInputListener()
|
||||
: myMousePressed (Aspect_VKeyMouse_NONE),
|
||||
myMouseModifiers (Aspect_VKeyFlags_NONE),
|
||||
//
|
||||
my3dMouseNoRotate (false, false, false),
|
||||
my3dMouseToReverse (true, false, false),
|
||||
my3dMouseAccelTrans (2.0f),
|
||||
my3dMouseAccelRotate (4.0f),
|
||||
my3dMouseIsQuadric (true)
|
||||
{
|
||||
memset(my3dMouseButtonState, 0, sizeof(my3dMouseButtonState));
|
||||
myEventTimer.Start();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : ~Aspect_WindowInputListener
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Aspect_WindowInputListener::~Aspect_WindowInputListener()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : KeyDown
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_WindowInputListener::KeyDown (Aspect_VKey theKey,
|
||||
double theTime,
|
||||
double thePressure)
|
||||
{
|
||||
myKeys.KeyDown (theKey, theTime, thePressure);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : KeyUp
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_WindowInputListener::KeyUp (Aspect_VKey theKey,
|
||||
double theTime)
|
||||
{
|
||||
myKeys.KeyUp (theKey, theTime);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : KeyFromAxis
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Aspect_WindowInputListener::KeyFromAxis (Aspect_VKey theNegative,
|
||||
Aspect_VKey thePositive,
|
||||
double theTime,
|
||||
double thePressure)
|
||||
{
|
||||
myKeys.KeyFromAxis (theNegative, thePositive, theTime, thePressure);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseTranslation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool Aspect_WindowInputListener::update3dMouseTranslation (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
if (!theEvent.IsTranslation())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isIdle = true;
|
||||
const double aTimeStamp = EventTime();
|
||||
const Graphic3d_Vec3d aTrans = theEvent.Translation (isIdle, my3dMouseIsQuadric) * my3dMouseAccelTrans;
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavSlideLeft, Aspect_VKey_NavSlideRight, aTimeStamp, aTrans.x());
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavForward, Aspect_VKey_NavBackward, aTimeStamp, aTrans.y());
|
||||
myKeys.KeyFromAxis (Aspect_VKey_NavSlideUp, Aspect_VKey_NavSlideDown, aTimeStamp, aTrans.z());
|
||||
return true;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseRotation
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool Aspect_WindowInputListener::update3dMouseRotation (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
if (!theEvent.IsRotation())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isIdle = true, toUpdate = false;
|
||||
const double aTimeStamp = EventTime();
|
||||
const Graphic3d_Vec3d aRot3 = theEvent.Rotation (isIdle, my3dMouseIsQuadric) * my3dMouseAccelRotate;
|
||||
if (!my3dMouseNoRotate.x())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavLookUp, Aspect_VKey_NavLookDown, aTimeStamp, !my3dMouseToReverse.x() ? aRot3.x() : -aRot3.x());
|
||||
toUpdate = true;
|
||||
}
|
||||
if (!my3dMouseNoRotate.y())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavRollCW, Aspect_VKey_NavRollCCW, aTimeStamp, !my3dMouseToReverse.y() ? aRot3.y() : -aRot3.y());
|
||||
toUpdate = true;
|
||||
}
|
||||
if (!my3dMouseNoRotate.z())
|
||||
{
|
||||
KeyFromAxis (Aspect_VKey_NavLookLeft, Aspect_VKey_NavLookRight, aTimeStamp, !my3dMouseToReverse.z() ? aRot3.z() : -aRot3.z());
|
||||
toUpdate = true;
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : update3dMouseKeys
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
bool Aspect_WindowInputListener::update3dMouseKeys (const WNT_HIDSpaceMouse& theEvent)
|
||||
{
|
||||
bool toUpdate = false;
|
||||
const double aTimeStamp = EventTime();
|
||||
if (theEvent.IsKeyState())
|
||||
{
|
||||
const uint32_t aKeyState = theEvent.KeyState();
|
||||
for (unsigned short aKeyBit = 0; aKeyBit < 32; ++aKeyBit)
|
||||
{
|
||||
const bool isPressed = (aKeyState & (1 << aKeyBit)) != 0;
|
||||
const bool isReleased = my3dMouseButtonState[aKeyBit] && !isPressed;
|
||||
//const bool isRepeated = my3dMouseButtonState[aKeyBit] && isPressed;
|
||||
my3dMouseButtonState[aKeyBit] = isPressed;
|
||||
if (!isReleased && !isPressed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const Aspect_VKey aVKey = theEvent.HidToSpaceKey (aKeyBit);
|
||||
if (aVKey != Aspect_VKey_UNKNOWN)
|
||||
{
|
||||
toUpdate = true;
|
||||
if (isPressed)
|
||||
{
|
||||
KeyDown (aVKey, aTimeStamp);
|
||||
}
|
||||
else
|
||||
{
|
||||
KeyUp (aVKey, aTimeStamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return toUpdate;
|
||||
}
|
@@ -1,236 +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 _Aspect_WindowInputListener_HeaderFile
|
||||
#define _Aspect_WindowInputListener_HeaderFile
|
||||
|
||||
#include <Aspect_VKeySet.hxx>
|
||||
#include <Graphic3d_Vec.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
struct Aspect_ScrollDelta;
|
||||
class WNT_HIDSpaceMouse;
|
||||
|
||||
//! Defines a listener for window input events.
|
||||
class Aspect_WindowInputListener
|
||||
{
|
||||
public:
|
||||
///DEFINE_STANDARD_ALLOC
|
||||
public:
|
||||
|
||||
//! Destructor.
|
||||
Standard_EXPORT virtual ~Aspect_WindowInputListener();
|
||||
|
||||
//! Return event time (e.g. current time).
|
||||
double EventTime() const { return myEventTimer.ElapsedTime(); }
|
||||
|
||||
//! Handle expose event (window content has been invalidation and should be redrawn).
|
||||
virtual void ProcessExpose() = 0;
|
||||
|
||||
//! Handle window resize event.
|
||||
virtual void ProcessConfigure (bool theIsResized) = 0;
|
||||
|
||||
//! Handle window input event immediately (flush input buffer or ignore).
|
||||
virtual void ProcessInput() = 0;
|
||||
|
||||
//! Handle focus event.
|
||||
virtual void ProcessFocus (bool theIsActivated) = 0;
|
||||
|
||||
//! Handle window close event.
|
||||
virtual void ProcessClose() = 0;
|
||||
|
||||
public: //! @name keyboard input
|
||||
|
||||
//! Return keyboard state.
|
||||
const Aspect_VKeySet& Keys() const { return myKeys; }
|
||||
|
||||
//! Return keyboard state.
|
||||
Aspect_VKeySet& ChangeKeys() { return myKeys; }
|
||||
|
||||
//! Press key.
|
||||
//! Default implementation updates internal cache.
|
||||
//! @param theKey key pressed
|
||||
//! @param theTime event timestamp
|
||||
Standard_EXPORT virtual void KeyDown (Aspect_VKey theKey,
|
||||
double theTime,
|
||||
double thePressure = 1.0) = 0;
|
||||
|
||||
//! Release key.
|
||||
//! Default implementation updates internal cache.
|
||||
//! @param theKey key pressed
|
||||
//! @param theTime event timestamp
|
||||
Standard_EXPORT virtual void KeyUp (Aspect_VKey theKey,
|
||||
double theTime) = 0;
|
||||
|
||||
//! Simulate key up/down events from axis value.
|
||||
//! Default implementation updates internal cache.
|
||||
Standard_EXPORT virtual void KeyFromAxis (Aspect_VKey theNegative,
|
||||
Aspect_VKey thePositive,
|
||||
double theTime,
|
||||
double thePressure) = 0;
|
||||
|
||||
public: //! @name mouse input
|
||||
|
||||
//! Update mouse scroll event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! @param theDelta mouse cursor position and delta
|
||||
//! @return TRUE if new event has been created or FALSE if existing one has been updated
|
||||
virtual bool UpdateMouseScroll (const Aspect_ScrollDelta& theDelta) = 0;
|
||||
|
||||
//! Handle mouse button press/release event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButtons pressed buttons
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if window content should be redrawn
|
||||
virtual bool UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButtons,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated) = 0;
|
||||
|
||||
//! Handle mouse cursor movement event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! Default implementation does nothing.
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButtons pressed buttons
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if window content should be redrawn
|
||||
virtual bool UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButtons,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated) = 0;
|
||||
|
||||
//! Handle mouse button press event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! Default implementation redirects to UpdateMousePosition().
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButton pressed button
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if window content should be redrawn
|
||||
bool PressMouseButton (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated)
|
||||
{
|
||||
return UpdateMouseButtons (thePoint, myMousePressed | theButton, theModifiers, theIsEmulated);
|
||||
}
|
||||
|
||||
//! Handle mouse button release event.
|
||||
//! This method is expected to be called from UI thread.
|
||||
//! Default implementation redirects to UpdateMousePosition().
|
||||
//! @param thePoint mouse cursor position
|
||||
//! @param theButton released button
|
||||
//! @param theModifiers key modifiers
|
||||
//! @param theIsEmulated if TRUE then mouse event comes NOT from real mouse
|
||||
//! but emulated from non-precise input like touch on screen
|
||||
//! @return TRUE if window content should be redrawn
|
||||
bool ReleaseMouseButton (const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsEmulated)
|
||||
{
|
||||
Aspect_VKeyMouse aButtons = myMousePressed & (~theButton);
|
||||
return UpdateMouseButtons (thePoint, aButtons, theModifiers, theIsEmulated);
|
||||
}
|
||||
|
||||
//! Return currently pressed mouse buttons.
|
||||
Aspect_VKeyMouse PressedMouseButtons() const { return myMousePressed; }
|
||||
|
||||
//! Return active key modifiers passed with last mouse event.
|
||||
Aspect_VKeyFlags LastMouseFlags() const { return myMouseModifiers; }
|
||||
|
||||
//! Return last mouse position.
|
||||
const Graphic3d_Vec2i& LastMousePosition() const { return myMousePositionLast; }
|
||||
|
||||
public: //! @name 3d mouse input
|
||||
|
||||
//! Return acceleration ratio for translation event; 2.0 by default.
|
||||
float Get3dMouseTranslationScale() const { return my3dMouseAccelTrans; }
|
||||
|
||||
//! Set acceleration ratio for translation event.
|
||||
void Set3dMouseTranslationScale (float theScale) { my3dMouseAccelTrans = theScale; }
|
||||
|
||||
//! Return acceleration ratio for rotation event; 4.0 by default.
|
||||
float Get3dMouseRotationScale() const { return my3dMouseAccelRotate; }
|
||||
|
||||
//! Set acceleration ratio for rotation event.
|
||||
void Set3dMouseRotationScale (float theScale) { my3dMouseAccelRotate = theScale; }
|
||||
|
||||
//! Return quadric acceleration flag; TRUE by default.
|
||||
bool To3dMousePreciseInput() const { return my3dMouseIsQuadric; }
|
||||
|
||||
//! Set quadric acceleration flag.
|
||||
void Set3dMousePreciseInput (bool theIsQuadric) { my3dMouseIsQuadric = theIsQuadric; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
||||
const NCollection_Vec3<bool>& Get3dMouseIsNoRotate() const { return my3dMouseNoRotate; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
||||
NCollection_Vec3<bool>& Change3dMouseIsNoRotate() { return my3dMouseNoRotate; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
||||
const NCollection_Vec3<bool>& Get3dMouseToReverse() const { return my3dMouseToReverse; }
|
||||
|
||||
//! Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
||||
NCollection_Vec3<bool>& Change3dMouseToReverse() { return my3dMouseToReverse; }
|
||||
|
||||
//! Process 3d mouse input event (redirects to translation, rotation and keys).
|
||||
virtual bool Update3dMouse (const WNT_HIDSpaceMouse& theEvent) = 0;
|
||||
|
||||
//! Process 3d mouse input translation event.
|
||||
Standard_EXPORT virtual bool update3dMouseTranslation (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
//! Process 3d mouse input rotation event.
|
||||
Standard_EXPORT virtual bool update3dMouseRotation (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
//! Process 3d mouse input keys event.
|
||||
Standard_EXPORT virtual bool update3dMouseKeys (const WNT_HIDSpaceMouse& theEvent);
|
||||
|
||||
protected:
|
||||
|
||||
//! Empty constructor.
|
||||
Standard_EXPORT Aspect_WindowInputListener();
|
||||
|
||||
protected:
|
||||
|
||||
OSD_Timer myEventTimer; //!< timer for timestamping events
|
||||
|
||||
protected: //! @name keyboard input variables
|
||||
|
||||
Aspect_VKeySet myKeys; //!< keyboard state
|
||||
|
||||
protected: //! @name mouse input variables
|
||||
|
||||
Graphic3d_Vec2i myMousePositionLast; //!< last mouse position
|
||||
Aspect_VKeyMouse myMousePressed; //!< active mouse buttons
|
||||
Aspect_VKeyFlags myMouseModifiers; //!< active key modifiers passed with last mouse event
|
||||
|
||||
protected: //! @name 3d mouse input variables
|
||||
|
||||
bool my3dMouseButtonState[32];//!< cached button state
|
||||
NCollection_Vec3<bool> my3dMouseNoRotate; //!< ignore 3d mouse rotation axes
|
||||
NCollection_Vec3<bool> my3dMouseToReverse; //!< reverse 3d mouse rotation axes
|
||||
float my3dMouseAccelTrans; //!< acceleration ratio for translation event
|
||||
float my3dMouseAccelRotate; //!< acceleration ratio for rotation event
|
||||
bool my3dMouseIsQuadric; //!< quadric acceleration
|
||||
|
||||
};
|
||||
|
||||
#endif // _Aspect_WindowInputListener_HeaderFile
|
@@ -14,7 +14,7 @@
|
||||
#ifndef __Aspect_WNTXWD_HXX
|
||||
# define __Aspect_WNTXWD_HXX
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(HAVE_XLIB)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__)
|
||||
# include <X11/XWDFile.h>
|
||||
# else
|
||||
|
||||
|
@@ -66,8 +66,6 @@ Aspect_Window.cxx
|
||||
Aspect_Window.hxx
|
||||
Aspect_WindowDefinitionError.hxx
|
||||
Aspect_WindowError.hxx
|
||||
Aspect_WindowInputListener.cxx
|
||||
Aspect_WindowInputListener.hxx
|
||||
Aspect_XAtom.hxx
|
||||
Aspect_XRAction.hxx
|
||||
Aspect_XRActionSet.hxx
|
||||
|
@@ -53,7 +53,7 @@ BOPAlgo_Builder::BOPAlgo_Builder()
|
||||
myShapesSD(100, myAllocator),
|
||||
myOrigins(100, myAllocator),
|
||||
myInParts(100, myAllocator),
|
||||
myNonDestructive(Standard_True),
|
||||
myNonDestructive(Standard_False),
|
||||
myGlue(BOPAlgo_GlueOff),
|
||||
myCheckInverted(Standard_True)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ BOPAlgo_Builder::BOPAlgo_Builder
|
||||
myShapesSD(100, myAllocator),
|
||||
myOrigins(100, myAllocator),
|
||||
myInParts(100, myAllocator),
|
||||
myNonDestructive(Standard_True),
|
||||
myNonDestructive(Standard_False),
|
||||
myGlue(BOPAlgo_GlueOff),
|
||||
myCheckInverted(Standard_True)
|
||||
{
|
||||
|
@@ -52,7 +52,7 @@ class TopoDS_Solid;
|
||||
//! Additionally to the options of the base classes, the algorithm has
|
||||
//! the following options:<br>
|
||||
//! - *Safe processing mode* - allows to avoid modification of the input
|
||||
//! shapes during the operation (enabled by default);<br>
|
||||
//! shapes during the operation (by default it is off);<br>
|
||||
//! - *Gluing options* - allows to speed up the calculation of the intersections
|
||||
//! on the special cases, in which some sub-shapes are coinciding.<br>
|
||||
//! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids
|
||||
@@ -126,7 +126,6 @@ public: //! @name Options
|
||||
//! This flag is taken into account if internal PaveFiller is used only.
|
||||
//! In the case of calling PerformWithFiller the corresponding flag of that PaveFiller
|
||||
//! is in force.
|
||||
//! Enabled by default.
|
||||
void SetNonDestructive(const Standard_Boolean theFlag)
|
||||
{
|
||||
myNonDestructive = theFlag;
|
||||
|
@@ -42,7 +42,7 @@ BOPAlgo_PaveFiller::BOPAlgo_PaveFiller()
|
||||
{
|
||||
myDS = NULL;
|
||||
myIterator = NULL;
|
||||
myNonDestructive = Standard_True;
|
||||
myNonDestructive = Standard_False;
|
||||
myIsPrimary = Standard_True;
|
||||
myAvoidBuildPCurve = Standard_False;
|
||||
myGlue = BOPAlgo_GlueOff;
|
||||
@@ -62,7 +62,7 @@ BOPAlgo_PaveFiller::BOPAlgo_PaveFiller
|
||||
{
|
||||
myDS = NULL;
|
||||
myIterator = NULL;
|
||||
myNonDestructive = Standard_True;
|
||||
myNonDestructive = Standard_False;
|
||||
myIsPrimary = Standard_True;
|
||||
myAvoidBuildPCurve = Standard_False;
|
||||
myGlue = BOPAlgo_GlueOff;
|
||||
|
@@ -83,7 +83,7 @@ class TopoDS_Face;
|
||||
//! - *Section attributes* - allows to customize the intersection of the faces
|
||||
//! (avoid approximation or building 2d curves);<br>
|
||||
//! - *Safe processing mode* - allows to avoid modification of the input
|
||||
//! shapes during the operation (enabled by default);<br>
|
||||
//! shapes during the operation (by default it is off);<br>
|
||||
//! - *Gluing options* - allows to speed up the calculation on the special
|
||||
//! cases, in which some sub-shapes are coincide.<br>
|
||||
//!
|
||||
@@ -151,7 +151,6 @@ public:
|
||||
//! Sets the flag that defines the mode of treatment.
|
||||
//! In non-destructive mode the argument shapes are not modified. Instead
|
||||
//! a copy of a sub-shape is created in the result if it is needed to be updated.
|
||||
//! Enabled by default.
|
||||
Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
|
||||
|
||||
//! Returns the flag that defines the mode of treatment.
|
||||
|
@@ -102,7 +102,7 @@ class BOPTest_Session {
|
||||
void SetDefaultOptions()
|
||||
{
|
||||
myRunParallel = Standard_False;
|
||||
myNonDestructive = Standard_True;
|
||||
myNonDestructive = Standard_False;
|
||||
myFuzzyValue = Precision::Confusion();
|
||||
myGlue = BOPAlgo_GlueOff;
|
||||
myDrawWarnShapes = Standard_False;
|
||||
|
@@ -64,7 +64,7 @@ void BOPTest::OptionCommands(Draw_Interpretor& theCommands)
|
||||
"\t\tUsage: bglue [0 (off) / 1 (shift) / 2 (full)]",
|
||||
__FILE__, bGlue, g);
|
||||
|
||||
theCommands.Add("bdrawwarnshapes", "Enables/Disables drawing of warning shapes of BOP algorithms.\n"
|
||||
theCommands.Add("bdrawwarnshapes", "Enables/Disables drawing of waring shapes of BOP algorithms.\n"
|
||||
"\t\tUsage: bdrawwarnshapes 0 (do not draw) / 1 (draw warning shapes)",
|
||||
__FILE__, bdrawwarnshapes, g);
|
||||
|
||||
|
@@ -576,7 +576,6 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
Standard_Integer aDegMin = -1, aDegMax = -1, aMaxSegments = -1;
|
||||
Standard_Real aMaxDist = -1;
|
||||
AppParCurves_Constraint aBndPnt = AppParCurves_TangencyPoint;
|
||||
Standard_Boolean isExtendSurf = Standard_False;
|
||||
if ((TolReached2d >= 10. * aTR) && (TolReached2d <= aMaxTol || isAnaSurf))
|
||||
{
|
||||
aTR = Min(aMaxTol, 0.1*TolReached2d);
|
||||
@@ -586,34 +585,12 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
|
||||
{
|
||||
aBndPnt = AppParCurves_PassPoint;
|
||||
}
|
||||
isExtendSurf = Standard_True;
|
||||
}
|
||||
else if(TolReached2d > aMaxTol)
|
||||
{
|
||||
aTR = Min(TolReached2d, 1.e3 * aMaxTol);
|
||||
aMaxDist = 1.e2 * aTR;
|
||||
aMaxSegments = 100;
|
||||
isExtendSurf = Standard_True;
|
||||
}
|
||||
if (isExtendSurf)
|
||||
{
|
||||
Handle(Adaptor3d_Surface) anA3dSurf;
|
||||
Standard_Real dt = (aBAHS->LastUParameter() - aBAHS->FirstUParameter());
|
||||
if (!aBAHS->IsUPeriodic() || Abs(dt - aBAHS->UPeriod()) > 0.01 * dt)
|
||||
{
|
||||
dt *= 0.01;
|
||||
anA3dSurf = aBAHS->UTrim(aBAHS->FirstUParameter() - dt, aBAHS->LastUParameter() + dt, 0.);
|
||||
}
|
||||
dt = (aBAHS->LastVParameter() - aBAHS->FirstVParameter());
|
||||
if (!aBAHS->IsVPeriodic() || Abs(dt - aBAHS->VPeriod()) > 0.01 * dt)
|
||||
{
|
||||
dt *= 0.01;
|
||||
anA3dSurf = aBAHS->VTrim(aBAHS->FirstVParameter() - dt, aBAHS->LastVParameter() + dt, 0.);
|
||||
}
|
||||
if (!anA3dSurf.IsNull())
|
||||
{
|
||||
aProjCurv.Load(anA3dSurf);
|
||||
}
|
||||
}
|
||||
aProjCurv.Load(aTR);
|
||||
aProjCurv.SetDegree(aDegMin, aDegMax);
|
||||
|
@@ -189,15 +189,14 @@ public:
|
||||
|
||||
//! Checks if CurveOnSurface of theE on theF matches with isoline of theF surface.
|
||||
//! Sets corresponding values for isTheUIso and isTheVIso variables.
|
||||
//!
|
||||
//! ATTENTION!!!
|
||||
//! This method is based on the comparison between direction of
|
||||
//! surface (which theF is based on) iso-lines and the direction
|
||||
//! of the edge p-curve (on theF) in middle-point of the p-curve.
|
||||
//!
|
||||
//! This method should be used carefully
|
||||
//! (e.g. BRep_Tool::IsClosed(...) together) in order to avoid
|
||||
//! false classification some p-curves as isoline (e.g. circle on a plane).
|
||||
//! This method is based on comparation between direction of
|
||||
//! surface (which theF is based on) iso-lines and the direction
|
||||
//! of the edge p-curve (on theF) in middle-point of the p-curve.
|
||||
//! This method should be used carefully
|
||||
//! (e.g. BRep_Tool::IsClosed(...) together) in order to
|
||||
//! avoid false classification some p-curves as isoline (e.g. circle
|
||||
//! on a plane).
|
||||
Standard_EXPORT static void IsEdgeIsoline(const TopoDS_Edge& theE,
|
||||
const TopoDS_Face& theF,
|
||||
Standard_Boolean& isTheUIso,
|
||||
|
@@ -80,10 +80,11 @@ public:
|
||||
//! auto-intersection of new wires are not searched.
|
||||
Standard_EXPORT static Standard_Boolean IsValid (const TopTools_ListOfShape& theArgs, const TopoDS_Shape& theResult, const Standard_Boolean closedSolid = Standard_False, const Standard_Boolean GeomCtrl = Standard_True);
|
||||
|
||||
//! Checks if the shape is "correct".
|
||||
//! If not, returns FALSE, else returns TRUE.
|
||||
//! This method differs from the previous one in the fact that no geometric controls
|
||||
//! (intersection of wires, pcurve validity) are performed.
|
||||
//! Checks if the shape is "correct". If not, returns
|
||||
//! <Standard_False>, else returns <Standard_True>.
|
||||
//! This method differs from the previous one in the
|
||||
//! fact that no geometric contols (intersection of
|
||||
//! wires, pcurve validity) are performed.
|
||||
Standard_EXPORT static Standard_Boolean IsTopologicallyValid (const TopoDS_Shape& S);
|
||||
|
||||
|
||||
|
@@ -37,6 +37,7 @@ class BRepAlgo_AsDes : public Standard_Transient
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an empty AsDes.
|
||||
Standard_EXPORT BRepAlgo_AsDes();
|
||||
|
||||
@@ -60,34 +61,45 @@ public:
|
||||
|
||||
//! Returns futur subhapes of <S>.
|
||||
Standard_EXPORT TopTools_ListOfShape& ChangeDescendant (const TopoDS_Shape& S);
|
||||
|
||||
//! Replace theOldS by theNewS.
|
||||
//! theOldS disappear from this.
|
||||
Standard_EXPORT void Replace (const TopoDS_Shape& theOldS, const TopoDS_Shape& theNewS);
|
||||
|
||||
//! Remove theS from me.
|
||||
Standard_EXPORT void Remove (const TopoDS_Shape& theS);
|
||||
|
||||
|
||||
//! Replace <OldS> by <NewS>.
|
||||
//! <OldS> disapear from <me>.
|
||||
Standard_EXPORT void Replace (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS);
|
||||
|
||||
//! Remove <S> from me.
|
||||
Standard_EXPORT void Remove (const TopoDS_Shape& S);
|
||||
|
||||
//! Returns True if (S1> and <S2> has common
|
||||
//! Descendants. Stores in <LC> the Commons Descendants.
|
||||
Standard_EXPORT Standard_Boolean HasCommonDescendant (const TopoDS_Shape& S1, const TopoDS_Shape& S2, TopTools_ListOfShape& LC) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(BRepAlgo_AsDes,Standard_Transient)
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
//! Replace theOldS by theNewS.
|
||||
//! theOldS disappear from this.
|
||||
Standard_EXPORT void BackReplace (const TopoDS_Shape& theOldS,
|
||||
const TopoDS_Shape& theNewS,
|
||||
const TopTools_ListOfShape& theL,
|
||||
const Standard_Boolean theInUp);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Replace <OldS> by <NewS>.
|
||||
//! <OldS> disapear from <me>.
|
||||
Standard_EXPORT void BackReplace (const TopoDS_Shape& OldS, const TopoDS_Shape& NewS, const TopTools_ListOfShape& L, const Standard_Boolean InUp);
|
||||
|
||||
TopTools_DataMapOfShapeListOfShape up;
|
||||
TopTools_DataMapOfShapeListOfShape down;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepAlgo_AsDes_HeaderFile
|
||||
|
@@ -28,7 +28,7 @@
|
||||
BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo()
|
||||
:
|
||||
BRepAlgoAPI_Algo(),
|
||||
myNonDestructive(Standard_True),
|
||||
myNonDestructive(Standard_False),
|
||||
myGlue(BOPAlgo_GlueOff),
|
||||
myCheckInverted(Standard_True),
|
||||
myFillHistory(Standard_True),
|
||||
@@ -43,7 +43,7 @@ BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo()
|
||||
BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo(const BOPAlgo_PaveFiller& aPF)
|
||||
:
|
||||
BRepAlgoAPI_Algo(),
|
||||
myNonDestructive(Standard_True),
|
||||
myNonDestructive(Standard_False),
|
||||
myGlue(BOPAlgo_GlueOff),
|
||||
myCheckInverted(Standard_True),
|
||||
myFillHistory(Standard_True),
|
||||
|
@@ -34,7 +34,7 @@
|
||||
//! Additionally to the options defined in the base class, the algorithm has
|
||||
//! the following options:<br>
|
||||
//! - *Safe processing mode* - allows to avoid modification of the input
|
||||
//! shapes during the operation (enabled by default);
|
||||
//! shapes during the operation (by default it is off);
|
||||
//! - *Gluing options* - allows to speed up the calculation of the intersections
|
||||
//! on the special cases, in which some sub-shapes are coinciding.
|
||||
//! - *Disabling the check for inverted solids* - Disables/Enables the check of the input solids
|
||||
@@ -94,7 +94,6 @@ public: //! @name Setting options
|
||||
//! Sets the flag that defines the mode of treatment.
|
||||
//! In non-destructive mode the argument shapes are not modified. Instead
|
||||
//! a copy of a sub-shape is created in the result if it is needed to be updated.
|
||||
//! Enabled by default.
|
||||
void SetNonDestructive(const Standard_Boolean theFlag)
|
||||
{
|
||||
myNonDestructive = theFlag;
|
||||
|
@@ -151,7 +151,7 @@ protected:
|
||||
NCollection_List<Standard_Integer> myFaces;
|
||||
NCollection_List<Standard_Integer> myEdges;
|
||||
|
||||
//! Identifies the place of this Vertex in
|
||||
//! Indentifies the place of this Vertex in
|
||||
//! BRepBuilderAPI_FastSewing::myVertexVec list
|
||||
Standard_Integer myID;
|
||||
};
|
||||
@@ -201,7 +201,7 @@ protected:
|
||||
//! myVertices[i] is Start point of myEdges[i]
|
||||
Standard_Integer myVertices[4];
|
||||
|
||||
//! Identifies the place of this Face in
|
||||
//! Indentifies the place of this Face in
|
||||
//! BRepBuilderAPI_FastSewing::myFaceVec list
|
||||
Standard_Integer myID;
|
||||
};
|
||||
@@ -245,7 +245,7 @@ protected:
|
||||
//! Value is the index of this shape in myFaceVec array
|
||||
NCollection_Sequence<Standard_Integer> myFaces;
|
||||
|
||||
//! Identifies the place of this Edge in
|
||||
//! Indentifies the place of this Edge in
|
||||
//! BRepBuilderAPI_FastSewing::myEdgeVec list
|
||||
Standard_Integer myID;
|
||||
|
||||
|
@@ -235,7 +235,7 @@ public:
|
||||
|
||||
//! Gets mode for non-manifold sewing.
|
||||
//!
|
||||
//! INTERNAL FUNCTIONS ---
|
||||
//! INTERNAL FUCTIONS ---
|
||||
Standard_Boolean NonManifoldMode() const;
|
||||
|
||||
|
||||
|
@@ -473,7 +473,7 @@ BRepCheck_Status BRepCheck_Face::OrientationOfWires
|
||||
}
|
||||
}
|
||||
}
|
||||
// quit without error
|
||||
// quit withour error
|
||||
if (Update) {
|
||||
BRepCheck::Add(myMap(myShape),myOrires);
|
||||
}
|
||||
|
@@ -110,10 +110,10 @@ class BRepExtrema_DistShapeShape
|
||||
//! This support can be a Vertex, an Edge or a Face. <br>
|
||||
Standard_EXPORT TopoDS_Shape SupportOnShape2(const Standard_Integer N) const;
|
||||
//! gives the corresponding parameter t if the Nth solution <br>
|
||||
//! is situated on an Edge of the first shape <br>
|
||||
//! is situated on an Egde of the first shape <br>
|
||||
Standard_EXPORT void ParOnEdgeS1(const Standard_Integer N,Standard_Real& t) const;
|
||||
//! gives the corresponding parameter t if the Nth solution <br>
|
||||
//! is situated on an Edge of the first shape <br>
|
||||
//! is situated on an Egde of the first shape <br>
|
||||
Standard_EXPORT void ParOnEdgeS2(const Standard_Integer N,Standard_Real& t) const;
|
||||
//! gives the corresponding parameters (U,V) if the Nth solution <br>
|
||||
//! is situated on an face of the first shape <br>
|
||||
|
@@ -28,15 +28,18 @@ class Geom2d_Curve;
|
||||
class StdFail_NotDone;
|
||||
|
||||
|
||||
//! Evaluate the 3dCurve and the PCurves described in a MultiLine from BRepFill.
|
||||
//! The parametrization of those curves is not imposed by the Bissectrice.
|
||||
//! The parametrization is given approximately by the abscissa of the curve3d.
|
||||
class BRepFill_ApproxSeewing
|
||||
//! Evaluate the 3dCurve and the PCurves described in
|
||||
//! a MultiLine from BRepFill. The parametrization of
|
||||
//! those curves is not imposed by the Bissectrice.
|
||||
//! The parametrization is given approximatively by
|
||||
//! the abscissa of the curve3d.
|
||||
class BRepFill_ApproxSeewing
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepFill_ApproxSeewing();
|
||||
|
||||
Standard_EXPORT BRepFill_ApproxSeewing(const BRepFill_MultiLine& ML);
|
||||
@@ -56,14 +59,32 @@ public:
|
||||
//! first face of the MultiLine
|
||||
Standard_EXPORT const Handle(Geom2d_Curve)& CurveOnF2() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRepFill_MultiLine myML;
|
||||
Standard_Boolean myIsDone;
|
||||
Handle(Geom_Curve) myCurve;
|
||||
Handle(Geom2d_Curve) myPCurve1;
|
||||
Handle(Geom2d_Curve) myPCurve2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepFill_ApproxSeewing_HeaderFile
|
||||
|
@@ -129,7 +129,7 @@ public:
|
||||
//! - correspondence between profile, and section on the sweeped shape defined by a vertex of the spine
|
||||
Standard_EXPORT void SetForceApproxC1 (const Standard_Boolean ForceApproxC1);
|
||||
|
||||
//! Set an section. The correspondence with the spine, will be automatically performed.
|
||||
//! Set an section. The correspondence with the spine, will be automaticaly performed.
|
||||
Standard_EXPORT void Add (const TopoDS_Shape& Profile, const Standard_Boolean WithContact = Standard_False, const Standard_Boolean WithCorrection = Standard_False);
|
||||
|
||||
//! Set an section. The correspondence with the spine, is given by Location.
|
||||
|
@@ -2969,25 +2969,13 @@ void BRepFill_Sweep::Build(TopTools_MapOfShape& ReversedEdges,
|
||||
// Construction of the shell
|
||||
TopoDS_Shell shell;
|
||||
B.MakeShell(shell);
|
||||
Standard_Integer aNbFaces = 0;
|
||||
for (ipath=1; ipath<=NbPath; ipath++)
|
||||
for (isec=1; isec <=NbLaw; isec++)
|
||||
{
|
||||
const TopoDS_Shape& face = myFaces->Value(isec, ipath);
|
||||
for (isec=1; isec <=NbLaw; isec++) {
|
||||
const TopoDS_Shape& face = myFaces->Value(isec, ipath);
|
||||
if (!face.IsNull() &&
|
||||
(face.ShapeType() == TopAbs_FACE) )
|
||||
{
|
||||
B.Add(shell, face);
|
||||
aNbFaces++;
|
||||
}
|
||||
(face.ShapeType() == TopAbs_FACE) ) B.Add(shell, face);
|
||||
}
|
||||
|
||||
if (aNbFaces == 0)
|
||||
{
|
||||
isDone = Standard_False;
|
||||
return;
|
||||
}
|
||||
|
||||
TopTools_ListIteratorOfListOfShape It(myAuxShape);
|
||||
for (; It.More(); It.Next()) {
|
||||
const TopoDS_Shape& face = It.Value();
|
||||
|
@@ -146,7 +146,7 @@ public:
|
||||
const Standard_Boolean SkipShared = Standard_False,
|
||||
const Standard_Boolean UseTriangulation = Standard_False);
|
||||
|
||||
//! Updates <SProps> with the shape <S>, that contains its principal properties.
|
||||
//! Updates <SProps> with the shape <S>, that contains its pricipal properties.
|
||||
//! The surface properties of all the faces in <S> are computed.
|
||||
//! Adaptive 2D Gauss integration is used.
|
||||
//! Parameter Eps sets maximal relative error of computed mass (area) for each face.
|
||||
@@ -207,7 +207,7 @@ public:
|
||||
const Standard_Boolean SkipShared = Standard_False,
|
||||
const Standard_Boolean UseTriangulation = Standard_False);
|
||||
|
||||
//! Updates <VProps> with the shape <S>, that contains its principal properties.
|
||||
//! Updates <VProps> with the shape <S>, that contains its pricipal properties.
|
||||
//! The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
|
||||
//! If OnlyClosed is True then computed faces must belong to closed Shells.
|
||||
//! Adaptive 2D Gauss integration is used.
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
const Standard_Real Eps, const Standard_Boolean OnlyClosed = Standard_False,
|
||||
const Standard_Boolean SkipShared = Standard_False);
|
||||
|
||||
//! Updates <VProps> with the shape <S>, that contains its principal properties.
|
||||
//! Updates <VProps> with the shape <S>, that contains its pricipal properties.
|
||||
//! The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
|
||||
//! If OnlyClosed is True then computed faces must belong to closed Shells.
|
||||
//! Adaptive 2D Gauss integration is used.
|
||||
|
@@ -225,7 +225,7 @@ void BRepGProp_Face::Normal (const Standard_Real U,
|
||||
|
||||
// APO 17.04.2002 (OCC104)
|
||||
// This is functions that calculate coeff. to optimize "integration order".
|
||||
// They had been produced experimentally for some hard example.
|
||||
//They had been produced experementally for some hard example.
|
||||
static Standard_Real AS = -0.15, AL = -0.50, B = 1.0, C = 0.75, D = 0.25;
|
||||
static inline Standard_Real SCoeff(const Standard_Real Eps){
|
||||
return Eps < 0.1? AS*(B+Log10(Eps)) + C: C;
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
//! surfaces.
|
||||
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
|
||||
//! is used. Numbers of points depend on types of surfaces and curves.
|
||||
//! Error of the computation is not calculated.
|
||||
//! Errror of the computation is not calculated.
|
||||
Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pnt& VLocation);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
//! surfaces.
|
||||
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
|
||||
//! is used. Numbers of points depend on types of surfaces and curves.
|
||||
//! Error of the computation is not calculated.
|
||||
//! Errror of the computation is not calculated.
|
||||
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& VLocation);
|
||||
|
||||
|
||||
|
@@ -64,7 +64,6 @@
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <IntRes2d_IntersectionPoint.hxx>
|
||||
#include <IntRes2d_IntersectionSegment.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColGeom2d_SequenceOfCurve.hxx>
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
@@ -279,14 +278,6 @@ static void Store(const TopoDS_Edge& theEdge,
|
||||
Handle(BRepAlgo_AsDes) theAsDes2d,
|
||||
TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
|
||||
{
|
||||
// Update vertices
|
||||
TopTools_ListIteratorOfListOfShape aIt(theLV);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value());
|
||||
BRep_Builder().UpdateVertex(aV, theTol);
|
||||
}
|
||||
|
||||
// Get vertices already added to the edge and check the distances to the new ones
|
||||
const TopTools_ListOfShape& aLVEx = theAsDes2d->Descendant(theEdge);
|
||||
if (!IsToUpdate && aLVEx.IsEmpty()) {
|
||||
if (theLV.Extent()) theAsDes2d->Add(theEdge, theLV);
|
||||
@@ -294,23 +285,21 @@ static void Store(const TopoDS_Edge& theEdge,
|
||||
}
|
||||
//
|
||||
GeomAPI_ProjectPointOnCurve aProjPC;
|
||||
Standard_Real aTolE = 0.0;
|
||||
if (IsToUpdate) {
|
||||
Standard_Real aT1, aT2;
|
||||
const Handle(Geom_Curve)& aC = BRep_Tool::Curve(theEdge, aT1, aT2);
|
||||
aProjPC.Init(aC, aT1, aT2);
|
||||
aTolE = BRep_Tool::Tolerance(theEdge);
|
||||
}
|
||||
//
|
||||
TopTools_MapOfShape aMV;
|
||||
for (aIt.Init(theLV); aIt.More(); aIt.Next()) {
|
||||
TopTools_ListIteratorOfListOfShape aIt(theLV);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(aIt.Value());
|
||||
if (!aMV.Add(aV)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const gp_Pnt& aP = BRep_Tool::Pnt(aV);
|
||||
const Standard_Real aTol = BRep_Tool::Tolerance(aV);
|
||||
//
|
||||
TopTools_ListOfShape aLVC;
|
||||
TopTools_ListIteratorOfListOfShape aItEx(aLVEx);
|
||||
@@ -320,8 +309,7 @@ static void Store(const TopoDS_Edge& theEdge,
|
||||
break;
|
||||
}
|
||||
const gp_Pnt& aPEx = BRep_Tool::Pnt(aVEx);
|
||||
const Standard_Real aTolVEx = BRep_Tool::Tolerance(aVEx);
|
||||
if (aP.IsEqual(aPEx, aTol + aTolVEx)) {
|
||||
if (aP.IsEqual(aPEx, theTol)) {
|
||||
aLVC.Append(aVEx);
|
||||
}
|
||||
}
|
||||
@@ -337,13 +325,16 @@ static void Store(const TopoDS_Edge& theEdge,
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aProjPC.LowerDistance() > aTol + aTolE) {
|
||||
if (aProjPC.LowerDistance() > theTol) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
Standard_Real aT = aProjPC.LowerDistanceParameter();
|
||||
TopoDS_Shape aLocalShape = aV.Oriented(TopAbs_INTERNAL);
|
||||
BRep_Builder().UpdateVertex(TopoDS::Vertex(aLocalShape), aT, theEdge, aTol);
|
||||
BRep_Builder().UpdateVertex(TopoDS::Vertex(aLocalShape), aT, theEdge, theTol);
|
||||
}
|
||||
else {
|
||||
BRep_Builder().UpdateVertex(aV, theTol);
|
||||
}
|
||||
//
|
||||
if (aLVC.Extent()) {
|
||||
@@ -681,7 +672,7 @@ static void RefEdgeInter(const TopoDS_Face& F,
|
||||
return;
|
||||
|
||||
Standard_Real f[3],l[3];
|
||||
Standard_Real TolDub = 1.e-7, TolLL = 0.0;
|
||||
Standard_Real TolDub = 1.e-7;
|
||||
Standard_Integer i;
|
||||
|
||||
//BRep_Tool::Range(E1, f[1], l[1]);
|
||||
@@ -698,6 +689,9 @@ static void RefEdgeInter(const TopoDS_Face& F,
|
||||
BRepLib::BuildCurve3d(E1);
|
||||
BRepLib::BuildCurve3d(E2);
|
||||
|
||||
Standard_Real TolSum = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
|
||||
TolSum = Max( TolSum, 1.e-5 );
|
||||
|
||||
TColgp_SequenceOfPnt ResPoints;
|
||||
TColStd_SequenceOfReal ResParamsOnE1, ResParamsOnE2;
|
||||
gp_Pnt DegPoint;
|
||||
@@ -727,19 +721,11 @@ static void RefEdgeInter(const TopoDS_Face& F,
|
||||
(GAC2.GetType() == GeomAbs_Line))
|
||||
{
|
||||
// Just quickly check if lines coincide
|
||||
Standard_Real anAngle = Abs(GAC1.Line().Direction().Angle(GAC2.Line().Direction()));
|
||||
if (anAngle <= 1.e-8 || M_PI - anAngle <= 1.e-8)
|
||||
if (GAC1.Line().Direction().IsParallel (GAC2.Line().Direction(), 1.e-8))
|
||||
{
|
||||
theCoincide = Standard_True;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Take into account the intersection range of line-line intersection
|
||||
// (the smaller angle between curves, the bigger range)
|
||||
TolLL = IntTools_Tools::ComputeIntRange(TolDub, TolDub, anAngle);
|
||||
TolLL = Min (TolLL, 1.e-5);
|
||||
}
|
||||
}
|
||||
|
||||
Geom2dInt_GInter Inter2d( GAC1, GAC2, TolDub, TolDub );
|
||||
@@ -957,12 +943,10 @@ static void RefEdgeInter(const TopoDS_Face& F,
|
||||
else
|
||||
theImageVV.Bind (theVref.Oriented(TopAbs_FORWARD), aNewVertex);
|
||||
}
|
||||
|
||||
|
||||
////-----------------------------------------------------
|
||||
Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2);
|
||||
TolStore = Max (TolStore, Tol);
|
||||
// Compare to Line-Line tolerance
|
||||
TolStore = Max (TolStore, TolLL);
|
||||
Store (E1,E2,LV1,LV2,TolStore,AsDes, aDMVV);
|
||||
}
|
||||
}
|
||||
|
@@ -4302,7 +4302,6 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
|
||||
// we need to intersect the faces to process the tangential faces
|
||||
aMV1.SetIntersect(Standard_True);
|
||||
aMV1.SetAvoidInternalShapes(Standard_True);
|
||||
aMV1.SetNonDestructive(Standard_False);
|
||||
aMV1.Perform();
|
||||
//
|
||||
Standard_Boolean bDone = ! aMV1.HasErrors();
|
||||
@@ -4383,7 +4382,6 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
|
||||
// no need to intersect this time
|
||||
aMV2.SetIntersect(Standard_False);
|
||||
aMV2.SetAvoidInternalShapes(Standard_True);
|
||||
aMV2.SetNonDestructive(Standard_False);
|
||||
aMV2.Perform();
|
||||
bDone = ! aMV2.HasErrors();
|
||||
if (!bDone) {
|
||||
@@ -4435,7 +4433,6 @@ Standard_Boolean BuildShellsCompleteInter(const TopTools_ListOfShape& theLF,
|
||||
aMV3.SetArguments(aLF);
|
||||
aMV3.SetIntersect(Standard_False);
|
||||
aMV3.SetAvoidInternalShapes(Standard_True);
|
||||
aMV3.SetNonDestructive(Standard_False);
|
||||
aMV3.Perform();
|
||||
bDone = ! aMV3.HasErrors();
|
||||
if (!bDone) {
|
||||
|
@@ -46,6 +46,7 @@
|
||||
|
||||
#include <BOPDS_DS.hxx>
|
||||
|
||||
#include <BOPAlgo_PaveFiller.hxx>
|
||||
#include <BOPAlgo_Builder.hxx>
|
||||
#include <BOPAlgo_Section.hxx>
|
||||
#include <BOPAlgo_MakerVolume.hxx>
|
||||
@@ -1303,7 +1304,6 @@ void IntersectTrimmedEdges(const TopTools_ListOfShape& theLF,
|
||||
// perform intersection of the edges
|
||||
BOPAlgo_Builder aGFE;
|
||||
aGFE.SetArguments(aLS);
|
||||
aGFE.SetNonDestructive(Standard_False);
|
||||
aGFE.Perform();
|
||||
if (aGFE.HasErrors()) {
|
||||
return;
|
||||
@@ -1496,9 +1496,9 @@ void BuildSplitsOfTrimmedFace(const TopoDS_Face& theFace,
|
||||
TopTools_ListOfShape& theLFImages)
|
||||
{
|
||||
BOPAlgo_Builder aGF;
|
||||
//
|
||||
aGF.AddArgument(theFace);
|
||||
aGF.AddArgument(theEdges);
|
||||
aGF.SetNonDestructive(Standard_False);
|
||||
aGF.Perform();
|
||||
if (aGF.HasErrors()) {
|
||||
return;
|
||||
@@ -3502,7 +3502,6 @@ void RemoveInsideFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
|
||||
BOPAlgo_MakerVolume aMV;
|
||||
aMV.SetArguments(aLS);
|
||||
aMV.SetIntersect(Standard_True);
|
||||
aMV.SetNonDestructive(Standard_False);
|
||||
aMV.Perform();
|
||||
if (aMV.HasErrors())
|
||||
return;
|
||||
@@ -5883,7 +5882,6 @@ void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theF
|
||||
// Intersect Edges
|
||||
BOPAlgo_Builder aGF;
|
||||
aGF.SetArguments(aLArgs);
|
||||
aGF.SetNonDestructive(Standard_False);
|
||||
aGF.Perform();
|
||||
if (aGF.HasErrors()) {
|
||||
return;
|
||||
@@ -5952,7 +5950,6 @@ void IntersectAndTrimEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theF
|
||||
BOPAlgo_Builder aGFCE;
|
||||
aGFCE.SetArguments(aLCE);
|
||||
aGFCE.AddArgument(aCEIm);
|
||||
aGFCE.SetNonDestructive(Standard_False);
|
||||
aGFCE.Perform();
|
||||
//
|
||||
if (aGFCE.HasErrors()) {
|
||||
@@ -6401,7 +6398,6 @@ void UpdateValidEdges(const TopTools_IndexedDataMapOfShapeListOfShape& theFImage
|
||||
BOPAlgo_Builder aGF;
|
||||
aGF.AddArgument(aBounds);
|
||||
aGF.AddArgument(aSplits);
|
||||
aGF.SetNonDestructive(Standard_False);
|
||||
aGF.Perform();
|
||||
//
|
||||
// update splits
|
||||
@@ -6549,7 +6545,6 @@ void TrimNewIntersectionEdges(const TopTools_ListOfShape& theLE,
|
||||
aMV.Add(aV1);
|
||||
aMV.Add(aV2);
|
||||
//
|
||||
aGFE.SetNonDestructive(Standard_False);
|
||||
aGFE.Perform();
|
||||
if (!aGFE.HasErrors()) {
|
||||
// get images of bounding vertices to remove splits containing them
|
||||
@@ -6639,7 +6634,6 @@ void IntersectEdges(const TopTools_ListOfShape& theLA,
|
||||
{
|
||||
BOPAlgo_Builder aGFA;
|
||||
aGFA.SetArguments(theLA);
|
||||
aGFA.SetNonDestructive(Standard_False);
|
||||
aGFA.Perform();
|
||||
if (aGFA.HasErrors()) {
|
||||
// just copy input to the result
|
||||
@@ -6880,7 +6874,6 @@ void GetInvalidEdgesByBounds(const TopoDS_Shape& theSplits,
|
||||
BOPAlgo_Section aSec;
|
||||
aSec.AddArgument(theSplits);
|
||||
aSec.AddArgument(theBounds);
|
||||
aSec.SetNonDestructive(Standard_False);
|
||||
//
|
||||
aSec.Perform();
|
||||
//
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include <GeometryTest.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <Draw_ProgressIndicator.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
@@ -168,13 +167,8 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
NbPtsCur->Value(i));
|
||||
Henri.Add(Cont);
|
||||
}
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Henri.Perform();
|
||||
|
||||
Standard_Real ErrG0 = 1.1*Henri.G0Error();
|
||||
//std::cout<<" dist. max = "<<Henri.G0Error()<<" ; angle max = "<<Henri.G1Error()<<std::endl;
|
||||
@@ -223,7 +217,7 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
// commande gplate : resultat face egale a la surface approchee
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Standard_Integer gplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
|
||||
static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const char** a)
|
||||
{
|
||||
if (n < 6 ) return 1;
|
||||
Standard_Integer NbCurFront=Draw::Atoi(a[2]),
|
||||
@@ -304,13 +298,7 @@ static Standard_Integer gplate (Draw_Interpretor & di,Standard_Integer n,const c
|
||||
Henri.Add(PCont);
|
||||
}
|
||||
}
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
Henri.Perform();
|
||||
Standard_Integer nbcarreau=9;
|
||||
Standard_Integer degmax=8;
|
||||
Standard_Real seuil;
|
||||
@@ -380,13 +368,7 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
|
||||
Henri.Add(Cont);
|
||||
}
|
||||
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
Henri.Perform();
|
||||
|
||||
Standard_Real dmax = Henri.G0Error(),
|
||||
anmax = Henri.G1Error();
|
||||
|
@@ -412,7 +412,7 @@ Standard_Boolean BRepTools_Modifier::Rebuild
|
||||
{
|
||||
// rem dub 16/09/97 : Make constant topology or not make at all.
|
||||
// Do not make if CopySurface = 1
|
||||
// Attention, TRUE sewing edges (ReallyClosed)
|
||||
// Atention, TRUE sewing edges (ReallyClosed)
|
||||
// stay even if CopySurface is true.
|
||||
|
||||
// check that edge contains two pcurves on this surface:
|
||||
|
@@ -112,16 +112,17 @@ public:
|
||||
|
||||
//! Applies the substitutions requests to a shape.
|
||||
//!
|
||||
//! theUntil gives the level of type until which requests are taken into account.
|
||||
//! For subshapes of the type <until> no rebuild and further exploring are done.
|
||||
//! <until> gives the level of type until which requests are taken
|
||||
//! into account. For subshapes of the type <until> no rebuild
|
||||
//! and futher exploring are done.
|
||||
//!
|
||||
//! NOTE: each subshape can be replaced by shape of the same type
|
||||
//! or by shape containing only shapes of that type
|
||||
//! (for example, TopoDS_Edge can be replaced by TopoDS_Edge,
|
||||
//! or by shape containing only shapes of that type (for
|
||||
//! example, TopoDS_Edge can be replaced by TopoDS_Edge,
|
||||
//! TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
|
||||
//! If incompatible shape type is encountered, it is ignored and flag FAIL1 is set in Status.
|
||||
Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& theShape,
|
||||
const TopAbs_ShapeEnum theUntil = TopAbs_SHAPE);
|
||||
//! If incompatible shape type is encountered, it is ignored
|
||||
//! and flag FAIL1 is set in Status.
|
||||
Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until = TopAbs_SHAPE);
|
||||
|
||||
//! Returns (modifiable) the flag which defines whether Location of shape take into account
|
||||
//! during replacing shapes.
|
||||
|
@@ -125,9 +125,9 @@ void BRepTools_Substitution::Build(const TopoDS_Shape& S)
|
||||
if (!HasSubShape) {
|
||||
if (NewS.ShapeType() == TopAbs_WIRE || NewS.ShapeType() == TopAbs_SHELL ||
|
||||
NewS.ShapeType() == TopAbs_SOLID || NewS.ShapeType() == TopAbs_COMPOUND)
|
||||
//-----------------------------------------------------------------
|
||||
// Wire,Solid,Shell,Compound must have subshape else they disappear
|
||||
//-----------------------------------------------------------------
|
||||
//----------------------------------------------------------------
|
||||
// Wire,Solid,Shell,Compound mut have subshape else they disapear
|
||||
//---------------------------------------------------------------
|
||||
NewS.Nullify();
|
||||
}
|
||||
}
|
||||
|
@@ -524,67 +524,64 @@ public:
|
||||
Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
|
||||
|
||||
//! Increase the degree of a bspline (or bezier) curve
|
||||
//! of dimension theDimension form theDegree to theNewDegree.
|
||||
//! of dimension <Dimension> form <Degree> to
|
||||
//! <NewDegree>.
|
||||
//!
|
||||
//! The number of poles in the new curve is:
|
||||
//! @code
|
||||
//! Poles.Length() + (NewDegree - Degree) * Number of spans
|
||||
//! @endcode
|
||||
//! Where the number of spans is:
|
||||
//! @code
|
||||
//! LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1
|
||||
//! @endcode
|
||||
//! for a non-periodic curve, and
|
||||
//! @code
|
||||
//! Knots.Length() - 1
|
||||
//! @endcode
|
||||
//! for a periodic curve.
|
||||
//! The number of poles in the new curve is :
|
||||
//!
|
||||
//! The multiplicities of all knots are increased by the degree elevation.
|
||||
//! Poles.Length() + (NewDegree - Degree) * Number of spans
|
||||
//!
|
||||
//! The new knots are usually the same knots with the
|
||||
//! exception of a non-periodic curve with the first
|
||||
//! Where the number of spans is :
|
||||
//!
|
||||
//! LastUKnotIndex(Mults) - FirstUKnotIndex(Mults) + 1
|
||||
//!
|
||||
//! for a non-periodic curve
|
||||
//!
|
||||
//! And Knots.Length() - 1 for a periodic curve.
|
||||
//!
|
||||
//! The multiplicities of all knots are increased by
|
||||
//! the degree elevation.
|
||||
//!
|
||||
//! The new knots are usually the same knots with the
|
||||
//! exception of a non-periodic curve with the first
|
||||
//! and last multiplicity not equal to Degree+1 where
|
||||
//! knots are removed form the start and the bottom
|
||||
//! until the sum of the multiplicities is equal to
|
||||
//! NewDegree+1 at the knots corresponding to the
|
||||
//! knots are removed form the start and the bottom
|
||||
//! untils the sum of the multiplicities is equal to
|
||||
//! NewDegree+1 at the knots corresponding to the
|
||||
//! first and last parameters of the curve.
|
||||
//!
|
||||
//! Example: Suppose a curve of degree 3 starting
|
||||
//! with following knots and multiplicities:
|
||||
//! @code
|
||||
//! knot : 0. 1. 2.
|
||||
//! mult : 1 2 1
|
||||
//! @endcode
|
||||
//! Example : Suppose a curve of degree 3 starting
|
||||
//! with following knots and multiplicities :
|
||||
//!
|
||||
//! The FirstUKnot is 2.0 because the sum of multiplicities is
|
||||
//! @code
|
||||
//! Degree+1 : 1 + 2 + 1 = 4 = 3 + 1
|
||||
//! @endcode
|
||||
//! i.e. the first parameter of the curve is 2.0 and
|
||||
//! will still be 2.0 after degree elevation.
|
||||
//! Let raise this curve to degree 4.
|
||||
//! The multiplicities are increased by 2.
|
||||
//! knot : 0. 1. 2.
|
||||
//! mult : 1 2 1
|
||||
//!
|
||||
//! They become 2 3 2.
|
||||
//! But we need a sum of multiplicities of 5 at knot 2.
|
||||
//! So the first knot is removed and the new knots are:
|
||||
//! @code
|
||||
//! knot : 1. 2.
|
||||
//! mult : 3 2
|
||||
//! @endcode
|
||||
//! The multipicity of the first knot may also be reduced if the sum is still to big.
|
||||
//! The FirstUKnot is 2. because the sum of
|
||||
//! multiplicities is Degree+1 : 1 + 2 + 1 = 4 = 3 + 1
|
||||
//!
|
||||
//! In the most common situations (periodic curve or curve with first
|
||||
//! and last multiplicities equals to Degree+1) the knots are knot changes.
|
||||
//! i.e. the first parameter of the curve is 2. and
|
||||
//! will still be 2. after degree elevation. Let
|
||||
//! raises this curve to degree 4. The multiplicities
|
||||
//! are increased by 2.
|
||||
//!
|
||||
//! The method IncreaseDegreeCountKnots can be used to compute the new number of knots.
|
||||
Standard_EXPORT static void IncreaseDegree (const Standard_Integer theNewDegree,
|
||||
const TColgp_Array1OfPnt2d& thePoles,
|
||||
const TColStd_Array1OfReal* theWeights,
|
||||
TColgp_Array1OfPnt2d& theNewPoles,
|
||||
TColStd_Array1OfReal* theNewWeights);
|
||||
|
||||
//! They become 2 3 2. But we need a sum of
|
||||
//! multiplicities of 5 at knot 2. So the first knot
|
||||
//! is removed and the new knots are :
|
||||
//!
|
||||
//! knot : 1. 2.
|
||||
//! mult : 3 2
|
||||
//!
|
||||
//! The multipicity of the first knot may also be
|
||||
//! reduced if the sum is still to big.
|
||||
//!
|
||||
//! In the most common situations (periodic curve or
|
||||
//! curve with first and last multiplicities equals to
|
||||
//! Degree+1) the knots are knot changes.
|
||||
//!
|
||||
//! The method IncreaseDegreeCountKnots can be used to
|
||||
//! compute the new number of knots.
|
||||
Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
|
||||
|
||||
//! Set in <NbKnots> and <NbPolesToAdd> the number of Knots and
|
||||
//! Poles of the NotPeriodic Curve identical at the
|
||||
//! periodic curve with a degree <Degree> , a
|
||||
|
@@ -34,8 +34,6 @@ IMPLEMENT_STANDARD_RTTIEXT(BVH_ObjectTransient, Standard_Transient)
|
||||
template class NCollection_Vec2<Standard_Real>;
|
||||
template class NCollection_Vec3<Standard_Real>;
|
||||
template class NCollection_Vec4<Standard_Real>;
|
||||
template class NCollection_Mat3<Standard_Real>;
|
||||
template class NCollection_Mat4<Standard_Real>;
|
||||
|
||||
template class BVH_Box<Standard_Real, 2>;
|
||||
template class BVH_Box<Standard_Real, 3>;
|
||||
|
@@ -31,11 +31,11 @@ class gp_Vec2d;
|
||||
class Geom2d_Point;
|
||||
|
||||
|
||||
//! Bisec provides the bisecting line between two elements
|
||||
//! This line is trimmed by a point <P> and it's contained in the domain
|
||||
//! Bisec provides the bisecting line between two elements
|
||||
//! This line is trimed by a point <P> and it's contained in the domain
|
||||
//! defined by the two vectors <V1>, <V2> and <Sense>.
|
||||
//!
|
||||
//! Definition of the domain:
|
||||
//! Definition of the domain:
|
||||
//! if <Sense> is true the bisecting line is contained in the sector
|
||||
//! defined by <-V1> and <-V2> in the sense indirect.
|
||||
//! if <Sense> is false the bisecting line is contained in the sector
|
||||
@@ -47,7 +47,7 @@ class Geom2d_Point;
|
||||
//! corresponding to one of hyperbola's axes.
|
||||
//! if the bisector is a parabola on the focal length is smaller than
|
||||
//! <Tolerance>, the bisector is replaced by a semi_line corresponding
|
||||
//! to the axe of symmetry of the parabola.
|
||||
//! to the axe of symetrie of the parabola.
|
||||
//! if the bisector is an ellipse and the minor radius is smaller than
|
||||
//! <Tolerance>, the bisector is replaced by a segment corresponding
|
||||
//! to the great axe of the ellipse.
|
||||
|
@@ -49,7 +49,7 @@ static Standard_Integer nbint = 0;
|
||||
|
||||
//===================================================================================
|
||||
// function :
|
||||
// purpose :
|
||||
// putpose :
|
||||
//===================================================================================
|
||||
Bisector_Inter::Bisector_Inter()
|
||||
{
|
||||
@@ -57,7 +57,7 @@ Bisector_Inter::Bisector_Inter()
|
||||
|
||||
//===================================================================================
|
||||
// function :
|
||||
// purpose :
|
||||
// putpose :
|
||||
//===================================================================================
|
||||
Bisector_Inter::Bisector_Inter(const Bisector_Bisec& C1,
|
||||
const IntRes2d_Domain& D1,
|
||||
@@ -72,7 +72,7 @@ Bisector_Inter::Bisector_Inter(const Bisector_Bisec& C1,
|
||||
|
||||
//===================================================================================
|
||||
// function : ConstructSegment
|
||||
// purpose :
|
||||
// putpose :
|
||||
//===================================================================================
|
||||
static Handle(Geom2d_Line) ConstructSegment(const gp_Pnt2d& PMin,
|
||||
const gp_Pnt2d& PMax,
|
||||
@@ -88,7 +88,7 @@ static Handle(Geom2d_Line) ConstructSegment(const gp_Pnt2d& PMin,
|
||||
|
||||
//===================================================================================
|
||||
// function : Perform
|
||||
// purpose :
|
||||
// putpose :
|
||||
//===================================================================================
|
||||
void Bisector_Inter::Perform(const Bisector_Bisec& C1,
|
||||
const IntRes2d_Domain& D1,
|
||||
@@ -208,7 +208,7 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1,
|
||||
|
||||
//===================================================================================
|
||||
// function : SinglePerform
|
||||
// purpose :
|
||||
// putpose :
|
||||
//===================================================================================
|
||||
void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1,
|
||||
const IntRes2d_Domain& D1,
|
||||
@@ -308,7 +308,7 @@ void Bisector_Inter::SinglePerform(const Handle(Geom2d_Curve)& CBis1,
|
||||
|
||||
//===================================================================================
|
||||
// function : NeighbourPerform
|
||||
// purpose : Find the intersection of 2 neighbor bissectrices curve/curve
|
||||
// putpose : Find the intersection of 2 neighbor bissectrices curve/curve
|
||||
// (ie Bis1 separates A and B and Bis2 separates B and C).
|
||||
// Bis1 is parameterized by B and Bis2 by C.
|
||||
//
|
||||
@@ -371,7 +371,7 @@ void Bisector_Inter::NeighbourPerform(const Handle(Bisector_BisecCC)& Bis1,
|
||||
|
||||
//=====================================================================================
|
||||
// function : TestBound
|
||||
// purpose : Test if the extremities of Bis2 are on the segment corresponding to Bis1.
|
||||
// putpose : Test if the extremities of Bis2 are on the segment cooresponding to Bis1.
|
||||
//=====================================================================================
|
||||
void Bisector_Inter::TestBound (const Handle(Geom2d_Line)& Bis1,
|
||||
const IntRes2d_Domain& D1,
|
||||
|
@@ -137,7 +137,7 @@ public:
|
||||
PCDM_ReaderStatus GetRetrieveStatus() const { return myRetrievableStatus; }
|
||||
|
||||
//! Reads aDoc from standard SEEKABLE stream theIStream,
|
||||
//! the stream should support SEEK functionality
|
||||
//! the stream should support SEEK fuctionality
|
||||
Standard_EXPORT Handle(CDM_Document) Read
|
||||
(Standard_IStream& theIStream,
|
||||
const Message_ProgressRange& theRange = Message_ProgressRange());
|
||||
|
@@ -776,7 +776,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data,
|
||||
|
||||
if(!ChFi3d_CheckSameParameter(checkcurve,PCurveOnFace,S1,tolC1,tolcheck)){
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout<<"approximate tolerance under-valued : "<<tolC1<<" for "<<tolcheck<<std::endl;
|
||||
std::cout<<"aaproximate tolerance under-valued : "<<tolC1<<" for "<<tolcheck<<std::endl;
|
||||
#endif
|
||||
tolC1 = tolcheck;
|
||||
}
|
||||
|
@@ -1,41 +1,5 @@
|
||||
project(DRAWEXE)
|
||||
|
||||
unset (CUSTOM_EXTERNLIB)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
# link specific list of plugins explicitly
|
||||
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB_STATIC" CUSTOM_EXTERNLIB)
|
||||
if (USE_OPENGL)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGles)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGlesTest)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB CSF_OpenGlesLibs)
|
||||
elseif(USE_GLES2)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGl)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGlTest)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB CSF_OpenGlLibs)
|
||||
else()
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGles)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGlesTest)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB CSF_OpenGlesLibs)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGl)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB TKOpenGlTest)
|
||||
list (REMOVE_ITEM CUSTOM_EXTERNLIB CSF_OpenGlLibs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (EXECUTABLE_PROJECT ON)
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
|
||||
unset (EXECUTABLE_PROJECT)
|
||||
unset (CUSTOM_EXTERNLIB)
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=1")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s MAX_WEBGL_VERSION=2")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --bind")
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s MODULARIZE=1")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXPORT_NAME='createDRAWEXE'")
|
||||
|
||||
install(FILES ${PROJECT_NAME}.html DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
install(FILES ../DrawResources/lamp.ico DESTINATION "${INSTALL_DIR_BIN}/${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
|
@@ -16,20 +16,6 @@
|
||||
#include <Draw.hxx>
|
||||
#include <DBRep.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_PrinterSystemLog.hxx>
|
||||
|
||||
#ifdef OCCT_NO_PLUGINS
|
||||
#include <BOPTest.hxx>
|
||||
#include <DPrsStd.hxx>
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_GLES2)
|
||||
#include <OpenGlTest.hxx>
|
||||
#endif
|
||||
#include <TObjDRAW.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
#include <XSDRAWSTLVRML.hxx>
|
||||
#include <XDEDRAW.hxx>
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : Draw_InitAppli
|
||||
@@ -38,29 +24,9 @@
|
||||
|
||||
void Draw_InitAppli (Draw_Interpretor& di)
|
||||
{
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
// open JavaScript console within the Browser to see this output
|
||||
Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("DRAWEXE");
|
||||
Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter);
|
||||
#endif
|
||||
|
||||
Draw::Commands (di);
|
||||
DBRep::BasicCommands (di);
|
||||
DrawTrSurf::BasicCommands (di);
|
||||
|
||||
#ifdef OCCT_NO_PLUGINS
|
||||
// load a couple of plugins
|
||||
BOPTest::Factory (di);
|
||||
DPrsStd::Factory (di);
|
||||
XSDRAWSTLVRML::Factory (di);
|
||||
XDEDRAW::Factory (di);
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_GLES2)
|
||||
ViewerTest::Factory (di);
|
||||
OpenGlTest::Factory (di);
|
||||
#endif
|
||||
//TObjDRAW::Factory (di);
|
||||
//QADraw::Factory (di);
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <Draw_Main.hxx>
|
||||
|
@@ -1,68 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang=en-us>
|
||||
<head>
|
||||
<meta charset=utf-8><meta content="text/html; charset=utf-8" http-equiv=Content-Type>
|
||||
<link rel="shortcut icon" href="lamp.ico" type="image/x-icon" />
|
||||
<title>OCCT Draw Harness</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>OCCT Draw Harness</h2>
|
||||
<div>
|
||||
<canvas id=occViewerCanvas oncontextmenu=event.preventDefault() tabindex=-1 style="border:0 none;background-color:#000" width="409" height="409"></canvas>
|
||||
</div>
|
||||
<h4>Output (open JavaScript console):</h4>
|
||||
<p id="output"></p>
|
||||
<script type="text/javascript" src="DRAWEXE.js" charset="utf-8"></script>
|
||||
<script>
|
||||
//! Check browser support.
|
||||
function isWasmSupported()
|
||||
{
|
||||
try {
|
||||
if (typeof WebAssembly === "object"
|
||||
&& typeof WebAssembly.instantiate === "function") {
|
||||
const aDummyModule = new WebAssembly.Module (Uint8Array.of (0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
if (aDummyModule instanceof WebAssembly.Module)
|
||||
{
|
||||
return new WebAssembly.Instance(aDummyModule) instanceof WebAssembly.Instance;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
if (!isWasmSupported())
|
||||
{
|
||||
var anElement = document.getElementById('output');
|
||||
anElement.innerHTML += "Browser is too old - WebAssembly support is missing!<br>Please check updates or install a modern browser.<br>";
|
||||
}
|
||||
|
||||
var DRAWEXE =
|
||||
{
|
||||
print: (function() {
|
||||
var anElement = document.getElementById('output');
|
||||
//return function(theText) { anElement.innerHTML += theText + "<br>"; };
|
||||
return function(theText) { console.warn(theText); };
|
||||
})(),
|
||||
printErr: function(theText) {
|
||||
//var anElement = document.getElementById('output');
|
||||
//anElement.innerHTML += theText + "<br>";
|
||||
console.warn(theText);
|
||||
},
|
||||
canvas: (function() {
|
||||
var aCanvas = document.getElementById('occViewerCanvas');
|
||||
return aCanvas;
|
||||
})(),
|
||||
|
||||
onRuntimeInitialized: function() {
|
||||
//
|
||||
}
|
||||
};
|
||||
|
||||
const DRAWEXEInitialized = createDRAWEXE(DRAWEXE);
|
||||
DRAWEXEInitialized.then(function(Module) {
|
||||
//DRAWEXE.eval("dversion");
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -1,75 +0,0 @@
|
||||
TKTopTest
|
||||
TKDCAF
|
||||
TKXSDRAW
|
||||
TKXDEDRAW
|
||||
TKOpenGlTest
|
||||
TKOpenGlesTest
|
||||
TKViewerTest
|
||||
TKDraw
|
||||
TKMeshVS
|
||||
TKXDESTEP
|
||||
TKSTEP
|
||||
TKSTEPAttr
|
||||
TKSTEP209
|
||||
TKSTEPBase
|
||||
TKXDEIGES
|
||||
TKIGES
|
||||
TKXSBase
|
||||
TKVRML
|
||||
TKSTL
|
||||
TKRWMesh
|
||||
TKBinXCAF
|
||||
TKXmlXCAF
|
||||
TKBin
|
||||
TKXml
|
||||
TKXmlL
|
||||
TKBinL
|
||||
TKOpenGl
|
||||
TKOpenGles
|
||||
TKXCAF
|
||||
TKVCAF
|
||||
TKStd
|
||||
TKCAF
|
||||
TKV3d
|
||||
TKHLR
|
||||
TKMesh
|
||||
TKService
|
||||
TKOffset
|
||||
TKFillet
|
||||
TKFeat
|
||||
TKBool
|
||||
TKBO
|
||||
TKShHealing
|
||||
TKPrim
|
||||
TKTopAlgo
|
||||
TKGeomAlgo
|
||||
TKBRep
|
||||
TKGeomBase
|
||||
TKG3d
|
||||
TKG2d
|
||||
TKMath
|
||||
TKStdL
|
||||
TKLCAF
|
||||
TKCDF
|
||||
TKernel
|
||||
CSF_TclLibs
|
||||
CSF_OpenVR
|
||||
CSF_OpenGlLibs
|
||||
CSF_OpenGlesLibs
|
||||
CSF_FFmpeg
|
||||
CSF_FreeImagePlus
|
||||
CSF_FREETYPE
|
||||
CSF_user32
|
||||
CSF_advapi32
|
||||
CSF_XwLibs
|
||||
CSF_dpsLibs
|
||||
CSF_XmuLibs
|
||||
CSF_fontconfig
|
||||
CSF_objc
|
||||
CSF_Appkit
|
||||
CSF_IOKit
|
||||
CSF_winmm
|
||||
CSF_ThreadLibs
|
||||
CSF_wsock32
|
||||
CSF_psapi
|
||||
CSF_androidlog
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user