mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
01da7955fb |
@@ -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)
|
||||
@@ -561,27 +558,6 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
||||
endif()
|
||||
|
||||
# FFmpeg
|
||||
# search for CSF_FFmpeg variable in EXTERNLIB of each being used toolkit
|
||||
OCCT_IS_PRODUCT_REQUIRED (CSF_FFmpeg CAN_USE_FFMPEG)
|
||||
|
||||
if (CAN_USE_FFMPEG)
|
||||
set (USE_FFMPEG OFF CACHE BOOL "${USE_FFMPEG_DESCR}")
|
||||
|
||||
if (USE_FFMPEG)
|
||||
add_definitions (-DHAVE_FFMPEG)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/ffmpeg")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
|
||||
endif()
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET ("USE_FFMPEG")
|
||||
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FFMPEG")
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
|
||||
endif()
|
||||
|
||||
# OpenGL ES 2.0
|
||||
if (WIN32 AND CAN_USE_GLES2)
|
||||
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
|
||||
@@ -715,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)
|
||||
@@ -756,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")
|
||||
@@ -773,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}")
|
||||
@@ -942,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})
|
||||
@@ -976,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
|
@@ -347,6 +347,8 @@ n StepToGeom
|
||||
n StepToTopoDS
|
||||
n StepVisual
|
||||
n StlAPI
|
||||
n StlMesh
|
||||
n StlTransfer
|
||||
n TopoDSToStep
|
||||
n Transfer
|
||||
n TransferBRep
|
||||
|
@@ -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()
|
||||
|
@@ -1,228 +0,0 @@
|
||||
# FFmpeg
|
||||
|
||||
if (NOT DEFINED INSTALL_FFMPEG)
|
||||
set (INSTALL_FFMPEG OFF CACHE BOOL "${INSTALL_FFMPEG_DESCR}")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_DIR)
|
||||
set (3RDPARTY_FFMPEG_DIR "" CACHE PATH "The directory containing FFmpeg")
|
||||
endif()
|
||||
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
# specify FFMPEG folder in connection with 3RDPARTY_DIR
|
||||
if (3RDPARTY_DIR AND EXISTS "${3RDPARTY_DIR}")
|
||||
if (NOT 3RDPARTY_FFMPEG_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_DIR}")
|
||||
FIND_PRODUCT_DIR ("${3RDPARTY_DIR}" FFMPEG FFMPEG_DIR_NAME)
|
||||
if (FFMPEG_DIR_NAME)
|
||||
set (3RDPARTY_FFMPEG_DIR "${3RDPARTY_DIR}/${FFMPEG_DIR_NAME}" CACHE PATH "The directory containing FFmpeg" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
endif()
|
||||
|
||||
# define required FFMPEG variables
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_INCLUDE_DIR)
|
||||
set (3RDPARTY_FFMPEG_INCLUDE_DIR "" CACHE PATH "the path of headers directory")
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_LIBRARY OR NOT 3RDPARTY_FFMPEG_LIBRARY_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
|
||||
set (3RDPARTY_FFMPEG_LIBRARY "" CACHE FILEPATH "FFmpeg framework" FORCE)
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_LIBRARY_DIR)
|
||||
set (3RDPARTY_FFMPEG_LIBRARY_DIR "" CACHE PATH "The directory containing FFmpeg framework")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_DLL OR NOT 3RDPARTY_FFMPEG_DLL_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_DLL_DIR}")
|
||||
set (3RDPARTY_FFMPEG_DLL "" CACHE FILEPATH "FFmpeg shared libraries" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (NOT DEFINED 3RDPARTY_FFMPEG_DLL_DIR)
|
||||
set (3RDPARTY_FFMPEG_DLL_DIR "" CACHE PATH "The directory containing FFmpeg shared libraries")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check 3RDPARTY_${PRODUCT_NAME}_ paths for consistency with specified 3RDPARTY_${PRODUCT_NAME}_DIR
|
||||
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
|
||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_INCLUDE_DIR PATH "the path to FFmpeg")
|
||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_LIBRARY FILEPATH "the path to FFmpeg framework")
|
||||
|
||||
if (3RDPARTY_FFMPEG_LIBRARY AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY}" PATH)
|
||||
set (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY_DIR}" CACHE PATH "The directory containing FFmpeg libraries" FORCE)
|
||||
else()
|
||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_LIBRARY_DIR PATH "The directory containing FFmpeg libraries")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_DLL FILEPATH "the path to FFmpeg shared libraries")
|
||||
|
||||
if (3RDPARTY_FFMPEG_DLL AND EXISTS "${3RDPARTY_FFMPEG_DLL}")
|
||||
get_filename_component (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL}" PATH)
|
||||
set (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL_DIR}" CACHE PATH "The directory containing FFmpeg shared libraries" FORCE)
|
||||
else()
|
||||
CHECK_PATH_FOR_CONSISTENCY (3RDPARTY_FFMPEG_DIR 3RDPARTY_FFMPEG_DLL_DIR PATH "The directory containing FFmpeg shared libraries")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# header
|
||||
if (NOT 3RDPARTY_FFMPEG_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
|
||||
set (HEADER_NAMES avutil.h libavutil/avutil.h)
|
||||
|
||||
# set 3RDPARTY_FFMPEG_INCLUDE_DIR as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FFMPEG_INCLUDE_DIR
|
||||
set (3RDPARTY_FFMPEG_INCLUDE_DIR "3RDPARTY_FFMPEG_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "the path to header directory" FORCE)
|
||||
|
||||
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
|
||||
find_path (3RDPARTY_FFMPEG_INCLUDE_DIR NAMES ${HEADER_NAMES}
|
||||
PATHS ${3RDPARTY_FFMPEG_DIR}
|
||||
PATH_SUFFIXES include
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_path (3RDPARTY_FFMPEG_INCLUDE_DIR NAMES ${HEADER_NAMES}
|
||||
PATH_SUFFIXES include
|
||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FFMPEG_INCLUDE_DIR AND EXISTS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_FFMPEG_INCLUDE_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_INCLUDE_DIR)
|
||||
|
||||
set (3RDPARTY_FFMPEG_INCLUDE_DIR "" CACHE FILEPATH "the path to avutil.h" FORCE)
|
||||
endif()
|
||||
|
||||
# library
|
||||
if (NOT 3RDPARTY_FFMPEG_LIBRARY OR NOT EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .so .dylib .a)
|
||||
|
||||
set (FFMPEG_PATH_SUFFIXES lib)
|
||||
if (ANDROID)
|
||||
set (FFMPEG_PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES} libs/${ANDROID_ABI})
|
||||
elseif(APPLE)
|
||||
set (FFMPEG_PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES} Frameworks)
|
||||
endif()
|
||||
|
||||
# set 3RDPARTY_FFMPEG_LIBRARY as notfound, otherwise find_library can't assign a new value to 3RDPARTY_FFMPEG_LIBRARY
|
||||
set (3RDPARTY_FFMPEG_LIBRARY "3RDPARTY_FFMPEG_LIBRARY-NOTFOUND" CACHE FILEPATH "The path to FFmpeg library" FORCE)
|
||||
|
||||
if (3RDPARTY_FFMPEG_DIR AND EXISTS "${3RDPARTY_FFMPEG_DIR}")
|
||||
find_library (3RDPARTY_FFMPEG_LIBRARY NAMES avutil
|
||||
PATHS "${3RDPARTY_FFMPEG_LIBRARY_DIR}" "${3RDPARTY_FFMPEG_DIR}"
|
||||
PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES}
|
||||
CMAKE_FIND_ROOT_PATH_BOTH
|
||||
NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_library (3RDPARTY_FFMPEG_LIBRARY NAMES avutil
|
||||
PATH_SUFFIXES ${FFMPEG_PATH_SUFFIXES}
|
||||
CMAKE_FIND_ROOT_PATH_BOTH)
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FFMPEG_LIBRARY AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY}")
|
||||
get_filename_component (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY}" PATH)
|
||||
set (3RDPARTY_FFMPEG_LIBRARY_DIR "${3RDPARTY_FFMPEG_LIBRARY_DIR}" CACHE PATH "The directory containing FFmpeg library" FORCE)
|
||||
else()
|
||||
set (3RDPARTY_FFMPEG_LIBRARY_DIR "" CACHE PATH "The directory containing FFmpeg library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FFMPEG_LIBRARY_DIR AND EXISTS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_FFMPEG_LIBRARY_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_LIBRARY_DIR)
|
||||
|
||||
set (3RDPARTY_FFMPEG_LIBRARY "" CACHE FILEPATH "The path to FFmpeg library" FORCE)
|
||||
endif()
|
||||
|
||||
# shared library
|
||||
if (WIN32)
|
||||
if (NOT 3RDPARTY_FFMPEG_DLL OR NOT EXISTS "${3RDPARTY_FFMPEG_DLL}")
|
||||
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .dll)
|
||||
set (3RDPARTY_FFMPEG_DLL "3RDPARTY_FFMPEG_DLL-NOTFOUND" CACHE FILEPATH "The path to FFmpeg shared library" FORCE)
|
||||
|
||||
# find FFmpeg shared library
|
||||
file (GLOB 3RDPARTY_FFMPEG_DLL "${3RDPARTY_FFMPEG_DIR}/bin/avutil[-][0-9]*")
|
||||
|
||||
if (3RDPARTY_FFMPEG_DLL AND EXISTS "${3RDPARTY_FFMPEG_DLL}")
|
||||
set (3RDPARTY_FFMPEG_DLL "${3RDPARTY_FFMPEG_DLL}" CACHE FILEPATH "FFmpeg shared library" FORCE)
|
||||
get_filename_component (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL}" PATH)
|
||||
set (3RDPARTY_FFMPEG_DLL_DIR "${3RDPARTY_FFMPEG_DLL_DIR}" CACHE PATH "The directory containing FFmpeg library" FORCE)
|
||||
else()
|
||||
set (3RDPARTY_FFMPEG_DLL_DIR "" CACHE PATH "The directory containing FFmpeg shared library" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (3RDPARTY_FFMPEG_DLL_DIR OR EXISTS "${3RDPARTY_FFMPEG_DLL_DIR}")
|
||||
list (APPEND 3RDPARTY_DLL_DIRS "${3RDPARTY_FFMPEG_DLL_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_FFMPEG_DLL_DIR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# install instructions
|
||||
if (INSTALL_FFMPEG)
|
||||
OCCT_MAKE_OS_WITH_BITNESS()
|
||||
OCCT_MAKE_COMPILER_SHORT_NAME()
|
||||
|
||||
if (WIN32)
|
||||
if (DEFINED INSTALL_BIN_DIR)
|
||||
install (FILES "${3RDPARTY_FFMPEG_DLL}" DESTINATION "${INSTALL_BIN_DIR}")
|
||||
else()
|
||||
install (FILES "${3RDPARTY_FFMPEG_DLL}"
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin")
|
||||
install (FILES "${3RDPARTY_FFMPEG_DLL}"
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini")
|
||||
install (FILES "${3RDPARTY_FFMPEG_DLL}"
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind")
|
||||
endif()
|
||||
else()
|
||||
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_ABS ${3RDPARTY_FFMPEG_LIBRARY} REALPATH)
|
||||
get_filename_component(3RDPARTY_FFMPEG_LIBRARY_NAME ${3RDPARTY_FFMPEG_LIBRARY} NAME)
|
||||
|
||||
if (DEFINED INSTALL_LIB_DIR)
|
||||
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
|
||||
DESTINATION "${INSTALL_LIB_DIR}"
|
||||
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
|
||||
else()
|
||||
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
|
||||
CONFIGURATIONS Release
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib"
|
||||
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
|
||||
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
|
||||
CONFIGURATIONS RelWithDebInfo
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi"
|
||||
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
|
||||
install (FILES "${3RDPARTY_FFMPEG_LIBRARY_ABS}"
|
||||
CONFIGURATIONS Debug
|
||||
DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd"
|
||||
RENAME ${3RDPARTY_FFMPEG_LIBRARY_NAME}.6)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set (USED_3RDPARTY_FFMPEG_DIR "")
|
||||
else()
|
||||
# the library directory for using by the executable
|
||||
if (WIN32)
|
||||
set (USED_3RDPARTY_FFMPEG_DIR ${3RDPARTY_FFMPEG_DLL_DIR})
|
||||
else()
|
||||
set (USED_3RDPARTY_FFMPEG_DIR ${3RDPARTY_FFMPEG_LIBRARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# unset all redundant variables
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_INCLUDE_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_LIBRARY_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (FFMPEG_DIR)
|
||||
|
||||
mark_as_advanced (3RDPARTY_FFMPEG_LIBRARY 3RDPARTY_FFMPEG_DLL)
|
@@ -24,13 +24,6 @@ else()
|
||||
set (CSF_FREETYPE)
|
||||
endif()
|
||||
|
||||
# FFmpeg
|
||||
if (USE_FFMPEG)
|
||||
set (CSF_FFmpeg "avcodec avformat swscale avutil")
|
||||
else()
|
||||
set (CSF_FFmpeg)
|
||||
endif()
|
||||
|
||||
# FREEIMAGE
|
||||
if (USE_FREEIMAGE)
|
||||
set (CSF_FreeImagePlus "freeimage")
|
||||
|
@@ -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)
|
||||
@@ -316,7 +308,6 @@ if (BUILD_USE_PCH)
|
||||
|
||||
# workaround for old gcc
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions("-D__STDC_CONSTANT_MACROS")
|
||||
add_definitions("-D__STDC_FORMAT_MACROS")
|
||||
endif()
|
||||
|
||||
|
@@ -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()
|
@@ -82,7 +82,6 @@ endmacro()
|
||||
INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
|
||||
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
|
||||
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
|
||||
INSTALL_MESSAGE (INSTALL_FFMPEG "FFmpeg binaries")
|
||||
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
|
||||
INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
|
||||
INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
|
||||
@@ -137,10 +136,6 @@ set (3RDPARTY_DIR_DESCR
|
||||
third-party product have been found - corresponding CMake variables will be specified
|
||||
(VTK: 3RDPARTY_VTK_DIR, 3RDPARTY_VTK_INCLUDE_DIR, 3RDPARTY_VTK_LIBRARY_DIR)")
|
||||
|
||||
set (USE_FFMPEG_DESCR
|
||||
"Indicates whether FFmpeg framework is used or not. FFmpeg stands for
|
||||
multimedia data handling, open-source software libraries used for video encoding and decoding.")
|
||||
|
||||
set (USE_FREEIMAGE_DESCR
|
||||
"Indicates whether Freeimage product should be used in OCCT visualization
|
||||
module for support of popular graphics image formats (PNG, BMP etc)")
|
||||
@@ -172,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}")
|
||||
|
@@ -119,21 +119,6 @@ proc wokdep:SearchHeader {theHeader} {
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
}
|
||||
|
||||
if { "$::tcl_platform(os)" == "Linux" } {
|
||||
if { "$::ARCH" == "64" } {
|
||||
set aPath "/usr/include/x86_64-linux-gnu/${theHeader}"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
}
|
||||
} else {
|
||||
set aPath "/usr/include/i386-linux-gnu/${theHeader}"
|
||||
if { [file exists "$aPath"] } {
|
||||
return "$aPath"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -61,7 +61,6 @@ set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
|
||||
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
|
||||
set (OpenCASCADE_WITH_TBB @USE_TBB@)
|
||||
set (OpenCASCADE_WITH_VTK @USE_VTK@)
|
||||
set (OpenCASCADE_WITH_FFMPEG @USE_FFMPEG@)
|
||||
set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
|
||||
@SET_OpenCASCADE_WITH_D3D@
|
||||
@SET_OpenCASCADE_WITH_GLX@
|
||||
|
@@ -14,11 +14,7 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIRS@"
|
||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
|
||||
set "FFMPEG_DIR=@3RDPARTY_FFMPEG_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@"
|
||||
|
||||
|
@@ -12,11 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export GL2PS_DIR="@3RDPARTY_GL2PS_LIBRARY_DIRS@"
|
||||
export TBB_DIR="@3RDPARTY_TBB_LIBRARY_DIR@"
|
||||
export VTK_DIR="@3RDPARTY_VTK_LIBRARY_DIR@"
|
||||
export FFMPEG_DIR="@3RDPARTY_FFMPEG_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@"
|
||||
|
@@ -16,11 +16,7 @@ if /I "%VCVER%" == "@COMPILER@" (
|
||||
set "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIRS@"
|
||||
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
|
||||
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
|
||||
set "FFMPEG_DIR=@USED_3RDPARTY_FFMPEG_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@"
|
||||
|
||||
|
@@ -12,11 +12,6 @@ if [ "$1" == "@BIN_LETTER@" ]; then
|
||||
export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIRS@"
|
||||
export TBB_DIR="@USED_3RDPARTY_TBB_DIR@"
|
||||
export VTK_DIR="@USED_3RDPARTY_VTK_DIR@"
|
||||
export FFMPEG_DIR="@USED_3RDPARTY_FFMPEG_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,8 +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 ["%FFMPEG_DIR%"] == [""] set "PATH=%FFMPEG_DIR%;%PATH%"
|
||||
if not ["%QTDIR%"] == [""] set "PATH=%QTDIR%/bin;%PATH%"
|
||||
|
||||
rem ----- Set path to 3rd party and OCCT libraries -----
|
||||
if not "%CSF_OCCTBinPath%" == "" (
|
||||
|
@@ -66,14 +66,6 @@ if [ "$VTK_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${VTK_DIR}:${THRDPARTY_PATH}"
|
||||
fi
|
||||
|
||||
if [ "$FFMPEG_DIR" != "" ]; then
|
||||
THRDPARTY_PATH="${FFMPEG_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%"
|
||||
|
@@ -110,7 +110,6 @@
|
||||
<ProgramDatabaseFile>.\..\..\..\win32\__VCVER__\bin\__XQTNAM__.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<ImportLibrary>..\..\..\win32\__VCVER__\lib\__XQTNAM__.lib</ImportLibrary>
|
||||
<AdditionalOptions>/LARGEADDRESSAWARE %(AdditionalOptions)</AdditionalOptions>
|
||||
__VCLNKREL__
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@@ -156,7 +155,6 @@
|
||||
<ProgramDatabaseFile>..\..\..\win32\__VCVER__\bind\__XQTNAM__.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<ImportLibrary>..\..\..\win32\__VCVER__\libd\__XQTNAM__.lib</ImportLibrary>
|
||||
<AdditionalOptions>/LARGEADDRESSAWARE %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@@ -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
|
||||
|
@@ -1260,8 +1260,6 @@ In most cases this change should be transparent, however applications implementi
|
||||
* The methods BOPAlgo_Tools::FillMap() have been replaced with the single template method BOPAlgo_Tools::FillMap().
|
||||
* Package BVH now uses opencascade::handle instead of NCollection_Handle (for classes BVH_Properties, BVH_Builder, BVH_Tree, BVH_Object).
|
||||
Application code using BVH package directly should be updated accordingly.
|
||||
* AIS_Shape now computes UV texture coordinates for AIS_Shaded presentation in case if texture mapping is enabled within Shaded Attributes.
|
||||
Therefore, redundant class AIS_TexturedShape has been marked deprecated - applications can use AIS_Shape directly (texture mapping should be defined through AIS_Shape::Attributes()).
|
||||
|
||||
@subsection upgrade_720_BOP_DataStructure BOP - Pairs of interfering indices
|
||||
|
||||
@@ -1406,7 +1404,3 @@ In previous versions, *IsPeriodic()* always returned false if *IsClosed()* retur
|
||||
The history of the changing of the initial shape was corrected:
|
||||
* all shapes created by the algorithm are considered as modified shapes instead of generated ones;
|
||||
* method Generated was removed and its calls should be replaced by calls of method History()->Modified.
|
||||
|
||||
@subsection upgrade_720_Change_In_RWStl Changes in STL Reader / Writer
|
||||
|
||||
Class RWStl now uses class Poly_Triangulation for storing triangular mesh instead of StlMesh data classes; the latter have been removed.
|
||||
|
@@ -135,9 +135,6 @@ by fully automating techniques as precompiled header usage and single compilatio
|
||||
Cotire is included in OCCT repository and used optionally by OCCT CMake scripts to accelerate builds by use of precompiled headers.
|
||||
Cotire is licensed under the MIT license (https://github.com/sakra/cotire/blob/master/license).
|
||||
|
||||
**FFmpeg** is an Open Source framework supporting various image, video and audio codecs.
|
||||
FFmpeg is optionally used by OCCT for video recording, on LGPL conditions (https://www.ffmpeg.org/legal.html).
|
||||
|
||||
**MikTEX** is up-to-date implementation of TeX/LaTeX and related programs for Windows. It is used
|
||||
for generation of User and Developer Guides in PDF format. See https://miktex.org for information
|
||||
on this tool.
|
||||
@@ -213,7 +210,6 @@ for which OCCT is certified to work.
|
||||
| TCL (for testing tools) | Tcl/Tk 8.6.3+ http://www.tcl.tk/software/tcltk/download.html <br> or ActiveTcl 8.6 http://www.activestate.com/activetcl/downloads (for Windows)|
|
||||
| Freetype (for text rendering) | FreeType 2.4.11-2.5.5 http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (optional, for support of common 2D graphic formats) | FreeImage 3.17.0+ http://sourceforge.net/projects/freeimage/files |
|
||||
| FFmpeg (optional, for video recording) | FFmpeg 3.1+ https://www.ffmpeg.org |
|
||||
| gl2ps (optional, for export contents of OCCT viewer to vector formats) | gl2ps-1.3.8+ http://geuz.org/gl2ps/ |
|
||||
| Intel TBB (optional, for multithreaded algorithms) | TBB 4.x or 5.x http://www.threadingbuildingblocks.org/ |
|
||||
| VTK (for VTK Integration Services | VTK 6.1+ http://www.vtk.org/VTK/resources/software.html |
|
||||
|
@@ -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:
|
||||
~~~~~
|
||||
@@ -6271,51 +6249,41 @@ bsplineprof res
|
||||
|
||||
@subsubsection occt_draw_7_2_6 mkoffset
|
||||
|
||||
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurrences is not limited.
|
||||
The offset distance defines the spacing and the positioning of the occurrences.
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
mkoffset result shape nboffset stepoffset [jointype(a/i) [alt]]
|
||||
mkoffset result face/compound of wires nboffset stepoffset
|
||||
~~~~~
|
||||
where:
|
||||
* *result* - the base name for the resulting wires. The index of the occurrence (starting with 1) will be added to this name, so the resulting wires will have the names - *result_1*, *result_2* ...;
|
||||
* *shape* - input shape (face or compound of wires);
|
||||
* *nboffset* - the number of the parallel occurrences;
|
||||
* *stepoffset* - offset distance between occurrences;
|
||||
* *jointype(a/i)* - join type (a for *arc* (default) and i for *intersection*);
|
||||
* *alt* - altitude from the plane of the input face in relation to the normal to the face.
|
||||
|
||||
**mkoffset** creates a parallel wire in the same plane using a face or an existing continuous set of wires as a reference. The number of occurences is not limited.
|
||||
|
||||
The offset distance defines the spacing and the positioning of the occurences.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
# Create a box and select a face
|
||||
#Create a box and select a face
|
||||
box b 1 2 3
|
||||
explode b f
|
||||
# Create three exterior parallel contours with an offset value of 2
|
||||
#Create three exterior parallel contours with an offset
|
||||
value of 2
|
||||
mkoffset r b_1 3 2
|
||||
# wires r_1, r_2 and r_3 are created
|
||||
|
||||
# Create three exterior parallel contours with an offset value of 2 without round corners
|
||||
mkoffset r b_1 3 2 i
|
||||
# wires r_1, r_2 and r_3 are created
|
||||
|
||||
# Create one interior parallel contour with an offset value of 0.4
|
||||
Create one interior parallel contour with an offset
|
||||
value of
|
||||
0.4
|
||||
mkoffset r b_1 1 -0.4
|
||||
~~~~~
|
||||
|
||||
**Note** that on a concave input contour for an interior step *mkoffset* command may produce several wires which will be contained in a single compound.
|
||||
**Note** that *mkoffset* command must be used with prudence, as angular contours produce offset contours with fillets. Interior parallel contours can produce more than one wire, normally these are refused. In the following example, any increase in the offset value is refused.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
# to create the example contour
|
||||
profile p F 0 0 x 2 y 4 tt 1 1 tt 0 4 w
|
||||
# creates an incoherent interior offset
|
||||
# to create an incoherent interior offset
|
||||
mkoffset r p 1 -0.50
|
||||
==p is not a FACE but a WIRE
|
||||
BRepFill_TrimEdgeTool: incoherent intersection
|
||||
# to create two incoherent wires
|
||||
mkoffset r p 1 -0.50
|
||||
|
||||
# creates two incoherent wires
|
||||
mkoffset r p 1 -0.55
|
||||
# r_1 is a compound of two wires
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_7_2_7 mkplane, mkface
|
||||
|
@@ -1508,8 +1508,8 @@ Such an object, for example, can be used for displaying the object and stored in
|
||||
|
||||
~~~~~
|
||||
// read the data and create a data source
|
||||
Handle(Poly_Triangulation) aSTLMesh = RWStl::ReadFile (aFileName);
|
||||
Handle(XSDRAWSTLVRML_DataSource) aDataSource = new XSDRAWSTLVRML_DataSource (aSTLMesh);
|
||||
Handle (StlMesh_Mesh) aSTLMesh = RWStl::ReadFile (aFileName);
|
||||
Handle (XSDRAWSTLVRML_DataSource) aDataSource = new XSDRAWSTLVRML_DataSource (aSTLMesh);
|
||||
|
||||
// create mesh
|
||||
Handle (MeshVS_Mesh) aMesh = new MeshVS();
|
||||
|
4
genconf
4
genconf
@@ -6,10 +6,8 @@
|
||||
# initialize environment
|
||||
aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
|
||||
if [ ! -e "${aScriptPath}/env.sh" ]; then
|
||||
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
|
||||
cat ${aScriptPath}/adm/templates/env.sh | sed -e '/__CASROOT__/d' > ${aScriptPath}/env.sh
|
||||
fi
|
||||
|
||||
if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
|
||||
|
||||
# run GUI tool
|
||||
tclsh "${aScriptPath}/adm/genconf.tcl"
|
||||
|
@@ -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^)
|
||||
|
@@ -75,6 +75,7 @@
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_LocalContext.hxx>
|
||||
#include <AIS_TextLabel.hxx>
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
|
||||
#include <Aspect_TypeOfline.hxx>
|
||||
#include <Aspect_WidthOfline.hxx>
|
||||
|
@@ -9,9 +9,9 @@
|
||||
#include <TopExp.hxx>
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Graphic3d_Texture2D.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <BRepBuilderAPI_Transform.hxx>
|
||||
@@ -80,7 +80,7 @@ void TexturesExt_Presentation::Init()
|
||||
" // aShape = ..." EOL
|
||||
"" EOL
|
||||
" // create a textured presentation object for aShape" EOL
|
||||
" Handle(AIS_Shape) aTShape = new AIS_Shape(aShape);" EOL
|
||||
" Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);" EOL
|
||||
"" EOL
|
||||
" TCollection_AsciiString aTFileName;" EOL
|
||||
"" EOL
|
||||
@@ -90,10 +90,22 @@ void TexturesExt_Presentation::Init()
|
||||
" // which will indicate use of predefined texture of this number" EOL
|
||||
" // aTFileName = ..." EOL
|
||||
"" EOL
|
||||
" aTShape->Attributes()->SetShadingAspect (new Prs3d_ShadingAspect());" EOL
|
||||
" Handle(Graphic3d_Texture2Dmanual) aTexture = new Graphic3d_Texture2Dmanual (aTFileName);" EOL
|
||||
" aTShape->Attributes()->ShadingAspect()->Aspect()->SetTextureMap (aTexture);" EOL
|
||||
" aTShape->Attributes()->ShadingAspect()->Aspect()->SetTextureMapOn();" EOL);
|
||||
" aTShape->SetTextureFileName(aTFileName);" EOL
|
||||
"" EOL
|
||||
" // do other initialization of AIS_TexturedShape" EOL
|
||||
" Standard_Real nRepeat;" EOL
|
||||
" Standard_Boolean toRepeat;" EOL
|
||||
" Standard_Boolean toScale;" EOL
|
||||
" // initialize aRepeat, toRepeat, toScale ..." EOL
|
||||
"" EOL
|
||||
" aTShape->SetTextureMapOn();" EOL
|
||||
" aTShape->SetTextureRepeat(toRepeat, nRepeat, nRepeat);" EOL
|
||||
" aTShape->SetTexturesExtcale(toScale);" EOL
|
||||
" " EOL
|
||||
" // mode 3 is \"textured\" mode of AIS_TexturedShape, " EOL
|
||||
" // other modes will display the \"normal\", non-textured shape," EOL
|
||||
" // in wireframe(1) or shaded(2) modes correspondingly" EOL
|
||||
" aTShape->SetDisplayMode(3); " EOL);
|
||||
// CString text(Message.ToCString());
|
||||
getDocument()->ClearDialog();
|
||||
getDocument()->SetDialogTitle("Change face color");
|
||||
@@ -105,12 +117,12 @@ void TexturesExt_Presentation::Init()
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//================================================================
|
||||
// Function : TexturesExt_Presentation::Texturize
|
||||
// display an AIS_Shape based on a given shape with texture with given filename
|
||||
// display an AIS_TexturedShape based on a given shape with texture with given filename
|
||||
// filename can also be an integer value ("2", "5", etc.), in this case
|
||||
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
||||
// is loaded.
|
||||
//================================================================
|
||||
Handle(AIS_Shape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
|
||||
Handle(AIS_TexturedShape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
|
||||
TCollection_AsciiString aTFileName,
|
||||
Standard_Real toScaleU,
|
||||
Standard_Real toScaleV,
|
||||
@@ -120,7 +132,7 @@ Handle(AIS_Shape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape
|
||||
Standard_Real originV)
|
||||
{
|
||||
// create a textured presentation object for aShape
|
||||
Handle(AIS_Shape) aTShape = new AIS_Shape(aShape);
|
||||
Handle(AIS_TexturedShape) aTShape = new AIS_TexturedShape(aShape);
|
||||
TCollection_AsciiString TFileName;
|
||||
// load texture from file if it is not an integer value
|
||||
// integer value indicates a number of texture in predefined TexturesExt enumeration
|
||||
@@ -132,19 +144,15 @@ Handle(AIS_Shape) TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape
|
||||
initfile += aTFileName.ToCString();
|
||||
}
|
||||
|
||||
if (!aTShape->Attributes()->HasOwnShadingAspect())
|
||||
{
|
||||
aTShape->Attributes()->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
}
|
||||
aTShape->Attributes()->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (TCollection_AsciiString ((const wchar_t* )initfile)));
|
||||
aTShape->Attributes()->ShadingAspect()->Aspect()->SetTextureMapOn();
|
||||
aTShape->SetTextureFileName (TCollection_AsciiString ((const wchar_t* )initfile));
|
||||
|
||||
// do other initialization of AIS_Shape
|
||||
aTShape->SetTextureScaleUV (gp_Pnt2d ( toScaleU, toScaleV));
|
||||
aTShape->SetTextureRepeatUV(gp_Pnt2d (toRepeatU, toRepeatV));
|
||||
aTShape->SetTextureOriginUV(gp_Pnt2d ( originU, originV));
|
||||
|
||||
aTShape->SetDisplayMode(AIS_Shaded);
|
||||
// do other initialization of AIS_TexturedShape
|
||||
aTShape->SetTextureMapOn();
|
||||
aTShape->SetTextureScale(Standard_True, toScaleU, toScaleV);
|
||||
aTShape->SetTextureRepeat(Standard_True, toRepeatU, toRepeatV);
|
||||
aTShape->SetTextureOrigin(Standard_True, originU, originV);
|
||||
|
||||
aTShape->SetDisplayMode(3); // mode 3 is "textured" mode
|
||||
|
||||
return aTShape;
|
||||
}
|
||||
@@ -247,10 +255,10 @@ aShape = Transformer.Shape();
|
||||
aShapeIO->SetPolygonOffsets(Aspect_POM_Fill, 1.5, 0.5);
|
||||
DISP(aShapeIO);
|
||||
|
||||
Handle(AIS_Shape) aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
|
||||
Handle(AIS_TexturedShape) aTFace1 = Texturize(aFaces(16), "carrelage1.gif", 1, 1, 3, 2);
|
||||
DISP(aTFace1);
|
||||
|
||||
Handle(AIS_Shape) aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
|
||||
Handle(AIS_TexturedShape) aTFace2 = Texturize(aFaces(21), "carrelage1.gif", 1, 1, 3, 2);
|
||||
DISP(aTFace2);
|
||||
|
||||
getViewer()->Update();
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "OCCDemo_Presentation.h"
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
@@ -28,11 +28,11 @@ public:
|
||||
virtual void Init();
|
||||
|
||||
private:
|
||||
// display an AIS_Shape based on a given shape with texture with given filename
|
||||
// display an AIS_TexturedShape based on a given shape with texture with given filename
|
||||
// filename can also be an integer value ("2", "5", etc.), in this case
|
||||
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
|
||||
// is loaded.
|
||||
Handle(AIS_Shape) Texturize(
|
||||
Handle(AIS_TexturedShape) Texturize(
|
||||
const TopoDS_Shape& aShape, TCollection_AsciiString aTFileName,
|
||||
Standard_Real toScaleU=1.0, Standard_Real toScaleV=1.0,
|
||||
Standard_Real toRepeatU=1.0, Standard_Real toRepeatV=1.0,
|
||||
|
@@ -2,15 +2,13 @@
|
||||
|
||||
#include "Sample2D_Image.h"
|
||||
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Image,AIS_Shape)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Sample2D_Image,AIS_TexturedShape)
|
||||
|
||||
Sample2D_Image::Sample2D_Image(TCollection_AsciiString& aFileName,
|
||||
const Standard_Real X,
|
||||
const Standard_Real Y,
|
||||
const Standard_Real aScale)
|
||||
:AIS_Shape(TopoDS_Shape())
|
||||
:AIS_TexturedShape(TopoDS_Shape())
|
||||
{
|
||||
myFilename = aFileName;
|
||||
myX = X;
|
||||
@@ -37,7 +35,9 @@ void Sample2D_Image::SetContext(const Handle(AIS_InteractiveContext)& theContext
|
||||
AIS_InteractiveObject::SetContext(theContext);
|
||||
MakeShape();
|
||||
this->Set(TopoDS_Shape(myFace));
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
myDrawer->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (myFilename));
|
||||
myDrawer->ShadingAspect()->Aspect()->SetTextureMapOn();
|
||||
this->SetTextureFileName(myFilename);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
#include <Standard_OStream.hxx>
|
||||
#include <Standard_IStream.hxx>
|
||||
class Sample2D_Image;
|
||||
DEFINE_STANDARD_HANDLE(Sample2D_Image,AIS_Shape)
|
||||
class Sample2D_Image : public AIS_Shape {
|
||||
DEFINE_STANDARD_HANDLE(Sample2D_Image,AIS_TexturedShape)
|
||||
class Sample2D_Image : public AIS_TexturedShape {
|
||||
|
||||
public:
|
||||
|
||||
@@ -26,7 +26,7 @@ Standard_EXPORT inline Standard_Real GetScale() const;
|
||||
Standard_EXPORT inline void SetScale(const Standard_Real aNewScale) ;
|
||||
Standard_EXPORT virtual void SetContext(const Handle(AIS_InteractiveContext)& theContext) ;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Sample2D_Image,AIS_Shape)
|
||||
DEFINE_STANDARD_RTTIEXT(Sample2D_Image,AIS_TexturedShape)
|
||||
private:
|
||||
void MakeShape();
|
||||
protected:
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <AIS_Line.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <AIS_TexturedShape.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
|
@@ -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
|
@@ -331,8 +331,10 @@ Standard_Boolean MainPage::SaveSTEP(const wchar_t* theFilePath, const TopoDS_Sha
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
switch (aWriter.Write (aFilePath.ToCString()))
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
switch (aWriter.Write(theFilePathA))
|
||||
{
|
||||
case IFSelect_RetError:
|
||||
Output_TextBlock->Text += L"Error: Incorrect Data\n";
|
||||
@@ -356,8 +358,11 @@ Standard_Boolean MainPage::SaveSTEP(const wchar_t* theFilePath, const TopoDS_Sha
|
||||
Standard_Boolean MainPage::SaveSTL(const wchar_t* theFilePath, const TopoDS_Shape& theShape)
|
||||
{
|
||||
StlAPI_Writer myStlWriter;
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
return myStlWriter.Write (theShape, aFilePath.ToCString());
|
||||
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
return myStlWriter.Write(theShape, theFilePathA) == StlAPI_StatusOK;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -367,8 +372,12 @@ Standard_Boolean MainPage::SaveSTL(const wchar_t* theFilePath, const TopoDS_Shap
|
||||
Standard_Boolean MainPage::SaveVRML(const wchar_t* theFilePath, const TopoDS_Shape& theShape)
|
||||
{
|
||||
VrmlAPI_Writer aWriter;
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
aWriter.Write (theShape, aFilePath.ToCString());
|
||||
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
aWriter.Write(theShape, theFilePathA);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
@@ -381,8 +390,11 @@ Standard_Boolean MainPage::ReadBREP(const wchar_t* theFilePath, TopoDS_Shape& th
|
||||
theShape.Nullify();
|
||||
|
||||
BRep_Builder aBuilder;
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
if (!BRepTools::Read(theShape, aFilePath.ToCString(), aBuilder))
|
||||
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
if (!BRepTools::Read(theShape, theFilePathA, aBuilder))
|
||||
return Standard_False;
|
||||
|
||||
return !theShape.IsNull() && BRepAlgo::IsValid(theShape);
|
||||
@@ -398,8 +410,10 @@ Standard_Boolean MainPage::ReadIGES(const wchar_t* theFilePath, TopoDS_Shape& th
|
||||
|
||||
IGESControl_Reader Reader;
|
||||
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
if (Reader.ReadFile (aFilePath.ToCString()) != IFSelect_RetDone)
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
if (Reader.ReadFile(theFilePathA) != IFSelect_RetDone)
|
||||
return Standard_False;
|
||||
|
||||
Reader.TransferRoots();
|
||||
@@ -417,8 +431,11 @@ Standard_Boolean MainPage::ReadSTEP(const wchar_t* theFilePath, TopoDS_Shape& th
|
||||
theShape.Nullify();
|
||||
|
||||
STEPControl_Reader aReader;
|
||||
const TCollection_AsciiString aFilePath (theFilePath);
|
||||
switch (aReader.ReadFile (aFilePath.ToCString()))
|
||||
|
||||
char theFilePathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, theFilePath, -1, theFilePathA, sizeof(theFilePathA), NULL, NULL);
|
||||
|
||||
switch (aReader.ReadFile(theFilePathA))
|
||||
{
|
||||
case IFSelect_RetError:
|
||||
Output_TextBlock->Text += L"Error: Not a valid Step file\n";
|
||||
|
@@ -298,12 +298,10 @@ void AIS_ColoredShape::UnsetTransparency()
|
||||
if (myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
|
||||
if (!HasColor()
|
||||
&& !HasMaterial()
|
||||
&& !myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
{
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
}
|
||||
if (!HasColor() && !HasMaterial())
|
||||
{
|
||||
myDrawer->SetShadingAspect (Handle(Prs3d_ShadingAspect)());
|
||||
}
|
||||
|
||||
for (AIS_DataMapOfShapeDrawer::Iterator anIter (myShapeColors); anIter.More(); anIter.Next())
|
||||
@@ -501,10 +499,7 @@ void AIS_ColoredShape::addShapesWithCustomProps (const Handle(Prs3d_Presentation
|
||||
// add special wireframe presentation for faces without triangulation
|
||||
StdPrs_ShadedShape::AddWireframeForFacesWithoutTriangles (thePrs, aShapeDraw, aDrawer);
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTriangles = StdPrs_ShadedShape::FillTriangles (aShapeDraw,
|
||||
aDrawer->ShadingAspect()->Aspect()->ToMapTexture()
|
||||
&& !aDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
|
||||
myUVOrigin, myUVRepeat, myUVScale);
|
||||
Handle(Graphic3d_ArrayOfTriangles) aTriangles = StdPrs_ShadedShape::FillTriangles (aShapeDraw);
|
||||
if (!aTriangles.IsNull())
|
||||
{
|
||||
if (aShadedGroup.IsNull())
|
||||
|
@@ -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
|
||||
|
@@ -80,19 +80,16 @@ static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: AIS_Shape
|
||||
// Function:
|
||||
// Purpose :
|
||||
//==================================================
|
||||
AIS_Shape::AIS_Shape(const TopoDS_Shape& theShape)
|
||||
: AIS_InteractiveObject (PrsMgr_TOP_ProjectorDependant),
|
||||
myshape (theShape),
|
||||
myUVOrigin(0.0, 0.0),
|
||||
myUVRepeat(1.0, 1.0),
|
||||
myUVScale (1.0, 1.0),
|
||||
myInitAng (0.0),
|
||||
myCompBB (Standard_True)
|
||||
|
||||
AIS_Shape::
|
||||
AIS_Shape(const TopoDS_Shape& shap):
|
||||
AIS_InteractiveObject(PrsMgr_TOP_ProjectorDependant),
|
||||
myInitAng(0.)
|
||||
{
|
||||
//
|
||||
Set (shap);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -186,10 +183,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer,
|
||||
myDrawer->ShadingAspect()->Aspect()->ToMapTexture()
|
||||
&& !myDrawer->ShadingAspect()->Aspect()->TextureMap().IsNull(),
|
||||
myUVOrigin, myUVRepeat, myUVScale);
|
||||
StdPrs_ShadedShape::Add (aPrs, myshape, myDrawer);
|
||||
}
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
@@ -568,7 +562,6 @@ void AIS_Shape::UnsetColor()
|
||||
return;
|
||||
}
|
||||
hasOwnColor = Standard_False;
|
||||
myDrawer->SetColor (myDrawer->HasLink() ? myDrawer->Link()->Color() : Quantity_Color (Quantity_NOC_WHITE));
|
||||
|
||||
if (!HasWidth())
|
||||
{
|
||||
@@ -612,34 +605,22 @@ void AIS_Shape::UnsetColor()
|
||||
myDrawer->SeenLineAspect()->SetColor (aColor);
|
||||
}
|
||||
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
if (HasMaterial()
|
||||
|| IsTransparent())
|
||||
{
|
||||
//
|
||||
}
|
||||
else if (HasMaterial()
|
||||
|| IsTransparent()
|
||||
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
{
|
||||
const Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
|
||||
Graphic3d_MaterialAspect mat = aDefaultMat;
|
||||
Quantity_Color anInteriorColors[2] = {Quantity_NOC_CYAN1, Quantity_NOC_CYAN1};
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
anInteriorColors[0] = myDrawer->Link()->ShadingAspect()->Aspect()->InteriorColor();
|
||||
anInteriorColors[1] = myDrawer->Link()->ShadingAspect()->Aspect()->BackInteriorColor();
|
||||
}
|
||||
if (HasMaterial() || myDrawer->HasLink())
|
||||
{
|
||||
const Handle(Graphic3d_AspectFillArea3d)& aSrcAspect = (HasMaterial() ? myDrawer : myDrawer->Link())->ShadingAspect()->Aspect();
|
||||
mat = myCurrentFacingModel != Aspect_TOFM_BACK_SIDE
|
||||
? aSrcAspect->FrontMaterial()
|
||||
: aSrcAspect->BackMaterial();
|
||||
mat = AIS_GraphicTool::GetMaterial(HasMaterial()? myDrawer : myDrawer->Link());
|
||||
}
|
||||
if (HasMaterial())
|
||||
{
|
||||
const Quantity_Color aColor = myDrawer->HasLink()
|
||||
? myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel)
|
||||
: aDefaultMat.AmbientColor();
|
||||
Quantity_Color aColor = aDefaultMat.AmbientColor();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aColor = myDrawer->Link()->ShadingAspect()->Color (myCurrentFacingModel);
|
||||
}
|
||||
mat.SetColor (aColor);
|
||||
}
|
||||
if (IsTransparent())
|
||||
@@ -647,9 +628,7 @@ void AIS_Shape::UnsetColor()
|
||||
Standard_Real aTransp = myDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
|
||||
mat.SetTransparency (Standard_ShortReal(aTransp));
|
||||
}
|
||||
myDrawer->ShadingAspect()->SetMaterial (mat, myCurrentFacingModel);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetInteriorColor (anInteriorColors[0]);
|
||||
myDrawer->ShadingAspect()->Aspect()->SetBackInteriorColor(anInteriorColors[1]);
|
||||
myDrawer->ShadingAspect()->SetMaterial (mat ,myCurrentFacingModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -659,8 +638,8 @@ void AIS_Shape::UnsetColor()
|
||||
|
||||
// modify shading presentation without re-computation
|
||||
const PrsMgr_Presentations& aPrsList = Presentations();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->ShadingAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAsp = myDrawer->LineAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectFillArea3d) anAreaAsp = myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
Handle(Graphic3d_AspectLine3d) aLineAsp = myDrawer->Link()->LineAspect()->Aspect();
|
||||
for (Standard_Integer aPrsIt = 1; aPrsIt <= aPrsList.Length(); ++aPrsIt)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aPrsModed = aPrsList.Value (aPrsIt);
|
||||
@@ -887,13 +866,8 @@ void AIS_Shape::UnsetMaterial()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
//
|
||||
}
|
||||
else if (HasColor()
|
||||
|| IsTransparent()
|
||||
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
if (HasColor()
|
||||
|| IsTransparent())
|
||||
{
|
||||
if(myDrawer->HasLink())
|
||||
{
|
||||
@@ -1007,9 +981,7 @@ void AIS_Shape::UnsetTransparency()
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (HasColor()
|
||||
|| HasMaterial()
|
||||
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
|
||||
else if (HasColor() || HasMaterial())
|
||||
{
|
||||
myDrawer->ShadingAspect()->SetTransparency (0.0, myCurrentFacingModel);
|
||||
}
|
||||
|
@@ -49,17 +49,6 @@ class Bnd_Box;
|
||||
//! above deviation angle and coefficient functions return
|
||||
//! true indicating that there is a local setting available
|
||||
//! for the specific object.
|
||||
//!
|
||||
//! This class allows to map textures on shapes using native UV parametric space of underlying surface of each Face
|
||||
//! (this means that texture will be visually duplicated on all Faces).
|
||||
//! To generate texture coordinates, appropriate shading attribute should be set before computing presentation in AIS_Shaded display mode:
|
||||
//! @code
|
||||
//! Handle(AIS_Shape) aPrs = new AIS_Shape();
|
||||
//! aPrs->Attributes()->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
//! aPrs->Attributes()->ShadingAspect()->Aspect()->SetTextureMapOn();
|
||||
//! aPrs->Attributes()->ShadingAspect()->Aspect()->SetTextureMap (new Graphic3d_Texture2Dmanual (Graphic3d_NOT_2D_ALUMINUM));
|
||||
//! @endcode
|
||||
//! The texture itself is parametrized in (0,1)x(0,1).
|
||||
class AIS_Shape : public AIS_InteractiveObject
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Shape, AIS_InteractiveObject)
|
||||
@@ -229,31 +218,6 @@ public:
|
||||
//! - mode 8 - Compound
|
||||
Standard_EXPORT static Standard_Integer SelectionMode (const TopAbs_ShapeEnum aShapeType);
|
||||
|
||||
public: //! @name methods to alter texture mapping properties
|
||||
|
||||
//! Return texture repeat UV values; (1, 1) by default.
|
||||
const gp_Pnt2d& TextureRepeatUV() const { return myUVRepeat; }
|
||||
|
||||
//! Sets the number of occurrences of the texture on each face. The texture itself is parameterized in (0,1) by (0,1).
|
||||
//! Each face of the shape to be textured is parameterized in UV space (Umin,Umax) by (Vmin,Vmax).
|
||||
void SetTextureRepeatUV (const gp_Pnt2d& theRepeatUV) { myUVRepeat = theRepeatUV; }
|
||||
|
||||
//! Return texture origin UV position; (0, 0) by default.
|
||||
const gp_Pnt2d& TextureOriginUV() const { return myUVOrigin; }
|
||||
|
||||
//! Use this method to change the origin of the texture.
|
||||
//! The texel (0,0) will be mapped to the surface (myUVOrigin.X(), myUVOrigin.Y()).
|
||||
void SetTextureOriginUV (const gp_Pnt2d& theOriginUV) { myUVOrigin = theOriginUV; }
|
||||
|
||||
//! Return scale factor for UV coordinates; (1, 1) by default.
|
||||
const gp_Pnt2d& TextureScaleUV() const { return myUVScale; }
|
||||
|
||||
//! Use this method to scale the texture (percent of the face).
|
||||
//! You can specify a scale factor for both U and V.
|
||||
//! Example: if you set ScaleU and ScaleV to 0.5 and you enable texture repeat,
|
||||
//! the texture will appear twice on the face in each direction.
|
||||
void SetTextureScaleUV (const gp_Pnt2d& theScaleUV) { myUVScale = theScaleUV; }
|
||||
|
||||
protected:
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
@@ -274,19 +238,19 @@ protected:
|
||||
|
||||
Standard_EXPORT void setMaterial (const Handle(Prs3d_Drawer)& theDrawer, const Graphic3d_MaterialAspect& theMaterial, const Standard_Boolean theToKeepColor, const Standard_Boolean theToKeepTransp) const;
|
||||
|
||||
private:
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& ashape);
|
||||
|
||||
protected:
|
||||
|
||||
TopoDS_Shape myshape; //!< shape to display
|
||||
Bnd_Box myBB; //!< cached bounding box of the shape
|
||||
gp_Pnt2d myUVOrigin; //!< UV origin vector for generating texture coordinates
|
||||
gp_Pnt2d myUVRepeat; //!< UV repeat vector for generating texture coordinates
|
||||
gp_Pnt2d myUVScale; //!< UV scale vector for generating texture coordinates
|
||||
Standard_Real myInitAng;
|
||||
Standard_Boolean myCompBB; //!< if TRUE, then bounding box should be recomputed
|
||||
TopoDS_Shape myshape;
|
||||
Bnd_Box myBB;
|
||||
Standard_Boolean myCompBB;
|
||||
|
||||
private:
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& ashape);
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myInitAng;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -52,8 +52,11 @@ AIS_TexturedShape::AIS_TexturedShape (const TopoDS_Shape& theShape)
|
||||
myPredefTexture (Graphic3d_NameOfTexture2D(0)),
|
||||
myToMapTexture (Standard_True),
|
||||
myModulate (Standard_True),
|
||||
myUVOrigin (0.0, 0.0),
|
||||
myIsCustomOrigin (Standard_True),
|
||||
myUVRepeat (1.0, 1.0),
|
||||
myToRepeat (Standard_True),
|
||||
myUVScale (1.0, 1.0),
|
||||
myToScale (Standard_True),
|
||||
myToShowTriangles (Standard_False)
|
||||
{
|
||||
|
@@ -196,8 +196,11 @@ protected: //! @name texture mapping properties
|
||||
|
||||
Standard_Boolean myToMapTexture;
|
||||
Standard_Boolean myModulate;
|
||||
gp_Pnt2d myUVOrigin;
|
||||
Standard_Boolean myIsCustomOrigin;
|
||||
gp_Pnt2d myUVRepeat;
|
||||
Standard_Boolean myToRepeat;
|
||||
gp_Pnt2d myUVScale;
|
||||
Standard_Boolean myToScale;
|
||||
Standard_Boolean myToShowTriangles;
|
||||
|
||||
|
@@ -128,7 +128,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
const Handle(Prs3d_Presentation)& aPresentation,
|
||||
const Standard_Integer aMode)
|
||||
{
|
||||
switch (aMode)
|
||||
switch (aMode)
|
||||
{
|
||||
case 0:
|
||||
const TColgp_Array1OfPnt& nodes = myTriangulation->Nodes(); //Nodes
|
||||
@@ -203,7 +203,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aP
|
||||
|
||||
//=======================================================================
|
||||
//function : ComputeSelection
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Triangulation::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
|
||||
const Standard_Integer /*aMode*/)
|
||||
@@ -238,7 +238,7 @@ Handle(TColStd_HArray1OfInteger) AIS_Triangulation::GetColors() const
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTriangulation
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTriangulation)
|
||||
{
|
||||
@@ -247,7 +247,7 @@ void AIS_Triangulation::SetTriangulation(const Handle(Poly_Triangulation)& aTria
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTriangulation
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
|
||||
return myTriangulation;
|
||||
@@ -255,19 +255,25 @@ Handle(Poly_Triangulation) AIS_Triangulation::GetTriangulation() const{
|
||||
|
||||
//=======================================================================
|
||||
//function : AttenuateColor
|
||||
//purpose :
|
||||
//purpose : Attenuates 32-bit color by a given attenuation factor (0...1):
|
||||
// aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
// All color components are multiplied by aComponent, the result is then packed again as 32-bit integer.
|
||||
// Color attenuation is applied to the vertex colors in order to have correct visual result
|
||||
// after glColorMaterial(GL_AMBIENT_AND_DIFFUSE). Without it, colors look unnatural and flat.
|
||||
//=======================================================================
|
||||
|
||||
Graphic3d_Vec4ub AIS_Triangulation::attenuateColor (const Standard_Integer theColor,
|
||||
const Standard_Real theComposition)
|
||||
{
|
||||
const Standard_Byte* anRgbx = reinterpret_cast<const Standard_Byte*> (&theColor);
|
||||
|
||||
const Graphic3d_Vec4ub& aColor = *reinterpret_cast<const Graphic3d_Vec4ub*> (&theColor);
|
||||
// If IsTranparent() is false alpha value will be ignored anyway.
|
||||
Standard_Byte anAlpha = IsTransparent() ? static_cast<Standard_Byte> (255.0 - myDrawer->ShadingAspect()->Aspect()->FrontMaterial().Transparency() * 255.0)
|
||||
: 255;
|
||||
|
||||
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * anRgbx[0]),
|
||||
(Standard_Byte)(theComposition * anRgbx[1]),
|
||||
(Standard_Byte)(theComposition * anRgbx[2]),
|
||||
return Graphic3d_Vec4ub ((Standard_Byte)(theComposition * aColor.r()),
|
||||
(Standard_Byte)(theComposition * aColor.g()),
|
||||
(Standard_Byte)(theComposition * aColor.b()),
|
||||
anAlpha);
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include <AdvApp2Var_Data_f2c.hxx>
|
||||
#include <AdvApp2Var_MathBase.hxx>
|
||||
#include <AdvApp2Var_Data.hxx>
|
||||
#include <NCollection_Array1.hxx>
|
||||
|
||||
// statics
|
||||
static
|
||||
@@ -121,11 +120,11 @@ int mmdrvcb_(integer *ideriv,
|
||||
|
||||
static
|
||||
int mmexthi_(integer *ndegre,
|
||||
NCollection_Array1<doublereal>& hwgaus);
|
||||
doublereal *hwgaus);
|
||||
|
||||
static
|
||||
int mmextrl_(integer *ndegre,
|
||||
NCollection_Array1<doublereal>& rootlg);
|
||||
doublereal *rootlg);
|
||||
|
||||
|
||||
|
||||
@@ -153,7 +152,7 @@ int mmpojac_(doublereal *tparam,
|
||||
integer *iordre,
|
||||
integer *ncoeff,
|
||||
integer *nderiv,
|
||||
NCollection_Array1<doublereal>& valjac,
|
||||
doublereal *valjac,
|
||||
integer *iercod);
|
||||
|
||||
static
|
||||
@@ -3765,7 +3764,7 @@ int AdvApp2Var_MathBase::mmeps1_(doublereal *epsilo)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int mmexthi_(integer *ndegre,
|
||||
NCollection_Array1<doublereal>& hwgaus)
|
||||
doublereal *hwgaus)
|
||||
|
||||
{
|
||||
/* System generated locals */
|
||||
@@ -3856,6 +3855,8 @@ int mmexthi_(integer *ndegre,
|
||||
|
||||
/************************************************************************
|
||||
*****/
|
||||
/* Parameter adjustments */
|
||||
--hwgaus;
|
||||
|
||||
/* Function Body */
|
||||
ibb = AdvApp2Var_SysBase::mnfndeb_();
|
||||
@@ -3881,7 +3882,7 @@ int mmexthi_(integer *ndegre,
|
||||
i__1 = *ndegre;
|
||||
for (ii = ideb; ii <= i__1; ++ii) {
|
||||
kpt = iadd + ii - ideb;
|
||||
hwgaus(ii) = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
|
||||
hwgaus[ii] = mlgdrtl_.hiltab[kpt + nmod2 * 465 - 1];
|
||||
/* L100: */
|
||||
}
|
||||
|
||||
@@ -3890,7 +3891,7 @@ int mmexthi_(integer *ndegre,
|
||||
|
||||
i__1 = ndeg2;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
hwgaus(ii) = hwgaus(*ndegre + 1 - ii);
|
||||
hwgaus[ii] = hwgaus[*ndegre + 1 - ii];
|
||||
/* L200: */
|
||||
}
|
||||
|
||||
@@ -3898,7 +3899,7 @@ int mmexthi_(integer *ndegre,
|
||||
/* associated Gauss weights are loaded. */
|
||||
|
||||
if (nmod2 == 1) {
|
||||
hwgaus(ndeg2 + 1) = mlgdrtl_.hi0tab[ndeg2];
|
||||
hwgaus[ndeg2 + 1] = mlgdrtl_.hi0tab[ndeg2];
|
||||
}
|
||||
|
||||
/* --------------------------- The end ----------------------------------
|
||||
@@ -3915,7 +3916,7 @@ int mmexthi_(integer *ndegre,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int mmextrl_(integer *ndegre,
|
||||
NCollection_Array1<doublereal>& rootlg)
|
||||
doublereal *rootlg)
|
||||
{
|
||||
/* System generated locals */
|
||||
integer i__1;
|
||||
@@ -4001,6 +4002,8 @@ int mmextrl_(integer *ndegre,
|
||||
|
||||
/************************************************************************
|
||||
*****/
|
||||
/* Parameter adjustments */
|
||||
--rootlg;
|
||||
|
||||
/* Function Body */
|
||||
ibb = AdvApp2Var_SysBase::mnfndeb_();
|
||||
@@ -4026,7 +4029,7 @@ int mmextrl_(integer *ndegre,
|
||||
i__1 = *ndegre;
|
||||
for (ii = ideb; ii <= i__1; ++ii) {
|
||||
kpt = iadd + ii - ideb;
|
||||
rootlg(ii) = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
|
||||
rootlg[ii] = mlgdrtl_.rootab[kpt + nmod2 * 465 - 1];
|
||||
/* L100: */
|
||||
}
|
||||
|
||||
@@ -4037,14 +4040,14 @@ int mmextrl_(integer *ndegre,
|
||||
|
||||
i__1 = ndeg2;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
rootlg(ii) = -rootlg(*ndegre + 1 - ii);
|
||||
rootlg[ii] = -rootlg[*ndegre + 1 - ii];
|
||||
/* L200: */
|
||||
}
|
||||
|
||||
/* Case NDEGRE uneven, 0 is root of Legendre polynom. */
|
||||
|
||||
if (nmod2 == 1) {
|
||||
rootlg(ndeg2 + 1) = 0.;
|
||||
rootlg[ndeg2 + 1] = 0.;
|
||||
}
|
||||
|
||||
/* -------------------------------- THE END -----------------------------
|
||||
@@ -6587,8 +6590,7 @@ L9900:
|
||||
integer valbas_dim1, i__1;
|
||||
|
||||
/* Local variables */
|
||||
doublereal vjacc[80], herm[24];
|
||||
NCollection_Array1<doublereal> vjac (vjacc[0], 1, 80);
|
||||
doublereal vjac[80], herm[24];
|
||||
integer iord[2];
|
||||
doublereal wval[4];
|
||||
integer nwcof, iunit;
|
||||
@@ -6783,7 +6785,7 @@ L9900:
|
||||
|
||||
i__1 = kk1;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
valbas[ii + iorjac] = wval[0] * vjac(ii);
|
||||
valbas[ii + iorjac] = wval[0] * vjac[ii - 1];
|
||||
}
|
||||
|
||||
/* (3) Evaluation of order 1 */
|
||||
@@ -6799,8 +6801,8 @@ L9900:
|
||||
|
||||
i__1 = kk1;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac(ii + kk1)
|
||||
+ wval[1] * vjac(ii);
|
||||
valbas[ii + iorjac + valbas_dim1] = wval[0] * vjac[ii + kk1 - 1]
|
||||
+ wval[1] * vjac[ii - 1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6816,9 +6818,9 @@ L9900:
|
||||
|
||||
i__1 = kk1;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac(ii +
|
||||
kk2) + wval[1] * 2 * vjac(ii + kk1) + wval[2] *
|
||||
vjac(ii);
|
||||
valbas[ii + iorjac + (valbas_dim1 << 1)] = wval[0] * vjac[ii +
|
||||
kk2 - 1] + wval[1] * 2 * vjac[ii + kk1 - 1] + wval[2] *
|
||||
vjac[ii - 1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6834,9 +6836,9 @@ L9900:
|
||||
|
||||
i__1 = kk1;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac(ii + kk3)
|
||||
+ wval[1] * 3 * vjac(ii + kk2) + wval[2] * 3 *
|
||||
vjac(ii + kk1) + wval[3] * vjac(ii);
|
||||
valbas[ii + iorjac + valbas_dim1 * 3] = wval[0] * vjac[ii + kk3 -
|
||||
1] + wval[1] * 3 * vjac[ii + kk2 - 1] + wval[2] * 3 *
|
||||
vjac[ii + kk1 - 1] + wval[3] * vjac[ii - 1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7090,7 +7092,7 @@ int mmpojac_(doublereal *tparam,
|
||||
integer *iordre,
|
||||
integer *ncoeff,
|
||||
integer *nderiv,
|
||||
NCollection_Array1<doublereal>& valjac,
|
||||
doublereal *valjac,
|
||||
integer *iercod)
|
||||
|
||||
{
|
||||
@@ -7165,6 +7167,7 @@ int mmpojac_(doublereal *tparam,
|
||||
|
||||
/* Parameter adjustments */
|
||||
valjac_dim1 = *ncoeff;
|
||||
--valjac;
|
||||
|
||||
/* Function Body */
|
||||
|
||||
@@ -7210,21 +7213,21 @@ int mmpojac_(doublereal *tparam,
|
||||
|
||||
/* --- Trivial Positions ----- */
|
||||
|
||||
valjac(1) = 1.;
|
||||
valjac[1] = 1.;
|
||||
aux1 = (doublereal) (*iordre + 1);
|
||||
valjac(2) = aux1 * *tparam;
|
||||
valjac[2] = aux1 * *tparam;
|
||||
|
||||
if (*nderiv >= 1) {
|
||||
valjac(valjac_dim1 + 1) = 0.;
|
||||
valjac(valjac_dim1 + 2) = aux1;
|
||||
valjac[valjac_dim1 + 1] = 0.;
|
||||
valjac[valjac_dim1 + 2] = aux1;
|
||||
|
||||
if (*nderiv >= 2) {
|
||||
valjac((valjac_dim1 << 1) + 1) = 0.;
|
||||
valjac((valjac_dim1 << 1) + 2) = 0.;
|
||||
valjac[(valjac_dim1 << 1) + 1] = 0.;
|
||||
valjac[(valjac_dim1 << 1) + 2] = 0.;
|
||||
|
||||
if (*nderiv >= 3) {
|
||||
valjac(valjac_dim1 * 3 + 1) = 0.;
|
||||
valjac(valjac_dim1 * 3 + 2) = 0.;
|
||||
valjac[valjac_dim1 * 3 + 1] = 0.;
|
||||
valjac[valjac_dim1 * 3 + 2] = 0.;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7244,26 +7247,26 @@ int mmpojac_(doublereal *tparam,
|
||||
denom = 1. / denom;
|
||||
|
||||
/* --> Pi(t) */
|
||||
valjac(ii) = (cofa * *tparam * valjac(kk1) + cofb * valjac(kk2)) *
|
||||
valjac[ii] = (cofa * *tparam * valjac[kk1] + cofb * valjac[kk2]) *
|
||||
denom;
|
||||
/* --> P'i(t) */
|
||||
if (*nderiv >= 1) {
|
||||
valjac(ii + valjac_dim1) = (cofa * *tparam * valjac(kk1 +
|
||||
valjac_dim1) + cofa * valjac(kk1) + cofb * valjac(kk2 +
|
||||
valjac_dim1)) * denom;
|
||||
valjac[ii + valjac_dim1] = (cofa * *tparam * valjac[kk1 +
|
||||
valjac_dim1] + cofa * valjac[kk1] + cofb * valjac[kk2 +
|
||||
valjac_dim1]) * denom;
|
||||
/* --> P''i(t) */
|
||||
if (*nderiv >= 2) {
|
||||
valjac(ii + (valjac_dim1 << 1)) = (cofa * *tparam * valjac(
|
||||
kk1 + (valjac_dim1 << 1)) + cofa * 2 * valjac(kk1 +
|
||||
valjac_dim1) + cofb * valjac(kk2 + (valjac_dim1 << 1))
|
||||
valjac[ii + (valjac_dim1 << 1)] = (cofa * *tparam * valjac[
|
||||
kk1 + (valjac_dim1 << 1)] + cofa * 2 * valjac[kk1 +
|
||||
valjac_dim1] + cofb * valjac[kk2 + (valjac_dim1 << 1)]
|
||||
) * denom;
|
||||
}
|
||||
/* --> P'i(t) */
|
||||
if (*nderiv >= 3) {
|
||||
valjac(ii + valjac_dim1 * 3) = (cofa * *tparam * valjac(kk1 +
|
||||
valjac_dim1 * 3) + cofa * 3 * valjac(kk1 + (
|
||||
valjac_dim1 << 1)) + cofb * valjac(kk2 + valjac_dim1 *
|
||||
3)) * denom;
|
||||
valjac[ii + valjac_dim1 * 3] = (cofa * *tparam * valjac[kk1 +
|
||||
valjac_dim1 * 3] + cofa * 3 * valjac[kk1 + (
|
||||
valjac_dim1 << 1)] + cofb * valjac[kk2 + valjac_dim1 *
|
||||
3]) * denom;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7274,8 +7277,8 @@ int mmpojac_(doublereal *tparam,
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
i__2 = *nderiv;
|
||||
for (jj = 0; jj <= i__2; ++jj) {
|
||||
valjac(ii + jj * valjac_dim1) = tnorm[ii - 1] * valjac(ii + jj *
|
||||
valjac_dim1);
|
||||
valjac[ii + jj * valjac_dim1] = tnorm[ii - 1] * valjac[ii + jj *
|
||||
valjac_dim1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10655,8 +10658,7 @@ int mvgaus0_(integer *kindic,
|
||||
integer i__1;
|
||||
|
||||
/* Local variables */
|
||||
doublereal tampc[40];
|
||||
NCollection_Array1<doublereal> tamp (tampc[0], 1, 40);
|
||||
doublereal tamp[40];
|
||||
integer ndegl, kg, ii;
|
||||
|
||||
/* **********************************************************************
|
||||
@@ -10749,7 +10751,7 @@ int mvgaus0_(integer *kindic,
|
||||
mmextrl_(&ndegl, tamp);
|
||||
i__1 = *nbrval;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
urootl[ii] = -tamp(ii);
|
||||
urootl[ii] = -tamp[ii - 1];
|
||||
/* L100: */
|
||||
}
|
||||
|
||||
@@ -10760,7 +10762,7 @@ int mvgaus0_(integer *kindic,
|
||||
mmexthi_(&ndegl, tamp);
|
||||
i__1 = *nbrval;
|
||||
for (ii = 1; ii <= i__1; ++ii) {
|
||||
hiltab[ii] = tamp(ii);
|
||||
hiltab[ii] = tamp[ii - 1];
|
||||
/* L200: */
|
||||
}
|
||||
|
||||
|
@@ -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))
|
||||
{
|
||||
|
@@ -3248,8 +3248,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
const Standard_Boolean UpdatePCurve,
|
||||
const Standard_Boolean enlargeU,
|
||||
const Standard_Boolean enlargeVfirst,
|
||||
const Standard_Boolean enlargeVlast,
|
||||
const Standard_Boolean UseInfini)
|
||||
const Standard_Boolean enlargeVlast)
|
||||
{
|
||||
//---------------------------
|
||||
// extension de la geometrie.
|
||||
@@ -3271,20 +3270,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
|
||||
}
|
||||
|
||||
S->Bounds (US1,US2,VS1,VS2);
|
||||
if (UseInfini)
|
||||
{
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Real FaceDU = UF2 - UF1;
|
||||
Standard_Real FaceDV = VF2 - VF1;
|
||||
UU1 = UF1 - FaceDU;
|
||||
UU2 = UF2 + FaceDU;
|
||||
VV1 = VF1 - FaceDV;
|
||||
VV2 = VF2 + FaceDV;
|
||||
}
|
||||
UU1 = VV1 = - TheInfini;
|
||||
UU2 = VV2 = TheInfini;
|
||||
|
||||
if (CanExtentSurface) {
|
||||
SurfaceChange = EnlargeGeometry( S, UU1, UU2, VV1, VV2, isVV1degen, isVV2degen, UF1, UF2, VF1, VF2,
|
||||
@@ -4161,4 +4148,4 @@ void PerformPlanes(const TopoDS_Face& theFace1,
|
||||
Standard_Boolean IsInf(const Standard_Real theVal)
|
||||
{
|
||||
return (theVal > TheInfini*0.9);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user