mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
958afe98a1 |
@@ -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
|
||||
|
@@ -1406,7 +1406,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^)
|
||||
|
@@ -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";
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
@@ -104,14 +104,7 @@ public:
|
||||
//! if <UpdatePCurve> is TRUE, update the pcurves of the
|
||||
//! edges of <F> on the new surface.if the surface has been changed,
|
||||
//! Returns True if The Surface of <NF> has changed.
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F,
|
||||
TopoDS_Face& NF,
|
||||
const Standard_Boolean ChangeGeom,
|
||||
const Standard_Boolean UpDatePCurve = Standard_False,
|
||||
const Standard_Boolean enlargeU = Standard_True,
|
||||
const Standard_Boolean enlargeVfirst = Standard_True,
|
||||
const Standard_Boolean enlargeVlast = Standard_True,
|
||||
const Standard_Boolean UseInfini = Standard_True);
|
||||
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
|
||||
|
||||
Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);
|
||||
|
||||
|
@@ -1,780 +0,0 @@
|
||||
// Created on: 2012-08-06
|
||||
// Created by: jgv@ROLEX
|
||||
// Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <BRepOffsetAPI_PatchFaces.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
#include <BRepTopAdaptor_TopolTool.hxx>
|
||||
#include <LocalAnalysis_SurfaceContinuity.hxx>
|
||||
#include <TopOpeBRepTool_TOOL.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepLib_MakeVertex.hxx>
|
||||
#include <BRepLib_MakeEdge.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <IntTools_Context.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BRepOffset_Tool.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
#include <ShapeConstruct_ProjectCurveOnSurface.hxx>
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
#include <Extrema_ExtPC.hxx>
|
||||
#include <BRepExtrema_ExtCC.hxx>
|
||||
#include <ShapeFix_Shape.hxx>
|
||||
|
||||
|
||||
static TopoDS_Edge MakeNewEdgeWithOldPcurvesOnNewSurfaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theOldFace1,
|
||||
const TopoDS_Face& theNewFace1,
|
||||
const TopoDS_Face& theOldFace2,
|
||||
const TopoDS_Face& theNewFace2)
|
||||
{
|
||||
TopoDS_Edge aNewEdge;
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Builder BB;
|
||||
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, fpar, lpar);
|
||||
aNewEdge = BRepLib_MakeEdge(aCurve, aCurve->FirstParameter(), aCurve->LastParameter()); //???
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
|
||||
Standard_Real Etol = BRep_Tool::Tolerance(theEdge);
|
||||
Handle(Geom2d_Curve) aPCurve1 = BRep_Tool::CurveOnSurface(theEdge, theOldFace1, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, aPCurve1, theNewFace1, Etol);
|
||||
Handle(Geom2d_Curve) aPCurve2 = BRep_Tool::CurveOnSurface(theEdge, theOldFace2, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, aPCurve2, theNewFace2, Etol);
|
||||
|
||||
return aNewEdge;
|
||||
}
|
||||
|
||||
static void UpdateEdgeByProjectionOfPCurve(TopoDS_Edge& anEdge,
|
||||
const TopoDS_Face& aNewFace,
|
||||
const TopoDS_Face& aBoundedNewFace)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
Standard_Real fpar, lpar;
|
||||
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge,fpar,lpar);
|
||||
|
||||
Handle(Geom_Surface) NewSurf = BRep_Tool::Surface(aNewFace);
|
||||
Handle(ShapeAnalysis_Surface) SAS = new ShapeAnalysis_Surface(NewSurf);
|
||||
ShapeConstruct_ProjectCurveOnSurface aToolProj;
|
||||
aToolProj.Init(SAS, Precision::Confusion());
|
||||
Handle(Geom2d_Curve) NewPCurve;
|
||||
aToolProj.Perform(aCurve,fpar,lpar,NewPCurve);
|
||||
Standard_Real TolReached = SAS->Gap();
|
||||
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
|
||||
BB.UpdateEdge(anEdge, NewPCurve, aBoundedNewFace, TolReached);
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(anEdge, V1, V2);
|
||||
BB.UpdateVertex(V1, TolReached);
|
||||
BB.UpdateVertex(V2, TolReached);
|
||||
}
|
||||
|
||||
static void ProjectVertexOnNewEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theNewEdge,
|
||||
Standard_Real& theParam,
|
||||
gp_Pnt& thePnt,
|
||||
Standard_Real& theTolReached)
|
||||
{
|
||||
Standard_Real ParamOnEdge = BRep_Tool::Parameter(theVertex, theEdge);
|
||||
BRepAdaptor_Curve BAcurve(theEdge);
|
||||
BRepAdaptor_Curve BAnewcurve(theNewEdge);
|
||||
gp_Pnt PointOnEdge = BAcurve.Value(ParamOnEdge);
|
||||
Extrema_ExtPC Projector(PointOnEdge, BAnewcurve);
|
||||
Standard_Real Param[4], dist[4];
|
||||
gp_Pnt Pnt[4];
|
||||
Param[1] = BAnewcurve.FirstParameter();
|
||||
Param[2] = BAnewcurve.LastParameter();
|
||||
Projector.TrimmedSquareDistances(dist[1], dist[2], Pnt[1], Pnt[2]);
|
||||
dist[3] = RealLast();
|
||||
if (Projector.IsDone() && Projector.NbExt() > 0)
|
||||
{
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer i = 2; i <= Projector.NbExt(); i++)
|
||||
if (Projector.SquareDistance(i) < Projector.SquareDistance(imin))
|
||||
imin = i;
|
||||
Param[3] = Projector.Point(imin).Parameter();
|
||||
dist[3] = Projector.SquareDistance(imin);
|
||||
Pnt[3] = Projector.Point(imin).Value();
|
||||
}
|
||||
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer i = 2; i <= 3; i++)
|
||||
if (dist[i] < dist[imin])
|
||||
imin = i;
|
||||
|
||||
theParam = Param[imin];
|
||||
thePnt = Pnt[imin];
|
||||
theTolReached = sqrt(dist[imin]);
|
||||
}
|
||||
|
||||
static TopoDS_Edge GetGeneratedEdge(const TopoDS_Edge& anEdge,
|
||||
const TopoDS_Face& aFace,
|
||||
const TopoDS_Face& aNewFace)
|
||||
{
|
||||
TopoDS_Edge aNewEdge;
|
||||
|
||||
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
|
||||
TopExp_Explorer ExploNew(aNewFace, TopAbs_EDGE);
|
||||
for (; Explo.More(); Explo.Next(),ExploNew.Next())
|
||||
{
|
||||
const TopoDS_Shape& EdgeInFace = Explo.Current();
|
||||
//const TopoDS_Shape& EdgeInNewFace = ExploNew.Current();
|
||||
if (anEdge == EdgeInFace)
|
||||
{
|
||||
aNewEdge = TopoDS::Edge(ExploNew.Current());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
BRep_Builder BB;
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
return aNewEdge;
|
||||
}
|
||||
|
||||
static TopAbs_Orientation OrientationInEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Edge& theEdge)
|
||||
{
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(theEdge, V1, V2);
|
||||
if (theVertex.IsSame(V1))
|
||||
return TopAbs_FORWARD;
|
||||
|
||||
return TopAbs_REVERSED;
|
||||
}
|
||||
|
||||
static Standard_Boolean EdgeContains(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Vertex& theVertex)
|
||||
{
|
||||
TopoDS_Iterator ite(theEdge);
|
||||
for (; ite.More(); ite.Next())
|
||||
if (theVertex.IsSame(ite.Value()))
|
||||
return Standard_True;
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
static Standard_Boolean IsTangentFaces(const TopoDS_Edge& theEdge,
|
||||
const TopoDS_Face& theFace1,
|
||||
const TopoDS_Face& theFace2,
|
||||
const GeomAbs_Shape Order)
|
||||
{
|
||||
if (Order == GeomAbs_G1 &&
|
||||
BRep_Tool::Continuity( theEdge, theFace1, theFace2 ) != GeomAbs_C0)
|
||||
return Standard_True;
|
||||
|
||||
Standard_Real TolC0 = Max(0.001, 1.5*BRep_Tool::Tolerance(theEdge));
|
||||
|
||||
Standard_Real aFirst;
|
||||
Standard_Real aLast;
|
||||
|
||||
// Obtaining of pcurves of edge on two faces.
|
||||
const Handle(Geom2d_Curve) aC2d1 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace1, aFirst, aLast);
|
||||
const Handle(Geom2d_Curve) aC2d2 = BRep_Tool::CurveOnSurface
|
||||
(theEdge, theFace2, aFirst, aLast);
|
||||
if (aC2d1.IsNull() || aC2d2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// Obtaining of two surfaces from adjacent faces.
|
||||
Handle(Geom_Surface) aSurf1 = BRep_Tool::Surface(theFace1);
|
||||
Handle(Geom_Surface) aSurf2 = BRep_Tool::Surface(theFace2);
|
||||
|
||||
if (aSurf1.IsNull() || aSurf2.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// Computation of the number of samples on the edge.
|
||||
BRepAdaptor_Surface aBAS1(theFace1);
|
||||
BRepAdaptor_Surface aBAS2(theFace2);
|
||||
Handle(BRepAdaptor_HSurface) aBAHS1 = new BRepAdaptor_HSurface(aBAS1);
|
||||
Handle(BRepAdaptor_HSurface) aBAHS2 = new BRepAdaptor_HSurface(aBAS2);
|
||||
Handle(BRepTopAdaptor_TopolTool) aTool1 = new BRepTopAdaptor_TopolTool(aBAHS1);
|
||||
Handle(BRepTopAdaptor_TopolTool) aTool2 = new BRepTopAdaptor_TopolTool(aBAHS2);
|
||||
Standard_Integer aNbSamples1 = aTool1->NbSamples();
|
||||
Standard_Integer aNbSamples2 = aTool2->NbSamples();
|
||||
const Standard_Integer aNbSamplesMax = 23;
|
||||
Standard_Integer aNbSamples = Min(aNbSamplesMax, Max(aNbSamples1, aNbSamples2));
|
||||
const Standard_Real aTolAngle = M_PI/18;
|
||||
|
||||
|
||||
// Computation of the continuity.
|
||||
Standard_Real aPar;
|
||||
Standard_Real aDelta = (aLast - aFirst)/(aNbSamples - 1);
|
||||
Standard_Integer i, nbNotDone = 0;
|
||||
|
||||
for (i = 1, aPar = aFirst; i <= aNbSamples; i++, aPar += aDelta) {
|
||||
if (i == aNbSamples) aPar = aLast;
|
||||
|
||||
LocalAnalysis_SurfaceContinuity aCont(aC2d1, aC2d2, aPar,
|
||||
aSurf1, aSurf2, Order,
|
||||
0.001, TolC0, aTolAngle, 0.1, 0.1);
|
||||
if (!aCont.IsDone())
|
||||
{
|
||||
nbNotDone++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Order == GeomAbs_G1)
|
||||
{
|
||||
if (!aCont.IsG1())
|
||||
return Standard_False;
|
||||
}
|
||||
else if (!aCont.IsG2())
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
if (nbNotDone == aNbSamples)
|
||||
return Standard_False;
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepOffsetAPI_PatchFaces
|
||||
//purpose : Constructor
|
||||
//=======================================================================
|
||||
|
||||
BRepOffsetAPI_PatchFaces::BRepOffsetAPI_PatchFaces(const TopoDS_Shape& theShape)
|
||||
{
|
||||
myInitialShape = theShape;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetOffsetFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BRepOffsetAPI_PatchFaces::AddPatchFace(const TopoDS_Face& theFace,
|
||||
const TopoDS_Face& thePatchFace)
|
||||
{
|
||||
// Check the orientation of the patch face and make
|
||||
// it oriented the same way as original
|
||||
TopoDS_Face aFace = TopoDS::Face(theFace.Oriented(TopAbs_FORWARD));
|
||||
TopoDS_Face aPatchFace = TopoDS::Face(thePatchFace.Oriented(TopAbs_FORWARD));
|
||||
|
||||
Handle(IntTools_Context) aCtx = new IntTools_Context;
|
||||
Standard_Boolean bToReverse = BOPTools_AlgoTools::IsSplitToReverse(aFace, aPatchFace, aCtx);
|
||||
TopoDS_Face anOrientedPatchFace = bToReverse ? TopoDS::Face(aPatchFace.Reversed()) : aPatchFace;
|
||||
myFacePatchFace.Add(aFace, anOrientedPatchFace);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Build
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::Build()
|
||||
{
|
||||
TopExp::MapShapesAndUniqueAncestors(myInitialShape, TopAbs_EDGE, TopAbs_FACE, myEFmap);
|
||||
|
||||
//Draft filling of <myFaceNewFace>
|
||||
for (Standard_Integer i = 1; i <= myFacePatchFace.Extent(); i++)
|
||||
{
|
||||
const TopoDS_Face& aFace = TopoDS::Face(myFacePatchFace.FindKey(i));
|
||||
const TopoDS_Shape& aPatchFace = myFacePatchFace(i);
|
||||
myFaceNewFace.Add(aFace, aPatchFace);
|
||||
TopExp_Explorer Explo(aFace, TopAbs_EDGE);
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
const TopoDS_Edge& anEdge = TopoDS::Edge(Explo.Current());
|
||||
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
|
||||
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
|
||||
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
|
||||
if (myFacePatchFace.Contains(aNeighborFace))
|
||||
continue;
|
||||
if (myFaceNewFace.Contains(aNeighborFace))
|
||||
continue;
|
||||
Standard_Boolean IsTangentEdge = IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1);
|
||||
if (IsTangentEdge)
|
||||
{
|
||||
myTangentEdges.Add(anEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
aNeighborFace.Orientation(TopAbs_FORWARD);
|
||||
TopoDS_Face aNewFace;
|
||||
BRepOffset_Tool::EnLargeFace(aNeighborFace, aNewFace,
|
||||
Standard_True,Standard_True,Standard_True,Standard_True,Standard_True,
|
||||
Standard_False); //not too big
|
||||
myFaceNewFace.Add(aNeighborFace, aNewFace);
|
||||
}
|
||||
}
|
||||
|
||||
//Make draft intersection edges: draft filling of <myEdgeNewEdge>
|
||||
BRep_Builder BB;
|
||||
TopTools_MapOfShape UpdatedConstEdges;
|
||||
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
|
||||
TopoDS_Face aNewFace = TopoDS::Face(myFaceNewFace(i));
|
||||
TopoDS_Face aBoundedNewFace;
|
||||
if (myNewFaceBoundedFace.IsBound(aNewFace))
|
||||
aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
|
||||
else
|
||||
{
|
||||
aBoundedNewFace = TopoDS::Face(aNewFace.EmptyCopied());
|
||||
myNewFaceBoundedFace.Bind(aNewFace, aBoundedNewFace);
|
||||
}
|
||||
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
|
||||
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
|
||||
BRepTools_WireExplorer wexp(F_Wire, aFace);
|
||||
for (; wexp.More(); wexp.Next())
|
||||
{
|
||||
TopoDS_Edge anEdge = wexp.Current();
|
||||
Standard_Boolean ToReverse = Standard_False;
|
||||
TopoDS_Edge aNewEdge;
|
||||
if (myEdgeNewEdge.IsBound(anEdge))
|
||||
//aNewEdge = TopoDS::Edge(myEdgeNewEdge(anEdge));
|
||||
continue;
|
||||
|
||||
Handle(Geom2d_Curve) NullPCurve;
|
||||
Standard_Real fpar, lpar;
|
||||
|
||||
const TopTools_ListOfShape& Lfaces = myEFmap.FindFromKey(anEdge);
|
||||
if (Lfaces.Extent() == 1) //seam edge
|
||||
{
|
||||
cout<<endl<<"Seam edge or degenerated edge !!!"<<endl;
|
||||
TopoDS_Edge GeneratedEdge = GetGeneratedEdge(anEdge, aFace, aNewFace);
|
||||
myOrientedEdgeNewEdge.Bind(anEdge, GeneratedEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
TopoDS_Face aNeighborFace = (aFace.IsSame(Lfaces.First()))?
|
||||
TopoDS::Face(Lfaces.Last()) : TopoDS::Face(Lfaces.First());
|
||||
|
||||
if (myTangentEdges.Contains(anEdge)&&
|
||||
!UpdatedConstEdges.Contains(anEdge)) //project onto patch
|
||||
{
|
||||
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
|
||||
|
||||
//aNewEdge = anEdge;
|
||||
UpdatedConstEdges.Add(anEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (myFaceNewFace.Contains(aNeighborFace))//intersect
|
||||
{
|
||||
TopoDS_Face aNewNeighborFace = TopoDS::Face(myFaceNewFace.FindFromKey(aNeighborFace));
|
||||
TopoDS_Face aBoundedNewNeighborFace;
|
||||
if (myNewFaceBoundedFace.IsBound(aNewNeighborFace))
|
||||
aBoundedNewNeighborFace = TopoDS::Face(myNewFaceBoundedFace(aNewNeighborFace));
|
||||
else
|
||||
{
|
||||
aBoundedNewNeighborFace = TopoDS::Face(aNewNeighborFace.EmptyCopied());
|
||||
myNewFaceBoundedFace.Bind(aNewNeighborFace, aBoundedNewNeighborFace);
|
||||
}
|
||||
|
||||
if (!myFacePatchFace.Contains(aFace) &&
|
||||
!myFacePatchFace.Contains(aNeighborFace) &&
|
||||
IsTangentFaces(anEdge, aFace, aNeighborFace, GeomAbs_G1)) //smooth edge
|
||||
{
|
||||
//make new edge with pcurves on new surfaces
|
||||
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
|
||||
aFace, aBoundedNewFace,
|
||||
aNeighborFace, aBoundedNewNeighborFace);
|
||||
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
|
||||
continue;
|
||||
}
|
||||
|
||||
BRepLib::BuildCurves3d(aNewFace);
|
||||
BRepLib::BuildCurves3d(aNewNeighborFace);
|
||||
|
||||
BRepAlgoAPI_Section SecBuilder(aNewFace, aNewNeighborFace, Standard_False);
|
||||
SecBuilder.Approximation(Standard_True);
|
||||
SecBuilder.ComputePCurveOn1(Standard_True);
|
||||
SecBuilder.ComputePCurveOn2(Standard_True);
|
||||
SecBuilder.Build();
|
||||
TopoDS_Shape aSection = SecBuilder.Shape();
|
||||
Standard_Boolean Success = Standard_True;
|
||||
TopExp_Explorer ExpSec(aSection, TopAbs_EDGE);
|
||||
if (ExpSec.More())
|
||||
aNewEdge = TopoDS::Edge(ExpSec.Current());
|
||||
else //no intersection
|
||||
{
|
||||
cout<<endl<<"No intersecion => smooth edge"<<endl;
|
||||
Success = Standard_False;
|
||||
}
|
||||
ExpSec.Next();
|
||||
if (ExpSec.More())
|
||||
{
|
||||
cout<<endl<<"More than one intersecion => smooth edge"<<endl;
|
||||
Success = Standard_False;
|
||||
}
|
||||
if (!Success) //a smooth edge with bigger angle
|
||||
{
|
||||
if (myFacePatchFace.Contains(aFace)) //project onto patch
|
||||
{
|
||||
UpdateEdgeByProjectionOfPCurve(anEdge, aNewFace, aBoundedNewFace);
|
||||
|
||||
//Remove neighbor face from <myFaceNewFace>
|
||||
myFaceNewFace.RemoveKey(aNeighborFace);
|
||||
|
||||
myTangentEdges.Add(anEdge);
|
||||
UpdatedConstEdges.Add(anEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
aNewEdge = MakeNewEdgeWithOldPcurvesOnNewSurfaces(anEdge,
|
||||
aFace, aBoundedNewFace,
|
||||
aNeighborFace, aBoundedNewNeighborFace);
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD), aNewEdge);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopExp::Vertices(aNewEdge, V1, V2);
|
||||
aNewEdge.Free(Standard_True);
|
||||
BB.Remove(aNewEdge, V1);
|
||||
BB.Remove(aNewEdge, V2);
|
||||
aNewEdge.Orientation(TopAbs_FORWARD);
|
||||
|
||||
//Make pcurves on new surfaces
|
||||
Handle(Geom2d_Curve) PCurve1 = BRep_Tool::CurveOnSurface(aNewEdge, aNewFace, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, NullPCurve, aNewFace, 0.);
|
||||
BB.UpdateEdge(aNewEdge, PCurve1, aBoundedNewFace, 0.);
|
||||
Handle(Geom2d_Curve) PCurve2 = BRep_Tool::CurveOnSurface(aNewEdge, aNewNeighborFace, fpar, lpar);
|
||||
BB.UpdateEdge(aNewEdge, NullPCurve, aNewNeighborFace, 0.);
|
||||
BB.UpdateEdge(aNewEdge, PCurve2, aBoundedNewNeighborFace, 0.);
|
||||
|
||||
//Check orientation of new edge
|
||||
BRepAdaptor_Curve BAcurve(anEdge);
|
||||
BRepAdaptor_Curve BAnewcurve(aNewEdge);
|
||||
gp_Pnt FirstPnt, FirstNewPnt;
|
||||
gp_Vec DirOnCurve, DirOnNewCurve;
|
||||
BAcurve.D1(BAcurve.FirstParameter(), FirstPnt, DirOnCurve);
|
||||
Standard_Real ParamOnNewEdge = BAnewcurve.FirstParameter();
|
||||
Extrema_ExtPC Projector(FirstPnt, BAnewcurve);
|
||||
if (!Projector.IsDone() || Projector.NbExt() == 0)
|
||||
{
|
||||
cout<<endl<<"Define orientation of new edge: extrema point-curve is not done"<<endl;
|
||||
}
|
||||
if (Projector.IsDone() && Projector.NbExt() > 0)
|
||||
{
|
||||
Standard_Integer indmin = 1;
|
||||
for (Standard_Integer ind = 2; ind <= Projector.NbExt(); ind++)
|
||||
if (Projector.SquareDistance(ind) < Projector.SquareDistance(indmin))
|
||||
indmin = ind;
|
||||
ParamOnNewEdge = Projector.Point(indmin).Parameter();
|
||||
}
|
||||
BAnewcurve.D1(ParamOnNewEdge, FirstNewPnt, DirOnNewCurve);
|
||||
Standard_Real ScalProd = DirOnCurve * DirOnNewCurve;
|
||||
if (ScalProd < 0.)
|
||||
ToReverse = Standard_True;
|
||||
|
||||
myEdgeNewEdge.Bind(anEdge.Oriented(TopAbs_FORWARD),
|
||||
(ToReverse)? aNewEdge.Oriented(TopAbs_REVERSED) : aNewEdge);
|
||||
} //intersect
|
||||
else //borders on constant face: change surface of pcurve on existing edge
|
||||
{
|
||||
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(anEdge, aFace, fpar, lpar);
|
||||
//BB.UpdateEdge(anEdge, NullPCurve, aFace, 0.);
|
||||
BB.UpdateEdge(anEdge, aPCurve, aBoundedNewFace, 0.);
|
||||
|
||||
aNewEdge = anEdge;
|
||||
}
|
||||
} //for (; wexp.More(); wexp.Next())
|
||||
} //for (; itf.More(); itf.Next())
|
||||
} //for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
|
||||
//Intersect edges and make new wires
|
||||
for (Standard_Integer i = 1; i <= myFaceNewFace.Extent(); i++)
|
||||
{
|
||||
TopoDS_Face aFace = TopoDS::Face(myFaceNewFace.FindKey(i));
|
||||
TopoDS_Shape aNewFace = myFaceNewFace(i);
|
||||
TopoDS_Face aBoundedNewFace = TopoDS::Face(myNewFaceBoundedFace(aNewFace));
|
||||
|
||||
TopoDS_Iterator itf(aFace);
|
||||
for (; itf.More(); itf.Next())
|
||||
{
|
||||
const TopoDS_Wire& aWire = TopoDS::Wire(itf.Value());
|
||||
TopAbs_Orientation aWireOr = aWire.Orientation();
|
||||
|
||||
TopoDS_Wire aNewWire;
|
||||
BB.MakeWire(aNewWire);
|
||||
|
||||
TopoDS_Wire F_Wire = TopoDS::Wire(aWire.Oriented(TopAbs_FORWARD));
|
||||
BRepTools_WireExplorer wexp(F_Wire, aFace);
|
||||
TopoDS_Vertex CurVertex = wexp.CurrentVertex();
|
||||
TopoDS_Edge FirstEdge = wexp.Current();
|
||||
TopoDS_Edge FirstNewEdge = FirstEdge;
|
||||
if (myOrientedEdgeNewEdge.IsBound(FirstEdge))
|
||||
FirstNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(FirstEdge));
|
||||
else if (myEdgeNewEdge.IsBound(FirstEdge))
|
||||
FirstNewEdge = TopoDS::Edge(myEdgeNewEdge(FirstEdge));
|
||||
TopoDS_Edge CurEdge, PrevEdge = FirstEdge;
|
||||
TopoDS_Edge CurNewEdge, PrevNewEdge = FirstNewEdge;
|
||||
wexp.Next();
|
||||
if (!wexp.More() && //only one edge in wire
|
||||
!myVertexNewVertex.IsBound(CurVertex))
|
||||
{
|
||||
TopoDS_Vertex CurNewVertex;
|
||||
if (myVertexNewVertex.IsBound(CurVertex))
|
||||
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(CurVertex));
|
||||
|
||||
if (myEdgeNewEdge.IsBound(FirstEdge))//new edge: update
|
||||
{
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Tool::Range(FirstEdge, fpar, lpar);
|
||||
BB.Range(FirstNewEdge, fpar, lpar);
|
||||
BRepAdaptor_Curve BAcurve(FirstNewEdge);
|
||||
gp_Pnt FirstPnt = BAcurve.Value(BAcurve.FirstParameter());
|
||||
if (CurNewVertex.IsNull())
|
||||
CurNewVertex = BRepLib_MakeVertex(FirstPnt);
|
||||
BB.Add(FirstNewEdge, CurNewVertex);
|
||||
BB.Add(FirstNewEdge, CurNewVertex.Oriented(TopAbs_REVERSED));
|
||||
myVertexNewVertex.Bind(CurVertex, CurNewVertex);
|
||||
}
|
||||
}
|
||||
for (; wexp.More(); wexp.Next())
|
||||
{
|
||||
CurEdge = wexp.Current();
|
||||
if (myOrientedEdgeNewEdge.IsBound(CurEdge))
|
||||
CurNewEdge = TopoDS::Edge(myOrientedEdgeNewEdge(CurEdge));
|
||||
else if (myEdgeNewEdge.IsBound(CurEdge))
|
||||
CurNewEdge = TopoDS::Edge(myEdgeNewEdge(CurEdge));
|
||||
else
|
||||
CurNewEdge = CurEdge;
|
||||
CurVertex = wexp.CurrentVertex();
|
||||
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
|
||||
CurEdge, CurNewEdge,
|
||||
CurVertex);
|
||||
if (!PrevEdge.IsSame(PrevNewEdge) &&
|
||||
PrevEdge.Orientation() == TopAbs_REVERSED)
|
||||
PrevNewEdge.Reverse();
|
||||
BB.Add(aNewWire, PrevNewEdge);
|
||||
|
||||
PrevEdge = CurEdge;
|
||||
PrevNewEdge = CurNewEdge;
|
||||
}
|
||||
CurEdge = FirstEdge;
|
||||
CurNewEdge = FirstNewEdge;
|
||||
CurVertex = wexp.CurrentVertex();
|
||||
UpdateEdgesAndVertex(PrevEdge, PrevNewEdge,
|
||||
CurEdge, CurNewEdge,
|
||||
CurVertex);
|
||||
if (!PrevEdge.IsSame(PrevNewEdge) &&
|
||||
PrevEdge.Orientation() == TopAbs_REVERSED)
|
||||
PrevNewEdge.Reverse();
|
||||
BB.Add(aNewWire, PrevNewEdge);
|
||||
|
||||
aNewWire.Orientation(aWireOr);
|
||||
BB.Add(aBoundedNewFace, aNewWire);
|
||||
} //for (; itf.More(); itf.Next()) (iterator on face)
|
||||
}
|
||||
|
||||
//Assemble resulting shape
|
||||
TopoDS_Solid aSolid;
|
||||
BB.MakeSolid(aSolid);
|
||||
TopoDS_Shell aShell;
|
||||
BB.MakeShell(aShell);
|
||||
TopExp_Explorer Explo(myInitialShape, TopAbs_FACE);
|
||||
for (; Explo.More(); Explo.Next())
|
||||
{
|
||||
const TopoDS_Shape& aFace = Explo.Current();
|
||||
TopoDS_Shape aBoundedNewFace;
|
||||
if (myFaceNewFace.Contains(aFace))
|
||||
{
|
||||
const TopoDS_Shape& aNewFace = myFaceNewFace.FindFromKey(aFace);
|
||||
aBoundedNewFace = myNewFaceBoundedFace(aNewFace);
|
||||
if (aFace.Orientation() == TopAbs_REVERSED)
|
||||
aBoundedNewFace.Reverse();
|
||||
}
|
||||
else
|
||||
aBoundedNewFace = aFace;
|
||||
BB.Add(aShell, aBoundedNewFace);
|
||||
}
|
||||
BB.Add(aSolid, aShell);
|
||||
|
||||
ShapeFix_Shape Fixer(aSolid);
|
||||
Fixer.Perform();
|
||||
|
||||
myShape = Fixer.Shape();
|
||||
//myShape = aSolid;
|
||||
|
||||
Done();
|
||||
}
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
|
||||
TopoDS_Edge& thePrevNewEdge,
|
||||
const TopoDS_Edge& theCurEdge,
|
||||
TopoDS_Edge& theCurNewEdge,
|
||||
TopoDS_Vertex& theCurVertex)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
|
||||
TopoDS_Vertex CurNewVertex;
|
||||
if (myVertexNewVertex.IsBound(theCurVertex))
|
||||
CurNewVertex = TopoDS::Vertex(myVertexNewVertex(theCurVertex));
|
||||
else
|
||||
{
|
||||
Standard_Boolean IsConstVertex = (!(myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
|
||||
!(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge)));
|
||||
if (IsConstVertex)
|
||||
CurNewVertex = theCurVertex;
|
||||
}
|
||||
|
||||
Standard_Boolean IsSeamPrev = (myOrientedEdgeNewEdge.IsBound(thePrevEdge));
|
||||
Standard_Boolean IsSeamCur = (myOrientedEdgeNewEdge.IsBound(theCurEdge));
|
||||
|
||||
if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) &&
|
||||
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //two new edges: intersect
|
||||
{
|
||||
Standard_Real ParamOnPrev, ParamOnCur, TolProj;
|
||||
gp_Pnt PntOnPrev, PntOnCur;
|
||||
ProjectVertexOnNewEdge(theCurVertex, thePrevEdge, thePrevNewEdge,
|
||||
ParamOnPrev, PntOnPrev, TolProj);
|
||||
ProjectVertexOnNewEdge(theCurVertex, theCurEdge, theCurNewEdge,
|
||||
ParamOnCur, PntOnCur, TolProj);
|
||||
|
||||
Standard_Real TolReached;
|
||||
gp_Pnt PntVtx = (CurNewVertex.IsNull())?
|
||||
BRep_Tool::Pnt(theCurVertex) : BRep_Tool::Pnt(CurNewVertex);
|
||||
TolReached = PntOnPrev.Distance(PntOnCur);
|
||||
Standard_Real DistVtoPrev = PntVtx.Distance(PntOnPrev);
|
||||
Standard_Real DistVtoCur = PntVtx.Distance(PntOnCur);
|
||||
TolReached = Max(TolReached, DistVtoPrev);
|
||||
TolReached = Max(TolReached, DistVtoCur);
|
||||
|
||||
BRepExtrema_ExtCC ExtrEE(thePrevNewEdge, theCurNewEdge);
|
||||
if (!ExtrEE.IsDone() || ExtrEE.NbExt() == 0)
|
||||
{
|
||||
cout<<endl<<"Extrema EE is not done"<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Integer imin = 1;
|
||||
for (Standard_Integer iext = 2; iext <= ExtrEE.NbExt(); iext++)
|
||||
if (ExtrEE.SquareDistance(iext) < ExtrEE.SquareDistance(imin))
|
||||
imin = iext;
|
||||
Standard_Real TolEE = sqrt(ExtrEE.SquareDistance(imin));
|
||||
gp_Pnt PntOnE1 = ExtrEE.PointOnE1(imin);
|
||||
gp_Pnt PntOnE2 = ExtrEE.PointOnE2(imin);
|
||||
Standard_Real DistVtoE1 = PntVtx.Distance(PntOnE1);
|
||||
Standard_Real DistVtoE2 = PntVtx.Distance(PntOnE2);
|
||||
TolEE = Max(TolEE, DistVtoE1);
|
||||
TolEE = Max(TolEE, DistVtoE2);
|
||||
if (TolEE < TolReached)
|
||||
{
|
||||
TolReached = TolEE;
|
||||
PntOnPrev = PntOnE1;
|
||||
PntOnCur = PntOnE2;
|
||||
ParamOnPrev = ExtrEE.ParameterOnE1(imin);
|
||||
ParamOnCur = ExtrEE.ParameterOnE2(imin);
|
||||
}
|
||||
}
|
||||
if (CurNewVertex.IsNull())
|
||||
{
|
||||
gp_Pnt NewPnt((PntOnPrev.XYZ() + PntOnCur.XYZ())/2);
|
||||
CurNewVertex = BRepLib_MakeVertex(NewPnt);
|
||||
myVertexNewVertex.Bind(theCurVertex, CurNewVertex);
|
||||
}
|
||||
BB.UpdateVertex(CurNewVertex, TolReached);
|
||||
if (!EdgeContains(thePrevNewEdge, CurNewVertex))
|
||||
{
|
||||
if (IsSeamCur)
|
||||
ParamOnPrev = RealLast();
|
||||
PutVertexToEdge(CurNewVertex, theCurVertex, thePrevNewEdge, thePrevEdge, ParamOnPrev);
|
||||
}
|
||||
|
||||
if (!EdgeContains(theCurNewEdge, CurNewVertex))
|
||||
{
|
||||
if (IsSeamPrev)
|
||||
ParamOnCur = RealLast();
|
||||
PutVertexToEdge(CurNewVertex, theCurVertex, theCurNewEdge, theCurEdge, ParamOnCur);
|
||||
}
|
||||
} //two new edges: intersect
|
||||
else if ((myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge)) ||
|
||||
(myEdgeNewEdge.IsBound(theCurEdge) || myOrientedEdgeNewEdge.IsBound(theCurEdge))) //one constant edge: project point onto curve
|
||||
{
|
||||
TopoDS_Edge ConstantEdge, ModifiedEdge, NewEdge;
|
||||
Standard_Boolean IsAdjacentSeam;
|
||||
if (myEdgeNewEdge.IsBound(thePrevEdge) || myOrientedEdgeNewEdge.IsBound(thePrevEdge))
|
||||
{
|
||||
ConstantEdge = theCurEdge;
|
||||
ModifiedEdge = thePrevEdge;
|
||||
NewEdge = thePrevNewEdge;
|
||||
IsAdjacentSeam = IsSeamCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConstantEdge = thePrevEdge;
|
||||
ModifiedEdge = theCurEdge;
|
||||
NewEdge = theCurNewEdge;
|
||||
IsAdjacentSeam = IsSeamPrev;
|
||||
}
|
||||
|
||||
Standard_Real ParamOnNewEdge, TolReached;
|
||||
gp_Pnt PntOnNewEdge;
|
||||
ProjectVertexOnNewEdge(theCurVertex, ModifiedEdge, NewEdge,
|
||||
ParamOnNewEdge, PntOnNewEdge, TolReached);
|
||||
BB.UpdateVertex(theCurVertex, TolReached);
|
||||
|
||||
if (!EdgeContains(NewEdge, theCurVertex))
|
||||
PutVertexToEdge(theCurVertex, theCurVertex, NewEdge, ModifiedEdge, ParamOnNewEdge);
|
||||
} //else (one constant edge: project point onto curve)
|
||||
else //two constant edges
|
||||
{
|
||||
//nothing ?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BRepOffsetAPI_PatchFaces::PutVertexToEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Vertex& theProVertex,
|
||||
TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theProEdge,
|
||||
const Standard_Real theParamOnEdge)
|
||||
{
|
||||
BRep_Builder BB;
|
||||
|
||||
TopAbs_Orientation anOr = OrientationInEdge(theProVertex, theProEdge);
|
||||
if (myEdgeNewEdge.IsBound(theProEdge) &&
|
||||
myEdgeNewEdge(theProEdge).Orientation() == TopAbs_REVERSED)
|
||||
anOr = TopAbs::Reverse(anOr);
|
||||
|
||||
TopoDS_Shape F_Edge = theEdge.Oriented(TopAbs_FORWARD);
|
||||
F_Edge.Free(Standard_True);
|
||||
BB.Add(F_Edge, theVertex.Oriented(anOr));
|
||||
if (!Precision::IsInfinite(theParamOnEdge))
|
||||
{
|
||||
Standard_Real fpar, lpar;
|
||||
BRep_Tool::Range(theEdge, fpar, lpar);
|
||||
if (anOr == TopAbs_FORWARD)
|
||||
BB.Range(theEdge, theParamOnEdge, lpar);
|
||||
else
|
||||
BB.Range(theEdge, fpar, theParamOnEdge);
|
||||
}
|
||||
}
|
@@ -1,99 +0,0 @@
|
||||
// Created on: 2012-08-06
|
||||
// Created by: jgv@ROLEX
|
||||
// Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
#define _BRepOffsetAPI_PatchFaces_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeShape.hxx>
|
||||
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <TopTools_DataMapOfOrientedShapeShape.hxx>
|
||||
#include <TopTools_MapOfShape.hxx>
|
||||
#include <BRepBuilderAPI_MakeShape.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! Describes functions to replace some faces in a shape
|
||||
//! by patches
|
||||
class BRepOffsetAPI_PatchFaces : public BRepBuilderAPI_MakeShape
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! General constructor.
|
||||
Standard_EXPORT BRepOffsetAPI_PatchFaces(const TopoDS_Shape& aShape);
|
||||
|
||||
//! Adds the patch face for the face in the shape.
|
||||
Standard_EXPORT void AddPatchFace (const TopoDS_Face& theFace, const TopoDS_Face& thePatchFace);
|
||||
|
||||
Standard_EXPORT virtual void Build() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void UpdateEdgesAndVertex(const TopoDS_Edge& thePrevEdge,
|
||||
TopoDS_Edge& thePrevNewEdge,
|
||||
const TopoDS_Edge& theCurEdge,
|
||||
TopoDS_Edge& theCurNewEdge,
|
||||
TopoDS_Vertex& theCurVertex);
|
||||
|
||||
Standard_EXPORT void PutVertexToEdge(const TopoDS_Vertex& theVertex,
|
||||
const TopoDS_Vertex& theProVertex,
|
||||
TopoDS_Edge& theEdge,
|
||||
const TopoDS_Edge& theProEdge,
|
||||
const Standard_Real theParamOnEdge);
|
||||
|
||||
|
||||
TopoDS_Shape myInitialShape;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeShape myFacePatchFace;
|
||||
TopTools_IndexedDataMapOfShapeShape myFaceNewFace;
|
||||
TopTools_DataMapOfShapeShape myNewFaceBoundedFace;
|
||||
TopTools_DataMapOfShapeShape myEdgeNewEdge;
|
||||
TopTools_DataMapOfOrientedShapeShape myOrientedEdgeNewEdge;
|
||||
TopTools_DataMapOfShapeShape myVertexNewVertex;
|
||||
TopTools_MapOfShape myTangentEdges;
|
||||
|
||||
TopTools_IndexedDataMapOfShapeListOfShape myEFmap;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepOffsetAPI_PatchFaces_HeaderFile
|
@@ -62,8 +62,6 @@
|
||||
#include <DBRep_DrawableShape.hxx>
|
||||
#include <BRepTest.hxx>
|
||||
|
||||
#include <BRepOffsetAPI_PatchFaces.hxx>
|
||||
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <ChFi3d_FilletShape.hxx>
|
||||
|
||||
@@ -2288,36 +2286,6 @@ static Standard_Integer ComputeSimpleOffset(Draw_Interpretor& theCommands,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : patchfaces
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Integer patchfaces(Draw_Interpretor& /*di*/,
|
||||
Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n < 5) return 1;
|
||||
|
||||
TopoDS_Shape aShape = DBRep::Get(a[2]);
|
||||
if (aShape.IsNull()) return 1;
|
||||
|
||||
TopoDS_Shape aLocalFace = DBRep::Get(a[3], TopAbs_FACE);
|
||||
if (aLocalFace.IsNull()) return 1;
|
||||
TopoDS_Face aFace = TopoDS::Face(aLocalFace);
|
||||
|
||||
TopoDS_Shape aLocalNewFace = DBRep::Get(a[4], TopAbs_FACE);
|
||||
if (aLocalNewFace.IsNull()) return 1;
|
||||
TopoDS_Face aNewFace = TopoDS::Face(aLocalNewFace);
|
||||
|
||||
BRepOffsetAPI_PatchFaces Builder(aShape);
|
||||
Builder.AddPatchFace(aFace, aNewFace);
|
||||
Builder.Build();
|
||||
|
||||
TopoDS_Shape Result = Builder.Shape();
|
||||
DBRep::Set(a[1], Result);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FeatureCommands
|
||||
//purpose :
|
||||
@@ -2466,7 +2434,4 @@ void BRepTest::FeatureCommands (Draw_Interpretor& theCommands)
|
||||
theCommands.Add("offsetshapesimple",
|
||||
"offsetshapesimple result shape offsetvalue [solid]",
|
||||
__FILE__, ComputeSimpleOffset);
|
||||
|
||||
theCommands.Add("patchfaces", "patchfaces res shape face newface",
|
||||
__FILE__,patchfaces,g);
|
||||
}
|
||||
|
@@ -106,8 +106,6 @@ void BinLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)& theDo
|
||||
myDrivers = AttributeDrivers (myMsgDriver);
|
||||
Handle(TDF_Data) aData = aDoc->GetData();
|
||||
FirstPass (aData->Root());
|
||||
if(aDoc->EmptyLabelsSavingMode())
|
||||
myEmptyLabels.Clear(); //
|
||||
|
||||
// 1. Write info section (including types table)
|
||||
WriteInfoSection (aDoc, theOStream);
|
||||
|
@@ -839,8 +839,11 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
|
||||
}
|
||||
|
||||
aFirstCurveType = curve->DynamicType();
|
||||
const gp_Pnt2d aPoint(asecondpoint->Pnt2d());
|
||||
(void )aPoint;
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Pnt2d Point(asecondpoint->Pnt2d());
|
||||
#else
|
||||
asecondpoint->Pnt2d();
|
||||
#endif
|
||||
if (aFirstCurveType == STANDARD_TYPE(Geom2d_Circle)) {
|
||||
cas = 1;
|
||||
Handle(Geom2d_Circle) C1 = Handle(Geom2d_Circle)::DownCast(curve);
|
||||
|
@@ -1074,7 +1074,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T,
|
||||
}
|
||||
|
||||
// allocate the arrays
|
||||
TColStd_Array1OfInteger Free (1, Max (1, 2 * nFree));
|
||||
TColStd_Array1OfInteger Free(1,2*nFree);
|
||||
|
||||
// array is replaced on map because it is impossible
|
||||
// to calculate number of internal edges in advance
|
||||
|
@@ -13,11 +13,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// ---------------------
|
||||
// ---------------------
|
||||
|
||||
// Version: 0.0
|
||||
// Version Date Purpose
|
||||
// 0.0 Feb 10 1997 Creation
|
||||
// Version: 0.0
|
||||
//Version Date Purpose
|
||||
// 0.0 Feb 10 1997 Creation
|
||||
|
||||
|
||||
#include <DDF.hxx>
|
||||
@@ -64,11 +64,11 @@
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_Children (Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
{
|
||||
if (n < 2) return 1;
|
||||
|
||||
|
||||
Handle(TDF_Data) DF;
|
||||
TCollection_AsciiString entry;
|
||||
|
||||
@@ -97,11 +97,11 @@ static Standard_Integer DDF_Children (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
{
|
||||
if (n != 3) return 1;
|
||||
|
||||
|
||||
Handle(TDF_Data) DF;
|
||||
|
||||
if (!DDF::GetDF (a[1], DF)) return 1;
|
||||
@@ -124,11 +124,11 @@ static Standard_Integer DDF_Attributes (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
{
|
||||
if (n != 3) return 1;
|
||||
|
||||
|
||||
Handle(TDF_Data) DF;
|
||||
|
||||
if (!DDF::GetDF (a[1], DF)) return 1;
|
||||
@@ -137,35 +137,11 @@ static Standard_Integer DDF_ForgetAll(Draw_Interpretor& /*di*/,
|
||||
TDF_Tool::Label(DF,a[2],label);
|
||||
if (label.IsNull()) return 1;
|
||||
label.ForgetAllAttributes();
|
||||
//POP pour NT
|
||||
//POP pour NT
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ForgetAttribute
|
||||
//purpose : "ForgetAtt dfname Label guid"
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_ForgetAttribute(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
{
|
||||
if (n != 4) return 1;
|
||||
Handle(TDF_Data) DF;
|
||||
if (!DDF::GetDF (a[1], DF)) return 1;
|
||||
|
||||
TDF_Label aLabel;
|
||||
TDF_Tool::Label(DF,a[2],aLabel);
|
||||
if (aLabel.IsNull()) return 1;
|
||||
if (!Standard_GUID::CheckGUIDFormat(a[3]))
|
||||
{
|
||||
di<<"DDF: The format of GUID is invalid\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_GUID guid(a[3]);
|
||||
aLabel.ForgetAttribute(guid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// save/restore & Store/Retrieve commands
|
||||
@@ -233,8 +209,8 @@ void ErrorMessage (const Storage_Error n)
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
{
|
||||
if (nb == 3) {
|
||||
Handle(TDF_Data) DF;
|
||||
@@ -256,8 +232,8 @@ static Standard_Integer DDF_SetTagger (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
{
|
||||
if (nb == 3) {
|
||||
Handle(TDF_Data) DF;
|
||||
@@ -278,8 +254,8 @@ static Standard_Integer DDF_NewTag (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDF_NewChild (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
{
|
||||
Handle(TDF_Data) DF;
|
||||
if (nb>=2){
|
||||
@@ -338,38 +314,35 @@ void DDF::BasicCommands (Draw_Interpretor& theCommands)
|
||||
|
||||
const char* g = "DF basic commands";
|
||||
|
||||
// Label :
|
||||
// Label :
|
||||
|
||||
theCommands.Add ("SetTagger",
|
||||
"SetTagger (DF, entry)",
|
||||
__FILE__, DDF_SetTagger, g);
|
||||
__FILE__, DDF_SetTagger, g);
|
||||
|
||||
theCommands.Add ("NewTag",
|
||||
"NewTag (DF, tagger)",
|
||||
__FILE__, DDF_NewTag, g);
|
||||
__FILE__, DDF_NewTag, g);
|
||||
|
||||
theCommands.Add ("NewChild",
|
||||
"NewChild (DF, [tagger])",
|
||||
__FILE__, DDF_NewChild, g);
|
||||
__FILE__, DDF_NewChild, g);
|
||||
|
||||
theCommands.Add ("Children",
|
||||
" Returns the list of label children: Children DF label",
|
||||
__FILE__, DDF_Children, g);
|
||||
" Returns the list of label children: Children DF label",
|
||||
__FILE__, DDF_Children, g);
|
||||
|
||||
theCommands.Add ("Attributes",
|
||||
" Returns the list of label attributes: Attributes DF label",
|
||||
__FILE__, DDF_Attributes, g);
|
||||
" Returns the list of label attributes: Attributes DF label",
|
||||
__FILE__, DDF_Attributes, g);
|
||||
|
||||
theCommands.Add ("ForgetAll",
|
||||
"Forgets all attributes from the label: ForgetAll DF Label",
|
||||
__FILE__, DDF_ForgetAll, g);
|
||||
|
||||
theCommands.Add ("ForgetAtt",
|
||||
"Forgets the specified by guid attribute from the label: ForgetAtt DF Label guid",
|
||||
__FILE__, DDF_ForgetAttribute, g);
|
||||
"Forgets all attributes from the label: ForgetAll DF Label",
|
||||
__FILE__, DDF_ForgetAll, g);
|
||||
|
||||
theCommands.Add ("Label",
|
||||
"Label DF entry",
|
||||
__FILE__, DDF_Label, g);
|
||||
"Label DF entry",
|
||||
__FILE__, DDF_Label, g);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -232,17 +232,17 @@ static Standard_Integer DDocStd_Save (Draw_Interpretor& di,
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** a)
|
||||
{
|
||||
Standard_Integer nb,
|
||||
const char** a)
|
||||
{
|
||||
if (nb >= 3) {
|
||||
Handle(TDocStd_Document) D;
|
||||
if (!DDocStd::GetDocument(a[1],D)) return 1;
|
||||
TCollection_ExtendedString path (a[2]);
|
||||
Handle(TDocStd_Application) A = DDocStd::GetApplication();
|
||||
PCDM_StoreStatus theStatus;
|
||||
|
||||
Standard_Boolean anUseStream(Standard_False), isSaveEmptyLabels(Standard_False);
|
||||
|
||||
Standard_Boolean anUseStream = Standard_False;
|
||||
for ( Standard_Integer i = 3; i < nb; i++ )
|
||||
{
|
||||
if (!strcmp (a[i], "-stream"))
|
||||
@@ -250,11 +250,9 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
di << "standard SEEKABLE stream is used\n";
|
||||
anUseStream = Standard_True;
|
||||
break;
|
||||
} else {
|
||||
isSaveEmptyLabels = ((atoi (a[3])) != 0);
|
||||
D->SetEmptyLabelsSavingMode(isSaveEmptyLabels);
|
||||
}
|
||||
}
|
||||
|
||||
if (anUseStream)
|
||||
{
|
||||
std::ofstream aFileStream;
|
||||
@@ -265,35 +263,35 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
|
||||
{
|
||||
theStatus = A->SaveAs(D,path);
|
||||
}
|
||||
|
||||
|
||||
if (theStatus != PCDM_SS_OK ) {
|
||||
switch ( theStatus ) {
|
||||
case PCDM_SS_DriverFailure: {
|
||||
di << "Error saving document: Could not store , no driver found to make it\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_WriteFailure: {
|
||||
di << "Error saving document: Write access failure\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Failure: {
|
||||
di << "Error saving document: Write failure\n" ;
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Doc_IsNull: {
|
||||
di << "Error saving document: No document to save\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_No_Obj: {
|
||||
di << "Error saving document: No objects written\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Info_Section_Error: {
|
||||
di << "Error saving document: Write info section failure\n" ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
case PCDM_SS_DriverFailure: {
|
||||
di << "Error saving document: Could not store , no driver found to make it\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_WriteFailure: {
|
||||
di << "Error saving document: Write access failure\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Failure: {
|
||||
di << "Error saving document: Write failure\n" ;
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Doc_IsNull: {
|
||||
di << "Error saving document: No document to save\n";
|
||||
break ;
|
||||
}
|
||||
case PCDM_SS_No_Obj: {
|
||||
di << "Error saving document: No objects written\n";
|
||||
break;
|
||||
}
|
||||
case PCDM_SS_Info_Section_Error: {
|
||||
di << "Error saving document: Write info section failure\n" ;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
@@ -533,7 +531,7 @@ void DDocStd::ApplicationCommands(Draw_Interpretor& theCommands)
|
||||
__FILE__, DDocStd_Open, g);
|
||||
|
||||
theCommands.Add("SaveAs",
|
||||
"SaveAs DOC path [saveEmptyLabels: 0|1] [-stream]",
|
||||
"SaveAs DOC path [-stream]",
|
||||
__FILE__, DDocStd_SaveAs, g);
|
||||
|
||||
theCommands.Add("Save",
|
||||
|
@@ -118,15 +118,13 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
|
||||
#ifdef OCCT_DEBUG
|
||||
if(!aNS1->IsEmpty()) {
|
||||
aShape1 = aNS1->Get();
|
||||
const gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
(void )aDebPoint;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
// cout << aCounter << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
} else
|
||||
cout << " Line3DDriver:: NS1 is empty" << endl;
|
||||
if(!aNS2->IsEmpty()) {
|
||||
aShape2 = aNS2->Get();
|
||||
const gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
(void )aDebPoint;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter+1 << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
} else
|
||||
cout << " Line3DDriver:: NS2 is empty" << endl;
|
||||
@@ -139,12 +137,10 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
|
||||
aShape1 = aNS1->Get();
|
||||
aShape2 = aNS2->Get();
|
||||
#ifdef OCCT_DEBUG
|
||||
const gp_Pnt aDebPoint1 = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
const gp_Pnt aDebPoint2 = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter << " X = " << aDebPoint1.X() << " Y = " << aDebPoint1.Y() << " Z = " << aDebPoint1.Z() << endl;
|
||||
// cout << aCounter+1 << " X = " << aDebPoint2.X() << " Y = " << aDebPoint2.Y() << " Z = " << aDebPoint2.Z() << endl;
|
||||
(void )aDebPoint1;
|
||||
(void )aDebPoint2;
|
||||
gp_Pnt aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape1));
|
||||
// cout << aCounter << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
aDebPoint = BRep_Tool::Pnt(TopoDS::Vertex(aShape2));
|
||||
// cout << aCounter+1 << " X = " << aDebPoint.X() << " Y = " << aDebPoint.Y() << " Z = " << aDebPoint.Z() << endl;
|
||||
#endif
|
||||
if(aShape1.ShapeType() != TopAbs_VERTEX || aShape2.ShapeType() != TopAbs_VERTEX) {
|
||||
aFunction->SetFailure(WRONG_ARGUMENT);
|
||||
|
@@ -350,11 +350,6 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
|
||||
#else
|
||||
di << "FreeImage disabled\n";
|
||||
#endif
|
||||
#ifdef HAVE_FFMPEG
|
||||
di << "FFmpeg enabled (HAVE_FFMPEG)\n";
|
||||
#else
|
||||
di << "FFmpeg disabled\n";
|
||||
#endif
|
||||
#ifdef HAVE_GLES2
|
||||
di << "OpenGL: ES2\n";
|
||||
#else
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user