mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Compare commits
1 Commits
CR0_720_IS
...
CR23497
Author | SHA1 | Date | |
---|---|---|---|
|
4ab551c000 |
@@ -365,9 +365,6 @@ if (WIN32)
|
||||
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
|
||||
endif()
|
||||
|
||||
set (USE_QT_TOOLS OFF CACHE BOOL "${USE_QT_TOOLS_DESCR}")
|
||||
set (USE_QT4 ON CACHE BOOL "${USE_QT4}")
|
||||
|
||||
# Enable/Disable the floating point exceptions (FPE) during runtime.
|
||||
if (NOT BUILD_ENABLE_FPE_SIGNAL_HANDLER)
|
||||
set (BUILD_ENABLE_FPE_SIGNAL_HANDLER OFF CACHE BOOL "${BUILD_ENABLE_FPE_SIGNAL_HANDLER_DESCR}" FORCE)
|
||||
@@ -694,7 +691,7 @@ if (3RDPARTY_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
# include <cmake binary folder>/inc
|
||||
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE})
|
||||
include_directories (${CMAKE_BINARY_DIR}/inc)
|
||||
|
||||
if (3RDPARTY_LIBRARY_DIRS AND BUILD_SHARED_LIBS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
|
||||
@@ -735,7 +732,7 @@ string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...")
|
||||
|
||||
# collect all the headers to <binary dir>/inc folder
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CMAKE_SOURCE_DIR}/src" "${INSTALL_DIR_INCLUDE}")
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting")
|
||||
@@ -752,33 +749,6 @@ else()
|
||||
set (SCRIPT_EXT sh)
|
||||
endif()
|
||||
|
||||
# OCCT tools
|
||||
# include the patched or original list of tools
|
||||
# list <TOOLNAME>_TOOLKITS is created foreach tool and contains its toolkits
|
||||
# list <OCCT_TOOLS> will contain all tools
|
||||
if (NOT USE_QT_TOOLS)
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_QT")
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TQTMALLOC")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_QT")
|
||||
else()
|
||||
OCCT_TOOLS_AND_TOOLKITS (OCCT_TOOLS)
|
||||
foreach (OCCT_TOOL ${OCCT_TOOLS})
|
||||
list (APPEND BUILD_TOOL_TOOLKITS ${${OCCT_TOOL}_TOOL_TOOLKITS})
|
||||
endforeach()
|
||||
|
||||
# collect all the headers to <binary dir>/inc folder
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT tool header files into ${CMAKE_BINARY_DIR}/tools/inc ...")
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}" "${BUILD_TOOL_TOOLKITS}" "${CMAKE_SOURCE_DIR}/tools" "tools")
|
||||
include_directories (${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/tools)
|
||||
|
||||
|
||||
# check qt 3rdparty path
|
||||
add_definitions (-DHAVE_QT)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5")
|
||||
message (STATUS "Info: Qt is used by OCCT")
|
||||
endif()
|
||||
|
||||
# OCCT samples
|
||||
# get absolute path from INSTALL_DIR
|
||||
set (INSTALL_DIR_ABSOLUTE "${INSTALL_DIR}")
|
||||
@@ -921,14 +891,8 @@ if (MSVC AND 3RDPARTY_DLL_DIRS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# include patched toolkit projects or original ones
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
foreach (BUILD_TOOL_TOOLKIT ${BUILD_TOOL_TOOLKITS})
|
||||
OCCT_ADD_SUBDIRECTORY ("tools/${BUILD_TOOL_TOOLKIT}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) OCCT toolkits processed")
|
||||
|
||||
# samples do not support patch usage
|
||||
if (BUILD_MODULE_MfcSamples)
|
||||
set (OCCT_ROOT ${CMAKE_SOURCE_DIR})
|
||||
@@ -955,22 +919,6 @@ if (BUILD_MODULE_UwpSample)
|
||||
add_subdirectory(samples/xaml)
|
||||
endif()
|
||||
|
||||
if (BUILD_TOOL_TOOLKITS)
|
||||
# copy tinspector script to install script folder
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/dfbrowser.${SCRIPT_EXT}")
|
||||
install (FILES "${BUILD_PATCH}/adm/templates/dfbrowser.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
else()
|
||||
install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/dfbrowser.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SCRIPT}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE)
|
||||
endif()
|
||||
|
||||
set (BUILD_SAMPLE_TOOLKITS TInspectorEXE)
|
||||
foreach (BUILD_SAMPLE_TOOL_TOOLKIT ${BUILD_SAMPLE_TOOLKITS})
|
||||
OCCT_ADD_SUBDIRECTORY ("samples/tools/${BUILD_SAMPLE_TOOL_TOOLKIT}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# Prepare variables for configuration of OpenCASCADE cmake config file
|
||||
set (OCCT_MODULES_ENABLED)
|
||||
set (OCCT_LIBRARIES)
|
||||
|
@@ -1,4 +0,0 @@
|
||||
TModelingData TKShapeView
|
||||
TVisualization TKView TKVInspector
|
||||
TApplicationFramework TKTreeModel TKTInspectorAPI TKDFBrowser
|
||||
TTool TKTInspector TKToolsDraw
|
@@ -139,17 +139,6 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
|
||||
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
if ("${3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX}-NOTFOUND")
|
||||
# find directory recursive
|
||||
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} "${${PRODUCT_NAME}_PATH_SUFFIXES}" SUBDIR_NAME)
|
||||
if (NOT "${SUBDIR_NAME}" STREQUAL "")
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
|
||||
PATHS "${SUBDIR_NAME}"
|
||||
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_LIBRARY_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME}
|
||||
PATH_SUFFIXES ${${PRODUCT_NAME}_PATH_SUFFIXES}
|
||||
@@ -186,16 +175,6 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
|
||||
PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}"
|
||||
PATH_SUFFIXES bin win${COMPILER_BITNESS}/${COMPILER}/bin
|
||||
NO_DEFAULT_PATH)
|
||||
if (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX}-NOTFOUND")
|
||||
# find directory recursive
|
||||
FIND_SUBDIRECTORY (${3RDPARTY_${PRODUCT_NAME}_DIR} bin SUBDIR_NAME)
|
||||
if (NOT "${SUBDIR_NAME}" STREQUAL "")
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME_SUFFIX}
|
||||
PATHS "${SUBDIR_NAME}"
|
||||
PATH_SUFFIXES bin
|
||||
NO_DEFAULT_PATH)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
find_library (3RDPARTY_${PRODUCT_NAME}_DLL_${LIBRARY_NAME_SUFFIX} NAMES ${LIBRARY_NAME} PATH_SUFFIXES bin)
|
||||
endif()
|
||||
@@ -227,7 +206,6 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
|
||||
string (REPLACE "." "" LIBRARY_NAME_SUFFIX "${LIBRARY_NAME}")
|
||||
if (WIN32)
|
||||
set (3RDPARTY_${PRODUCT_NAME}_DLL_DIRS "${3RDPARTY_${PRODUCT_NAME}_DLL_DIR_${LIBRARY_NAME_SUFFIX}};${3RDPARTY_${PRODUCT_NAME}_DLL_DIRS}")
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}")
|
||||
else()
|
||||
set (3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS "${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIR_${LIBRARY_NAME_SUFFIX}}:${3RDPARTY_${PRODUCT_NAME}_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
@@ -106,34 +106,6 @@ function (SUBDIRECTORY_NAMES MAIN_DIRECTORY RESULT)
|
||||
set (${RESULT} ${LOCAL_RESULT} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (FIND_SUBDIRECTORY ROOT_DIRECTORY DIRECTORY_SUFFIX SUBDIRECTORY_NAME)
|
||||
#message("Trying to find directory with suffix ${DIRECTORY_SUFFIX} in ${ROOT_DIRECTORY}")
|
||||
SUBDIRECTORY_NAMES ("${ROOT_DIRECTORY}" SUBDIR_NAME_LIST)
|
||||
#message("Subdirectories: ${SUBDIR_NAME_LIST}")
|
||||
|
||||
#set(${SUBDIRECTORY_NAME} "${SUBDIR_NAME_LIST}" PARENT_SCOPE)
|
||||
|
||||
foreach (SUBDIR_NAME ${SUBDIR_NAME_LIST})
|
||||
#message("Subdir: ${SUBDIR_NAME}, ${DIRECTORY_SUFFIX}")
|
||||
# REGEX failed if the directory name contains '++' combination, so we replace it
|
||||
string(REPLACE "++" "\\+\\+" SUBDIR_NAME_ESCAPED ${SUBDIR_NAME})
|
||||
string (REGEX MATCH "${SUBDIR_NAME_ESCAPED}" DOES_PATH_CONTAIN "${DIRECTORY_SUFFIX}")
|
||||
if (DOES_PATH_CONTAIN)
|
||||
set(${SUBDIRECTORY_NAME} "${ROOT_DIRECTORY}/${SUBDIR_NAME}" PARENT_SCOPE)
|
||||
#message("Subdirectory is found: ${SUBDIRECTORY_NAME}")
|
||||
BREAK()
|
||||
else()
|
||||
#message("Check directory: ${ROOT_DIRECTORY}/${SUBDIR_NAME}")
|
||||
FIND_SUBDIRECTORY ("${ROOT_DIRECTORY}/${SUBDIR_NAME}" "${DIRECTORY_SUFFIX}" SUBDIR_REC_NAME)
|
||||
if (NOT "${SUBDIR_REC_NAME}" STREQUAL "")
|
||||
set(${SUBDIRECTORY_NAME} "${SUBDIR_REC_NAME}" PARENT_SCOPE)
|
||||
#message("Subdirectory is found: ${SUBDIRECTORY_NAME}")
|
||||
BREAK()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
|
||||
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/${RELATIVE_PATH}")
|
||||
@@ -222,7 +194,7 @@ macro (OCCT_CONFIGURE_AND_INSTALL BEING_CONGIRUGED_FILE BUILD_NAME INSTALL_NAME
|
||||
install(FILES "${OCCT_BINARY_DIR}/${BUILD_NAME}" DESTINATION "${DESTINATION_PATH}" RENAME ${INSTALL_NAME})
|
||||
endmacro()
|
||||
|
||||
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS OCCT_COLLECT_SOURCE_DIR OCCT_INSTALL_DIR_PREFIX)
|
||||
macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOOLKITS)
|
||||
set (OCCT_USED_PACKAGES)
|
||||
|
||||
# consider patched header.in template
|
||||
@@ -238,8 +210,8 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
set (OCCT_TOOLKIT_PACKAGES)
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
|
||||
file (STRINGS "${BUILD_PATCH}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
|
||||
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES")
|
||||
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_USED_TOOLKIT}/PACKAGES" OCCT_TOOLKIT_PACKAGES)
|
||||
endif()
|
||||
|
||||
list (APPEND OCCT_USED_PACKAGES ${OCCT_TOOLKIT_PACKAGES})
|
||||
@@ -257,10 +229,10 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${BUILD_PATCH}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
|
||||
elseif (EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
|
||||
elseif (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES" OCCT_ALL_FILE_NAMES)
|
||||
else()
|
||||
message (WARNING "FILES has not been found in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}")
|
||||
message (WARNING "FILES has not been found in ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
@@ -268,13 +240,13 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
math (EXPR ALL_FILES_NB "${ALL_FILES_NB} - 1" )
|
||||
|
||||
# emit warnings if there is unprocessed headers
|
||||
file (GLOB OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/*.*")
|
||||
file (GLOB OCCT_ALL_FILES_IN_DIR "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/*.*")
|
||||
file (GLOB OCCT_ALL_FILES_IN_PATCH_DIR "${BUILD_PATCH}/src/${OCCT_PACKAGE}/*.*")
|
||||
|
||||
# use patched header files
|
||||
foreach (OCCT_FILE_IN_PATCH_DIR ${OCCT_ALL_FILES_IN_PATCH_DIR})
|
||||
get_filename_component (OCCT_FILE_IN_PATCH_DIR_NAME ${OCCT_FILE_IN_PATCH_DIR} NAME)
|
||||
list (REMOVE_ITEM OCCT_ALL_FILES_IN_DIR "${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/${OCCT_FILE_IN_PATCH_DIR_NAME}")
|
||||
list (REMOVE_ITEM OCCT_ALL_FILES_IN_DIR "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/${OCCT_FILE_IN_PATCH_DIR_NAME}")
|
||||
list (APPEND OCCT_ALL_FILES_IN_DIR "${OCCT_FILE_IN_PATCH_DIR}")
|
||||
endforeach()
|
||||
|
||||
@@ -315,7 +287,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
endforeach()
|
||||
|
||||
if (NOT OCCT_FILE_IN_DIR_STATUS)
|
||||
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${OCCT_COLLECT_SOURCE_DIR}/${OCCT_PACKAGE}/FILES")
|
||||
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||
|
||||
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
|
||||
if (IS_HEADER_FOUND)
|
||||
@@ -332,10 +304,10 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
|
||||
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
|
||||
set (OCCT_HEADER_FILE_CONTENT "#include \"${OCCT_HEADER_FILE}\"")
|
||||
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/${OCCT_INSTALL_DIR_PREFIX}/${HEADER_FILE_NAME}" @ONLY)
|
||||
configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY)
|
||||
endforeach()
|
||||
|
||||
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${OCCT_INSTALL_DIR_PREFIX}")
|
||||
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR_INCLUDE}")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
|
||||
@@ -347,7 +319,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
|
||||
list (FIND OCCT_USED_PACKAGES ${PACKAGE_NAME} IS_HEADER_FOUND)
|
||||
if (NOT ${IS_HEADER_FOUND} EQUAL -1)
|
||||
if (NOT EXISTS "${OCCT_COLLECT_SOURCE_DIR}/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
|
||||
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/${PACKAGE_NAME}/${HEADER_FILE_NAME}")
|
||||
message (STATUS "Warning. ${OCCT_HEADER_FILE_OLD} is not presented in the sources and will be removed from ${ROOT_TARGET_OCCT_DIR}/inc")
|
||||
file (REMOVE "${OCCT_HEADER_FILE_OLD}")
|
||||
else()
|
||||
@@ -518,24 +490,6 @@ function (OCCT_MODULES_AND_TOOLKITS MODULE_LIST)
|
||||
set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Function to get list of tools and toolkits from file adm/TOOLS.
|
||||
# Creates list <$TOOL_LIST> to store list of TOOLS and
|
||||
# <NAME_OF_TOOL>_TOOLKITS foreach tool to store its toolkits.
|
||||
function (OCCT_TOOLS_AND_TOOLKITS TOOL_LIST)
|
||||
FILE_TO_LIST ("adm/TOOLS" FILE_CONTENT)
|
||||
|
||||
foreach (CONTENT_LINE ${FILE_CONTENT})
|
||||
string (REPLACE " " ";" CONTENT_LINE ${CONTENT_LINE})
|
||||
list (GET CONTENT_LINE 0 TOOL_NAME)
|
||||
list (REMOVE_AT CONTENT_LINE 0)
|
||||
list (APPEND ${TOOL_LIST} ${TOOL_NAME})
|
||||
# (!) REMOVE THE LINE BELOW (implicit variables)
|
||||
set (${TOOL_NAME}_TOOL_TOOLKITS ${CONTENT_LINE} PARENT_SCOPE)
|
||||
endforeach()
|
||||
|
||||
set (${TOOL_LIST} ${${TOOL_LIST}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Returns OCC version string from file Standard_Version.hxx (if available)
|
||||
function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT)
|
||||
|
||||
|
@@ -287,14 +287,6 @@ if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
|
||||
# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0)
|
||||
add_definitions("-DOCCT_NO_DEPRECATED")
|
||||
message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# use Cotire to accelerate build via usage of precompiled headers
|
||||
if (BUILD_USE_PCH)
|
||||
if (WIN32)
|
||||
|
@@ -1,298 +0,0 @@
|
||||
# script for each OCCT tool toolkit
|
||||
|
||||
# Qt dependencies
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/qt5_macro)
|
||||
|
||||
FIND_QT5_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
|
||||
include_directories("${PROJECT_INCLUDES}"
|
||||
"${CMAKE_BINARY_DIR}/${INSTALL_DIR_INCLUDE}/tools")
|
||||
|
||||
FILE_TO_LIST ("tools/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
|
||||
# parce PACKAGES file
|
||||
|
||||
if ("${PROJECT_NAME}" STREQUAL TInspectorEXE)
|
||||
set (USED_PACKAGES ${PROJECT_NAME})
|
||||
set (PACKAGE_PREFIX_DIR "samples/tools")
|
||||
include_directories("${PROJECT_INCLUDES}"
|
||||
"${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${PROJECT_NAME}")
|
||||
else()
|
||||
FILE_TO_LIST ("tools/${PROJECT_NAME}/PACKAGES" USED_PACKAGES)
|
||||
set (PACKAGE_PREFIX_DIR "tools")
|
||||
endif()
|
||||
|
||||
|
||||
SET (RCC_FILES)
|
||||
foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
|
||||
#message("Sources are ${SOURCE_FILES_C}")
|
||||
FIND_AND_WRAP_MOC_FILES("${SOURCE_FILES_C}")
|
||||
|
||||
#message("Dir is ${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${OCCT_PACKAGE}.qrc")
|
||||
FIND_AND_WRAP_RESOURCE_FILE("${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${OCCT_PACKAGE}.qrc" RCC_FILES)
|
||||
endforeach()
|
||||
#message("RCC_FILES for ${PROJECT_NAME} are ${RCC_FILES}")
|
||||
|
||||
set (PRECOMPILED_DEFS)
|
||||
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
|
||||
endif()
|
||||
|
||||
# Get all used packages from toolkit
|
||||
foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
|
||||
ADD_DEFINITIONS(-D${OCCT_PACKAGE}_EXPORTS)
|
||||
|
||||
# TKService contains platform-dependent packages: Xw and WNT
|
||||
if ((WIN32 AND "${OCCT_PACKAGE}" STREQUAL "Xw") OR (NOT WIN32 AND "${OCCT_PACKAGE}" STREQUAL "WNT"))
|
||||
# do nothing
|
||||
else()
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND PRECOMPILED_DEFS "-D__${OCCT_PACKAGE}_DLL")
|
||||
endif()
|
||||
|
||||
set (SOURCE_FILES)
|
||||
set (HEADER_FILES)
|
||||
|
||||
# Generate Flex and Bison files
|
||||
if (${BUILD_YACCLEX})
|
||||
|
||||
# flex files
|
||||
OCCT_ORIGIN_AND_PATCHED_FILES ("tools/${OCCT_PACKAGE}" "*[.]lex" SOURCE_FILES_FLEX)
|
||||
list (LENGTH SOURCE_FILES_FLEX SOURCE_FILES_FLEX_LEN)
|
||||
|
||||
# bison files
|
||||
OCCT_ORIGIN_AND_PATCHED_FILES ("tools/${OCCT_PACKAGE}" "*[.]yacc" SOURCE_FILES_BISON)
|
||||
list (LENGTH SOURCE_FILES_BISON SOURCE_FILES_BISON_LEN)
|
||||
|
||||
if (${SOURCE_FILES_FLEX_LEN} EQUAL ${SOURCE_FILES_BISON_LEN} AND NOT ${SOURCE_FILES_FLEX_LEN} EQUAL 0)
|
||||
|
||||
list (SORT SOURCE_FILES_FLEX)
|
||||
list (SORT SOURCE_FILES_BISON)
|
||||
|
||||
math (EXPR SOURCE_FILES_FLEX_LEN "${SOURCE_FILES_FLEX_LEN} - 1")
|
||||
foreach (FLEX_FILE_INDEX RANGE ${SOURCE_FILES_FLEX_LEN})
|
||||
|
||||
list (GET SOURCE_FILES_FLEX ${FLEX_FILE_INDEX} CURRENT_FLEX_FILE)
|
||||
get_filename_component (CURRENT_FLEX_FILE_NAME ${CURRENT_FLEX_FILE} NAME_WE)
|
||||
|
||||
list (GET SOURCE_FILES_BISON ${FLEX_FILE_INDEX} CURRENT_BISON_FILE)
|
||||
get_filename_component (CURRENT_BISON_FILE_NAME ${CURRENT_BISON_FILE} NAME_WE)
|
||||
|
||||
string (COMPARE EQUAL ${CURRENT_FLEX_FILE_NAME} ${CURRENT_BISON_FILE_NAME} ARE_FILES_EQUAL)
|
||||
|
||||
if (EXISTS "${CURRENT_FLEX_FILE}" AND EXISTS "${CURRENT_BISON_FILE}" AND ${ARE_FILES_EQUAL})
|
||||
set (BISON_OUTPUT_FILE ${CURRENT_BISON_FILE_NAME}.tab.c)
|
||||
set (FLEX_OUTPUT_FILE lex.${CURRENT_FLEX_FILE_NAME}.c)
|
||||
BISON_TARGET (Parser_${CURRENT_BISON_FILE_NAME} ${CURRENT_BISON_FILE} ${CMAKE_SOURCE_DIR}/tools/${OCCT_PACKAGE}/${BISON_OUTPUT_FILE} COMPILE_FLAGS "-p ${CURRENT_BISON_FILE_NAME}")
|
||||
FLEX_TARGET (Scanner_${CURRENT_FLEX_FILE_NAME} ${CURRENT_FLEX_FILE} ${CMAKE_SOURCE_DIR}/tools/${OCCT_PACKAGE}/${FLEX_OUTPUT_FILE} COMPILE_FLAGS "-P${CURRENT_FLEX_FILE_NAME}")
|
||||
ADD_FLEX_BISON_DEPENDENCY (Scanner_${CURRENT_FLEX_FILE_NAME} Parser_${CURRENT_BISON_FILE_NAME})
|
||||
|
||||
list (APPEND SOURCE_FILES ${BISON_OUTPUT_FILE} ${FLEX_OUTPUT_FILE})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# header files
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES")
|
||||
file (STRINGS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||
file (STRINGS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||
file (STRINGS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||
|
||||
file (STRINGS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
if(APPLE)
|
||||
file (STRINGS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
||||
endif()
|
||||
else()
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_M REGEX ".+[.]h")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_LXX REGEX ".+[.]lxx")
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" HEADER_FILES_GXX REGEX ".+[.]gxx")
|
||||
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
if(APPLE)
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_M REGEX ".+[.]mm")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
list (APPEND HEADER_FILES ${HEADER_FILES_M} ${HEADER_FILES_LXX} ${SOURCE_FILES_GXX})
|
||||
list (APPEND SOURCE_FILES ${SOURCE_FILES_C})
|
||||
if(APPLE)
|
||||
list (APPEND SOURCE_FILES ${SOURCE_FILES_M})
|
||||
endif()
|
||||
|
||||
foreach(HEADER_FILE ${HEADER_FILES})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
list (APPEND USED_INCFILES "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
else()
|
||||
list (APPEND USED_INCFILES "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||
if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
list (APPEND USED_SRCFILES "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${BUILD_PATCH}/tools/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
else()
|
||||
list (APPEND USED_SRCFILES "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
string (REGEX REPLACE ";" " " PRECOMPILED_DEFS "${PRECOMPILED_DEFS}")
|
||||
|
||||
set (USED_RCFILE "")
|
||||
if (MSVC)
|
||||
set (USED_RCFILE "${CMAKE_BINARY_DIR}/resources/${PROJECT_NAME}.rc")
|
||||
|
||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in")
|
||||
configure_file("${APPLY_OCCT_PATCH_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
else()
|
||||
configure_file("${CMAKE_SOURCE_DIR}/adm/templates/occt_toolkit.rc.in" "${USED_RCFILE}" @ONLY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (CURRENT_MODULE)
|
||||
foreach (OCCT_MODULE ${OCCT_TOOLS})
|
||||
list (FIND ${OCCT_MODULE}_TOOL_TOOLKITS ${PROJECT_NAME} CURRENT_PROJECT_IS_BUILT)
|
||||
if (NOT ${CURRENT_PROJECT_IS_BUILT} EQUAL -1)
|
||||
set (CURRENT_MODULE ${OCCT_MODULE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (NOT SINGLE_GENERATOR)
|
||||
OCCT_INSERT_CODE_FOR_TARGET ()
|
||||
endif()
|
||||
|
||||
if ("${PROJECT_NAME}" STREQUAL TInspectorEXE)
|
||||
add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES})
|
||||
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
else()
|
||||
add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES})
|
||||
|
||||
if (MSVC)
|
||||
install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
set (CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set (CMAKE_SHARED_LIBRARY_SUFFIX "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
install (TARGETS ${PROJECT_NAME}
|
||||
EXPORT OpenCASCADE${CURRENT_MODULE}Targets
|
||||
RUNTIME DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}"
|
||||
LIBRARY DESTINATION "${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}")
|
||||
|
||||
|
||||
if (NOT WIN32)
|
||||
if (BUILD_SHARED_LIBS AND NOT "${BUILD_SHARED_LIBRARY_NAME_POSTFIX}" STREQUAL "")
|
||||
set (LINK_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX_DEFAULT}/tools")
|
||||
set (LIBRARY_NAME "${INSTALL_DIR}/${INSTALL_DIR_LIB}\${OCCT_INSTALL_BIN_LETTER}/lib${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}/tools")
|
||||
OCCT_CREATE_SYMLINK_TO_FILE (${LIBRARY_NAME} ${LINK_NAME})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (CURRENT_MODULE)
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Tools/${CURRENT_MODULE}")
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES MODULE "${CURRENT_MODULE}")
|
||||
if (APPLE)
|
||||
if (NOT "${INSTALL_NAME_DIR}" STREQUAL "")
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "${INSTALL_NAME_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR)
|
||||
get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR)
|
||||
get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE)
|
||||
|
||||
if (ANDROID)
|
||||
# do not append version to the filename
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}")
|
||||
else()
|
||||
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}"
|
||||
SOVERSION "${OCC_VERSION_MAJOR}"
|
||||
VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}")
|
||||
endif()
|
||||
|
||||
set (USED_TOOLKITS_BY_CURRENT_PROJECT)
|
||||
set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
|
||||
|
||||
# parce EXTERNLIB file
|
||||
FILE_TO_LIST ("${PACKAGE_PREFIX_DIR}/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
|
||||
if (NOT COMMENT_FOUND)
|
||||
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
|
||||
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
|
||||
|
||||
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
||||
else()
|
||||
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
|
||||
if ("${CSF_FOUND}" STREQUAL "")
|
||||
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
|
||||
else() # get CSF_ value
|
||||
set (CURRENT_CSF ${${USED_ITEM}})
|
||||
if (NOT "x${CURRENT_CSF}" STREQUAL "x")
|
||||
# prepare a list from a string with whitespaces
|
||||
separate_arguments (CURRENT_CSF)
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if (APPLE)
|
||||
list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
|
||||
if (NOT ${IS_X11_FOUND} EQUAL -1)
|
||||
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
|
||||
if (NOT X11_FOUND)
|
||||
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
|
||||
# Add VTK_OPENGL2_BACKEND definition.
|
||||
if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
|
||||
add_definitions(-DVTK_OPENGL2_BACKEND)
|
||||
foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
|
||||
list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
|
||||
if (NOT ${IS_VTK_OPENGL_FOUND} EQUAL -1)
|
||||
list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${VTK_EXCLUDE_LIBRARY})
|
||||
if (${VTK_EXCLUDE_LIBRARY} STREQUAL vtkRenderingOpenGL)
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingOpenGL2)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
|
||||
endif()
|
||||
|
||||
# Set Qt dependencies
|
||||
target_link_libraries(${PROJECT_NAME} "${PROJECT_LIBRARIES}")
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} debug "${PROJECT_LIBRARIES_DEBUG}")
|
||||
target_link_libraries(${PROJECT_NAME} optimized "${PROJECT_LIBRARIES_RELEASE}")
|
||||
|
@@ -1,22 +0,0 @@
|
||||
#qt
|
||||
|
||||
#looking for 3RDPARTY_QT_DIR variable used later in qt5_macro.cmake
|
||||
if (${USE_QT4})
|
||||
SET(CSF_QtCore "QtCore")
|
||||
THIRDPARTY_PRODUCT("QT" "" "CSF_QtCore" "d")
|
||||
else()
|
||||
SET(CSF_Qt5Core "Qt5Core")
|
||||
THIRDPARTY_PRODUCT("QT" "" "CSF_Qt5Core" "d")
|
||||
endif()
|
||||
|
||||
list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_INCLUDE_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_LIBRARY_DIR")
|
||||
list (REMOVE_ITEM 3RDPARTY_NOT_INCLUDED "3RDPARTY_QT_DLL_DIR")
|
||||
|
||||
UNSET (${3RDPARTY_QT_DLL} CACHE)
|
||||
UNSET (${3RDPARTY_QT_DLL_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_INCLUDE_DIR} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY} CACHE)
|
||||
UNSET (${3RDPARTY_QT_LIBRARY_DIR} CACHE)
|
||||
|
||||
set (USED_3RDPARTY_QT_DIR "${3RDPARTY_QT_DIR}")
|
@@ -1,68 +0,0 @@
|
||||
#qt
|
||||
|
||||
macro (FIND_QT5_PACKAGE PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
|
||||
|
||||
if ("${3RDPARTY_QT_DIR}" STREQUAL "")
|
||||
message (FATAL_ERROR "Empty Qt dir")
|
||||
endif()
|
||||
|
||||
# Now set CMAKE_PREFIX_PATH to point to local Qt installation.
|
||||
# Without this setting find_package() will not work
|
||||
set(CMAKE_PREFIX_PATH ${3RDPARTY_QT_DIR})
|
||||
if (USE_QT4)
|
||||
# Now we can apply standard CMake finder for Qt. We do this mostly
|
||||
# to have qt5_wrap_cpp() function available
|
||||
find_package(Qt4)
|
||||
#message (STATUS "Qt cmake configuration at directory ${Qt4DIR}")
|
||||
|
||||
set(PROJECT_INCLUDES ${QT_INCLUDES})
|
||||
if (WIN32)
|
||||
set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/QtCored4.lib;${3RDPARTY_QT_DIR}/lib/QtGuid4.lib")
|
||||
set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/QtCore4.lib;${3RDPARTY_QT_DIR}/lib/QtGui4.lib")
|
||||
else()
|
||||
set(PROJECT_LIBRARIES_DEBUG "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
|
||||
set(PROJECT_LIBRARIES_RELEASE "${3RDPARTY_QT_DIR}/lib/libQtCore.so;${3RDPARTY_QT_DIR}/lib/libQtGui.so")
|
||||
endif(WIN32)
|
||||
else()
|
||||
# Now we can apply standard CMake finder for Qt4. We do this mostly
|
||||
# to have qt5_wrap_cpp() function available
|
||||
find_package(Qt5 REQUIRED COMPONENTS Widgets)
|
||||
#message (STATUS "Qt cmake configuration at directory ${Qt5DIR}")
|
||||
|
||||
set(PROJECT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS}")
|
||||
set(PROJECT_LIBRARIES_DEBUG "${Qt5Widgets_LIBRARIES}")
|
||||
set(PROJECT_LIBRARIES_RELEASE "${Qt5Widgets_LIBRARIES}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro (FIND_AND_WRAP_MOC_FILES SOURCE_FILES)
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
foreach (FILE ${SOURCE_FILES})
|
||||
set (src_files ${src_files} ${FILE})
|
||||
unset (MOC_FILE)
|
||||
if (USE_QT4)
|
||||
qt4_wrap_cpp(MOC_FILE ${FILE})
|
||||
else()
|
||||
qt5_wrap_cpp(MOC_FILE ${FILE})
|
||||
endif()
|
||||
#message (STATUS "... Info: next MOC file ${MOC_FILE}")
|
||||
|
||||
endforeach (FILE)
|
||||
|
||||
endmacro()
|
||||
|
||||
macro (FIND_AND_WRAP_RESOURCE_FILE RESOURCE_FILE_NAME RCC_FILES)
|
||||
if(EXISTS "${RESOURCE_FILE_NAME}")
|
||||
if (USE_QT4)
|
||||
qt4_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
|
||||
# suppress some GCC warnings coming from source files generated from .qrc resources
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
|
||||
endif()
|
||||
else()
|
||||
qt5_add_resources(RCC_FILES "${RESOURCE_FILE_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
@@ -167,11 +167,6 @@ set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
|
||||
|
||||
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
|
||||
|
||||
set (BUILD_QT_TOOLS_DESCR "Indicates whether OCCT tools should be build or not")
|
||||
|
||||
set (USE_QT_TOOLS_DESCR "Indicates whether OCCT tools should be used or not
|
||||
The tools will be searched in third-party directory or may be set manually")
|
||||
|
||||
macro (BUILD_MODULE MODULE_NAME)
|
||||
set (ENABLE_MODULE TRUE)
|
||||
set (BUILD_MODULE_${MODULE_NAME} ${ENABLE_MODULE} CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
|
||||
|
@@ -70,7 +70,7 @@ proc gendoc {args} {
|
||||
set DOCLABEL ""
|
||||
set VERB_MODE "NO"
|
||||
set SEARCH_MODE "none"
|
||||
set MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1"
|
||||
set MATHJAX_LOCATION "https://cdn.mathjax.org/mathjax/latest"
|
||||
set mathjax_js_name "MathJax.js"
|
||||
set DOCTYPE_COMBO_FLAG 0
|
||||
set GENMODE_COMBO_FLAG 0
|
||||
@@ -303,6 +303,13 @@ proc gendoc {args} {
|
||||
|
||||
puts ""
|
||||
|
||||
# Clean logfiles
|
||||
set DOXYLOG [OCCDoc_GetRootDir]/doc/doxygen_warnings_and_errors.log
|
||||
set PDFLOG [OCCDoc_GetRootDir]/doc/pdflatex_warnings_and_errors.log
|
||||
|
||||
file delete -force $PDFLOG
|
||||
file delete -force $DOXYLOG
|
||||
|
||||
# Start main activities
|
||||
if { $GEN_MODE != "PDF_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
@@ -323,15 +330,15 @@ proc gendoc {args} {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts "Generating OCCT User Guides in PDF format..."
|
||||
puts "Generating OCCT User Guides in PDF format...\n"
|
||||
foreach pdf $DOCFILES {
|
||||
|
||||
puts "\nInfo: Processing file $pdf"
|
||||
puts "Info: Processing file $pdf\n"
|
||||
|
||||
# Some values are hardcoded because they are related only to PDF generation
|
||||
OCCDoc_Main "OVERVIEW" [list $pdf] {} "PDF_ONLY" $VERB_MODE "none" $MATHJAX_LOCATION "NO" $DOXYGEN_PATH $GRAPHVIZ_PATH $INKSCAPE_PATH $HHC_PATH
|
||||
}
|
||||
puts "\n[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,31 +465,23 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
|
||||
if { ($generatorMode == "HTML_ONLY") || ($docType == "REFMAN") } {
|
||||
set LOGPREFIX "html_"
|
||||
puts "$starttimestamp Generating HTML files..."
|
||||
|
||||
# Copy index file to provide fast access to HTML documentation
|
||||
file copy -force $INDIR/resources/index.html $DOCDIR/index.html
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
set LOGPREFIX "chm_"
|
||||
puts "$starttimestamp Generating CHM file..."
|
||||
} elseif { $generatorMode == "PDF_ONLY" } {
|
||||
set LOGPREFIX "[file rootname [file tail [lindex $docfiles 0]]]_"
|
||||
puts "$starttimestamp Generating PDF file..."
|
||||
}
|
||||
|
||||
# Clean logfiles
|
||||
set DOXYLOG $OUTDIR/${LOGPREFIX}doxygen_err.log
|
||||
set DOXYOUT $OUTDIR/${LOGPREFIX}doxygen_out.log
|
||||
file delete -force $DOXYLOG
|
||||
file delete -force $DOXYOUT
|
||||
|
||||
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $DOXYOUT} DOX_ERROR]
|
||||
set DOXYLOG $OUTDIR/doxygen_warnings_and_errors.log
|
||||
set RESULT [catch {exec $DOXYGEN_PATH $DOXYFILE >> $OUTDIR/doxygen_out.log} DOX_ERROR]
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $DOX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: Doxygen reported $NbErrors messages."
|
||||
puts "See log in $DOXYLOG"
|
||||
puts "\nWarning: Doxygen reported $NbErrors messages."
|
||||
puts "See log in $DOXYLOG\n"
|
||||
set DOX_ERROR_FILE [open $DOXYLOG "a"]
|
||||
if {$generatorMode == "PDF_ONLY"} {
|
||||
puts $DOX_ERROR_FILE "\n===================================================="
|
||||
@@ -504,7 +503,7 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
if {[OCCDoc_PostProcessor $DOCDIR] == 0} {
|
||||
puts "$curtime Generation completed."
|
||||
puts "\nInfo: doxygen log file is located in:"
|
||||
puts "${DOXYOUT}."
|
||||
puts "$OUTDIR/doxygen_out.log."
|
||||
puts "\nReference Manual is generated in \n$DOCDIR"
|
||||
}
|
||||
} elseif { $docType == "OVERVIEW" } {
|
||||
@@ -571,29 +570,25 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
puts "Info: Executing $LATEXDIR/Makefile..."
|
||||
}
|
||||
}
|
||||
|
||||
set PDFLOG $OUTDIR/${LOGPREFIX}pdflatex_err.log
|
||||
set PDFOUT $OUTDIR/${LOGPREFIX}pdflatex_out.log
|
||||
file delete -force $PDFLOG
|
||||
file delete -force $PDFOUT
|
||||
set PDFLOG $OUTDIR/pdflatex_warnings_and_errors.log
|
||||
|
||||
if {"$is_win" == "yes"} {
|
||||
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$PDFOUT"} LaTeX_ERROR]
|
||||
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make.bat] >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
|
||||
} else {
|
||||
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
set RESULT [catch {eval exec "make -f $LATEXDIR/Makefile" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
|
||||
|
||||
# Small workaround for *nix stations
|
||||
set prev_loc [pwd]
|
||||
cd $LATEXDIR
|
||||
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$PDFOUT"} LaTeX_ERROR]
|
||||
set RESULT [catch {eval exec "pdflatex refman.tex" >> "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
|
||||
cd $prev_loc
|
||||
}
|
||||
|
||||
if {$RESULT != 0} {
|
||||
set NbErrors [regexp -all -line {^\s*[^\s]+} $LaTeX_ERROR]
|
||||
if {$NbErrors > 0} {
|
||||
puts "Warning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG"
|
||||
set LaTeX_ERROR_FILE [open $PDFLOG "a+"]
|
||||
puts "\nWarning: PDFLaTeX reported $NbErrors messages.\nSee log in $PDFLOG\n"
|
||||
set LaTeX_ERROR_FILE [open $PDFLOG "a"]
|
||||
puts $LaTeX_ERROR_FILE "\n===================================================="
|
||||
puts $LaTeX_ERROR_FILE "Logfile of file $TEX:"
|
||||
puts $LaTeX_ERROR_FILE "====================================================\n"
|
||||
@@ -626,7 +621,6 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
set TEX "$PDFNAME"
|
||||
}
|
||||
file rename -force $LATEXDIR/refman.pdf "$destFolder/$TEX.pdf"
|
||||
puts "Generated $destFolder/$TEX.pdf"
|
||||
}
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
if { [OCCDoc_GetProdRootDir] == ""} {
|
||||
@@ -638,10 +632,13 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
cd $INDIR
|
||||
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
puts "HTML documentation is generated in \n$DOCDIR"
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
puts "Generated CHM documentation is in \n$OUTDIR/overview.chm"
|
||||
puts "\nHTML documentation is generated in \n$DOCDIR"
|
||||
}
|
||||
if { $generatorMode == "CHM_ONLY" } {
|
||||
puts "\nGenerated CHM documentation is in \n$OUTDIR/overview.chm"
|
||||
}
|
||||
|
||||
puts ""
|
||||
}
|
||||
|
||||
# Remove temporary Doxygen files
|
||||
@@ -650,6 +647,8 @@ proc OCCDoc_Main {docType {docfiles {}} {modules {}} generatorMode verboseMode s
|
||||
file delete $file
|
||||
}
|
||||
|
||||
puts "\nPDF files are generated in \n[file normalize $OUTDIR]"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -1354,7 +1354,6 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
||||
set aLibsMap(CSF_TclLibs) ""
|
||||
set aFrmsMap(CSF_TclTkLibs) "Tk"
|
||||
set aLibsMap(CSF_TclTkLibs) ""
|
||||
set aLibsMap(CSF_QT) "QtCore QtGui"
|
||||
} else {
|
||||
if { "$theOS" == "qnx" } {
|
||||
# CSF_ThreadLibs - pthread API is part of libc on QNX
|
||||
|
@@ -15,9 +15,6 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
|
||||
|
||||
if not "@3RDPARTY_QT_DIR@" == "" (
|
||||
set "QTDIR=@3RDPARTY_QT_DIR@"
|
||||
)
|
||||
set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
|
@@ -13,10 +13,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
|
||||
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
|
||||
|
||||
if [ "x@3RDPARTY_QT_DIR" != "x" ]; then
|
||||
export QTDIR="@3RDPARTY_QT_DIR@"
|
||||
fi
|
||||
|
||||
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
|
@@ -17,9 +17,6 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
|
||||
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
|
||||
|
||||
if not "@USED_3RDPARTY_QT_DIR@" == "" (
|
||||
set "QTDIR=@USED_3RDPARTY_QT_DIR@"
|
||||
)
|
||||
set "TCL_VERSION_WITH_DOT=@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
set "TK_VERSION_WITH_DOT=@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
|
@@ -13,10 +13,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export TBB_DIR="@USED_3RDPARTY_TBB_DIR@"
|
||||
export VTK_DIR="@USED_3RDPARTY_VTK_DIR@"
|
||||
|
||||
if [ "x@USED_3RDPARTY_QT_DIR@" != "x" ]; then
|
||||
export QTDIR="@USED_3RDPARTY_QT_DIR@"
|
||||
fi
|
||||
|
||||
export TCL_VERSION_WITH_DOT="@3RDPARTY_TCL_LIBRARY_VERSION_WITH_DOT@"
|
||||
export TK_VERSION_WITH_DOT="@3RDPARTY_TK_LIBRARY_VERSION_WITH_DOT@"
|
||||
|
||||
|
@@ -1,7 +0,0 @@
|
||||
@echo off
|
||||
|
||||
rem Setup environment and launch TInspector
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
TInspectorEXE.exe --dfbrowser
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
aCurrentPath="$PWD"
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
|
||||
source "${aScriptPath}/env.sh" "$1"
|
||||
|
||||
cd ${aCurrentPath}
|
||||
TInspectorEXE --dfbrowser
|
@@ -52,56 +52,6 @@ if /I ["%3"] == ["relwithdeb"] set "CASDEB=i"
|
||||
rem Decode VCVER
|
||||
call "%~dp0adm\vcver.bat"
|
||||
|
||||
rem ----- Parsing of Visual Studio platform -----
|
||||
set "VisualStudioExpressName=VCExpress"
|
||||
|
||||
if not "%DevEnvDir%" == "" (
|
||||
rem If DevEnvDir is already defined (e.g. in custom.bat), use that value
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
|
||||
rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
|
||||
rem and has a new name for executable - WDExpress
|
||||
set "VisualStudioExpressName=WDExpress"
|
||||
) else if /I "%VCFMT%" == "vc12" (
|
||||
set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
|
||||
set "VisualStudioExpressName=WDExpress"
|
||||
) else if /I "%VCFMT%" == "vc14" (
|
||||
set "DevEnvDir=%VS140COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc141" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,15.99]" -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "DevEnvDir=%%i\Common7\IDE\"
|
||||
)
|
||||
) else (
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
)
|
||||
|
||||
rem ----- Parsing vcvarsall for qt samples and define PlatformToolset -----
|
||||
if /I "%VCFMT%" == "vc10" (
|
||||
set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v100"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v110"
|
||||
) else if /I "%VCFMT%" == "vc12" (
|
||||
set "VCVARS=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v120"
|
||||
) else if /I "%VCFMT%" == "vc14" (
|
||||
set "VCVARS=%VS140COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
set "VCPlatformToolSet=v140"
|
||||
) else if /I "%VCFMT%" == "vc141" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,15.99]" -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set "VCVARS=%%i\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
)
|
||||
set "VCPlatformToolSet=v141"
|
||||
) else (
|
||||
echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
|
||||
echo one of: vc10 ^(VS 2010 SP3^), vc11 ^(VS 2012 SP3^), vc12 ^(VS 2013^) or vc14 ^(VS 2015^)
|
||||
exit
|
||||
)
|
||||
|
||||
set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%"
|
||||
set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%"
|
||||
set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%"
|
||||
|
@@ -115,7 +115,6 @@ if not ["%GLES2_DIR%"] == [""] set "PATH=%GLES2_DIR%;%PATH%"
|
||||
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
|
||||
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
||||
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||
if not ["%QTDIR%"] == [""] set "PATH=%QTDIR%/bin;%PATH%"
|
||||
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
if not "%CSF_OCCTBinPath%" == "" (
|
||||
|
@@ -66,10 +66,6 @@ if [ "$VTK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$QTDIR" != "" ]; then
|
||||
THRDPARTY_PATH="${QTDIR}/lib:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$TK_DIR" != "$TCL_DIR" ]; then
|
||||
if [ "$TK_DIR" != "" ]; then
|
||||
export TK_LIBRARY="${TK_DIR}/../lib/tk${TK_VERSION_WITH_DOT}"
|
||||
|
@@ -10,6 +10,35 @@ if not "%4" == "" (
|
||||
set "PRJFILE=%4"
|
||||
)
|
||||
|
||||
set "VisualStudioExpressName=VCExpress"
|
||||
|
||||
if not "%DevEnvDir%" == "" (
|
||||
rem If DevEnvDir is already defined (e.g. in custom.bat), use that value
|
||||
) else if /I "%VCFMT%" == "vc8" (
|
||||
set "DevEnvDir=%VS80COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc9" (
|
||||
set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc10" (
|
||||
set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc11" (
|
||||
set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
|
||||
rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
|
||||
rem and has a new name for executable - WDExpress
|
||||
set "VisualStudioExpressName=WDExpress"
|
||||
) else if /I "%VCFMT%" == "vc12" (
|
||||
set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
|
||||
set "VisualStudioExpressName=WDExpress"
|
||||
) else if /I "%VCFMT%" == "vc14" (
|
||||
set "DevEnvDir=%VS140COMNTOOLS%..\IDE"
|
||||
) else if /I "%VCFMT%" == "vc141" (
|
||||
for /f "usebackq delims=" %%i in (`vswhere.exe -version "[15.0,15.99]" -requires Microsoft.VisualStudio.Workload.%VCPROP% -property installationPath`) do (
|
||||
set DevEnvDir=%%i\Common7\IDE
|
||||
)
|
||||
) else (
|
||||
echo Error: wrong VS identifier
|
||||
exit /B
|
||||
)
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
|
@@ -35,7 +35,7 @@ endif()
|
||||
# configuration file for doxygen
|
||||
set (OCCT_CONFIG_FOR_DOXYGEN "${OCCT_GENERATED_DOC_DIR}/occt.cfg")
|
||||
|
||||
set (3RDPARTY_MATHJAX_RELATIVE_PATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1")
|
||||
set (3RDPARTY_MATHJAX_RELATIVE_PATH "https://cdn.mathjax.org/mathjax/latest")
|
||||
|
||||
configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CONFIG_FOR_DOXYGEN}" COPYONLY)
|
||||
|
||||
|
@@ -38,7 +38,7 @@ Follow the instructions to proceed (define proxy settings if needed, select a mi
|
||||
**MathJax** is used for rendering math formulas in browser (HTML and CHM outputs): http://www.mathjax.org.
|
||||
|
||||
By default MathJAX scripts and fonts work on-line and no installation of MathJAX is necessary if Internet is accessible.
|
||||
If you need to use OCCT documentation while off-line, you can install a local copy of MatJAX, see https://docs.mathjax.org/en/v2.7-latest/start.html#installing-your-own-copy-of-mathjax.
|
||||
If you need to use OCCT documentation while off-line, you can install a local copy of MatJAX, see https://docs.mathjax.org/en/v2.6-latest/start.html#installing-your-own-copy-of-mathjax.
|
||||
See \ref OCCT_DM_SECTION_A_9 for more details on inserting mathematical expressions.
|
||||
|
||||
@section OCCT_DM_SECTION_2_1 Documentation Generation
|
||||
|
@@ -31,7 +31,6 @@
|
||||
\fontseries{bc}\selectfont%
|
||||
\color{darkgray}%
|
||||
}
|
||||
\newcommand{\+}{\discretionary{\mbox{\scriptsize$\hookleftarrow$}}{}{}}
|
||||
|
||||
% Page & text layout
|
||||
\usepackage{geometry}
|
||||
@@ -51,12 +50,12 @@
|
||||
\makeatletter
|
||||
\renewcommand{\paragraph}{%
|
||||
\@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@parafont%
|
||||
\normalfont\normalsize\bfseries\SS@parafont%
|
||||
}%
|
||||
}
|
||||
\renewcommand{\subparagraph}{%
|
||||
\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%
|
||||
\normalfont\normalsize\bfseries\SS@subparafont%
|
||||
\normalfont\normalsize\bfseries\SS@subparafont%
|
||||
}%
|
||||
}
|
||||
\makeatother
|
||||
@@ -108,12 +107,9 @@
|
||||
\newcommand{\clearemptydoublepage}{%
|
||||
\newpage{\pagestyle{empty}\cleardoublepage}%
|
||||
}
|
||||
|
||||
|
||||
%===== C O N T E N T S =====
|
||||
|
||||
\n
|
||||
%===== C O N T E N T S =====\n
|
||||
\begin{document}
|
||||
|
||||
% Titlepage & ToC
|
||||
\hypersetup{pageanchor=false}
|
||||
\pagenumbering{roman}
|
||||
|
@@ -41,7 +41,7 @@ GENERATE_TREEVIEW = NO
|
||||
PREDEFINED = PDF_ONLY
|
||||
GENERATE_LATEX = YES
|
||||
COMPACT_LATEX = YES
|
||||
PDF_HYPERLINKS = YES
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = YES
|
||||
LATEX_BATCHMODE = YES
|
||||
LATEX_OUTPUT = latex
|
||||
|
@@ -391,7 +391,7 @@ puts ;negative;
|
||||
Syntax:
|
||||
|
||||
|
||||
~~~~~
|
||||
~~~~~~
|
||||
while condition script
|
||||
for init condition reinit script
|
||||
foreach varname list script
|
||||
@@ -2506,7 +2506,7 @@ vdimparam dim1 -textvalue "w_1"
|
||||
vdimparam dim1 -autovalue
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_4_4_22 vangleparam
|
||||
@subsubsection occt_draw_4_4_22 vdimangleparam
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
@@ -2527,29 +2527,7 @@ vfit
|
||||
vangleparam dim1 -type exterior -showarrow first
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_4_4_23 vlengthparam
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
vlengthparam name [-type interior|exterior]
|
||||
[-showarrow first|second|both|none]
|
||||
~~~~~
|
||||
|
||||
Sets parameters for length dimension **name**.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
vinit
|
||||
vpoint p1 20 20 0
|
||||
vpoint p2 80 80 0
|
||||
vdimension dim1 -length -plane xoy -shapes p1 p2
|
||||
vtop
|
||||
vfit
|
||||
vzoom 0.5
|
||||
vlengthparam dim1 -direction ox
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_4_4_24 vmovedim
|
||||
@subsubsection occt_draw_4_4_23 vmovedim
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
|
@@ -10,9 +10,9 @@ set "PRJFILE=%~dp0\CSharp.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -21,9 +21,9 @@ set "PRJFILE=%~dp0\CSharp_D3D.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -10,9 +10,9 @@ set "PRJFILE=%~dp0All-%VCFMT%.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCFMT%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -10,9 +10,9 @@ set "PRJFILE=%~dp0FuncDemo.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -10,9 +10,9 @@ set "PRJFILE=%~dp0IESample.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -10,9 +10,9 @@ set "PRJFILE=%~dp0Tutorial.sln"
|
||||
|
||||
rem Launch Visual Studio - either professional (devenv) or Express, as available
|
||||
if exist "%DevEnvDir%\devenv.exe" (
|
||||
start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
|
||||
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
|
||||
start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
|
||||
) else (
|
||||
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
|
||||
echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
|
||||
|
@@ -1,5 +0,0 @@
|
||||
project(TInspectorEXE)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_tool)
|
||||
|
||||
set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER Samples)
|
@@ -1 +0,0 @@
|
||||
TKTInspector
|
@@ -1,5 +0,0 @@
|
||||
TInspectorEXE.cxx
|
||||
TInspectorEXE_OpenFileDialog.cxx
|
||||
TInspectorEXE_OpenFileDialog.hxx
|
||||
TInspectorEXE_OpenFileViewModel.cxx
|
||||
TInspectorEXE_OpenFileViewModel.hxx
|
@@ -1,134 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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 <OSD_Environment.hxx>
|
||||
#include <TInspectorEXE_OpenFileDialog.hxx>
|
||||
#include <TInspector_Communicator.hxx>
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
#include <QMainWindow>
|
||||
#include <QToolBar>
|
||||
|
||||
#include <set>
|
||||
|
||||
// =======================================================================
|
||||
// function : fileNameInDataDir
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TCollection_AsciiString fileNameInDataDir(const TCollection_AsciiString& theEnvironmentDir,
|
||||
const TCollection_AsciiString& theName)
|
||||
{
|
||||
OSD_Environment anEnvironment(theEnvironmentDir);
|
||||
|
||||
TCollection_AsciiString aFileName = anEnvironment.Value();
|
||||
aFileName += TCollection_AsciiString("/") + theName;
|
||||
|
||||
return aFileName;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : setPluginSampleDirectory
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void setPluginSampleDirectory (const TCollection_AsciiString& theName, TInspector_Communicator* theCommunicator,
|
||||
TInspectorEXE_OpenButton* theButtonControl)
|
||||
{
|
||||
if (theName.IsEqual ("TKDFBrowser"))
|
||||
{
|
||||
theCommunicator->OpenFile (theName, fileNameInDataDir ("CSF_OCCTDataPath", "step/screw.step"));
|
||||
theButtonControl->SetPluginDir (theName, fileNameInDataDir ("CSF_OCCTDataPath", "step"));
|
||||
}
|
||||
else if (theName.IsEqual ("TKShapeView"))
|
||||
{
|
||||
theCommunicator->OpenFile (theName, fileNameInDataDir ("CSF_OCCTDataPath", "occ/hammer.brep"));
|
||||
theButtonControl->SetPluginDir (theName, fileNameInDataDir ("CSF_OCCTDataPath", "occ"));
|
||||
}
|
||||
else if (theName.IsEqual ("TKVInspector"))
|
||||
{
|
||||
theCommunicator->OpenFile (theName, fileNameInDataDir ("CSF_OCCTDataPath", "occ/face1.brep"));
|
||||
theCommunicator->OpenFile (theName, fileNameInDataDir ("CSF_OCCTDataPath", "occ/face2.brep"));
|
||||
theButtonControl->SetPluginDir (theName, fileNameInDataDir ("CSF_OCCTDataPath", "occ"));
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : main
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
OSD_Environment anEnvironment ("QTDIR");
|
||||
TCollection_AsciiString aPlugindsDirName = anEnvironment.Value();
|
||||
if (aPlugindsDirName.IsEmpty())
|
||||
{
|
||||
std::cout << "QTDIR is not defined" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
aPlugindsDirName += "/plugins";
|
||||
QApplication::addLibraryPath (aPlugindsDirName.ToCString());
|
||||
QApplication anApp (argc, argv);
|
||||
|
||||
std::set<TCollection_AsciiString> aPlugins;
|
||||
for (int anArgId = 1; anArgId < argc; anArgId++ )
|
||||
{
|
||||
if (!strcmp (argv[anArgId], "--dfbrowser"))
|
||||
aPlugins.insert ("TKDFBrowser");
|
||||
|
||||
if (!strcmp (argv[anArgId], "--shapeview"))
|
||||
aPlugins.insert ("TKShapeView");
|
||||
|
||||
if (!strcmp (argv[anArgId], "--vinspector"))
|
||||
aPlugins.insert ("TKVInspector");
|
||||
}
|
||||
NCollection_List<Handle(Standard_Transient)> aParameters;
|
||||
|
||||
// Create tool communicator
|
||||
TInspector_Communicator* aCommunicator = TInspectorEXE_OpenFileDialog::Communicator();
|
||||
if (!aCommunicator)
|
||||
{
|
||||
std::cout << "Communicator can not be created" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
TInspectorEXE_OpenButton* aButtonControl = new TInspectorEXE_OpenButton (0);
|
||||
TCollection_AsciiString anActivatedPluginName;
|
||||
if (aPlugins.empty())
|
||||
{
|
||||
aPlugins.insert("TKDFBrowser");
|
||||
aPlugins.insert("TKShapeView");
|
||||
aPlugins.insert("TKVInspector");
|
||||
|
||||
anActivatedPluginName = "TKDFBrowser";
|
||||
}
|
||||
else
|
||||
anActivatedPluginName = *aPlugins.rbegin();
|
||||
|
||||
for (std::set<TCollection_AsciiString>::const_iterator aPluginIt = aPlugins.begin(); aPluginIt != aPlugins.end(); aPluginIt++)
|
||||
{
|
||||
TCollection_AsciiString aName = *aPluginIt;
|
||||
aCommunicator->RegisterPlugin (aName);
|
||||
aCommunicator->Init (aName, aParameters);
|
||||
setPluginSampleDirectory (aName, aCommunicator, aButtonControl);
|
||||
}
|
||||
aCommunicator->Activate (anActivatedPluginName);
|
||||
|
||||
aCommunicator->SetVisible (true);
|
||||
aCommunicator->SetOpenButton (aButtonControl->StartButton());
|
||||
|
||||
return anApp.exec();
|
||||
}
|
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>icons/folder_open.png</file>
|
||||
<file>icons/folder_import.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -1,311 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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 <TInspectorEXE_OpenFileDialog.hxx>
|
||||
|
||||
#include <TInspector_Communicator.hxx>
|
||||
#include <TInspectorEXE_OpenFileViewModel.hxx>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCompleter>
|
||||
#include <QDir>
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemModel>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QScrollBar>
|
||||
#include <QTableView>
|
||||
#include <QToolButton>
|
||||
#include <QPushButton>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
const int FONT_POINT_SIZE = 18;
|
||||
const int ICON_SIZE = 40;
|
||||
|
||||
const int OPEN_DIALOG_WIDTH = 550;
|
||||
const int OPEN_DIALOG_HEIGHT = 200;
|
||||
|
||||
const int MARGIN_DIALOG = 4;
|
||||
const int SPACING_DIALOG = 2;
|
||||
|
||||
TInspector_Communicator* MyCommunicator;
|
||||
|
||||
// =======================================================================
|
||||
// function : StartButton
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QPushButton* TInspectorEXE_OpenButton::StartButton()
|
||||
{
|
||||
if (!myStartButton)
|
||||
{
|
||||
myStartButton = new QPushButton();
|
||||
myStartButton->setIcon (QIcon (":/icons/folder_open.png"));
|
||||
connect (myStartButton, SIGNAL (clicked()), this, SLOT (onStartButtonClicked()));
|
||||
}
|
||||
return myStartButton;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onStartButtonClicked
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenButton::onStartButtonClicked()
|
||||
{
|
||||
QPushButton* aButton = (QPushButton*)sender();
|
||||
TCollection_AsciiString aPluginName (aButton->objectName().toStdString().c_str());
|
||||
if (aPluginName.IsEmpty())
|
||||
return;
|
||||
|
||||
QString aDataDirName = QDir::currentPath();
|
||||
if (myDefaultDirs.IsBound (aPluginName))
|
||||
aDataDirName = myDefaultDirs.Find (aPluginName).ToCString();
|
||||
|
||||
QString aFileName = TInspectorEXE_OpenFileDialog::OpenFile (0, aDataDirName);
|
||||
aFileName = QDir().toNativeSeparators (aFileName);
|
||||
if (!aFileName.isEmpty()) {
|
||||
QApplication::setOverrideCursor (Qt::WaitCursor);
|
||||
TInspectorEXE_OpenFileDialog::Communicator()->OpenFile (aPluginName, TCollection_AsciiString (aFileName.toUtf8().data()));
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : changeMargins
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void changeMargins (QBoxLayout* theLayout)
|
||||
{
|
||||
theLayout->setContentsMargins (MARGIN_DIALOG, MARGIN_DIALOG, MARGIN_DIALOG, MARGIN_DIALOG);
|
||||
theLayout->setSpacing (SPACING_DIALOG);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Constructor
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TInspectorEXE_OpenFileDialog::TInspectorEXE_OpenFileDialog (QWidget* theParent, const QString& theDataDirName)
|
||||
: QDialog(theParent), myDataDir (theDataDirName)
|
||||
{
|
||||
setWindowTitle (theDataDirName);
|
||||
|
||||
QVBoxLayout* aDialogLay = new QVBoxLayout (this);
|
||||
changeMargins (aDialogLay);
|
||||
|
||||
// Title label
|
||||
QLabel* aTitleLabel = new QLabel (this);
|
||||
aTitleLabel->setText (tr ("Open File"));
|
||||
aDialogLay->addWidget (aTitleLabel);
|
||||
|
||||
// Samples View
|
||||
QGroupBox* aSamplesBox = new QGroupBox (this);
|
||||
aSamplesBox->setTitle (tr ("Samples"));
|
||||
aDialogLay->addWidget (aSamplesBox);
|
||||
QVBoxLayout* aSampleLay = new QVBoxLayout (aSamplesBox);
|
||||
changeMargins (aSampleLay);
|
||||
mySamplesView = createTableView (readSampleNames());
|
||||
aSampleLay->addWidget (mySamplesView);
|
||||
|
||||
// Select file
|
||||
QGroupBox* aSelectFileBox = new QGroupBox (this);
|
||||
aSelectFileBox->setTitle (tr ("Select file"));
|
||||
aDialogLay->addWidget (aSelectFileBox);
|
||||
QGridLayout* aSelectFileLay = new QGridLayout (aSelectFileBox);
|
||||
aSelectFileLay->setContentsMargins (MARGIN_DIALOG, MARGIN_DIALOG, MARGIN_DIALOG, MARGIN_DIALOG);
|
||||
|
||||
mySelectedName = new QLineEdit (aSelectFileBox);
|
||||
QCompleter* aCompleter = new QCompleter();
|
||||
QFileSystemModel* aFileSystemModel = new QFileSystemModel;
|
||||
aFileSystemModel->setRootPath (QDir::rootPath());
|
||||
aCompleter->setModel (aFileSystemModel);
|
||||
mySelectedName->setCompleter (aCompleter);
|
||||
aSelectFileLay->addWidget (mySelectedName, 1, 0);
|
||||
|
||||
QToolButton* aSelectFileBtn = new QToolButton (aSelectFileBox);
|
||||
aSelectFileBtn->setIcon (QIcon (":/icons/folder_open.png"));
|
||||
aSelectFileLay->addWidget (aSelectFileBtn, 1, 1);
|
||||
|
||||
myFolderApplyOpen = new QToolButton (aSelectFileBox);
|
||||
myFolderApplyOpen->setIcon (QIcon (":/icons/folder_import.png"));
|
||||
myFolderApplyOpen->setIconSize (QSize (ICON_SIZE, ICON_SIZE));
|
||||
myFolderApplyOpen->setEnabled (false);
|
||||
aSelectFileLay->addWidget (myFolderApplyOpen, 0, 2, 2, 1);
|
||||
|
||||
connect (mySelectedName, SIGNAL (textChanged (const QString&)),
|
||||
this, SLOT (onNameChanged (const QString&)));
|
||||
connect (aSelectFileBtn, SIGNAL (clicked()), this, SLOT (onSelectClicked()));
|
||||
connect (myFolderApplyOpen, SIGNAL (clicked()), this, SLOT (onApplySelectClicked()));
|
||||
|
||||
resize (OPEN_DIALOG_WIDTH, OPEN_DIALOG_HEIGHT);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : OpenFile
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QString TInspectorEXE_OpenFileDialog::OpenFile (QWidget* theParent, const QString& theDataDirName)
|
||||
{
|
||||
QString aFileName;
|
||||
TInspectorEXE_OpenFileDialog* aDialog = new TInspectorEXE_OpenFileDialog(theParent, theDataDirName);
|
||||
if (aDialog->exec() == QDialog::Accepted)
|
||||
aFileName = aDialog->GetFileName();
|
||||
|
||||
return aFileName;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Communicator
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
TInspector_Communicator* TInspectorEXE_OpenFileDialog::Communicator()
|
||||
{
|
||||
if (!MyCommunicator)
|
||||
MyCommunicator = new TInspector_Communicator();
|
||||
return MyCommunicator;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onSampleSelectionChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileDialog::onSampleSelectionChanged (const QItemSelection& theSelected,
|
||||
const QItemSelection&)
|
||||
{
|
||||
QItemSelectionModel* aSelectionModel = (QItemSelectionModel*)sender();
|
||||
if (!aSelectionModel)
|
||||
return;
|
||||
if (theSelected.isEmpty())
|
||||
return;
|
||||
|
||||
QModelIndex anIndex = theSelected.first().indexes().first();
|
||||
if (!anIndex.isValid())
|
||||
return;
|
||||
|
||||
myFileName = aSelectionModel->model()->data (anIndex, Qt::ToolTipRole).toString();
|
||||
accept();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onNameChanged
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileDialog::onNameChanged (const QString& theText)
|
||||
{
|
||||
QFileInfo aFileInfo (theText);
|
||||
bool anExists = aFileInfo.exists() && aFileInfo.isFile();
|
||||
myFolderApplyOpen->setEnabled (anExists);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onSelectClicked
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileDialog::onSelectClicked()
|
||||
{
|
||||
QString anEnteredPath;
|
||||
QString aDirName = mySelectedName->text();
|
||||
if (!aDirName.isEmpty())
|
||||
{
|
||||
QDir aDir (aDirName);
|
||||
if (aDir.exists())
|
||||
anEnteredPath = aDirName;
|
||||
}
|
||||
|
||||
QString aFileName = QFileDialog::getOpenFileName (0, "Open document", anEnteredPath);
|
||||
|
||||
if (aFileName.isEmpty())
|
||||
return; // do nothing, left the previous value
|
||||
|
||||
mySelectedName->setText (aFileName);
|
||||
onNameChanged (aFileName);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : onApplySelectClicked
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileDialog::onApplySelectClicked()
|
||||
{
|
||||
myFileName = mySelectedName->text();
|
||||
accept();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : createTableView
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QTableView* TInspectorEXE_OpenFileDialog::createTableView (const QStringList& theFileNames)
|
||||
{
|
||||
QTableView* aTableView = new QTableView (this);
|
||||
aTableView->setFrameStyle (QFrame::NoFrame);
|
||||
QPalette aPalette = aTableView->viewport()->palette();
|
||||
QColor aWindowColor = aPalette.color (QPalette::Window);
|
||||
aPalette.setBrush (QPalette::Base, aWindowColor);
|
||||
aTableView->viewport()->setPalette (aPalette);
|
||||
|
||||
aTableView->horizontalHeader()->setVisible (false);
|
||||
aTableView->verticalHeader()->setVisible (false);
|
||||
aTableView->setGridStyle (Qt::NoPen);
|
||||
aTableView->setModel (createModel (theFileNames));
|
||||
aTableView->setItemDelegateForRow (0, new TInspectorEXE_OpenFileItemDelegate (aTableView,
|
||||
aPalette.color (QPalette::Highlight)));
|
||||
aTableView->viewport()->setAttribute (Qt::WA_Hover);
|
||||
int aCellHeight = ICON_SIZE + aTableView->verticalHeader()->defaultSectionSize();
|
||||
aTableView->setRowHeight (0, aCellHeight);
|
||||
int aScrollHeight = aTableView->horizontalScrollBar()->sizeHint().height();
|
||||
aTableView->setMinimumHeight (aCellHeight + aScrollHeight);
|
||||
QItemSelectionModel* aSelectionModel = new QItemSelectionModel (aTableView->model());
|
||||
connect (aSelectionModel, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
|
||||
this, SLOT (onSampleSelectionChanged (const QItemSelection&, const QItemSelection&)));
|
||||
aTableView->setSelectionModel (aSelectionModel);
|
||||
|
||||
return aTableView;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : createModel
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QAbstractItemModel* TInspectorEXE_OpenFileDialog::createModel (const QStringList& theFileNames)
|
||||
{
|
||||
TInspectorEXE_OpenFileViewModel* aModel = new TInspectorEXE_OpenFileViewModel (this);
|
||||
aModel->Init (theFileNames);
|
||||
return aModel;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : readSampleNames
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QStringList TInspectorEXE_OpenFileDialog::readSampleNames()
|
||||
{
|
||||
QStringList aNames;
|
||||
|
||||
QDir aDir(myDataDir);
|
||||
aDir.setSorting(QDir::Name);
|
||||
|
||||
QFileInfoList aDirEntries = aDir.entryInfoList();
|
||||
for (int aDirId = 0; aDirId < aDirEntries.size(); ++aDirId)
|
||||
{
|
||||
QFileInfo aFileInfo = aDirEntries.at(aDirId);
|
||||
if (aFileInfo.isFile())
|
||||
aNames.append (aFileInfo.absoluteFilePath());
|
||||
}
|
||||
return aNames;
|
||||
}
|
@@ -1,143 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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 TInspectorEXE_OpenFileDialog_H
|
||||
#define TInspectorEXE_OpenFileDialog_H
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#endif
|
||||
#include <QDialog>
|
||||
#include <QItemSelection>
|
||||
#include <QStringList>
|
||||
|
||||
#include <map>
|
||||
|
||||
class TInspector_Communicator;
|
||||
|
||||
class QAbstractItemModel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QTableView;
|
||||
class QToolButton;
|
||||
class QWidget;
|
||||
|
||||
//! \class TInspectorEXE_OpenButton
|
||||
//! Class that contains push button and the button processing. It obtains a file name from the default or current
|
||||
//! directory and gives the name into TInspector communicator
|
||||
//! Object name of the button is the name of the plugin to get the default directory, or the current directory is used.
|
||||
class TInspectorEXE_OpenButton : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
TInspectorEXE_OpenButton (QObject* theParent) : QObject (theParent), myStartButton (0) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~TInspectorEXE_OpenButton() {}
|
||||
|
||||
//! Returns the start button, if this is the first call, it creates the button and connect it to the slot
|
||||
QPushButton* StartButton();
|
||||
|
||||
//! Sets the default directory of plugin.
|
||||
void SetPluginDir (const TCollection_AsciiString& thePluginName, const TCollection_AsciiString& theDefaultDir)
|
||||
{ myDefaultDirs.Bind (thePluginName, theDefaultDir); }
|
||||
|
||||
private slots:
|
||||
|
||||
//! Processes the button click, open default/current directory to select open file, calls OpenFile of communicator
|
||||
void onStartButtonClicked();
|
||||
|
||||
private:
|
||||
|
||||
QPushButton* myStartButton; //!< processed button
|
||||
NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> myDefaultDirs; //!< plugins default directories
|
||||
};
|
||||
|
||||
//! \class TInspectorEXE_OpenFileDialog
|
||||
//! Control that contains table view of samples and line to select a file name from other directory.
|
||||
//! Click on element of samples table view calls this sample opening else after entering(or opening) file name
|
||||
//! the import becomes active. Click on the button will open selected file if it is possible
|
||||
class TInspectorEXE_OpenFileDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
||||
//! Constructor
|
||||
TInspectorEXE_OpenFileDialog (QWidget* theParent, const QString& theDataDirName);
|
||||
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~TInspectorEXE_OpenFileDialog() Standard_OVERRIDE {}
|
||||
|
||||
//! Opens this file dialog using for samples view the given directory and try to open new file
|
||||
//! \param theParent a parent for the new dialog
|
||||
//! \param theDataDirName path to default samples directory
|
||||
//! \returns a file name from the open file dialog
|
||||
static QString OpenFile (QWidget* theParent, const QString& theDataDirName);
|
||||
|
||||
//! Returns selection name from the dialog
|
||||
QString GetFileName() const { return myFileName; }
|
||||
|
||||
//! Returns communicator, if this is the first call, create a communicator instance
|
||||
static TInspector_Communicator* Communicator();
|
||||
|
||||
private slots:
|
||||
|
||||
//! Stores name of selected sample file
|
||||
void onSampleSelectionChanged (const QItemSelection& theSelected, const QItemSelection& theDeselected);
|
||||
|
||||
//! Updates enabling state of Open file button, it is enabled if the file by the entered path exists
|
||||
//! \param theText a file name text in line edit
|
||||
void onNameChanged (const QString& theText);
|
||||
|
||||
//! Open file dialog to select a file name. Fills file name line, enable import button
|
||||
void onSelectClicked();
|
||||
|
||||
//! Accepts open file dialog
|
||||
void onApplySelectClicked();
|
||||
|
||||
private:
|
||||
|
||||
//! Creates view of file names in samples directory
|
||||
//! \param theFileNames a container of names
|
||||
//! \return table view
|
||||
QTableView* createTableView (const QStringList& theFileNames);
|
||||
|
||||
//! Creates view model and fills it by the file names
|
||||
//! \param theFileNames a container of names
|
||||
//! \return model
|
||||
QAbstractItemModel* createModel (const QStringList& theFileNames);
|
||||
|
||||
//! Generates container of file names in samples directory
|
||||
//! \return container of names
|
||||
QStringList readSampleNames();
|
||||
|
||||
private:
|
||||
|
||||
QString myDataDir; //!< samples directory
|
||||
QString myFileName; //!< result file name
|
||||
QTableView* mySamplesView; //! <view of sample file names
|
||||
QLineEdit* mySelectedName; //!< alternative control to open file
|
||||
QToolButton* myFolderApplyOpen; //! button to open file
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,75 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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 <TInspectorEXE_OpenFileViewModel.hxx>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QIcon>
|
||||
#include <QPainter>
|
||||
|
||||
const int ICON_SIZE = 40;
|
||||
|
||||
// =======================================================================
|
||||
// function : paint
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileItemDelegate::paint (QPainter* thePainter, const QStyleOptionViewItem& theOption,
|
||||
const QModelIndex& theIndex) const
|
||||
{
|
||||
// highlight cell
|
||||
if (theOption.state & QStyle::State_MouseOver)
|
||||
thePainter->fillRect (theOption.rect, myColor);
|
||||
|
||||
// action icon for all indices before the last one
|
||||
QIcon anIcon (":/icons/folder_import.png");
|
||||
QSize anIconSize (ICON_SIZE, ICON_SIZE);
|
||||
int aWidth = theOption.rect.width();
|
||||
int aCenter = aWidth / 2.;
|
||||
int aHalf = anIconSize.width() / 2.;
|
||||
int aMargin = qApp->style()->pixelMetric (QStyle::PM_HeaderMargin);
|
||||
thePainter->drawPixmap (QRect (theOption.rect.left() + (aCenter - aHalf),
|
||||
theOption.rect.top() + aMargin,
|
||||
anIconSize.width(),
|
||||
anIconSize.height()),
|
||||
anIcon.pixmap(anIconSize.width(), anIconSize.height()));
|
||||
// default paint
|
||||
QItemDelegate::paint (thePainter, theOption, theIndex);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : Init
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void TInspectorEXE_OpenFileViewModel::Init (const QStringList& theValues)
|
||||
{
|
||||
myValues = theValues;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : data
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
QVariant TInspectorEXE_OpenFileViewModel::data (const QModelIndex& theIndex, int theRole) const
|
||||
{
|
||||
switch (theRole)
|
||||
{
|
||||
case Qt::DisplayRole: return QFileInfo (myValues[theIndex.column()]).fileName();
|
||||
case Qt::ToolTipRole: return myValues[theIndex.column()];
|
||||
case Qt::TextAlignmentRole: return QVariant (Qt::AlignBottom | Qt::AlignHCenter);
|
||||
default: break;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
// Created on: 2017-06-16
|
||||
// Created by: Natalia ERMOLAEVA
|
||||
// Copyright (c) 2017 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 TInspectorEXE_OpenFileViewModel_H
|
||||
#define TInspectorEXE_OpenFileViewModel_H
|
||||
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#endif
|
||||
#include <QAbstractTableModel>
|
||||
#include <QStringList>
|
||||
#include <QItemDelegate>
|
||||
|
||||
class QObject;
|
||||
class QPainter;
|
||||
|
||||
//! \class TInspectorEXE_OpenFileItemDelegate
|
||||
//! Draws large(40x40) icons in cell. The icon background in colored in highlight when mouse is over button
|
||||
class TInspectorEXE_OpenFileItemDelegate : public QItemDelegate
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
TInspectorEXE_OpenFileItemDelegate (QObject* theParent, const QColor& theHighlightColor)
|
||||
: QItemDelegate (theParent), myColor(theHighlightColor) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~TInspectorEXE_OpenFileItemDelegate() {}
|
||||
|
||||
//! Draw an icon in the cell
|
||||
//! \param thePainter a painter
|
||||
//! \param theOption a paint options
|
||||
//! \param theIndex a view index
|
||||
virtual void paint (QPainter* thePainter, const QStyleOptionViewItem& theOption,
|
||||
const QModelIndex& theIndex) const Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
QColor myColor; //!< highlight color
|
||||
};
|
||||
|
||||
//! \class TInspectorEXE_OpenFileViewModel
|
||||
//! Table model that visualizes container of string values (file names)
|
||||
//! Table orientation is horizontal, it has 1 row, number of columns equals to number of values
|
||||
class TInspectorEXE_OpenFileViewModel : public QAbstractTableModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
TInspectorEXE_OpenFileViewModel (QObject* theParent = 0) : QAbstractTableModel (theParent) {}
|
||||
|
||||
//! Destructor
|
||||
virtual ~TInspectorEXE_OpenFileViewModel() {}
|
||||
|
||||
//! Store values
|
||||
//! \param theValues a container of values to fill model
|
||||
void Init (const QStringList& theValues);
|
||||
|
||||
//! Returns content of the model index for the given role, it is obtained from internal container of values
|
||||
//! It returns value only for DisplayRole.
|
||||
//! \param theIndex a model index
|
||||
//! \param theRole a view role
|
||||
//! \return value intepreted depending on the given role
|
||||
virtual QVariant data (const QModelIndex& theIndex, int theRole = Qt::DisplayRole) const Standard_OVERRIDE;
|
||||
|
||||
//! Returns number of rows
|
||||
//! \param theParent an index of the parent item
|
||||
//! \return an integer value
|
||||
virtual int rowCount (const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE
|
||||
{ (void)theParent; return 1; }
|
||||
|
||||
//! Returns number of columns
|
||||
//! \param theParent an index of the parent item
|
||||
//! \return an integer value
|
||||
virtual int columnCount (const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE
|
||||
{ (void)theParent; return myValues.size(); }
|
||||
|
||||
private:
|
||||
|
||||
QStringList myValues; //!< file names
|
||||
};
|
||||
|
||||
#endif
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,127 +0,0 @@
|
||||
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
|
||||
project (TStandalone)
|
||||
|
||||
set (CASROOT "" CACHE PATH "Third party OpenCascade dir" )
|
||||
set (3RDPARTY_DIR "" CACHE PATH "Third party dir" )
|
||||
set (INSTALL_DIR "" CACHE PATH "Where to install" )
|
||||
|
||||
set (USE_QT4 ON CACHE BOOL "${USE_QT4}")
|
||||
|
||||
if (NOT "$ENV{CASROOT}" STREQUAL "" AND EXISTS "$ENV{CASROOT}")
|
||||
set (CASROOT "$ENV{CASROOT}")
|
||||
#set (3RDPARTY_OCCT_DIR "${CASROOT}")
|
||||
#message("Environment CASROOT: ${CASROOT}")
|
||||
#message("Environment 3RDPARTY_OCCT_DIR: ${CASROOT}")
|
||||
endif()
|
||||
|
||||
if (NOT "$ENV{THIRDPARTY_DIR}" STREQUAL "" AND EXISTS "$ENV{THIRDPARTY_DIR}")
|
||||
set (3RDPARTY_DIR "$ENV{THIRDPARTY_DIR}")
|
||||
message("Environment THIRDPARTY_DIR: ${3RDPARTY_DIR}")
|
||||
endif()
|
||||
|
||||
if (NOT "$ENV{INSTALL_DIR}" STREQUAL "")
|
||||
set (INSTALL_DIR "$ENV{INSTALL_DIR}")
|
||||
message("Environment INSTALL_DIR: ${INSTALL_DIR}")
|
||||
endif()
|
||||
|
||||
# Define the next variable to has defined 3rdParties DLL dir variables
|
||||
set (BUILD_SHARED_LIBS ON)
|
||||
|
||||
set (CASROOT_SOURCE_FILES "${CMAKE_SOURCE_DIR}/../../.." CACHE PATH "OCCT sources dir to find tools packages" )
|
||||
if ("${CASROOT}" STREQUAL "")
|
||||
set (CASROOT "${CASROOT_SOURCE_FILES}/work/install" CACHE PATH "OCCT sources dir to find tools packages" )
|
||||
endif()
|
||||
|
||||
macro (OCCT_INCLUDE_CMAKE_FILE BEING_INCLUDED_FILE)
|
||||
include (${CASROOT_SOURCE_FILES}/${BEING_INCLUDED_FILE}.cmake)
|
||||
endmacro()
|
||||
|
||||
macro (OCCT_INCLUDE_CMAKE_FILE_STANDALONE BEING_INCLUDED_FILE)
|
||||
include (${CMAKE_SOURCE_DIR}/${BEING_INCLUDED_FILE}.cmake)
|
||||
endmacro()
|
||||
|
||||
set (ADDITIONAL_DLL_DIR "" CACHE PATH "Additional paths that should be included into PATH" )
|
||||
if (NOT "$ENV{ADDITIONAL_DLL_DIR}" STREQUAL "")
|
||||
set (ADDITIONAL_DLL_DIR "$ENV{ADDITIONAL_DLL_DIR}")
|
||||
message("Environment ADDITIONAL_DLL_DIR: ${ADDITIONAL_DLL_DIR}")
|
||||
endif()
|
||||
|
||||
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE("adm/cmake/occt")
|
||||
if (OCCT_LIBRARY_NOT_FOUND)
|
||||
message (FATAL_ERROR "Could NOT find OCCT Library in : ${3RDPARTY_OCCT_LIBRARY_DIR}" )
|
||||
endif()
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
|
||||
set (INSTALL_API_DIR "${INSTALL_DIR}/api" CACHE PATH "" FORCE)
|
||||
set (INSTALL_DIR_BIN "${OS_WITH_BIT}/${COMPILER}/bin" CACHE PATH "" FORCE)
|
||||
set (INSTALL_DIR_LIB "${OS_WITH_BIT}/${COMPILER}/lib" CACHE PATH "" FORCE)
|
||||
set (INSTALL_DIR_INCLUDE "inc" CACHE PATH "")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gl2ps")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
#include (${CMAKE_SOURCE_DIR}/adm/cmake/3rdparty.cmake)
|
||||
|
||||
set (3RDPARTY_DLL_PATH "${USED_3RDPARTY_OCCT_DIRS};\
|
||||
${USED_3RDPARTY_FREETYPE_DIR};\
|
||||
${USED_3RDPARTY_FREEIMAGE_DIRS};\
|
||||
${USED_3RDPARTY_GL2PS_DIRS};\
|
||||
${3RDPARTY_QT_DIR}/bin;\
|
||||
${3RDPARTY_TBB_DLL_DIR}")
|
||||
|
||||
if (ADDITIONAL_DLL_DIR)
|
||||
set (3RDPARTY_DLL_PATH "${3RDPARTY_DLL_PATH};\
|
||||
${ADDITIONAL_DLL_DIR}")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_DLL_DEB_PATH "${3RDPARTY_DLL_PATH}")
|
||||
|
||||
|
||||
set (BUILD_TOOLKITS
|
||||
TKTInspectorAPI
|
||||
TKView
|
||||
TKTreeModel
|
||||
TKDFBrowser
|
||||
TKVInspector
|
||||
TKShapeView
|
||||
TKTInspector
|
||||
TKToolsDraw
|
||||
)
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all header files into ${CMAKE_BINARY_DIR}/inc ...")
|
||||
# collect all the headers to <binary dir>/inc folder
|
||||
COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" "${CASROOT_SOURCE_FILES}/tools" "${INSTALL_DIR_INCLUDE}")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/standalone_macros")
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/qt5_macro")
|
||||
|
||||
set (BUILD_PROJECTS
|
||||
TInspectorAPI
|
||||
View
|
||||
TreeModel
|
||||
DFBrowserPane
|
||||
DFBrowserPaneXDE
|
||||
DFBrowser
|
||||
ShapeView
|
||||
VInspector
|
||||
TInspector
|
||||
TInspectorEXE
|
||||
ToolsDraw
|
||||
)
|
||||
# include patched toolkit projects or original ones
|
||||
foreach (PROJECT_ITEM ${BUILD_PROJECTS})
|
||||
OCCT_ADD_SUBDIRECTORY ("src/${PROJECT_ITEM}")
|
||||
endforeach()
|
@@ -1,75 +0,0 @@
|
||||
#freeimage
|
||||
|
||||
if(NOT "${CASROOT}" STREQUAL "")
|
||||
#message(FATAL_ERROR, "Empty OCCT dir")
|
||||
#return()
|
||||
#set("3RDPARTY_OCCT_DIR ${CASROOT}")
|
||||
endif()
|
||||
|
||||
#set(3RDPARTY_OCC_DIR ${CASROOT})
|
||||
#message("3RDPARTY_OCC_DIR: ${3RDPARTY_OCC_DIR}")
|
||||
#set("3RDPARTY_OCC_DIR ${3RDPARTY_OCCT_DIR}")
|
||||
#message("3RDPARTY_OCC_DIR: ${3RDPARTY_OCC_DIR}")
|
||||
|
||||
set(CSF_TKernel "TKernel")
|
||||
THIRDPARTY_PRODUCT("OCCT" "Standard.hxx" "CSF_TKernel" "")
|
||||
|
||||
set(3RDPARTY_OCCT_DIR ${3RDPARTY_OCC_DIR} CACHE PATH "OCCT dir")
|
||||
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
SET(3RDPARTY_OCCT_INCLUDE_DIR "${3RDPARTY_OCC_INCLUDE_DIR}" CACHE PATH "OCCT include dir")
|
||||
SET(3RDPARTY_OCCT_LIBRARY_DIR "${3RDPARTY_OCC_LIBRARY_DIR}" CACHE PATH "OCCT library dir")
|
||||
SET(3RDPARTY_OCCT_DLL_DIR "${3RDPARTY_OCC_DLL_DIR}" CACHE PATH "OCCT dll dir")
|
||||
|
||||
SET(CSF_StandardDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT Standard Resource")
|
||||
SET(CSF_XCAFDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT XCAF Defaults")
|
||||
SET(CSF_PluginDefaults_DIR ${CASROOT}/src/StdResource CACHE PATH "OCCT Plugin Defaults")
|
||||
|
||||
message (STATUS "... OCCT dir: ${3RDPARTY_OCCT_DIR}")
|
||||
message (STATUS "... OCCT Include dirs: ${3RDPARTY_OCCT_INCLUDE_DIR}")
|
||||
message (STATUS "... OCCT Library dirs: ${3RDPARTY_OCCT_LIBRARY_DIRS}")
|
||||
message (STATUS "... OCCT Binary dirs: ${3RDPARTY_OCCT_DLL_DIRS}")
|
||||
|
||||
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${3RDPARTY_OCCT_LIBRARY_DIRS}")
|
||||
|
||||
find_library(TKernel TKernel PATHS "${3RDPARTY_OCCT_LIBRARY_DIRS}"
|
||||
PATH_SUFFIXES lib
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if ("${TKernel}" STREQUAL "TKernel-NOTFOUND")
|
||||
set (OCCT_LIBRARY_NOT_FOUND ON)
|
||||
endif()
|
||||
|
||||
find_library(TKMath TKMath)
|
||||
|
||||
find_library(TKCAF TKCAF)
|
||||
find_library(TKCDF TKCDF)
|
||||
find_library(TKLCAF TKLCAF)
|
||||
find_library(TKVCAF TKVCAF)
|
||||
|
||||
find_library(TKBRep TKBRep)
|
||||
find_library(TKService TKService)
|
||||
|
||||
find_library(TKOpenGl TKOpenGl)
|
||||
find_library(TKV3d TKV3d)
|
||||
|
||||
find_library(TKXCAF TKXCAF)
|
||||
find_library(TKXSBase TKXSBase)
|
||||
find_library(TKXDESTEP TKXDESTEP)
|
||||
find_library(TKXmlXCAF TKXmlXCAF)
|
||||
find_library(TKXml TKXml)
|
||||
|
||||
find_library(TKBin TKBin)
|
||||
find_library(TKBinL TKBinL)
|
||||
find_library(TKBinXCAF TKBinXCAF)
|
||||
|
||||
find_library(TKStd TKStd)
|
||||
find_library(TKXmlL TKXmlL)
|
||||
find_library(TKStdL TKStdL)
|
||||
# VInspector additionally:
|
||||
find_library(TKBO TKBO)
|
||||
# ShapeView additionally:
|
||||
find_library(TKGeomBase TKGeomBase)
|
||||
find_library(TKG3d TKG3d)
|
@@ -1,115 +0,0 @@
|
||||
# script for each OCCT toolkit
|
||||
|
||||
#Qt dependencies
|
||||
#message ("Project is ${PROJECT_NAME}")
|
||||
if (EXECUTABLE_PROJECT)
|
||||
set (PACKAGE_PREFIX_DIR "samples/tools")
|
||||
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}/../${PROJECT_NAME})
|
||||
include_directories("${SOURCE_DIR}")
|
||||
#message("Inc dir: ${CMAKE_SOURCE_DIR}/../${PROJECT_NAME}")
|
||||
else()
|
||||
set (PACKAGE_PREFIX_DIR "tools")
|
||||
SET(SOURCE_DIR ${CASROOT_SOURCE_FILES}/${PACKAGE_PREFIX_DIR}/${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
FIND_SOURCES_AND_HEADERS_FILES(${SOURCE_DIR} SOURCE_FILES HEADER_FILES)
|
||||
|
||||
#message ("Source dir is ${SOURCE_DIR}")
|
||||
#message ("Sources are ${SOURCE_FILES}")
|
||||
|
||||
unset(RCC_FILES)
|
||||
if (USE_QT)
|
||||
FIND_QT5_PACKAGE(PROJECT_LIBRARIES_DEBUG PROJECT_LIBRARIES_RELEASE PROJECT_INCLUDES)
|
||||
|
||||
FIND_AND_WRAP_MOC_FILES("${SOURCE_FILES}")
|
||||
FIND_AND_WRAP_RESOURCE_FILE("${SOURCE_DIR}/${PROJECT_NAME}.qrc" RCC_FILES)
|
||||
|
||||
endif()
|
||||
|
||||
if (TOOLKIT_NAME)
|
||||
set(TARGET_NAME TK${PROJECT_NAME})
|
||||
else ()
|
||||
set(TARGET_NAME ${PROJECT_NAME})
|
||||
endif()
|
||||
|
||||
if (EXECUTABLE_PROJECT)
|
||||
add_executable (${TARGET_NAME} ${SOURCE_FILES} ${HEADER_FILES})
|
||||
else()
|
||||
add_library(${TARGET_NAME} SHARED ${SOURCE_FILES} ${HEADER_FILES})
|
||||
endif()
|
||||
|
||||
|
||||
include_directories(
|
||||
${PROJECT_INCLUDES}
|
||||
${SOURCE_DIR}
|
||||
${3RDPARTY_OCCT_INCLUDE_DIR}
|
||||
"${CMAKE_BINARY_DIR}/inc")
|
||||
|
||||
add_definitions(-D__WIN32__)
|
||||
add_definitions(-DWNT)
|
||||
add_definitions(-D${PROJECT_NAME}_EXPORTS)
|
||||
|
||||
# parce EXTERNLIB file
|
||||
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
|
||||
if (NOT COMMENT_FOUND)
|
||||
set (LIB_ITEM ${USED_ITEM})
|
||||
set (LIB_PARSED_ITEM ${${USED_ITEM}})
|
||||
|
||||
if (LIB_PARSED_ITEM)
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${${USED_ITEM}})
|
||||
#message("Append external lib: ${${USED_ITEM}}")
|
||||
else ()
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
||||
#message("Append lib: ${USED_ITEM}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
target_link_libraries (${TARGET_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT})
|
||||
|
||||
if (USE_QT)
|
||||
target_link_libraries (${TARGET_NAME} debug ${PROJECT_LIBRARIES_DEBUG})
|
||||
target_link_libraries (${TARGET_NAME} optimized ${PROJECT_LIBRARIES_RELEASE})
|
||||
|
||||
if (NOT "${RCC_FILES}" STREQUAL "")
|
||||
#message("RCC files: ${RCC_FILES}")
|
||||
target_sources(${TARGET_NAME} PRIVATE ${RCC_FILES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (EXECUTABLE_PROJECT)
|
||||
INSTALL(TARGETS ${TARGET_NAME} DESTINATION "${INSTALL_DIR_BIN}")
|
||||
else()
|
||||
if (MSVC)
|
||||
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
|
||||
DESTINATION "${INSTALL_DIR_BIN}"
|
||||
FILES_MATCHING PATTERN *.pdb)
|
||||
if (INSTALL_API_DIR)
|
||||
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
|
||||
DESTINATION "${INSTALL_API_DIR}/bin"
|
||||
FILES_MATCHING PATTERN *.pdb)
|
||||
endif()
|
||||
endif()
|
||||
install (TARGETS ${TARGET_NAME}
|
||||
RUNTIME DESTINATION "${INSTALL_DIR_BIN}"
|
||||
ARCHIVE DESTINATION "${INSTALL_DIR_LIB}"
|
||||
LIBRARY DESTINATION "${INSTALL_DIR_LIB}")
|
||||
|
||||
if (INSTALL_API_DIR)
|
||||
install (TARGETS ${TARGET_NAME}
|
||||
RUNTIME DESTINATION "${INSTALL_API_DIR}/bin")
|
||||
|
||||
if (INSTALL_API)
|
||||
INSTALL(FILES ${HEADER_FILES} DESTINATION "${INSTALL_API_DIR}/${INSTALL_DIR_INCLUDE}")
|
||||
|
||||
install (DIRECTORY ${PROJECT_BINARY_DIR}/Debug/
|
||||
DESTINATION "${INSTALL_API_DIR}/lib"
|
||||
FILES_MATCHING PATTERN *.lib)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
@@ -1,33 +0,0 @@
|
||||
#freeimage
|
||||
|
||||
macro (FIND_SOURCES_AND_HEADERS_FILES CURRENT_SOURCES_DIR SOURCE_FILES HEADER_FILES)
|
||||
if (EXISTS "${CURRENT_SOURCES_DIR}/FILES")
|
||||
file (STRINGS "${CURRENT_SOURCES_DIR}/FILES" HEADER_FILES_H REGEX ".+[.]h")
|
||||
file (STRINGS "${CURRENT_SOURCES_DIR}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
|
||||
|
||||
if (NOT "${HEADER_FILES_H}" STREQUAL "")
|
||||
foreach (ORIGIN_FILE ${HEADER_FILES_H})
|
||||
list (APPEND HEADER_FILES_ ${CURRENT_SOURCES_DIR}/${ORIGIN_FILE})
|
||||
endforeach()
|
||||
|
||||
#message("${HEADER_FILES_}")
|
||||
set(${HEADER_FILES} ${HEADER_FILES_})
|
||||
endif()
|
||||
|
||||
if(NOT "${SOURCE_FILES_C}" STREQUAL "")
|
||||
foreach (ORIGIN_FILE ${SOURCE_FILES_C})
|
||||
list (APPEND SOURCE_FILES_ ${CURRENT_SOURCES_DIR}/${ORIGIN_FILE})
|
||||
endforeach()
|
||||
|
||||
#message("${SOURCE_FILES_}")
|
||||
set(${SOURCE_FILES} ${SOURCE_FILES_})
|
||||
endif()
|
||||
|
||||
#set(${HEADER_FILES} ${HEADER_FILES_H})
|
||||
#set(${SOURCE_FILES} ${SOURCE_FILES_C})
|
||||
|
||||
else()
|
||||
message(WARNING "file FILES is absent in $TARGET")
|
||||
endif()
|
||||
|
||||
endmacro()
|
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
|
||||
DATA_DIR=@INSTALL_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
|
||||
</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
|
||||
DATA_DIR=@INSTALL_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
|
||||
</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<LocalDebuggerEnvironment>PATH=@3RDPARTY_DLL_DEB_PATH@;@CMAKE_INSTALL_PREFIX@/@INSTALL_DIR_BIN@;%PATH%
|
||||
DATA_DIR=@INSTALL_DIR@/data
|
||||
QTDIR=@3RDPARTY_QT_DIR@
|
||||
CSF_OCCTDataPath=@3RDPARTY_OCCT_DIR@/data
|
||||
CSF_ShadersDirectory=@CASROOT@/src/Shaders
|
||||
</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
|
||||
</PropertyGroup>
|
||||
</Project>
|
@@ -1 +0,0 @@
|
||||
@OCCT_HEADER_FILE_CONTENT@
|
@@ -1,11 +0,0 @@
|
||||
project(DFBrowser)
|
||||
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
unset (TOOLKIT_NAME)
|
@@ -1,29 +0,0 @@
|
||||
DFBrowserPane
|
||||
DFBrowserPaneXDE
|
||||
TKBRep
|
||||
TKMath
|
||||
TKV3d
|
||||
TKBRep
|
||||
TKBin
|
||||
TKBinL
|
||||
TKBinXCAF
|
||||
TKCAF
|
||||
TKCDF
|
||||
TKernel
|
||||
TKLCAF
|
||||
TKMath
|
||||
TKOpenGl
|
||||
TKService
|
||||
TKStd
|
||||
TKStdL
|
||||
TKTInspector
|
||||
TKTInspectorAPI
|
||||
TKTreeModel
|
||||
TKV3d
|
||||
TKView
|
||||
TKXSBase
|
||||
TKXCAF
|
||||
TKXDESTEP
|
||||
TKXmlXCAF
|
||||
TKXml
|
||||
TKXmlL
|
@@ -1,5 +0,0 @@
|
||||
project(DFBrowserPane)
|
||||
|
||||
set (USE_QT ON)
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
unset (USE_QT)
|
@@ -1,12 +0,0 @@
|
||||
TKG3d
|
||||
TKTInspectorAPI
|
||||
TKTreeModel
|
||||
TKernel
|
||||
TKMath
|
||||
TKService
|
||||
TKV3d
|
||||
TKVCAF
|
||||
TKCDF
|
||||
TKCAF
|
||||
TKLCAF
|
||||
TKBRep
|
@@ -1,5 +0,0 @@
|
||||
project(DFBrowserPaneXDE)
|
||||
|
||||
set (USE_QT ON)
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
unset (USE_QT)
|
@@ -1,7 +0,0 @@
|
||||
DFBrowserPane
|
||||
TKernel
|
||||
TKTInspectorAPI
|
||||
TKXSBase
|
||||
TKXDESTEP
|
||||
TKBRep
|
||||
TKXCAF
|
@@ -1,11 +0,0 @@
|
||||
project(ShapeView)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
unset (TOOLKIT_NAME)
|
||||
|
||||
|
@@ -1,8 +0,0 @@
|
||||
TKBRep
|
||||
TKGeomBase
|
||||
TKG3d
|
||||
TKMath
|
||||
TKTInspectorAPI
|
||||
TKTreeModel
|
||||
TKService
|
||||
TKView
|
@@ -1,11 +0,0 @@
|
||||
project(TInspector)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
set (INSTALL_API ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
unset (TOOLKIT_NAME)
|
||||
unset (INSTALL_API)
|
@@ -1,2 +0,0 @@
|
||||
TKernel
|
||||
TKTInspectorAPI
|
@@ -1,10 +0,0 @@
|
||||
project(TInspectorAPI)
|
||||
|
||||
set (TOOLKIT_NAME ON)
|
||||
set (INSTALL_API ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (TOOLKIT_NAME)
|
||||
unset (INSTALL_API)
|
||||
|
@@ -1,2 +0,0 @@
|
||||
TKernel
|
||||
TKLCAF
|
@@ -1,13 +0,0 @@
|
||||
project(TInspectorEXE)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (EXECUTABLE_PROJECT ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
unset (EXECUTABLE_PROJECT)
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/adm/templates/${PROJECT_NAME}.vcxproj.user.in
|
||||
${${PROJECT_NAME}_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user @ONLY)
|
||||
|
@@ -1,8 +0,0 @@
|
||||
TKBRep
|
||||
TKG3d
|
||||
TKService
|
||||
TKTInspector
|
||||
TKXCAF
|
||||
TKXDESTEP
|
||||
TKXSBase
|
||||
TKView
|
@@ -1,10 +0,0 @@
|
||||
project(TreeModel)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
|
@@ -1,9 +0,0 @@
|
||||
project(VInspector)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
unset (TOOLKIT_NAME)
|
@@ -1,10 +0,0 @@
|
||||
TKBO
|
||||
TKBRep
|
||||
TKG3d
|
||||
TKernel
|
||||
TKMath
|
||||
TKTInspectorAPI
|
||||
TKTreeModel
|
||||
TKService
|
||||
TKV3d
|
||||
TKView
|
@@ -1,9 +0,0 @@
|
||||
project(View)
|
||||
|
||||
set (USE_QT ON)
|
||||
set (TOOLKIT_NAME ON)
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE_STANDALONE ("adm/cmake/occt_toolkit_standalone")
|
||||
|
||||
unset (USE_QT)
|
||||
|
@@ -1,5 +0,0 @@
|
||||
TKernel
|
||||
TKMath
|
||||
TKService
|
||||
TKOpenGl
|
||||
TKV3d
|
@@ -691,9 +691,21 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
FitTextAlignmentForLinear (theFirstPoint, theSecondPoint, theIsOneSide, aHorisontalTextPos,
|
||||
aLabelPosition, isArrowsExternal);
|
||||
|
||||
// compute dimension line points
|
||||
gp_Pnt aLineBegPoint, aLineEndPoint;
|
||||
ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, aLineBegPoint, aLineEndPoint);
|
||||
// compute dimension line points
|
||||
gp_Ax1 aPlaneNormal = GetPlane().Axis();
|
||||
gp_Dir aTargetPointsVector = gce_MakeDir (theFirstPoint, theSecondPoint);
|
||||
|
||||
// compute flyout direction vector
|
||||
gp_Dir aFlyoutVector = aPlaneNormal.Direction() ^ aTargetPointsVector;
|
||||
|
||||
// create lines for layouts
|
||||
gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
|
||||
gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
|
||||
|
||||
// Get flyout end points
|
||||
gp_Pnt aLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint) + GetFlyout(), aLine1);
|
||||
gp_Pnt aLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
|
||||
|
||||
gp_Lin aDimensionLine = gce_MakeLin (aLineBegPoint, aLineEndPoint);
|
||||
|
||||
// compute arrows positions and directions
|
||||
@@ -984,27 +996,6 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
|
||||
mySelectionGeom.IsComputed = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeFlyoutLinePoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
|
||||
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
|
||||
{
|
||||
// compute dimension line points
|
||||
gp_Ax1 aPlaneNormal = GetPlane().Axis();
|
||||
// compute flyout direction vector
|
||||
gp_Dir aTargetPointsVector = gce_MakeDir (theFirstPoint, theSecondPoint);
|
||||
gp_Dir aFlyoutVector = aPlaneNormal.Direction() ^ aTargetPointsVector;
|
||||
// create lines for layouts
|
||||
gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
|
||||
gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
|
||||
|
||||
// Get flyout end points
|
||||
theLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint) + GetFlyout(), aLine1);
|
||||
theLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeLinearFlyouts
|
||||
//purpose :
|
||||
|
@@ -463,14 +463,6 @@ protected:
|
||||
const gp_Pnt& theSecondPoint,
|
||||
const Standard_Boolean theIsOneSide = Standard_False);
|
||||
|
||||
//! Computes points bounded the flyout line for linear dimension.
|
||||
//! @param theFirstPoint [in] the first attach point of linear dimension.
|
||||
//! @param theSecondPoint [in] the second attach point of linear dimension.
|
||||
//! @param theLineBegPoint [out] the first attach point of linear dimension.
|
||||
//! @param theLineEndPoint [out] the second attach point of linear dimension.
|
||||
Standard_EXPORT virtual void ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
|
||||
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint);
|
||||
|
||||
//! Compute selection sensitives for linear dimension flyout lines (length, diameter, radius).
|
||||
//! Please note that this method uses base dimension properties: working plane and flyout length.
|
||||
//! @param theSelection [in] the selection structure to fill with selection primitives.
|
||||
|
@@ -44,8 +44,7 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
|
||||
//=======================================================================
|
||||
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
|
||||
const TopoDS_Face& theSecondFace)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH),
|
||||
myHasCustomDirection (Standard_False)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH)
|
||||
{
|
||||
SetMeasuredGeometry (theFirstFace, theSecondFace);
|
||||
SetFlyout (15.0);
|
||||
@@ -57,8 +56,7 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
|
||||
//=======================================================================
|
||||
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
|
||||
const TopoDS_Edge& theEdge)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH),
|
||||
myHasCustomDirection (Standard_False)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH)
|
||||
{
|
||||
SetMeasuredGeometry (theFace, theEdge);
|
||||
SetFlyout (15.0);
|
||||
@@ -71,8 +69,7 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
|
||||
AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
|
||||
const gp_Pnt& theSecondPoint,
|
||||
const gp_Pln& thePlane)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH),
|
||||
myHasCustomDirection (Standard_False)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH)
|
||||
{
|
||||
SetMeasuredGeometry (theFirstPoint, theSecondPoint, thePlane);
|
||||
SetFlyout (15.0);
|
||||
@@ -85,8 +82,7 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
|
||||
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
|
||||
const TopoDS_Shape& theSecondShape,
|
||||
const gp_Pln& thePlane)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH),
|
||||
myHasCustomDirection (Standard_False)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH)
|
||||
{
|
||||
SetCustomPlane (thePlane);
|
||||
SetMeasuredShapes (theFirstShape, theSecondShape);
|
||||
@@ -99,8 +95,7 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
|
||||
//=======================================================================
|
||||
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge,
|
||||
const gp_Pln& thePlane)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH),
|
||||
myHasCustomDirection (Standard_False)
|
||||
: AIS_Dimension (AIS_KOD_LENGTH)
|
||||
{
|
||||
SetMeasuredGeometry (theEdge, thePlane);
|
||||
SetFlyout (15.0);
|
||||
@@ -266,13 +261,7 @@ void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUni
|
||||
//=======================================================================
|
||||
Standard_Real AIS_LengthDimension::ComputeValue() const
|
||||
{
|
||||
if (!IsValid())
|
||||
return 0.0;
|
||||
|
||||
if (!myHasCustomDirection)
|
||||
return myFirstPoint.Distance (mySecondPoint);
|
||||
|
||||
return fabs (gp_Vec(myFirstPoint, mySecondPoint).Dot (myDirection));
|
||||
return IsValid() ? myFirstPoint.Distance (mySecondPoint) : 0.0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -293,35 +282,6 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
|
||||
DrawLinearDimension (thePresentation, theMode, myFirstPoint, mySecondPoint);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeFlyoutLinePoints
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
|
||||
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
|
||||
{
|
||||
if (!myHasCustomDirection)
|
||||
{
|
||||
AIS_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint);
|
||||
return;
|
||||
}
|
||||
|
||||
// find scalar of projection target vector (from start to second point) to flyout vector
|
||||
gp_Ax1 aPlaneNormal = GetPlane().Axis();
|
||||
gp_Vec aFlyoutNormalizedDir(aPlaneNormal.Direction() ^ myDirection);
|
||||
aFlyoutNormalizedDir.Normalize();
|
||||
Standard_Real aTargetProjectedToFlyout = gp_Vec(theFirstPoint, theSecondPoint).Dot (aFlyoutNormalizedDir);
|
||||
|
||||
gp_Dir aFlyoutVector = aFlyoutNormalizedDir;
|
||||
// create lines for layouts
|
||||
gp_Lin aLine1 (theFirstPoint, aFlyoutVector);
|
||||
gp_Lin aLine2 (theSecondPoint, aFlyoutVector);
|
||||
|
||||
// Get flyout end points
|
||||
theLineBegPoint = ElCLib::Value (ElCLib::Parameter (aLine1, theFirstPoint) + GetFlyout() + aTargetProjectedToFlyout, aLine1);
|
||||
theLineEndPoint = ElCLib::Value (ElCLib::Parameter (aLine2, theSecondPoint) + GetFlyout(), aLine2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeFlyoutSelection
|
||||
//purpose :
|
||||
@@ -813,14 +773,3 @@ void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos)
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetDirection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_LengthDimension::SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection)
|
||||
{
|
||||
myHasCustomDirection = theUseDirection;
|
||||
if (myHasCustomDirection)
|
||||
myDirection = theDirection;
|
||||
}
|
||||
|
@@ -194,13 +194,6 @@ public:
|
||||
|
||||
Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE;
|
||||
|
||||
//! Set custom direction for dimension. If it is not set, the direction is obtained
|
||||
//! from the measured geometry (e.g. line between points of dimension)
|
||||
//! The direction does not change flyout direction of dimension.
|
||||
//! @param theDirection [in] the dimension direction.
|
||||
//! @param theUseDirection [in] boolean value if custom direction should be used.
|
||||
Standard_EXPORT void SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection = Standard_True);
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
|
||||
@@ -212,25 +205,12 @@ protected:
|
||||
|
||||
Standard_EXPORT virtual gp_Pln ComputePlane(const gp_Dir& theAttachDir) const;
|
||||
|
||||
//! Computes distance between dimension points. If custom direction is defined, the distance
|
||||
//! is a projection value of the distance between points to this direction
|
||||
//! @return dimension value
|
||||
Standard_EXPORT Standard_Real ComputeValue() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
|
||||
const Handle(Prs3d_Presentation)& thePresentation,
|
||||
const Standard_Integer theMode = 0) Standard_OVERRIDE;
|
||||
|
||||
//! Computes points bounded the flyout line for linear dimension.
|
||||
//! Direction of flyout line equal to the custom direction of dimension if defined or
|
||||
//! parallel to the main direction line
|
||||
//! @param theFirstPoint [in] the first attach point of linear dimension.
|
||||
//! @param theSecondPoint [in] the second attach point of linear dimension.
|
||||
//! @param theLineBegPoint [out] the first attach point of linear dimension.
|
||||
//! @param theLineEndPoint [out] the second attach point of linear dimension.
|
||||
Standard_EXPORT virtual void ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
|
||||
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Handle(SelectMgr_EntityOwner)& theEntityOwner) Standard_OVERRIDE;
|
||||
|
||||
@@ -283,8 +263,6 @@ private:
|
||||
gp_Pnt mySecondPoint;
|
||||
TopoDS_Shape myFirstShape;
|
||||
TopoDS_Shape mySecondShape;
|
||||
gp_Dir myDirection;
|
||||
Standard_Boolean myHasCustomDirection;
|
||||
};
|
||||
|
||||
#endif // _AIS_LengthDimension_HeaderFile
|
||||
|
@@ -37,100 +37,100 @@ static Handle(TCollection_HAsciiString) nulstr;
|
||||
static Handle(Interface_HArray1OfHAsciiString) nularr;
|
||||
|
||||
APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader
|
||||
(const Handle(StepData_StepModel)& model)
|
||||
(const Handle(StepData_StepModel)& model)
|
||||
{
|
||||
done = Standard_True;
|
||||
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileName))) {
|
||||
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName))) {
|
||||
fn = GetCasted(HeaderSection_FileName,
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName)));
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileName)));
|
||||
}
|
||||
else done = Standard_False;
|
||||
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema))) {
|
||||
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) {
|
||||
fs = GetCasted(HeaderSection_FileSchema,
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema)));
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema)));
|
||||
}
|
||||
else done = Standard_False;
|
||||
if (model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription))) {
|
||||
if (model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileDescription))) {
|
||||
fd = GetCasted(HeaderSection_FileDescription,
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)));
|
||||
model->HeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)));
|
||||
}
|
||||
else done = Standard_False;
|
||||
}
|
||||
|
||||
APIHeaderSection_MakeHeader::APIHeaderSection_MakeHeader
|
||||
(const Standard_Integer shapetype)
|
||||
(const Standard_Integer shapetype)
|
||||
{
|
||||
switch (shapetype) {
|
||||
case 1: Init("Open CASCADE Facetted BRep Model"); break;
|
||||
case 2: Init("Open CASCADE Face Based Surface Model"); break;
|
||||
case 3: Init("Open CASCADE Shell Based Surface Model"); break;
|
||||
case 4: Init("Open CASCADE Manifold Solid Brep Model"); break;
|
||||
default: Init("Open CASCADE Shape Model"); break;
|
||||
switch(shapetype) {
|
||||
case 1 : Init ("Open CASCADE Facetted BRep Model"); break;
|
||||
case 2 : Init ("Open CASCADE Face Based Surface Model"); break;
|
||||
case 3 : Init ("Open CASCADE Shell Based Surface Model"); break;
|
||||
case 4 : Init ("Open CASCADE Manifold Solid Brep Model"); break;
|
||||
default: Init ("Open CASCADE Shape Model"); break;
|
||||
}
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::Init(const Standard_CString nameval)
|
||||
void APIHeaderSection_MakeHeader::Init (const Standard_CString nameval)
|
||||
{
|
||||
done = Standard_True;
|
||||
|
||||
|
||||
// - File Name
|
||||
char timestamp[50];
|
||||
|
||||
|
||||
if (fn.IsNull()) fn = new HeaderSection_FileName;
|
||||
Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(nameval);
|
||||
fn->SetName(name);
|
||||
Interface_MSG::TDate(timestamp, 0, 0, 0, 0, 0, 1, "C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // actually
|
||||
Handle(TCollection_HAsciiString) tst =
|
||||
Interface_MSG::TDate (timestamp,0,0,0,0,0,1,"C:%4.4d-%2.2d-%2.2dT%2.2d:%2.2d:%2.2d"); // actually
|
||||
Handle(TCollection_HAsciiString) tst =
|
||||
new TCollection_HAsciiString(timestamp);
|
||||
fn->SetTimeStamp(tst);
|
||||
Handle(Interface_HArray1OfHAsciiString) authors =
|
||||
new Interface_HArray1OfHAsciiString(1, 1);
|
||||
Handle(TCollection_HAsciiString) a1 =
|
||||
Handle(Interface_HArray1OfHAsciiString) authors =
|
||||
new Interface_HArray1OfHAsciiString(1,1);
|
||||
Handle(TCollection_HAsciiString) a1 =
|
||||
new TCollection_HAsciiString("Author");
|
||||
authors->SetValue(1, a1);
|
||||
authors->SetValue(1,a1);
|
||||
fn->SetAuthor(authors);
|
||||
Handle(Interface_HArray1OfHAsciiString) org =
|
||||
new Interface_HArray1OfHAsciiString(1, 1);
|
||||
Handle(TCollection_HAsciiString) org1 =
|
||||
Handle(Interface_HArray1OfHAsciiString) org =
|
||||
new Interface_HArray1OfHAsciiString(1,1);
|
||||
Handle(TCollection_HAsciiString) org1 =
|
||||
new TCollection_HAsciiString("Open CASCADE");
|
||||
org->SetValue(1, org1);
|
||||
org->SetValue(1,org1);
|
||||
fn->SetOrganization(org);
|
||||
|
||||
|
||||
char procver[80];
|
||||
sprintf(procver, XSTEP_PROCESSOR_VERSION, "STEP");
|
||||
Handle(TCollection_HAsciiString) pv = new TCollection_HAsciiString(procver);
|
||||
sprintf (procver, XSTEP_PROCESSOR_VERSION, "STEP");
|
||||
Handle(TCollection_HAsciiString) pv = new TCollection_HAsciiString (procver);
|
||||
//Handle(TCollection_HAsciiString) pv =
|
||||
//new TCollection_HAsciiString(XSTEP_VERSION);
|
||||
fn->SetPreprocessorVersion(pv);
|
||||
|
||||
Handle(TCollection_HAsciiString) sys =
|
||||
|
||||
Handle(TCollection_HAsciiString) sys =
|
||||
new TCollection_HAsciiString(XSTEP_SYSTEM_VERSION);//#58 rln
|
||||
fn->SetOriginatingSystem(sys);
|
||||
Handle(TCollection_HAsciiString) auth =
|
||||
Handle(TCollection_HAsciiString) auth =
|
||||
new TCollection_HAsciiString("Unknown");
|
||||
fn->SetAuthorisation(auth);
|
||||
|
||||
|
||||
// - File Description
|
||||
|
||||
|
||||
if (fd.IsNull()) fd = new HeaderSection_FileDescription;
|
||||
Handle(Interface_HArray1OfHAsciiString) descr =
|
||||
new Interface_HArray1OfHAsciiString(1, 1);
|
||||
Handle(TCollection_HAsciiString) descr1 =
|
||||
new Interface_HArray1OfHAsciiString(1,1);
|
||||
Handle(TCollection_HAsciiString) descr1 =
|
||||
new TCollection_HAsciiString("Open CASCADE Model");
|
||||
descr->SetValue(1, descr1);
|
||||
descr->SetValue(1,descr1);
|
||||
fd->SetDescription(descr);
|
||||
Handle(TCollection_HAsciiString) il =
|
||||
Handle(TCollection_HAsciiString) il =
|
||||
new TCollection_HAsciiString("2;1");
|
||||
fd->SetImplementationLevel(il);
|
||||
|
||||
// - File Schema
|
||||
|
||||
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
|
||||
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
|
||||
Handle(Interface_HArray1OfHAsciiString) schid =
|
||||
new Interface_HArray1OfHAsciiString(1, 1);
|
||||
Handle(TCollection_HAsciiString) schid1 =
|
||||
new Interface_HArray1OfHAsciiString(1,1);
|
||||
Handle(TCollection_HAsciiString) schid1 =
|
||||
new TCollection_HAsciiString("");
|
||||
schid->SetValue(1, schid1);
|
||||
schid->SetValue(1,schid1);
|
||||
fs->SetSchemaIdentifiers(schid);
|
||||
|
||||
}
|
||||
@@ -141,31 +141,30 @@ Standard_Boolean APIHeaderSection_MakeHeader::IsDone() const
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::Apply
|
||||
(const Handle(StepData_StepModel)& model) const
|
||||
(const Handle(StepData_StepModel)& model) const
|
||||
{
|
||||
Interface_EntityIterator header = model->Header();
|
||||
if (HasFd() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileDescription)))
|
||||
if (HasFd() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileDescription)))
|
||||
header.AddItem(fd);
|
||||
if (HasFn() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileName)))
|
||||
if (HasFn() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileName)))
|
||||
header.AddItem(fn);
|
||||
if (HasFs() && !model->HasHeaderEntity(STANDARD_TYPE(HeaderSection_FileSchema))) {
|
||||
if (HasFs() && !model->HasHeaderEntity (STANDARD_TYPE(HeaderSection_FileSchema))) {
|
||||
|
||||
// Schema defined? If not take it from the protocole
|
||||
// Schema defined? If not take it from the protocole
|
||||
Handle(TCollection_HAsciiString) sch;
|
||||
Handle(Interface_HArray1OfHAsciiString) schid = fs->SchemaIdentifiers();
|
||||
if (!schid.IsNull()) sch = schid->Value(1);
|
||||
else {
|
||||
schid = new Interface_HArray1OfHAsciiString(1, 1);
|
||||
schid = new Interface_HArray1OfHAsciiString(1,1);
|
||||
fs->SetSchemaIdentifiers(schid);
|
||||
}
|
||||
if (!sch.IsNull()) { if (sch->Length() < 2) sch.Nullify(); } // not defined
|
||||
if (sch.IsNull()) {
|
||||
Handle(StepData_Protocol) stepro = Handle(StepData_Protocol)::DownCast
|
||||
(model->Protocol());
|
||||
Handle(Interface_Static) aParam = model->GetParam("write.step.schema");
|
||||
if (!aParam.IsNull() && !stepro.IsNull())
|
||||
sch = new TCollection_HAsciiString(stepro->SchemaName(aParam->IntegerValue()));
|
||||
if (!sch.IsNull()) schid->SetValue(1, sch);
|
||||
( model->Protocol());
|
||||
if (!stepro.IsNull()) sch = new TCollection_HAsciiString
|
||||
(stepro->SchemaName());
|
||||
if (!sch.IsNull()) schid->SetValue (1,sch);
|
||||
}
|
||||
header.AddItem(fs);
|
||||
}
|
||||
@@ -180,12 +179,12 @@ void APIHeaderSection_MakeHeader::Apply
|
||||
// ========
|
||||
|
||||
Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel
|
||||
(const Handle(Interface_Protocol)& protocol) const
|
||||
(const Handle(Interface_Protocol)& protocol) const
|
||||
{
|
||||
Handle(StepData_StepModel) stepmodel = new StepData_StepModel;
|
||||
stepmodel->SetProtocol(protocol);
|
||||
stepmodel->SetProtocol (protocol);
|
||||
|
||||
// - Make Header information
|
||||
// - Make Header information
|
||||
|
||||
Apply(stepmodel);
|
||||
return stepmodel;
|
||||
@@ -198,9 +197,7 @@ Handle(StepData_StepModel) APIHeaderSection_MakeHeader::NewModel
|
||||
// ========
|
||||
|
||||
Standard_Boolean APIHeaderSection_MakeHeader::HasFn() const
|
||||
{
|
||||
return (!fn.IsNull());
|
||||
}
|
||||
{ return (!fn.IsNull()); }
|
||||
|
||||
Handle(HeaderSection_FileName) APIHeaderSection_MakeHeader::FnValue() const
|
||||
{
|
||||
@@ -211,23 +208,23 @@ Handle(HeaderSection_FileName) APIHeaderSection_MakeHeader::FnValue() const
|
||||
void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer shapetype)
|
||||
{
|
||||
Handle(TCollection_HAsciiString) name;
|
||||
switch(shapetype)
|
||||
switch(shapetype)
|
||||
{
|
||||
case 1: // face_based_surface_model
|
||||
name = new TCollection_HAsciiString
|
||||
("Euclid Face Based Surface Model");
|
||||
("Euclid Face Based Surface Model");
|
||||
break;
|
||||
case 2: // manifold_solid_brep
|
||||
name = new TCollection_HAsciiString
|
||||
("Euclid Manifold Solid Brep Model");
|
||||
name = new TCollection_HAsciiString
|
||||
("Euclid Manifold Solid Brep Model");
|
||||
break;
|
||||
case 3: // facetted_brep
|
||||
name = new TCollection_HAsciiString
|
||||
("Euclid Facetted Brep Model");
|
||||
("Euclid Facetted Brep Model");
|
||||
break;
|
||||
default : // others ?
|
||||
name = new TCollection_HAsciiString
|
||||
("Euclid Shape Model");
|
||||
("Euclid Shape Model");
|
||||
break;
|
||||
}
|
||||
SetName(aName);
|
||||
@@ -236,106 +233,106 @@ void APIHeaderSection_MakeHeader::SetNameFromShapeType(const Standard_Integer sh
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetName(const Handle(TCollection_HAsciiString)& aName)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetName(aName);
|
||||
if (!fn.IsNull()) fn->SetName(aName);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Name() const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->Name());
|
||||
return (fn.IsNull() ? nulstr : fn->Name());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetTimeStamp(const Handle(TCollection_HAsciiString)& aTimeStamp)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetTimeStamp(aTimeStamp);
|
||||
if (!fn.IsNull()) fn->SetTimeStamp(aTimeStamp);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::TimeStamp() const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->TimeStamp());
|
||||
return (fn.IsNull() ? nulstr : fn->TimeStamp());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetAuthor(const Handle(Interface_HArray1OfHAsciiString)& aAuthor)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetAuthor(aAuthor);
|
||||
if (!fn.IsNull()) fn->SetAuthor(aAuthor);
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetAuthorValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aAuthor)
|
||||
{
|
||||
if (fn.IsNull()) return;
|
||||
Handle(Interface_HArray1OfHAsciiString) li = fn->Author();
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aAuthor);
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aAuthor);
|
||||
}
|
||||
|
||||
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Author() const
|
||||
{
|
||||
return (fn.IsNull() ? nularr : fn->Author());
|
||||
return (fn.IsNull() ? nularr : fn->Author());
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::AuthorValue(const Standard_Integer num) const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->AuthorValue(num));
|
||||
return (fn.IsNull() ? nulstr : fn->AuthorValue(num));
|
||||
}
|
||||
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbAuthor() const
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbAuthor () const
|
||||
{
|
||||
return (fn.IsNull() ? 0 : fn->NbAuthor());
|
||||
return (fn.IsNull() ? 0 : fn->NbAuthor());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetOrganization(const Handle(Interface_HArray1OfHAsciiString)& aOrganization)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetOrganization(aOrganization);
|
||||
if (!fn.IsNull()) fn->SetOrganization(aOrganization);
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetOrganizationValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aOrgan)
|
||||
{
|
||||
if (fn.IsNull()) return;
|
||||
Handle(Interface_HArray1OfHAsciiString) li = fn->Organization();
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aOrgan);
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aOrgan);
|
||||
}
|
||||
|
||||
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Organization() const
|
||||
{
|
||||
return (fn.IsNull() ? nularr : fn->Organization());
|
||||
return (fn.IsNull() ? nularr : fn->Organization());
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OrganizationValue(const Standard_Integer num) const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->OrganizationValue(num));
|
||||
return (fn.IsNull() ? nulstr : fn->OrganizationValue(num));
|
||||
}
|
||||
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbOrganization() const
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbOrganization () const
|
||||
{
|
||||
return (fn.IsNull() ? 0 : fn->NbOrganization());
|
||||
return (fn.IsNull() ? 0 : fn->NbOrganization());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetPreprocessorVersion(const Handle(TCollection_HAsciiString)& aPreprocessorVersion)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetPreprocessorVersion(aPreprocessorVersion);
|
||||
if (!fn.IsNull()) fn->SetPreprocessorVersion(aPreprocessorVersion);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::PreprocessorVersion() const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->PreprocessorVersion());
|
||||
return (fn.IsNull() ? nulstr : fn->PreprocessorVersion());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetOriginatingSystem(const Handle(TCollection_HAsciiString)& aOriginatingSystem)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetOriginatingSystem(aOriginatingSystem);
|
||||
if (!fn.IsNull()) fn->SetOriginatingSystem(aOriginatingSystem);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::OriginatingSystem() const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->OriginatingSystem());
|
||||
return (fn.IsNull() ? nulstr : fn->OriginatingSystem());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetAuthorisation(const Handle(TCollection_HAsciiString)& aAuthorisation)
|
||||
{
|
||||
if (!fn.IsNull()) fn->SetAuthorisation(aAuthorisation);
|
||||
if (!fn.IsNull()) fn->SetAuthorisation(aAuthorisation);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() const
|
||||
{
|
||||
return (fn.IsNull() ? nulstr : fn->Authorisation());
|
||||
return (fn.IsNull() ? nulstr : fn->Authorisation());
|
||||
}
|
||||
|
||||
// ===========
|
||||
@@ -343,9 +340,7 @@ Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::Authorisation() co
|
||||
// ===========
|
||||
|
||||
Standard_Boolean APIHeaderSection_MakeHeader::HasFs() const
|
||||
{
|
||||
return (!fs.IsNull());
|
||||
}
|
||||
{ return (!fs.IsNull()); }
|
||||
|
||||
Handle(HeaderSection_FileSchema) APIHeaderSection_MakeHeader::FsValue() const
|
||||
{
|
||||
@@ -354,29 +349,29 @@ Handle(HeaderSection_FileSchema) APIHeaderSection_MakeHeader::FsValue() const
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetSchemaIdentifiers(const Handle(Interface_HArray1OfHAsciiString)& aSchemaIdentifiers)
|
||||
{
|
||||
if (!fs.IsNull()) fs->SetSchemaIdentifiers(aSchemaIdentifiers);
|
||||
if (!fs.IsNull()) fs->SetSchemaIdentifiers(aSchemaIdentifiers);
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetSchemaIdentifiersValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aSchem)
|
||||
{
|
||||
if (fs.IsNull()) return;
|
||||
Handle(Interface_HArray1OfHAsciiString) li = fs->SchemaIdentifiers();
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aSchem);
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aSchem);
|
||||
}
|
||||
|
||||
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiers() const
|
||||
{
|
||||
return (fs.IsNull() ? nularr : fs->SchemaIdentifiers());
|
||||
return (fs.IsNull() ? nularr : fs->SchemaIdentifiers());
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::SchemaIdentifiersValue(const Standard_Integer num) const
|
||||
{
|
||||
return (fs.IsNull() ? nulstr : fs->SchemaIdentifiersValue(num));
|
||||
return (fs.IsNull() ? nulstr : fs->SchemaIdentifiersValue(num));
|
||||
}
|
||||
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers() const
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers () const
|
||||
{
|
||||
return (fs.IsNull() ? 0 : fs->NbSchemaIdentifiers());
|
||||
return (fs.IsNull() ? 0 : fs->NbSchemaIdentifiers());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -386,24 +381,24 @@ Standard_Integer APIHeaderSection_MakeHeader::NbSchemaIdentifiers() const
|
||||
|
||||
void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_HAsciiString)& aSchem)
|
||||
{
|
||||
if (fs.IsNull()) fs = new HeaderSection_FileSchema;
|
||||
if ( fs.IsNull() ) fs = new HeaderSection_FileSchema;
|
||||
Handle(Interface_HArray1OfHAsciiString) idents = fs->SchemaIdentifiers();
|
||||
|
||||
// check that requested subschema is already in the list
|
||||
Standard_Integer i;
|
||||
for (i = 1; !idents.IsNull() && i <= idents->Length(); i++) {
|
||||
if (aSchem->IsSameString(idents->Value(i))) return;
|
||||
for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) {
|
||||
if ( aSchem->IsSameString ( idents->Value(i) ) ) return;
|
||||
}
|
||||
|
||||
|
||||
// add a subshema
|
||||
Handle(Interface_HArray1OfHAsciiString) ids =
|
||||
new Interface_HArray1OfHAsciiString(1, (idents.IsNull() ? 1 : idents->Length() + 1));
|
||||
for (i = 1; !idents.IsNull() && i <= idents->Length(); i++) {
|
||||
ids->SetValue(i, idents->Value(i));
|
||||
Handle(Interface_HArray1OfHAsciiString) ids =
|
||||
new Interface_HArray1OfHAsciiString ( 1, ( idents.IsNull() ? 1 : idents->Length() + 1 ) );
|
||||
for ( i=1; ! idents.IsNull() && i <= idents->Length(); i++ ) {
|
||||
ids->SetValue ( i, idents->Value(i) );
|
||||
}
|
||||
ids->SetValue(i, aSchem);
|
||||
|
||||
fs->SetSchemaIdentifiers(ids);
|
||||
ids->SetValue ( i, aSchem );
|
||||
|
||||
fs->SetSchemaIdentifiers ( ids );
|
||||
}
|
||||
|
||||
// ================
|
||||
@@ -411,9 +406,7 @@ void APIHeaderSection_MakeHeader::AddSchemaIdentifier(const Handle(TCollection_H
|
||||
// ================
|
||||
|
||||
Standard_Boolean APIHeaderSection_MakeHeader::HasFd() const
|
||||
{
|
||||
return (!fd.IsNull());
|
||||
}
|
||||
{ return (!fd.IsNull()); }
|
||||
|
||||
Handle(HeaderSection_FileDescription) APIHeaderSection_MakeHeader::FdValue() const
|
||||
{
|
||||
@@ -422,37 +415,37 @@ Handle(HeaderSection_FileDescription) APIHeaderSection_MakeHeader::FdValue() con
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetDescription(const Handle(Interface_HArray1OfHAsciiString)& aDescription)
|
||||
{
|
||||
if (!fs.IsNull()) fd->SetDescription(aDescription);
|
||||
if (!fs.IsNull()) fd->SetDescription(aDescription);
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetDescriptionValue(const Standard_Integer num, const Handle(TCollection_HAsciiString)& aDescr)
|
||||
{
|
||||
if (fd.IsNull()) return;
|
||||
Handle(Interface_HArray1OfHAsciiString) li = fd->Description();
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num, aDescr);
|
||||
if (num >= li->Lower() && num <= li->Upper()) li->SetValue(num,aDescr);
|
||||
}
|
||||
|
||||
Handle(Interface_HArray1OfHAsciiString) APIHeaderSection_MakeHeader::Description() const
|
||||
{
|
||||
return (fd.IsNull() ? nularr : fd->Description());
|
||||
return (fd.IsNull() ? nularr : fd->Description());
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::DescriptionValue(const Standard_Integer num) const
|
||||
{
|
||||
return (fd.IsNull() ? nulstr : fd->DescriptionValue(num));
|
||||
return (fd.IsNull() ? nulstr : fd->DescriptionValue(num));
|
||||
}
|
||||
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbDescription() const
|
||||
Standard_Integer APIHeaderSection_MakeHeader::NbDescription () const
|
||||
{
|
||||
return (fd.IsNull() ? 0 : fd->NbDescription());
|
||||
return (fd.IsNull() ? 0 : fd->NbDescription());
|
||||
}
|
||||
|
||||
void APIHeaderSection_MakeHeader::SetImplementationLevel(const Handle(TCollection_HAsciiString)& aImplementationLevel)
|
||||
{
|
||||
if (!fd.IsNull()) fd->SetImplementationLevel(aImplementationLevel);
|
||||
if (!fd.IsNull()) fd->SetImplementationLevel(aImplementationLevel);
|
||||
}
|
||||
|
||||
Handle(TCollection_HAsciiString) APIHeaderSection_MakeHeader::ImplementationLevel() const
|
||||
{
|
||||
return (fd.IsNull() ? nulstr : fd->ImplementationLevel());
|
||||
return (fd.IsNull() ? nulstr : fd->ImplementationLevel());
|
||||
}
|
||||
|
@@ -313,14 +313,11 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer,
|
||||
continue;
|
||||
TopoDS_Face f1 = TopoDS::Face(ffs.First());
|
||||
TopoDS_Face f2 = TopoDS::Face(ffs.Last());
|
||||
IntCurveSurface_TransitionOnCurve tran;
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(EE, V1, V2);
|
||||
if (LVInts.Contains(V1) || LVInts.Contains(V2))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
IntCurveSurface_TransitionOnCurve tran = IntCurveSurface_Tangent;
|
||||
Standard_Integer Tst = GetTransi(f1, f2, EE, param, L, tran);
|
||||
if (Tst == 1 && Abs(Lpar) < Abs(parmin))
|
||||
{
|
||||
|
@@ -106,8 +106,6 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
|
||||
myDrivers = AttributeDrivers (myMsgDriver);
|
||||
Handle(TDF_Data) aData = aDoc->GetData();
|
||||
FirstPass (aData->Root());
|
||||
if(aDoc->EmptyLabelsSavingMode())
|
||||
myEmptyLabels.Clear(); //
|
||||
|
||||
// 1. Write info section (including types table)
|
||||
WriteInfoSection (aDoc, theOStream);
|
||||
|
@@ -839,8 +839,11 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
|
||||
}
|
||||
|
||||
aFirstCurveType = curve->DynamicType();
|
||||
const gp_Pnt2d aPoint(asecondpoint->Pnt2d());
|
||||
(void )aPoint;
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Pnt2d Point(asecondpoint->Pnt2d());
|
||||
#else
|
||||
asecondpoint->Pnt2d();
|
||||
#endif
|
||||
if (aFirstCurveType == STANDARD_TYPE(Geom2d_Circle)) {
|
||||
cas = 1;
|
||||
Handle(Geom2d_Circle) C1 = Handle(Geom2d_Circle)::DownCast(curve);
|
||||
|
@@ -232,17 +232,17 @@ static Standard_Integer DDocStd_Save (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** a)
|
||||
{
|
||||
Standard_Integer nb,
|
||||
const char** a)
|
||||
{
|
||||
if (nb >= 3) {
|
||||
Handle(TDocStd_Document) D;
|
||||
if (!DDocStd::GetDocument(a[1],D)) return 1;
|
||||
TCollection_ExtendedString path (a[2]);
|
||||
Handle(TDocStd_Application) A = DDocStd::GetApplication();
|
||||
PCDM_StoreStatus theStatus;
|
||||
|
||||
Standard_Boolean anUseStream(Standard_False), isSaveEmptyLabels(Standard_False);
|
||||
|
||||
Standard_Boolean anUseStream = Standard_False;
|
||||
for ( Standard_Integer i = 3; i < nb; i++ )
|
||||
{
|
||||
if (!strcmp (a[i], "-stream"))
|
||||
@@ -250,11 +250,9 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
di << "standard SEEKABLE stream is used\n";
|
||||
anUseStream = Standard_True;
|
||||
break;
|
||||
} else {
|
||||
isSaveEmptyLabels = ((atoi (a[3])) != 0);
|
||||
D->SetEmptyLabelsSavingMode(isSaveEmptyLabels);
|
||||
}
|
||||
}
|
||||
|
||||
if (anUseStream)
|
||||
{
|
||||
std::ofstream aFileStream;
|
||||
@@ -265,35 +263,35 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
{
|
||||
theStatus = A->SaveAs(D,path);
|
||||
}
|
||||
|
||||
|
||||
if (theStatus != PCDM_SS_OK ) {
|
||||
switch ( theStatus ) {
|
||||
case PCDM_SS_DriverFailure: {
|
||||
di << "Error saving document: Could not store , no driver found to make it\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_WriteFailure: {
|
||||
di << "Error saving document: Write access failure\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Failure: {
|
||||
di << "Error saving document: Write failure\n" ;
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Doc_IsNull: {
|
||||
di << "Error saving document: No document to save\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_No_Obj: {
|
||||
di << "Error saving document: No objects written\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Info_Section_Error: {
|
||||
di << "Error saving document: Write info section failure\n" ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
case PCDM_SS_DriverFailure: {
|
||||
di << "Error saving document: Could not store , no driver found to make it\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_WriteFailure: {
|
||||
di << "Error saving document: Write access failure\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Failure: {
|
||||
di << "Error saving document: Write failure\n" ;
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Doc_IsNull: {
|
||||
di << "Error saving document: No document to save\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_No_Obj: {
|
||||
di << "Error saving document: No objects written\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Info_Section_Error: {
|
||||
di << "Error saving document: Write info section failure\n" ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
@@ -533,7 +531,7 @@ void DDocStd::ApplicationCommands(Draw_Interpretor& theCommands)
|
||||
__FILE__, DDocStd_Open, g);
|
||||
|
||||
theCommands.Add("SaveAs",
|
||||
"SaveAs DOC path [saveEmptyLabels: 0|1] [-stream]",
|
||||
"SaveAs DOC path [-stream]",
|
||||
__FILE__, DDocStd_SaveAs, g);
|
||||
|
||||
theCommands.Add("Save",
|
||||
|
@@ -118,15 +118,13 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
|
||||
#ifdef OCCT_DEBUG
|
||||
if(!aNS1->IsEmpty()) {
|
||||
aShape1 = aNS1->Get();
|
||||
const gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
(void )aDebPoint;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
// cout << aCounter << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
} else
|
||||
cout << " Line3DDriver:: NS1 is empty" << endl;
|
||||
if(!aNS2->IsEmpty()) {
|
||||
aShape2 = aNS2->Get();
|
||||
const gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
(void )aDebPoint;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter+1 << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
} else
|
||||
cout << " Line3DDriver:: NS2 is empty" << endl;
|
||||
@@ -139,12 +137,10 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
|
||||
aShape1 = aNS1->Get();
|
||||
aShape2 = aNS2->Get();
|
||||
#ifdef OCCT_DEBUG
|
||||
const gp_Pnt aDebPoint1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
const gp_Pnt aDebPoint2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter << " X = " << aDebPoint1.X() << " Y = " << aDebPoint1.Y() << " Z = " << aDebPoint1.Z() << endl;
|
||||
// cout << aCounter+1 << " X = " << aDebPoint2.X() << " Y = " << aDebPoint2.Y() << " Z = " << aDebPoint2.Z() << endl;
|
||||
(void )aDebPoint1;
|
||||
(void )aDebPoint2;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
// cout << aCounter << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter+1 << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
#endif
|
||||
if(aShape1.ShapeType() != TopAbs_VERTEX || aShape2.ShapeType() != TopAbs_VERTEX) {
|
||||
aFunction->SetFailure(WRONG_ARGUMENT);
|
||||
|
@@ -48,4 +48,3 @@ TOBJ : TKTObjDRAW
|
||||
DFBROWSER : TKDFBrowser
|
||||
QAcommands : TKQADraw
|
||||
VIS : TKIVtkDraw
|
||||
TOOLS : TKToolsDraw
|
||||
|
@@ -2176,9 +2176,8 @@ proc _log_html_diff {file log dir1 dir2 highlight_percent} {
|
||||
# note: special handler for the case if test grid directoried are compared directly
|
||||
set gridpath ""
|
||||
}
|
||||
set aCaseName [lindex $case end]
|
||||
set img1 "<a href=\"[_make_url $file [file join $dir1 $gridpath $aCaseName.html]]\"><img src=\"[_make_url $file [file join $dir1 $gridpath $img]]\"></a>"
|
||||
set img2 "<a href=\"[_make_url $file [file join $dir2 $gridpath $aCaseName.html]]\"><img src=\"[_make_url $file [file join $dir2 $gridpath $img]]\"></a>"
|
||||
set img1 "<img src=\"[_make_url $file [file join $dir1 $gridpath $img]]\">"
|
||||
set img2 "<img src=\"[_make_url $file [file join $dir2 $gridpath $img]]\">"
|
||||
|
||||
set difffile [_diff_img_name $dir1 $dir2 $gridpath $img]
|
||||
if { [file exists $difffile] } {
|
||||
|
@@ -89,9 +89,11 @@ GccAna_Circ2d3Tan::
|
||||
Standard_Real R1 = C1.Radius();
|
||||
Standard_Real R2 = C2.Radius();
|
||||
gp_Pnt2d center1(C1.Location());
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Pnt2d center2(C2.Location());
|
||||
(void )center2;
|
||||
|
||||
#else
|
||||
C2.Location() ;
|
||||
#endif
|
||||
gp_Pnt2d origin3(L3.Location());
|
||||
gp_Dir2d dir3(L3.Direction());
|
||||
gp_Dir2d normL3(-dir3.Y(),dir3.X());
|
||||
|
@@ -93,14 +93,18 @@ GccAna_Circ2d3Tan::
|
||||
Standard_Integer nbsolution1 = Bis1.NbSolutions();
|
||||
Handle(GccInt_Bisec) Sol2 = Bis2.ThisSolution();
|
||||
for (Standard_Integer i = 1 ; i <= nbsolution1; i++) {
|
||||
const gp_Lin2d Sol1(Bis1.ThisSolution(i));
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Lin2d Sol1(Bis1.ThisSolution(i));
|
||||
#else
|
||||
Bis1.ThisSolution(i) ;
|
||||
#endif
|
||||
GccInt_IType typ2 = Sol2->ArcType();
|
||||
IntAna2d_AnaIntersection Intp;
|
||||
if (typ2 == GccInt_Lin) {
|
||||
Intp.Perform(Sol1,Sol2->Line());
|
||||
Intp.Perform(Bis1.ThisSolution(i),Sol2->Line());
|
||||
}
|
||||
else if (typ2 == GccInt_Par) {
|
||||
Intp.Perform(Sol1,IntAna2d_Conic(Sol2->Parabola()));
|
||||
Intp.Perform(Bis1.ThisSolution(i),IntAna2d_Conic(Sol2->Parabola()));
|
||||
}
|
||||
if (Intp.IsDone()) {
|
||||
if (!Intp.IsEmpty()) {
|
||||
|
@@ -88,9 +88,14 @@ GccAna_Circ2d3Tan::
|
||||
GccAna_Pnt2dBisec Bis1(Point2,Point3);
|
||||
GccAna_LinPnt2dBisec Bis2(L1,Point2);
|
||||
if (Bis1.IsDone() && Bis2.IsDone()) {
|
||||
const gp_Lin2d linint1(Bis1.ThisSolution());
|
||||
gp_Lin2d linint1(Bis1.ThisSolution());
|
||||
Handle(GccInt_Bisec) Sol2 = Bis2.ThisSolution();
|
||||
GccInt_IType typ2 = Sol2->ArcType();
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Lin2d linintb(Bis1.ThisSolution());
|
||||
#else
|
||||
Bis1.ThisSolution() ;
|
||||
#endif
|
||||
IntAna2d_AnaIntersection Intp;
|
||||
if (typ2 == GccInt_Lin) {
|
||||
gp_Lin2d linint2(Sol2->Line());
|
||||
|
@@ -6,5 +6,7 @@ HeaderSection_FileName.cxx
|
||||
HeaderSection_FileName.hxx
|
||||
HeaderSection_FileSchema.cxx
|
||||
HeaderSection_FileSchema.hxx
|
||||
HeaderSection_HeaderRecognizer.cxx
|
||||
HeaderSection_HeaderRecognizer.hxx
|
||||
HeaderSection_Protocol.cxx
|
||||
HeaderSection_Protocol.hxx
|
||||
|
@@ -16,12 +16,12 @@
|
||||
#include <HeaderSection_Protocol.hxx>
|
||||
#include <Interface_Statics.hxx>
|
||||
|
||||
//StaticHandle(HeaderSection_Protocol, proto);
|
||||
StaticHandle(HeaderSection_Protocol, proto);
|
||||
|
||||
Handle(HeaderSection_Protocol) HeaderSection::Protocol()
|
||||
|
||||
{
|
||||
//InitHandleVoid(HeaderSection_Protocol, proto);
|
||||
return new HeaderSection_Protocol;
|
||||
}
|
||||
{
|
||||
InitHandleVoid(HeaderSection_Protocol, proto);
|
||||
return proto;
|
||||
}
|
||||
|
||||
|
51
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx
Normal file
51
src/HeaderSection/HeaderSection_HeaderRecognizer.cxx
Normal file
@@ -0,0 +1,51 @@
|
||||
// Created on: 1994-06-27
|
||||
// Created by: Frederic MAUPAS
|
||||
// Copyright (c) 1994-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 <HeaderSection_FileDescription.hxx>
|
||||
#include <HeaderSection_FileName.hxx>
|
||||
#include <HeaderSection_FileSchema.hxx>
|
||||
#include <HeaderSection_HeaderRecognizer.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
|
||||
|
||||
static TCollection_AsciiString reco_FileName ("FILE_NAME");
|
||||
static TCollection_AsciiString reco_FileSchema ("FILE_SCHEMA");
|
||||
static TCollection_AsciiString reco_FileDescription ("FILE_DESCRIPTION");
|
||||
|
||||
|
||||
|
||||
HeaderSection_HeaderRecognizer::HeaderSection_HeaderRecognizer ()
|
||||
{ }
|
||||
|
||||
void HeaderSection_HeaderRecognizer::Eval
|
||||
(const TCollection_AsciiString& key)
|
||||
{
|
||||
if (key.IsEqual(reco_FileName)) {
|
||||
SetOK(new HeaderSection_FileName);
|
||||
return;
|
||||
}
|
||||
if (key.IsEqual(reco_FileSchema)) {
|
||||
SetOK(new HeaderSection_FileSchema);
|
||||
return;
|
||||
}
|
||||
if (key.IsEqual(reco_FileDescription)) {
|
||||
SetOK(new HeaderSection_FileDescription);
|
||||
return;
|
||||
}
|
||||
}
|
66
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx
Normal file
66
src/HeaderSection/HeaderSection_HeaderRecognizer.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 1994-06-27
|
||||
// Created by: Frederic MAUPAS
|
||||
// Copyright (c) 1994-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 _HeaderSection_HeaderRecognizer_HeaderFile
|
||||
#define _HeaderSection_HeaderRecognizer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <StepData_FileRecognizer.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class HeaderSection_HeaderRecognizer;
|
||||
DEFINE_STANDARD_HANDLE(HeaderSection_HeaderRecognizer, StepData_FileRecognizer)
|
||||
|
||||
//! Recognizes STEP Standard Header Entities
|
||||
//! (FileName, FileDescription, FileSchema)
|
||||
class HeaderSection_HeaderRecognizer : public StepData_FileRecognizer
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT HeaderSection_HeaderRecognizer();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(HeaderSection_HeaderRecognizer,StepData_FileRecognizer)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Recognizes data types of Header STEP Standard
|
||||
Standard_EXPORT void Eval (const TCollection_AsciiString& key) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _HeaderSection_HeaderRecognizer_HeaderFile
|
@@ -21,7 +21,7 @@
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(HeaderSection_Protocol,StepData_Protocol)
|
||||
|
||||
//static Standard_CString schemaName = "header_section";
|
||||
static Standard_CString schemaName = "header_section";
|
||||
|
||||
HeaderSection_Protocol::HeaderSection_Protocol () { }
|
||||
|
||||
@@ -35,5 +35,5 @@ Handle(Standard_Type)& atype) const
|
||||
else return 0;
|
||||
}
|
||||
|
||||
Standard_CString HeaderSection_Protocol::SchemaName(Standard_Integer /*theShematype*/)
|
||||
{ return "header_section"; }
|
||||
Standard_CString HeaderSection_Protocol::SchemaName() const
|
||||
{ return schemaName; }
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
//! Returns a Case Number for each of the HeaderSection Entities
|
||||
Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_CString SchemaName(Standard_Integer theShematype) Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Standard_CString SchemaName() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
@@ -877,6 +877,62 @@ static IFSelect_ReturnStatus fun27
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
static IFSelect_ReturnStatus fun28
|
||||
(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
Standard_Integer argc = pilot->NbWords();
|
||||
const Standard_CString arg1 = pilot->Arg(1);
|
||||
const Standard_CString arg2 = pilot->Arg(2);
|
||||
const Standard_CString arg3 = pilot->Arg(3);
|
||||
// **** DefParam ****
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
if (argc < 2) {
|
||||
Handle(TColStd_HSequenceOfHAsciiString) li = Interface_Static::Items();
|
||||
Standard_Integer i,nb = li->Length();
|
||||
sout<<" List of parameters : "<<nb<<" items :"<<endl;
|
||||
for (i = 1; i <= nb; i ++) sout<<" "<<li->Value(i)->ToCString();
|
||||
sout<<endl<<" defparam name_param to known more about one"<<endl;
|
||||
sout<<" defparam nom_param e options to edit a definition"<<endl;
|
||||
|
||||
} else if (argc == 2) {
|
||||
sout<<" Definition of Parameter : "<<arg1<<endl;
|
||||
Handle(Interface_Static) unst = Interface_Static::Static (arg1);
|
||||
if (unst.IsNull()) sout<<" undefined"<<endl;
|
||||
else unst->Print(sout);
|
||||
return IFSelect_RetVoid;
|
||||
|
||||
} else if (arg2[0] == 'i') {
|
||||
// initialisation : arg1=nompar a2='i' a3=family a4=type [a5=val]
|
||||
if (argc < 5) { sout<<" name init family type [valinit]"<<endl; return IFSelect_RetVoid; }
|
||||
char typ = (pilot->Arg(4))[0];
|
||||
Standard_Boolean ok= (argc==5 ? Interface_Static::Init(arg3,arg1,typ) :
|
||||
Interface_Static::Init(arg3,arg1,typ,pilot->Arg(5)));
|
||||
return (ok ? IFSelect_RetDone : IFSelect_RetFail);
|
||||
|
||||
} else if (arg2[0] == 'e') {
|
||||
// edition : arg1=nompar arg2='e' arg3=option arg4...=parametres option
|
||||
char comm[100];
|
||||
if (argc < 4) {
|
||||
sout<<" give name and options ! Options (according type), 1 a time\n"
|
||||
<<" imin ival / imax ival / rmin rval / rmax rval /\n"
|
||||
<<" enum stnum / enum stnum match / eval e1 e2 e3 ... (maxi 10)\n"
|
||||
<<endl;
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
if (argc > 4) sout<<"Only the command and ONE more arg are considered"<<endl;
|
||||
sprintf(comm,"%s %s",pilot->Arg(3),pilot->Arg(4));
|
||||
sout<<"Editing parameter : "<<arg1<<" , by command : "<<comm<<endl;
|
||||
|
||||
Handle(Interface_Static) unst = Interface_Static::Static (arg1);
|
||||
if (unst.IsNull()) { sout<<arg1<<" undefined"<<endl; return IFSelect_RetError; }
|
||||
if (Interface_Static::Init(unst->Family(),arg1,'&',comm))
|
||||
{ sout<<"Editing done"<<endl; return IFSelect_RetDone; }
|
||||
else { sout<<"Command not processed : "<<comm<<endl; return IFSelect_RetFail; }
|
||||
}
|
||||
sout<<"Unknown Option : "<<arg2<<endl;
|
||||
return IFSelect_RetVoid;
|
||||
}
|
||||
|
||||
static IFSelect_ReturnStatus fun29
|
||||
(const Handle(IFSelect_SessionPilot)& pilot)
|
||||
{
|
||||
@@ -2438,6 +2494,7 @@ void IFSelect_Functions::Init()
|
||||
IFSelect_Act::AddFunc("xsave","filename:string : sauve items-session",fun25);
|
||||
IFSelect_Act::AddFunc("xrestore","filename:string : restaure items-session",fun26);
|
||||
IFSelect_Act::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27);
|
||||
IFSelect_Act::AddFunc("defparam","nompar:string : display def. param; also : nompar edit, nompar init",fun28);
|
||||
|
||||
IFSelect_Act::AddFunc("sentfiles","Lists files sent from last Load",fun29);
|
||||
IFSelect_Act::AddFunc("fileprefix","prefix:string : definit File Prefix",fun30);
|
||||
|
@@ -264,8 +264,8 @@ IFSelect_ModelCopier::IFSelect_ModelCopier () { }
|
||||
{
|
||||
Interface_CheckIterator checks;
|
||||
checks.SetName ("X-STEP WorkSession : Send All");
|
||||
//Message::DefaultMessenger() <<
|
||||
// "** WorkSession : Sending all data"<<endl;
|
||||
Message::DefaultMessenger() <<
|
||||
"** WorkSession : Sending all data"<<endl;
|
||||
Handle(Interface_InterfaceModel) model = G.Model();
|
||||
if (model.IsNull() || protocol.IsNull() || WL.IsNull()) return checks;
|
||||
|
||||
|
@@ -71,6 +71,7 @@
|
||||
#include <Interface_ReportEntity.hxx>
|
||||
#include <Interface_ShareFlags.hxx>
|
||||
#include <Interface_ShareTool.hxx>
|
||||
#include <Interface_Static.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <OSD_Path.hxx>
|
||||
@@ -211,7 +212,7 @@ IFSelect_ReturnStatus IFSelect_WorkSession::ReadFile
|
||||
{
|
||||
if (thelibrary.IsNull()) return IFSelect_RetVoid;
|
||||
if (theprotocol.IsNull()) return IFSelect_RetVoid;
|
||||
Handle(Interface_InterfaceModel) model =myModel;
|
||||
Handle(Interface_InterfaceModel) model;
|
||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
@@ -1075,6 +1076,30 @@ Standard_Integer IFSelect_WorkSession::NextIdentForLabel
|
||||
// #################################################################
|
||||
// .... Parametres (Int et Text) ....
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Standard_Transient) IFSelect_WorkSession::NewParamFromStatic
|
||||
(const Standard_CString statname, const Standard_CString name)
|
||||
{
|
||||
Handle(Standard_Transient) param;
|
||||
Handle(Interface_Static) stat = Interface_Static::Static(statname);
|
||||
if (stat.IsNull()) return param;
|
||||
if (stat->Type() == Interface_ParamInteger) {
|
||||
Handle(IFSelect_IntParam) intpar = new IFSelect_IntParam;
|
||||
intpar->SetStaticName (statname);
|
||||
param = intpar;
|
||||
} else {
|
||||
param = stat->HStringValue();
|
||||
}
|
||||
if (param.IsNull()) return param;
|
||||
if ( AddNamedItem (name, param) == 0 ) param.Nullify();
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
@@ -1676,12 +1701,11 @@ Standard_Integer IFSelect_WorkSession::RunTransformer
|
||||
{
|
||||
Standard_Integer effect = 0;
|
||||
if (transf.IsNull() || !IsLoaded()) return effect;
|
||||
|
||||
Handle(Interface_InterfaceModel) newmod; // Null au depart
|
||||
Interface_CheckIterator checks;
|
||||
checks.SetName("X-STEP WorkSession : RunTransformer");
|
||||
Standard_Boolean res = transf->Perform
|
||||
(thegraph->Graph(),theprotocol,checks,myModel);
|
||||
(thegraph->Graph(),theprotocol,checks,newmod);
|
||||
|
||||
if (!checks.IsEmpty(Standard_False)) {
|
||||
Handle(Message_Messenger) sout = Message::DefaultMessenger();
|
||||
@@ -3031,7 +3055,7 @@ Handle(IFSelect_Selection) IFSelect_WorkSession::GiveSelection
|
||||
}
|
||||
|
||||
Handle(IFSelect_Selection) sel;
|
||||
if (np >= 0)
|
||||
if (np >= 0)
|
||||
{
|
||||
nomsel[np] = 0;
|
||||
}
|
||||
|
@@ -407,6 +407,13 @@ public:
|
||||
//! - other values are ignored
|
||||
Standard_EXPORT Standard_Integer NextIdentForLabel (const Standard_CString label, const Standard_Integer id, const Standard_Integer mode = 0) const;
|
||||
|
||||
//! Creates a parameter as being bound to a Static
|
||||
//! If the Static is Integer, this creates an IntParam bound to
|
||||
//! it by its name. Else this creates a String which is the value
|
||||
//! of the Static.
|
||||
//! Returns a null handle if <statname> is unknown as a Static
|
||||
Standard_EXPORT Handle(Standard_Transient) NewParamFromStatic (const Standard_CString statname, const Standard_CString name = "");
|
||||
|
||||
//! Returns an IntParam, given its Ident in the Session
|
||||
//! Null result if <id> is not suitable for an IntParam
|
||||
//! (undefined, or defined for another kind of variable)
|
||||
|
@@ -942,8 +942,12 @@ void IntCurveSurface_Inter::PerformConicSurf(const gp_Lin& Line,
|
||||
Standard_Integer nbp = intlintorus.NbPoints();
|
||||
Standard_Real fi,theta,w;
|
||||
for(Standard_Integer i = 1; i<= nbp; i++) {
|
||||
const gp_Pnt aDebPnt(intlintorus.Value(i));
|
||||
(void )aDebPnt;
|
||||
#ifndef OCCT_DEBUG
|
||||
gp_Pnt P;
|
||||
P = intlintorus.Value(i);
|
||||
#else
|
||||
gp_Pnt P(intlintorus.Value(i));
|
||||
#endif
|
||||
w = intlintorus.ParamOnLine(i);
|
||||
intlintorus.ParamOnTorus(i,fi,theta);
|
||||
AppendPoint(curve,w,surface,fi,theta);
|
||||
|
@@ -39,8 +39,10 @@
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
static int errh = 1;
|
||||
|
||||
void Interface_CheckTool::raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
|
||||
|
||||
static void raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
|
||||
{
|
||||
char mess[100];
|
||||
sprintf (mess,"** Exception Raised during Check : %s **",
|
||||
@@ -73,7 +75,6 @@ Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)&
|
||||
theshare (model,protocol)
|
||||
{
|
||||
thestat = 0;
|
||||
errh = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +88,6 @@ Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)&
|
||||
{
|
||||
thestat = 0;
|
||||
thegtool->Reservate(model->NbEntities());
|
||||
errh = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)&
|
||||
Interface_CheckTool::Interface_CheckTool(const Interface_Graph& graph)
|
||||
: thegtool(graph.Model()->GTool()) , theshare (graph)
|
||||
{
|
||||
errh = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +110,6 @@ Interface_CheckTool::Interface_CheckTool(const Interface_Graph& graph)
|
||||
Interface_CheckTool::Interface_CheckTool(const Handle(Interface_HGraph)& hgraph)
|
||||
: thegtool(hgraph->Graph().Model()->GTool()) , theshare (hgraph)
|
||||
{
|
||||
errh = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,10 +126,10 @@ void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent,
|
||||
Standard_Integer CN;
|
||||
if (thegtool->Select(ent,module,CN)) {
|
||||
// Sans try/catch (fait par l appelant, evite try/catch en boucle)
|
||||
//if (!errh) {
|
||||
// module->CheckCase(CN,ent,sh,ach);
|
||||
// return;
|
||||
//}
|
||||
if (!errh) {
|
||||
module->CheckCase(CN,ent,sh,ach);
|
||||
return;
|
||||
}
|
||||
// Avec try/catch
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
@@ -202,7 +200,7 @@ Handle(Interface_Check) Interface_CheckTool::Check(const Standard_Integer num)
|
||||
Handle(Interface_InterfaceModel) model = theshare.Model();
|
||||
Handle(Standard_Transient) ent = model->Value(num);
|
||||
Handle(Interface_Check) ach = new Interface_Check(ent); // non filtre par "Warning" : tel quel
|
||||
//errh = 1;
|
||||
errh = 1;
|
||||
FillCheck(ent,theshare,ach);
|
||||
return ach;
|
||||
}
|
||||
@@ -223,13 +221,13 @@ void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset)
|
||||
("Interface Model : Global Check");
|
||||
Handle(Interface_InterfaceModel) model = theshare.Model();
|
||||
if (model->GlobalCheck()->NbFails() > 0) throw Interface_CheckFailure("Interface Model : Global Check");
|
||||
//Handle(Interface_Check) modchk = new Interface_Check;
|
||||
//model->VerifyCheck(modchk);
|
||||
//if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),modchk);
|
||||
//if (modchk->HasFailed()) throw Interface_CheckFailure("Interface Model : Verify Check");
|
||||
//if (thestat == 3) return; // tout teste et ca passe
|
||||
Handle(Interface_Check) modchk = new Interface_Check;
|
||||
model->VerifyCheck(modchk);
|
||||
if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),modchk);
|
||||
if (modchk->HasFailed()) throw Interface_CheckFailure("Interface Model : Verify Check");
|
||||
if (thestat == 3) return; // tout teste et ca passe
|
||||
|
||||
//errh = 0; // Pas de try/catch, car justement on raise
|
||||
errh = 0; // Pas de try/catch, car justement on raise
|
||||
Standard_Integer nb = model->NbEntities();
|
||||
for (Standard_Integer i = 1; i <= nb; i ++) {
|
||||
if (model->IsErrorEntity(i)) throw Interface_CheckFailure("Interface Model : an Entity is recorded as Erroneous");
|
||||
@@ -264,13 +262,13 @@ Interface_CheckIterator Interface_CheckTool::CompleteCheckList ()
|
||||
Interface_CheckIterator res;
|
||||
res.SetModel(model);
|
||||
Handle(Interface_Check) globch = model->GlobalCheck(); // GlobalCheck Statique
|
||||
//if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch);
|
||||
//model->VerifyCheck(globch); // GlobalCheck Dynamique
|
||||
//if (globch->HasFailed() || globch->HasWarnings()) res.Add(globch,0);
|
||||
//if (globch->HasFailed()) thestat |= 12;
|
||||
if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch);
|
||||
model->VerifyCheck(globch); // GlobalCheck Dynamique
|
||||
if (globch->HasFailed() || globch->HasWarnings()) res.Add(globch,0);
|
||||
if (globch->HasFailed()) thestat |= 12;
|
||||
|
||||
Standard_Integer i=0,n0 = 1, nb = model->NbEntities();
|
||||
//errh = 0;
|
||||
errh = 0;
|
||||
while (n0 <= nb) {
|
||||
Handle(Interface_Check) ach = new Interface_Check;
|
||||
Handle(Standard_Transient) ent;
|
||||
@@ -318,11 +316,11 @@ Interface_CheckIterator Interface_CheckTool::CheckList ()
|
||||
res.SetModel(model);
|
||||
Standard_Integer i=0, n0 = 1, nb = model->NbEntities();
|
||||
Handle(Interface_Check) globch = model->GlobalCheck();
|
||||
//if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch);
|
||||
//model->VerifyCheck(globch);
|
||||
//if (globch->HasFailed()) { thestat |= 12; res.Add(globch,0); }
|
||||
if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch);
|
||||
model->VerifyCheck(globch);
|
||||
if (globch->HasFailed()) { thestat |= 12; res.Add(globch,0); }
|
||||
|
||||
//errh = 0;
|
||||
errh = 0;
|
||||
while (n0 <= nb) {
|
||||
Handle(Interface_Check) ach = new Interface_Check;
|
||||
Handle(Standard_Transient) ent;
|
||||
@@ -370,7 +368,7 @@ Interface_CheckIterator Interface_CheckTool::AnalyseCheckList ()
|
||||
res.SetModel(model);
|
||||
Standard_Integer i=0, n0 = 1, nb = model->NbEntities();
|
||||
|
||||
//errh = 0;
|
||||
errh = 0;
|
||||
while (n0 <= nb) {
|
||||
Handle(Interface_Check) ach = new Interface_Check;
|
||||
try {
|
||||
@@ -410,7 +408,7 @@ Interface_CheckIterator Interface_CheckTool::VerifyCheckList ()
|
||||
res.SetModel(model);
|
||||
Standard_Integer i=0, n0 = 1, nb = model->NbEntities();
|
||||
|
||||
//errh = 0;
|
||||
errh = 0;
|
||||
while (n0 <= nb) {
|
||||
Handle(Standard_Transient) ent;
|
||||
Handle(Interface_Check) ach = new Interface_Check;
|
||||
@@ -454,7 +452,7 @@ Interface_CheckIterator Interface_CheckTool::WarningCheckList ()
|
||||
res.SetModel(model);
|
||||
Standard_Integer i=0, n0 = 1, nb = model->NbEntities();
|
||||
|
||||
//errh = 0;
|
||||
errh = 0;
|
||||
while (n0 <= nb) {
|
||||
Handle(Interface_Check) ach = new Interface_Check;
|
||||
Handle(Standard_Transient) ent;
|
||||
|
@@ -131,12 +131,10 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void raisecheck(Standard_Failure& theException, Handle(Interface_Check)& ach);
|
||||
|
||||
Handle(Interface_GTool) thegtool;
|
||||
Interface_ShareTool theshare;
|
||||
Standard_Integer thestat;
|
||||
Standard_Integer errh;
|
||||
|
||||
|
||||
};
|
||||
|
@@ -66,7 +66,7 @@ Interface_FileReaderTool::Interface_FileReaderTool ()
|
||||
{
|
||||
themessenger = Message::DefaultMessenger();
|
||||
theerrhand = Standard_True;
|
||||
thetrace = 0;
|
||||
thetrace = 1;
|
||||
thenbrep0 = thenbreps = 0;
|
||||
}
|
||||
|
||||
@@ -334,11 +334,8 @@ void Interface_FileReaderTool::LoadModel
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
// Sendinf of message : Internal error during the header reading
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send(Msg11, Message_Info);
|
||||
}
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send (Msg11, Message_Info);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -370,12 +367,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
// .. Fin Lecture ..
|
||||
if (anent.IsNull()) {
|
||||
// Sending of message : Number of ignored Null Entities
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities());
|
||||
TF->Send(Msg21, Message_Info);
|
||||
}
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities());
|
||||
TF->Send (Msg21, Message_Info);
|
||||
continue;
|
||||
}
|
||||
// LoadedEntity fait AddEntity MAIS PAS SetReport (en bloc a la fin)
|
||||
@@ -398,18 +392,13 @@ void Interface_FileReaderTool::LoadModel
|
||||
//:abv 03Apr00: anent is actually a previous one: if (anent.IsNull())
|
||||
anent = thereader->BoundEntity(num);
|
||||
if (anent.IsNull()) {
|
||||
if (thetrace > 0)
|
||||
{
|
||||
// Sending of message : Number of ignored Null Entities
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities() + 1);
|
||||
|
||||
TF->Send(Msg21, Message_Info);
|
||||
}
|
||||
continue;
|
||||
if (thetrace > 0)
|
||||
{
|
||||
// Sending of message : Number of ignored Null Entities
|
||||
Message_Msg Msg21("XSTEP_21");
|
||||
Msg21.Arg(amodel->NbEntities()+1);
|
||||
TF->Send (Msg21, Message_Info);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/*Handle(Interface_Check)*/ ach = new Interface_Check(anent);
|
||||
@@ -419,13 +408,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
ach->SendFail (Msg278);
|
||||
|
||||
if (ierr == 2) {
|
||||
// Sending of message : reading of entity failed
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send(Msg22, Message_Info);
|
||||
}
|
||||
// Sending of message : reading of entity failed
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send (Msg22, Message_Info);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -434,13 +420,10 @@ void Interface_FileReaderTool::LoadModel
|
||||
ierr = 1;
|
||||
// ce qui serait bien ici serait de recuperer le texte de l erreur pour ach ...
|
||||
if (thetrace > 0) {
|
||||
// Sending of message : recovered entity
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg23("XSTEP_23");
|
||||
Msg23.Arg(num);
|
||||
TF->Send(Msg23, Message_Info);
|
||||
}
|
||||
// Sending of message : recovered entity
|
||||
Message_Msg Msg23("XSTEP_23");
|
||||
Msg23.Arg(num);
|
||||
TF->Send (Msg23, Message_Info);
|
||||
}
|
||||
|
||||
// Finalement, on charge une Entite Inconnue
|
||||
@@ -461,12 +444,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
else {
|
||||
if (thetrace > 0) {
|
||||
// Sending of message : reading of entity failed
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send(Msg22, Message_Info);
|
||||
}
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
Msg22.Arg(amodel->StringLabel(anent));
|
||||
TF->Send (Msg22, Message_Info);
|
||||
}
|
||||
// On garde <rep> telle quelle : pas d analyse fichier supplementaire,
|
||||
// Mais la phase preliminaire eventuelle est conservee
|
||||
@@ -480,12 +460,9 @@ void Interface_FileReaderTool::LoadModel
|
||||
if (thetrace > 0)
|
||||
{
|
||||
// Sending of message : report
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg24("XSTEP_24");
|
||||
Msg24.Arg(thenbreps);
|
||||
TF->Send(Msg24, Message_Info);
|
||||
}
|
||||
Message_Msg Msg24("XSTEP_24");
|
||||
Msg24.Arg(thenbreps);
|
||||
TF->Send (Msg24, Message_Info);
|
||||
}
|
||||
amodel->Reservate (-thenbreps-10);
|
||||
thenbreps = thereports->Upper();
|
||||
@@ -506,11 +483,8 @@ void Interface_FileReaderTool::LoadModel
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
// Sendinf of message : Internal error during the header reading
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send(Msg11, Message_Info);
|
||||
}
|
||||
Message_Msg Msg11("XSTEP_11");
|
||||
TF->Send (Msg11, Message_Info);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -539,13 +513,10 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
|
||||
// Trace Entite Inconnue
|
||||
if (thetrace >= 2 && theproto->IsUnknownEntity(anent)) {
|
||||
Handle(Message_Messenger) TF = Messenger();
|
||||
if (!TF.IsNull())
|
||||
{
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
// Sending of message : reading of entity failed
|
||||
Msg22.Arg(themodel->StringLabel(anent)->String());
|
||||
TF->Send(Msg22, Message_Info);
|
||||
}
|
||||
Message_Msg Msg22("XSTEP_22");
|
||||
// Sending of message : reading of entity failed
|
||||
Msg22.Arg(themodel->StringLabel(anent)->String());
|
||||
TF->Send (Msg22, Message_Info);
|
||||
}
|
||||
// .. Chargement proprement dit : Specifique de la Norme ..
|
||||
AnalyseRecord(num,anent,ach);
|
||||
@@ -574,7 +545,7 @@ Handle(Standard_Transient) Interface_FileReaderTool::LoadedEntity
|
||||
}
|
||||
thereports->SetValue(irep,rep);
|
||||
|
||||
if ( thetrace >= 2 && !Messenger().IsNull())
|
||||
if ( thetrace >= 2)
|
||||
ach->Print (Messenger(),2);
|
||||
}
|
||||
|
||||
|
@@ -1040,75 +1040,3 @@ Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Interface_Static) Interface_InterfaceModel::GetParam
|
||||
(const Standard_CString theParamName) const
|
||||
{
|
||||
Handle(Interface_Static) aParam;
|
||||
if (myParamMap.IsBound(theParamName))
|
||||
{
|
||||
Handle(Standard_Transient) result;
|
||||
myParamMap.Find(theParamName, result);
|
||||
if (!result.IsNull())
|
||||
aParam = Handle(Interface_Static)::DownCast(result);
|
||||
}
|
||||
if (aParam.IsNull())
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Incorrect parameter :" << name << endl;
|
||||
#endif
|
||||
}
|
||||
return aParam;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetParam
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Interface_InterfaceModel::AddParam
|
||||
(const Standard_CString theParamName, Handle(Interface_Static)& theParam)
|
||||
{
|
||||
myParamMap.Bind(theParamName, theParam);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AllParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& Interface_InterfaceModel::AllParameters()
|
||||
{
|
||||
return myParamMap;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IVal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer Interface_InterfaceModel::IVal(const Standard_CString theParamName) const
|
||||
{
|
||||
Handle(Interface_Static) aParam = GetParam(theParamName);
|
||||
return (aParam.IsNull() ? 0 : aParam->IntegerValue());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RVal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Real Interface_InterfaceModel::RVal(const Standard_CString theParamName) const
|
||||
{
|
||||
Handle(Interface_Static) aParam = GetParam(theParamName);
|
||||
return (aParam.IsNull() ? 0.0 : aParam->RealValue());
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CVal
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_CString Interface_InterfaceModel::CVal(const Standard_CString theParamName) const
|
||||
{
|
||||
Handle(Interface_Static) aParam = GetParam(theParamName);
|
||||
return (aParam.IsNull() ? "" : aParam->CStringValue());
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user