mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b720f78482 | ||
|
efb8c69bbc | ||
|
3b8f64569e | ||
|
a370cc6537 |
@@ -160,15 +160,11 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
|
||||
if ("${USE_TCL}" STREQUAL ON)
|
||||
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_GROUP ("3RDPARTY_TK")
|
||||
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TCL")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
|
||||
endif()
|
||||
|
||||
# search for CSF_FREETYPE variable in EXTERNLIB of each being used toolkit
|
||||
|
@@ -192,60 +192,3 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB
|
||||
|
||||
mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL)
|
||||
endmacro()
|
||||
|
||||
macro (COMPLIANCE_PRODUCT_CONSISTENCY LIBNAME)
|
||||
if (3RDPARTY_${LIBNAME}_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DIR}")
|
||||
# include dir
|
||||
set (DOES_PATH_CONTAIN FALSE)
|
||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
endif()
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
|
||||
# library dir
|
||||
set (DOES_PATH_CONTAIN FALSE)
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
endif()
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# shared library dir
|
||||
if (WIN32)
|
||||
set (DOES_PATH_CONTAIN FALSE)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
endif()
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check library
|
||||
set (DOES_PATH_CONTAIN FALSE)
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# check shared library
|
||||
if (WIN32)
|
||||
set (DOES_PATH_CONTAIN FALSE)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
endif()
|
||||
endif()
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
@@ -111,11 +111,6 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
|
||||
|
||||
string (TOLOWER "${PRODUCT_NAME}" lower_PRODUCT_NAME)
|
||||
|
||||
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}.*[0-9.]+")
|
||||
list (APPEND SEARCH_TEMPLATES "^${lower_PRODUCT_NAME}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
|
||||
list (APPEND SEARCH_TEMPLATES "${lower_PRODUCT_NAME}.*[0-9.]+.*${COMPILER_BITNESS}")
|
||||
|
@@ -14,6 +14,11 @@ if (NOT DEFINED 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tcl")
|
||||
endif()
|
||||
|
||||
# tk include directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
||||
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)
|
||||
@@ -24,6 +29,16 @@ if (NOT DEFINED 3RDPARTY_TCL_LIBRARY_DIR)
|
||||
set (3RDPARTY_TCL_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tcl library")
|
||||
endif()
|
||||
|
||||
# tk library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
|
||||
endif()
|
||||
|
||||
# tk library directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
|
||||
endif()
|
||||
|
||||
# tcl shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TCL_DLL OR NOT 3RDPARTY_TCL_DLL_DIR)
|
||||
@@ -36,6 +51,18 @@ if (WIN32 AND NOT DEFINED 3RDPARTY_TCL_DLL_DIR)
|
||||
set (3RDPARTY_TCL_DLL_DIR "" CACHE FILEPATH "The directory containing tcl shared library")
|
||||
endif()
|
||||
|
||||
# tk shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tk shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk 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)
|
||||
@@ -49,148 +76,226 @@ if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
||||
set (TCL_INCLUDE_PATH "${3RDPARTY_TCL_DIR}/include")
|
||||
endif()
|
||||
|
||||
# check tcl include dir, library dir and shared library dir
|
||||
COMPLIANCE_PRODUCT_CONSISTENCY(TCL)
|
||||
# check tcl/tk include dir, library dir and shared library dir
|
||||
macro (DIR_SUBDIR_FILE_FIT LIBNAME)
|
||||
if (3RDPARTY_TCL_DIR AND EXISTS "${3RDPARTY_TCL_DIR}")
|
||||
# tcl/tk include dir
|
||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl/tk library dir
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# tcl/tk shared library dir
|
||||
if (WIN32)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
string (REGEX MATCH "${3RDPARTY_TCL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check tcl/tk library
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
# check tcl/tk shared library
|
||||
if (WIN32)
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
if (3RDPARTY_${LIBNAME}_DLL AND EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
string (REGEX MATCH "${3RDPARTY_${LIBNAME}_DLL_DIR}" DOES_PATH_CONTAIN "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
|
||||
if (NOT DOES_PATH_CONTAIN)
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
else()
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
DIR_SUBDIR_FILE_FIT(TCL)
|
||||
DIR_SUBDIR_FILE_FIT(TK)
|
||||
|
||||
|
||||
# use default (CMake) TCL search
|
||||
find_package(TCL)
|
||||
|
||||
# tcl include dir
|
||||
if (NOT 3RDPARTY_TCL_INCLUDE_DIR)
|
||||
if (TCL_INCLUDE_PATH AND EXISTS "${TCL_INCLUDE_PATH}")
|
||||
set (3RDPARTY_TCL_INCLUDE_DIR "${TCL_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of TCL" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
foreach (LIBNAME TCL TK)
|
||||
string (TOLOWER "${LIBNAME}" LIBNAME_L)
|
||||
|
||||
# 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)
|
||||
# tcl/tk include dir
|
||||
if (NOT 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||
if (${LIBNAME}_INCLUDE_PATH AND EXISTS "${${LIBNAME}_INCLUDE_PATH}")
|
||||
set (3RDPARTY_${LIBNAME}_INCLUDE_DIR "${${LIBNAME}_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of ${LIBNAME}" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tcl/tk dir and library
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
if (${LIBNAME}_LIBRARY AND EXISTS "${${LIBNAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "${${LIBNAME}_LIBRARY}" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TCL_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".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")
|
||||
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 tcl86 tcl85
|
||||
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 tcl8.6 tcl86 tcl8.5 tcl85
|
||||
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 tcl8.6 tcl86 tcl8.5 tcl85
|
||||
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")
|
||||
|
||||
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()
|
||||
|
||||
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_${LIBNAME}_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
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)
|
||||
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
elseif (3RDPARTY_${LIBNAME}_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}86 ${LIBNAME_L}85
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
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()
|
||||
DIR_SUBDIR_FILE_FIT(${LIBNAME})
|
||||
|
||||
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 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}")
|
||||
# tcl/tk dir and library
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "3RDPARTY_${LIBNAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||
PATHS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# search in another place if previous search doesn't find anything
|
||||
find_library (3RDPARTY_${LIBNAME}_LIBRARY NAMES ${LIBNAME_L}8.6 ${LIBNAME_L}86 ${LIBNAME_L}8.5 ${LIBNAME_L}85
|
||||
PATHS "${3RDPARTY_TCL_DIR}/lib"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY OR NOT EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY "" CACHE FILEPATH "${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_LIBRARY_DIR AND 3RDPARTY_${LIBNAME}_LIBRARY)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_DIR "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
get_filename_component (${LIBNAME}_LIBRARY_NAME "${3RDPARTY_${LIBNAME}_LIBRARY}" NAME)
|
||||
string(REGEX REPLACE "^.*${LIBNAME_L}([0-9]\\.*[0-9]).*$" "\\1" ${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_LIBRARY_NAME}")
|
||||
|
||||
if (NOT "${${LIBNAME}_LIBRARY_VERSION}" STREQUAL "${${LIBNAME}_LIBRARY_NAME}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION "${${LIBNAME}_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: ${LIBNAME} version isn't found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "")
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY_VERSION)
|
||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_${LIBNAME}_MAJOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_${LIBNAME}_MINOR_VERSION "${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}")
|
||||
set (3RDPARTY_${LIBNAME}_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_${LIBNAME}_MAJOR_VERSION}.${3RDPARTY_${LIBNAME}_MINOR_VERSION}")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
elseif (3RDPARTY_TCL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TCL_DIR}/bin")
|
||||
else()
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_${LIBNAME}_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_${LIBNAME}_DLL "3RDPARTY_${LIBNAME}_DLL-NOTFOUND" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
find_library (3RDPARTY_${LIBNAME}_DLL NAMES ${LIBNAME_L}${3RDPARTY_${LIBNAME}_LIBRARY_VERSION}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL OR NOT EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
set (3RDPARTY_${LIBNAME}_DLL "" CACHE FILEPATH "${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_${LIBNAME}_DLL_DIR AND 3RDPARTY_${LIBNAME}_DLL)
|
||||
get_filename_component (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL}" PATH)
|
||||
set (3RDPARTY_${LIBNAME}_DLL_DIR "${3RDPARTY_${LIBNAME}_DLL_DIR}" CACHE FILEPATH "The directory containing ${LIBNAME} shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_${LIBNAME}_INCLUDE_DIR AND EXISTS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_${LIBNAME}_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TCL_DLL_DIR)
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_INCLUDE_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install tcl
|
||||
if (3RDPARTY_${LIBNAME}_LIBRARY AND EXISTS "${3RDPARTY_${LIBNAME}_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_${LIBNAME}_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (3RDPARTY_${LIBNAME}_DLL OR EXISTS "${3RDPARTY_${LIBNAME}_DLL}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_${LIBNAME}_DLL_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_${LIBNAME}_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# install tcltk
|
||||
if (INSTALL_TCL)
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
@@ -201,15 +306,16 @@ if (INSTALL_TCL)
|
||||
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
|
||||
# collect and install all dlls from tcl/tk dll dirs
|
||||
file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll")
|
||||
install (FILES ${TCL_DLLS}
|
||||
file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll")
|
||||
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
install (FILES ${TCL_DLLS}
|
||||
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
install (FILES ${TCL_DLLS}
|
||||
install (FILES ${TCL_DLLS} ${TK_DLLS}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
else()
|
||||
@@ -223,14 +329,26 @@ if (INSTALL_TCL)
|
||||
install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||
|
||||
get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||
endif()
|
||||
|
||||
if (TCL_TCLSH_VERSION)
|
||||
# tcl is required to install in lib folder (without)
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
else()
|
||||
message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.")
|
||||
message (STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
|
||||
message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
|
||||
endif()
|
||||
|
||||
@@ -244,15 +362,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TCL_DLL)
|
||||
|
||||
if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
||||
get_filename_component (3RDPARTY_TK_WISH_DIR "${TK_WISH}" PATH)
|
||||
get_filename_component (3RDPARTY_TK_WISH_DIR_PARENT "${3RDPARTY_TK_WISH_DIR}" PATH)
|
||||
if ("${3RDPARTY_TK_WISH_DIR_PARENT}" STREQUAL "${3RDPARTY_TCL_DIR}")
|
||||
set (3RDPARTY_TCLTK_DIR "${3RDPARTY_TCL_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced (3RDPARTY_TCL_LIBRARY 3RDPARTY_TK_LIBRARY 3RDPARTY_TCL_DLL 3RDPARTY_TK_DLL)
|
||||
|
||||
# unset all redundant variables
|
||||
#TCL
|
||||
|
@@ -1,260 +0,0 @@
|
||||
# tk
|
||||
|
||||
if (NOT DEFINED INSTALL_TK)
|
||||
set (INSTALL_TK OFF CACHE BOOL "${INSTALL_TK_DESCR}")
|
||||
endif()
|
||||
|
||||
# tk directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_DIR)
|
||||
set (3RDPARTY_TK_DIR "" CACHE PATH "The directory containing tk")
|
||||
endif ()
|
||||
|
||||
if (NOT 3RDPARTY_TK_DIR AND 3RDPARTY_TCLTK_DIR)
|
||||
set (3RDPARTY_TK_DIR "${3RDPARTY_TCLTK_DIR}" CACHE PATH "The directory containing tk" FORCE)
|
||||
endif()
|
||||
|
||||
# tk include directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
|
||||
endif()
|
||||
|
||||
# tk library file (with absolute path)
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY OR NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "tk library" FORCE)
|
||||
endif()
|
||||
|
||||
# tk library directory
|
||||
if (NOT DEFINED 3RDPARTY_TK_LIBRARY_DIR)
|
||||
set (3RDPARTY_TK_LIBRARY_DIR "" CACHE FILEPATH "The directory containing tk library")
|
||||
endif()
|
||||
|
||||
# tk shared library (with absolute path)
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_TK_DLL OR NOT 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "tk shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tk shared library directory
|
||||
if (WIN32 AND NOT DEFINED 3RDPARTY_TK_DLL_DIR)
|
||||
set (3RDPARTY_TK_DLL_DIR "" CACHE FILEPATH "The directory containing tk shared library")
|
||||
endif()
|
||||
|
||||
# search for tk in user defined directory
|
||||
if (NOT 3RDPARTY_TK_DIR AND 3RDPARTY_DIR)
|
||||
FIND_PRODUCT_DIR("${3RDPARTY_DIR}" tk TK_DIR_NAME)
|
||||
if (TK_DIR_NAME)
|
||||
set (3RDPARTY_TK_DIR "${3RDPARTY_DIR}/${TK_DIR_NAME}" CACHE PATH "The directory containing tk" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# define paths for default engine
|
||||
if (3RDPARTY_TK_DIR AND EXISTS "${3RDPARTY_TK_DIR}")
|
||||
set (TK_INCLUDE_PATH "${3RDPARTY_TK_DIR}/include")
|
||||
endif()
|
||||
|
||||
# check tk include dir, library dir and shared library dir
|
||||
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
||||
|
||||
# use default (CMake) TCL search
|
||||
find_package(TCL)
|
||||
|
||||
# tk include dir
|
||||
if (NOT 3RDPARTY_TK_INCLUDE_DIR)
|
||||
if (TK_INCLUDE_PATH AND EXISTS "${TK_INCLUDE_PATH}")
|
||||
set (3RDPARTY_TK_INCLUDE_DIR "${TK_INCLUDE_PATH}" CACHE FILEPATH "The directory containing headers of TK" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# tk dir and library
|
||||
if (NOT 3RDPARTY_TK_LIBRARY)
|
||||
if (TK_LIBRARY AND EXISTS "${TK_LIBRARY}")
|
||||
set (3RDPARTY_TK_LIBRARY "${TK_LIBRARY}" CACHE FILEPATH "TK library" FORCE)
|
||||
|
||||
if (NOT 3RDPARTY_TK_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TK library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TK_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TK_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DLL_DIR}")
|
||||
elseif (3RDPARTY_TK_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DIR}/bin")
|
||||
elseif (3RDPARTY_TK_LIBRARY_DIR)
|
||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR_PARENT "${3RDPARTY_TK_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TK_DLL "3RDPARTY_TK_DLL-NOTFOUND" CACHE FILEPATH "TK shared library" FORCE)
|
||||
find_library (3RDPARTY_TK_DLL NAMES tk86 tk85
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
COMPLIANCE_PRODUCT_CONSISTENCY(TK)
|
||||
|
||||
# tk dir and library
|
||||
if (NOT 3RDPARTY_TK_LIBRARY)
|
||||
set (3RDPARTY_TK_LIBRARY "3RDPARTY_TK_LIBRARY-NOTFOUND" CACHE FILEPATH "TK library" FORCE)
|
||||
find_library (3RDPARTY_TK_LIBRARY NAMES tk8.6 tk86 tk8.5 tk85
|
||||
PATHS "${3RDPARTY_TK_LIBRARY_DIR}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
# search in another place if previous search doesn't find anything
|
||||
find_library (3RDPARTY_TK_LIBRARY NAMES tk8.6 tk86 tk8.5 tk85
|
||||
PATHS "${3RDPARTY_TK_DIR}/lib"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
|
||||
if (NOT 3RDPARTY_TK_LIBRARY OR NOT EXISTS "${3RDPARTY_TK_LIBRARY}")
|
||||
set (3RDPARTY_TK_LIBRARY "" CACHE FILEPATH "TK library" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT 3RDPARTY_TK_LIBRARY_DIR AND 3RDPARTY_TK_LIBRARY)
|
||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY}" PATH)
|
||||
set (3RDPARTY_TK_LIBRARY_DIR "${3RDPARTY_TK_LIBRARY_DIR}" CACHE FILEPATH "The directory containing TK library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TK_LIBRARY_VERSION "")
|
||||
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
|
||||
get_filename_component (TK_LIBRARY_NAME "${3RDPARTY_TK_LIBRARY}" NAME)
|
||||
string(REGEX REPLACE "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY_NAME}")
|
||||
|
||||
if (NOT "${TK_LIBRARY_VERSION}" STREQUAL "${TK_LIBRARY_NAME}")
|
||||
set (3RDPARTY_TK_LIBRARY_VERSION "${TK_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: TK version isn't found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT "")
|
||||
if (3RDPARTY_TK_LIBRARY_VERSION)
|
||||
string (REGEX REPLACE "^.*([0-9])[^0-9]*[0-9].*$" "\\1" 3RDPARTY_TK_MAJOR_VERSION "${3RDPARTY_TK_LIBRARY_VERSION}")
|
||||
string (REGEX REPLACE "^.*[0-9][^0-9]*([0-9]).*$" "\\1" 3RDPARTY_TK_MINOR_VERSION "${3RDPARTY_TK_LIBRARY_VERSION}")
|
||||
set (3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT "${3RDPARTY_TK_MAJOR_VERSION}.${3RDPARTY_TK_MINOR_VERSION}")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_TK_DLL)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
set (DLL_FOLDER_FOR_SEARCH "")
|
||||
if (3RDPARTY_TK_DLL_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DLL_DIR}")
|
||||
elseif (3RDPARTY_TK_DIR)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_DIR}/bin")
|
||||
else()
|
||||
get_filename_component (3RDPARTY_TK_LIBRARY_DIR_PARENT "${3RDPARTY_TK_LIBRARY_DIR}" PATH)
|
||||
set (DLL_FOLDER_FOR_SEARCH "${3RDPARTY_TK_LIBRARY_DIR_PARENT}/bin")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_TK_DLL "3RDPARTY_TK_DLL-NOTFOUND" CACHE FILEPATH "TK shared library" FORCE)
|
||||
find_library (3RDPARTY_TK_DLL NAMES tk${3RDPARTY_TK_LIBRARY_VERSION}
|
||||
PATHS "${DLL_FOLDER_FOR_SEARCH}"
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if (NOT 3RDPARTY_TK_DLL OR NOT EXISTS "${3RDPARTY_TK_DLL}")
|
||||
set (3RDPARTY_TK_DLL "" CACHE FILEPATH "TK shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
if (NOT 3RDPARTY_TK_DLL_DIR AND 3RDPARTY_TK_DLL)
|
||||
get_filename_component (3RDPARTY_TK_DLL_DIR "${3RDPARTY_TK_DLL}" PATH)
|
||||
set (3RDPARTY_TK_DLL_DIR "${3RDPARTY_TK_DLL_DIR}" CACHE FILEPATH "The directory containing TK shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include found paths to common variables
|
||||
if (3RDPARTY_TK_INCLUDE_DIR AND EXISTS "${3RDPARTY_TK_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_TK_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_INCLUDE_DIR)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_TK_LIBRARY AND EXISTS "${3RDPARTY_TK_LIBRARY}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TK_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (3RDPARTY_TK_DLL OR EXISTS "${3RDPARTY_TK_DLL}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_TK_DLL_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TK_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install tk
|
||||
if (INSTALL_TK)
|
||||
# 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)
|
||||
# tk 8.6 requires zlib. install all dlls from tk bin folder that may contain zlib also
|
||||
|
||||
# collect and install all dlls from tk dll dirs
|
||||
file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll")
|
||||
install (FILES ${TK_DLLS}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
install (FILES ${TK_DLLS}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
install (FILES ${TK_DLLS}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
else()
|
||||
get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH)
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi")
|
||||
install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH}
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd")
|
||||
endif()
|
||||
|
||||
if (TCL_TCLSH_VERSION)
|
||||
# tk is required to install in lib folder (without)
|
||||
install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib")
|
||||
else()
|
||||
message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.")
|
||||
message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.")
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_TK_DIR "")
|
||||
else()
|
||||
# the library directory for using by the executable
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_TK_DIR ${3RDPARTY_TK_DLL_DIR})
|
||||
else()
|
||||
set (USED_3RDPARTY_TK_DIR ${3RDPARTY_TK_LIBRARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (3RDPARTY_TK_LIBRARY 3RDPARTY_TK_DLL)
|
||||
|
||||
# unset all redundant variables
|
||||
#TCL
|
||||
OCCT_CHECK_AND_UNSET (TCL_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TCL_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TCL_TCLSH)
|
||||
#TK
|
||||
OCCT_CHECK_AND_UNSET (TK_LIBRARY)
|
||||
OCCT_CHECK_AND_UNSET (TK_INCLUDE_PATH)
|
||||
OCCT_CHECK_AND_UNSET (TK_WISH)
|
@@ -43,7 +43,6 @@ INSTALL_MESSAGE (INSTALL_FREETYPE "FreeType binaries")
|
||||
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
|
||||
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
|
||||
INSTALL_MESSAGE (INSTALL_TCL "TCL binaries")
|
||||
INSTALL_MESSAGE (INSTALL_TK "TK binaries")
|
||||
INSTALL_MESSAGE (INSTALL_VTK "VTK binaries ")
|
||||
|
||||
# build variables
|
||||
|
@@ -1109,19 +1109,12 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
||||
set aFrmsMap(CSF_TclLibs) "Tcl"
|
||||
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
||||
} else {
|
||||
if { "$theOS" == "qnx" } {
|
||||
# CSF_ThreadLibs - pthread API is part og libc on QNX
|
||||
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
|
||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
||||
set aLibsMap(CSF_TclTkLibs) "tk8.6"
|
||||
} else {
|
||||
set aLibsMap(CSF_ThreadLibs) "pthread rt"
|
||||
set aLibsMap(CSF_OpenGlLibs) "GL"
|
||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
||||
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
|
||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||
set aLibsMap(CSF_MotifLibs) "X11"
|
||||
}
|
||||
set aLibsMap(CSF_ThreadLibs) "pthread rt"
|
||||
set aLibsMap(CSF_OpenGlLibs) "GL"
|
||||
set aLibsMap(CSF_TclLibs) "tcl8.6"
|
||||
set aLibsMap(CSF_TclTkLibs) "X11 tk8.6"
|
||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||
set aLibsMap(CSF_MotifLibs) "X11"
|
||||
}
|
||||
|
||||
# optional 3rd-parties
|
||||
@@ -2061,13 +2054,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
# Release target configuration
|
||||
puts $aFile "\t\t\t<Target title=\"Release\">"
|
||||
if { "$theIsExe" == "true" } {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bin/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||
} else {
|
||||
if { "$aWokStation" == "wnt" } {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
} else {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/lib/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||
}
|
||||
@@ -2077,8 +2070,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
} else {
|
||||
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
|
||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
|
||||
|
||||
# compiler options per TARGET (including defines)
|
||||
puts $aFile "\t\t\t\t<Compiler>"
|
||||
@@ -2092,20 +2085,15 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
} else {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-O2\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
||||
if { "$aWokStation" != "qnx" } {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||
}
|
||||
foreach aMacro $theDefines {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-DNDEBUG\" />"
|
||||
if { "$aWokStation" == "qnx" } {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-DNo_Exception\" />"
|
||||
|
||||
puts $aFile "\t\t\t\t</Compiler>"
|
||||
@@ -2123,13 +2111,13 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
# Debug target configuration
|
||||
puts $aFile "\t\t\t<Target title=\"Debug\">"
|
||||
if { "$theIsExe" == "true" } {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/bind/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
puts $aFile "\t\t\t\t<Option type=\"1\" />"
|
||||
} else {
|
||||
if { "$aWokStation" == "wnt" } {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
} else {
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}.so\" prefix_auto=\"0\" extension_auto=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option output=\"../../../${aWokStation}/cbp/libd/lib${theProjName}\" prefix_auto=\"1\" extension_auto=\"1\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t<Option type=\"3\" />"
|
||||
}
|
||||
@@ -2139,8 +2127,8 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
} else {
|
||||
puts $aFile "\t\t\t\t<Option compiler=\"gcc\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t<Option createDefFile=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"0\" />"
|
||||
puts $aFile "\t\t\t\t<Option createDefFile=\"1\" />"
|
||||
puts $aFile "\t\t\t\t<Option createStaticLib=\"1\" />"
|
||||
|
||||
# compiler options per TARGET (including defines)
|
||||
puts $aFile "\t\t\t\t<Compiler>"
|
||||
@@ -2156,20 +2144,15 @@ proc osutils:cbp { theOutDir theProjName theSrcFiles theLibsList theFrameworks t
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-O0\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-std=c++0x\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-g\" />"
|
||||
if { "$aWokStation" != "qnx" } {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mmmx\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-msse2\" />"
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-mfpmath=sse\" />"
|
||||
}
|
||||
foreach aMacro $theDefines {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-D${aMacro}\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_DEBUG\" />"
|
||||
if { "$aWokStation" == "qnx" } {
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-D_QNX_SOURCE\" />"
|
||||
}
|
||||
puts $aFile "\t\t\t\t\t<Add option=\"-DDEB\" />"
|
||||
puts $aFile "\t\t\t\t</Compiler>"
|
||||
|
||||
|
@@ -3,7 +3,6 @@ echo off
|
||||
if "%VCVER%" == "@COMPILER@" (
|
||||
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
||||
set "TCL_DIR=@3RDPARTY_TCL_DLL_DIR@"
|
||||
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
|
||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
|
||||
set "FREEIMAGEPLUS_DIR=@3RDPARTY_FREEIMAGEPLUS_DLL_DIR@"
|
||||
|
@@ -3,7 +3,6 @@
|
||||
if [ "$COMPILER" == "@COMPILER@" ]; then
|
||||
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
||||
export TCL_DIR="@3RDPARTY_TCL_LIBRARY_DIR@"
|
||||
export TK_DIR="@3RDPARTY_TK_LIBRARY_DIR@"
|
||||
export FREETYPE_DIR="@3RDPARTY_FREETYPE_LIBRARY_DIR@"
|
||||
export FREEIMAGE_DIR="@3RDPARTY_FREEIMAGE_LIBRARY_DIR@"
|
||||
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIR@"
|
||||
|
@@ -3,7 +3,6 @@ echo off
|
||||
if "%VCVER%" == "@COMPILER@" (
|
||||
if "%ARCH%" == "@COMPILER_BITNESS@" (
|
||||
set "TCL_DIR=@USED_3RDPARTY_TCL_DIR@"
|
||||
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
|
||||
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
|
||||
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
|
||||
set "FREEIMAGEPLUS_DIR=@USED_3RDPARTY_FREEIMAGEPLUS_DIR@"
|
||||
|
@@ -3,7 +3,6 @@
|
||||
if [ "$COMPILER" == "@COMPILER@" ]; then
|
||||
if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then
|
||||
export TCL_DIR="@USED_3RDPARTY_TCL_DIR@"
|
||||
export TK_DIR="@USED_3RDPARTY_TK_DIR@"
|
||||
export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@"
|
||||
export FREEIMAGE_DIR="@USED_3RDPARTY_FREEIMAGE_DIR@"
|
||||
export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIR@"
|
||||
|
@@ -28,7 +28,6 @@ set "PRODROOT="
|
||||
set "ORIGIN_PATH=%PATH%"
|
||||
|
||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
||||
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
||||
@@ -39,10 +38,6 @@ if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
||||
set "PATH=@CMAKE_BINARY_DIR@/%BIN_TAIL%;%PATH%"
|
||||
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
|
||||
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
)
|
||||
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
|
@@ -45,10 +45,6 @@ if [ "$TCL_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$FREETYPE_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
@@ -69,15 +65,6 @@ if [ "$VTK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TK_DIR" != "$TCL_DIR" ]; then
|
||||
if [ "$TK_DIR" != "" ]; then
|
||||
export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
fi
|
||||
if [ "$TCL_DIR" != "" ]; then
|
||||
export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
fi
|
||||
fi
|
||||
|
||||
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
||||
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
||||
|
||||
|
@@ -26,7 +26,6 @@ set "PRODROOT="
|
||||
set "ORIGIN_PATH=%PATH%"
|
||||
|
||||
if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
|
||||
if not ["%FREEIMAGEPLUS_DIR%"] == [""] set "PATH=%FREEIMAGEPLUS_DIR%;%PATH%"
|
||||
@@ -37,10 +36,6 @@ if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
set "BIN_TAIL=win%ARCH%/%VCVER%/bin%CASDEB%"
|
||||
set "PATH=%CASROOT%/%BIN_TAIL%;%PATH%"
|
||||
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
|
||||
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
)
|
||||
|
||||
rem ----- Set envoronment variables used by OCCT -----
|
||||
set CSF_LANGUAGE=us
|
||||
|
@@ -43,10 +43,6 @@ if [ "$TCL_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TCL_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${TK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$FREETYPE_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${FREETYPE_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
@@ -67,15 +63,6 @@ if [ "$VTK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TK_DIR" != "$TCL_DIR" ]; then
|
||||
if [ "$TK_DIR" != "" ]; then
|
||||
export TK_LIBRARY="${TK_DIR}/../lib/tk@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
fi
|
||||
if [ "$TCL_DIR" != "" ]; then
|
||||
export TCL_LIBRARY="${TCL_DIR}/../lib/tcl@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
fi
|
||||
fi
|
||||
|
||||
BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
|
||||
LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
|
||||
|
||||
|
@@ -11,13 +11,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// AdvApp2Var_ApproxF2var.cxx
|
||||
#include <math.h>
|
||||
#include <AdvApp2Var_SysBase.hxx>
|
||||
#include <AdvApp2Var_MathBase.hxx>
|
||||
#include <AdvApp2Var_Data_f2c.hxx>
|
||||
#include <AdvApp2Var_Data.hxx>
|
||||
#include <AdvApp2Var_ApproxF2var.hxx>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
static
|
||||
int mmjacpt_(const integer *ndimen,
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
// AdvApp2Var_SysBase.cxx
|
||||
#include <assert.h>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <AdvApp2Var_Data_f2c.hxx>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
// =======================================================================
|
||||
Aspect_DisplayConnection::Aspect_DisplayConnection()
|
||||
{
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
OSD_Environment anEnv ("DISPLAY");
|
||||
myDisplayName = anEnv.Value();
|
||||
Init();
|
||||
@@ -36,7 +36,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
|
||||
// =======================================================================
|
||||
Aspect_DisplayConnection::~Aspect_DisplayConnection()
|
||||
{
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
if (myDisplay != NULL)
|
||||
{
|
||||
XCloseDisplay (myDisplay);
|
||||
@@ -44,7 +44,7 @@ Aspect_DisplayConnection::~Aspect_DisplayConnection()
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
// =======================================================================
|
||||
// function : Aspect_DisplayConnection
|
||||
// purpose :
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
#include <InterfaceGraphic.hxx>
|
||||
#endif
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
//! Destructor. Close opened connection.
|
||||
Standard_EXPORT ~Aspect_DisplayConnection();
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
//! 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.
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#ifndef _Aspect_FBConfig_HeaderFile
|
||||
#define _Aspect_FBConfig_HeaderFile
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
typedef struct __GLXFBConfigRec* GLXFBConfig;
|
||||
typedef GLXFBConfig Aspect_FBConfig; // GLXFBConfig* under UNIX
|
||||
#else
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#ifndef __Aspect_WNTXWD_HXX
|
||||
# define __Aspect_WNTXWD_HXX
|
||||
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && !defined(__ANDROID__)
|
||||
# include <X11/XWDFile.h>
|
||||
# else
|
||||
|
||||
|
@@ -87,7 +87,7 @@ class BOPCol_ContextFunctor
|
||||
static Standard_Integer HashCode(const Standard_ThreadId theKey,
|
||||
const Standard_Integer Upper)
|
||||
{
|
||||
return ::HashCode((Standard_Size)theKey, Upper);
|
||||
return ::HashCode(theKey, Upper);
|
||||
}
|
||||
|
||||
static Standard_Boolean IsEqual(const Standard_ThreadId theKey1,
|
||||
|
@@ -2256,25 +2256,6 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
|
||||
inters.Perform(HC, HGs);
|
||||
if (inters.IsDone()&& inters.NbPoints()!=0) {
|
||||
Fd->ChangeSurf(DStr.AddSurface(TopOpeBRepDS_Surface(S1, DStr.ChangeSurface(Isurf).Tolerance())));
|
||||
//update history
|
||||
if (myEVIMap.IsBound(EdgeSpine))
|
||||
{
|
||||
TColStd_ListIteratorOfListOfInteger itl(myEVIMap.ChangeFind(EdgeSpine));
|
||||
for (; itl.More(); itl.Next())
|
||||
if (itl.Value() == Isurf)
|
||||
{
|
||||
myEVIMap.ChangeFind(EdgeSpine).Remove(itl);
|
||||
break;
|
||||
}
|
||||
myEVIMap.ChangeFind(EdgeSpine).Append(Fd->Surf());
|
||||
}
|
||||
else
|
||||
{
|
||||
TColStd_ListOfInteger IndexList;
|
||||
IndexList.Append(Fd->Surf());
|
||||
myEVIMap.Bind(EdgeSpine, IndexList);
|
||||
}
|
||||
////////////////
|
||||
Isurf=Fd->Surf();
|
||||
}
|
||||
}
|
||||
|
@@ -362,10 +362,6 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
|
||||
#elif defined(__ANDROID__) /* must be before Linux */
|
||||
#include <android/api-level.h>
|
||||
di << "OS: Android (__ANDROID_API__ = " << __ANDROID_API__ << ")\n";
|
||||
#elif defined(__QNXNTO__)
|
||||
di << "OS: QNX Neutrino\n";
|
||||
#elif defined(__QNX__)
|
||||
di << "OS: QNX\n";
|
||||
#elif defined(__linux__)
|
||||
di << "OS: Linux\n";
|
||||
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
|
||||
|
@@ -1342,12 +1342,7 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax2& Pos,
|
||||
Standard_Real sht =
|
||||
gp_Vec(Pos.Location (), P).Dot
|
||||
(gp_Vec (Pos.YDirection())) / MinorRadius;
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
return std::asinh(sht);
|
||||
#else
|
||||
return asinh(sht);
|
||||
#endif
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1426,11 +1421,7 @@ Standard_Real ElCLib::HyperbolaParameter (const gp_Ax22d& Pos,
|
||||
{
|
||||
gp_Vec2d V (Pos.YDirection().XY());
|
||||
Standard_Real sht = gp_Vec2d(Pos.Location(),P).Dot(V) /MinorRadius;
|
||||
#if __cplusplus >= 201103L
|
||||
return std::asinh(sht);
|
||||
#else
|
||||
return asinh(sht);
|
||||
#endif
|
||||
return asinh(sht);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -77,6 +77,13 @@ Graphic3d_InitialisationError.hxx
|
||||
Graphic3d_LevelOfTextureAnisotropy.hxx
|
||||
Graphic3d_ListIteratorOfListOfShortReal.hxx
|
||||
Graphic3d_ListOfShortReal.hxx
|
||||
Graphic3d_LOD.hxx
|
||||
Graphic3d_LOD.cxx
|
||||
Graphic3d_LODSelector.hxx
|
||||
Graphic3d_LODDistanceSelector.hxx
|
||||
Graphic3d_LODDistanceSelector.cxx
|
||||
Graphic3d_LODManager.hxx
|
||||
Graphic3d_LODManager.cxx
|
||||
Graphic3d_MapIteratorOfMapOfStructure.hxx
|
||||
Graphic3d_MapOfObject.hxx
|
||||
Graphic3d_MapOfStructure.hxx
|
||||
|
@@ -28,6 +28,8 @@
|
||||
|
||||
class Graphic3d_GraphicDriver;
|
||||
class Graphic3d_StructureManager;
|
||||
class Graphic3d_LOD;
|
||||
class Graphic3d_LODManager;
|
||||
|
||||
//! Low-level graphic structure interface
|
||||
class Graphic3d_CStructure : public Standard_Transient
|
||||
@@ -112,9 +114,16 @@ public:
|
||||
//! Create new group within this structure
|
||||
virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct) = 0;
|
||||
|
||||
//! Create new LOD within this structure
|
||||
virtual Handle(Graphic3d_LOD) NewLOD (const Handle(Graphic3d_Structure)& theStruct) = 0;
|
||||
|
||||
//! Remove group from this structure
|
||||
virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup) = 0;
|
||||
|
||||
virtual Standard_Integer NbDetailLevels() const = 0;
|
||||
|
||||
virtual void SetDetailLevelRange (const Standard_Integer theIdOfLOD, const Standard_Real theFrom, const Standard_Real theTo) = 0;
|
||||
|
||||
public:
|
||||
|
||||
int Id;
|
||||
@@ -158,6 +167,7 @@ protected:
|
||||
Graphic3d_SequenceOfGroup myGroups;
|
||||
Graphic3d_BndBox4f myBndBox;
|
||||
Graphic3d_SequenceOfHClipPlane myClipPlanes;
|
||||
Handle(Graphic3d_LODManager) myLODManager;
|
||||
|
||||
public:
|
||||
|
||||
|
37
src/Graphic3d/Graphic3d_LOD.cxx
Normal file
37
src/Graphic3d/Graphic3d_LOD.cxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// function : Destructor
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Graphic3d_LOD::~Graphic3d_LOD()
|
||||
{
|
||||
myGroups.Clear();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : SetRange
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Graphic3d_LOD::SetRange (const Standard_Real theFrom, const Standard_Real theTo)
|
||||
{
|
||||
Standard_ASSERT_RAISE (theFrom < theTo,
|
||||
"The upper boundary of the interval must be greater than lower one!");
|
||||
|
||||
myRange = Graphic3d_RangeOfLOD (theFrom, theTo);
|
||||
}
|
96
src/Graphic3d/Graphic3d_LOD.hxx
Normal file
96
src/Graphic3d/Graphic3d_LOD.hxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_LOD_Header
|
||||
#define _Graphic3d_LOD_Header
|
||||
|
||||
#include <Graphic3d_Camera.hxx>
|
||||
#include <Graphic3d_SequenceOfGroup.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
struct Graphic3d_RangeOfLOD
|
||||
{
|
||||
public:
|
||||
Graphic3d_RangeOfLOD (const Standard_Real theFrom, const Standard_Real theTo)
|
||||
: myTo (theTo),
|
||||
myFrom (theFrom)
|
||||
{
|
||||
Standard_ASSERT_RAISE (theFrom < theTo,
|
||||
"The upper boundary of the interval must be greater than lower one!");
|
||||
}
|
||||
|
||||
Standard_Boolean IsIn (const Standard_Real theVal) const
|
||||
{
|
||||
return (myFrom < theVal) && (theVal < myTo);
|
||||
}
|
||||
|
||||
Standard_Boolean IsLess (const Standard_Real theVal) const
|
||||
{
|
||||
return theVal < myFrom;
|
||||
}
|
||||
|
||||
Standard_Boolean IsGreater (const Standard_Real theVal) const
|
||||
{
|
||||
return myTo < theVal;
|
||||
}
|
||||
|
||||
bool operator < (const Graphic3d_RangeOfLOD& theOther) const
|
||||
{
|
||||
return myFrom < theOther.myFrom;
|
||||
}
|
||||
|
||||
private:
|
||||
Standard_Real myFrom;
|
||||
Standard_Real myTo;
|
||||
};
|
||||
|
||||
class Graphic3d_LOD : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT virtual ~Graphic3d_LOD();
|
||||
|
||||
Standard_EXPORT void SetRange (const Standard_Real theFrom, const Standard_Real theTo);
|
||||
|
||||
Standard_EXPORT const Graphic3d_RangeOfLOD& GetRange() const
|
||||
{
|
||||
return myRange;
|
||||
}
|
||||
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& /*theParentStruct*/)
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
|
||||
const Graphic3d_SequenceOfGroup& GetDrawGroups() const
|
||||
{
|
||||
return myGroups;
|
||||
}
|
||||
|
||||
DEFINE_STANDARD_RTTI (Graphic3d_LOD, Standard_Transient)
|
||||
|
||||
protected:
|
||||
Standard_EXPORT Graphic3d_LOD() : myRange (-DBL_MAX, DBL_MAX) {};
|
||||
|
||||
protected:
|
||||
Graphic3d_SequenceOfGroup myGroups;
|
||||
Graphic3d_RangeOfLOD myRange;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_LOD, Standard_Transient)
|
||||
|
||||
#endif // _Graphic3d_LOD_Header
|
32
src/Graphic3d/Graphic3d_LODDistanceSelector.cxx
Normal file
32
src/Graphic3d/Graphic3d_LODDistanceSelector.cxx
Normal file
@@ -0,0 +1,32 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Graphic3d_Camera.hxx>
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_LODDistanceSelector.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// function : ComputeMetric
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Real Graphic3d_LODDistanceSelector::ComputeMetric (const Handle(Graphic3d_CStructure)& theParentStructure,
|
||||
const Handle(Graphic3d_Camera)& theCamera)
|
||||
{
|
||||
const Graphic3d_BndBox4f& aBndBox = theParentStructure->BoundingBox();
|
||||
const Graphic3d_Vec4 aCenter = aBndBox.Center();
|
||||
const gp_Pnt aGpCenter = gp_Pnt (aCenter.x(), aCenter.y(), aCenter.z());
|
||||
return (theCamera->Eye().Distance (aGpCenter)) / theCamera->Scale();
|
||||
}
|
38
src/Graphic3d/Graphic3d_LODDistanceSelector.hxx
Normal file
38
src/Graphic3d/Graphic3d_LODDistanceSelector.hxx
Normal file
@@ -0,0 +1,38 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_LODDistanceSelector_Header
|
||||
#define _Graphic3d_LODDistanceSelector_Header
|
||||
|
||||
#include <Graphic3d_LODSelector.hxx>
|
||||
|
||||
class Graphic3d_CStructure;
|
||||
class Graphic3d_Camera;
|
||||
|
||||
class Graphic3d_LODDistanceSelector : public Graphic3d_LODSelector
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT Graphic3d_LODDistanceSelector() {};
|
||||
Standard_EXPORT virtual ~Graphic3d_LODDistanceSelector() {};
|
||||
|
||||
Standard_EXPORT virtual Standard_Real ComputeMetric (const Handle(Graphic3d_CStructure)& theParentStructure,
|
||||
const Handle(Graphic3d_Camera)& theCamera) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI (Graphic3d_LODDistanceSelector, Graphic3d_LODSelector)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_LODDistanceSelector, Graphic3d_LODSelector)
|
||||
|
||||
#endif // _Graphic3d_LODDistanceSelector_Header
|
83
src/Graphic3d/Graphic3d_LODManager.cxx
Normal file
83
src/Graphic3d/Graphic3d_LODManager.cxx
Normal file
@@ -0,0 +1,83 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <Graphic3d_LODManager.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// function : Creation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Graphic3d_LODManager::Graphic3d_LODManager (const Handle(Graphic3d_Structure)& theParentStructure)
|
||||
: myCurrentLODIdx (-1),
|
||||
mySelector (new Graphic3d_LODDistanceSelector())
|
||||
{
|
||||
myStructure = theParentStructure.operator->();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetCurrentLODIdx
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer Graphic3d_LODManager::GetCurrentLODIdx (const Handle(Graphic3d_Camera)& theCamera)
|
||||
{
|
||||
if (theCamera->WorldViewProjState() == myPrevCameraState && myCurrentLODIdx != -1)
|
||||
return myCurrentLODIdx;
|
||||
|
||||
myPrevCameraState = theCamera->WorldViewProjState();
|
||||
const Standard_Real aMetric = mySelector->ComputeMetric (myStructure->CStructure(), theCamera);
|
||||
if (myLODs.Value (0)->GetRange().IsLess (aMetric))
|
||||
{
|
||||
myCurrentLODIdx = -1;
|
||||
}
|
||||
else if (myLODs.Value (myLODs.Size() - 1)->GetRange().IsGreater (aMetric))
|
||||
{
|
||||
myCurrentLODIdx = myLODs.Size() - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Standard_Integer aLodIdx = 0; aLodIdx < myLODs.Size(); ++aLodIdx)
|
||||
{
|
||||
if (myLODs.Value (aLodIdx)->GetRange().IsIn (aMetric))
|
||||
{
|
||||
myCurrentLODIdx = aLodIdx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return myCurrentLODIdx;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : SetRange
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void Graphic3d_LODManager::SetRange (const Standard_Integer theLodIdx,
|
||||
const Standard_Real theFrom,
|
||||
const Standard_Real theTo)
|
||||
{
|
||||
myLODs.ChangeValue (theLodIdx)->SetRange (theFrom, theTo);
|
||||
sortLODs();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetCurrentGroups
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
const Graphic3d_SequenceOfGroup& Graphic3d_LODManager::GetCurrentGroups() const
|
||||
{
|
||||
return myLODs.Value (myCurrentLODIdx)->GetDrawGroups();
|
||||
}
|
75
src/Graphic3d/Graphic3d_LODManager.hxx
Normal file
75
src/Graphic3d/Graphic3d_LODManager.hxx
Normal file
@@ -0,0 +1,75 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_LODManager_Header
|
||||
#define _Graphic3d_LODManager_Header
|
||||
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_Camera.hxx>
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <Graphic3d_LODSelector.hxx>
|
||||
#include <Graphic3d_LODDistanceSelector.hxx>
|
||||
#include <Graphic3d_SequenceOfGroup.hxx>
|
||||
#include <Graphic3d_StructurePtr.hxx>
|
||||
#include <NCollection_Vector.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class Graphic3d_LODManager : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT virtual ~Graphic3d_LODManager() {};
|
||||
|
||||
Standard_EXPORT void SetSelector (const Handle(Graphic3d_LODSelector)& theSelector)
|
||||
{
|
||||
mySelector = theSelector;
|
||||
}
|
||||
|
||||
Standard_EXPORT inline Standard_Integer NbOfDetailLevels() const
|
||||
{
|
||||
return myLODs.Size();
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetRange (const Standard_Integer theLodIdx,
|
||||
const Standard_Real theFrom,
|
||||
const Standard_Real theTo);
|
||||
|
||||
Standard_EXPORT Standard_Integer GetCurrentLODIdx (const Handle(Graphic3d_Camera)& theCamera);
|
||||
|
||||
Standard_EXPORT const Graphic3d_SequenceOfGroup& GetCurrentGroups() const;
|
||||
|
||||
Standard_EXPORT virtual Handle(Graphic3d_LOD) AddNewLOD() = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI (Graphic3d_LODManager, Standard_Transient)
|
||||
|
||||
protected:
|
||||
Standard_EXPORT Graphic3d_LODManager (const Handle(Graphic3d_Structure)& theParentStructure);
|
||||
|
||||
Standard_EXPORT virtual void sortLODs() {};
|
||||
|
||||
protected:
|
||||
NCollection_Vector<Handle(Graphic3d_LOD)> myLODs;
|
||||
|
||||
private:
|
||||
Standard_Integer myCurrentLODIdx;
|
||||
Handle(Graphic3d_LODSelector) mySelector;
|
||||
Graphic3d_StructurePtr myStructure;
|
||||
Graphic3d_WorldViewProjState myPrevCameraState;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_LODManager, Standard_Transient)
|
||||
|
||||
#endif //_Graphic3d_LODManager_Header
|
37
src/Graphic3d/Graphic3d_LODSelector.hxx
Normal file
37
src/Graphic3d/Graphic3d_LODSelector.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Graphic3d_LODSelector_Header
|
||||
#define _Graphic3d_LODSelector_Header
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
class Graphic3d_CStructure;
|
||||
class Graphic3d_Camera;
|
||||
|
||||
class Graphic3d_LODSelector : public Standard_Transient
|
||||
{
|
||||
public:
|
||||
virtual Standard_Real ComputeMetric (const Handle(Graphic3d_CStructure)& theParentStructure,
|
||||
const Handle(Graphic3d_Camera)& theCamera) = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTI (Graphic3d_LODSelector, Standard_Transient)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (Graphic3d_LODSelector, Standard_Transient)
|
||||
|
||||
#endif // _Graphic3d_LODSelector_Header
|
@@ -79,12 +79,6 @@ public:
|
||||
AnaglyphRight.SetRow (3, aZero);
|
||||
}
|
||||
|
||||
//! Returns resolution ratio.
|
||||
Standard_ShortReal ResolutionRatio() const
|
||||
{
|
||||
return Resolution / static_cast<Standard_ShortReal> (THE_DEFAULT_RESOLUTION);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Graphic3d_RenderingMode Method; //!< specifies rendering mode, Graphic3d_RM_RASTERIZATION by default
|
||||
|
@@ -1743,6 +1743,33 @@ Handle(Graphic3d_Group) Graphic3d_Structure::NewGroup()
|
||||
return myCStructure->NewGroup (this);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : NewLOD
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Handle(Graphic3d_LOD) Graphic3d_Structure::NewLOD()
|
||||
{
|
||||
return myCStructure->NewLOD (this);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : NbDetailLevels
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Standard_Integer Graphic3d_Structure::NbDetailLevels() const
|
||||
{
|
||||
return myCStructure->NbDetailLevels();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : SetDetailLevelRange
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void Graphic3d_Structure::SetDetailLevelRange (const Standard_Integer theIdOfLOD, const Standard_Real theFrom, const Standard_Real theTo)
|
||||
{
|
||||
myCStructure->SetDetailLevelRange (theIdOfLOD, theFrom, theTo);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : Remove
|
||||
//purpose :
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <Graphic3d_SequenceOfGroup.hxx>
|
||||
#include <Graphic3d_TypeOfConnection.hxx>
|
||||
@@ -54,6 +55,7 @@ class Graphic3d_AspectFillArea3d;
|
||||
class Graphic3d_AspectText3d;
|
||||
class Graphic3d_AspectMarker3d;
|
||||
class Graphic3d_DataStructureManager;
|
||||
class Graphic3d_LOD;
|
||||
class Bnd_Box;
|
||||
class gp_Pnt;
|
||||
class Graphic3d_Vector;
|
||||
@@ -259,6 +261,9 @@ public:
|
||||
|
||||
//! Append new group to this structure.
|
||||
Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
|
||||
|
||||
//! Append new LOD to this structure.
|
||||
Standard_EXPORT Handle(Graphic3d_LOD) NewLOD();
|
||||
|
||||
//! Returns the highlight color for the Highlight method
|
||||
//! with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
|
||||
@@ -492,6 +497,10 @@ public:
|
||||
//! Returns the low-level structure
|
||||
const Handle(Graphic3d_CStructure)& CStructure() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer NbDetailLevels() const;
|
||||
|
||||
Standard_EXPORT void SetDetailLevelRange (const Standard_Integer theIdOfLOD, const Standard_Real theFrom, const Standard_Real theTo);
|
||||
|
||||
friend class Graphic3d_Group;
|
||||
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#undef DrawText
|
||||
#endif
|
||||
|
||||
#elif !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#elif !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@@ -41,6 +41,10 @@ MeshVS_ElementalColorPrsBuilder.cxx
|
||||
MeshVS_ElementalColorPrsBuilder.hxx
|
||||
MeshVS_EntityType.hxx
|
||||
MeshVS_HArray1OfSequenceOfInteger.hxx
|
||||
MeshVS_LODBuilder.hxx
|
||||
MeshVS_LODBuilder.cxx
|
||||
MeshVS_LODDataSource.hxx
|
||||
MeshVS_LODDataSource.cxx
|
||||
MeshVS_MapIteratorOfMapOfTwoNodes.hxx
|
||||
MeshVS_MapOfTwoNodes.hxx
|
||||
MeshVS_Mesh.cxx
|
||||
|
@@ -56,7 +56,7 @@ class MeshVS_DataSource : public MMgt_TShared
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! Returns geometry information about node or element
|
||||
//! ID is the numerical identificator of node or element
|
||||
//! IsElement indicates this ID describe node ( if Standard_False ) or element ( if Standard_True )
|
||||
@@ -67,33 +67,44 @@ public:
|
||||
//! NbNodes is number of nodes. It is recommended this parameter to be set to 1 for node.
|
||||
//! Type is type of node or element (from enumeration). It is recommended this parameter to be set to
|
||||
//! MeshVS_ET_Node for node.
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeom (const Standard_Integer ID, const Standard_Boolean IsElement, TColStd_Array1OfReal& Coords, Standard_Integer& NbNodes, MeshVS_EntityType& Type) const = 0;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeom (const Standard_Integer ID,
|
||||
const Standard_Boolean IsElement,
|
||||
TColStd_Array1OfReal& Coords,
|
||||
Standard_Integer& NbNodes,
|
||||
MeshVS_EntityType& Type) const = 0;
|
||||
|
||||
//! This method is similar to GetGeom, but returns only element or node type.
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeomType (const Standard_Integer ID, const Standard_Boolean IsElement, MeshVS_EntityType& Type) const = 0;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeomType (const Standard_Integer ID,
|
||||
const Standard_Boolean IsElement,
|
||||
MeshVS_EntityType& Type) const = 0;
|
||||
|
||||
//! This method returns topology information about 3D-element
|
||||
//! Returns false if element with ID isn't 3D or because other troubles
|
||||
Standard_EXPORT virtual Standard_Boolean Get3DGeom (const Standard_Integer ID, Standard_Integer& NbNodes, Handle(MeshVS_HArray1OfSequenceOfInteger)& Data) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Get3DGeom (const Standard_Integer ID,
|
||||
Standard_Integer& NbNodes,
|
||||
Handle(MeshVS_HArray1OfSequenceOfInteger)& Data) const;
|
||||
|
||||
//! This method returns pointer which represents element or node data structure.
|
||||
//! This address will be saved in MeshVS_MeshEntityOwner, so that you can access to data structure fast
|
||||
//! by the method Owner(). In the redefined method you can return NULL.
|
||||
//! ID is the numerical identificator of node or element
|
||||
//! IsElement indicates this ID describe node ( if Standard_False ) or element ( if Standard_True )
|
||||
Standard_EXPORT virtual Standard_Address GetAddr (const Standard_Integer ID, const Standard_Boolean IsElement) const = 0;
|
||||
|
||||
Standard_EXPORT virtual Standard_Address GetAddr (const Standard_Integer ID,
|
||||
const Standard_Boolean IsElement) const = 0;
|
||||
|
||||
//! This method returns information about nodes this element consist of.
|
||||
//! ID is the numerical identificator of element.
|
||||
//! NodeIDs is the output array of nodes IDs in correct order,
|
||||
//! the same as coordinates returned by GetGeom().
|
||||
//! NbNodes is number of nodes (number of items set in NodeIDs).
|
||||
//! Returns False if element does not exist
|
||||
Standard_EXPORT virtual Standard_Boolean GetNodesByElement (const Standard_Integer ID, TColStd_Array1OfInteger& NodeIDs, Standard_Integer& NbNodes) const = 0;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetNodesByElement (const Standard_Integer ID,
|
||||
TColStd_Array1OfInteger& NodeIDs,
|
||||
Standard_Integer& NbNodes) const = 0;
|
||||
|
||||
//! This method returns map of all nodes the object consist of.
|
||||
Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllNodes() const = 0;
|
||||
|
||||
|
||||
//! This method returns map of all elements the object consist of.
|
||||
Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllElements() const = 0;
|
||||
|
||||
@@ -105,13 +116,21 @@ public:
|
||||
//! In the redefined method you can return normal with length more then 1, but in this case
|
||||
//! the appearance of element will be more bright than usual. For ordinary brightness you must return
|
||||
//! normal with length 1
|
||||
Standard_EXPORT virtual Standard_Boolean GetNormal (const Standard_Integer Id, const Standard_Integer Max, Standard_Real& nx, Standard_Real& ny, Standard_Real& nz) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetNormal (const Standard_Integer Id,
|
||||
const Standard_Integer Max,
|
||||
Standard_Real& nx,
|
||||
Standard_Real& ny,
|
||||
Standard_Real& nz) const;
|
||||
|
||||
//! This method return normal of node ranknode of face Id,
|
||||
//! which is using for smooth shading presentation.
|
||||
//! Returns false if normal isn't defined.
|
||||
Standard_EXPORT virtual Standard_Boolean GetNodeNormal (const Standard_Integer ranknode, const Standard_Integer ElementId, Standard_Real& nx, Standard_Real& ny, Standard_Real& nz) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetNodeNormal (const Standard_Integer ranknode,
|
||||
const Standard_Integer ElementId,
|
||||
Standard_Real& nx,
|
||||
Standard_Real& ny,
|
||||
Standard_Real& nz) const;
|
||||
|
||||
//! This method puts components of normal vectors at each node of a mesh face (at each face of a mesh volume)
|
||||
//! into the output array.
|
||||
//! Returns false if some problem was detected during calculation of normals.
|
||||
@@ -123,13 +142,18 @@ public:
|
||||
//! volume: normals to all faces of the volume are computed (not for each node!).
|
||||
//! MaxNodes is maximal number of nodes an element can consist of.
|
||||
//! Normals contains the result.
|
||||
Standard_EXPORT virtual Standard_Boolean GetNormalsByElement (const Standard_Integer Id, const Standard_Boolean IsNodal, const Standard_Integer MaxNodes, Handle(TColStd_HArray1OfReal)& Normals) const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetNormalsByElement (const Standard_Integer Id,
|
||||
const Standard_Boolean IsNodal,
|
||||
const Standard_Integer MaxNodes,
|
||||
Handle(TColStd_HArray1OfReal)& Normals) const;
|
||||
|
||||
//! This method returns map of all groups the object contains.
|
||||
Standard_EXPORT virtual void GetAllGroups (TColStd_PackedMapOfInteger& Ids) const;
|
||||
|
||||
|
||||
//! This method returns map of all group elements.
|
||||
Standard_EXPORT virtual Standard_Boolean GetGroup (const Standard_Integer Id, MeshVS_EntityType& Type, TColStd_PackedMapOfInteger& Ids) const;
|
||||
Standard_EXPORT virtual Standard_Boolean GetGroup (const Standard_Integer Id,
|
||||
MeshVS_EntityType& Type,
|
||||
TColStd_PackedMapOfInteger& Ids) const;
|
||||
|
||||
//! This method returns pointer which represents group data structure.
|
||||
//! This address will be saved in MeshVS_MeshOwner, so that you can access to data structure fast
|
||||
@@ -156,7 +180,13 @@ public:
|
||||
//! Returns True if something is detected.
|
||||
//! It should be redefined if the advanced mesh selection is
|
||||
//! activated. Default implementation returns False.
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs, const Standard_Real X, const Standard_Real Y, const Standard_Real aTol, Handle(TColStd_HPackedMapOfInteger)& Nodes, Handle(TColStd_HPackedMapOfInteger)& Elements, Standard_Real& DMin);
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs,
|
||||
const Standard_Real X,
|
||||
const Standard_Real Y,
|
||||
const Standard_Real aTol,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Nodes,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Elements,
|
||||
Standard_Real& DMin);
|
||||
|
||||
//! Returns maps of entities (nodes and elements) detected
|
||||
//! by mouse selection with rectangular box (XMin, YMin, XMax, YMax)
|
||||
@@ -164,45 +194,39 @@ public:
|
||||
//! Returns True if something is detected.
|
||||
//! It should be redefined if the advanced mesh selection is
|
||||
//! activated. Default implementation returns False.
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs, const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol, Handle(TColStd_HPackedMapOfInteger)& Nodes, Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs,
|
||||
const Standard_Real XMin,
|
||||
const Standard_Real YMin,
|
||||
const Standard_Real XMax,
|
||||
const Standard_Real YMax,
|
||||
const Standard_Real aTol,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Nodes,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
//! Returns maps of entities (nodes and elements) detected
|
||||
//! by mouse selection with the polyline <Polyline>
|
||||
//! on the current veiw plane, with the tolerance aTol.
|
||||
//! Returns True if something is detected.
|
||||
//! It should be redefined if the advanced mesh selection is
|
||||
//! activated. Default implementation returns False.
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs, const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol, Handle(TColStd_HPackedMapOfInteger)& Nodes, Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs,
|
||||
const TColgp_Array1OfPnt2d& Polyline,
|
||||
const Bnd_Box2d& aBox,
|
||||
const Standard_Real aTol,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Nodes,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
//! Filter out the maps of mesh entities so as to keep
|
||||
//! only the entities that are allowed to be selected
|
||||
//! according to the current context.
|
||||
//! Returns True if any of the maps has been changed.
|
||||
//! It should be redefined if the advanced mesh selection is
|
||||
//! activated. Default implementation returns False.
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs, Handle(TColStd_HPackedMapOfInteger)& Nodes, Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean GetDetectedEntities (const Handle(MeshVS_Mesh)& Prs,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Nodes,
|
||||
Handle(TColStd_HPackedMapOfInteger)& Elements);
|
||||
|
||||
DEFINE_STANDARD_RTTI(MeshVS_DataSource,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _MeshVS_DataSource_HeaderFile
|
||||
|
544
src/MeshVS/MeshVS_LODBuilder.cxx
Normal file
544
src/MeshVS/MeshVS_LODBuilder.cxx
Normal file
@@ -0,0 +1,544 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <MeshVS_Drawer.hxx>
|
||||
#include <MeshVS_DrawerAttribute.hxx>
|
||||
#include <MeshVS_LODBuilder.hxx>
|
||||
#include <MeshVS_MapOfTwoNodes.hxx>
|
||||
#include <MeshVS_MeshPrsBuilder.hxx>
|
||||
#include <MeshVS_SymmetricPairHasher.hxx>
|
||||
#include <MeshVS_Tool.hxx>
|
||||
#include <TColStd_HPackedMapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// function : Creation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
MeshVS_LODBuilder::MeshVS_LODBuilder (const Handle(MeshVS_Mesh)& theParentMesh,
|
||||
const MeshVS_DisplayModeFlags& theFlags,
|
||||
const Handle(MeshVS_LODDataSource)& theDataSource,
|
||||
const Standard_Integer theId,
|
||||
const MeshVS_BuilderPriority& thePriority)
|
||||
: MeshVS_PrsBuilder (theParentMesh, theFlags, theDataSource, theId, thePriority)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
// function : Build
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void MeshVS_LODBuilder::Build (const Handle(Prs3d_Presentation)& theBasePrs,
|
||||
const TColStd_PackedMapOfInteger& theIDs,
|
||||
TColStd_PackedMapOfInteger& /*theIDsToExclude*/,
|
||||
const Standard_Boolean theIsElement,
|
||||
const Standard_Integer theDisplayMode) const
|
||||
{
|
||||
if (myParentMesh == NULL)
|
||||
return;
|
||||
|
||||
//if (!theIsElement)
|
||||
//{
|
||||
// Standard_Boolean hasSelectFlag = ((aDispMode & MeshVS_DMF_SelectionPrs) != 0);
|
||||
// Standard_Boolean hasHilightFlag = ((aDispMode & MeshVS_DMF_HilightPrs) != 0);
|
||||
|
||||
// Standard_Real aCoordsBuf[3];
|
||||
// TColStd_Array1OfReal aCoords (*aCoordsBuf, 1, 3);
|
||||
// Standard_Integer aNodesNb;
|
||||
// MeshVS_EntityType aType;
|
||||
|
||||
// TColStd_PackedMapOfInteger anIDs;
|
||||
// anIDs.Assign (myNodeIdxs);
|
||||
// if (!hasSelectFlag && !hasHilightFlag)
|
||||
// {
|
||||
// // subtract the hidden nodes and ids to exclude (to minimize allocated memory)
|
||||
// Handle(TColStd_HPackedMapOfInteger) aHiddenNodes = aMesh->GetHiddenNodes();
|
||||
// if (!aHiddenNodes.IsNull())
|
||||
// anIDs.Subtract (aHiddenNodes->Map());
|
||||
// }
|
||||
|
||||
// Standard_Integer aSize = anIDs.Extent();
|
||||
// if (aSize > 0)
|
||||
// {
|
||||
// Handle(Graphic3d_ArrayOfPoints) aNodePoints = new Graphic3d_ArrayOfPoints (aSize);
|
||||
// Standard_Integer aPntsNb = 0;
|
||||
// for (TColStd_MapIteratorOfPackedMapOfInteger aNodeIdxsIter (myNodeIdxs); aNodeIdxsIter.More(); aNodeIdxsIter.Next())
|
||||
// {
|
||||
// const Standard_Integer aKey = aNodeIdxsIter.Key();
|
||||
// if (GetGeom (aKey, Standard_False, aCoords, aNodesNb, aType))
|
||||
// {
|
||||
// aPntsNb++;
|
||||
// aNodePoints->AddVertex (aCoords(1), aCoords(2), aCoords(3));
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (aPntsNb > 0)
|
||||
// {
|
||||
// Handle(Graphic3d_LOD) aNewLod = Prs3d_Root::NewLOD (aMainPrs);
|
||||
// Handle(Graphic3d_Group) aLODGroup = aNewLod->NewGroup();
|
||||
// aLODGroup->AddPrimitiveArray (aNodePoints);
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
if (theIsElement)
|
||||
{
|
||||
Standard_Integer aMaxNodesNb;
|
||||
|
||||
Handle(MeshVS_MeshPrsBuilder) aBuilder = Handle(MeshVS_MeshPrsBuilder)::DownCast (myParentMesh->GetBuilder (1));
|
||||
if (aBuilder.IsNull())
|
||||
return;
|
||||
Handle(MeshVS_Drawer) aDrawer = aBuilder->GetDrawer();
|
||||
if (aDrawer.IsNull() ||
|
||||
!aDrawer->GetInteger (MeshVS_DA_MaxFaceNodes, aMaxNodesNb) ||
|
||||
aMaxNodesNb <= 0)
|
||||
return;
|
||||
|
||||
//----------- extract useful display mode flags ----------
|
||||
Standard_Integer aDispStatus = (theDisplayMode & aBuilder->GetFlags());
|
||||
if ((aDispStatus & MeshVS_DMF_DeformedMask) != 0)
|
||||
{
|
||||
aDispStatus /= MeshVS_DMF_DeformedPrsWireFrame;
|
||||
// This transformation turns deformed mesh flags to real display modes
|
||||
}
|
||||
aDispStatus &= MeshVS_DMF_OCCMask;
|
||||
//--------------------------------------------------------
|
||||
|
||||
Standard_Real aShrinkCoef;
|
||||
aDrawer->GetDouble (MeshVS_DA_ShrinkCoeff, aShrinkCoef);
|
||||
|
||||
const Standard_Boolean isWireframe = theDisplayMode == MeshVS_DMF_WireFrame;
|
||||
Standard_Boolean isShading = theDisplayMode == MeshVS_DMF_Shading;
|
||||
Standard_Boolean isShrink = theDisplayMode == MeshVS_DMF_Shrink;
|
||||
const Standard_Boolean hasHilightFlag = (aDispStatus & MeshVS_DMF_HilightPrs) != 0;
|
||||
const Standard_Boolean hasSelFlag =(aDispStatus & MeshVS_DMF_SelectionPrs) != 0;
|
||||
Standard_Boolean isMeshSmoothShading = Standard_False;
|
||||
Standard_Boolean isMeshReflect, isMeshAllowOverlap, isReflect;
|
||||
|
||||
aDrawer->GetBoolean (MeshVS_DA_Reflection, isMeshReflect);
|
||||
aDrawer->GetBoolean (MeshVS_DA_IsAllowOverlapped, isMeshAllowOverlap);
|
||||
isReflect = isMeshReflect && !hasHilightFlag;
|
||||
aDrawer->GetBoolean (MeshVS_DA_SmoothShading, isMeshSmoothShading);
|
||||
|
||||
// display mode for highlighted prs of groups
|
||||
isShrink = isShrink && !hasHilightFlag;
|
||||
isShading = isShading || hasHilightFlag;
|
||||
|
||||
Graphic3d_MaterialAspect aMatAspect;
|
||||
aDrawer->GetMaterial (MeshVS_DA_FrontMaterial, aMatAspect);
|
||||
if (!isReflect)
|
||||
{
|
||||
aMatAspect.SetReflectionModeOff(Graphic3d_TOR_AMBIENT);
|
||||
aMatAspect.SetReflectionModeOff(Graphic3d_TOR_DIFFUSE);
|
||||
aMatAspect.SetReflectionModeOff(Graphic3d_TOR_SPECULAR);
|
||||
aMatAspect.SetReflectionModeOff(Graphic3d_TOR_EMISSION);
|
||||
}
|
||||
Handle(Graphic3d_AspectFillArea3d ) aFill = MeshVS_Tool::CreateAspectFillArea3d (aDrawer, aMatAspect);
|
||||
Handle(Graphic3d_AspectLine3d ) aBeam = MeshVS_Tool::CreateAspectLine3d (aDrawer);
|
||||
|
||||
const Standard_Boolean isOverlapControl =
|
||||
!isMeshAllowOverlap && (isWireframe || isShading) && !hasSelFlag;
|
||||
|
||||
// subtract the hidden elements and ids to exclude (to minimize allocated memory)
|
||||
TColStd_PackedMapOfInteger anIDs;
|
||||
anIDs.Assign (theIDs);
|
||||
Handle(TColStd_HPackedMapOfInteger) aHiddenElems = myParentMesh->GetHiddenElems();
|
||||
if (!aHiddenElems.IsNull())
|
||||
anIDs.Subtract (aHiddenElems->Map());
|
||||
|
||||
Handle(MeshVS_HArray1OfSequenceOfInteger) aTopo;
|
||||
|
||||
Standard_Boolean toShowEdges = Standard_True;
|
||||
aDrawer->GetBoolean (MeshVS_DA_ShowEdges, toShowEdges);
|
||||
|
||||
toShowEdges = isWireframe || toShowEdges;
|
||||
|
||||
Standard_Integer* aNodesBuf = (Standard_Integer*)alloca (aMaxNodesNb * sizeof (Standard_Integer));
|
||||
Standard_Real* aCoordsBuf = (Standard_Real*)alloca (3 * aMaxNodesNb * sizeof (Standard_Real));
|
||||
|
||||
TColStd_Array1OfInteger aNodes (*aNodesBuf, 1, aMaxNodesNb);
|
||||
TColStd_Array1OfReal aCoords (*aCoordsBuf, 1, 3 * aMaxNodesNb);
|
||||
|
||||
Standard_Integer aNbFacePrimitives = 0;
|
||||
Standard_Integer aNbVolmPrimitives = 0;
|
||||
Standard_Integer aNbEdgePrimitives = 0;
|
||||
Standard_Integer aNbLinkPrimitives = 0;
|
||||
|
||||
MeshVS_EntityType aType;
|
||||
|
||||
TColStd_MapIteratorOfPackedMapOfInteger anIdxIter (anIDs);
|
||||
for (anIdxIter.Reset(); anIdxIter.More(); anIdxIter.Next())
|
||||
{
|
||||
Standard_Integer aNbNodes = 0;
|
||||
|
||||
if (!DataSource()->GetGeom (anIdxIter.Key(), Standard_True, aCoords, aNbNodes, aType))
|
||||
continue;
|
||||
|
||||
if (aType == MeshVS_ET_Volume)
|
||||
{
|
||||
if (DataSource()->Get3DGeom (anIdxIter.Key(), aNbNodes, aTopo))
|
||||
{
|
||||
for (Standard_Integer aFaceIdx = aTopo->Lower(); aFaceIdx <= aTopo->Upper(); ++aFaceIdx)
|
||||
{
|
||||
const TColStd_SequenceOfInteger& aFaceNodes = aTopo->Value(aFaceIdx);
|
||||
|
||||
if (toShowEdges) // add edge segments
|
||||
{
|
||||
aNbEdgePrimitives += aFaceNodes.Length();
|
||||
}
|
||||
|
||||
if (isShading || isShrink) // add volumetric cell triangles
|
||||
{
|
||||
if (!hasSelFlag)
|
||||
aNbVolmPrimitives += aFaceNodes.Length() - 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (aType == MeshVS_ET_Link)
|
||||
{
|
||||
if (toShowEdges)
|
||||
{
|
||||
aNbLinkPrimitives += 1; // add link segment
|
||||
}
|
||||
}
|
||||
else if (aType == MeshVS_ET_Face)
|
||||
{
|
||||
if (toShowEdges)
|
||||
{
|
||||
aNbEdgePrimitives += aNbNodes; // add edge segments
|
||||
}
|
||||
|
||||
if (!isOverlapControl || isShading)
|
||||
{
|
||||
if ((isShading || isShrink) && !hasSelFlag)
|
||||
{
|
||||
aNbFacePrimitives += aNbNodes - 2; // add face triangles
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Here we do not use indices arrays because they are not effective for some mesh
|
||||
// drawing modes: shrinking mode (displaces the vertices inside the polygon), 3D
|
||||
// cell rendering (normal interpolation is not always applicable - flat shading),
|
||||
// elemental coloring (color interpolation is impossible)
|
||||
Handle(Graphic3d_ArrayOfTriangles) aVolmTriangles =
|
||||
new Graphic3d_ArrayOfTriangles (aNbVolmPrimitives * 3, 0, isReflect);
|
||||
Handle(Graphic3d_ArrayOfTriangles) aFaceTriangles =
|
||||
new Graphic3d_ArrayOfTriangles (aNbFacePrimitives * 3, 0, isReflect);
|
||||
|
||||
Handle(Graphic3d_ArrayOfSegments) aLinkSegments;
|
||||
Handle(Graphic3d_ArrayOfSegments) aEdgeSegments;
|
||||
|
||||
if (toShowEdges)
|
||||
{
|
||||
aLinkSegments = new Graphic3d_ArrayOfSegments (aNbLinkPrimitives * 2);
|
||||
aEdgeSegments = new Graphic3d_ArrayOfSegments (aNbEdgePrimitives * 2);
|
||||
}
|
||||
|
||||
TColStd_PackedMapOfInteger aCustomElements;
|
||||
|
||||
MeshVS_MapOfTwoNodes aLinkNodes;
|
||||
|
||||
Quantity_Color anOldEdgeColor;
|
||||
Quantity_Color anEdgeColor;
|
||||
Quantity_Color anIntColor;
|
||||
Aspect_InteriorStyle anIntType;
|
||||
Aspect_TypeOfLine aLine;
|
||||
Standard_Real aWidth;
|
||||
|
||||
aFill->Values (anIntType, anIntColor, anEdgeColor, aLine, aWidth);
|
||||
|
||||
// Forbid drawings of edges which overlap with some links
|
||||
if (toShowEdges && isOverlapControl)
|
||||
{
|
||||
for (anIdxIter.Reset(); anIdxIter.More(); anIdxIter.Next())
|
||||
{
|
||||
if (DataSource()->GetGeomType (anIdxIter.Key(), Standard_True, aType) && aType == MeshVS_ET_Link)
|
||||
{
|
||||
Standard_Integer aNbNodes;
|
||||
|
||||
if (DataSource()->GetNodesByElement (anIdxIter.Key(), aNodes, aNbNodes) && aNbNodes == 2)
|
||||
{
|
||||
aLinkNodes.Add (MeshVS_TwoNodes (aNodes(1), aNodes(2)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NCollection_Map<MeshVS_NodePair, MeshVS_SymmetricPairHasher> aSegmentMap;
|
||||
|
||||
for (anIdxIter.Reset(); anIdxIter.More(); anIdxIter.Next())
|
||||
{
|
||||
const Standard_Integer aKey = anIdxIter.Key();
|
||||
|
||||
Standard_Integer NbNodes;
|
||||
if (!DataSource()->GetGeom (aKey, Standard_True, aCoords, NbNodes, aType))
|
||||
continue;
|
||||
|
||||
if (!DataSource()->GetNodesByElement (aKey, aNodes, NbNodes))
|
||||
continue;
|
||||
|
||||
switch (aType)
|
||||
{
|
||||
case MeshVS_ET_Volume:
|
||||
{
|
||||
if (DataSource()->Get3DGeom (aKey, NbNodes, aTopo))
|
||||
{
|
||||
// Add wire-frame presentation (draw edges for shading mode as well)
|
||||
if (toShowEdges)
|
||||
{
|
||||
aBuilder->AddVolumePrs (aTopo, aCoords, NbNodes,
|
||||
aEdgeSegments, isReflect,
|
||||
isShrink, hasSelFlag,
|
||||
aShrinkCoef);
|
||||
}
|
||||
|
||||
// Add shading presentation
|
||||
if ((isShading || isShrink) && !hasSelFlag)
|
||||
{
|
||||
aBuilder->AddVolumePrs (aTopo, aCoords, NbNodes,
|
||||
aVolmTriangles, isReflect,
|
||||
isShrink, hasSelFlag,
|
||||
aShrinkCoef);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MeshVS_ET_Link:
|
||||
{
|
||||
if (toShowEdges)
|
||||
{
|
||||
aBuilder->AddLinkPrs (aCoords, aLinkSegments, isShrink || hasSelFlag, aShrinkCoef);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case MeshVS_ET_Face:
|
||||
{
|
||||
if (toShowEdges && isOverlapControl)
|
||||
{
|
||||
Standard_Integer Last = 0;
|
||||
|
||||
MeshVS_TwoNodes aTwoNodes (aNodes(1));
|
||||
|
||||
for (Standard_Integer i = 1; i <= NbNodes; ++i)
|
||||
{
|
||||
if (i > 1)
|
||||
aTwoNodes.First = aTwoNodes.Second;
|
||||
|
||||
aTwoNodes.Second = (i < NbNodes) ? aNodes (i + 1) : aNodes (1);
|
||||
|
||||
if (aLinkNodes.Contains (aTwoNodes))
|
||||
{
|
||||
for (Standard_Integer aNodeIdx = Last + 1; aNodeIdx < i; ++aNodeIdx)
|
||||
{
|
||||
const Standard_Integer aNextIdx = aNodeIdx + 1;
|
||||
|
||||
aEdgeSegments->AddVertex (
|
||||
aCoords (3 * aNodeIdx - 2), aCoords (3 * aNodeIdx - 1), aCoords (3 * aNodeIdx));
|
||||
aEdgeSegments->AddVertex(
|
||||
aCoords (3 * aNextIdx - 2), aCoords (3 * aNextIdx - 1), aCoords (3 * aNextIdx));
|
||||
}
|
||||
|
||||
Last = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (NbNodes - Last > 0)
|
||||
{
|
||||
for (Standard_Integer aNodeIdx = Last; aNodeIdx < NbNodes; ++aNodeIdx)
|
||||
{
|
||||
const Standard_Integer aNextIdx = (aNodeIdx + 1) % NbNodes;
|
||||
|
||||
const MeshVS_NodePair aSegment (aNodes (aNodeIdx + 1), aNodes (aNextIdx + 1));
|
||||
|
||||
if (!aSegmentMap.Contains (aSegment))
|
||||
{
|
||||
aEdgeSegments->AddVertex (aCoords (3 * aNodeIdx + 1),
|
||||
aCoords (3 * aNodeIdx + 2),
|
||||
aCoords (3 * aNodeIdx + 3));
|
||||
|
||||
aEdgeSegments->AddVertex (aCoords (3 * aNextIdx + 1),
|
||||
aCoords (3 * aNextIdx + 2),
|
||||
aCoords (3 * aNextIdx + 3));
|
||||
|
||||
aSegmentMap.Add (aSegment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isOverlapControl || isShading)
|
||||
{
|
||||
if (!isOverlapControl && toShowEdges)
|
||||
{
|
||||
aBuilder->AddFaceWirePrs (aCoords, NbNodes, aEdgeSegments, isShrink || hasSelFlag, aShrinkCoef);
|
||||
}
|
||||
|
||||
if ((isShading || isShrink) && !hasSelFlag)
|
||||
{
|
||||
aBuilder->AddFaceSolidPrs (DataSource(), aKey, aCoords, NbNodes, aMaxNodesNb, aFaceTriangles, isReflect,
|
||||
isShrink || hasSelFlag, aShrinkCoef, isMeshSmoothShading);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
aCustomElements.Add (aKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (isShrink)
|
||||
{
|
||||
anOldEdgeColor = anEdgeColor;
|
||||
aFill->SetEdgeColor (Quantity_NOC_BLACK);
|
||||
}
|
||||
|
||||
Standard_Boolean isSupressBackFaces = Standard_False;
|
||||
if (!aDrawer.IsNull())
|
||||
{
|
||||
aDrawer->GetBoolean (MeshVS_DA_SupressBackFaces, isSupressBackFaces);
|
||||
}
|
||||
drawArrays (theBasePrs, aFaceTriangles, aEdgeSegments, aLinkSegments, aVolmTriangles,
|
||||
!toShowEdges, hasSelFlag, isSupressBackFaces, aFill, aBeam);
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : drawArrays
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void MeshVS_LODBuilder::drawArrays (const Handle(Prs3d_Presentation)& theBasePrs,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& thePolygons,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLinkLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theVolumesInShad,
|
||||
const Standard_Boolean theIsPolygonsEdgesOff,
|
||||
const Standard_Boolean theIsSelected,
|
||||
const Standard_Boolean theIsSupressBackFaces,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theFillAsp,
|
||||
const Handle(Graphic3d_AspectLine3d)& theLineAsp) const
|
||||
{
|
||||
if (theFillAsp.IsNull())
|
||||
return;
|
||||
|
||||
Standard_Boolean isFacePolygons = (!thePolygons.IsNull() && thePolygons->ItemNumber() > 0),
|
||||
isVolumePolygons = (!theVolumesInShad.IsNull() && theVolumesInShad->ItemNumber() > 0),
|
||||
isPolygons = isFacePolygons || isVolumePolygons,
|
||||
isPolylines = (!theLines.IsNull() && theLines->ItemNumber() > 0),
|
||||
isLinkPolylines = (!theLinkLines.IsNull() && theLinkLines->ItemNumber() > 0);
|
||||
|
||||
Aspect_InteriorStyle aStyle;
|
||||
Quantity_Color anIntColor, aBackColor, anEdgeColor;
|
||||
Aspect_TypeOfLine aType;
|
||||
Standard_Real aWidth;
|
||||
|
||||
Handle(Graphic3d_LOD) aNewLod = theBasePrs->NewLOD();
|
||||
theFillAsp->Values (aStyle, anIntColor, aBackColor, anEdgeColor, aType, aWidth);
|
||||
|
||||
if (isPolygons && theFillAsp->FrontMaterial().Transparency() < 0.01)
|
||||
{
|
||||
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
||||
|
||||
theFillAsp->SetEdgeOff();
|
||||
|
||||
if (anIntColor != aBackColor)
|
||||
theFillAsp->SetDistinguishOn();
|
||||
else
|
||||
theFillAsp->SetDistinguishOff();
|
||||
|
||||
aGroup->SetClosed (theIsSupressBackFaces);
|
||||
Handle(Graphic3d_AspectFillArea3d) aFillAsp = new Graphic3d_AspectFillArea3d (*(theFillAsp.operator->()));
|
||||
if (theIsSupressBackFaces)
|
||||
{
|
||||
aFillAsp->SuppressBackFace();
|
||||
}
|
||||
aGroup->SetPrimitivesAspect (aFillAsp);
|
||||
|
||||
if (isFacePolygons)
|
||||
{
|
||||
aGroup->AddPrimitiveArray (thePolygons);
|
||||
}
|
||||
|
||||
if (isVolumePolygons)
|
||||
{
|
||||
aGroup->AddPrimitiveArray (theVolumesInShad);
|
||||
}
|
||||
}
|
||||
|
||||
if (isPolylines && !theIsPolygonsEdgesOff)
|
||||
{
|
||||
Handle (Graphic3d_Group) aLGroup = aNewLod->NewGroup (theBasePrs);
|
||||
|
||||
theFillAsp->SetEdgeOff();
|
||||
if (theIsSelected)
|
||||
aLGroup->SetPrimitivesAspect (theLineAsp);
|
||||
else
|
||||
{
|
||||
aLGroup->SetPrimitivesAspect (theFillAsp);
|
||||
aLGroup->SetPrimitivesAspect (new Graphic3d_AspectLine3d (anEdgeColor, Aspect_TOL_SOLID, aWidth));
|
||||
}
|
||||
aLGroup->AddPrimitiveArray (theLines);
|
||||
theFillAsp->SetEdgeOn();
|
||||
}
|
||||
|
||||
if (isLinkPolylines)
|
||||
{
|
||||
Handle (Graphic3d_Group) aBeamGroup = aNewLod->NewGroup (theBasePrs);
|
||||
|
||||
theFillAsp->SetEdgeOff();
|
||||
if (!theIsSelected)
|
||||
aBeamGroup->SetPrimitivesAspect (theFillAsp);
|
||||
aBeamGroup->SetPrimitivesAspect (theLineAsp);
|
||||
aBeamGroup->AddPrimitiveArray (theLinkLines);
|
||||
theFillAsp->SetEdgeOn();
|
||||
}
|
||||
|
||||
if (isPolygons && theFillAsp->FrontMaterial().Transparency() >= 0.01)
|
||||
{
|
||||
Handle (Graphic3d_Group) aGroup = aNewLod->NewGroup (theBasePrs);
|
||||
|
||||
theFillAsp->SetEdgeOff();
|
||||
|
||||
if (anIntColor != aBackColor)
|
||||
theFillAsp->SetDistinguishOn();
|
||||
else
|
||||
theFillAsp->SetDistinguishOff();
|
||||
|
||||
aGroup->SetClosed (theIsSupressBackFaces);
|
||||
Handle(Graphic3d_AspectFillArea3d) aFillAsp = new Graphic3d_AspectFillArea3d (*(theFillAsp.operator->()));
|
||||
if (theIsSupressBackFaces)
|
||||
{
|
||||
aFillAsp->SuppressBackFace();
|
||||
}
|
||||
aGroup->SetPrimitivesAspect (aFillAsp);
|
||||
|
||||
if (isFacePolygons)
|
||||
{
|
||||
aGroup->AddPrimitiveArray (thePolygons);
|
||||
}
|
||||
|
||||
if (isVolumePolygons)
|
||||
{
|
||||
aGroup->AddPrimitiveArray (theVolumesInShad);
|
||||
}
|
||||
}
|
||||
}
|
66
src/MeshVS/MeshVS_LODBuilder.hxx
Normal file
66
src/MeshVS/MeshVS_LODBuilder.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _MeshVS_LODBuilder_Header
|
||||
#define _MeshVS_LODBuilder_Header
|
||||
|
||||
#include <MeshVS_Mesh.hxx>
|
||||
#include <MeshVS_PrsBuilder.hxx>
|
||||
#include <MeshVS_LODDataSource.hxx>
|
||||
|
||||
class MeshVS_LODBuilder : public MeshVS_PrsBuilder
|
||||
{
|
||||
public:
|
||||
|
||||
//! Creates builder with certain display mode flags, data source, ID and priority
|
||||
Standard_EXPORT MeshVS_LODBuilder (const Handle(MeshVS_Mesh)& theParentMesh,
|
||||
const MeshVS_DisplayModeFlags& theFlags = MeshVS_DMF_OCCMask,
|
||||
const Handle(MeshVS_LODDataSource)& theDataSource = NULL,
|
||||
const Standard_Integer theId = -1,
|
||||
const MeshVS_BuilderPriority& thePriority = MeshVS_BP_Mesh);
|
||||
|
||||
Standard_EXPORT virtual ~MeshVS_LODBuilder() {};
|
||||
|
||||
//! Builds presentation of certain type of data.
|
||||
//! Prs is presentation object which this method constructs.
|
||||
//! IDs is set of numeric identificators forming object appearance.
|
||||
//! IDsToExclude is set of IDs to exclude from processing. If some entity
|
||||
//! has been excluded, it is not processed by other builders.
|
||||
//! IsElement indicates, IDs is identificators of nodes or elements.
|
||||
//! DisplayMode is numeric constant describing display mode (see MeshVS_DisplayModeFlags.hxx)
|
||||
Standard_EXPORT virtual void Build (const Handle(Prs3d_Presentation)& theBasePrs,
|
||||
const TColStd_PackedMapOfInteger& theIDs,
|
||||
TColStd_PackedMapOfInteger& theIDsToExclude,
|
||||
const Standard_Boolean theIsElement,
|
||||
const Standard_Integer theDisplayMode) const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI (MeshVS_LODBuilder, MeshVS_PrsBuilder)
|
||||
|
||||
protected:
|
||||
void drawArrays (const Handle(Prs3d_Presentation)& theBasePrs,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& thePolygons,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLinkLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theVolumesInShad,
|
||||
const Standard_Boolean theIsPolygonsEdgesOff,
|
||||
const Standard_Boolean theIsSelected,
|
||||
const Standard_Boolean theIsSupressBackFaces,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theFillAsp,
|
||||
const Handle(Graphic3d_AspectLine3d)& theLineAsp) const;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (MeshVS_LODBuilder, MeshVS_PrsBuilder)
|
||||
|
||||
#endif // _MeshVS_LODBuilder_Header
|
177
src/MeshVS/MeshVS_LODDataSource.cxx
Normal file
177
src/MeshVS/MeshVS_LODDataSource.cxx
Normal file
@@ -0,0 +1,177 @@
|
||||
// Created on: 2015-10-23
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <MeshVS_LODDataSource.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <MeshVS_Drawer.hxx>
|
||||
#include <MeshVS_DrawerAttribute.hxx>
|
||||
#include <MeshVS_Mesh.hxx>
|
||||
#include <MeshVS_MapOfTwoNodes.hxx>
|
||||
#include <MeshVS_MeshPrsBuilder.hxx>
|
||||
#include <MeshVS_SymmetricPairHasher.hxx>
|
||||
#include <MeshVS_Tool.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Root.hxx>
|
||||
#include <TColStd_HPackedMapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
|
||||
#include <TColgp_SequenceOfXYZ.hxx>
|
||||
#include <StlMesh_SequenceOfMeshTriangle.hxx>
|
||||
#include <StlMesh_MeshTriangle.hxx>
|
||||
|
||||
//=======================================================================
|
||||
// function : MeshVS_LODDataSource
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
MeshVS_LODDataSource::MeshVS_LODDataSource (const Handle(StlMesh_Mesh)& theMesh)
|
||||
: myTriangles (1, theMesh->Triangles().Length()),
|
||||
myNodes (1, theMesh->Vertices().Length())
|
||||
{
|
||||
if (theMesh.IsNull())
|
||||
return;
|
||||
|
||||
const TColgp_SequenceOfXYZ& aVerts = theMesh->Vertices();
|
||||
for (Standard_Integer aNodeIdx = 1; aNodeIdx <= aVerts.Length(); ++aNodeIdx)
|
||||
{
|
||||
myNodeIdxs.Add (aNodeIdx);
|
||||
myNodes.ChangeValue (aNodeIdx) = aVerts (aNodeIdx);
|
||||
}
|
||||
|
||||
const StlMesh_SequenceOfMeshTriangle& aTriangles = theMesh->Triangles();
|
||||
for (Standard_Integer aTrgIdx = 1; aTrgIdx <= aTriangles.Length(); ++aTrgIdx)
|
||||
{
|
||||
myTriangleIdxs.Add (aTrgIdx);
|
||||
const Handle(StlMesh_MeshTriangle)& aTriangle = aTriangles.Value (aTrgIdx);
|
||||
Standard_Integer aNodeIdxs[3];
|
||||
Standard_Real aNormalX, aNormalY, aNormalZ;
|
||||
aTriangle->GetVertexAndOrientation (aNodeIdxs[0], aNodeIdxs[1], aNodeIdxs[2], aNormalX, aNormalY, aNormalZ);
|
||||
myTriangles.ChangeValue (aTrgIdx) = Poly_Triangle (aNodeIdxs[0], aNodeIdxs[1], aNodeIdxs[2]);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetGeom
|
||||
// purpose : Returns full info about the entity according to the index and type of element given
|
||||
//=======================================================================
|
||||
Standard_Boolean MeshVS_LODDataSource::GetGeom (const Standard_Integer theId,
|
||||
const Standard_Boolean theIsElement,
|
||||
TColStd_Array1OfReal& theCoords,
|
||||
Standard_Integer& theNodesNb,
|
||||
MeshVS_EntityType& theEntityType) const
|
||||
{
|
||||
if (theId < 1)
|
||||
return Standard_False;
|
||||
|
||||
if (theIsElement)
|
||||
{
|
||||
if (theId > myTriangleIdxs.Extent() || theCoords.Length() < 9)
|
||||
return Standard_False;
|
||||
|
||||
Standard_Integer aNode1, aNode2, aNode3;
|
||||
myTriangles.Value (theId).Get (aNode1, aNode2, aNode3);
|
||||
gp_Pnt aPnts[3] = { myNodes.Value (aNode1),
|
||||
myNodes.Value (aNode2),
|
||||
myNodes.Value (aNode3) };
|
||||
for (Standard_Integer aPntIdx = 0, anIdx = 1; aPntIdx < 3; ++aPntIdx)
|
||||
{
|
||||
for (Standard_Integer aCoordIdx = 0; aCoordIdx < 3; aCoordIdx++)
|
||||
{
|
||||
theCoords (anIdx++) = aPnts[aPntIdx].XYZ().GetData()[aCoordIdx];
|
||||
}
|
||||
}
|
||||
|
||||
theNodesNb = 3;
|
||||
theEntityType = MeshVS_ET_Face;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (theId > myNodeIdxs.Extent() || theCoords.Length() < 3)
|
||||
return Standard_False;
|
||||
|
||||
const gp_Pnt& aNode = myNodes.Value (theId);
|
||||
theCoords (1) = aNode.X();
|
||||
theCoords (2) = aNode.Y();
|
||||
theCoords (3) = aNode.Z();
|
||||
|
||||
theNodesNb = 1;
|
||||
theEntityType = MeshVS_ET_Node;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetGeomType
|
||||
// purpose : Returns type of geometry according to the index and type of element given
|
||||
//=======================================================================
|
||||
Standard_Boolean MeshVS_LODDataSource::GetGeomType (const Standard_Integer /*theId*/,
|
||||
const Standard_Boolean theIsElement,
|
||||
MeshVS_EntityType& theEntityType) const
|
||||
{
|
||||
theEntityType = theIsElement ? MeshVS_ET_Face : MeshVS_ET_Node;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetAddr
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Standard_Address MeshVS_LODDataSource::GetAddr (const Standard_Integer /*theId*/,
|
||||
const Standard_Boolean /*theIsElement*/) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetNodesByElement
|
||||
// purpose : Returns nodes forming a triangle with id theId
|
||||
//=======================================================================
|
||||
Standard_Boolean MeshVS_LODDataSource::GetNodesByElement (const Standard_Integer theId,
|
||||
TColStd_Array1OfInteger& theNodeIds,
|
||||
Standard_Integer& theNodesNb) const
|
||||
{
|
||||
if (theId < 1 || theId > myTriangleIdxs.Extent() || theNodeIds.Length() < 3)
|
||||
return Standard_False;
|
||||
|
||||
const Standard_Integer aLowerIdx = theNodeIds.Lower();
|
||||
myTriangles.Value (theId).Get (theNodeIds.ChangeValue (aLowerIdx),
|
||||
theNodeIds.ChangeValue (aLowerIdx + 1),
|
||||
theNodeIds.ChangeValue (aLowerIdx + 2));
|
||||
theNodesNb = 3;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetAllNodes
|
||||
// purpose : This method makes storing usless map excusable
|
||||
//=======================================================================
|
||||
const TColStd_PackedMapOfInteger& MeshVS_LODDataSource::GetAllNodes() const
|
||||
{
|
||||
return myNodeIdxs;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : GetAllElements
|
||||
// purpose : This method makes storing usless map excusable
|
||||
//=======================================================================
|
||||
const TColStd_PackedMapOfInteger& MeshVS_LODDataSource::GetAllElements() const
|
||||
{
|
||||
return myTriangleIdxs;
|
||||
}
|
93
src/MeshVS/MeshVS_LODDataSource.hxx
Normal file
93
src/MeshVS/MeshVS_LODDataSource.hxx
Normal file
@@ -0,0 +1,93 @@
|
||||
// Created on: 2015-10-23
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _MeshVS_LODDataSource_Header
|
||||
#define _MeshVS_LODDataSource_Header
|
||||
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <MeshVS_DataSource.hxx>
|
||||
#include <Poly_Array1OfTriangle.hxx>
|
||||
#include <Poly_Triangle.hxx>
|
||||
#include <StlMesh_Mesh.hxx>
|
||||
|
||||
//! TODO: VPA: think how to avoid copying mesh data. Now it is done for returning useless maps
|
||||
//! in GetAllElements() and GetAllNodes() because they must return const links. Moreover,
|
||||
//! copying data allows to avoid cases when indexation in Poly_Triangluation inner
|
||||
//! arrays starts from arbitrary numbers (if it is really possible).
|
||||
class MeshVS_LODDataSource : public MeshVS_DataSource
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT MeshVS_LODDataSource (const Handle(StlMesh_Mesh)& theMesh);
|
||||
|
||||
Standard_EXPORT virtual ~MeshVS_LODDataSource() {};
|
||||
|
||||
//! Returns geometry information about node or element
|
||||
//! ID is the numerical identificator of node or element
|
||||
//! IsElement indicates this ID describe node ( if Standard_False ) or element ( if Standard_True )
|
||||
//! Coords is an array of co-ordinates of node(s).
|
||||
//! For node it is only 3 numbers: X, Y, Z in the strict order
|
||||
//! For element it is 3*n numbers, where n is number of this element vertices
|
||||
//! The order is strict also: X1, Y1, Z1, X2,...., where Xi, Yi, Zi are co-ordinates of vertices
|
||||
//! NbNodes is number of nodes. It is recommended this parameter to be set to 1 for node.
|
||||
//! Type is type of node or element (from enumeration). It is recommended this parameter to be set to
|
||||
//! MeshVS_ET_Node for node.
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeom (const Standard_Integer theId,
|
||||
const Standard_Boolean theIsElement,
|
||||
TColStd_Array1OfReal& theCoords,
|
||||
Standard_Integer& theNodesNb,
|
||||
MeshVS_EntityType& theEntityType) const Standard_OVERRIDE;
|
||||
|
||||
//! This method is similar to GetGeom, but returns only element or node type.
|
||||
Standard_EXPORT virtual Standard_Boolean GetGeomType (const Standard_Integer theId,
|
||||
const Standard_Boolean theIsElement,
|
||||
MeshVS_EntityType& theEntityType) const Standard_OVERRIDE;
|
||||
|
||||
//! This method returns pointer which represents element or node data structure.
|
||||
//! This address will be saved in MeshVS_MeshEntityOwner, so that you can access to data structure fast
|
||||
//! by the method Owner(). In the redefined method you can return NULL.
|
||||
//! ID is the numerical identificator of node or element
|
||||
//! IsElement indicates this ID describe node ( if Standard_False ) or element ( if Standard_True )
|
||||
Standard_EXPORT virtual Standard_Address GetAddr (const Standard_Integer theId,
|
||||
const Standard_Boolean theIsElement) const Standard_OVERRIDE;
|
||||
|
||||
//! This method returns information about nodes this element consist of.
|
||||
//! ID is the numerical identificator of element.
|
||||
//! NodeIDs is the output array of nodes IDs in correct order,
|
||||
//! the same as coordinates returned by GetGeom().
|
||||
//! NbNodes is number of nodes (number of items set in NodeIDs).
|
||||
//! Returns False if element does not exist
|
||||
Standard_EXPORT virtual Standard_Boolean GetNodesByElement (const Standard_Integer theId,
|
||||
TColStd_Array1OfInteger& theNodeIds,
|
||||
Standard_Integer& theNodesNb) const Standard_OVERRIDE;
|
||||
|
||||
//! This method returns map of all nodes the object consist of.
|
||||
Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllNodes() const Standard_OVERRIDE;
|
||||
|
||||
//! This method returns map of all elements the object consist of.
|
||||
Standard_EXPORT virtual const TColStd_PackedMapOfInteger& GetAllElements() const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI (MeshVS_LODDataSource, MeshVS_DataSource)
|
||||
|
||||
private:
|
||||
TColStd_PackedMapOfInteger myNodeIdxs;
|
||||
TColStd_PackedMapOfInteger myTriangleIdxs;
|
||||
TColgp_Array1OfPnt myNodes;
|
||||
Poly_Array1OfTriangle myTriangles;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (MeshVS_LODDataSource, MeshVS_DataSource)
|
||||
|
||||
#endif // _MeshVS_LODDataSource_Header
|
@@ -27,6 +27,7 @@
|
||||
#include <MeshVS_Drawer.hxx>
|
||||
#include <MeshVS_DrawerAttribute.hxx>
|
||||
#include <MeshVS_DummySensitiveEntity.hxx>
|
||||
#include <MeshVS_LODBuilder.hxx>
|
||||
#include <MeshVS_Mesh.hxx>
|
||||
#include <MeshVS_MeshEntityOwner.hxx>
|
||||
#include <MeshVS_MeshOwner.hxx>
|
||||
@@ -172,6 +173,10 @@ void MeshVS_Mesh::Compute ( const Handle(PrsMgr_PresentationManager3d)& thePrsMg
|
||||
for ( Standard_Integer i=1; i<=len; i++ )
|
||||
{
|
||||
Handle (MeshVS_PrsBuilder) aCurrent = myBuilders.Value ( i );
|
||||
if (!Handle(MeshVS_LODBuilder)::DownCast (aCurrent).IsNull())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( !aCurrent.IsNull() && aCurrent->TestFlags ( theMode ) )
|
||||
{
|
||||
aCurrent->SetPresentationManager( thePrsMgr );
|
||||
@@ -182,6 +187,22 @@ void MeshVS_Mesh::Compute ( const Handle(PrsMgr_PresentationManager3d)& thePrsMg
|
||||
}
|
||||
}
|
||||
|
||||
if (myLODDataSources.Size() > 0)
|
||||
{
|
||||
for (Standard_Integer aLodBldrIdx = 1; aLodBldrIdx <= myBuilders.Length(); ++aLodBldrIdx)
|
||||
{
|
||||
const Handle(MeshVS_LODBuilder) aLodBldr = Handle(MeshVS_LODBuilder)::DownCast (myBuilders.Value (aLodBldrIdx));
|
||||
if (aLodBldr.IsNull() || !aLodBldr->TestFlags (theMode))
|
||||
continue;
|
||||
|
||||
const TColStd_PackedMapOfInteger aVertIdxs = aLodBldr->GetDataSource()->GetAllNodes();
|
||||
const TColStd_PackedMapOfInteger aTrgIdxs = aLodBldr->GetDataSource()->GetAllElements();
|
||||
if (HasNodes)
|
||||
aLodBldr->Build (thePresentation, aVertIdxs, aNodesToExclude, Standard_False, theMode);
|
||||
if (HasElements)
|
||||
aLodBldr->Build (thePresentation, aTrgIdxs, aElemsToExclude, Standard_True, theMode);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ShowComputeTime )
|
||||
{
|
||||
@@ -869,6 +890,15 @@ void MeshVS_Mesh::SetDataSource( const Handle(MeshVS_DataSource)& theDataSource
|
||||
myDataSource = theDataSource;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : AddDataSource
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void MeshVS_Mesh::AddDataSource (const Handle(MeshVS_DataSource)& theDataSource)
|
||||
{
|
||||
myLODDataSources.Append (theDataSource);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : HilightSelected
|
||||
// Purpose :
|
||||
|
@@ -127,7 +127,10 @@ public:
|
||||
|
||||
//! Sets default builders' data source
|
||||
Standard_EXPORT void SetDataSource (const Handle(MeshVS_DataSource)& aDataSource);
|
||||
|
||||
|
||||
//! Adds data source to define LOD
|
||||
Standard_EXPORT void AddDataSource (const Handle(MeshVS_DataSource)& theDataSource);
|
||||
|
||||
//! Returns default builders' drawer
|
||||
Standard_EXPORT Handle(MeshVS_Drawer) GetDrawer() const;
|
||||
|
||||
@@ -191,7 +194,6 @@ friend class MeshVS_PrsBuilder;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
MeshVS_DataMapOfIntegerOwner myNodeOwners;
|
||||
MeshVS_DataMapOfIntegerOwner myElementOwners;
|
||||
MeshVS_DataMapOfIntegerOwner my0DOwners;
|
||||
@@ -205,10 +207,8 @@ protected:
|
||||
Handle(MeshVS_Drawer) myHilightDrawer;
|
||||
Handle(SelectMgr_EntityOwner) myWholeMeshOwner;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
MeshVS_SequenceOfPrsBuilder myBuilders;
|
||||
Handle(MeshVS_PrsBuilder) myHilighter;
|
||||
Handle(TColStd_HPackedMapOfInteger) myHiddenElements;
|
||||
@@ -216,14 +216,7 @@ private:
|
||||
Handle(TColStd_HPackedMapOfInteger) mySelectableNodes;
|
||||
Handle(MeshVS_DataSource) myDataSource;
|
||||
MeshVS_MeshSelectionMethod mySelectionMethod;
|
||||
|
||||
|
||||
NCollection_Vector<Handle(MeshVS_DataSource)> myLODDataSources;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _MeshVS_Mesh_HeaderFile
|
||||
|
@@ -717,7 +717,8 @@ void MeshVS_MeshPrsBuilder::AddFaceWirePrs (const TColStd_Array1OfReal&
|
||||
// Function : AddFaceSolidPrs
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer theID,
|
||||
void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Handle(MeshVS_DataSource)& theDataSource,
|
||||
const Standard_Integer theID,
|
||||
const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer theNbNodes,
|
||||
const Standard_Integer theMaxNodes,
|
||||
@@ -727,9 +728,7 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer
|
||||
const Standard_Real theShrinkingCoef,
|
||||
const Standard_Boolean theIsSmoothShading) const
|
||||
{
|
||||
Handle(MeshVS_DataSource) aDataSource = myParentMesh->GetDataSource();
|
||||
|
||||
if (aDataSource.IsNull())
|
||||
if (theDataSource.IsNull())
|
||||
return;
|
||||
|
||||
Standard_Real aCenterX = 0.0;
|
||||
@@ -752,7 +751,7 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer
|
||||
{
|
||||
for (Standard_Integer aNodeIdx = 1; aNodeIdx <= theNbNodes; ++aNodeIdx)
|
||||
{
|
||||
if (!aDataSource->GetNodeNormal (aNodeIdx, theID, aNormalX, aNormalY, aNormalZ))
|
||||
if (!theDataSource->GetNodeNormal (aNodeIdx, theID, aNormalX, aNormalY, aNormalZ))
|
||||
break;
|
||||
|
||||
aVertexNormals.Append (gp_XYZ (aNormalX, aNormalY, aNormalZ));
|
||||
@@ -761,7 +760,7 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer
|
||||
|
||||
if (!theIsSmoothShading || aVertexNormals.Size() != theNbNodes)
|
||||
{
|
||||
aDataSource->GetNormal (theID, theMaxNodes, aNormalX, aNormalY, aNormalZ);
|
||||
theDataSource->GetNormal (theID, theMaxNodes, aNormalX, aNormalY, aNormalZ);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,6 +813,26 @@ void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer
|
||||
}
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : AddFaceSolidPrs
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void MeshVS_MeshPrsBuilder::AddFaceSolidPrs (const Standard_Integer theID,
|
||||
const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer theNbNodes,
|
||||
const Standard_Integer theMaxNodes,
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& theTriangles,
|
||||
const Standard_Boolean theIsShaded,
|
||||
const Standard_Boolean theIsShrinked,
|
||||
const Standard_Real theShrinkingCoef,
|
||||
const Standard_Boolean theIsSmoothShading) const
|
||||
{
|
||||
Handle(MeshVS_DataSource) aDataSource = myParentMesh->GetDataSource();
|
||||
AddFaceSolidPrs (aDataSource, theID, theCoords, theNbNodes, theMaxNodes, theTriangles,
|
||||
theIsShaded, theIsShrinked, theShrinkingCoef, theIsSmoothShading);
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : AddVolumePrs
|
||||
// Purpose :
|
||||
|
@@ -44,64 +44,117 @@ DEFINE_STANDARD_HANDLE(MeshVS_MeshPrsBuilder, MeshVS_PrsBuilder)
|
||||
//! This class provides methods to compute base mesh presentation
|
||||
class MeshVS_MeshPrsBuilder : public MeshVS_PrsBuilder
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates builder with certain display mode flags, data source, ID and priority
|
||||
Standard_EXPORT MeshVS_MeshPrsBuilder(const Handle(MeshVS_Mesh)& Parent, const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_OCCMask, const Handle(MeshVS_DataSource)& DS = 0, const Standard_Integer Id = -1, const MeshVS_BuilderPriority& Priority = MeshVS_BP_Mesh);
|
||||
|
||||
Standard_EXPORT MeshVS_MeshPrsBuilder(const Handle(MeshVS_Mesh)& Parent,
|
||||
const MeshVS_DisplayModeFlags& Flags = MeshVS_DMF_OCCMask,
|
||||
const Handle(MeshVS_DataSource)& DS = 0,
|
||||
const Standard_Integer Id = -1,
|
||||
const MeshVS_BuilderPriority& Priority = MeshVS_BP_Mesh);
|
||||
|
||||
//! Builds base mesh presentation by calling the methods below
|
||||
Standard_EXPORT virtual void Build (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, TColStd_PackedMapOfInteger& IDsToExclude, const Standard_Boolean IsElement, const Standard_Integer DisplayMode) const;
|
||||
|
||||
Standard_EXPORT virtual void Build (const Handle(Prs3d_Presentation)& Prs,
|
||||
const TColStd_PackedMapOfInteger& IDs,
|
||||
TColStd_PackedMapOfInteger& IDsToExclude,
|
||||
const Standard_Boolean IsElement,
|
||||
const Standard_Integer DisplayMode) const;
|
||||
|
||||
//! Builds nodes presentation
|
||||
Standard_EXPORT virtual void BuildNodes (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, TColStd_PackedMapOfInteger& IDsToExclude, const Standard_Integer DisplayMode) const;
|
||||
|
||||
Standard_EXPORT virtual void BuildNodes (const Handle(Prs3d_Presentation)& Prs,
|
||||
const TColStd_PackedMapOfInteger& IDs,
|
||||
TColStd_PackedMapOfInteger& IDsToExclude,
|
||||
const Standard_Integer DisplayMode) const;
|
||||
|
||||
//! Builds elements presentation
|
||||
Standard_EXPORT virtual void BuildElements (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, TColStd_PackedMapOfInteger& IDsToExclude, const Standard_Integer DisplayMode) const;
|
||||
|
||||
Standard_EXPORT virtual void BuildElements (const Handle(Prs3d_Presentation)& Prs,
|
||||
const TColStd_PackedMapOfInteger& IDs,
|
||||
TColStd_PackedMapOfInteger& IDsToExclude,
|
||||
const Standard_Integer DisplayMode) const;
|
||||
|
||||
//! Builds presentation of hilighted entity
|
||||
Standard_EXPORT virtual void BuildHilightPrs (const Handle(Prs3d_Presentation)& Prs, const TColStd_PackedMapOfInteger& IDs, const Standard_Boolean IsElement) const;
|
||||
|
||||
Standard_EXPORT virtual void BuildHilightPrs (const Handle(Prs3d_Presentation)& Prs,
|
||||
const TColStd_PackedMapOfInteger& IDs,
|
||||
const Standard_Boolean IsElement) const;
|
||||
|
||||
//! Add to array polygons or polylines representing volume
|
||||
Standard_EXPORT static void AddVolumePrs (const Handle(MeshVS_HArray1OfSequenceOfInteger)& Topo, const TColStd_Array1OfReal& Nodes, const Standard_Integer NbNodes, const Handle(Graphic3d_ArrayOfPrimitives)& Array, const Standard_Boolean IsReflected, const Standard_Boolean IsShrinked, const Standard_Boolean IsSelect, const Standard_Real ShrinkCoef);
|
||||
|
||||
Standard_EXPORT static void AddVolumePrs (const Handle(MeshVS_HArray1OfSequenceOfInteger)& Topo,
|
||||
const TColStd_Array1OfReal& Nodes,
|
||||
const Standard_Integer NbNodes,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& Array,
|
||||
const Standard_Boolean IsReflected,
|
||||
const Standard_Boolean IsShrinked,
|
||||
const Standard_Boolean IsSelect,
|
||||
const Standard_Real ShrinkCoef);
|
||||
|
||||
//! Calculate how many polygons or polylines are necessary to draw passed topology
|
||||
Standard_EXPORT static void HowManyPrimitives (const Handle(MeshVS_HArray1OfSequenceOfInteger)& Topo, const Standard_Boolean AsPolygons, const Standard_Boolean IsSelect, const Standard_Integer NbNodes, Standard_Integer& Vertices, Standard_Integer& Bounds);
|
||||
Standard_EXPORT static void HowManyPrimitives (const Handle(MeshVS_HArray1OfSequenceOfInteger)& Topo,
|
||||
const Standard_Boolean AsPolygons,
|
||||
const Standard_Boolean IsSelect,
|
||||
const Standard_Integer NbNodes,
|
||||
Standard_Integer& Vertices,
|
||||
Standard_Integer& Bounds);
|
||||
|
||||
//! Add to array of polylines some lines representing link
|
||||
Standard_EXPORT void AddLinkPrs (const TColStd_Array1OfReal& theCoords,
|
||||
const Handle(Graphic3d_ArrayOfSegments)& theLines,
|
||||
const Standard_Boolean IsShrinked,
|
||||
const Standard_Real ShrinkCoef) const;
|
||||
|
||||
//! Add to array of segments representing face's wire
|
||||
Standard_EXPORT void AddFaceWirePrs (const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer theNbNodes,
|
||||
const Handle(Graphic3d_ArrayOfSegments)& theLines,
|
||||
const Standard_Boolean theIsShrinked,
|
||||
const Standard_Real theShrinkingCoef) const;
|
||||
|
||||
//! Add to array of polygons a polygon representing face
|
||||
Standard_EXPORT void AddFaceSolidPrs (const Handle(MeshVS_DataSource)& theDataSource,
|
||||
const Standard_Integer ID,
|
||||
const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer theNbNodes,
|
||||
const Standard_Integer theMaxNodes,
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& theTriangles,
|
||||
const Standard_Boolean theIsReflected,
|
||||
const Standard_Boolean theIsShrinked,
|
||||
const Standard_Real theShrinkCoef,
|
||||
const Standard_Boolean theIsMeshSmoothShading) const;
|
||||
|
||||
DEFINE_STANDARD_RTTI(MeshVS_MeshPrsBuilder,MeshVS_PrsBuilder)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Add to array of polylines some lines representing link
|
||||
Standard_EXPORT void AddLinkPrs (const TColStd_Array1OfReal& theCoords, const Handle(Graphic3d_ArrayOfSegments)& theLines, const Standard_Boolean IsShrinked, const Standard_Real ShrinkCoef) const;
|
||||
|
||||
//! Add to array of segments representing face's wire
|
||||
Standard_EXPORT void AddFaceWirePrs (const TColStd_Array1OfReal& theCoords, const Standard_Integer theNbNodes, const Handle(Graphic3d_ArrayOfSegments)& theLines, const Standard_Boolean theIsShrinked, const Standard_Real theShrinkingCoef) const;
|
||||
|
||||
//! Add to array of polygons a polygon representing face
|
||||
Standard_EXPORT void AddFaceSolidPrs (const Standard_Integer ID, const TColStd_Array1OfReal& theCoords, const Standard_Integer theNbNodes, const Standard_Integer theMaxNodes, const Handle(Graphic3d_ArrayOfTriangles)& theTriangles, const Standard_Boolean theIsReflected, const Standard_Boolean theIsShrinked, const Standard_Real theShrinkCoef, const Standard_Boolean theIsMeshSmoothShading) const;
|
||||
|
||||
Standard_EXPORT void AddFaceSolidPrs (const Standard_Integer ID,
|
||||
const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer theNbNodes,
|
||||
const Standard_Integer theMaxNodes,
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& theTriangles,
|
||||
const Standard_Boolean theIsReflected,
|
||||
const Standard_Boolean theIsShrinked,
|
||||
const Standard_Real theShrinkCoef,
|
||||
const Standard_Boolean theIsMeshSmoothShading) const;
|
||||
|
||||
//! Draw array of polygons and polylines in the certain order according to transparency
|
||||
Standard_EXPORT void DrawArrays (const Handle(Prs3d_Presentation)& Prs, const Handle(Graphic3d_ArrayOfPrimitives)& thePolygons, const Handle(Graphic3d_ArrayOfPrimitives)& theLines, const Handle(Graphic3d_ArrayOfPrimitives)& theLinkLines, const Handle(Graphic3d_ArrayOfPrimitives)& theVolumesInShad, const Standard_Boolean IsPolygonsEdgesOff, const Standard_Boolean IsSelected, const Handle(Graphic3d_AspectFillArea3d)& theFillAsp, const Handle(Graphic3d_AspectLine3d)& theLineAsp) const;
|
||||
|
||||
Standard_EXPORT void DrawArrays (const Handle(Prs3d_Presentation)& Prs,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& thePolygons,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theLinkLines,
|
||||
const Handle(Graphic3d_ArrayOfPrimitives)& theVolumesInShad,
|
||||
const Standard_Boolean IsPolygonsEdgesOff,
|
||||
const Standard_Boolean IsSelected,
|
||||
const Handle(Graphic3d_AspectFillArea3d)& theFillAsp,
|
||||
const Handle(Graphic3d_AspectLine3d)& theLineAsp) const;
|
||||
|
||||
//! Default calculation of center of face or link. This method if useful for shrink mode presentation
|
||||
//! theCoords is array of nodes co-ordinates in the strict order X1, Y1, Z1, X2...
|
||||
//! NbNodes is number of nodes an element consist of
|
||||
//! xG, yG, zG are co-ordinates of center whose will be returned
|
||||
Standard_EXPORT static void CalculateCenter (const TColStd_Array1OfReal& theCoords, const Standard_Integer NbNodes, Standard_Real& xG, Standard_Real& yG, Standard_Real& zG);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT static void CalculateCenter (const TColStd_Array1OfReal& theCoords,
|
||||
const Standard_Integer NbNodes,
|
||||
Standard_Real& xG,
|
||||
Standard_Real& yG,
|
||||
Standard_Real& zG);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -22,10 +22,6 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose : Empty constructor, defaulting to cerr
|
||||
|
@@ -37,8 +37,6 @@ NCollection_WinHeapAllocator::NCollection_WinHeapAllocator
|
||||
ULONG aHeapInfo = 2;
|
||||
HeapSetInformation (myHeapH, HeapCompatibilityInformation,
|
||||
&aHeapInfo, sizeof(aHeapInfo));
|
||||
#else
|
||||
(void )theInitSizeBytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <OSD.hxx>
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#if defined(isfinite)
|
||||
# define finite isfinite
|
||||
@@ -125,10 +125,6 @@ void OSD::MilliSecSleep(const Standard_Integer aDelay)
|
||||
|
||||
Standard_Boolean OSD::IsDivisible(const Standard_Real theDividend,const Standard_Real theDivisor)
|
||||
{
|
||||
#ifdef __QNX__
|
||||
using std::finite;
|
||||
#endif
|
||||
|
||||
if ( theDivisor == 0. || ! finite(theDividend) ) return Standard_False;
|
||||
//
|
||||
// you may divide by infinity
|
||||
|
@@ -57,7 +57,7 @@
|
||||
//=======================================================================
|
||||
void OSD_Chronometer::GetProcessCPU (Standard_Real& UserSeconds, Standard_Real& SystemSeconds)
|
||||
{
|
||||
#if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(__linux__) || defined(linux) || defined(__FreeBSD__) || defined(__ANDROID__)
|
||||
static const long aCLK_TCK = sysconf(_SC_CLK_TCK);
|
||||
#else
|
||||
static const long aCLK_TCK = CLK_TCK;
|
||||
@@ -87,7 +87,7 @@ void OSD_Chronometer::GetThreadCPU (Standard_Real& theUserSeconds,
|
||||
theUserSeconds = Standard_Real(aTaskInfo.user_time.seconds) + 0.000001 * aTaskInfo.user_time.microseconds;
|
||||
theSystemSeconds = Standard_Real(aTaskInfo.system_time.seconds) + 0.000001 * aTaskInfo.system_time.microseconds;
|
||||
}
|
||||
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif (defined(_POSIX_TIMERS) && defined(_POSIX_THREAD_CPUTIME)) || defined(__ANDROID__)
|
||||
// on Linux, only user times are available for threads via clock_gettime()
|
||||
struct timespec t;
|
||||
if (!clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t))
|
||||
|
@@ -21,26 +21,34 @@
|
||||
#include <Standard_ProgramError.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
static OSD_SysType whereAmI()
|
||||
{
|
||||
#if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__) || defined(__QNX__) || defined(__FreeBSD_kernel__)
|
||||
static OSD_SysType whereAmI(){
|
||||
#if defined(__digital__) || defined(__FreeBSD__) || defined(SUNOS) || defined(__APPLE__)
|
||||
return OSD_UnixBSD;
|
||||
}
|
||||
#elif defined(sgi) || defined(IRIX) || defined(__sun) || defined(SOLARIS) || defined(__sco__) || defined(__hpux) || defined(HPUX)
|
||||
return OSD_UnixSystemV;
|
||||
}
|
||||
#elif defined(__osf__) || defined(DECOSF1)
|
||||
return OSD_OSF;
|
||||
}
|
||||
#elif defined(OS2)
|
||||
return OSD_WindowsNT;
|
||||
}
|
||||
#elif defined(_WIN32) || defined(__WIN32__)
|
||||
return OSD_WindowsNT;
|
||||
}
|
||||
#elif defined(__CYGWIN32_) || defined(__MINGW32__)
|
||||
return OSD_WindowsNT;
|
||||
}
|
||||
#elif defined(vax) || defined(__vms)
|
||||
return OSD_VMS;
|
||||
}
|
||||
#elif defined(__linux__) || defined(__linux)
|
||||
return OSD_LinuxREDHAT;
|
||||
}
|
||||
#elif defined(_AIX) || defined(AIX)
|
||||
return OSD_Aix;
|
||||
}
|
||||
#else
|
||||
struct utsname info;
|
||||
uname(&info);
|
||||
@@ -50,8 +58,8 @@ static OSD_SysType whereAmI()
|
||||
cout << info.version << endl;
|
||||
cout << info.machine << endl;
|
||||
return OSD_Default;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(defined(_WIN32) || defined(__WIN32__))
|
||||
|
||||
|
@@ -258,7 +258,7 @@ Standard_Boolean OSD_Thread::Wait (Standard_Address &result) const
|
||||
// OSD_Thread::Wait
|
||||
//=============================================
|
||||
|
||||
Standard_Boolean OSD_Thread::Wait (const Standard_Integer theTimeMs, Standard_Address &result) const
|
||||
Standard_Boolean OSD_Thread::Wait (const Standard_Integer time, Standard_Address &result) const
|
||||
{
|
||||
// check that thread handle is not null
|
||||
result = 0;
|
||||
@@ -268,7 +268,7 @@ Standard_Boolean OSD_Thread::Wait (const Standard_Integer theTimeMs, Standard_Ad
|
||||
#ifdef _WIN32
|
||||
|
||||
// On Windows, wait for the thread handle to be signaled
|
||||
DWORD ret = WaitForSingleObject (myThread, theTimeMs);
|
||||
DWORD ret = WaitForSingleObject ( myThread, time );
|
||||
if (ret == WAIT_OBJECT_0)
|
||||
{
|
||||
DWORD anExitCode;
|
||||
@@ -284,32 +284,11 @@ Standard_Boolean OSD_Thread::Wait (const Standard_Integer theTimeMs, Standard_Ad
|
||||
return Standard_False;
|
||||
|
||||
#else
|
||||
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||
#if __GLIBC_PREREQ(2,4)
|
||||
#define HAS_TIMED_NP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAS_TIMED_NP
|
||||
struct timespec aTimeout;
|
||||
if (clock_gettime (CLOCK_REALTIME, &aTimeout) == -1)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
// On Unix/Linux, join the thread
|
||||
return ! pthread_join ( myThread, &result );
|
||||
|
||||
time_t aSeconds = (theTimeMs / 1000);
|
||||
long aMicroseconds = (theTimeMs - aSeconds * 1000) * 1000;
|
||||
aTimeout.tv_sec += aSeconds;
|
||||
aTimeout.tv_nsec += aMicroseconds * 1000;
|
||||
|
||||
return pthread_timedjoin_np (myThread, &result, &aTimeout) == 0;
|
||||
#else
|
||||
// join the thread without timeout
|
||||
(void )theTimeMs;
|
||||
return pthread_join (myThread, &result) == 0;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//=============================================
|
||||
|
@@ -70,7 +70,7 @@ typedef void (* SIG_PFV) (int);
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#if !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(__ANDROID__)
|
||||
#include <sys/signal.h>
|
||||
#endif
|
||||
|
||||
@@ -115,11 +115,7 @@ static sigfpe_handler_type *GetOldFPE()
|
||||
//==== SIGSEGV is handled by "SegvHandler()"
|
||||
//============================================================================
|
||||
#ifdef SA_SIGINFO
|
||||
#if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
|
||||
static void Handler (const int theSignal, siginfo_t *theSigInfo, const Standard_Address theContext)
|
||||
#else
|
||||
static void Handler (const int theSignal, siginfo_t */*theSigInfo*/, const Standard_Address /*theContext*/)
|
||||
#endif
|
||||
#else
|
||||
static void Handler (const int theSignal)
|
||||
#endif
|
||||
@@ -342,8 +338,6 @@ static void SegvHandler(const int theSignal,
|
||||
Handler(theSignal, ip, theContext);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
(void )theContext;
|
||||
#endif
|
||||
#ifdef linux
|
||||
if (fFltExceptions)
|
||||
|
@@ -111,6 +111,10 @@ OpenGl_GlCore44.hxx
|
||||
OpenGl_LayerList.cxx
|
||||
OpenGl_LayerList.hxx
|
||||
OpenGl_LayerFilter.hxx
|
||||
OpenGl_LOD.hxx
|
||||
OpenGl_LOD.cxx
|
||||
OpenGl_LODManager.hxx
|
||||
OpenGl_LODManager.cxx
|
||||
OpenGl_GraphicDriver.cxx
|
||||
OpenGl_GraphicDriver.hxx
|
||||
OpenGl_IndexBuffer.cxx
|
||||
|
@@ -140,8 +140,7 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
|
||||
myReadBuffer (0),
|
||||
myDrawBuffer (0),
|
||||
myDefaultVao (0),
|
||||
myIsGlDebugCtx (Standard_False),
|
||||
myResolutionRatio (1.0f)
|
||||
myIsGlDebugCtx (Standard_False)
|
||||
{
|
||||
// system-dependent fields
|
||||
#if defined(HAVE_EGL)
|
||||
@@ -773,7 +772,7 @@ void OpenGl_Context::ResetErrors (const bool theToPrintErrors)
|
||||
}
|
||||
|
||||
const TCollection_ExtendedString aMsg = TCollection_ExtendedString ("Unhandled GL error: ") + anErrId;
|
||||
PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 0, GL_DEBUG_SEVERITY_LOW, aMsg);
|
||||
PushMessage (GL_DEBUG_SOURCE_APPLICATION_ARB, GL_DEBUG_TYPE_OTHER_ARB, 0, GL_DEBUG_SEVERITY_LOW, aMsg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2673,7 +2672,7 @@ void OpenGl_Context::SetPointSize (const Standard_ShortReal theSize)
|
||||
{
|
||||
if (!myActiveProgram.IsNull())
|
||||
{
|
||||
myActiveProgram->SetUniform (this, myActiveProgram->GetStateLocation (OpenGl_OCCT_POINT_SIZE), theSize * myResolutionRatio);
|
||||
myActiveProgram->SetUniform (this, myActiveProgram->GetStateLocation (OpenGl_OCCT_POINT_SIZE), theSize);
|
||||
#if !defined(GL_ES_VERSION_2_0)
|
||||
//myContext->core11fwd->glEnable (GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
#endif
|
||||
@@ -2681,7 +2680,7 @@ void OpenGl_Context::SetPointSize (const Standard_ShortReal theSize)
|
||||
#if !defined(GL_ES_VERSION_2_0)
|
||||
//else
|
||||
{
|
||||
core11fwd->glPointSize (theSize * myResolutionRatio);
|
||||
core11fwd->glPointSize (theSize);
|
||||
if (core20fwd != NULL)
|
||||
{
|
||||
//myContext->core11fwd->glDisable (GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
|
@@ -583,13 +583,6 @@ public: //! @name methods to alter or retrieve current state
|
||||
|
||||
Standard_EXPORT void DisableFeatures() const;
|
||||
|
||||
//! Set resolution ratio.
|
||||
//! Note that this method rounds @theRatio to nearest integer.
|
||||
void SetResolutionRatio (const Standard_ShortReal theRatio)
|
||||
{
|
||||
myResolutionRatio = Max (1.0f, std::floor (theRatio + 0.5f));
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! Wrapper to system function to retrieve GL function pointer by name.
|
||||
@@ -702,18 +695,16 @@ private: // context info
|
||||
|
||||
private: //! @name fields tracking current state
|
||||
|
||||
Handle(OpenGl_ShaderProgram) myActiveProgram; //!< currently active GLSL program
|
||||
Handle(OpenGl_Sampler) myTexSampler; //!< currently active sampler object
|
||||
Handle(OpenGl_FrameBuffer) myDefaultFbo; //!< default Frame Buffer Object
|
||||
Standard_Integer myRenderMode; //!< value for active rendering mode
|
||||
Standard_Integer myReadBuffer; //!< current read buffer
|
||||
Standard_Integer myDrawBuffer; //!< current draw buffer
|
||||
unsigned int myDefaultVao; //!< default Vertex Array Object
|
||||
Standard_Boolean myIsGlDebugCtx; //!< debug context initialization state
|
||||
TCollection_AsciiString myVendor; //!< Graphics Driver's vendor
|
||||
TColStd_PackedMapOfInteger myFilters[6]; //!< messages suppressing filter (for sources from GL_DEBUG_SOURCE_API_ARB to GL_DEBUG_SOURCE_OTHER_ARB)
|
||||
Standard_ShortReal myResolutionRatio; //!< scaling factor for parameters like text size
|
||||
//!< to be properly displayed on device (screen / printer)
|
||||
Handle(OpenGl_ShaderProgram) myActiveProgram; //!< currently active GLSL program
|
||||
Handle(OpenGl_Sampler) myTexSampler; //!< currently active sampler object
|
||||
Handle(OpenGl_FrameBuffer) myDefaultFbo; //!< default Frame Buffer Object
|
||||
Standard_Integer myRenderMode; //!< value for active rendering mode
|
||||
Standard_Integer myReadBuffer; //!< current read buffer
|
||||
Standard_Integer myDrawBuffer; //!< current draw buffer
|
||||
unsigned int myDefaultVao; //!< default Vertex Array Object
|
||||
Standard_Boolean myIsGlDebugCtx; //!< debug context initialization state
|
||||
TCollection_AsciiString myVendor; //!< Graphics Driver's vendor
|
||||
TColStd_PackedMapOfInteger myFilters[6]; //!< messages suppressing filter (for sources from GL_DEBUG_SOURCE_API_ARB to GL_DEBUG_SOURCE_OTHER_ARB)
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -66,6 +66,11 @@ void OpenGl_Flipper::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
{
|
||||
// Check if rendering is to be in immediate mode
|
||||
const Handle(OpenGl_Context)& aContext = theWorkspace->GetGlContext();
|
||||
|
||||
#if !defined(GL_ES_VERSION_2_0)
|
||||
GLint aCurrMode = GL_MODELVIEW;
|
||||
glGetIntegerv (GL_MATRIX_MODE, &aCurrMode);
|
||||
|
||||
if (!myIsEnabled)
|
||||
{
|
||||
// restore matrix state
|
||||
@@ -73,6 +78,7 @@ void OpenGl_Flipper::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
|
||||
// Apply since we probably in the middle of something.
|
||||
aContext->ApplyModelViewMatrix();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,4 +140,6 @@ void OpenGl_Flipper::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
// load transformed model-view matrix
|
||||
aContext->WorldViewState.SetCurrent (aMatrixMV);
|
||||
aContext->ApplyWorldViewMatrix();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@@ -42,19 +42,19 @@ namespace
|
||||
}
|
||||
case GL_DEPTH_COMPONENT16:
|
||||
{
|
||||
thePixelFormat = GL_DEPTH_COMPONENT;
|
||||
thePixelFormat = GL_DEPTH;
|
||||
theDataType = GL_UNSIGNED_SHORT;
|
||||
return true;
|
||||
}
|
||||
case GL_DEPTH_COMPONENT24:
|
||||
{
|
||||
thePixelFormat = GL_DEPTH_COMPONENT;
|
||||
thePixelFormat = GL_DEPTH;
|
||||
theDataType = GL_UNSIGNED_INT;
|
||||
return true;
|
||||
}
|
||||
case GL_DEPTH_COMPONENT32F:
|
||||
{
|
||||
thePixelFormat = GL_DEPTH_COMPONENT;
|
||||
thePixelFormat = GL_DEPTH;
|
||||
theDataType = GL_FLOAT;
|
||||
return true;
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@
|
||||
#include <OpenGL/gl.h>
|
||||
#endif
|
||||
#define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
|
||||
#elif defined(HAVE_GLES2) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif defined(HAVE_GLES2) || defined(__ANDROID__)
|
||||
#include <GLES2/gl2.h>
|
||||
//#include <GLES3/gl3.h>
|
||||
#else
|
||||
@@ -109,7 +109,6 @@
|
||||
#define GL_DEPTH24_STENCIL8 0x88F0
|
||||
|
||||
// OpenGL ES 3.0+
|
||||
#define GL_DEPTH_COMPONENT24 0x81A6
|
||||
#define GL_DEPTH_COMPONENT32F 0x8CAC
|
||||
#define GL_DEPTH32F_STENCIL8 0x8CAD
|
||||
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
|
||||
@@ -149,7 +148,7 @@
|
||||
#define GL_TEXTURE_BUFFER_ARB 0x8C2A
|
||||
#endif
|
||||
|
||||
#if defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(__ANDROID__)
|
||||
#define HAVE_EGL
|
||||
#endif
|
||||
|
||||
|
@@ -38,11 +38,11 @@
|
||||
#include <Xw_Window.hxx>
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#include <X11/Xlib.h> // XOpenDisplay()
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
|
||||
const Standard_Boolean theToInitialize)
|
||||
: Graphic3d_GraphicDriver (theDisp),
|
||||
myIsOwnContext (Standard_False),
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
|
||||
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
|
||||
myEglConfig (NULL),
|
||||
@@ -68,7 +68,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
|
||||
myMapOfView (1, NCollection_BaseAllocator::CommonBaseAllocator()),
|
||||
myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator())
|
||||
{
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
if (myDisplayConnection.IsNull())
|
||||
{
|
||||
//Aspect_GraphicDeviceDefinitionError::Raise ("OpenGl_GraphicDriver: cannot connect to X server!");
|
||||
@@ -202,7 +202,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
|
||||
aWindow->GetGlContext()->forcedRelease();
|
||||
}
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
if (myIsOwnContext)
|
||||
{
|
||||
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
|
||||
@@ -237,9 +237,9 @@ void OpenGl_GraphicDriver::ReleaseContext()
|
||||
Standard_Boolean OpenGl_GraphicDriver::InitContext()
|
||||
{
|
||||
ReleaseContext();
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
if (myDisplayConnection.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
@@ -328,7 +328,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitContext()
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
// =======================================================================
|
||||
// function : InitEglContext
|
||||
// purpose :
|
||||
@@ -338,7 +338,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display t
|
||||
void* theEglConfig)
|
||||
{
|
||||
ReleaseContext();
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
#if !defined(_WIN32) && !defined(__ANDROID__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
if (myDisplayConnection.IsNull())
|
||||
{
|
||||
return Standard_False;
|
||||
@@ -751,7 +751,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
||||
#else
|
||||
NSView* TheSpecifiedWindowId = THEWindow->HView();
|
||||
#endif
|
||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif defined(__ANDROID__)
|
||||
int TheSpecifiedWindowId = -1;
|
||||
#else
|
||||
const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
|
||||
@@ -776,7 +776,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
||||
#else
|
||||
NSView* TheWindowIdOfView = theWindow->HView();
|
||||
#endif
|
||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif defined(__ANDROID__)
|
||||
int TheWindowIdOfView = 0;
|
||||
#else
|
||||
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
|
||||
|
@@ -104,7 +104,7 @@ public:
|
||||
//! Perform initialization of default OpenGL context.
|
||||
Standard_EXPORT Standard_Boolean InitContext();
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
//! Initialize default OpenGL context using existing one.
|
||||
//! @param theEglDisplay EGL connection to the Display
|
||||
//! @param theEglContext EGL rendering context
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
//! Could return NULL-handle if no window created by this driver.
|
||||
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
Aspect_Display getRawGlDisplay() const { return myEglDisplay; }
|
||||
Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
|
||||
void* getRawGlConfig() const { return myEglConfig; }
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
protected:
|
||||
|
||||
Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
|
||||
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
|
||||
void* myEglConfig; //!< EGL configuration : EGLConfig
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@@ -13,17 +13,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <OpenGl_LOD.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : StepRepr_FeatureForDatumtargetRelationship
|
||||
//purpose :
|
||||
// function : NewGroup
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
|
||||
StepRepr_FeatureForDatumTargetRelationship::StepRepr_FeatureForDatumTargetRelationship ()
|
||||
Handle(Graphic3d_Group) OpenGl_LOD::NewGroup (const Handle(Graphic3d_Structure)& theParentStruct)
|
||||
{
|
||||
}
|
||||
Handle(OpenGl_Group) aGroup = new OpenGl_Group (theParentStruct);
|
||||
myGroups.Append (aGroup);
|
||||
return aGroup;
|
||||
}
|
38
src/OpenGl/OpenGl_LOD.hxx
Normal file
38
src/OpenGl/OpenGl_LOD.hxx
Normal file
@@ -0,0 +1,38 @@
|
||||
// Created on: 2015-10-29
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _OpenGl_LOD_Header
|
||||
#define _OpenGl_LOD_Header
|
||||
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <OpenGl_AspectFace.hxx>
|
||||
#include <OpenGl_AspectLine.hxx>
|
||||
#include <OpenGl_Structure.hxx>
|
||||
|
||||
class OpenGl_LOD : public Graphic3d_LOD
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT OpenGl_LOD() : Graphic3d_LOD () {};
|
||||
Standard_EXPORT ~OpenGl_LOD() {};
|
||||
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theParentStruct) Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI (OpenGl_LOD, Graphic3d_LOD)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (OpenGl_LOD, Graphic3d_LOD)
|
||||
|
||||
#endif // _OpenGl_LOD_Header
|
75
src/OpenGl/OpenGl_LODManager.cxx
Normal file
75
src/OpenGl/OpenGl_LODManager.cxx
Normal file
@@ -0,0 +1,75 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_LOD.hxx>
|
||||
#include <OpenGl_LOD.hxx>
|
||||
#include <OpenGl_LODManager.hxx>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace
|
||||
{
|
||||
// Comparison operator for sorting LODs
|
||||
class CompareLODS
|
||||
{
|
||||
public:
|
||||
|
||||
CompareLODS (const NCollection_Vector<Handle(Graphic3d_LOD)>& theLODs)
|
||||
: myLODs (theLODs) {}
|
||||
|
||||
Standard_Boolean operator() (const Handle(Graphic3d_LOD)& theLeft, const Handle(Graphic3d_LOD)& theRight) const
|
||||
{
|
||||
return theLeft->GetRange() < theRight->GetRange();
|
||||
}
|
||||
|
||||
private:
|
||||
void operator = (const CompareLODS&);
|
||||
|
||||
private:
|
||||
const NCollection_Vector<Handle(Graphic3d_LOD)>& myLODs;
|
||||
};
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : Creation
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
OpenGl_LODManager::OpenGl_LODManager (const Handle(Graphic3d_Structure)& theParentStructure)
|
||||
: Graphic3d_LODManager (theParentStructure)
|
||||
{
|
||||
Standard_ASSERT_RAISE (!theParentStructure.IsNull(),
|
||||
"Parent structure of LOD manager is null!");
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : AddNewLOD
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
Handle(Graphic3d_LOD) OpenGl_LODManager::AddNewLOD()
|
||||
{
|
||||
Handle(Graphic3d_LOD) aNewLOD = new OpenGl_LOD();
|
||||
myLODs.Append (aNewLOD);
|
||||
sortLODs();
|
||||
return aNewLOD;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : sortLODs
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void OpenGl_LODManager::sortLODs()
|
||||
{
|
||||
std::sort (myLODs.begin(), myLODs.end(), CompareLODS (myLODs));
|
||||
}
|
38
src/OpenGl/OpenGl_LODManager.hxx
Normal file
38
src/OpenGl/OpenGl_LODManager.hxx
Normal file
@@ -0,0 +1,38 @@
|
||||
// Created on: 2015-11-25
|
||||
// Created by: Varvara POSKONINA
|
||||
// Copyright (c) 2005-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _OpenGl_LODManager_Header
|
||||
#define _OpenGl_LODManager_Header
|
||||
|
||||
#include <Graphic3d_LODManager.hxx>
|
||||
|
||||
class OpenGl_LODManager : public Graphic3d_LODManager
|
||||
{
|
||||
public:
|
||||
Standard_EXPORT OpenGl_LODManager (const Handle(Graphic3d_Structure)& theParentStructure);
|
||||
|
||||
Standard_EXPORT virtual ~OpenGl_LODManager() {};
|
||||
|
||||
Standard_EXPORT virtual Handle(Graphic3d_LOD) AddNewLOD() Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTI (OpenGl_LODManager, Graphic3d_LODManager)
|
||||
|
||||
protected:
|
||||
Standard_EXPORT virtual void sortLODs() Standard_OVERRIDE;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE (OpenGl_LODManager, Graphic3d_LODManager)
|
||||
|
||||
#endif // _OpenGl_LODManager_Header
|
@@ -17,6 +17,8 @@
|
||||
#include <OpenGl_Context.hxx>
|
||||
#include <OpenGl_GlCore11.hxx>
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <OpenGl_LOD.hxx>
|
||||
#include <OpenGl_LODManager.hxx>
|
||||
#include <OpenGl_ShaderManager.hxx>
|
||||
#include <OpenGl_ShaderProgram.hxx>
|
||||
#include <OpenGl_StructureShadow.hxx>
|
||||
@@ -26,6 +28,7 @@
|
||||
#include <OpenGl_Workspace.hxx>
|
||||
|
||||
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||
#include <Graphic3d_LODManager.hxx>
|
||||
|
||||
|
||||
//! Auxiliary class for bounding box presentation
|
||||
@@ -431,6 +434,19 @@ Handle(Graphic3d_Group) OpenGl_Structure::NewGroup (const Handle(Graphic3d_Struc
|
||||
return aGroup;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : NewLOD
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(Graphic3d_LOD) OpenGl_Structure::NewLOD (const Handle(Graphic3d_Structure)& theStruct)
|
||||
{
|
||||
if (myLODManager.IsNull())
|
||||
{
|
||||
myLODManager = new OpenGl_LODManager (theStruct);
|
||||
}
|
||||
return myLODManager->AddNewLOD();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : RemoveGroup
|
||||
// purpose :
|
||||
@@ -525,6 +541,9 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
return;
|
||||
}
|
||||
|
||||
if (!myLODManager.IsNull() && myLODManager->GetCurrentLODIdx (theWorkspace->View()->Camera()) == -1)
|
||||
return;
|
||||
|
||||
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
|
||||
|
||||
// Render named status
|
||||
@@ -764,3 +783,38 @@ Handle(Graphic3d_CStructure) OpenGl_Structure::ShadowLink (const Handle(Graphic3
|
||||
{
|
||||
return new OpenGl_StructureShadow (theManager, this);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDetailLevelRange
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void OpenGl_Structure::SetDetailLevelRange (const Standard_Integer theIdOfLOD,
|
||||
const Standard_Real theFrom,
|
||||
const Standard_Real theTo)
|
||||
{
|
||||
Standard_ASSERT_RAISE (theFrom < theTo,
|
||||
"The upper boundary of the interval must be greater than lower one!");
|
||||
|
||||
if (theIdOfLOD < 0 || theIdOfLOD > myLODManager->NbOfDetailLevels())
|
||||
return;
|
||||
|
||||
myLODManager->SetRange (theIdOfLOD, theFrom, theTo);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DrawGroups
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Graphic3d_SequenceOfGroup& OpenGl_Structure::DrawGroups() const
|
||||
{
|
||||
return myLODManager.IsNull() ? myGroups : myLODManager->GetCurrentGroups();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbDetailLevels
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer OpenGl_Structure::NbDetailLevels() const
|
||||
{
|
||||
return myLODManager->NbOfDetailLevels();
|
||||
}
|
||||
|
@@ -35,8 +35,10 @@
|
||||
|
||||
class OpenGl_Structure;
|
||||
class OpenGl_GraphicDriver;
|
||||
class OpenGl_LOD;
|
||||
|
||||
typedef NCollection_List<const OpenGl_Structure* > OpenGl_ListOfStructure;
|
||||
typedef NCollection_Vector<Handle(OpenGl_LOD)> OpenGl_VectorOfLODs;
|
||||
|
||||
//! Implementation of low-level graphic structure.
|
||||
class OpenGl_Structure : public Graphic3d_CStructure
|
||||
@@ -98,16 +100,20 @@ public:
|
||||
//! Create new group within this structure
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Group) NewGroup (const Handle(Graphic3d_Structure)& theStruct);
|
||||
|
||||
//! Create new LOD within this structure
|
||||
Standard_EXPORT virtual Handle(Graphic3d_LOD) NewLOD (const Handle(Graphic3d_Structure)& theStruct) Standard_OVERRIDE;
|
||||
|
||||
//! Remove group from this structure
|
||||
Standard_EXPORT virtual void RemoveGroup (const Handle(Graphic3d_Group)& theGroup);
|
||||
|
||||
Standard_EXPORT virtual void SetDetailLevelRange (const Standard_Integer theIdOfLOD,
|
||||
const Standard_Real theFrom,
|
||||
const Standard_Real theTo) Standard_OVERRIDE;
|
||||
|
||||
public:
|
||||
|
||||
//! @return graphic groups
|
||||
virtual const Graphic3d_SequenceOfGroup& DrawGroups() const
|
||||
{
|
||||
return myGroups;
|
||||
}
|
||||
virtual const Graphic3d_SequenceOfGroup& DrawGroups() const;
|
||||
|
||||
//! Access graphic driver
|
||||
OpenGl_GraphicDriver* GlDriver() const
|
||||
@@ -192,6 +198,8 @@ public:
|
||||
//! Is the structure ray-tracable (contains ray-tracable elements)?
|
||||
Standard_Boolean IsRaytracable() const;
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer NbDetailLevels() const Standard_OVERRIDE;
|
||||
|
||||
protected:
|
||||
|
||||
Standard_EXPORT virtual ~OpenGl_Structure();
|
||||
|
@@ -541,8 +541,6 @@ void OpenGl_Text::setupMatrix (const Handle(OpenGl_PrinterContext)& thePrintCtx,
|
||||
// as it is better for keeping text/3d graphics proportions
|
||||
Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, aTextScaley, aTextScaley, aTextScaley);
|
||||
}
|
||||
#else
|
||||
(void )thePrintCtx;
|
||||
#endif
|
||||
Graphic3d_TransformUtils::Scale<GLdouble> (aModViewMat, myScaleHeight, myScaleHeight, myScaleHeight);
|
||||
}
|
||||
|
@@ -761,11 +761,6 @@ Standard_Boolean OpenGl_View::Print (const Aspect_Handle thePrinterDC,
|
||||
return (Standard_Boolean) isDone;
|
||||
|
||||
#else // not _WIN32
|
||||
(void )thePrinterDC;
|
||||
(void )theToShowBackground;
|
||||
(void )theFileName;
|
||||
(void )thePrintAlgorithm;
|
||||
(void )theScaleFactor;
|
||||
Standard_NotImplemented::Raise ("OpenGl_View::Print is implemented only on Windows");
|
||||
myWorkspace->PrinterContext().Nullify();
|
||||
return Standard_False;
|
||||
|
@@ -281,9 +281,6 @@ void OpenGl_View::Redraw()
|
||||
// fetch OpenGl context state
|
||||
aCtx->FetchState();
|
||||
|
||||
// set resolution ratio
|
||||
aCtx->SetResolutionRatio (RenderingParams().ResolutionRatio());
|
||||
|
||||
OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )myFBO;
|
||||
bool toSwap = aCtx->IsRender()
|
||||
&& !aCtx->caps->buffersNoSwap
|
||||
@@ -1602,10 +1599,10 @@ void OpenGl_View::drawStereoPair (OpenGl_FrameBuffer* theDrawFbo)
|
||||
if (!myOpenGlFBO ->InitLazy (aCtx, aPair[0]->GetVPSizeX(), aPair[0]->GetVPSizeY(), myFboColorFormat, myFboDepthFormat, 0)
|
||||
|| !myOpenGlFBO2->InitLazy (aCtx, aPair[0]->GetVPSizeX(), aPair[0]->GetVPSizeY(), myFboColorFormat, 0, 0))
|
||||
{
|
||||
aCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION,
|
||||
GL_DEBUG_TYPE_ERROR,
|
||||
aCtx->PushMessage (GL_DEBUG_SOURCE_APPLICATION_ARB,
|
||||
GL_DEBUG_TYPE_ERROR_ARB,
|
||||
0,
|
||||
GL_DEBUG_SEVERITY_HIGH,
|
||||
GL_DEBUG_SEVERITY_HIGH_ARB,
|
||||
"Error! Unable to allocate FBO for blitting stereo pair");
|
||||
bindDefaultFbo (theDrawFbo);
|
||||
return;
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
//
|
||||
#elif defined(_WIN32)
|
||||
|
||||
@@ -172,7 +172,7 @@ OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
|
||||
|
||||
Standard_Boolean isCoreProfile = Standard_False;
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
|
||||
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
|
||||
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
|
||||
@@ -615,7 +615,7 @@ OpenGl_Window::~OpenGl_Window()
|
||||
// release "GL" context if it is owned by window
|
||||
// Mesa implementation can fail to destroy GL context if it set for current thread.
|
||||
// It should be safer to unset thread GL context before its destruction.
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
|
||||
{
|
||||
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
|
||||
@@ -677,7 +677,7 @@ Standard_Boolean OpenGl_Window::Activate()
|
||||
// =======================================================================
|
||||
void OpenGl_Window::Resize()
|
||||
{
|
||||
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
|
||||
Display* aDisp = (Display* )myGlContext->myDisplay;
|
||||
if (aDisp == NULL)
|
||||
return;
|
||||
@@ -694,7 +694,7 @@ void OpenGl_Window::Resize()
|
||||
myWidth = aWidth;
|
||||
myHeight = aHeight;
|
||||
|
||||
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__)
|
||||
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
|
||||
XSync (aDisp, False);
|
||||
#endif
|
||||
@@ -711,7 +711,7 @@ void OpenGl_Window::Init()
|
||||
if (!Activate())
|
||||
return;
|
||||
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(HAVE_EGL) || defined(__ANDROID__)
|
||||
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
|
||||
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
|
||||
#elif defined(_WIN32)
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
class Graphic3d_Group;
|
||||
class Graphic3d_LOD;
|
||||
class Prs3d_Presentation;
|
||||
|
||||
|
||||
@@ -44,22 +45,6 @@ public:
|
||||
//! objects in the display.
|
||||
//! A group also contains the attributes whose ranges are limited to the primitives in it.
|
||||
Standard_EXPORT static Handle(Graphic3d_Group) NewGroup (const Handle(Prs3d_Presentation)& Prs3d);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -385,7 +385,6 @@
|
||||
#include <RWStepRepr_RWReprItemAndLengthMeasureWithUnit.hxx>
|
||||
#include <RWStepRepr_RWShapeAspect.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectTransition.hxx>
|
||||
#include <RWStepRepr_RWShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
#include <RWStepRepr_RWSpecifiedHigherUsageOccurrence.hxx>
|
||||
@@ -924,7 +923,6 @@
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectDerivingRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationship.hxx>
|
||||
#include <StepRepr_ShapeRepresentationRelationshipWithTransformation.hxx>
|
||||
@@ -4972,12 +4970,6 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN,
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.Share(anent,iter);
|
||||
}
|
||||
|
||||
default : break;
|
||||
}
|
||||
@@ -6925,9 +6917,6 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid
|
||||
case 701:
|
||||
ent = new StepRepr_ValueRepresentationItem;
|
||||
break;
|
||||
case 702:
|
||||
ent = new StepRepr_FeatureForDatumTargetRelationship;
|
||||
break;
|
||||
|
||||
default:
|
||||
return Standard_False;
|
||||
|
@@ -295,7 +295,6 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <StepBasic_SecurityClassificationLevel.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
@@ -687,7 +686,6 @@ Handle(atype) result = Handle(atype)::DownCast (start)
|
||||
#include <RWStepBasic_RWSecurityClassificationLevel.hxx>
|
||||
#include <RWStepRepr_RWShapeAspect.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectRelationship.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <RWStepRepr_RWShapeAspectTransition.hxx>
|
||||
#include <RWStepShape_RWShapeDefinitionRepresentation.hxx>
|
||||
#include <RWStepShape_RWShapeRepresentation.hxx>
|
||||
@@ -9102,13 +9100,6 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN,
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.ReadStep (data,num,ach,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
ach->AddFail("Type Mismatch when reading - Entity");
|
||||
@@ -13810,13 +13801,6 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN,
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
case 702:
|
||||
{
|
||||
DeclareAndCast(StepRepr_FeatureForDatumTargetRelationship,anent,ent);
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship tool;
|
||||
tool.WriteStep (SW,anent);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
|
@@ -38,8 +38,6 @@ RWStepRepr_RWDescriptiveRepresentationItem.cxx
|
||||
RWStepRepr_RWDescriptiveRepresentationItem.hxx
|
||||
RWStepRepr_RWExtension.cxx
|
||||
RWStepRepr_RWExtension.hxx
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship.cxx
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship.hxx
|
||||
RWStepRepr_RWFunctionallyDefinedTransformation.cxx
|
||||
RWStepRepr_RWFunctionallyDefinedTransformation.hxx
|
||||
RWStepRepr_RWGeometricAlignment.cxx
|
||||
|
@@ -1,112 +0,0 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
|
||||
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_EntityIterator.hxx>
|
||||
#include <RWStepRepr_RWFeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepData_StepReaderData.hxx>
|
||||
#include <StepData_StepWriter.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : RWStepRepr_RWFeatureForDatumTargetRelationship
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
RWStepRepr_RWFeatureForDatumTargetRelationship::RWStepRepr_RWFeatureForDatumTargetRelationship ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ReadStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::ReadStep (const Handle(StepData_StepReaderData)& data,
|
||||
const Standard_Integer num,
|
||||
Handle(Interface_Check)& ach,
|
||||
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
|
||||
{
|
||||
// Check number of parameters
|
||||
if ( ! data->CheckNbParams(num,4,ach,"feature_for_datum_target-relationship") ) return;
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
Handle(TCollection_HAsciiString) aName;
|
||||
data->ReadString (num, 1, "name", ach, aName);
|
||||
|
||||
Handle(TCollection_HAsciiString) aDescription;
|
||||
Standard_Boolean hasDescription = Standard_True;
|
||||
if ( data->IsParamDefined (num,2) ) {
|
||||
data->ReadString (num, 2, "description", ach, aDescription);
|
||||
}
|
||||
else {
|
||||
hasDescription = Standard_False;
|
||||
}
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aRelatingShapeAspect;
|
||||
data->ReadEntity (num, 3, "relating_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatingShapeAspect);
|
||||
|
||||
Handle(StepRepr_ShapeAspect) aRelatedShapeAspect;
|
||||
data->ReadEntity (num, 4, "related_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aRelatedShapeAspect);
|
||||
|
||||
// Initialize entity
|
||||
ent->Init(aName,
|
||||
hasDescription,
|
||||
aDescription,
|
||||
aRelatingShapeAspect,
|
||||
aRelatedShapeAspect);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : WriteStep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::WriteStep (StepData_StepWriter& SW,
|
||||
const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent) const
|
||||
{
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
SW.Send (ent->Name());
|
||||
|
||||
if ( ent->HasDescription() ) {
|
||||
SW.Send (ent->Description());
|
||||
}
|
||||
else SW.SendUndef();
|
||||
|
||||
SW.Send (ent->RelatingShapeAspect());
|
||||
|
||||
SW.Send (ent->RelatedShapeAspect());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Share
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void RWStepRepr_RWFeatureForDatumTargetRelationship::Share (const Handle(StepRepr_FeatureForDatumTargetRelationship) &ent,
|
||||
Interface_EntityIterator& iter) const
|
||||
{
|
||||
|
||||
// Own fields of ShapeAspectRelationship
|
||||
|
||||
iter.AddItem (ent->RelatingShapeAspect());
|
||||
|
||||
iter.AddItem (ent->RelatedShapeAspect());
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
||||
#define _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
class StepData_StepReaderData;
|
||||
class Interface_Check;
|
||||
class StepRepr_FeatureForDatumTargetRelationship;
|
||||
class StepData_StepWriter;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
//! Read & Write tool for FeatureForDatumTargetRelationship
|
||||
class RWStepRepr_RWFeatureForDatumTargetRelationship
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT RWStepRepr_RWFeatureForDatumTargetRelationship();
|
||||
|
||||
//! Reads ShapeAspectRelationship
|
||||
Standard_EXPORT void ReadStep (const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
|
||||
|
||||
//! Writes ShapeAspectRelationship
|
||||
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent) const;
|
||||
|
||||
//! Fills data for graph (shared items)
|
||||
Standard_EXPORT void Share (const Handle(StepRepr_FeatureForDatumTargetRelationship)& ent, Interface_EntityIterator& iter) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _RWStepRepr_RWFeatureForDatumTargetRelationship_HeaderFile
|
File diff suppressed because it is too large
Load Diff
@@ -2079,8 +2079,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
|
||||
for(i=1; i<=DGTLabels.Length(); i++) {
|
||||
TDF_Label DatumL = DGTLabels.Value(i);
|
||||
TDF_LabelSequence ShapeL;
|
||||
TDF_LabelSequence aNullSeq;
|
||||
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL,aNullSeq)) continue;
|
||||
if(!DGTTool->GetRefShapeLabel(DatumL,ShapeL)) continue;
|
||||
// find target shape
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
|
||||
TopLoc_Location Loc;
|
||||
@@ -2161,8 +2160,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTs (const Handle(XSControl_WorkSe
|
||||
for(i=1; i<=DGTLabels.Length(); i++) {
|
||||
TDF_Label DimTolL = DGTLabels.Value(i);
|
||||
TDF_LabelSequence ShapeL;
|
||||
TDF_LabelSequence aNullSeq;
|
||||
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL,aNullSeq)) continue;
|
||||
if(!DGTTool->GetRefShapeLabel(DimTolL,ShapeL)) continue;
|
||||
// find target shape
|
||||
TopoDS_Shape aShape = XCAFDoc_ShapeTool::GetShape(ShapeL.Value(1));
|
||||
TopLoc_Location Loc;
|
||||
|
@@ -12,8 +12,6 @@ STEPConstruct_DataMapOfAsciiStringTransient.hxx
|
||||
STEPConstruct_DataMapOfPointTransient.hxx
|
||||
STEPConstruct_ExternRefs.cxx
|
||||
STEPConstruct_ExternRefs.hxx
|
||||
STEPConstruct_GDTProperty.cxx
|
||||
STEPConstruct_GDTProperty.hxx
|
||||
STEPConstruct_Part.cxx
|
||||
STEPConstruct_Part.hxx
|
||||
STEPConstruct_PointHasher.cxx
|
||||
|
@@ -1,600 +0,0 @@
|
||||
// Created on: 1999-09-09
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 1999-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <STEPConstruct_GDTProperty.hxx>
|
||||
#include <StepRepr_DescriptiveRepresentationItem.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : STEPConstruct_GDTProperty
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
STEPConstruct_GDTProperty::STEPConstruct_GDTProperty ()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getDimModifiers
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void STEPConstruct_GDTProperty::GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
|
||||
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers)
|
||||
{
|
||||
for (Standard_Integer l = 1; l <= theCRI->ItemElement()->Length(); l++)
|
||||
{
|
||||
Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
|
||||
Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(theCRI->ItemElement()->Value(l));
|
||||
if(aDRI.IsNull()) continue;
|
||||
XCAFDimTolObjects_DimensionModif aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
|
||||
const TCollection_AsciiString aModifStr = aDRI->Description()->String();
|
||||
Standard_Boolean aFound = Standard_False;
|
||||
if(aModifStr.IsEqual("controlled radius"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_ControlledRadius;
|
||||
}
|
||||
else if(aModifStr.IsEqual("square"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_Square;
|
||||
}
|
||||
else if(aModifStr.IsEqual("statistical"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_StatisticalTolerance;
|
||||
}
|
||||
else if(aModifStr.IsEqual("continuous feature"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_ContinuousFeature;
|
||||
}
|
||||
else if(aModifStr.IsEqual("two point size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_TwoPointSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("local size defined by a sphere"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_LocalSizeDefinedBySphere;
|
||||
}
|
||||
else if(aModifStr.IsEqual("least squares association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_LeastSquaresAssociationCriterion;
|
||||
}
|
||||
else if(aModifStr.IsEqual("maximum inscribed association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MaximumInscribedAssociation;
|
||||
}
|
||||
else if(aModifStr.IsEqual("minimum circumscribed association criteria"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MinimumCircumscribedAssociation;
|
||||
}
|
||||
else if(aModifStr.IsEqual("circumference diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_CircumferenceDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("area diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AreaDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("volume diameter calculated size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_VolumeDiameter;
|
||||
}
|
||||
else if(aModifStr.IsEqual("maximum rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MaximumSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("minimum rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MinimumSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("average rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AverageSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("median rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MedianSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("mid range rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_MidRangeSize;
|
||||
}
|
||||
else if(aModifStr.IsEqual("range rank order size"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_RangeOfSizes;
|
||||
}
|
||||
else if(aModifStr.IsEqual("any part of the feature"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AnyRestrictedPortionOfFeature;
|
||||
}
|
||||
else if(aModifStr.IsEqual("any cross section"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_AnyCrossSection;
|
||||
}
|
||||
else if(aModifStr.IsEqual("specific fixed cross section"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_SpecificFixedCrossSection;
|
||||
}
|
||||
else if(aModifStr.IsEqual("common tolerance"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_CommonTolerance;
|
||||
}
|
||||
else if(aModifStr.IsEqual("free state condition"))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
aModifier = XCAFDimTolObjects_DimensionModif_FreeStateCondition;
|
||||
}
|
||||
if (aFound)
|
||||
theModifiers.Append(aModifier);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getClassOfTolerance
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void STEPConstruct_GDTProperty::GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
|
||||
Standard_Boolean theHolle,
|
||||
XCAFDimTolObjects_DimensionFormVariance theFV,
|
||||
XCAFDimTolObjects_DimensionGrade theG)
|
||||
{
|
||||
Handle(TCollection_HAsciiString) aFormV = theLAF->FormVariance();
|
||||
Handle(TCollection_HAsciiString) aGrade = theLAF->Grade();
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_None;
|
||||
Standard_Boolean aFound;
|
||||
theHolle = Standard_False;
|
||||
//it is not verified information
|
||||
for(Standard_Integer c = 0; c <= 1; c++)
|
||||
{
|
||||
aFound = Standard_False;
|
||||
Standard_Boolean aCaseSens = Standard_False;
|
||||
if (c == 1)
|
||||
aCaseSens = Standard_True;
|
||||
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("a");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_A;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("b");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("c");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_C;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("cd");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_CD;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("d");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_D;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("e");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_E;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("ef");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_EF;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("f");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_F;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("fg");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_FG;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("g");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_G;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("h");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_H;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("js");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_JS;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("k");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_K;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("m");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_M;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("n");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_N;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("p");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_P;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("r");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_R;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("s");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_S;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("t");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_T;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("u");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_U;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("v");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_V;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("x");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_X;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("y");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_Y;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("b");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_B;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("z");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_Z;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("za");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZA;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("zb");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZB;
|
||||
continue;
|
||||
}
|
||||
aStr = new TCollection_HAsciiString("zc");
|
||||
if(aFormV->IsSameString(aStr, aCaseSens))
|
||||
{
|
||||
aFound = Standard_True;
|
||||
theFV = XCAFDimTolObjects_DimensionFormVariance_ZC;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (c == 1 && !aFound)
|
||||
theHolle = Standard_True;
|
||||
}
|
||||
Handle(TCollection_HAsciiString) aStr = new TCollection_HAsciiString("01");
|
||||
if(aGrade->IsSameString(aStr))
|
||||
{
|
||||
theG = XCAFDimTolObjects_DimensionGrade_IT01;
|
||||
}
|
||||
else
|
||||
{
|
||||
theG = (XCAFDimTolObjects_DimensionGrade)(aGrade->IntegerValue()+1);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : getDimType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDimType(const Handle(TCollection_HAsciiString)& theName,
|
||||
XCAFDimTolObjects_DimensionType& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theName->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_None;
|
||||
if(aName.IsEqual("curve length"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_CurveLength;
|
||||
}
|
||||
else if(aName.IsEqual("diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Diameter;
|
||||
}
|
||||
else if(aName.IsEqual("spherical diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_SphericalDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Radius;
|
||||
}
|
||||
else if(aName.IsEqual("spherical radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_SphericalRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal minor diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal minor radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMinorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal high major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal low major diameter"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorDiameter;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal high major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("toroidal low major radius"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius;
|
||||
}
|
||||
else if(aName.IsEqual("thickness"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Size_Thickness;
|
||||
}
|
||||
else if(aName.IsEqual("curved distance"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_CurvedDistance;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance centre outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance centre inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromCenterToInner;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer centre"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToCenter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance outer inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromOuterToInner;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner centre"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToCenter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner outer"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToOuter;
|
||||
}
|
||||
else if(aName.IsEqual("linear distance inner inner"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner;
|
||||
}
|
||||
|
||||
if(theType != XCAFDimTolObjects_DimensionType_Location_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DatumTargetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DatumTargetType& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
if(aName.IsEqual("area"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Area;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("line"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Line;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("circle"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Circle;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("rectangle"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Rectangle;
|
||||
return Standard_True;
|
||||
}
|
||||
else if(aName.IsEqual("point"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DatumTargetType_Point;
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetDimQualifierType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DimensionQualifier& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_None;
|
||||
if(aName.IsEqual("maximum"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Max;
|
||||
}
|
||||
else if(aName.IsEqual("minimum"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Min;
|
||||
}
|
||||
else if(aName.IsEqual("average"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_DimensionQualifier_Avg;
|
||||
}
|
||||
if(theType != XCAFDimTolObjects_DimensionQualifier_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTolValueType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean STEPConstruct_GDTProperty::GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_GeomToleranceTypeValue& theType)
|
||||
{
|
||||
TCollection_AsciiString aName = theDescription->String();
|
||||
aName.LowerCase();
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_None;
|
||||
if(aName.IsEqual("cylindrical or circular"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_Diameter;
|
||||
}
|
||||
else if(aName.IsEqual("spherical"))
|
||||
{
|
||||
theType = XCAFDimTolObjects_GeomToleranceTypeValue_SphericalDiameter;
|
||||
}
|
||||
if(theType != XCAFDimTolObjects_GeomToleranceTypeValue_None)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
// Created on: 1999-09-08
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _STEPConstruct_GDTProperty_HeaderFile
|
||||
#define _STEPConstruct_GDTProperty_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <STEPConstruct_Tool.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <StepRepr_CompoundRepresentationItem.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
|
||||
#include <StepShape_LimitsAndFits.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionFormVariance.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionGrade.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionType.hxx>
|
||||
#include <XCAFDimTolObjects_DatumTargetType.hxx>
|
||||
#include <XCAFDimTolObjects_DimensionQualifier.hxx>
|
||||
#include <XCAFDimTolObjects_GeomToleranceTypeValue.hxx>
|
||||
|
||||
//! This class provides tools for access (read)
|
||||
//! the GDT properties.
|
||||
class STEPConstruct_GDTProperty
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT STEPConstruct_GDTProperty();
|
||||
Standard_EXPORT static void GetDimModifiers(const Handle(StepRepr_CompoundRepresentationItem)& theCRI,
|
||||
XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
|
||||
|
||||
Standard_EXPORT static void GetDimClassOfTolerance(const Handle(StepShape_LimitsAndFits)& theLAF,
|
||||
Standard_Boolean theHolle,
|
||||
XCAFDimTolObjects_DimensionFormVariance theFV,
|
||||
XCAFDimTolObjects_DimensionGrade theG);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDimType(const Handle(TCollection_HAsciiString)& theName,
|
||||
XCAFDimTolObjects_DimensionType& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDatumTargetType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DatumTargetType& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetDimQualifierType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_DimensionQualifier& theType);
|
||||
|
||||
Standard_EXPORT static Standard_Boolean GetTolValueType(const Handle(TCollection_HAsciiString)& theDescription,
|
||||
XCAFDimTolObjects_GeomToleranceTypeValue& theType);
|
||||
|
||||
};
|
||||
|
||||
#endif // _STEPConstruct_GDTProperty_HeaderFile
|
@@ -27,7 +27,7 @@
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(__ANDROID__) || defined(__QNX__)
|
||||
#if defined(_MSC_VER) || defined(__ANDROID__)
|
||||
#include <malloc.h>
|
||||
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
|
||||
#include <mm_malloc.h>
|
||||
@@ -264,7 +264,7 @@ Standard_Address Standard::AllocateAligned (const Standard_Size theSize,
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
return _aligned_malloc (theSize, theAlign);
|
||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif defined(__ANDROID__)
|
||||
return memalign (theAlign, theSize);
|
||||
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
|
||||
return _mm_malloc (theSize, theAlign);
|
||||
@@ -287,7 +287,7 @@ void Standard::FreeAligned (Standard_Address thePtrAligned)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
_aligned_free (thePtrAligned);
|
||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
||||
#elif defined(__ANDROID__)
|
||||
free (thePtrAligned);
|
||||
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 1)
|
||||
_mm_free (thePtrAligned);
|
||||
|
@@ -80,7 +80,7 @@ Standard_Integer HashCodes (const Standard_CString Value,
|
||||
// glibc version for android platform use locale-independent implementation of
|
||||
// strtod, strtol, strtoll functions. For other system with locale-depended
|
||||
// implementations problems may appear if "C" locale is not set explicitly.
|
||||
#if !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#ifndef __ANDROID__
|
||||
#error System does not support xlocale. Import/export could be broken if C locale did not specified by application.
|
||||
#endif
|
||||
#define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr)
|
||||
|
@@ -18,7 +18,6 @@
|
||||
#include <Standard_Assert.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
|
@@ -24,8 +24,6 @@
|
||||
#include <Standard_Mutex.hxx>
|
||||
#include <Standard_OStream.hxx>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
//=============================================
|
||||
// Standard_Mutex::Standard_Mutex
|
||||
//=============================================
|
||||
|
@@ -20,11 +20,11 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_ErrorHandlerCallback.hxx>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if (defined(_WIN32) || defined(__WIN32__))
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
///#include <sys/errno.h>
|
||||
#include <sys/errno.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
@@ -239,12 +239,8 @@ Standard_Real ATanh(const Standard_Real Value)
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Illegal agument in ATanh" << endl ;
|
||||
#endif
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
return std::atanh(Value);
|
||||
#else
|
||||
return atanh(Value);
|
||||
#endif
|
||||
}
|
||||
return atanh(Value);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -257,12 +253,8 @@ Standard_Real ACosh (const Standard_Real Value)
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Illegal agument in ACosh" << endl ;
|
||||
#endif
|
||||
}
|
||||
#if __cplusplus >= 201103L
|
||||
return std::acosh(Value);
|
||||
#else
|
||||
return acosh(Value);
|
||||
#endif
|
||||
}
|
||||
return acosh(Value);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
@@ -15,8 +15,8 @@
|
||||
#ifndef _Standard_Real_HeaderFile
|
||||
#define _Standard_Real_HeaderFile
|
||||
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <Standard_values.h>
|
||||
#include <Standard_math.hxx>
|
||||
#include <Standard_TypeDef.hxx>
|
||||
@@ -295,11 +295,7 @@ inline Standard_Real Sinh(const Standard_Real Value)
|
||||
// ASinh : Returns the hyperbolic arc sine of a real
|
||||
//-------------------------------------------------------------------
|
||||
inline Standard_Real ASinh(const Standard_Real Value)
|
||||
#if __cplusplus >= 201103L
|
||||
{ return std::asinh(Value); }
|
||||
#else
|
||||
{ return asinh(Value); }
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Square : Returns a real to the power 2
|
||||
|
@@ -15,8 +15,8 @@
|
||||
#ifndef _Standard_ShortReal_HeaderFile
|
||||
#define _Standard_ShortReal_HeaderFile
|
||||
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <Standard_values.h>
|
||||
#include <Standard_TypeDef.hxx>
|
||||
|
@@ -21,8 +21,6 @@
|
||||
// - IsEqual
|
||||
// ===============================================
|
||||
|
||||
#ifndef __QNX__ // same as Standard_Size
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// IsEqual : Returns Standard_True if two time values are equal
|
||||
// ------------------------------------------------------------------
|
||||
@@ -33,5 +31,3 @@ inline Standard_Boolean IsEqual (const Standard_Time theOne,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -288,7 +288,6 @@ static Standard_CString schemaAP203 = "CONFIG_CONTROL_DESIGN";
|
||||
#include <StepBasic_SecurityClassificationLevel.hxx>
|
||||
#include <StepRepr_ShapeAspect.hxx>
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
#include <StepRepr_FeatureForDatumTargetRelationship.hxx>
|
||||
#include <StepRepr_ShapeAspectTransition.hxx>
|
||||
#include <StepShape_ShapeDefinitionRepresentation.hxx>
|
||||
#include <StepShape_ShapeRepresentation.hxx>
|
||||
@@ -1412,7 +1411,6 @@ StepAP214_Protocol::StepAP214_Protocol ()
|
||||
types.Bind (STANDARD_TYPE(StepRepr_CompShAspAndDatumFeatAndShAsp), 699);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_IntegerRepresentationItem), 700);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_ValueRepresentationItem), 701);
|
||||
types.Bind (STANDARD_TYPE(StepRepr_FeatureForDatumTargetRelationship), 702);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -48,8 +48,6 @@ StepRepr_Extension.cxx
|
||||
StepRepr_Extension.hxx
|
||||
StepRepr_ExternallyDefinedRepresentation.cxx
|
||||
StepRepr_ExternallyDefinedRepresentation.hxx
|
||||
StepRepr_FeatureForDatumTargetRelationship.cxx
|
||||
StepRepr_FeatureForDatumTargetRelationship.hxx
|
||||
StepRepr_FunctionallyDefinedTransformation.cxx
|
||||
StepRepr_FunctionallyDefinedTransformation.hxx
|
||||
StepRepr_GeometricAlignment.cxx
|
||||
|
@@ -1,59 +0,0 @@
|
||||
// Created on: 2000-04-18
|
||||
// Created by: Andrey BETENEV
|
||||
// Copyright (c) 2000-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
||||
#define _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepRepr_ShapeAspectRelationship.hxx>
|
||||
|
||||
|
||||
class StepRepr_FeatureForDatumTargetRelationship;
|
||||
DEFINE_STANDARD_HANDLE(StepRepr_FeatureForDatumTargetRelationship, StepRepr_ShapeAspectRelationship)
|
||||
|
||||
//! Representation of STEP entity DimensionalLocation
|
||||
class StepRepr_FeatureForDatumTargetRelationship : public StepRepr_ShapeAspectRelationship
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Empty constructor
|
||||
Standard_EXPORT StepRepr_FeatureForDatumTargetRelationship();
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(StepRepr_FeatureForDatumTargetRelationship,StepRepr_ShapeAspectRelationship)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StepRepr_FeatureForDatumtargetRelationship_HeaderFile
|
@@ -15,7 +15,6 @@
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <StepShape_PrecisionQualifier.hxx>
|
||||
#include <StepShape_TypeQualifier.hxx>
|
||||
#include <StepShape_ValueFormatTypeQualifier.hxx>
|
||||
#include <StepShape_ValueQualifier.hxx>
|
||||
|
||||
StepShape_ValueQualifier::StepShape_ValueQualifier () { }
|
||||
@@ -34,6 +33,3 @@ Handle(StepShape_PrecisionQualifier) StepShape_ValueQualifier::PrecisionQualifi
|
||||
|
||||
Handle(StepShape_TypeQualifier) StepShape_ValueQualifier::TypeQualifier () const
|
||||
{ return Handle(StepShape_TypeQualifier)::DownCast(Value()); }
|
||||
|
||||
Handle(StepShape_ValueFormatTypeQualifier) StepShape_ValueQualifier::ValueFormatTypeQualifier () const
|
||||
{ return Handle(StepShape_ValueFormatTypeQualifier)::DownCast(Value()); }
|
@@ -25,7 +25,6 @@
|
||||
class Standard_Transient;
|
||||
class StepShape_PrecisionQualifier;
|
||||
class StepShape_TypeQualifier;
|
||||
class StepShape_ValueFormatTypeQualifier;
|
||||
|
||||
|
||||
//! Added for Dimensional Tolerances
|
||||
@@ -50,9 +49,6 @@ public:
|
||||
//! Returns Value as TypeQualifier
|
||||
Standard_EXPORT Handle(StepShape_TypeQualifier) TypeQualifier() const;
|
||||
|
||||
//! Returns Value as ValueFormatTypeQualifier
|
||||
Standard_EXPORT Handle(StepShape_ValueFormatTypeQualifier) ValueFormatTypeQualifier() const;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -4,3 +4,4 @@ TKService
|
||||
TKernel
|
||||
TKG3d
|
||||
TKG2d
|
||||
TKSTL
|
||||
|
@@ -25,7 +25,7 @@ if (WIN32)
|
||||
list( APPEND USED_LIBS gdi32.lib )
|
||||
list( APPEND USED_LIBS user32.lib )
|
||||
list( APPEND USED_LIBS kernel32.lib )
|
||||
elseif (NOT APPLE AND NOT ANDROID AND NOT QNX)
|
||||
elseif (NOT APPLE)
|
||||
list( APPEND USED_LIBS pthread )
|
||||
list( APPEND USED_LIBS rt )
|
||||
endif()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user